/* Castlark public site — shared styles.
   Pre-rendered, served directly from dist/site. No framework, no build step required. */

:root {
  --ink: #0f1a2b;
  --ink-2: #2e3a4f;
  --muted: #5a6479;
  --line: #e4e8ef;
  --paper: #ffffff;
  --cream: #fbfaf6;
  --cobalt: #2c4bff;
  --cobalt-ink: #1a30b3;
  --pistachio: #b3ee8a;
  --pistachio-ink: #1d6a1e;
  --lavender: #e8e4ff;
  --sky: #d7ecff;
  --apricot: #ffe4d2;
  --mint: #d9f3e4;
  --space: 16px;
  --radius: 14px;
  --radius-lg: 22px;
  --font: -apple-system, BlinkMacSystemFont, "Inter", "Helvetica Neue", Arial, system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { color-scheme: light; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

.container { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 760px; margin: 0 auto; padding: 0 24px; }

/* ── Header ──────────────────────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,0.86);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .inner {
  display: flex; align-items: center; gap: 24px;
  height: 64px; padding: 0 24px; max-width: 1180px; margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -0.01em; color: var(--ink); }
.brand-dot { width: 20px; height: 20px; border-radius: 6px; background: linear-gradient(135deg, #2c4bff, #19247a); }
.nav { display: flex; gap: 22px; margin-left: 12px; }
.nav a { color: var(--ink-2); font-weight: 500; }
.nav a:hover { color: var(--ink); }
.header-actions { margin-left: auto; display: flex; gap: 12px; align-items: center; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; height: 40px; padding: 0 18px; border-radius: 999px;
  font-weight: 600; font-size: 15px; cursor: pointer;
  border: 1px solid transparent; background: transparent; color: var(--ink);
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--pistachio); color: var(--pistachio-ink); border: 1px solid #a0d975; }
.btn-primary:hover { background: #a7e67c; }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: rgba(0,0,0,0.04); }
.btn-outline { background: var(--paper); color: var(--ink); border: 1px solid var(--line); }
.btn-outline:hover { background: #f4f6fa; }

/* ── Hero ────────────────────────────────────────────────────────────────── */
.hero {
  position: relative; padding: 96px 24px 72px; text-align: center;
  background: radial-gradient(1000px 500px at 50% -10%, #eff2ff 0%, transparent 70%), var(--cream);
  overflow: hidden;
}
.hero h1 { font-size: clamp(42px, 6vw, 72px); line-height: 1.04; margin: 0 0 20px; letter-spacing: -0.02em; font-weight: 800; }
.hero .sub { color: var(--muted); font-size: 19px; max-width: 640px; margin: 0 auto 32px; }
.hero .cta-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 44px; }
.hero .email-pill {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 6px 6px 18px; box-shadow: 0 2px 16px rgba(10,20,40,0.05);
}
.hero .email-pill input {
  border: none; outline: none; background: transparent; font-size: 15px;
  padding: 10px 6px; min-width: 220px; color: var(--ink);
}

/* Floating service tiles (14 chips around the hero) */
.chip-ring { position: relative; max-width: 1180px; margin: 32px auto 0; height: 220px; display: none; }
.chip-ring .chip {
  position: absolute; width: 56px; height: 56px; border-radius: 16px;
  background: var(--paper); border: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(10,20,40,0.06);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 11px; color: var(--ink-2);
}
@media (min-width: 900px) { .chip-ring { display: block; } }

/* ── Sections ────────────────────────────────────────────────────────────── */
section { padding: 72px 0; }
section h2 { font-size: clamp(28px, 4vw, 44px); margin: 0 0 16px; letter-spacing: -0.015em; font-weight: 800; line-height: 1.1; }
section .lead { color: var(--muted); font-size: 18px; max-width: 640px; }

.showcase-grid {
  display: grid; gap: 18px; margin-top: 32px;
  grid-template-columns: 1fr;
}
@media (min-width: 720px) { .showcase-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1040px) { .showcase-grid { grid-template-columns: 2fr 1fr 1fr; } }

.showcase-card {
  border-radius: var(--radius-lg); padding: 28px; border: 1px solid var(--line);
  display: flex; flex-direction: column; justify-content: space-between; min-height: 280px;
}
.showcase-card h3 { margin: 0 0 8px; font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.showcase-card p { margin: 0; color: var(--ink-2); }
.showcase-card .badge { display: inline-block; font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; opacity: 0.8; margin-bottom: 10px; }
.showcase-card.lavender { background: var(--lavender); }
.showcase-card.pistachio { background: var(--pistachio); color: var(--pistachio-ink); }
.showcase-card.pistachio h3, .showcase-card.pistachio p { color: var(--pistachio-ink); }
.showcase-card.sky { background: var(--sky); }
.showcase-card.apricot { background: var(--apricot); }
.showcase-card.mint { background: var(--mint); }
.showcase-card.large { grid-column: 1 / -1; min-height: 320px; }
@media (min-width: 1040px) { .showcase-card.large { grid-column: 1 / 3; } }

.feature-row { display: grid; gap: 28px; grid-template-columns: 1fr; margin-top: 40px; }
@media (min-width: 900px) { .feature-row { grid-template-columns: 1fr 1fr 1fr; } }
.feature { padding: 24px; border-radius: var(--radius); background: var(--paper); border: 1px solid var(--line); }
.feature h4 { margin: 0 0 6px; font-size: 18px; font-weight: 700; }
.feature p { margin: 0; color: var(--muted); font-size: 15px; }

/* Channel dock */
.channel-dock {
  display: grid; gap: 10px; margin-top: 28px;
  grid-template-columns: repeat(4, 1fr);
}
@media (min-width: 720px) { .channel-dock { grid-template-columns: repeat(8, 1fr); } }
.channel-chip {
  padding: 10px 6px; border-radius: 12px; background: var(--paper);
  border: 1px solid var(--line); font-size: 12px; font-weight: 600;
  color: var(--ink-2); text-align: center;
}

/* Made for tabs */
.made-tabs { display: flex; gap: 8px; margin-top: 20px; flex-wrap: wrap; }
.made-tabs a {
  padding: 8px 14px; border-radius: 999px; background: var(--paper);
  border: 1px solid var(--line); color: var(--ink-2); font-size: 14px; font-weight: 600;
}
.made-tabs a:hover { border-color: var(--cobalt); color: var(--cobalt); text-decoration: none; }

/* FAQ */
.faq { margin-top: 28px; }
.faq details { padding: 18px 22px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--paper); margin-bottom: 10px; }
.faq summary { font-weight: 700; cursor: pointer; font-size: 17px; }
.faq details[open] summary { margin-bottom: 10px; }
.faq p { margin: 0; color: var(--ink-2); }

/* Footer */
.site-footer { background: #0f1a2b; color: #cbd5e1; padding: 56px 24px 32px; margin-top: 64px; }
.site-footer a { color: #e2e8f0; }
.site-footer .cols { max-width: 1180px; margin: 0 auto; display: grid; gap: 28px; grid-template-columns: 2fr 1fr 1fr 1fr 1fr 1fr; }
@media (max-width: 900px) { .site-footer .cols { grid-template-columns: 1fr 1fr; } }
.site-footer h5 { margin: 0 0 12px; color: #fff; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin: 6px 0; font-size: 14px; }
.site-footer .bottom { max-width: 1180px; margin: 36px auto 0; padding-top: 20px; border-top: 1px solid rgba(255,255,255,0.08); display: flex; justify-content: space-between; color: #94a3b8; font-size: 13px; flex-wrap: wrap; gap: 8px; }

/* Guide / article pages */
article.doc { background: var(--paper); border-radius: var(--radius-lg); padding: 44px clamp(24px, 4vw, 64px); max-width: 820px; margin: 48px auto; border: 1px solid var(--line); }
article.doc h1 { font-size: clamp(32px, 4.5vw, 44px); margin: 0 0 18px; letter-spacing: -0.015em; line-height: 1.12; }
article.doc .meta { color: var(--muted); font-size: 14px; margin-bottom: 36px; }
article.doc h2 { font-size: 26px; margin-top: 42px; letter-spacing: -0.01em; }
article.doc h3 { font-size: 20px; margin-top: 32px; }
article.doc p, article.doc li { font-size: 17px; line-height: 1.7; color: var(--ink-2); }
article.doc ul, article.doc ol { padding-left: 22px; }
article.doc code { font-family: var(--mono); background: var(--cream); padding: 2px 6px; border-radius: 6px; font-size: 14px; }
article.doc pre { font-family: var(--mono); background: #0f1a2b; color: #d8e3f3; padding: 18px; border-radius: 12px; overflow-x: auto; font-size: 14px; }

/* Editorial ad slot — fixed height prevents CLS, used only in ≥1,300-word guides. */
.ad-slot {
  min-height: 120px; display: block; margin: 36px auto; text-align: center;
  background: var(--cream); border: 1px dashed var(--line); border-radius: 12px;
  color: var(--muted); font-size: 12px; padding: 24px;
}

/* Small bits */
.muted { color: var(--muted); }
.kbd { font-family: var(--mono); font-size: 13px; padding: 2px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* View transitions for cross-page nav (progressively enhanced) */
@view-transition { navigation: auto; }
.privacy-choices { max-width: 820px; margin: 24px auto; padding: 24px; border-top: 1px solid var(--line); }
.privacy-choices p { margin: 4px 0 12px; }
.privacy-choices button, .made-tabs button { font: inherit; color: var(--ink); background: white; border: 1px solid #9aa5ae; border-radius: 24px; min-height: 44px; padding: 6px 16px; cursor: pointer; }
.privacy-choices output { display: block; margin-top: 8px; }
.ad-slot { height: 120px; padding: 0; overflow: hidden; }
.skip-link { position: fixed; z-index: 60; left: 12px; top: -80px; padding: 12px; background: white; }
.skip-link:focus { top: 8px; }
.landing .nav { align-items: center; gap: clamp(10px,1.4vw,22px); }
.menu { position: relative; }
.menu summary { cursor: pointer; font-weight: 550; list-style: none; }
.menu summary::-webkit-details-marker { display: none; }
.menu summary::after { content: " ▾"; }
.menu > div { position: absolute; z-index: 2; width: max-content; padding: 14px; background: white; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 12px 30px #26312a18; }
.menu a { display: block; padding: 8px; }
.landing .hero { padding: clamp(68px,8vw,116px) 24px 68px; background: #f3f5ed; isolation: isolate; }
.hero h1 { max-width: 720px; margin-inline: auto; font-size: clamp(50px,7.4vw,104px); line-height: .98; letter-spacing: -.065em; color: #173427; text-wrap: balance; }
.hero .sub { max-width: 490px; color: #395347; }
.hero .cta-row { margin-bottom: 16px; }
.hero .chip-ring { position: absolute; inset: 0; margin: auto; height: 100%; z-index: -1; pointer-events: none; }
.chip-ring .chip { width: clamp(48px,5vw,70px); height: auto; aspect-ratio: 1; transform: rotate(var(--tilt)); background: var(--tile); border: 5px solid white; box-shadow: 0 8px 14px #2031241f; }
.chip svg { width: 62%; height: 62%; }
.chip:nth-child(1) { top:9%; left:13%; } .chip:nth-child(2) { top:34%;left:3%; } .chip:nth-child(3) { top:49%;left:14%; } .chip:nth-child(4) { top:73%;left:5%; } .chip:nth-child(5) { top:83%;left:19%; } .chip:nth-child(6) { top:8%;left:29%; } .chip:nth-child(7) { bottom:4%;left:33%; }
.chip:nth-child(8) { top:10%;right:12%; } .chip:nth-child(9) { top:32%;right:3%; } .chip:nth-child(10) { top:53%;right:14%; } .chip:nth-child(11) { top:73%;right:5%; } .chip:nth-child(12) { top:85%;right:19%; } .chip:nth-child(13) { top:7%;right:29%; } .chip:nth-child(14) { bottom:4%;right:33%; }
.landing section.container { padding-block: clamp(36px,5vw,72px); scroll-margin-top: 84px; }
.landing .showcase-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
.landing .showcase-card { display: flex; flex-direction: column; min-height: auto; padding: clamp(20px,3vw,44px); gap: 10px; }
.showcase-card.large { grid-column: 1/-1; }
.sample-panel { padding: 18px; border-radius: 16px; background: #ffffffcf; border: 1px solid #0001; box-shadow: 0 8px 20px #1728190c; margin-bottom: 18px; }
.sample-panel span { font: 600 12px/1.4 ui-monospace,monospace; color:#525b61; }
.sample-panel output { display:block; font-size:clamp(18px,2vw,26px); font-weight:650; margin:14px 0; }
.sample-panel button { background:#1d392e; color:white; border:0; border-radius:24px; padding:10px 16px; min-height:44px; cursor:pointer; }
.made-tabs button[aria-selected=true] { background:#173427; color:white; }
.made-panel, .calculator { padding:24px; border-radius:18px; margin-top:14px; background:#edf4e4; }
.calculator { display:grid;grid-template-columns:1fr 1fr;gap:24px;padding:clamp(24px,4vw,58px); }
.calculator label { display:flex;align-items:center;justify-content:space-between;gap:12px;margin:6px 0; }
.calculator input { width:80px;padding:9px;font:inherit; }
.calculator output { display:block;font-weight:650;margin-top:18px; }
:focus-visible { outline:3px solid #2c4bff;outline-offset:3px; }
@media(max-width:960px) {
 .landing .site-header .inner { flex-wrap:wrap; height:auto; gap:0; padding:8px 16px 0; }
 .landing .nav { order:3;width:100%;margin:0;flex-wrap:wrap;justify-content:space-between;font-size:14px;padding:5px 0;gap:4px 12px; }
 .menu > div { left:0; } .menu:nth-child(n+3) > div { left:auto;right:0; }
}
@media(max-width:680px) {
 .site-header .inner { gap:8px;padding-inline:12px; } .site-header .nav { gap:8px; margin:0; }
 .landing .showcase-grid,.calculator { grid-template-columns:1fr; }
 .hero .email-pill { width:min(100%,400px); } .hero .email-pill input { min-width:0;width:100%;font-size:16px; }
 .hero .email-pill button,.header-actions .btn { white-space:nowrap;padding-inline:11px;font-size:13px; }
 .landing .hero { padding-top:32px; }
 .hero .chip-ring { display:flex;position:static;justify-content:center;flex-wrap:wrap;gap:8px;margin:24px auto 0;height:auto;max-width:330px; }
 .chip-ring .chip { position:static;width:36px;border-width:2px;border-radius:10px; }
 .site-footer .cols { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
