/* someplace slow — one warm light
   palette locked 12 months (Doc 05): night #0F1B2D · mid #16233A · violet #2A2450
   warm #FFB45E · glow #FFD9A0 · body #F5EDE0 · mist #7E93AD */

@font-face {
  font-family: "Fraunces";
  src: url("assets/fonts/fraunces.woff2") format("woff2");
  font-weight: 300 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("assets/fonts/inter.woff2") format("woff2");
  font-weight: 400 500;
  font-style: normal;
  font-display: swap;
}

:root {
  --night: #0f1b2d;
  --mid: #16233a;
  --violet: #2a2450;
  --warm: #ffb45e;
  --glow: #ffd9a0;
  --body: #f5ede0;
  --mist: #7e93ad;
  --display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --text: "Inter", -apple-system, "Helvetica Neue", sans-serif;
  --breath: 8s; /* a sleeper's breathing cycle */
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--text);
  font-weight: 400;
  color: var(--body);
  /* the descent: dusk violet at the top of the page, deepest night by the footer */
  background:
    linear-gradient(180deg,
      var(--violet) 0%,
      #1d2344 14%,
      var(--mid) 38%,
      #101d31 62%,
      var(--night) 100%);
  background-color: var(--night);
  font-size: 1.0625rem;
  line-height: 1.75;
  letter-spacing: 0.005em;
  -webkit-font-smoothing: antialiased;
}

/* grain — banding is the fingerprint of haste */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 40;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
}

::selection { background: rgba(255, 180, 94, 0.25); color: var(--body); }

a { color: inherit; text-decoration: none; }

:focus-visible {
  outline: 2px solid var(--glow);
  outline-offset: 4px;
  border-radius: 2px;
}

.wrap {
  max-width: 68rem;
  margin: 0 auto;
  padding: 0 clamp(1.5rem, 5vw, 3rem);
}

/* ---------- hero: the sky, and one light you can press ---------- */

.hero {
  min-height: 100svh;
  display: grid;
  place-items: center;
  text-align: center;
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, #2a2450 0%, #1e2547 30%, var(--mid) 70%, rgba(22, 35, 58, 0) 100%);
}

#stars {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.mist {
  position: absolute;
  bottom: -12vh;
  left: -30%;
  width: 160%;
  height: 34vh;
  pointer-events: none;
  background: radial-gradient(ellipse 50% 60% at 50% 60%, rgba(126, 147, 173, 0.16), rgba(126, 147, 173, 0) 70%);
  filter: blur(30px);
  animation: mist-drift 80s ease-in-out infinite alternate;
}
@keyframes mist-drift {
  from { transform: translateX(-6%); }
  to   { transform: translateX(6%); }
}

.hero-inner { position: relative; will-change: transform, opacity; }

.hero-inner { padding: 12vh 1.5rem 14vh; position: relative; }

/* the page wakes the way a story begins: one element at a time */
.hero-inner > * {
  opacity: 0;
  transform: translateY(14px);
  animation: settle 1.4s ease forwards;
}
.hero-inner .eyebrow     { animation-delay: 0.2s; }
.hero-inner .wordmark    { animation-delay: 0.55s; }
.hero-inner .descriptor  { animation-delay: 1.05s; }
.hero-inner .lede        { animation-delay: 1.45s; }
.hero-inner .cta {
  /* settle in first, then breathe forever */
  animation:
    settle 1.4s ease 1.95s both,
    breathe var(--breath) ease-in-out 3.4s infinite;
}
@keyframes settle {
  to { opacity: 1; transform: none; }
}

.eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.42em;
  color: var(--mist);
  text-transform: none;
  margin-bottom: 2.4rem;
}

.wordmark {
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(3.2rem, 11vw, 8.25rem);
  letter-spacing: 0.02em;
  line-height: 1.02;
  color: var(--body);
  text-wrap: balance;
}

.descriptor {
  margin-top: 2.2rem;
  font-size: clamp(0.95rem, 1.6vw, 1.15rem);
  letter-spacing: 0.24em;
  color: var(--mist);
}

.lede {
  max-width: 34rem;
  margin: 2.6rem auto 0;
  color: var(--body);
  opacity: 0.85;
  font-size: 1.02rem;
}

