/* Creative Rift - warm editorial system
   Palette and typographic feel modelled on anthropic.com: ivory ground,
   warm transitional serif for display, grotesque for UI, clay accent. */

:root {
  color-scheme: light;

  --bg:        #faf9f5;
  --bg-panel:  #f2efe6;
  --bg-deep:   #e9e5d9;
  --card:      #ffffff;

  --ink:       #191917;
  --ink-2:     #45443f;
  --ink-3:     #6f6e65;
  --ink-4:     #918f84;

  --rule:      #e2ddd0;
  --rule-soft: #ece8dc;

  --accent:    #d97757;
  --accent-dk: #a8492a;
  --accent-bg: #fbeee7;

  --good:      #3f6b4f;
  --warn:      #8a5a1f;
  --loss:      #9c3b26;

  --serif: "Newsreader", "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono:  ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;

  --wrap: 1120px;
  --wrap-narrow: 720px;

  --r:    10px;
  --r-lg: 16px;

  --shadow: 0 1px 2px rgba(25,25,23,.04), 0 8px 24px -12px rgba(25,25,23,.10);
}

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

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.62;
  font-feature-settings: "kern" 1;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { max-width: 100%; display: block; }

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

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

:focus-visible {
  outline: 2px solid var(--accent-dk);
  outline-offset: 3px;
  border-radius: 3px;
}

/* ---------- type ---------- */

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 400;
  color: var(--ink);
  letter-spacing: -0.015em;
  margin: 0;
  text-wrap: balance;
}

h1 { font-size: clamp(2.5rem, 5.6vw, 4rem);   line-height: 1.05; letter-spacing: -0.028em; }
h2 { font-size: clamp(1.85rem, 3.4vw, 2.6rem); line-height: 1.14; letter-spacing: -0.022em; }
h3 { font-size: clamp(1.2rem, 1.7vw, 1.45rem); line-height: 1.28; }
h4 { font-family: var(--sans); font-size: .95rem; font-weight: 600; letter-spacing: .005em; }

p { margin: 0 0 1.05em; }
p:last-child { margin-bottom: 0; }

.lede {
  font-size: clamp(1.1rem, 1.55vw, 1.3rem);
  line-height: 1.55;
  color: var(--ink-2);
}

.eyebrow {
  font-family: var(--sans);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-4);
  margin: 0 0 1.1rem;
}

.serif-em { font-family: var(--serif); font-style: italic; }
.muted { color: var(--ink-3); }
.small { font-size: .875rem; line-height: 1.55; }
.xs    { font-size: .8rem;  line-height: 1.5; }
.num   { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }

/* ---------- layout ---------- */

.wrap   { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 clamp(20px, 5vw, 40px); }
.wrap.narrow > * { max-width: var(--wrap-narrow); }

section { padding: clamp(56px, 8vw, 104px) 0; }
section.tight { padding: clamp(40px, 5vw, 64px) 0; }
.panel { background: var(--bg-panel); }
.hr { height: 1px; background: var(--rule); border: 0; margin: 0; }

.grid { display: grid; gap: clamp(24px, 3.5vw, 44px); }
.g2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.split { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); align-items: start; }

@media (max-width: 860px) {
  .g2, .g3, .split { grid-template-columns: minmax(0, 1fr); }
}

/* Anchor links must clear the sticky header. */
section[id], div[id] { scroll-margin-top: 88px; }

/* ---------- header ---------- */

.site-head {
  position: sticky; top: 0; z-index: 40;
  background: rgba(250,249,245,.86);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--rule-soft);
}
.site-head .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; min-height: 68px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--serif); font-size: 1.22rem; color: var(--ink);
  letter-spacing: -.02em;
}
.brand:hover { text-decoration: none; }
.brand .mark {
  width: 22px; height: 22px; flex: none;
  border-radius: 6px;
  background: linear-gradient(150deg, var(--accent) 0%, var(--accent-dk) 100%);
}
.nav { display: flex; align-items: center; gap: clamp(18px, 2.4vw, 30px); }
.nav a {
  font-size: .9rem; color: var(--ink-2); font-weight: 450;
}
.nav a:hover { color: var(--ink); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--ink); font-weight: 550; }

