/* LoreWind Studios: hand-rolled, no framework, no build step.
   Tokens mirror the app (web/src/routes/layout.css): ink night, parchment
   page, ember candlelight, Fraunces for lore, Inter for interface. */

/* Self-hosted variable fonts, same files the app ships (@fontsource-variable). */
@font-face {
  font-family: 'Fraunces Variable';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('fonts/fraunces-latin-wght-normal.woff2') format('woff2-variations');
}
@font-face {
  font-family: 'Inter Variable';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('fonts/inter-latin-wght-normal.woff2') format('woff2-variations');
}

:root {
  /* Ink: the night the stories are told in. */
  --ink-950: #0d0e16;
  --ink-900: #14151f;
  --ink-800: #1d1e2c;
  --ink-700: #2a2b3d;
  --ink-500: #565873;
  --ink-400: #6f7189;
  --ink-300: #9b9cb0;
  --ink-200: #b9bac9;
  /* Parchment: the page they are written on. */
  --parchment-50: #faf7f0;
  --parchment-100: #f4efe3;
  --parchment-200: #e8dfc9;
  /* Ember: candlelight accents. */
  --ember-200: #f1c174;
  --ember-300: #eec886;
  --ember-400: #dfa64f;
  --ember-500: #c98a2e;
  --ember-600: #a86e1f;

  --serif: 'Fraunces Variable', Georgia, 'Times New Roman', serif;
  --sans: 'Inter Variable', system-ui, -apple-system, 'Segoe UI', sans-serif;

  /* The same faint fractal-noise grain the app lays over manuscript pages. */
  --grain: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.025'/%3E%3C/svg%3E");
}

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

body {
  font-family: var(--sans);
  background: var(--parchment-50);
  color: var(--ink-700);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 720px; margin: 0 auto; padding: 0 24px; }

/* Header: the night sky above the page. */
header.site {
  background: var(--ink-950);
  border-bottom: 1px solid var(--ink-800);
}
/* On the home page the header opens straight into the hero night. */
body.home header.site { border-bottom-color: transparent; }
header.site .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 20px;
  padding-top: 16px;
  padding-bottom: 16px;
}
.wordmark {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
  color: var(--parchment-50);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.wordmark span { color: var(--ember-400); }
nav.site {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}
nav.site a {
  color: var(--ink-300);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.15s;
}
nav.site a:hover { color: var(--parchment-50); }
/* The Play tab: the one nav item that IS the product. */
nav.site a.play { color: var(--ember-400); font-weight: 600; }
nav.site a.play:hover { color: var(--ember-300); }

main { padding: 72px 0; }
/* The home page manages its own rhythm: the hero owns the top. */
body.home main { padding-top: 0; }

h1 {
  font-family: var(--serif);
  font-size: 40px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--ink-900);
  text-wrap: balance;
}
h1 em { font-style: italic; color: var(--ember-600); }
h2 {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 600;
  margin: 56px 0 8px;
  color: var(--ink-900);
}
p.lede { font-size: 18px; color: var(--ink-500); margin-top: 16px; }
main p { margin-top: 12px; color: var(--ink-500); }
main a {
  color: var(--ink-700);
  text-decoration-color: var(--ember-500);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
main a:hover { color: var(--ink-900); }
main p, main a { overflow-wrap: anywhere; }

/* ---- The hero: the studio's front porch at night. ---- */

.hero {
  position: relative;
  background:
    radial-gradient(60rem 30rem at 50% 118%, rgba(223, 166, 79, 0.16), transparent 62%),
    radial-gradient(46rem 20rem at 82% -30%, rgba(42, 43, 61, 0.85), transparent 70%),
    var(--ink-950);
  overflow: hidden;
}
.hero::after {
  /* The horizon: night settling onto the parchment below. */
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(223, 166, 79, 0.5), transparent);
}
.hero-inner {
  position: relative;
  z-index: 2;
  padding-top: 96px;
  padding-bottom: 112px;
  text-align: center;
}
.hero-mark {
  display: block;
  width: 96px;
  height: 96px;
  margin: 0 auto 22px;
  filter: drop-shadow(0 0 28px rgba(223, 166, 79, 0.28));
  animation: hero-rise 600ms cubic-bezier(0.22, 0.9, 0.3, 1) both;
}
.hero-kicker {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ember-400);
  animation: hero-rise 600ms 80ms cubic-bezier(0.22, 0.9, 0.3, 1) both;
}
.hero h1 {
  margin-top: 18px;
  font-size: clamp(40px, 8vw, 62px);
  color: var(--parchment-50);
  animation: hero-rise 700ms 200ms cubic-bezier(0.22, 0.9, 0.3, 1) both;
}
.hero h1 em {
  color: var(--ember-300);
  animation: ember-bloom 2.6s 500ms ease-out both;
}
.hero-lede {
  max-width: 34em;
  margin: 20px auto 0;
  font-size: 18px;
  color: var(--ink-200);
  text-wrap: balance;
  animation: hero-rise 700ms 360ms cubic-bezier(0.22, 0.9, 0.3, 1) both;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 14px 22px;
  margin-top: 34px;
  animation: hero-rise 700ms 500ms cubic-bezier(0.22, 0.9, 0.3, 1) both;
}
.cta-quiet {
  color: var(--ink-200);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid var(--ink-700);
  padding-bottom: 2px;
  transition: color 0.15s, border-color 0.15s;
}
.cta-quiet:hover { color: var(--parchment-50); border-color: var(--ember-400); }

