/* flipwright — standalone product page.
   Responsive contract: mobile <768, tablet 768-1279, desktop 1280-1919,
   TV 1920+. All type in rem, layout in grid/flex, no fixed content widths. */

/* ---------- typefaces (self-hosted, variable) ----------
   Self-hosted on purpose: the CSP is `default-src 'self'`, so a Google Fonts
   <link> would be blocked outright. One variable file per family, ~92 KB total,
   with font-display: swap so text paints before the font arrives. */
@font-face {
  font-family: 'Space Grotesk';
  src: url("fonts/SpaceGrotesk-500.87c506d88b9f.woff2") format('woff2-variations');
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url("fonts/Inter-400.260c81a4759b.woff2") format('woff2-variations');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url("fonts/JetBrainsMono-500.a21e038a03f7.woff2") format('woff2-variations');
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #0d1117;
  --ink-2: #151b24;
  --line: #263041;
  --text: #e6edf3;
  --muted: #93a1b5;
  --accent: #4ade80;
  --accent-dim: #14532d;
  --warn: #fbbf24;
  --radius: 0.9rem;
  --font: 'Inter', ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: 'Space Grotesk', 'Inter', ui-sans-serif, system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --wrap: 72rem;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(circle at 15% -10%, #14251c 0%, transparent 45%),
    var(--ink);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.skip {
  position: absolute; left: -999px; top: 0;
  background: var(--accent); color: #04140a; padding: 0.6rem 1rem; z-index: 20;
}
.skip:focus { left: 1rem; top: 1rem; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ---------- header ---------- */
.site-header {
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--ink) 85%, transparent);
  backdrop-filter: blur(6px);
  position: sticky; top: 0; z-index: 10;
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; min-height: 3.75rem;
}
.wordmark {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--font-display); font-weight: 700; font-size: 1.15rem;
  letter-spacing: -0.02em; color: var(--text);
}
.wordmark:hover { text-decoration: none; }
.mark { color: var(--text); width: 1.5rem; height: 1.5rem; flex: none; display: block; }
.nav { display: flex; align-items: center; gap: 1.25rem; font-size: 0.9rem; }
.nav a { color: var(--muted); }
.nav a:hover { color: var(--text); text-decoration: none; }
.nav-cta {
  color: #04140a !important;
  background: var(--accent);
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  font-weight: 600;
  min-height: 2.75rem;
  display: inline-flex; align-items: center;
}

/* mobile navigation: under 768 the links collapse into a menu button */
.menu-btn {
  display: none;
  flex-direction: column; justify-content: center; gap: 0.28rem;
  width: 2.75rem; height: 2.75rem; padding: 0.55rem;
  background: transparent; border: 1px solid var(--line); border-radius: 0.5rem;
  cursor: pointer;
}
.menu-btn span { display: block; height: 2px; width: 100%; background: var(--text); border-radius: 2px; }
.menu-btn[aria-expanded="true"] { border-color: var(--accent); }

@media (max-width: 767px) {
  .menu-btn { display: flex; }
  .nav {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--ink-2); border-bottom: 1px solid var(--line);
    padding: 0.5rem 1.25rem 1rem;
    display: none;
  }
  .nav.open { display: flex; }
  .nav a { padding: 0.85rem 0; border-bottom: 1px solid var(--line); font-size: 1rem; }
  .nav a:last-child { border-bottom: 0; }
  .nav-cta { justify-content: center; margin-top: 0.75rem; }
  .site-header { position: relative; }
}

