/* ============================================================
   Sydney Stevens — authorsydneystevens.com
   Palette sampled from the covers: near-black ground, cream type,
   crimson (Within Range) as the primary accent, ice-blue and gold
   (Working Him Out) as secondaries.
   ============================================================ */

:root {
  --ink:        #0b0a0d;   /* page ground — near black */
  --ink-2:      #131117;   /* raised surface */
  --ink-3:      #1c1922;   /* cards, inputs */
  --line:       #2c2733;

  --cream:      #f4efe6;   /* primary text — matches cover title cream */
  --cream-dim:  #b9b1a6;   /* secondary text */
  --muted:      #8a8290;

  --crimson:    #b21a22;   /* Within Range accent rule */
  --crimson-lt: #d92a35;   /* hover / glow */
  --ice:        #4a7fa8;   /* Working Him Out cool light */
  --gold:       #c9a227;   /* Working Him Out subtitle */

  --font-display: 'Bebas Neue', 'Oswald', Impact, sans-serif;
  --font-ui:      'Oswald', 'Helvetica Neue', Arial, sans-serif;
  --font-body:    'Cormorant Garamond', Georgia, 'Times New Roman', serif;

  --wrap: 1140px;
  --radius: 4px;
  --shadow: 0 18px 44px rgba(0, 0, 0, .55);
}

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 1.18rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--cream); text-decoration-color: rgba(217, 42, 53, .55); text-underline-offset: 3px; }
a:hover { color: #fff; text-decoration-color: var(--crimson-lt); }

.wrap { width: min(var(--wrap), calc(100% - 2.5rem)); margin-inline: auto; }
.wrap.narrow { width: min(760px, calc(100% - 2.5rem)); }
.center { text-align: center; }
.plain { list-style: none; margin: 0; padding: 0; }
.muted { color: var(--cream-dim); }
.small, .smallprint { font-size: .95rem; color: var(--muted); font-family: var(--font-ui); font-weight: 400; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--crimson); color: #fff; padding: .7rem 1.1rem; font-family: var(--font-ui);
}
.skip-link:focus { left: .5rem; top: .5rem; }

:focus-visible { outline: 2px solid var(--crimson-lt); outline-offset: 3px; }

/* ---------- Type ---------- */
h1, h2, h3 { font-family: var(--font-display); font-weight: 400; letter-spacing: .015em; line-height: 1.03; margin: 0 0 .5rem; }

.eyebrow {
  font-family: var(--font-ui); font-weight: 600; font-size: .78rem;
  letter-spacing: .22em; text-transform: uppercase; color: var(--crimson-lt);
  margin: 0 0 .6rem;
}
.eyebrow a { color: inherit; }

.page-h  { font-size: clamp(2.6rem, 7vw, 4.6rem); }
.section-h { font-size: clamp(1.9rem, 4vw, 2.8rem); margin-top: 2.5rem; }
.section-h:first-child { margin-top: 0; }
.section-sub { color: var(--cream-dim); font-size: 1.2rem; max-width: 62ch; }

.prose p { margin: 0 0 1.15rem; }
.prose h2 { font-size: 1.9rem; margin-top: 2.2rem; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11, 10, 13, .93);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 1.5rem; padding: .85rem 0; }

.brand { text-decoration: none; display: block; margin-right: auto; }
.brand-name {
  display: block; font-family: var(--font-display); font-size: 1.7rem;
  letter-spacing: .06em; color: var(--cream); line-height: 1;
}
.brand-tag {
  display: block; font-family: var(--font-ui); font-size: .66rem; font-weight: 400;
  letter-spacing: .2em; text-transform: uppercase; color: var(--muted); margin-top: .2rem;
}

.site-nav { display: flex; align-items: center; gap: 1.5rem; }
.site-nav a {
  font-family: var(--font-ui); font-size: .82rem; font-weight: 400;
  letter-spacing: .14em; text-transform: uppercase; text-decoration: none; color: var(--cream-dim);
}
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--cream); }
.site-nav a[aria-current="page"] { border-bottom: 2px solid var(--crimson); padding-bottom: 2px; }
.nav-cta {
  background: var(--crimson); color: #fff !important; padding: .55rem .95rem;
  border-radius: var(--radius);
}
.nav-cta:hover { background: var(--crimson-lt); }

