/* ============================================================================
   PROPOSAL TEMPLATE — design system
   The studio's constant identity. Per project, only --accent + content change.
   Concept: "the bound document" — an editorial proposal you read, not a
   landing page you scroll. Mono = the spec voice. Serif = the argument.
   ========================================================================== */

:root {
  /* Surfaces ------------------------------------------------------------- */
  --ink:          #191b18;   /* near-black, faintly green */
  --ink-soft:     #3c3f39;
  --paper:        #f4f6f2;   /* sage paper, echoes the source palette */
  --paper-panel:  #ebefe7;   /* alternating band */
  --paper-card:   #ffffff;
  --muted:        #6c726a;   /* secondary text */
  --line:         #d7ddd2;   /* hairline rules */
  --line-soft:    #e7eae2;

  /* Accent — OVERRIDDEN PER CLIENT by app.js from PROPOSAL.meta.accent ---- */
  --accent:          #2f5d4f;
  --accent-contrast: #ffffff;
  --accent-tint:     color-mix(in srgb, var(--accent) 10%, var(--paper));

  /* Type ----------------------------------------------------------------- */
  --display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --body:    "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono:    "Spline Sans Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  /* A precise editorial scale */
  --step--1: clamp(0.78rem, 0.76rem + 0.1vw, 0.84rem);
  --step-0:  clamp(1rem, 0.97rem + 0.18vw, 1.12rem);
  --step-1:  clamp(1.2rem, 1.12rem + 0.4vw, 1.45rem);
  --step-2:  clamp(1.5rem, 1.34rem + 0.8vw, 2.05rem);
  --step-3:  clamp(2.1rem, 1.7rem + 2vw, 3.4rem);
  --step-4:  clamp(2.8rem, 2rem + 4vw, 5.6rem);

  /* Rhythm --------------------------------------------------------------- */
  --measure: 64ch;
  --gutter:  clamp(1.25rem, 5vw, 6rem);
  --band-y:  clamp(4rem, 8vw, 8rem);
  --radius:  14px;
  --ease:    cubic-bezier(0.22, 1, 0.36, 1);
}

/* Reset ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--body);
  font-size: var(--step-0);
  line-height: 1.62;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection { background: var(--accent); color: var(--accent-contrast); }

a { color: inherit; }
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3 { font-family: var(--display); font-weight: 460; line-height: 1.04;
  letter-spacing: -0.01em; font-optical-sizing: auto; }

/* Shared helpers --------------------------------------------------------- */
.mono {
  font-family: var(--mono);
  font-size: var(--step--1);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.eyebrow {
  font-family: var(--mono);
  font-size: var(--step--1);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
}
.eyebrow::before {
  content: "";
  width: 1.6em; height: 1px;
  background: var(--accent);
  display: inline-block;
}

/* ============================================================================
   TOP BAR — persistent colophon: studio · client · ref
   ========================================================================== */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem var(--gutter);
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.4s var(--ease), background 0.4s var(--ease);
}
.topbar.scrolled { border-bottom-color: var(--line); }
.topbar__studio { font-family: var(--display); font-size: var(--step-1);
  letter-spacing: -0.02em; font-weight: 500; }
.topbar__studio b { color: var(--accent); font-weight: 500; }
.topbar__meta { font-family: var(--mono); font-size: var(--step--1);
  color: var(--muted); letter-spacing: 0.04em; text-align: right; }
.topbar__meta span { color: var(--ink); }
@media (max-width: 640px) { .topbar__meta { display: none; } }

/* Thin reading-progress line under the bar — the signature, part 1 -------- */
.progress {
  position: fixed; left: 0; top: 0; height: 2px; width: 0%;
  background: var(--accent); z-index: 60;
  transition: width 0.08s linear;
}

/* ============================================================================
   LAYOUT — a centered reading column with a left margin rail
   ========================================================================== */
.doc { position: relative; }