/* A roadside fire off-frame: warm light breathing at the hero's base. */
.hero-glow {
  position: absolute;
  left: 50%; bottom: -20%;
  width: 130%; height: 55%;
  transform: translateX(-50%);
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 100%, rgba(224, 122, 62, 0.2), rgba(241, 193, 116, 0.09) 45%, transparent 72%);
  animation: hero-flicker 5.5s ease-in-out infinite;
}

/* Embers drifting up through the night. */
.ember-motes { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.ember-motes span {
  position: absolute;
  left: var(--x);
  bottom: -1rem;
  width: var(--size);
  height: var(--size);
  border-radius: 999px;
  background: var(--ember-200);
  box-shadow: 0 0 8px rgba(241, 193, 116, 0.75);
  opacity: 0;
  animation: mote-rise var(--duration) var(--delay) linear infinite;
}

/* ---- The study below: parchment, manuscript, letter. ---- */

.kicker {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.19em;
  text-transform: uppercase;
  color: var(--ember-600);
}

/* Product card: a lit window in the study. */
.product-card {
  margin-top: 64px;
  border: 1px solid var(--parchment-200);
  border-radius: 16px;
  padding: 32px 28px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(13, 14, 22, 0.05);
}
.product-card.manuscript {
  background-color: rgba(255, 253, 247, 0.97);
  background-image: var(--grain);
  box-shadow:
    0 10px 34px rgba(13, 14, 22, 0.09),
    0 0 0 4px var(--parchment-50),
    0 0 0 5px var(--parchment-200);
}
.product-card .kicker { margin-top: 0; }
.product-card h3 {
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 600;
  margin-top: 6px;
  color: var(--ink-900);
}
.product-card p { margin-top: 10px; color: var(--ink-500); }
.product-card p.drop-cap::first-letter {
  float: left;
  margin: 0.08em 0.14em 0 0;
  font-family: var(--serif);
  font-size: 3.1em;
  font-weight: 600;
  line-height: 0.78;
  color: var(--ember-600);
}
.cta {
  display: inline-block;
  margin-top: 20px;
  background: var(--ember-400);
  color: #000000;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  padding: 11px 20px;
  border-radius: 8px;
  box-shadow: 0 0 28px rgba(223, 166, 79, 0.35);
  transition: background 0.15s, transform 0.15s;
}
.cta:hover { background: var(--ember-300); color: #000000; transform: translateY(-1px); }
.hero .cta { margin-top: 0; }
.cta-breathe { animation: cta-breathe 3.4s ease-in-out infinite; }

/* The founder's portrait, hung in the study: arched frame, parchment ring,
   a touch of candlelight warmth over the photo. */
.portrait {
  float: right;
  width: 156px;
  margin: 8px 0 10px 22px;
  shape-outside: margin-box;
}
.portrait img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 999px 999px 14px 14px;
  filter: sepia(0.07) saturate(1.05);
  box-shadow:
    0 8px 22px rgba(13, 14, 22, 0.14),
    0 0 0 4px var(--parchment-50),
    0 0 0 5px var(--parchment-200);
}
@media (max-width: 560px) {
  .portrait { float: none; width: 168px; margin: 16px auto 4px; }
}

.signature { margin-top: 20px; display: flex; flex-direction: column; gap: 2px; }
.signature-name {
  font-family: var(--serif);
  font-style: italic;
  font-size: 22px;
  color: var(--ink-900);
}
.signature-role { font-size: 13px; color: var(--ink-400); letter-spacing: 0.02em; }
.gold-dot { color: var(--ember-500); font-weight: 700; }

ul.plain { margin-top: 12px; list-style: none; padding-left: 0; color: var(--ink-500); }
ul.plain li { position: relative; margin-top: 10px; padding-left: 22px; }
ul.plain li::before {
  content: '✦';
  position: absolute;
  left: 0;
  top: 0.18em;
  font-size: 11px;
  color: var(--ember-500);
}

footer.site {
  background: var(--ink-950);
  border-top: 1px solid var(--ink-800);
  color: var(--ink-300);
  font-size: 14px;
  margin-top: 88px;
}
footer.site .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 24px;
  padding-bottom: 24px;
}
footer.site .wrap > span { display: flex; flex-wrap: wrap; gap: 8px 16px; }
footer.site .wrap > span.footer-mark { display: inline-block; }
footer.site a { color: var(--ink-300); text-decoration: none; transition: color 0.15s; }
footer.site a:hover { color: var(--parchment-50); }
.footer-mark { font-family: var(--serif); color: var(--parchment-100); }

