/* A Door in the Machine — D.M. Baxter
   Art direction: cold glass architecture, a warm doorway of light. */

:root {
  /* surfaces */
  --ink: #07090a;
  --ink-2: #0d1113;
  --ink-3: #141a1c;
  --line: rgba(214, 232, 226, 0.14);
  --line-soft: rgba(214, 232, 226, 0.08);

  /* text */
  --fg: #e8f0ec;
  --fg-dim: #a9b8b3;
  --fg-faint: #728480;

  /* accents drawn from the cover */
  --glass: #b9cfc7;      /* pale misted green */
  --door: #d8c48a;       /* warm light through the doorway */
  --door-soft: rgba(216, 196, 138, 0.16);

  --font-display: 'Cormorant Garamond', 'Cormorant', Georgia, serif;
  --font-body: 'Satoshi', 'Inter', system-ui, sans-serif;
  --font-read: 'Source Serif 4', Georgia, serif;

  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.5rem;
  --text-2xl: clamp(2rem, 4vw, 3rem);
  --text-3xl: clamp(2.6rem, 7vw, 5.5rem);

  --maxw: 1180px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }

.wrap { width: min(100% - 2.5rem, var(--maxw)); margin-inline: auto; }

/* ---------- chrome ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 60;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
  padding: 1rem clamp(1.25rem, 4vw, 2.5rem);
  backdrop-filter: blur(14px);
  background: linear-gradient(180deg, rgba(7, 9, 10, 0.88), rgba(7, 9, 10, 0));
  transition: background 0.4s var(--ease), border-color 0.4s var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.solid {
  background: rgba(7, 9, 10, 0.92);
  border-bottom-color: var(--line-soft);
}
.brand { display: flex; align-items: center; gap: 0.7rem; text-decoration: none; }
.brand svg { width: 26px; height: 26px; color: var(--glass); flex: none; }
.brand b {
  font-family: var(--font-display);
  font-size: 1.05rem; font-weight: 500; letter-spacing: 0.14em;
  text-transform: uppercase;
}
.nav-links { display: flex; align-items: center; gap: clamp(1rem, 2.4vw, 2rem); }
.nav-links a {
  text-decoration: none; font-size: var(--text-sm); color: var(--fg-dim);
  letter-spacing: 0.06em; transition: color 0.25s var(--ease);
}
.nav-links a:hover { color: var(--fg); }
.nav-links a.btn { color: var(--fg); }
.nav-links a.btn-door, .nav-links a.btn-door:hover { color: #171308; }
.btn .short { display: none; }
@media (max-width: 700px) {
  .nav-links a.hide-sm { display: none; }
  .brand b { font-size: 0.82rem; letter-spacing: 0.1em; }
  .btn .long { display: none; }
  .btn .short { display: inline; }
  .nav { padding: 0.85rem 1.1rem; }
}

.btn {
  display: inline-flex; align-items: center; gap: 0.55rem;
  padding: 0.7rem 1.35rem; border-radius: 999px;
  font-size: var(--text-sm); font-weight: 500; letter-spacing: 0.04em;
  text-decoration: none; border: 1px solid var(--line);
  color: var(--fg); background: transparent;
  transition: all 0.3s var(--ease); cursor: pointer;
}
.btn:hover { border-color: var(--glass); background: rgba(185, 207, 199, 0.08); }
.btn-door {
  background: var(--door); color: #171308; border-color: var(--door);
  box-shadow: 0 0 0 0 var(--door-soft);
}
.btn-door:hover {
  background: #e6d5a4; border-color: #e6d5a4; color: #171308;
  box-shadow: 0 0 34px var(--door-soft);
}

/* ---------- hero ---------- */
.hero {
  position: relative; min-height: 100svh;
  display: grid; align-items: center;
  padding: 8rem 0 4rem;
  overflow: hidden;
}
.hero::after {
  content: ''; position: absolute; inset: auto 0 0 0; height: 40%;
  background: linear-gradient(180deg, rgba(7, 9, 10, 0), var(--ink));
  pointer-events: none;
}
#field {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0.55;
}
.hero-grid {
  position: relative; z-index: 2;
  display: grid; gap: clamp(2.5rem, 6vw, 5rem);
  grid-template-columns: 1.15fr 0.85fr; align-items: center;
}
@media (max-width: 860px) { .hero-grid { grid-template-columns: 1fr; } }

.eyebrow {
  font-size: var(--text-xs); letter-spacing: 0.32em; text-transform: uppercase;
  color: var(--fg-faint); margin: 0 0 1.5rem;
}
.hero h1 {
  font-family: var(--font-display);
  font-size: var(--text-3xl); font-weight: 300; line-height: 0.98;
  letter-spacing: 0.01em; margin: 0 0 1.5rem;
}
.hero h1 span { display: block; }
.hero h1 .lit {
  background: linear-gradient(96deg, var(--fg) 20%, var(--door) 60%, var(--glass));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p.lede {
  font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: var(--fg-dim);
  max-width: 46ch; margin: 0 0 2.25rem;
}
.hero-cta { display: flex; flex-wrap: wrap; gap: 0.85rem; align-items: center; }
.hero-meta {
  margin-top: 2.5rem; display: flex; flex-wrap: wrap; gap: 1.75rem;
  font-size: var(--text-xs); letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--fg-faint);
}