.nav-toggle, .nav-burger { display: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; font-family: var(--font-ui); font-weight: 600;
  font-size: .84rem; letter-spacing: .14em; text-transform: uppercase;
  background: var(--crimson); color: #fff; text-decoration: none;
  padding: .85rem 1.6rem; border: 1px solid var(--crimson); border-radius: var(--radius);
  cursor: pointer; transition: background .18s ease, transform .18s ease;
}
.btn:hover { background: var(--crimson-lt); border-color: var(--crimson-lt); color: #fff; transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--cream); border-color: var(--line); }
.btn-ghost:hover { background: rgba(178, 26, 34, .14); border-color: var(--crimson); color: var(--cream); }
.btn-sm { padding: .6rem 1.05rem; font-size: .76rem; }
.btn-block { width: 100%; }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(80rem 40rem at 82% 18%, rgba(178, 26, 34, .30), transparent 62%),
    radial-gradient(60rem 34rem at 8% 88%, rgba(74, 127, 168, .18), transparent 60%),
    linear-gradient(180deg, #100e14 0%, var(--ink) 100%);
  border-bottom: 1px solid var(--line);
}
.hero-inner {
  display: grid; grid-template-columns: 1.15fr .85fr; gap: 3rem; align-items: center;
  padding: clamp(3rem, 8vw, 6rem) 0;
}
.hero-h { font-size: clamp(3.6rem, 11vw, 7.5rem); margin-bottom: 1rem; }
.hero-lede { font-size: 1.32rem; color: var(--cream-dim); max-width: 46ch; margin: 0 0 2rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .85rem; margin-bottom: 2rem; }

.promise { display: flex; flex-wrap: wrap; gap: .5rem .65rem; }
.promise li {
  font-family: var(--font-ui); font-size: .72rem; letter-spacing: .13em; text-transform: uppercase;
  color: var(--cream-dim); border: 1px solid var(--line); border-radius: 99px; padding: .38rem .8rem;
}

/* The covers are absolutely positioned to get the fanned-out look, which takes
   them out of flow — so the container contributes no height of its own. A fixed
   min-height can't work: the covers are sized as a % of the container's WIDTH,
   so their height scales with the viewport while a fixed min-height doesn't, and
   they spill over the heading on narrow screens. aspect-ratio ties the
   container's height to that same width, so it always contains them.
   Geometry: cover height = 58% × 1.6 (covers are 5:8) = 0.928 × container width.
   Lowest cover starts at 12% of container height (0.144w), ending at ~1.07w —
   inside the 1.2w box, with room to spare for the rotation. */
.hero-covers { position: relative; aspect-ratio: 1 / 1.2; }
.hero-cover {
  position: absolute; width: 58%; border-radius: 3px; box-shadow: var(--shadow);
  border: 1px solid rgba(244, 239, 230, .08);
}
.hero-cover-0 { top: 0; right: 4%; transform: rotate(3deg); z-index: 2; }
.hero-cover-1 { top: 12%; left: 0; transform: rotate(-5deg); z-index: 1; opacity: .92; }

/* ---------- Sections ---------- */
.section { padding: clamp(3rem, 7vw, 5.5rem) 0; }
.section-top { padding-top: clamp(1.5rem, 3vw, 2.5rem); }
.section-alt { background: var(--ink-2); border-block: 1px solid var(--line); }

.breadcrumbs { padding-top: 1.4rem; }
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: .5rem; font-family: var(--font-ui); font-size: .76rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.breadcrumbs li + li::before { content: "/"; margin-right: .5rem; color: var(--line); }
.breadcrumbs a { color: var(--cream-dim); text-decoration: none; }
.breadcrumbs a:hover { color: var(--cream); }

/* ---------- Book grid + cards ---------- */
.book-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem; margin-top: 2.5rem;
}
.book-card {
  background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform .2s ease, border-color .2s ease;
}
.book-card:hover { transform: translateY(-4px); border-color: rgba(178, 26, 34, .55); }
.book-card-cover { display: block; background: #000; }
.book-card-cover img { width: 100%; aspect-ratio: 5 / 8; object-fit: cover; }
.book-card-body { padding: 1.4rem; display: flex; flex-direction: column; gap: .55rem; flex: 1; }
.book-card-title { font-size: 2rem; margin: 0; }
.book-card-title a { text-decoration: none; }
.book-card-sub { font-family: var(--font-ui); font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); margin: 0; }
.book-card-hook { color: var(--cream-dim); font-size: 1.06rem; margin: .3rem 0 .6rem; }
.book-card-actions { display: flex; flex-wrap: wrap; gap: .55rem; margin-top: auto; padding-top: .6rem; }

.tag-row { display: flex; flex-wrap: wrap; gap: .4rem; }
.tag {
  font-family: var(--font-ui); font-size: .68rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--cream-dim); background: rgba(74, 127, 168, .12);
  border: 1px solid rgba(74, 127, 168, .3); border-radius: 99px; padding: .3rem .7rem;
}
.tag-alt { background: rgba(178, 26, 34, .12); border-color: rgba(178, 26, 34, .35); }