@media (max-width: 660px) {
  .nav a.hide-sm { display: none; }
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--sans); font-size: .925rem; font-weight: 500;
  padding: 11px 20px; border-radius: 8px;
  border: 1px solid transparent; cursor: pointer;
  transition: background .16s ease, border-color .16s ease, color .16s ease, transform .12s ease;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { background: #302f2b; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-dk); }
.btn-ghost { border-color: var(--rule); color: var(--ink); background: transparent; }
.btn-ghost:hover { background: var(--bg-panel); border-color: var(--ink-4); }
.btn-sm { padding: 8px 14px; font-size: .85rem; }

/* ---------- hero ---------- */

.hero { padding: clamp(64px, 11vw, 132px) 0 clamp(48px, 7vw, 88px); }
.hero h1 { max-width: 18ch; }
.hero .lede { max-width: 54ch; margin-top: 1.4rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 2.2rem; }

/* ---------- service / feature blocks ---------- */

.svc { border-top: 1px solid var(--rule); padding-top: 22px; }
.svc h3 { margin-bottom: .5rem; }
.svc p { color: var(--ink-2); font-size: .95rem; }
.svc .idx {
  font-family: var(--mono); font-size: .74rem; color: var(--ink-4);
  letter-spacing: .04em; margin-bottom: 14px;
}

.card {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  padding: clamp(22px, 2.6vw, 32px);
}

.rows { border-top: 1px solid var(--rule); }
.row {
  display: grid; grid-template-columns: minmax(0,1fr) auto;
  gap: 16px 24px; align-items: baseline;
  padding: 16px 0; border-bottom: 1px solid var(--rule-soft);
}
.row .rl { color: var(--ink); font-size: .95rem; }
.row .rl small { display: block; color: var(--ink-3); font-size: .84rem; margin-top: 3px; }
.row .rr { font-family: var(--mono); font-size: .9rem; color: var(--ink); white-space: nowrap; }

ul.ticks { list-style: none; margin: 0; padding: 0; }
ul.ticks li {
  position: relative; padding-left: 22px; margin-bottom: .55em;
  font-size: .94rem; color: var(--ink-2);
}
ul.ticks li::before {
  content: ""; position: absolute; left: 3px; top: .62em;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
}
ul.ticks.plain li::before { background: var(--ink-4); }

.tag {
  display: inline-block; font-family: var(--sans); font-size: .72rem; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase;
  padding: 4px 9px; border-radius: 999px;
  background: var(--accent-bg); color: var(--accent-dk);
}
.tag.grey { background: var(--bg-deep); color: var(--ink-3); }
.tag.loss { background: #fbeae5; color: var(--loss); }

blockquote.pull {
  margin: 0; padding: 0 0 0 22px; border-left: 2px solid var(--accent);
  font-family: var(--serif); font-size: clamp(1.25rem, 2.1vw, 1.6rem);
  line-height: 1.42; color: var(--ink); letter-spacing: -.015em;
}

/* ---------- footer ---------- */

.site-foot {
  border-top: 1px solid var(--rule);
  padding: 44px 0 56px;
  color: var(--ink-3);
  font-size: .875rem;
}
.site-foot .wrap { display: flex; flex-wrap: wrap; gap: 18px 40px; justify-content: space-between; align-items: flex-end; }
.site-foot a { color: var(--ink-2); }

/* ---------- gate ---------- */

.gate-shell {
  min-height: 100vh; display: grid; place-items: center;
  padding: 40px 20px; background: var(--bg);
}
.gate {
  width: 100%; max-width: 430px; text-align: left;
}
.gate .card { padding: 32px; }
.gate h1 { font-size: 1.9rem; line-height: 1.15; margin-bottom: .6rem; }
.gate label { display: block; font-size: .82rem; font-weight: 600; color: var(--ink-2); margin-bottom: 8px; }
.gate input {
  width: 100%; font-family: var(--mono); font-size: 1.35rem; letter-spacing: .22em;
  text-align: center; padding: 14px 12px;
  border: 1px solid var(--rule); border-radius: 10px;
  background: var(--bg); color: var(--ink);
}
.gate input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-bg); }
.gate .btn { width: 100%; margin-top: 14px; }
.gate .err {
  margin-top: 12px; font-size: .875rem; color: var(--loss);
  min-height: 1.3em;
}
.gate .hint { margin-top: 18px; font-size: .82rem; color: var(--ink-3); line-height: 1.5; }