/* ---------- hero ---------- */
.hero { padding: 3rem 1.25rem 2rem; }
.eyebrow {
  font-family: var(--font-display);
  text-transform: uppercase; letter-spacing: 0.16em; font-size: 0.7rem;
  font-weight: 500; color: var(--accent); margin: 0 0 0.75rem;
}
h1, h2, h3, .wordmark, .btn, .eyebrow, .tier-line {
  font-family: var(--font-display);
}
h1 {
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1.02; letter-spacing: -0.035em; font-weight: 700; margin: 0 0 1rem;
}
h2 { font-size: 1.2rem; letter-spacing: -0.015em; font-weight: 700; margin: 0 0 1rem; }
.lede { letter-spacing: -0.005em; }
.lede { font-size: 1.06rem; color: #c8d3e0; max-width: 46rem; margin: 0 0 1rem; }
.fine { color: var(--muted); font-size: 0.9rem; }
.tiny { font-size: 0.8rem; }
.spaced { margin-top: 1rem; }

/* ---------- tool ---------- */
.tool-grid {
  display: grid; gap: 1.25rem;
  grid-template-columns: 1fr;
  align-items: start;
  padding-bottom: 1rem;
}
.card {
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.35rem;
}
label {
  display: block; font-size: 0.82rem; font-weight: 600;
  color: var(--muted); margin: 0.85rem 0 0.35rem;
  text-transform: uppercase; letter-spacing: 0.06em;
}
label:first-of-type { margin-top: 0; }
.opt { text-transform: none; letter-spacing: 0; font-weight: 400; color: #64748b; }
input, select, button { font: inherit; }
input[type="text"], input[type="date"], input[type="number"], input[type="email"], select {
  width: 100%;
  background: #0b1017;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 0.55rem;
  padding: 0.7rem 0.8rem;
  min-height: 2.75rem;
}
input:focus, select:focus, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.row2 { display: grid; gap: 1rem; grid-template-columns: 1fr; }
.checks {
  border: 1px solid var(--line); border-radius: 0.55rem;
  margin: 1.1rem 0 0; padding: 0.8rem 1rem;
}
.checks legend {
  font-size: 0.78rem; color: var(--muted); text-transform: uppercase;
  letter-spacing: 0.06em; padding: 0 0.35rem;
}
.check { display: flex; gap: 0.55rem; align-items: center; text-transform: none;
  letter-spacing: 0; font-weight: 400; color: var(--text); font-size: 0.92rem;
  margin: 0.35rem 0; }
.check input { min-height: auto; width: 1.15rem; height: 1.15rem; accent-color: var(--accent); }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 2.9rem; padding: 0.7rem 1.2rem; margin-top: 1.1rem;
  background: var(--accent); color: #04140a; border: 0;
  border-radius: 0.6rem; font-weight: 700; cursor: pointer;
}
.btn:hover { filter: brightness(1.08); }
.btn[disabled] { opacity: 0.6; cursor: progress; }
.btn.ghost {
  background: transparent; color: var(--text);
  border: 1px solid var(--line); margin-top: 0;
}
.ghost:hover { border-color: var(--accent); color: var(--accent); }

.status { min-height: 1.2rem; font-size: 0.88rem; color: var(--warn); margin: 0.7rem 0 0; }
.status.ok { color: var(--accent); }
.status.err { color: #f87171; }

/* ---------- result ---------- */
.result h3 { font-size: 1.05rem; margin: 1.4rem 0 0.5rem; }
.result h3:first-child { margin-top: 0; }
.kv { display: grid; grid-template-columns: 1fr; gap: 0.4rem; margin: 0; }
.kv div { display: flex; justify-content: space-between; gap: 1rem;
  border-bottom: 1px dashed var(--line); padding: 0.4rem 0; font-size: 0.92rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 0.95em; }
.badge {
  display: inline-block; background: var(--accent-dim); color: var(--accent);
  border-radius: 999px; padding: 0.1rem 0.6rem; font-size: 0.8rem;
  font-weight: 700; margin-right: 0.4rem;
}
.tbl { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.tbl th, .tbl td {
  text-align: left; padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}
.tbl th { color: var(--muted); font-weight: 600; font-size: 0.74rem;
  text-transform: uppercase; letter-spacing: 0.08em; font-family: var(--font-display); }
.tbl td { font-family: var(--mono); font-size: 0.85rem; }
.note {
  border-left: 3px solid var(--warn); padding: 0.5rem 0 0.5rem 0.8rem;
  color: #e7d9b6; font-size: 0.9rem; margin: 0.8rem 0 0;
}
.share, .lead { margin-top: 1.4rem; border-top: 1px solid var(--line); padding-top: 1.1rem; }
.share-row { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.share-row input { flex: 1 1 12rem; }

/* ---------- sections ---------- */
.section { padding: 2.5rem 1.25rem; border-top: 1px solid var(--line); }
.steps { padding-left: 1.2rem; margin: 0; max-width: 52rem; }
.steps li { margin: 0.8rem 0; color: #c8d3e0; }
.steps strong { color: var(--text); }
.grid-2 { display: grid; gap: 1.25rem; grid-template-columns: 1fr; }
.plan-title { font-family: var(--font-display); font-weight: 700;
  font-size: clamp(1.7rem, 4vw, 2.6rem); letter-spacing: -0.03em; word-break: break-all; }
.tier-line { font-size: 1rem; margin: 0 0 0.6rem; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); margin-top: 2rem; padding: 1.5rem 0; }
.footer-inner { display: flex; flex-direction: column; gap: 0.5rem; font-size: 0.85rem;
  color: var(--muted); }

/* ---------- tablet 768-1279 ---------- */
@media (min-width: 768px) {
  .wrap { padding: 0 1.75rem; }
  .hero, .section { padding-left: 1.75rem; padding-right: 1.75rem; }
  .row2 { grid-template-columns: 1fr 1fr; }
  .tool-grid { grid-template-columns: 1fr 1fr; }
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .kv { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: row; justify-content: space-between; align-items: center; }
  .hero { padding-top: 4rem; }
}

/* ---------- desktop 1280-1919 ---------- */
@media (min-width: 1280px) {
  body { font-size: 1.02rem; }
  .tool-grid { grid-template-columns: 1.05fr 1fr; gap: 1.75rem; }
  .hero { padding-top: 5rem; padding-bottom: 2.5rem; }
  .section { padding-top: 3.25rem; padding-bottom: 3.25rem; }
}

/* ---------- TV / large 1920+ ---------- */
@media (min-width: 1920px) {
  :root { --wrap: 100rem; }
  body { font-size: 1.12rem; }
  h1 { font-size: 3.9rem; }
  .card { padding: 1.9rem; }
}

/* ---------- print (the PDF path) ---------- */
@media print {
  body { background: #fff; color: #111; }
  .site-header, .site-footer, .nav, #plan-form, .share, .lead, .btn { display: none !important; }
  .card { border: 1px solid #ccc; background: #fff; break-inside: avoid; }
  .fine, .tbl th { color: #444; }
  a { color: #111; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}

/* ---------- sales copy blocks ---------- */
.pains {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 1rem; grid-template-columns: repeat(2, minmax(0, 1fr));
}
.pains li {
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.1rem 1.25rem;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--muted);
}
.pains strong {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-bottom: 0.35rem;
}

.ticks { list-style: none; margin: 1.5rem 0 0; padding: 0; display: grid; gap: 0.55rem; }
.ticks li { position: relative; padding-left: 1.7rem; font-size: 0.92rem; color: var(--muted); }
.ticks li::before {
  content: "✓"; position: absolute; left: 0; top: 0;
  color: var(--accent); font-weight: 700;
}

.cta-band { border-top: 1px solid var(--line); margin-top: 2rem; padding-top: 2.25rem; }
.form-note { margin: -0.4rem 0 1rem; }

@media (max-width: 767px) {
  .pains { grid-template-columns: 1fr; }
}

.market-note { margin-top: 0.9rem; max-width: 46rem; opacity: 0.85; }

/* primary public CTA + a quiet utility link beside it */
.hero-actions { display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap; margin-top: 1.4rem; }
.hero-actions .quiet, .quiet {
  color: var(--muted); font-size: 0.9rem; text-decoration: underline;
  text-underline-offset: 3px; text-decoration-color: var(--line);
}
.hero-actions .quiet:hover { color: var(--text); }
/* On a phone the quiet link measured 23px tall with no padding - under the 44px minimum.
   Give it a real hit area without changing how it looks at rest. */
@media (max-width: 767px) {
  .hero-actions { gap: 0.75rem; }
  .hero-actions .quiet { display: inline-flex; align-items: center; min-height: 44px; padding: 0 0.2rem; }
}

/* ---------------------------------------------------------------- plan card ---- */
.plan-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--ink-2);
  padding: 1.4rem 1.4rem 1.1rem;
  margin-top: 1.2rem;
}
.plan-card-head { display: flex; gap: 1rem; justify-content: space-between;
  align-items: flex-start; flex-wrap: wrap; }
.plan-domain { margin: 0; font-family: var(--font-display); font-size: 1.55rem; letter-spacing: -.01em; }
.plan-kind { margin: .2rem 0 0; }
.plan-tier { font-family: var(--mono); font-size: .72rem; color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px; padding: .05rem .4rem; margin-left: .25rem; }
.plan-disclosure { margin: 0; max-width: 18rem; text-align: right; }

.plan-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: .8rem;
  margin: 1.1rem 0 .2rem; }
.plan-facts .k { display: block; color: var(--muted); font-size: .74rem;
  text-transform: uppercase; letter-spacing: .06em; }
.plan-facts .v { display: block; font-family: var(--mono); font-size: 1rem;
  font-variant-numeric: tabular-nums; margin-top: .15rem; }

.next-action { margin: 1.1rem 0 .4rem; padding: .8rem .9rem; border-radius: .6rem;
  border: 1px solid var(--line); border-left: 3px solid var(--accent); background: #10161f; }
.next-action .k { margin: 0; color: var(--muted); font-size: .74rem; text-transform: uppercase;
  letter-spacing: .06em; }
.next-action .v { margin: .25rem 0 .1rem; font-size: 1rem; }

.plan-figure { margin: 1.3rem 0 .4rem; }
.plan-figure figcaption { color: var(--muted); font-size: .74rem; text-transform: uppercase;
  letter-spacing: .06em; margin-bottom: .35rem; }
.plan-figure { max-width: 760px; }
/* capped, because a viewBox scales its text and height with the container: at 1920 an
   uncapped chart rendered 1497x561 and became the giant card this design rules out */
.plan-figure svg { display: block; width: 100%; height: auto; max-width: 760px; }

.tl .phase { stroke: none; }
.tl .phase-build { fill: #23303f; }
.tl .phase-ready { fill: #33413a; }
.tl .phase-market { fill: var(--accent-dim); }
.tl .phase-label { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.tl .tick { stroke: var(--line); stroke-width: 1; }
.tl .axis-label { fill: var(--muted); font-size: 10.5px; font-family: var(--mono);
  text-anchor: middle; }

.chart .prep { fill: #141b25; }
.chart .floor-line { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 4 4; }
.chart .floor-label { fill: var(--muted); font-size: 10.5px; font-family: var(--mono);
  dominant-baseline: hanging; }
.chart .price-path { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; }
.chart .price-point { fill: var(--accent); stroke: var(--ink-2); stroke-width: 2; }
.chart .price-label { fill: var(--text); font-size: 11px; font-family: var(--mono);
  text-anchor: middle; font-variant-numeric: tabular-nums; }
.chart .tick { stroke: var(--line); stroke-width: 1; }
.chart .axis-label { fill: var(--muted); font-size: 10.5px; font-family: var(--mono);
  text-anchor: middle; }
.fstep:focus { outline: none; }
.fstep:focus-visible .price-point { stroke: var(--text); stroke-width: 3; }
.fstep:focus-visible .price-label { fill: var(--accent); }

.plan-details { margin-top: 1.1rem; border-top: 1px solid var(--line); padding-top: .7rem; }
.plan-details summary { cursor: pointer; color: var(--muted); font-size: .86rem; }
.plan-details summary:hover { color: var(--text); }
.plan-details .tbl { margin-top: .7rem; }

.plan-work { margin: 1rem 0 .2rem; }
.plan-share { margin: 0; }

@media (max-width: 720px) {
  .plan-facts { grid-template-columns: 1fr; gap: .55rem; }
  .plan-disclosure { text-align: left; }
  /* contained scroll: labels stay readable, the page never scrolls sideways */
  .plan-figure { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .plan-figure svg { min-width: 520px; }
}

/* ------------------------------------------------------------ sign-in modal ---- */
.signin-dialog {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--ink-2);
  color: var(--text);
  padding: 1.5rem 1.5rem 1.2rem;
  max-width: 27rem;
  width: calc(100% - 2rem);
  position: relative;
}
.signin-dialog::backdrop { background: rgba(4, 7, 11, .66); }
.signin-dialog h2 { margin: 0 0 .6rem; font-family: var(--font-display); font-size: 1.3rem; }
.signin-close-row { position: absolute; top: .35rem; right: .45rem; margin: 0; }
.signin-x {
  background: none; border: 0; color: var(--muted);
  font-size: 1.5rem; line-height: 1; padding: .3rem .5rem; cursor: pointer;
  border-radius: .4rem;
}
.signin-x:hover, .signin-x:focus-visible { color: var(--text); }
.signin-cancel { background: none; border: 0; color: var(--muted); cursor: pointer;
  font: inherit; padding: .5rem .2rem; }
.signin-cancel:hover, .signin-cancel:focus-visible { color: var(--text); }
.signin-dialog .hero-actions { margin-bottom: 0; }

/* --------------------------------------------------- plan reasoning block ---- */
.plan-inputs { margin: .9rem 0 0; padding-top: .7rem; border-top: 1px solid var(--line); }
.caption-note { color: var(--muted); text-transform: none; letter-spacing: 0;
  margin-left: .4rem; font-size: .72rem; }
.plan-deadline { margin: .8rem 0 0; }
.why-plan { margin-top: 1.3rem; padding-top: .9rem; border-top: 1px solid var(--line); }
.why-plan h3 { margin: 0 0 .6rem; font-size: 1rem; font-family: var(--font-display); }
.why-plan dl { margin: 0; display: grid; gap: .7rem; }
.why-plan dt { color: var(--muted); font-size: .74rem; text-transform: uppercase;
  letter-spacing: .06em; }
.why-plan dd { margin: .18rem 0 0; font-size: .93rem; line-height: 1.45; }
.why-plan p { margin-top: .8rem; }

/* ------------------------------------------------------------ account menu ---- */
.account-menu { position: relative; }
.account-menu > summary {
  cursor: pointer; list-style: none; color: var(--text);
  padding: .25rem .1rem; border-radius: .35rem;
}
.account-menu > summary::-webkit-details-marker { display: none; }
.account-menu > summary::after { content: " ▾"; color: var(--muted); font-size: .8em; }
.account-menu[open] > summary, .account-menu > summary:focus-visible { color: var(--accent); outline: none; }
.account-panel {
  position: absolute; right: 0; top: calc(100% + .5rem); z-index: 20;
  min-width: 13rem; padding: .7rem .8rem;
  background: var(--ink-2); border: 1px solid var(--line); border-radius: .6rem;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .35);
  display: grid; gap: .45rem;
}
.account-panel a { color: var(--text); text-decoration: none; }
.account-panel a:hover, .account-panel a:focus-visible { color: var(--accent); }
.account-email { margin: 0; overflow: hidden; text-overflow: ellipsis; }
.linkish {
  background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--muted); font: inherit; text-align: left;
}
.linkish:hover, .linkish:focus-visible { color: var(--warn); }
.signout-card { display: flex; justify-content: space-between; align-items: center;
  gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.signout-card h1 { margin: 0; font-size: 1.25rem; }
@media (max-width: 720px) {
  .account-panel { right: auto; left: 0; }
}