.cta {
  display: inline-block;
  margin-top: 3.6rem;
  font-family: var(--text);
  font-weight: 500;
  font-size: 0.95rem;
  letter-spacing: 0.14em;
  color: #241703;
  background: var(--warm);
  padding: 1.05rem 2.6rem;
  border-radius: 999px;
  /* light poured, not placed — layered halo */
  box-shadow:
    0 0 18px rgba(255, 180, 94, 0.35),
    0 0 55px rgba(255, 180, 94, 0.22),
    0 0 130px rgba(255, 180, 94, 0.12);
  animation: breathe var(--breath) ease-in-out infinite;
  transition: transform 0.6s ease;
}
.cta:hover { transform: translateY(-2px); }

@keyframes breathe {
  0%, 100% {
    box-shadow:
      0 0 18px rgba(255, 180, 94, 0.35),
      0 0 55px rgba(255, 180, 94, 0.22),
      0 0 130px rgba(255, 180, 94, 0.12);
  }
  50% {
    box-shadow:
      0 0 26px rgba(255, 217, 160, 0.5),
      0 0 80px rgba(255, 180, 94, 0.3),
      0 0 170px rgba(255, 180, 94, 0.16);
  }
}

.hero-hint {
  position: absolute;
  bottom: 2.2rem;
  left: 50%;
  transform: translateX(-50%);
  color: var(--mist);
  font-size: 0.78rem;
  letter-spacing: 0.3em;
  opacity: 0.7;
}

/* ---------- sections ---------- */

section { padding: clamp(6rem, 14vh, 10rem) 0; }

.section-head {
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(2rem, 4.6vw, 3.4rem);
  letter-spacing: 0.07em;
  color: var(--body);
  margin-bottom: 1.2rem;
  transition: letter-spacing 2.2s ease;
}
/* type exhales as it arrives */
.reveal.in .section-head { letter-spacing: 0.02em; }

.section-sub {
  color: var(--mist);
  max-width: 38rem;
  margin-bottom: 4rem;
}

/* ---------- the stories: a row of dark windows; only one is ever lit ---------- */

.stories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 1.6rem;
}

.story-card {
  position: relative;
  display: block;
  border: 1px solid rgba(126, 147, 173, 0.16);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(22, 35, 58, 0.65), rgba(15, 27, 45, 0.9));
  padding: 2.2rem 1.8rem 1.9rem;
  transition: border-color 0.7s ease, transform 0.7s ease;
}
.story-card:hover { border-color: rgba(126, 147, 173, 0.32); transform: translateY(-3px); }

/* the window pane */
.pane {
  width: 1.35rem;
  height: 1.7rem;
  border-radius: 3px;
  margin-bottom: 1.7rem;
  background: #1a2740;
  border: 1px solid rgba(126, 147, 173, 0.25);
  position: relative;
  transition: background 1.2s ease, box-shadow 1.2s ease;
}
.pane::before, .pane::after {
  content: "";
  position: absolute;
  background: rgba(15, 27, 45, 0.55);
}
.pane::before { left: 50%; top: 0; bottom: 0; width: 1px; }
.pane::after { top: 50%; left: 0; right: 0; height: 1px; }

.story-card.lit .pane {
  background: linear-gradient(180deg, var(--glow), var(--warm));
  border-color: rgba(255, 217, 160, 0.6);
  box-shadow:
    0 0 14px rgba(255, 180, 94, 0.45),
    0 0 44px rgba(255, 180, 94, 0.22),
    0 0 90px rgba(255, 180, 94, 0.1);
  animation: pane-flicker 7s ease-in-out infinite;
}
/* candle-quiet flicker — barely there */
@keyframes pane-flicker {
  0%, 100% { filter: brightness(1); }
  23%      { filter: brightness(0.96); }
  41%      { filter: brightness(1.05); }
  67%      { filter: brightness(0.98); }
  82%      { filter: brightness(1.03); }
}

.story-family {
  font-size: 0.72rem;
  letter-spacing: 0.3em;
  color: var(--mist);
  margin-bottom: 0.7rem;
}

.story-title {
  font-family: var(--display);
  font-weight: 400;
  font-size: 1.35rem;
  line-height: 1.3;
  color: var(--body);
  margin-bottom: 0.9rem;
  text-wrap: balance;
}

.story-note { font-size: 0.88rem; color: var(--mist); }

.story-title-link { color: inherit; text-decoration: none; }
.story-title-link:hover { color: var(--glow); }

/* platform marks: quiet by default, one warms under the hand.
   each link is a 44px touch target; the mark sits centered inside it */