/* ---------- proposal ---------- */

.doc { padding-bottom: 0; }
.doc-head { padding: clamp(48px, 7vw, 92px) 0 clamp(28px, 4vw, 44px); }
.doc-meta {
  display: flex; flex-wrap: wrap; gap: 8px 28px;
  margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--rule);
  font-size: .85rem; color: var(--ink-3);
}
.doc-meta b { color: var(--ink-2); font-weight: 550; }

.prose { max-width: 68ch; }
.prose h2 { margin-top: 0; }
.prose p, .prose ul { color: var(--ink-2); }
.prose > * + * { margin-top: 1.05em; }
.prose h2 + p { margin-top: .9em; }

.stat-strip {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1px; background: var(--rule);
  border: 1px solid var(--rule); border-radius: var(--r-lg); overflow: hidden;
}
.stat {
  background: var(--card); padding: 22px;
}
.stat .k { font-family: var(--mono); font-size: 1.5rem; letter-spacing: -.03em; color: var(--ink); }
.stat .l { font-size: .82rem; color: var(--ink-3); margin-top: 6px; line-height: 1.45; }

/* configurator */

.cfg { display: grid; grid-template-columns: minmax(0,1fr) 350px; gap: 36px; align-items: start; }
.cfg > * { min-width: 0; }
@media (max-width: 1000px) { .cfg { grid-template-columns: minmax(0, 1fr); } }

.cfg-group { margin-bottom: 34px; }
.cfg-group > h3 { margin-bottom: 4px; }
.cfg-group > .small { color: var(--ink-3); margin-bottom: 16px; }

.opt {
  display: block; position: relative; cursor: pointer;
  border: 1px solid var(--rule); border-radius: var(--r);
  background: var(--card); padding: 18px 20px;
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}
.opt + .opt { margin-top: 10px; }
.opt:hover { border-color: var(--ink-4); }
.opt:focus-visible { outline: 2px solid var(--accent-dk); outline-offset: 3px; }
.opt-top { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: flex-start; justify-content: space-between; }
.opt-name { min-width: 0; }
.opt-name { font-size: .98rem; font-weight: 550; color: var(--ink); display: flex; align-items: center; gap: 9px; flex: 1 1 auto; }
.opt-price { font-family: var(--mono); font-size: .92rem; color: var(--ink); white-space: nowrap; }
.opt-desc { font-size: .86rem; color: var(--ink-3); margin-top: 7px; max-width: 62ch; }
.opt .box {
  width: 17px; height: 17px; flex: none; border-radius: 4px;
  border: 1.5px solid var(--ink-4); background: var(--bg);
  display: grid; place-items: center; margin-top: 2px;
}
.opt .box.radio { border-radius: 50%; }
.opt .box svg { width: 11px; height: 11px; opacity: 0; color: #fff; }
.opt.on { border-color: var(--accent); background: linear-gradient(0deg, var(--accent-bg), var(--accent-bg)), var(--card); box-shadow: 0 0 0 1px var(--accent) inset; }
.opt.on .box { background: var(--accent); border-color: var(--accent); }
.opt.on .box svg { opacity: 1; }
.opt.locked { opacity: .72; cursor: default; background: var(--bg-panel); }
.opt.locked:hover { border-color: var(--rule); }

.opt-forgone {
  margin-top: 12px; padding-top: 11px; border-top: 1px dashed #e6cfc6;
  font-size: .85rem; color: var(--loss); display: none;
}
.opt.show-forgone .opt-forgone { display: block; }

.opt-sub { margin-top: 14px; padding-top: 13px; border-top: 1px solid var(--rule-soft); display: none; }
.opt.on .opt-sub { display: block; }
.seg { display: inline-flex; border: 1px solid var(--rule); border-radius: 8px; overflow: hidden; background: var(--bg); }
.seg button {
  font-family: var(--sans); font-size: .82rem; font-weight: 500; color: var(--ink-2);
  padding: 7px 13px; border: 0; background: transparent; cursor: pointer;
}
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }

