/* Shapewire shared theme — light, blue-accent system (context.dev-inspired).
   Variable NAMES are kept from the original brass theme so existing inline
   style="color:var(--brass-deep)" references retheme automatically. */

:root {
  --paper: #FFFFFF;            /* page background */
  --surface: #FFFFFF;          /* cards */
  --surface-2: #F4F5F7;        /* subtle fills, pill nav */
  --border: #E5E7EB;
  --border-strong: #D1D5DB;
  --text: #0A0F1E;
  --text-muted: #6B7280;

  /* "brass" slots now carry the blue accent */
  --brass: #2563EB;
  --brass-deep: #1D4ED8;
  --brass-strong: #2563EB;
  --brass-on-dark: #93C5FD;
  --brass-soft: rgba(37, 99, 235, 0.10);

  --dark: #0B0F19;             /* code / terminal panels */
  --dark-2: #111827;
  --dark-border: #26324B;
  --on-dark: #F8FAFC;
  --on-dark-muted: #94A3B8;
  --bad: #DC2626;

  --grad-accent: linear-gradient(135deg, #3B82F6 0%, #4F46E5 100%);
  --grad-wash: linear-gradient(180deg, #FFFFFF 0%, #EFF4FF 60%, #DCE7FF 100%);

  --radius-card: 16px;
  --shadow-card: 0 4px 8px 0 rgba(41,41,41,.06), 0 2px 4px 0 rgba(41,41,41,.04),
                 0 1px 2px 0 rgba(41,41,41,.04), 0 0 0 1px rgba(41,41,41,.08);
  --shadow-pop: 0 24px 48px -20px rgba(15,23,42,.25), 0 4px 12px rgba(15,23,42,.08),
                0 0 0 1px rgba(41,41,41,.06);

  --font-display: "IBM Plex Sans", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-ui: "IBM Plex Sans", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--paper); color: var(--text); font-family: var(--font-ui);
  font-size: 16px; line-height: 1.6; -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
.wrap { max-width: 880px; margin: 0 auto; padding: 0 clamp(1.2rem, 4vw, 1.6rem); }
.k { font-family: var(--font-mono); }

/* ---------- announcement bar ---------- */
.announce {
  background: var(--grad-accent); color: #fff; text-align: center; padding: .6rem 1rem;
  font-size: .84rem; font-weight: 500; letter-spacing: .01em;
}
.announce a { color: #fff; text-decoration: underline; text-underline-offset: 3px; font-weight: 650; }

/* ---------- nav ---------- */
header.top {
  position: sticky; top: 0; z-index: 30; background: rgba(255,255,255,.82);
  backdrop-filter: blur(12px); border-bottom: 1px solid var(--border);
}
.top-inner {
  max-width: 1100px; margin: 0 auto; padding: .7rem clamp(1.2rem, 4vw, 1.6rem);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.mark { display: flex; align-items: center; text-decoration: none; color: var(--text); }
/* Integrated lockup — wire and wordmark are one SVG, so scale by height only. */
.mark .logo { height: 36px; width: auto; display: block; }
@media (max-width: 420px) { .mark .logo { height: 28px; } }
.top-nav {
  display: flex; align-items: center; gap: .15rem;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 999px; padding: .28rem .4rem;
}
.top-nav a.link {
  font-size: .87rem; font-weight: 500; color: var(--text); text-decoration: none;
  padding: .42rem .85rem; border-radius: 999px;
}
.top-nav a.link:hover { background: #fff; box-shadow: 0 1px 2px rgba(15,23,42,.08); }
.top-nav a.link.current { color: var(--brass-deep); font-weight: 650; }
.top-actions { display: flex; align-items: center; gap: .6rem; }

/* nav dropdown */
.nav-dd { position: relative; }
.nav-dd > button {
  font-family: var(--font-ui); font-size: .87rem; font-weight: 500; color: var(--text);
  background: none; border: none; padding: .42rem .85rem; border-radius: 999px;
  cursor: pointer; display: inline-flex; align-items: center; gap: .35rem;
}
.nav-dd > button:hover, .nav-dd:focus-within > button { background: #fff; box-shadow: 0 1px 2px rgba(15,23,42,.08); }
.nav-dd .dd-caret { font-size: .58rem; color: var(--text-muted); transform: translateY(1px); transition: transform .15s; }
.nav-dd:hover .dd-caret, .nav-dd:focus-within .dd-caret { transform: translateY(1px) rotate(180deg); }
.dd-menu {
  display: none; position: absolute; top: calc(100% + .8rem); left: 50%; transform: translateX(-50%);
  background: #fff; border-radius: 16px; box-shadow: var(--shadow-pop);
  padding: .55rem; min-width: 21rem; z-index: 40;
}
.dd-menu::before { content: ""; position: absolute; top: -.9rem; left: 0; right: 0; height: .9rem; }
.nav-dd:hover .dd-menu, .nav-dd:focus-within .dd-menu { display: block; }
.dd-menu a {
  display: flex; align-items: flex-start; gap: .75rem; padding: .65rem .7rem;
  border-radius: 11px; text-decoration: none;
}
.dd-menu a:hover { background: var(--surface-2); }
.dd-icon {
  flex: none; width: 36px; height: 36px; border-radius: 10px; background: var(--grad-accent);
  display: flex; align-items: center; justify-content: center; color: #fff;
  box-shadow: 0 2px 5px rgba(37,99,235,.35);
}
.dd-icon svg { width: 19px; height: 19px; }
.dd-menu a .dd-title { display: block; font-size: .89rem; font-weight: 650; color: var(--text); line-height: 1.3; }
.dd-menu a .dd-sub { display: block; font-size: .76rem; color: var(--text-muted); margin-top: .15rem; line-height: 1.4; }
.dd-menu a.current .dd-title { color: var(--brass-deep); }

/* ---------- buttons ---------- */
.btn {
  font-family: var(--font-ui); font-weight: 600; text-decoration: none; display: inline-flex;
  align-items: center; justify-content: center; gap: .4rem; border-radius: 999px;
  white-space: nowrap; border: 1px solid transparent; cursor: pointer;
  transition: background .15s, box-shadow .15s, transform .15s;
}
.btn.solid { background: #111827; color: #fff; padding: .62rem 1.25rem; font-size: .89rem; }
.btn.solid:hover { background: #1F2937; transform: translateY(-1px); }
.btn.ghost-dark {
  background: #fff; color: #111827; border-color: rgba(10,15,30,.14);
  padding: .62rem 1.25rem; font-size: .89rem; box-shadow: 0 1px 2px rgba(15,23,42,.06);
}
.btn.ghost-dark:hover { border-color: rgba(10,15,30,.28); }
.btn.small { padding: .48rem .95rem; font-size: .82rem; }
@media (max-width: 720px) { .top-nav { display: none; } }

/* ---------- mobile menu (no JS: a plain disclosure) ----------
   A right-hand drawer. Both the scrim and the panel position against header.top
   (.mobile-nav is deliberately left unpositioned) so they can span the viewport
   independently of where the toggle sits in the header. The panel used to hang off
   the toggle itself with `right: 0`, which pushed it past the left edge of the
   screen on phones and clipped half of every label. */
.mobile-nav { display: none; }
.mobile-nav > summary {
  list-style: none; cursor: pointer; width: 44px; height: 44px; border-radius: 11px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  display: flex; align-items: center; justify-content: center; font-size: 1.15rem;
  position: relative; z-index: 60; /* stays above the open panel so it can close it */
  -webkit-tap-highlight-color: transparent;
}
.mobile-nav > summary::-webkit-details-marker { display: none; }
.mobile-nav[open] > summary { border-color: var(--brass); color: var(--brass-deep); background: #fff; }
/* ☰ turns into ✕ while the sheet is open */
.mobile-nav[open] > summary > span { display: none; }
.mobile-nav[open] > summary::after { content: "\00d7"; font-size: 1.7rem; line-height: 1; margin-top: -.2rem; }

/* Dims the strip of page left visible beside the drawer. Lives on the details
   rather than the panel, whose overflow:auto would clip it. */
.mobile-nav[open]::before {
  content: ""; position: absolute; top: 100%; left: 0; right: 0; z-index: 49;
  height: calc(100vh - 100%);
  height: calc(100dvh - 100%);
  background: rgba(15, 23, 42, .38); pointer-events: none;
}
.mobile-nav-panel {
  position: absolute; top: 100%; right: 0; left: auto; z-index: 50;
  width: 70%; min-width: min(16rem, 100%);
  height: calc(100vh - 100%);
  height: calc(100dvh - 100%); /* keeps clear of mobile browser chrome */
  background: #fff; border-top: 1px solid var(--border); box-shadow: var(--shadow-pop);
  padding: .4rem 1.1rem 2rem;
  display: flex; flex-direction: column;
  overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
}
.mobile-nav-panel a {
  padding: .85rem .25rem; text-decoration: none;
  font-size: .95rem; font-weight: 600; color: var(--text);
  border-bottom: 1px solid var(--border);
}
.mobile-nav-panel a:last-child { border-bottom: none; }
.mobile-nav-panel a:hover, .mobile-nav-panel a:focus { color: var(--brass-deep); }
/* Progressive enhancement: stop the page scrolling behind the open sheet. */
body:has(.mobile-nav[open]) { overflow: hidden; }
@media (max-width: 720px) {
  /* Toggle belongs at the edge, not stranded between the logo and the CTA. */
  .mobile-nav { display: block; order: 3; }
  .top-actions { order: 2; margin-left: auto; }
}
@media (max-width: 420px) { .top-inner { gap: .5rem; } .btn.small, .top-actions .btn { padding: .5rem .8rem; font-size: .8rem; } }

/* ---------- type & sections ---------- */
h1 {
  font-family: var(--font-display); font-weight: 550; font-size: clamp(2.1rem, 5.4vw, 3.3rem);
  line-height: 1.08; letter-spacing: -.035em; text-wrap: balance; margin: .3rem 0 0;
}
h1 .accent { color: var(--brass); }
h1 .brace { font-family: var(--font-mono); font-weight: 400; font-size: .85em; color: var(--brass); }
h2 {
  font-family: var(--font-display); font-weight: 600; font-size: clamp(1.5rem, 3.2vw, 1.9rem);
  letter-spacing: -.025em; text-wrap: balance; margin: 0; max-width: 26ch;
}
.eyebrow {
  font-size: .74rem; font-weight: 700; letter-spacing: .13em; text-transform: uppercase;
  color: var(--brass);
}
p { max-width: 62ch; color: var(--text); }
p.muted { color: var(--text-muted); }
p + p { margin-top: .85rem; }
section.block { padding: clamp(2.6rem, 6vw, 3.8rem) 0; }
.rule-top { border-top: 1px dashed var(--border-strong); }
.block-head { display: flex; flex-direction: column; gap: .5rem; margin-bottom: 1.6rem; }

/* ---------- hero (bookended pages: home + pricing) ---------- */
.hero { position: relative; overflow: hidden; padding: clamp(3rem, 8vw, 4.6rem) 0 clamp(2.6rem, 6vw, 3.4rem); background: var(--grad-wash); }
#hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
.hero-inner { position: relative; z-index: 1; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 1.2rem; }
.badge {
  display: inline-flex; align-items: center; gap: .4rem; font-size: .78rem; font-weight: 550;
  color: var(--text-muted); border-radius: 999px; padding: .34rem .85rem;
  background: #fff; box-shadow: var(--shadow-card);
}
.hero-sub { font-size: 1.12rem; color: var(--text-muted); max-width: 48ch; text-wrap: balance; }
.hero-cta { display: flex; align-items: center; gap: .8rem; margin-top: .3rem; flex-wrap: wrap; justify-content: center; }
.hero-note { font-size: .8rem; color: var(--text-muted); margin-top: .2rem; }

/* ---------- receipt / terminal panel ---------- */
.receipt {
  background: var(--dark); color: var(--on-dark); border-radius: 14px; padding: 1.2rem 1.3rem; margin-top: 1.3rem;
  font-family: var(--font-mono); font-size: .82rem; line-height: 1.7; overflow-x: auto;
  box-shadow: var(--shadow-card);
}
.receipt .c1 { color: var(--brass-on-dark); } .receipt .c2 { color: var(--on-dark-muted); }
.receipt-cap { font-size: .84rem; color: var(--text-muted); margin-top: .7rem; }

/* ---------- FAQ ---------- */
.faq { display: flex; flex-direction: column; gap: .65rem; margin-top: 1.3rem; }
details.faq-item { border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-card); }
details.faq-item summary {
  cursor: pointer; padding: 1rem 1.2rem; font-weight: 600; font-size: .95rem; list-style: none;
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
}
details.faq-item summary::-webkit-details-marker { display: none; }
details.faq-item summary::after { content: "+"; font-family: var(--font-mono); color: var(--brass); font-size: 1.1rem; flex: none; }
details.faq-item[open] summary::after { content: "–"; }
.faq-a { padding: 0 1.2rem 1.05rem; font-size: .9rem; color: var(--text-muted); }
.faq-a p { max-width: none; }

/* ---------- final CTA ---------- */
.cta-band {
  position: relative; overflow: hidden; padding: clamp(3.2rem, 8vw, 4.6rem) 0; text-align: center;
  background: linear-gradient(180deg, #FFFFFF 0%, #EFF4FF 55%, #D6E4FF 100%);
}
#cta-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
.cta-inner { position: relative; z-index: 1; }
.cta-band h2 { max-width: none; margin: 0 auto; }
.cta-band p { margin: .7rem auto 0; }
.cta-row { display: flex; flex-direction: column; align-items: center; gap: .9rem; margin-top: 1.6rem; }
.cta-buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem; }
.cta-promise { font-size: .87rem; color: var(--text-muted); max-width: 54ch; margin: 0; text-wrap: balance; }

/* ---------- footer ---------- */
footer { border-top: 1px dashed var(--border-strong); padding: 1.8rem 0 2.6rem; text-align: center; background: #fff; }
footer p { margin: 0 auto; font-size: .82rem; color: var(--text-muted); max-width: none; }
footer nav { margin-top: .7rem; display: flex; justify-content: center; gap: 1.2rem; flex-wrap: wrap; font-size: .82rem; }
footer nav a { color: var(--text-muted); text-decoration: none; }
footer nav a:hover { color: var(--brass-deep); }

/* ---------- scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s cubic-bezier(.16,.8,.24,1), transform .7s cubic-bezier(.16,.8,.24,1); }
.reveal.visible { opacity: 1; transform: none; }
.reveal-stagger:not(.visible) > * { opacity: 0; }
.reveal-stagger.visible > * { animation: rise-in .6s cubic-bezier(.16,.8,.24,1) backwards; }
.reveal-stagger.visible > *:nth-child(2) { animation-delay: .06s; }
.reveal-stagger.visible > *:nth-child(3) { animation-delay: .12s; }
.reveal-stagger.visible > *:nth-child(4) { animation-delay: .18s; }
.reveal-stagger.visible > *:nth-child(5) { animation-delay: .24s; }
.reveal-stagger.visible > *:nth-child(6) { animation-delay: .3s; }
@keyframes rise-in { from { opacity: 0; transform: translateY(18px); } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .reveal-stagger:not(.visible) > * { opacity: 1; }
  .reveal-stagger.visible > * { animation: none; }
}

/* ---------- integration-guide pages (shared components) ---------- */
.guide-hero { padding: clamp(2.6rem, 7vw, 4rem) 0 clamp(1.8rem, 4vw, 2.4rem); background: var(--grad-wash); }
.guide-hero h1 { max-width: 24ch; font-size: clamp(2rem, 5vw, 2.9rem); }
.guide-hero .hero-sub { max-width: 56ch; margin-top: 1rem; text-align: left; }
ul.list { max-width: 66ch; padding-left: 1.2rem; display: flex; flex-direction: column; gap: .55rem; }
ul.list li strong { font-weight: 650; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: .9rem; margin-top: 1.2rem; }
.step { border-radius: var(--radius-card); padding: 1.15rem 1.25rem; background: var(--surface); box-shadow: var(--shadow-card); }
.step .n { font-family: var(--font-mono); color: var(--brass); font-size: .95rem; font-weight: 700; display: block; margin-bottom: .5rem; }
.step h3 { font-size: .95rem; font-weight: 650; margin: 0 0 .35rem; }
.step p { font-size: .87rem; color: var(--text-muted); margin: 0; }
.note {
  border-left: 3px solid var(--brass); background: #EFF4FF; border-radius: 0 12px 12px 0;
  padding: .95rem 1.1rem; margin-top: 1.4rem; font-size: .92rem; max-width: 66ch;
}
