/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Theme variables */
:root {
  --bg-light: #fbf4d9; /* warmer, yellowish white */
  --bg-dark: #0f0f12;
}

body.light {
  --bg: var(--bg-light);
  --text: #1a1a1a;
  --nav: #444;
  --divider: rgba(0,0,0,0.08);
}

body.dark {
  --bg: var(--bg-dark);
  --text: #e6e6e6;
  --nav: #aaa;
  --divider: rgba(255,255,255,0.06);
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: serif;
  height: 100vh;
  padding-bottom: 56px; /* reserve space for fixed footer */
}

/* Layout */
.container {
  display: flex;
  height: 100vh;
}

.sidebar {
  width: 220px;
  padding: 32px 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
  border-right: 2px solid var(--divider);
}

.sidebar a {
  text-decoration: none;
  color: var(--nav);
  font-size: 16px;
  font-weight: 600;
}

.sidebar a.active {
  color: var(--text);
}

.nyx-link {
  display: none;
}

/* Main content */
.content {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Signature */
.signature-wrap {
  width: 100%;
  max-width: 600px;
  display: flex;
  justify-content: center;
  position: relative;
}

.signature-wrap {
  position: relative;
  aspect-ratio: 2048 / 1760;
}

.signature-img {
  width: 100%;
  height: auto;
  display: block;
  position: relative;
}

/* Stack images on top of each other */
.signature-wrap {
  position: relative;
}
.signature-img {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  transition: clip-path 650ms cubic-bezier(.2,.8,.2,1);
  -webkit-transition: -webkit-clip-path 650ms cubic-bezier(.2,.8,.2,1);
  will-change: clip-path;
}
.signature-img#signatureNight {
  z-index: 1;
}
.signature-img#signatureDay {
  z-index: 2;
}

/* Center simple content like email and quotes */
.content p,
.content blockquote {
  text-align: center;
}

blockquote {
  font-style: italic;
  font-size: 1.25rem;
  max-width: 60ch;
  margin: 0;
}



/* Candle toggle */
#themeToggle {
  position: fixed;
  top: 18px;
  right: 18px;
  background: none;
  border: none;
  font-size: 28px;
  line-height: 1;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--text);
  z-index: 1200;
}

/* Reveal circle used for animated theme switching */
#reveal {
  position: fixed;
  pointer-events: none;
  border-radius: 50%;
  transform: scale(0);
  opacity: 0;
  transition: transform var(--reveal-duration, 650ms) cubic-bezier(.2,.8,.2,1),
              opacity 260ms ease;
  will-change: transform, opacity;
  z-index: 1000;
}

/* When active we scale it to full size and show */
#reveal.reveal-animate {
  transform: scale(1);
  opacity: 1;
}

/* Fade-out state to avoid jump when removing the overlay */
#reveal.reveal-fadeout {
  opacity: 0;
  transition: opacity 260ms ease;
}

/* Sidebar shake */
.sidebar.shake {
  animation: sidebar-shake 360ms ease-in-out;
}

@keyframes sidebar-shake {
  0% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
  100% { transform: translateX(0); }
}

/* Show Nyx only in dark mode */
body.dark .nyx-link {
  display: block;
}

/* Footer */
.site-footer {
  position: fixed;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  color: var(--nav);
  background: transparent;
  z-index: 1100;
}

/* Nyx quote hover morph */
.nyx-quote {
  display: inline-block;
  line-height: 1.25;
  cursor: default;
  user-select: none;
  position: relative;
  padding: 0.25rem 0;
}
.nyx-quote .layer {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  white-space: pre;
}
.nyx-quote span {
  display: inline-block;
  transition: transform 320ms cubic-bezier(.2,.8,.2,1), opacity 320ms;
  transform-origin: 50% 50%;
}

/* Idle state: current visible, target hidden */
.nyx-quote .target span {
  opacity: 0;
  transform: scale(0.96);
}

/* Animating: staggered per-letter growth for a wave effect */
.nyx-quote.animating .target span {
  opacity: 1;
  transform: scale(1.18);
  transition-delay: calc(var(--i) * 36ms);
}
.nyx-quote.animating .current span {
  opacity: 0;
  transform: scale(0.9);
  transition-delay: calc(var(--i) * 36ms);
}

/* Completed state: target fully visible */
.nyx-quote.done .target span {
  opacity: 1;
  transform: none;
  transition-delay: 0ms !important;
}
.nyx-quote.done .current { display: none; }

/* About page: Hungarian word styling and shake */
.hungarian-word {
  display: inline-block;
  font-weight: 700;
  font-size: inherit;
  font-family: inherit;
  cursor: pointer;
  margin-left: 0.25rem;
}

.shake-letters {
  display: inline-block;
  animation: letters-shake 520ms ease-in-out;
}

@keyframes letters-shake {
  0% { transform: translateY(0); }
  25% { transform: translateY(-4px) rotate(-0.8deg); }
  50% { transform: translateY(2px) rotate(0.6deg); }
  75% { transform: translateY(-2px) rotate(-0.4deg); }
  100% { transform: translateY(0); }
}

.lang-flag {
  display:inline-block;
  margin-left:0.5rem;
  cursor:pointer;
  font-size:1rem;
}

/* About content constraints */
#aboutContent {
  max-width: 64ch;
  margin: 0 auto;
  padding: 0 1rem;
  text-align: justify;
}

#aboutContent p {
  margin: 0 0 1rem 0;
  line-height: 1.5;
  font-size: 1rem;
}