/* Asides read like a note tucked into the margin, not a warning sign. */
.notice {
  margin-top: 28px;
  border: 1px solid var(--parchment-200);
  border-left: 3px solid var(--ember-400);
  border-radius: 12px;
  padding: 14px 18px;
  background: var(--parchment-50);
  color: var(--ink-500);
  font-size: 14px;
}

/* ---- Subpages: the study's quieter rooms. ---- */

/* One manuscript scroll holds the whole page's text. */
.page-scroll {
  margin-top: 40px;
  border: 1px solid var(--parchment-200);
  border-radius: 16px;
  padding: 36px 32px 40px;
  background-color: rgba(255, 253, 247, 0.97);
  background-image: var(--grain);
  box-shadow:
    0 10px 34px rgba(13, 14, 22, 0.09),
    0 0 0 4px var(--parchment-50),
    0 0 0 5px var(--parchment-200);
}
.page-scroll h2 { margin: 40px 0 8px; }
.page-scroll h2:first-child { margin-top: 0; }
.page-scroll .notice.lead-note { margin-top: 0; }
.page-scroll h2.after-note { margin-top: 36px; }
@media (max-width: 560px) {
  .page-scroll { padding: 26px 20px 30px; }
}

/* A hairline with a small star where one section hands off to the next. */
hr.flourish {
  border: 0;
  height: 1px;
  margin: 44px 0 0;
  background: linear-gradient(90deg, transparent, var(--parchment-300) 22%, var(--parchment-300) 78%, transparent);
  position: relative;
  overflow: visible;
}
hr.flourish::after {
  content: '✦';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  padding: 0 10px;
  background: #fffdf7;
  color: var(--ember-500);
  font-size: 12px;
  line-height: 1;
}

/* ---- Subpage night: each quiet room opens under the same sky. ---- */

/* Pages whose main opens with a hero band: the header melts into the night. */
body.night-page header.site { border-bottom-color: transparent; }
body.night-page main { padding-top: 0; }

.hero.brief .hero-inner { padding-top: 56px; padding-bottom: 76px; }
.hero.brief h1 { font-size: clamp(34px, 6vw, 48px); margin-top: 14px; }
.hero.brief .hero-lede { font-size: 17px; }

/* The page's sections, each its own manuscript leaf on the desk. */
.leaf-stack { margin-top: 44px; }
.leaf {
  border: 1px solid var(--parchment-200);
  border-radius: 16px;
  padding: 30px 28px;
  background-color: rgba(255, 253, 247, 0.97);
  background-image: var(--grain);
  box-shadow:
    0 10px 34px rgba(13, 14, 22, 0.09),
    0 0 0 4px var(--parchment-50),
    0 0 0 5px var(--parchment-200);
  transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
}
.leaf + .leaf { margin-top: 26px; }
.leaf:hover {
  transform: translateY(-3px);
  border-color: var(--ember-300);
  box-shadow:
    0 18px 40px rgba(13, 14, 22, 0.12),
    0 0 24px rgba(223, 166, 79, 0.12),
    0 0 0 4px var(--parchment-50),
    0 0 0 5px var(--parchment-200);
}
.leaf h2 { margin: 0 0 6px; }
.leaf h2.after-note { margin-top: 30px; }
.leaf .notice { margin-top: 22px; }
.leaf .notice.lead-note { margin-top: 0; }
@media (max-width: 560px) { .leaf { padding: 24px 20px; } }

/* Questions folded like letters: open the one you came for. */
.fold {
  margin-top: 12px;
  border: 1px solid var(--parchment-200);
  border-radius: 12px;
  background: var(--parchment-50);
  transition: border-color 200ms ease, box-shadow 200ms ease, background 200ms ease;
}
.fold summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 14px 18px;
  font-weight: 600;
  color: var(--ink-900);
}
.fold summary::-webkit-details-marker { display: none; }
.fold summary::before {
  content: '✦';
  flex: 0 0 auto;
  color: var(--ember-500);
  font-size: 12px;
  transition: transform 250ms cubic-bezier(0.22, 0.9, 0.3, 1), text-shadow 250ms ease;
}
.fold:hover { border-color: var(--ember-300); }
.fold:hover summary::before { text-shadow: 0 0 10px rgba(241, 193, 116, 0.85); }
.fold[open] {
  background: #fffdf7;
  border-color: var(--ember-300);
  box-shadow: inset 3px 0 0 var(--ember-400), 0 6px 18px rgba(13, 14, 22, 0.06);
}
.fold[open] summary::before { transform: rotate(45deg); }
.fold > p { padding: 0 18px 16px 42px; margin-top: 0; }
.fold summary:focus-visible { outline: 2px solid var(--ember-400); outline-offset: 2px; border-radius: 10px; }