.story-platforms {
  display: flex;
  gap: 0.2rem;
  margin-top: 0.8rem;
  margin-left: -0.75rem;
}
.story-platforms a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  color: var(--mist);
  opacity: 0.75;
  transition: color 0.5s ease, opacity 0.5s ease, transform 0.5s ease;
}
.story-platforms a:hover,
.story-platforms a:focus-visible {
  color: var(--glow);
  opacity: 1;
  transform: translateY(-1px);
}
.story-platforms svg { width: 20px; height: 20px; display: block; }

/* phones: marks read larger, targets stay 44px, hover glow becomes the default state
   since there is no hover on touch */
@media (max-width: 640px) {
  .story-platforms { gap: 0.45rem; }
  .story-platforms svg { width: 24px; height: 24px; }
  .story-platforms a { opacity: 0.9; }

  /* phones scroll in inches, not viewports: tighten the night between sections */
  section { padding: 4.5rem 0; }
  .postcard { min-height: 58svh; }
  .story-family { font-size: 0.78rem; }
}

/* ---------- postcard: the house gets its own viewport, drifting slower than you ---------- */

.postcard {
  padding: 0;
  min-height: 72svh;
  display: grid;
  align-items: end;
  position: relative;
  overflow: hidden;
}

.postcard-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* svg layers drift at their own depths (JS) */
#pc-far, #pc-mid, #pc-near { will-change: transform; }

.postcard::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(15, 27, 45, 0) 0%, rgba(15, 27, 45, 0) 70%, rgba(15, 27, 45, 0.6) 100%);
}

/* candlelight: an uneven waver you can actually see, over a slow breath, with the rare draft */
.pc-halo { animation: halo-candle 4.3s ease-in-out infinite; }
@keyframes halo-candle {
  0%, 100% { opacity: 0.5; }
  14%      { opacity: 0.85; }
  27%      { opacity: 0.6; }
  43%      { opacity: 0.95; }
  56%      { opacity: 0.65; }
  71%      { opacity: 0.9; }
  85%      { opacity: 0.55; }
}

/* the hot layer crossfades over the warm pane — the flame itself */
.pc-pane-hot {
  animation:
    hot-flicker 3.7s ease-in-out infinite,
    candle-draft 17s ease-in-out infinite;
}
@keyframes hot-flicker {
  0%, 100% { opacity: 0.05; }
  13%      { opacity: 0.42; }
  24%      { opacity: 0.12; }
  38%      { opacity: 0.5; }
  49%      { opacity: 0.18; }
  63%      { opacity: 0.45; }
  78%      { opacity: 0.1; }
  90%      { opacity: 0.35; }
}
/* every so often, a draft finds the flame */
@keyframes candle-draft {
  0%, 86%, 100% { filter: brightness(1); }
  90%           { filter: brightness(0.45); }
  93%           { filter: brightness(0.85); }
  96%           { filter: brightness(0.6); }
}

/* smoke from the chimney — someone kept the fire in */
.pc-puff {
  opacity: 0;
  animation: puff-rise 21s linear infinite;
}
.pc-puff:nth-child(2) { animation-delay: 7s; }
.pc-puff:nth-child(3) { animation-delay: 14s; }
@keyframes puff-rise {
  0%   { opacity: 0;    transform: translate(0, 0) scale(0.6); }
  8%   { opacity: 0.14; }
  55%  { opacity: 0.07; }
  100% { opacity: 0;    transform: translate(26px, -110px) scale(2.6); }
}

/* the scene's stars keep their own slow time */
.pc-stars circle { animation: pc-twinkle 7s ease-in-out infinite; }
.pc-stars circle:nth-child(2n)  { animation-duration: 9s;  animation-delay: 1.6s; }
.pc-stars circle:nth-child(3n)  { animation-duration: 11s; animation-delay: 3.4s; }
.pc-stars circle:nth-child(5n)  { animation-duration: 8s;  animation-delay: 5.1s; }
@keyframes pc-twinkle {
  0%, 100% { opacity: 0.18; }
  50%      { opacity: 0.55; }
}

/* mist rolling through the valley */
#pc-mist-band { animation: valley-mist 70s ease-in-out infinite alternate; }
@keyframes valley-mist {
  from { transform: translateX(-60px); }
  to   { transform: translateX(60px); }
}

.postcard-caption { position: relative; z-index: 2; }
.postcard-caption {
  text-align: center;
  padding: 3rem 1.5rem 3.6rem;
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(1.3rem, 2.6vw, 1.9rem);
  letter-spacing: 0.04em;
  color: var(--body);
  opacity: 0.92;
}