/* summary rail */

.rail { position: sticky; top: 88px; }
.rail .card { padding: 24px; }
.rail h3 { font-family: var(--sans); font-size: .78rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-4); margin-bottom: 18px; }
.sum-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 14px; align-items: baseline; padding: 9px 0; font-size: .9rem; }
.sum-row .sl { color: var(--ink-2); min-width: 0; flex: 1 1 60%; }
.sum-row .sv { font-family: var(--mono); color: var(--ink); white-space: nowrap; }
.sum-row.total { border-top: 1px solid var(--rule); margin-top: 8px; padding-top: 15px; }
.sum-row.total .sl { font-weight: 600; color: var(--ink); font-size: .95rem; }
.sum-row.total .sv { font-size: 1.32rem; letter-spacing: -.03em; }
.sum-row.sub .sl, .sum-row.sub .sv { color: var(--ink-3); font-size: .84rem; }
.rail-note { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--rule-soft); font-size: .8rem; color: var(--ink-3); line-height: 1.5; }
.rail .btn { width: 100%; margin-top: 16px; }

.forgone-card {
  margin-top: 14px; border: 1px solid #ecd5cc; background: #fdf4f1;
  border-radius: var(--r-lg); padding: 20px;
}
.forgone-card h3 { color: var(--loss); }
.forgone-card .k { font-family: var(--mono); font-size: 1.4rem; letter-spacing: -.03em; color: var(--loss); }
.forgone-card p { font-size: .84rem; color: #7a3a28; margin-top: 8px; line-height: 1.5; }
.forgone-card ul { margin: 12px 0 0; padding-left: 18px; font-size: .83rem; color: #7a3a28; }
.forgone-card li { margin-bottom: 4px; }

table.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.tbl th, table.tbl td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--rule-soft); vertical-align: top; }
table.tbl th { font-size: .76rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-4); font-weight: 600; border-bottom-color: var(--rule); }
table.tbl td.n { font-family: var(--mono); white-space: nowrap; }
.tbl-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px);
  background: var(--ink); color: var(--bg); font-size: .875rem;
  padding: 11px 18px; border-radius: 999px; opacity: 0; pointer-events: none;
  transition: opacity .2s ease, transform .2s ease; z-index: 90;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