.band { padding: var(--band-y) var(--gutter); }
.band--panel { background: var(--paper-panel); }
.band__inner { max-width: 78rem; margin: 0 auto; }

/* sections get a number + heading head, then a reading column */
.col { max-width: var(--measure); }
.col p + p { margin-top: 1.1rem; }
.lead { font-size: var(--step-1); line-height: 1.5; color: var(--ink-soft); }

.section-head { display: flex; gap: clamp(1rem, 3vw, 2.5rem);
  align-items: baseline; margin-bottom: clamp(2rem, 4vw, 3rem); }
.section-head__no { font-family: var(--mono); font-size: var(--step--1);
  color: var(--accent); letter-spacing: 0.1em; padding-top: 0.5em;
  flex: 0 0 auto; }
.section-head__body { flex: 1 1 auto; }
.section-head h2 { font-size: var(--step-3); max-width: 22ch; }
.section-head .kicker { color: var(--muted); margin-top: 0.9rem;
  max-width: 52ch; font-size: var(--step-1); }

/* ============================================================================
   COVER — the proposal's title page
   ========================================================================== */
.cover { padding: clamp(3rem, 9vw, 8rem) var(--gutter) var(--band-y);
  min-height: min(92vh, 900px); display: flex; flex-direction: column;
  justify-content: center; position: relative; }
.cover__inner { max-width: 78rem; margin: 0 auto; width: 100%; }
.cover h1 { font-size: var(--step-4); max-width: 18ch; margin: 1.6rem 0 0; }
.cover h1 em { font-style: italic; color: var(--accent); }
.cover__sub { font-size: var(--step-1); color: var(--ink-soft);
  max-width: 46ch; margin-top: 1.6rem; }
.cover__colophon { margin-top: clamp(2.5rem, 6vw, 4.5rem);
  display: flex; flex-wrap: wrap; gap: 1.4rem 3rem;
  padding-top: 1.6rem; border-top: 1px solid var(--line); }
.cover__field { font-family: var(--mono); font-size: var(--step--1); }
.cover__field span { display: block; color: var(--muted);
  letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 0.35rem; }
.cover__field b { font-weight: 500; color: var(--ink); font-size: 0.95rem;
  letter-spacing: 0.02em; }

/* scroll cue */
.cover__cue { position: absolute; bottom: 1.6rem; left: 50%;
  transform: translateX(-50%); font-family: var(--mono);
  font-size: var(--step--1); color: var(--muted); letter-spacing: 0.12em;
  text-transform: uppercase; display: inline-flex; flex-direction: column;
  align-items: center; gap: 0.5rem; }
.cover__cue::after { content: ""; width: 1px; height: 2.2rem;
  background: linear-gradient(var(--muted), transparent);
  animation: drift 2.4s var(--ease) infinite; }
@keyframes drift { 0%,100%{opacity:0.3; transform:scaleY(0.6) translateY(-30%);}
  50%{opacity:1; transform:scaleY(1) translateY(0);} }

/* ============================================================================
   LIST sections — understanding / approach
   ========================================================================== */
.items { display: grid; gap: 1px; background: var(--line-soft);
  border: 1px solid var(--line-soft); border-radius: var(--radius);
  overflow: hidden; margin-top: 0.5rem; }
.item { background: var(--paper); padding: clamp(1.4rem, 3vw, 2.2rem); }
.band--panel .item { background: var(--paper-panel); }
.item__no { font-family: var(--mono); font-size: var(--step--1);
  color: var(--accent); letter-spacing: 0.08em; }
.item h3 { font-size: var(--step-1); margin: 0.7rem 0 0.5rem;
  font-family: var(--display); font-weight: 500; letter-spacing: -0.01em; }
.item p { color: var(--ink-soft); }
@media (min-width: 720px) { .items--2 { grid-template-columns: 1fr 1fr; }
  .items--3 { grid-template-columns: repeat(3, 1fr); } }

/* ============================================================================
   SCOPE — a deliverables spec sheet
   ========================================================================== */