/* ---------- listen ---------- */

.listen-list { list-style: none; max-width: 44rem; }

.listen-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1.5rem;
  padding: 1.7rem 0.2rem;
  border-bottom: 1px solid rgba(126, 147, 173, 0.15);
}
.listen-row:first-child { border-top: 1px solid rgba(126, 147, 173, 0.15); }

.listen-name {
  font-family: var(--display);
  font-weight: 400;
  font-size: 1.5rem;
  color: var(--body);
  transition: color 0.6s ease, text-shadow 0.6s ease;
}
a.listen-link:hover .listen-name,
a.listen-link:focus-visible .listen-name {
  color: var(--glow);
  text-shadow: 0 0 26px rgba(255, 180, 94, 0.35);
}

.listen-note { font-size: 0.85rem; color: var(--mist); text-align: right; }

.listen-row.soon .listen-name { color: var(--mist); }

/* ---------- about ---------- */

.about-text {
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(1.25rem, 2.4vw, 1.75rem);
  line-height: 1.7;
  max-width: 46rem;
  color: var(--body);
  opacity: 0.92;
}
.about-text + .about-text { margin-top: 1.6rem; }

.tagline {
  margin-top: 3.4rem;
  font-size: 0.8rem;
  letter-spacing: 0.34em;
  color: var(--mist);
}

/* ---------- footer ---------- */

footer {
  padding: clamp(5rem, 12vh, 8rem) 0 3.2rem;
  text-align: center;
}

.goodnight {
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(1.6rem, 3.4vw, 2.5rem);
  letter-spacing: 0.03em;
  color: var(--glow);
  text-shadow: 0 0 34px rgba(255, 180, 94, 0.25);
  animation: goodnight-breathe 11s ease-in-out infinite;
}
@keyframes goodnight-breathe {
  0%, 100% { text-shadow: 0 0 34px rgba(255, 180, 94, 0.22); opacity: 0.92; }
  50%      { text-shadow: 0 0 46px rgba(255, 180, 94, 0.4);  opacity: 1; }
}

.footer-links {
  margin-top: 3.2rem;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  color: var(--mist);
}
.footer-links a { padding: 0 0.7rem; transition: color 0.5s ease; }
.footer-links a:hover { color: var(--body); }

.disclaimer {
  margin: 1.9rem auto 0;
  max-width: 34rem;
  font-size: 0.78rem;
  line-height: 1.8;
  color: var(--mist);
  opacity: 0.85;
}

.copyright { margin-top: 2rem; font-size: 0.75rem; color: var(--mist); opacity: 0.6; }

/* ---------- reveals: glacial, like falling asleep ---------- */

.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 1.3s ease, transform 1.3s ease;
  transition-delay: var(--stagger, 0s);
}
.reveal.in { opacity: 1; transform: none; }
/* hover lift must survive the reveal state (same specificity, later wins) */
.stories-grid .story-card.reveal.in:hover { transform: translateY(-3px); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .cta, .pc-halo, .pc-pane, .pc-pane-hot, .mist, .story-card.lit .pane,
  .pc-puff, .pc-stars circle, #pc-mist-band, .goodnight { animation: none !important; }
  .pc-pane-hot { opacity: 0.2; }
  .pc-puff { opacity: 0; }
  .hero-inner > * { animation: none; opacity: 1; transform: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .section-head { letter-spacing: 0.02em; transition: none; }
}

/* ---------- legal pages ---------- */

.legal { max-width: 44rem; margin: 0 auto; padding: 9rem 1.5rem 5rem; }
.legal h1 { font-family: var(--display); font-weight: 300; font-size: 2.4rem; margin-bottom: 0.6rem; }
.legal h2 { font-family: var(--display); font-weight: 400; font-size: 1.35rem; margin: 2.6rem 0 0.8rem; }
.legal p, .legal li { color: var(--body); opacity: 0.88; font-size: 0.95rem; }
.legal ul { padding-left: 1.3rem; margin: 0.6rem 0; }
.legal .meta { color: var(--mist); font-size: 0.8rem; margin-bottom: 3rem; }
.legal .back { display: inline-block; margin-top: 4rem; color: var(--mist); font-size: 0.85rem; letter-spacing: 0.1em; }
.legal .back:hover { color: var(--body); }

@media (max-width: 40rem) {
  .listen-row { flex-direction: column; gap: 0.4rem; }
  .listen-note { text-align: left; }
}
