/* self-hosted variable fonts — latin subset only */
@font-face {
  font-family: 'Cinzel';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('/fonts/cinzel-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('/fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg:         #e8e5dc;
  --bg-deep:    #ded9cd;
  --surface:    rgba(255, 253, 247, 0.55);
  --surface-hi: rgba(255, 253, 247, 0.85);
  --border:     rgba(60, 50, 35, 0.14);
  --border-hi:  rgba(60, 50, 35, 0.42);
  --text:       #23241f;
  --text-dim:   #6a6557;
  --text-faint: #8a8576;
  --accent:     #3a6670;
  --accent-warm:#c44536;
  --glow:       rgb(58 102 112 / 0.22);

  /* color tuples — referenced from SVG sigils via rgb(var(...) / a) */
  --ink-rgb:    40 40 35;
  --ember-rgb:  196 69 54;
  --accent-rgb: 58 102 112;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:         #1c2228;
    --bg-deep:    #161a1e;
    --surface:    rgba(220, 215, 200, 0.04);
    --surface-hi: rgba(220, 215, 200, 0.10);
    --border:     rgba(220, 215, 200, 0.10);
    --border-hi:  rgba(220, 215, 200, 0.32);
    --text:       #d4cfc1;
    --text-dim:   #8a8576;
    --text-faint: #6a665c;
    --accent:     #5a9ba8;
    --accent-warm:#d65644;
    --glow:       rgb(90 155 168 / 0.28);

    --ink-rgb:    220 215 200;
    --ember-rgb:  214 86 68;
    --accent-rgb: 90 155 168;
  }
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}
html, body { height: 100%; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, system-ui, sans-serif;
  color: var(--text);
  background: var(--bg-deep);
  min-height: 100vh;
  padding: 56px 18px 48px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  position: relative;
}
body::before {
  content: '';
  position: fixed; inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%, rgb(var(--accent-rgb) / 0.10) 0%, transparent 60%),
    radial-gradient(ellipse 70% 55% at 85% 95%, rgba(120, 100, 75, 0.10) 0%, transparent 55%),
    radial-gradient(ellipse 45% 35% at 50% 50%, rgb(var(--ember-rgb) / 0.03) 0%, transparent 55%),
    var(--bg);
  animation: drift 32s ease-in-out infinite alternate;
  z-index: -2;
}
@media (prefers-color-scheme: dark) {
  body::before {
    background:
      radial-gradient(ellipse 80% 60% at 20% 10%, rgb(var(--accent-rgb) / 0.10) 0%, transparent 60%),
      radial-gradient(ellipse 70% 55% at 85% 95%, rgba(50, 65, 85, 0.18) 0%, transparent 55%),
      radial-gradient(ellipse 45% 35% at 50% 50%, rgb(var(--ember-rgb) / 0.06) 0%, transparent 55%),
      var(--bg);
  }
}
@keyframes drift {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-2%, 1%) scale(1.04); }
}

/* static noise (cheap — data URI, no per-frame work) */
body::after {
  content: '';
  position: fixed; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.18  0 0 0 0 0.17  0 0 0 0 0.15  0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.32;
  mix-blend-mode: multiply;
  pointer-events: none;
  z-index: -1;
  /* very cheap GPU-only "breath": slow translate, no rasterization per frame */
  animation: noise-drift 80s ease-in-out infinite alternate;
  will-change: transform;
}
@media (prefers-color-scheme: dark) {
  body::after { opacity: 0.18; mix-blend-mode: screen; }
}
@keyframes noise-drift {
  0%   { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-3%, 2%, 0); }
}

main {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
}

/* staggered entrance — every direct child of main fades up in sequence */
main > * {
  opacity: 0;
  transform: translateY(8px);
  animation: enter 760ms cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
}
main > :nth-child(1)  { animation-delay: 120ms; }  /* hero */
main > :nth-child(2)  { animation-delay: 320ms; }  /* sep moored */
main > :nth-child(3)  { animation-delay: 320ms; }  /* list moored */
main > :nth-child(4)  { animation-delay: 480ms; }  /* sep deep */
main > :nth-child(5)  { animation-delay: 480ms; }  /* list deep */
main > :nth-child(6)  { animation-delay: 640ms; }  /* sep signal */
main > :nth-child(7)  { animation-delay: 640ms; }  /* list signal */
main > :nth-child(8)  { animation-delay: 820ms; }  /* whisper */
main > :nth-child(9)  { animation-delay: 980ms; }  /* details stash */
main > :nth-child(10) { animation-delay: 1140ms; } /* footer */

@keyframes enter {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* hero */
.hero { text-align: center; padding: 4px 0 16px; }
.hero h1 {
  font-family: 'Cinzel', serif;
  font-weight: 500;
  font-size: clamp(34px, 8vw, 48px);
  letter-spacing: 0.42em;
  text-indent: 0.42em;
  color: var(--text);
}
.hero .ripple {
  display: block;
  width: 64px;
  height: 16px;
  margin: 10px auto 10px;
  opacity: 0.55;
  animation: ripple-sway 7s ease-in-out infinite alternate;
  will-change: transform;
}
@keyframes ripple-sway {
  0%   { transform: translateX(-4px) scaleY(0.94); }
  50%  { transform: translateX(0)    scaleY(1.08); }
  100% { transform: translateX(4px)  scaleY(0.94); }
}
.hero .sub {
  font-family: 'Cinzel', serif;
  font-size: 12px;
  letter-spacing: 0.22em;
  text-indent: 0.22em;
  color: var(--text-dim);
  text-transform: lowercase;
}
.epigraph {
  position: relative;
  max-width: 380px;
  margin: 14px auto 0;
  text-align: center;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-dim);
  font-style: italic;
}
/* tiny accent dots tight to the text — out of inline flow so centering stays clean */
.epigraph::before,
.epigraph::after {
  content: '·';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  color: var(--accent-warm);
  font-style: normal;
  font-size: 13px;
  line-height: 1;
}
.epigraph::before { top: -10px; }
.epigraph::after  { bottom: -10px; }