/* ---------- Book detail ---------- */
.book-detail-top {
  display: grid; grid-template-columns: minmax(240px, 340px) 1fr; gap: 3rem;
  padding: 2rem 0 1rem; align-items: start;
}
.book-detail-cover img { border-radius: 3px; box-shadow: var(--shadow); border: 1px solid rgba(244, 239, 230, .08); width: 100%; }
.book-detail-sub { font-family: var(--font-ui); font-size: .9rem; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); margin: 0 0 1rem; }
.book-tagline { font-size: 1.5rem; font-style: italic; color: var(--cream); margin: 0 0 1.4rem; }

.buy-box { background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem; margin: 1.8rem 0 1.4rem; }
.buy-h { font-size: 1.5rem; margin-bottom: .9rem; }
.buy-list { display: flex; flex-direction: column; gap: .8rem; }
.buy-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.buy-format { font-family: var(--font-ui); font-weight: 600; letter-spacing: .1em; text-transform: uppercase; font-size: .85rem; display: block; }
.buy-note { font-family: var(--font-ui); font-size: .76rem; color: var(--ice); }

.specs { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 1rem; margin: 0; }
.specs dt { font-family: var(--font-ui); font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.specs dd { margin: .15rem 0 0; font-size: 1.05rem; }

.book-detail-body { display: grid; grid-template-columns: 1fr minmax(240px, 320px); gap: 3rem; padding: 2.5rem 0; align-items: start; }
.blurb-hook { font-size: 1.5rem; font-family: var(--font-display); letter-spacing: .01em; line-height: 1.15; color: var(--cream); }
.blurb-close { color: var(--cream-dim); border-left: 3px solid var(--crimson); padding-left: 1rem; font-style: italic; }

.side-box { background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem; margin-bottom: 1.4rem; }
.side-box-warn { border-color: rgba(178, 26, 34, .4); background: rgba(178, 26, 34, .07); }
.side-box-warn p { font-size: 1.02rem; color: var(--cream-dim); margin: 0; }
.side-h { font-size: 1.35rem; margin-bottom: .8rem; }

/* ---------- FAQ ---------- */
.faq { border-top: 1px solid var(--line); margin-top: 1.5rem; }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-item summary { cursor: pointer; padding: 1.1rem 0; list-style: none; display: flex; align-items: center; gap: .8rem; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; margin-left: auto; font-family: var(--font-ui); color: var(--crimson-lt); font-size: 1.5rem; line-height: 1; }
.faq-item[open] summary::after { content: "–"; }
.faq-item summary h3 { font-size: 1.3rem; margin: 0; font-family: var(--font-ui); font-weight: 400; letter-spacing: .02em; }
.faq-item p { margin: 0 0 1.2rem; color: var(--cream-dim); }

/* ---------- Signup ---------- */
.signup {
  background:
    radial-gradient(50rem 24rem at 20% 0%, rgba(178, 26, 34, .26), transparent 60%),
    var(--ink-2);
  border-block: 1px solid var(--line);
  padding: clamp(3rem, 7vw, 5rem) 0;
}
.signup-inner { display: grid; grid-template-columns: 1.05fr .95fr; gap: 3rem; align-items: center; }
.signup-page .signup-inner { grid-template-columns: 1fr; max-width: 560px; }
.signup-h { font-size: clamp(2.2rem, 5vw, 3.4rem); }
.signup-sub { color: var(--cream-dim); margin: 0 0 1.4rem; }
.perks { display: flex; flex-direction: column; gap: .5rem; }
.perks li { font-family: var(--font-ui); font-size: .92rem; color: var(--cream-dim); }
.perks span { color: var(--crimson-lt); margin-right: .4rem; }

.signup-form, .stack-form { display: flex; flex-direction: column; gap: 1rem; }
.stack-form { max-width: 560px; margin-top: 1.8rem; }

.field { display: flex; flex-direction: column; gap: .35rem; }
.field > span {
  font-family: var(--font-ui); font-size: .74rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--cream-dim);
}
.field em { text-transform: none; letter-spacing: .04em; color: var(--muted); font-style: normal; }
.field input, .field textarea {
  background: var(--ink-3); border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--cream); font-family: var(--font-body); font-size: 1.1rem; padding: .8rem .95rem;
  width: 100%;
}
.field input::placeholder, .field textarea::placeholder { color: #6c6474; }
.field input:focus, .field textarea:focus { border-color: var(--crimson); outline: none; }
.field textarea { resize: vertical; }

/* Honeypot — off-screen rather than display:none, which some bots detect. */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-status { font-family: var(--font-ui); font-size: .95rem; margin: 0; min-height: 1.4em; }
.form-status.ok { color: #6fcf97; }
.form-status.err { color: #ff8087; }

.notice {
  background: rgba(74, 127, 168, .1); border: 1px solid rgba(74, 127, 168, .35);
  border-radius: var(--radius); padding: 1.1rem 1.3rem;
}
/* Secondary notice — the 18+ line sits under the spoiler warning and shouldn't
   compete with it for attention. */
.notice-quiet {
  background: transparent; border-color: var(--line);
  color: var(--muted); font-family: var(--font-ui); font-size: .88rem;
  letter-spacing: .06em; text-transform: uppercase; padding: .7rem 1.1rem;
}

/* ---------- Bonus scene ---------- */
.scene-meta {
  font-family: var(--font-ui); font-size: .82rem; letter-spacing: .16em;
  text-transform: uppercase; color: var(--gold); margin: -.2rem 0 1.6rem;
}
/* Scene breaks are their own paragraphs in the markup. Without this they read as
   ordinary body text and the reader loses the beat between scenes. */
.scene-break {
  text-align: center; letter-spacing: .8em; text-indent: .8em;
  color: var(--crimson-lt); margin: 2.2rem 0; user-select: none;
}
.scene-signoff {
  font-size: 1.15rem; color: var(--cream-dim); text-align: right;
  border-top: 1px solid var(--line); padding-top: 1.2rem; margin: 2.5rem 0 2rem;
}
/* Long-form reading: a touch more air than the marketing pages. */
.prose .scene-break + p { margin-top: 0; }

.promise-list li { margin-bottom: .7rem; color: var(--cream-dim); }
.promise-list strong { color: var(--cream); }
.link-list li { margin-bottom: .5rem; }

/* ---------- Footer ---------- */
.site-footer { background: #08070a; border-top: 1px solid var(--line); padding: 3.5rem 0 1.5rem; margin-top: 0; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.2fr; gap: 2.5rem; }
.footer-brand { font-family: var(--font-display); font-size: 1.8rem; margin: 0 0 .5rem; letter-spacing: .05em; }
.footer-h { font-family: var(--font-ui); font-size: .74rem; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--cream); margin: 0 0 .8rem; }
.site-footer li { margin-bottom: .45rem; font-size: 1.02rem; }
.site-footer a { color: var(--cream-dim); text-decoration: none; }
.site-footer a:hover { color: var(--cream); text-decoration: underline; }
.footer-bottom { border-top: 1px solid var(--line); margin-top: 2.5rem; padding-top: 1.4rem; display: flex; flex-wrap: wrap; gap: .5rem 2rem; justify-content: space-between; }
.footer-bottom p { margin: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; }
  /* Width MUST be explicit here. Every child is position:absolute, so this box
     has no in-flow content — anything that makes a grid item size to its
     content (auto margins, justify-self:center, float, inline-block) collapses
     it to 0 wide, which then makes aspect-ratio compute 0 height and the covers
     disappear entirely. `width: min(100%, 380px)` keeps it centred via the
     margin below while staying explicitly sized. */
  .hero-covers { order: -1; width: min(100%, 380px); margin-inline: auto; }
  .book-detail-top, .book-detail-body, .signup-inner { grid-template-columns: 1fr; gap: 2rem; }
  .book-detail-cover { max-width: 300px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 700px) {
  body { font-size: 1.1rem; }

  .nav-burger {
    display: block; width: 30px; height: 22px; position: relative; cursor: pointer; margin-left: auto;
  }
  .nav-burger span, .nav-burger::before, .nav-burger::after {
    content: ""; position: absolute; left: 0; width: 100%; height: 2px; background: var(--cream);
    transition: transform .2s ease, opacity .2s ease;
  }
  .nav-burger::before { top: 0; }
  .nav-burger span { top: 10px; }
  .nav-burger::after { bottom: 0; }

  .site-nav {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: flex-start; gap: 0;
    background: var(--ink-2); border-bottom: 1px solid var(--line); padding: .5rem 1.25rem 1.25rem;
  }
  .nav-toggle:checked ~ .site-nav { display: flex; }
  .nav-toggle:checked ~ .nav-burger span { opacity: 0; }
  .nav-toggle:checked ~ .nav-burger::before { transform: translateY(10px) rotate(45deg); }
  .nav-toggle:checked ~ .nav-burger::after { transform: translateY(-10px) rotate(-45deg); }
  .site-nav a { padding: .85rem 0; width: 100%; border-bottom: 1px solid var(--line); }
  .site-nav a[aria-current="page"] { border-bottom: 1px solid var(--line); }
  .nav-cta { margin-top: .9rem; text-align: center; border-bottom: none !important; }
  .header-inner { position: relative; flex-wrap: wrap; }

  .book-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
}