.cover-stage { position: relative; display: grid; place-items: center; }
.cover-stage::before {
  content: ''; position: absolute; width: 78%; aspect-ratio: 1;
  background: radial-gradient(circle, rgba(216, 196, 138, 0.22), transparent 62%);
  filter: blur(28px);
}
.cover {
  position: relative; width: min(340px, 78%);
  border-radius: 3px; overflow: hidden;
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(232, 240, 236, 0.09);
  transform: perspective(1400px) rotateY(-11deg) rotateX(2deg);
  transition: transform 0.9s var(--ease);
}
.cover:hover { transform: perspective(1400px) rotateY(-4deg) rotateX(0deg); }
.cover::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(100deg, rgba(255, 255, 255, 0.16), transparent 42%);
  pointer-events: none;
}

/* ---------- sections ---------- */
section { position: relative; }
.band { padding: clamp(5rem, 11vw, 9rem) 0; }
.band-line { border-top: 1px solid var(--line-soft); }

.kicker {
  font-size: var(--text-xs); letter-spacing: 0.32em; text-transform: uppercase;
  color: var(--door); margin: 0 0 1.5rem;
}
h2.section-title {
  font-family: var(--font-display); font-weight: 300;
  font-size: var(--text-2xl); line-height: 1.08; margin: 0 0 1.75rem;
  letter-spacing: 0.01em;
}
.prose { max-width: 62ch; }
.prose p { color: var(--fg-dim); font-size: var(--text-lg); margin: 0 0 1.35rem; }
.prose p.strong-line { color: var(--fg); font-family: var(--font-display); font-size: var(--text-xl); line-height: 1.35; }

.two-col {
  display: grid; grid-template-columns: 0.85fr 1.15fr;
  gap: clamp(2rem, 6vw, 5rem); align-items: start;
}
@media (max-width: 820px) { .two-col { grid-template-columns: 1fr; } }

.pull {
  font-family: var(--font-display); font-weight: 300;
  font-size: clamp(1.6rem, 3.4vw, 2.6rem); line-height: 1.25;
  max-width: 24ch; margin: 0; color: var(--fg);
}
.pull em { color: var(--door); font-style: italic; }

/* act cards */
.acts { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1px; background: var(--line-soft); border: 1px solid var(--line-soft); }
.act-card {
  background: var(--ink-2); padding: 2rem 1.75rem 2.25rem;
  text-decoration: none; display: block;
  transition: background 0.35s var(--ease), transform 0.35s var(--ease);
}
.act-card:hover { background: var(--ink-3); }
.act-card .n {
  font-family: var(--font-display); font-size: 2.6rem; font-weight: 300;
  color: var(--door); line-height: 1; display: block; margin-bottom: 1rem;
}
.act-card h3 { font-size: var(--text-base); font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; margin: 0 0 0.6rem; }
.act-card p { color: var(--fg-faint); font-size: var(--text-sm); margin: 0; }

/* stats strip */
.stats { display: flex; flex-wrap: wrap; gap: clamp(2rem, 6vw, 4.5rem); }
.stat .v { font-family: var(--font-display); font-size: 2.4rem; font-weight: 300; color: var(--fg); line-height: 1; }
.stat .k { font-size: var(--text-xs); letter-spacing: 0.22em; text-transform: uppercase; color: var(--fg-faint); margin-top: 0.6rem; }

/* buy panel */
.buy {
  border: 1px solid var(--line); background:
    radial-gradient(120% 140% at 82% 0%, rgba(216, 196, 138, 0.12), transparent 58%),
    var(--ink-2);
  padding: clamp(2.25rem, 5vw, 4rem);
  display: grid; grid-template-columns: 1fr auto; gap: 2.5rem; align-items: center;
}
@media (max-width: 760px) { .buy { grid-template-columns: 1fr; } }
.buy h2 { font-family: var(--font-display); font-weight: 300; font-size: var(--text-2xl); margin: 0 0 0.75rem; }
.buy p { color: var(--fg-dim); margin: 0; max-width: 48ch; }
.buy-actions { display: flex; flex-direction: column; gap: 0.75rem; min-width: 220px; }
.buy-actions small { color: var(--fg-faint); font-size: var(--text-xs); letter-spacing: 0.1em; text-align: center; }

/* author */
.author-card { display: grid; grid-template-columns: auto 1fr; gap: 2rem; align-items: start; }
@media (max-width: 620px) { .author-card { grid-template-columns: 1fr; } }
.sigil {
  width: 96px; height: 96px; border-radius: 50%;
  border: 1px solid var(--line); display: grid; place-items: center;
  color: var(--glass);
}

footer.foot {
  border-top: 1px solid var(--line-soft); padding: 3rem 0 4rem;
  color: var(--fg-faint); font-size: var(--text-sm);
  display: flex; flex-wrap: wrap; gap: 1.25rem; justify-content: space-between;
}
footer.foot a { text-decoration: none; }
footer.foot a:hover { color: var(--fg); }

/* reveal on scroll */
.rise { opacity: 0; transform: translateY(26px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.rise.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .rise { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}