.scope { display: grid; gap: clamp(1.5rem, 3vw, 2.5rem); margin-top: 0.5rem; }
@media (min-width: 820px) { .scope { grid-template-columns: 1fr 1fr; } }
.scope__group { border-top: 2px solid var(--ink); padding-top: 1.1rem; }
.scope__group h3 { font-family: var(--mono); font-size: var(--step--1);
  text-transform: uppercase; letter-spacing: 0.12em; font-weight: 400;
  display: flex; justify-content: space-between; align-items: baseline; }
.scope__group h3 small { color: var(--muted); }
.scope__list { list-style: none; padding: 0; margin: 1rem 0 0; }
.scope__list li { display: flex; gap: 0.85rem; padding: 0.7rem 0;
  border-bottom: 1px solid var(--line-soft); color: var(--ink-soft); }
.scope__list li::before { content: "—"; color: var(--accent); flex: 0 0 auto; }

/* ============================================================================
   TIMELINE — phased plan
   ========================================================================== */
.timeline { list-style: none; padding: 0; margin: 0.5rem 0 0;
  display: grid; gap: 0; }
.phase { display: grid; grid-template-columns: minmax(7rem, 12rem) 1fr;
  gap: clamp(1rem, 3vw, 2.5rem); padding: clamp(1.3rem,3vw,2rem) 0;
  border-top: 1px solid var(--line); align-items: start; }
.phase:last-child { border-bottom: 1px solid var(--line); }
.phase__when { font-family: var(--mono); font-size: var(--step--1);
  letter-spacing: 0.04em; color: var(--accent); padding-top: 0.35em; }
.phase__when b { display:block; color: var(--ink); font-size: 0.95rem;
  letter-spacing: 0; margin-bottom: 0.3rem; text-transform: none; }
.phase h3 { font-family: var(--display); font-size: var(--step-1);
  font-weight: 500; }
.phase p { color: var(--ink-soft); margin-top: 0.5rem; max-width: 54ch; }
@media (max-width: 560px) { .phase { grid-template-columns: 1fr; gap: 0.6rem; } }

/* ============================================================================
   INVESTMENT — tiers
   ========================================================================== */