/* One press and the address is on your clipboard. */
.copy-mail {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--parchment-200);
  border-radius: 999px;
  background: var(--parchment-50);
  color: var(--ink-500);
  font: 600 12.5px/1 var(--sans);
  letter-spacing: 0.02em;
  padding: 9px 15px;
  cursor: pointer;
  transition: color 150ms, border-color 150ms, background 150ms, box-shadow 150ms;
}
.copy-mail:hover { border-color: var(--ember-400); color: var(--ink-900); box-shadow: 0 0 16px rgba(223, 166, 79, 0.25); }
.copy-mail:focus-visible { outline: 2px solid var(--ember-400); outline-offset: 2px; }
.copy-mail.did { background: var(--ember-400); border-color: var(--ember-400); color: #000000; }

/* Looking at a rule makes its ember flare. */
ul.plain li { transition: color 180ms ease; }
ul.plain li::before { transition: color 180ms ease, text-shadow 180ms ease; }
ul.plain li:hover { color: var(--ink-700); }
ul.plain li:hover::before { color: var(--ember-400); text-shadow: 0 0 10px rgba(241, 193, 116, 0.85); }

/* The lines that never move: point at one and it underlines itself, and holds. */
ul.laws li::after {
  content: '';
  position: absolute;
  left: 22px;
  bottom: -5px;
  width: min(220px, 60%);
  height: 2px;
  background: linear-gradient(90deg, var(--ember-500), transparent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 350ms cubic-bezier(0.22, 0.9, 0.3, 1);
}
ul.laws li:hover::after { transform: scaleX(1); }

/* Keyboard focus: candlelight ring. */
nav.site a:focus-visible,
main a:focus-visible,
.cta:focus-visible,
.cta-quiet:focus-visible,
footer.site a:focus-visible {
  outline: 2px solid var(--ember-400);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ---- Motion. Every animation here is decorative and fully removable. ---- */

/* Sections below the fold rise into view once; without the motion-ok class
   (scripting off, reduced motion) they are simply visible. */
html.motion-ok .reveal { opacity: 0; transform: translateY(14px); }
html.motion-ok .reveal.in {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 600ms cubic-bezier(0.22, 0.9, 0.3, 1), transform 600ms cubic-bezier(0.22, 0.9, 0.3, 1);
}

@keyframes hero-rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes ember-bloom {
  0%, 45% { text-shadow: 0 0 0 rgba(241, 193, 116, 0); }
  75% { text-shadow: 0 0 24px rgba(241, 193, 116, 0.72); }
  100% { text-shadow: 0 0 10px rgba(241, 193, 116, 0.2); }
}
@keyframes hero-flicker {
  0%, 100% { opacity: 0.7; }
  28% { opacity: 1; }
  52% { opacity: 0.55; }
  79% { opacity: 0.88; }
}
@keyframes cta-breathe {
  0%, 100% { box-shadow: 0 0 28px rgba(223, 166, 79, 0.28); }
  50% { box-shadow: 0 0 48px rgba(223, 166, 79, 0.52); }
}
@keyframes mote-rise {
  0% { opacity: 0; transform: translate3d(0, 0, 0); }
  12% { opacity: var(--o); }
  82% { opacity: var(--o); }
  100% { opacity: 0; transform: translate3d(var(--sway), -46rem, 0); }
}

/* A hidden tab pays for no embers. */
body.motion-paused .ember-motes span,
body.motion-paused .hero-glow,
body.motion-paused .cta-breathe { animation-play-state: paused; }

@media (prefers-reduced-motion: reduce) {
  .hero-kicker, .hero h1, .hero-lede, .hero-actions { animation: none; }
  .hero h1 em { animation: none; text-shadow: 0 0 10px rgba(241, 193, 116, 0.2); }
  .hero-glow { animation: none; opacity: 0.8; }
  .ember-motes span { animation: none; }
  .cta-breathe { animation: none; }
  .leaf, .leaf:hover { transform: none; transition: none; }
  .fold, .fold summary::before, .copy-mail { transition: none; }
  ul.laws li::after { transition: none; }
}

@media (max-width: 480px) {
  h1 { font-size: 32px; }
  main { padding: 48px 0; }
  body.home main { padding-top: 0; }
  .hero-inner { padding-top: 64px; padding-bottom: 80px; }
  .product-card { padding: 26px 20px; }
}