@media print {
  .site-head, .rail .btn, .toast, .no-print { display: none !important; }
  body { background: #fff; font-size: 11pt; }
  .cfg { grid-template-columns: 1fr; }
  .rail { position: static; }
  section { padding: 18px 0; }
}

/* Submission form in the totals rail. */
.fld {
  display: block;
  width: 100%;
  margin: 0 0 8px;
  padding: 10px 12px;
  font: inherit;
  font-size: .88rem;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 7px;
}
.fld:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.fld::placeholder { color: var(--ink-3, #8c8c8c); }
textarea.fld { resize: vertical; min-height: 68px; }
#submitPanel .btn { margin-top: 4px; }

/* ---- Generated agreement ---- */
#agreement { display: none; }
#agreement.show { display: block; }
body.agreement-open > *:not(#agreement):not(.toast) { display: none !important; }

.agr-wrap { max-width: 46em; margin: 0 auto; padding: clamp(28px,5vw,64px) clamp(18px,4vw,32px); }
.agr-head { border-bottom: 2px solid var(--ink); padding-bottom: 18px; margin-bottom: 30px; }
.agr-head .brand { font-weight: 700; letter-spacing: .02em; font-size: 1.05rem; }
.agr-head h1 { font-size: 1.5rem; margin: 14px 0 6px; font-weight: 600; }
.agr-meta { font-size: .82rem; color: var(--ink-2); }
.agr h2 {
  font-size: .78rem; text-transform: uppercase; letter-spacing: .09em;
  color: var(--ink-2); margin: 30px 0 10px; font-weight: 700;
}
.agr p, .agr li { font-size: .9rem; line-height: 1.62; }
.agr table { width: 100%; border-collapse: collapse; margin: 10px 0 4px; font-size: .88rem; }
.agr th, .agr td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.agr th { font-weight: 600; color: var(--ink-2); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; }
.agr td.amt { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.agr tr.tot td { border-top: 2px solid var(--ink); border-bottom: none; font-weight: 700; padding-top: 11px; }
.agr .note { font-size: .8rem; color: var(--ink-2); }
.agr dl { margin: 0; }
.agr dt { font-weight: 600; font-size: .86rem; margin-top: 13px; }
.agr dd { margin: 3px 0 0; font-size: .86rem; color: var(--ink-2); line-height: 1.58; }
.sig-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 34px; margin-top: 20px; }
.sig-box { padding-top: 8px; }
.sig-line { border-bottom: 1px solid var(--ink); height: 40px; margin-bottom: 7px; }
.sig-box .lbl { font-size: .74rem; color: var(--ink-2); text-transform: uppercase; letter-spacing: .06em; }
.agr-callout {
  border: 1px solid var(--ink); border-left-width: 4px;
  padding: 13px 16px; margin: 22px 0; font-size: .86rem; line-height: 1.58;
}
@media (max-width: 560px) { .sig-grid { grid-template-columns: 1fr; gap: 24px; } }
@media print {
  body.agreement-open > *:not(#agreement) { display: none !important; }
  #agreement { display: block !important; }
  .agr-wrap { max-width: none; padding: 0; }
  .agr-callout { break-inside: avoid; }
  .sig-grid { break-inside: avoid; }
  .agr h2 { break-after: avoid; }
}

/* ---- Like-for-like package comparison ---- */
.cmp-card { margin-top: 16px; padding: clamp(18px,3vw,26px); border: 1px solid var(--rule); border-radius: 12px; background: var(--paper); }
.cmp-card h3 { font-family: var(--sans); font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); margin: 0 0 6px; }
.cmp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.cmp-col { padding: 14px 15px; border: 1px solid var(--rule); border-radius: 9px; background: var(--bg); }
.cmp-col.on { border-color: var(--ink); border-width: 2px; padding: 13px 14px; }
.cmp-name { font-size: .82rem; font-weight: 600; margin-bottom: 7px; }
.cmp-total { font-size: 1.5rem; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.02em; margin-bottom: 10px; }
.cmp-rows > div { display: flex; justify-content: space-between; gap: 10px; font-size: .78rem; color: var(--ink-2); padding: 4px 0; border-top: 1px solid var(--rule-soft); }
.cmp-rows > div:first-child { border-top: 0; }
.cmp-verdict { font-size: .88rem; line-height: 1.6; margin: 15px 0 0; padding-top: 14px; border-top: 1px solid var(--rule); }
@media (max-width: 620px) { .cmp-grid { grid-template-columns: 1fr; } }
