@import url('https://fonts.googleapis.com/css2?family=Ubuntu:ital,wght@0,300;0,400;0,500;1,300;1,400&display=swap');

:root {
  --font: "Ubuntu", sans-serif;
  --gold:  oklch(0.78 0.12 80);

  --bg:       #f0ece3;
  --fg:       #18181a;
  --fg-soft:  #706e6a;
  --fg-faint: #b5b2ac;
}

@media (prefers-color-scheme: light) {
  :root {
    --gold: oklch(0.58 0.14 72);
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:       #0d0d0e;
    --fg:       #eeeae0;
    --fg-soft:  #9c9890;
    --fg-faint: #4a4844;
  }
}

html[data-theme="light"] {
  --bg:       #f0ece3;
  --fg:       #18181a;
  --fg-soft:  #706e6a;
  --fg-faint: #b5b2ac;
  --gold:     oklch(0.58 0.14 72);
}
html[data-theme="dark"] {
  --bg:       #0d0d0e;
  --fg:       #eeeae0;
  --fg-soft:  #9c9890;
  --fg-faint: #4a4844;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: var(--font);
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  text-transform: lowercase;
  transition: background .3s ease, color .3s ease;
}

/* ── header ─────────────────────────────────────────────────── */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 48px;
  background: color-mix(in oklab, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.brand {
  font-size: 21px;
  font-weight: 400;
  letter-spacing: 0.01em;
  color: var(--fg-soft);
  text-decoration: none;
  transition: color .2s ease;
}
.brand:hover { color: var(--fg); }

.nav {
  display: flex;
  align-items: center;
  gap: 20px;
}

.theme-toggle {
  appearance: none;
  background: transparent;
  border: none;
  color: var(--fg-faint);
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: color .2s ease;
}
.theme-toggle:hover { color: var(--fg-soft); }

.theme-icon {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.theme-icon-sun  { display: block; }
.theme-icon-moon { display: none;  }

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .theme-icon-sun  { display: none;  }
  html:not([data-theme="light"]) .theme-icon-moon { display: block; }
}
html[data-theme="dark"]  .theme-icon-sun  { display: none;  }
html[data-theme="dark"]  .theme-icon-moon { display: block; }
html[data-theme="light"] .theme-icon-sun  { display: block; }
html[data-theme="light"] .theme-icon-moon { display: none;  }

.contact {
  font-size: 14px;
  font-weight: 300;
  letter-spacing: 0.04em;
  color: var(--fg-faint);
  text-decoration: none;
  text-underline-offset: 3px;
  transition: color .2s ease;
}
.contact:hover {
  color: var(--fg-soft);
  text-decoration: underline;
  text-decoration-thickness: 1px;
}

/* ── main / poem ─────────────────────────────────────────────── */
.main {
  max-width: 580px;
  margin: 0 auto;
  padding: 128px 40px 152px;
  position: relative;
}

.seam {
  position: absolute;
  left: 8px;
  top: 0;
  width: 24px;
  pointer-events: none;
  overflow: hidden;
}

#seam-path {
  fill: none;
  stroke: var(--gold);
  stroke-width: 0.4;
  stroke-linecap: round;
  filter: drop-shadow(0 0 3px var(--gold));
}

.stanza {
  margin: 0 0 44px;
  padding-left: 48px;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .85s ease, transform .85s ease;
}
.stanza.is-in {
  opacity: 1;
  transform: none;
}

.line {
  font-size: clamp(15px, 1.6vw, 19px);
  line-height: 1.65;
  font-weight: 400;
  margin: 0 0 4px;
  color: var(--fg);
  text-wrap: pretty;
}
.line.is-final {
  font-style: italic;
  font-weight: 400;
  color: var(--gold);
}

/* ── footer ──────────────────────────────────────────────────── */
.footer {
  display: flex;
  justify-content: center;
  padding: 36px 48px 52px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .85s ease, transform .85s ease;
}
.footer.is-in {
  opacity: 1;
  transform: none;
}

.footer-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-style: italic;
  letter-spacing: 0.01em;
  color: var(--fg-faint);
}

.logo-mark {
  display: block;
  width: 20px;
  height: 12.5px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.55;
}

/* ── responsive ──────────────────────────────────────────────── */
@media (max-width: 720px) {
  .header  { padding: 18px 24px; }
  .main    { padding: 80px 28px 96px; }
  .stanza  { margin-bottom: 52px; }
  .footer  { padding: 28px 24px 40px; }
}

@media (prefers-reduced-motion: reduce) {
  .stanza, .footer { transition: none; opacity: 1; transform: none; }
  body { scroll-behavior: auto; }
}
