/* ============================================================
   Pine Street Analytics — editorial stylesheet
   One serif voice, warm paper, hand-drawn graphics.
   Light sections = engineering graph paper; dark = blueprint.
   ============================================================ */

:root {
  /* brand darks */
  --navy: #122a45;
  --navy-deep: #0b1d31;

  /* warm paper system */
  --paper: #f6f1e7;        /* page background */
  --paper-2: #fbf7ef;      /* raised surfaces / cards */
  --ink: #23252b;          /* body text */
  --muted: #6a6357;        /* warm grey */
  --line: #e6ddcb;         /* hairlines on paper */

  /* accents */
  --accent: #4f46e5;       /* indigo — links, primary action */
  --accent-soft: #6366f1;
  --healthy: #1f9d57;      /* green — a job that ran clean */
  --healthy-deep: #15793f;
  --broken: #c0492a;       /* rust — a job that fell over */

  --max: 1140px;
  --radius: 12px;

  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;

  /* hand-drawn wave divider */
  --wave: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='14'%3E%3Cpath d='M0 8 Q12 2 24 8 T48 8' fill='none' stroke='%23d6c8ac' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* ---------- Backgrounds: warm engineering graph paper ---------- */
body {
  font-family: var(--sans);
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    radial-gradient(135% 90% at 50% -12%, rgba(255,255,255,.55), rgba(255,255,255,0) 55%),
    radial-gradient(120% 70% at 92% 4%, rgba(201,138,43,.05), rgba(201,138,43,0) 40%),
    linear-gradient(rgba(35,37,43,.05) 1.1px, transparent 1.1px),
    linear-gradient(90deg, rgba(35,37,43,.05) 1.1px, transparent 1.1px),
    linear-gradient(rgba(35,37,43,.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(35,37,43,.022) 1px, transparent 1px);
  background-size:
    100% 100%,
    100% 100%,
    132px 132px,
    132px 132px,
    22px 22px,
    22px 22px;
  background-attachment: fixed, fixed, scroll, scroll, scroll, scroll;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 28px; }
.narrow { max-width: 760px; }

/* ---------- Header / Nav ---------- */
header {
  background: var(--navy);
  color: #fff;
  position: sticky; top: 0; z-index: 50;
  box-shadow: 0 1px 0 rgba(255,255,255,.06);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: 12px; font-family: var(--serif); font-weight: 600; font-size: 1.18rem; color: #fff; }
.brand:hover { text-decoration: none; }
nav ul { list-style: none; display: flex; gap: 26px; align-items: center; }
nav a { color: #cdd6e0; font-weight: 500; font-size: .96rem; }
nav a:hover, nav a.active { color: #fff; text-decoration: none; }
nav a.active { box-shadow: inset 0 -2px 0 var(--accent-soft); padding-bottom: 5px; }
.nav-cta { background: var(--accent); color: #fff !important; padding: 9px 16px; border-radius: 8px; font-weight: 600; }
.nav-cta:hover { background: var(--accent-soft); text-decoration: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; background: var(--accent); color: #fff;
  padding: 13px 26px; border-radius: 8px; font-weight: 600; font-size: 1rem;
}
.btn:hover { background: var(--accent-soft); text-decoration: none; }
.btn.secondary { background: transparent; color: inherit; border: 1.5px solid currentColor; opacity: .85; }
.btn.secondary:hover { opacity: 1; background: rgba(0,0,0,.04); }
.hero .btn.secondary, .panel .btn.secondary { color: #fff; border-color: #43617f; }
.hero .btn.secondary:hover { background: rgba(255,255,255,.08); }

/* ---------- Blueprint grid for dark surfaces ---------- */
.hero, .panel, footer {
  background-color: var(--navy);
  background-image:
    radial-gradient(120% 100% at 50% -10%, rgba(255,255,255,.06), rgba(255,255,255,0) 60%),
    linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 100% 100%, 30px 30px, 30px 30px;
}
footer { background-color: var(--navy-deep); }

/* ---------- Hero ---------- */
.hero { color: #fff; padding: 64px 0 58px; position: relative; overflow: hidden; }
.hero .wrap { position: relative; z-index: 1; }

.hero.split .wrap { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 48px; align-items: center; }
.hero h1 { font-size: 3.05rem; line-height: 1.08; margin-bottom: 18px; max-width: 12ch; }
.hero.split h1 { max-width: none; }
.hero p.lead { font-size: 1.18rem; color: #cdd8e4; max-width: 50ch; margin-bottom: 26px; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

.pill {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: .82rem; font-weight: 600; color: #d9deff;
  background: rgba(99,102,241,.14); border: 1px solid rgba(99,102,241,.4);
  padding: 6px 15px; border-radius: 999px; margin-bottom: 22px;
}
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--healthy); box-shadow: 0 0 0 3px rgba(31,157,87,.25); }

.hero.page { padding: 50px 0 44px; }
.hero.page h1 { font-size: 2.3rem; }

/* ---------- Credibility strip ---------- */
.signals { background: var(--navy-deep); color: #b9c6d3; padding: 15px 0; }
.signals .wrap { display: flex; flex-wrap: wrap; gap: 12px 38px; justify-content: center; font-size: .9rem; }
.signals strong { color: #fff; }

/* ---------- Sections ---------- */
section.block { padding: 56px 0; }
section.block.alt { position: relative; background: var(--paper-2); }
section.block.alt::before, section.block.alt::after {
  content: ""; position: absolute; left: 0; right: 0; height: 14px;
  background-image: var(--wave); background-repeat: repeat-x; background-size: 48px 14px;
  opacity: .75; pointer-events: none;
}
section.block.alt::before { top: -7px; }
section.block.alt::after { bottom: -7px; }
section.block.tight { padding: 38px 0; }

.eyebrow { color: var(--accent); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; font-size: .76rem; margin-bottom: 12px; }
h2.section-title { font-size: 2.05rem; color: var(--navy); margin-bottom: 14px; line-height: 1.12; }
.section-intro { color: var(--muted); max-width: 62ch; margin-bottom: 30px; font-size: 1.08rem; }

/* ---------- Asymmetric offset rows ---------- */
.offset { display: grid; grid-template-columns: 7fr 5fr; gap: 52px; align-items: center; }
.offset + .offset { margin-top: 44px; }
.offset.flip { grid-template-columns: 5fr 7fr; }
.offset.flip .offset-media { order: -1; }
.offset h3 { font-size: 1.5rem; color: var(--navy); margin-bottom: 10px; }
.offset p { color: var(--ink); font-size: 1.04rem; }
.offset .kicker { color: var(--accent); font-weight: 700; font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; display: block; margin-bottom: 8px; }

/* ---------- Pull-quote ---------- */
.pullquote { padding: 46px 0; }
.pullquote blockquote {
  font-family: var(--serif); font-weight: 500; font-size: 2.05rem; line-height: 1.28;
  color: var(--navy); max-width: 20ch; position: relative;
}
.pullquote.indent blockquote { margin-left: auto; margin-right: 0; text-align: right; }
.pullquote .mark { font-family: var(--serif); font-size: 3.4rem; color: var(--accent); line-height: 0; display: block; height: .5em; }
.pullquote cite { display: block; margin-top: 20px; font-family: var(--sans); font-style: normal; font-size: .92rem; color: var(--muted); font-weight: 600; }

/* ---------- Numbered steps (process) ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; counter-reset: step; }
.step { position: relative; padding-top: 14px; }
.step .num { font-family: var(--serif); font-size: 2.6rem; font-weight: 600; color: var(--accent); line-height: 1; display: block; margin-bottom: 8px; }
.step h3 { font-size: 1.22rem; color: var(--navy); margin-bottom: 6px; }
.step p { color: var(--muted); font-size: .98rem; }
.steps .step:not(:first-child)::after {
  content: "→"; position: absolute; top: 10px; left: -22px; color: var(--line); font-size: 1.4rem;
}

/* handwritten marker accent */
.hand { font-family: "Caveat", "Segoe Script", cursive; }

/* ---------- Hand-drawn sketch frame ---------- */
.sketch { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; box-shadow: 0 14px 30px -22px rgba(18,42,69,.5); }
.sketch svg { width: 100%; height: auto; display: block; }
.sketch.tilt { transform: rotate(-1.4deg); }
.sketch-cap { color: var(--muted); font-size: .88rem; margin: 12px 4px 0; font-style: italic; }
.hero .sketch { background: rgba(255,255,255,.04); border-color: rgba(255,255,255,.14); box-shadow: none; }

/* ---------- Cards (kept, used sparingly) ---------- */
.grid { display: grid; gap: 24px; }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.card {
  background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px;
}
.card h3 { color: var(--navy); font-size: 1.16rem; margin-bottom: 8px; }
.card p { color: var(--muted); font-size: .98rem; }

/* compact spec list (used inside offset media on Services) */
.spec { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 22px; }
.spec .row { display: flex; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: .96rem; }
.spec .row:last-child { border-bottom: 0; }
.spec .row .k { color: var(--muted); }
.spec .row .v { color: var(--navy); font-weight: 600; text-align: right; }

/* a lighter "list" alternative to cards */
.plainlist { display: grid; gap: 4px; }
.plainlist .item { padding: 18px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: minmax(160px, 220px) 1fr; gap: 28px; align-items: baseline; }
.plainlist .item:first-child { border-top: 1px solid var(--line); }
.plainlist .item h3 { font-size: 1.2rem; color: var(--navy); }
.plainlist .item p { color: var(--muted); font-size: 1rem; }

/* ---------- Dark panel (replaces repeated navy callout) ---------- */
.panel { color: #fff; border-radius: 16px; padding: 44px; position: relative; overflow: hidden; }
.panel h2 { font-size: 1.8rem; margin-bottom: 12px; }
.panel p { color: #cdd8e4; max-width: 58ch; margin-bottom: 22px; }
.panel.center { text-align: center; }
.panel.center p { margin-left: auto; margin-right: auto; }

/* a quiet inline CTA for inner pages (not a big box) */
.cta-line { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 28px; font-size: 1.06rem; color: var(--ink); }
.cta-line a { font-weight: 600; }

/* ---------- Signed note (About) ---------- */
.signoff { max-width: 60ch; }
.signoff p { font-size: 1.1rem; color: var(--ink); margin-bottom: 16px; }
.signoff .sig { font-family: "Caveat", cursive; font-size: 2.1rem; color: var(--navy); margin-top: 18px; line-height: 1; }
.signoff .sig small { display: block; font-family: var(--sans); font-size: .85rem; color: var(--muted); margin-top: 8px; letter-spacing: .02em; }

/* ---------- Forms ---------- */
form .field { margin-bottom: 18px; }
label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; color: var(--navy); }
input, textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line);
  border-radius: 8px; font-size: 1rem; font-family: inherit; background: #fff;
}
input:focus, textarea:focus { outline: none; border-color: var(--accent); }

/* ---------- Audience toggle (kept) ---------- */
.toggle-wrap { display: flex; justify-content: flex-start; margin-bottom: 26px; }
.toggle { display: inline-flex; background: rgba(255,255,255,.07); border: 1px solid #43617f; border-radius: 999px; padding: 4px; gap: 4px; }
.toggle button { background: transparent; border: 0; color: #c7d2de; font: inherit; font-weight: 600; font-size: .9rem; padding: 8px 22px; border-radius: 999px; cursor: pointer; transition: all .15s ease; }
.toggle button:hover { color: #fff; }
.toggle button.on { background: var(--accent); color: #fff; }
body.gov-mode .com-only { display: none; }
body.com-mode .gov-only { display: none; }

/* ---------- Placeholder highlight (disabled at launch) ---------- */
.ph { /* highlight removed — placeholders filled */ }

/* ---------- Footer ---------- */
footer { color: #9fb0c0; padding: 46px 0 28px; font-size: .92rem; position: relative; }
footer .wrap { position: relative; z-index: 1; }
footer .foot-cta { display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; align-items: end; padding-bottom: 30px; margin-bottom: 28px; border-bottom: 1px solid #1b3350; }
footer .foot-cta h3 { font-size: 1.6rem; color: #fff; margin-bottom: 10px; line-height: 1.15; }
footer .foot-cta p { max-width: 46ch; }
footer .foot-cta .actions { display: flex; gap: 12px; flex-wrap: wrap; }
footer .cols { display: flex; flex-wrap: wrap; gap: 40px; justify-content: space-between; margin-bottom: 26px; }
footer h4 { color: #fff; font-size: .95rem; margin-bottom: 12px; font-family: var(--sans); }
footer a { color: #9fb0c0; }
footer a:hover { color: #fff; }
footer .legal { border-top: 1px solid #1b3350; padding-top: 18px; font-size: .85rem; color: #6f8092; }

/* ---------- Approach diagrams ---------- */
.diagram { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin: 8px 0 6px; box-shadow: 0 14px 30px -24px rgba(18,42,69,.45); }
.diagram svg { width: 100%; height: auto; display: block; }
.diagram-cap { color: var(--muted); font-size: .9rem; margin: 0 0 30px; font-style: italic; }
.note-banner { background: #fff6df; border: 1px solid #e7c878; border-radius: 10px; padding: 16px 20px; color: #6b531c; font-size: .96rem; margin-bottom: 8px; }

/* ---------- Blog ---------- */
.post { padding: 50px 0 70px; }
.post .wrap { max-width: 760px; }
.post-back { display: inline-block; color: var(--accent); font-size: .9rem; font-weight: 600; margin-bottom: 22px; }
.post h1 { color: var(--navy); font-size: 2.4rem; line-height: 1.16; margin-bottom: 8px; }
.post-date { color: var(--muted); font-size: .9rem; margin-bottom: 32px; }
.post h2 { color: var(--navy); font-size: 1.5rem; margin: 34px 0 10px; }
.post p { color: var(--ink); font-size: 1.08rem; line-height: 1.75; margin-bottom: 16px; }
.post strong { color: var(--navy); }
.post pre { background: var(--navy); color: #e6e9ef; padding: 16px 18px; border-radius: 8px; overflow: auto; font-size: .9rem; margin: 0 0 18px; }
.post code { font-family: Consolas, Menlo, monospace; }
.post :not(pre) > code { background: #efe7d6; padding: 1px 5px; border-radius: 4px; font-size: .92em; }
.post-rule { border: 0; border-top: 1px solid var(--line); margin: 40px 0 20px; }
.post-cta { color: var(--muted); font-size: .98rem; }
.post-row { display: block; padding: 22px 0; border-bottom: 1px solid var(--line); }
.post-row:first-of-type { border-top: 1px solid var(--line); }
.post-row:hover { text-decoration: none; }
.post-row:hover h3 { color: var(--accent); }
.post-row h3 { color: var(--navy); font-size: 1.3rem; margin-bottom: 4px; }
.post-row-meta { color: var(--muted); font-size: .85rem; margin-bottom: 6px; }
.post-row-desc { color: var(--muted); font-size: 1rem; margin: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 880px) {
  nav ul { gap: 16px; }
  .grid.cols-3, .grid.cols-2 { grid-template-columns: 1fr; }
  .hero.split .wrap { grid-template-columns: 1fr; gap: 32px; }
  .hero h1 { font-size: 2.3rem; }
  .offset, .offset.flip { grid-template-columns: 1fr; gap: 24px; }
  .offset.flip .offset-media { order: 0; }
  .steps { grid-template-columns: 1fr; gap: 24px; }
  .steps .step:not(:first-child)::after { display: none; }
  .plainlist .item { grid-template-columns: 1fr; gap: 6px; }
  .pullquote blockquote, .pullquote.indent blockquote { font-size: 1.6rem; max-width: none; text-align: left; margin: 0; }
  footer .foot-cta { grid-template-columns: 1fr; gap: 20px; }
  .panel { padding: 32px 24px; }
}
@media (max-width: 560px) {
  nav ul li.hide-sm { display: none; }
  .brand span.full { display: none; }
}