.tiers { display: grid; gap: 1.25rem; margin-top: 0.5rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); }
.tier { background: var(--paper-card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: clamp(1.5rem, 3vw, 2.2rem);
  display: flex; flex-direction: column; }
.tier--highlight { border-color: var(--accent);
  box-shadow: 0 1px 0 var(--accent), 0 18px 40px -28px var(--accent); }
.tier__tag { font-family: var(--mono); font-size: var(--step--1);
  text-transform: uppercase; letter-spacing: 0.12em; color: var(--accent); }
.tier h3 { font-family: var(--display); font-size: var(--step-2);
  font-weight: 500; margin: 0.4rem 0 0.2rem; }
.tier__price { font-family: var(--display); font-size: var(--step-2);
  font-weight: 500; margin-top: 0.8rem; }
.tier__price small { font-family: var(--mono); font-size: var(--step--1);
  color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em;
  display: block; margin-top: 0.3rem; }
.tier__summary { color: var(--ink-soft); margin-top: 0.9rem; }
.tier__includes { list-style: none; padding: 1.2rem 0 0; margin: 1.2rem 0 0;
  border-top: 1px solid var(--line-soft); display: grid; gap: 0.6rem; }
.tier__includes li { display: flex; gap: 0.7rem; font-size: 0.96rem;
  color: var(--ink-soft); }
.tier__includes li::before { content: "✓"; color: var(--accent);
  flex: 0 0 auto; font-size: 0.9em; padding-top: 0.15em; }
.invest-note { font-family: var(--mono); font-size: var(--step--1);
  color: var(--muted); margin-top: 1.6rem; letter-spacing: 0.02em; }

/* ============================================================================
   FAQ
   ========================================================================== */
.faq { margin-top: 0.5rem; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; list-style: none; padding: 1.3rem 0;
  display: flex; justify-content: space-between; gap: 1.5rem;
  font-family: var(--display); font-size: var(--step-1); font-weight: 500; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--mono);
  color: var(--accent); transition: transform 0.3s var(--ease); flex: 0 0 auto; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { color: var(--ink-soft); padding: 0 0 1.4rem; max-width: 60ch; }

/* ============================================================================
   CLOSING / CTA
   ========================================================================== */
.closing { background: var(--ink); color: var(--paper); }
.closing .eyebrow, .closing .section-head__no { color: var(--accent); }
.closing h2 { color: var(--paper); }
.closing .kicker { color: color-mix(in srgb, var(--paper) 72%, transparent); }
.cta-row { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 2.4rem; }
.btn { display: inline-flex; align-items: center; gap: 0.6rem;
  font-family: var(--mono); font-size: var(--step--1); letter-spacing: 0.06em;
  text-transform: uppercase; text-decoration: none; padding: 0.95rem 1.5rem;
  border-radius: 999px; border: 1px solid var(--accent); color: var(--ink);
  background: var(--accent); transition: transform 0.25s var(--ease),
  box-shadow 0.25s var(--ease), background 0.25s var(--ease); }
.btn:hover { transform: translateY(-2px); box-shadow: 0 12px 30px -16px var(--accent); }
.btn--ghost { background: transparent; color: var(--paper);
  border-color: color-mix(in srgb, var(--paper) 40%, transparent); }
.btn--ghost:hover { border-color: var(--paper); box-shadow: none; }
.contact { display: flex; flex-wrap: wrap; gap: 1.4rem 3rem; margin-top: 3rem;
  padding-top: 1.8rem; border-top: 1px solid color-mix(in srgb, var(--paper) 22%, transparent); }
.contact a { color: var(--paper); text-decoration: none;
  border-bottom: 1px solid var(--accent); }
.contact div span { display: block; font-family: var(--mono);
  font-size: var(--step--1); letter-spacing: 0.12em; text-transform: uppercase;
  color: color-mix(in srgb, var(--paper) 55%, transparent); margin-bottom: 0.3rem; }

/* ============================================================================
   FOOTER
   ========================================================================== */
.foot { padding: 2.4rem var(--gutter); display: flex; flex-wrap: wrap;
  gap: 0.6rem 2rem; justify-content: space-between;
  font-family: var(--mono); font-size: var(--step--1); color: var(--muted);
  letter-spacing: 0.04em; border-top: 1px solid var(--line); }

/* ============================================================================
   MARGIN RAIL — the table of contents that tracks reading (signature, part 2)
   ========================================================================== */
.rail { position: fixed; left: clamp(1rem, 2.4vw, 2.2rem); top: 50%;
  transform: translateY(-50%); z-index: 40; display: none; }
.rail ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.55rem; }
.rail a { display: flex; align-items: center; gap: 0.7rem; text-decoration: none;
  font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--muted); opacity: 0.55;
  transition: opacity 0.3s var(--ease), color 0.3s var(--ease); }
.rail a::before { content: ""; width: 1.4rem; height: 1px; background: currentColor;
  transition: width 0.3s var(--ease); }
.rail a .rail__label { opacity: 0; transform: translateX(-4px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
  max-width: 0; overflow: hidden; white-space: nowrap; }
.rail:hover a .rail__label { opacity: 1; transform: none; max-width: 14rem; }
.rail a.active { color: var(--accent); opacity: 1; }
.rail a.active::before { width: 2.4rem; background: var(--accent); }
@media (min-width: 1180px) { .rail { display: block; } }

/* ============================================================================
   MOTION — scroll reveal (disabled under reduced-motion)
   ========================================================================== */
.reveal { opacity: 0; transform: translateY(18px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .cover__cue::after { animation: none; }
}

/* Focus visibility — quality floor */
a:focus-visible, summary:focus-visible, .btn:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