/* section separator */
.sep {
  display: flex; align-items: center; gap: 12px;
  font-family: 'Cinzel', serif;
  font-size: 10px;
  letter-spacing: 0.42em;
  text-indent: 0.42em;
  color: var(--text-faint);
  text-transform: uppercase;
  margin: 24px 0 12px;
}
.sep::before, .sep::after {
  content: ''; flex: 1; height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
}

/* cards */
.list { display: flex; flex-direction: column; gap: 8px; }
a.card {
  position: relative;
  display: flex; align-items: center; gap: 14px;
  padding: 12px 14px;
  background: var(--surface);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: 12px;
  text-decoration: none;
  color: var(--text);
  touch-action: manipulation;
  transition: background 220ms ease, border-color 220ms ease, transform 220ms ease, box-shadow 220ms ease;
  overflow: hidden;
}
a.card::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgb(var(--accent-rgb) / 0.10) 0%, transparent 45%);
  opacity: 0;
  transition: opacity 220ms ease;
  pointer-events: none;
}
a.card:hover {
  background: var(--surface-hi);
  border-color: var(--border-hi);
  transform: translateY(-1px);
  box-shadow: 0 10px 26px rgba(40, 30, 15, 0.12), 0 0 0 1px var(--glow);
}
a.card:hover::before { opacity: 1; }
a.card:hover .glyph { filter: drop-shadow(0 0 8px var(--glow)); animation: glyph-breath 1400ms ease-in-out infinite; }
a.card:hover .glyph circle.ring { stroke: var(--accent); }

/* glyph breathes on card hover — strong enough to notice */
@keyframes glyph-breath {
  0%, 100% { transform: scale(1)    rotate(0deg); }
  50%      { transform: scale(1.10) rotate(-2deg); }
}

.glyph {
  flex: 0 0 36px;
  height: 36px;
  stroke-width: 1.2;
  transform-origin: center;
  transition: filter 220ms ease;
}
.glyph circle.ring { stroke: var(--text-dim); transition: stroke 220ms ease; }

.body { display: flex; flex-direction: column; min-width: 0; flex: 1; gap: 2px; }
.title { font-size: 14px; font-weight: 500; letter-spacing: 0.02em; }
.url {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.02em;
}
.note { font-size: 11px; color: var(--text-faint); margin-top: 2px; font-style: italic; }
.arrow {
  flex: 0 0 auto;
  color: var(--text-faint);
  transition: color 220ms ease, transform 220ms ease;
  font-family: 'Cinzel', serif;
}
a.card:hover .arrow { color: var(--accent); transform: translateX(3px); }

/* whisper — quiet family note */
.whisper {
  max-width: 380px;
  margin: 36px auto 0;
  text-align: center;
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 0.18em;
  line-height: 1.9;
  color: var(--text-faint);
  font-style: italic;
  opacity: 0.78;
}
.whisper span { display: block; }

/* stash — hidden in plain sight */
.stash-reveal { margin: 28px 0 0; }
.stash-reveal summary {
  list-style: none;
  cursor: pointer;
  text-align: center;
  padding: 14px 10px;
  font-family: 'Cinzel', serif;
  font-size: 18px;
  color: var(--text-faint);
  opacity: 0.22;
  letter-spacing: 0.6em;
  text-indent: 0.6em;
  user-select: none;
  animation: dots-breath 5000ms ease-in-out infinite;
  transition: opacity 260ms ease, letter-spacing 260ms ease, color 260ms ease;
}
.stash-reveal summary::-webkit-details-marker { display: none; }
.stash-reveal summary::marker { content: ""; }
.stash-reveal summary:hover {
  opacity: 0.55;
  color: var(--accent);
  animation: none;
}
.stash-reveal[open] summary {
  opacity: 0.45;
  letter-spacing: 1em;
  text-indent: 1em;
  animation: none;
}
.stash-reveal[open] .sep { margin-top: 4px; }
.stash-reveal .list { animation: stashIn 380ms ease-out; }

@keyframes dots-breath {
  0%, 100% { opacity: 0.14; letter-spacing: 0.6em; }
  50%      { opacity: 0.48; letter-spacing: 0.85em; }
}
@keyframes stashIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* footer */
footer {
  margin-top: 40px;
  text-align: center;
  font-family: 'Cinzel', serif;
  font-size: 10px;
  color: var(--text-faint);
  letter-spacing: 0.32em;
  text-indent: 0.32em;
}
footer .year::before { content: '·'; margin-right: 12px; color: var(--accent-warm); }
footer .year::after  { content: '·'; margin-left:  12px; color: var(--accent-warm); }

/* focus polish — only the keyboard outline shows, not mouse */
a.card:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 12px;
}
summary { outline: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
