/* Politeum — site stylesheet · tokens from Planning/04-brand-guide.md */

:root {
  --ink: #111418;
  --blue: #2458E6;
  --blue-dark: #4D7CFF;
  --slate: #5A6472;
  --slate-dark: #9AA3AF;
  --mist: #E8EAED;
  --tint: #F4F6F9;
  --bg: #FFFFFF;
  --display: "Space Grotesk", sans-serif;
  --body: "Inter", sans-serif;
  --mono: "IBM Plex Mono", monospace;
  --max: 1120px;
  --pad: clamp(20px, 4vw, 48px);
}

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

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

body {
  font-family: var(--body);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.1;
  text-wrap: balance;
}
h1 { font-size: clamp(2.2rem, 5.2vw, 3.6rem); }
h2 { font-size: clamp(1.7rem, 3.6vw, 2.5rem); }
h3 { font-size: 1.45rem; line-height: 1.25; }

p { max-width: 68ch; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
strong { font-weight: 600; }

.wrap { max-width: var(--max); margin: 0 auto; padding-left: var(--pad); padding-right: var(--pad); }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--mist);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  height: 68px;
}
.site-header .logo img { display: block; height: 30px; width: auto; }
.site-nav { display: flex; gap: clamp(16px, 3vw, 34px); align-items: center; }
.site-nav a { color: var(--ink); font-size: 15px; font-weight: 500; }
.site-nav a:hover { color: var(--blue); text-decoration: none; }
.site-nav a[aria-current="page"] { color: var(--blue); }
.site-nav .cta {
  color: #fff; background: var(--blue);
  padding: 8px 18px; border-radius: 6px; transition: background .18s;
  white-space: nowrap;
}
.site-nav .cta:hover { background: #1d49c2; color: #fff; }

/* mobile header: shrink logo/nav so they don't squish or wrap awkwardly */
@media (max-width: 640px) {
  .site-header .wrap { height: auto; padding-top: 14px; padding-bottom: 14px; }
  .site-header .logo img { height: 22px; }
  .site-nav { gap: 10px; }
  .site-nav a:not(.cta) { font-size: 14px; }
  .site-nav .cta { padding: 7px 14px; font-size: 14px; }
}
@media (max-width: 400px) {
  .site-nav a:not(.cta) { display: none; }
}

/* ---------- kickers & labels (mono, sentence case per brand voice) ---------- */
.kicker {
  font-family: var(--mono); font-size: 13.5px; color: var(--blue);
  display: block; margin-bottom: 18px;
}
.kicker::before {
  content: ""; display: inline-block; width: 3px; height: 15px;
  background: var(--blue); margin-right: 10px; vertical-align: -2px;
}
.label { font-family: var(--mono); font-size: 13px; color: var(--slate); }

/* ---------- color bands ---------- */
.band-tint { background: var(--tint); }
.band-dark { background: var(--ink); color: var(--mist); }
.band-dark h1, .band-dark h2, .band-dark h3 { color: #fff; }
.band-dark .kicker { color: var(--blue-dark); }
.band-dark .kicker::before { background: var(--blue-dark); }
.band-dark .label { color: var(--slate-dark); }
.band-dark a:not(.btn) { color: var(--blue-dark); }
.band-dark p { color: var(--slate-dark); }
.band-dark p.stat, .band-dark .standout { color: #fff; }

/* ---------- hero ---------- */
.hero { padding-top: clamp(64px, 9vw, 118px); padding-bottom: clamp(40px, 6vw, 72px); }
.hero h1 { max-width: 21ch; }
.hero .sub { margin-top: 24px; font-size: clamp(1.1rem, 1.8vw, 1.3rem); color: var(--slate); max-width: 50ch; }
.hero .actions { margin-top: 36px; display: flex; gap: 14px; flex-wrap: wrap; }

.btn {
  display: inline-block; font-weight: 500; font-size: 16px;
  padding: 13px 26px; border-radius: 6px; transition: transform .18s, background .18s, color .18s, border-color .18s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: #1d49c2; }
.btn-ghost { color: var(--ink); border: 1.5px solid var(--ink); }
.btn-ghost:hover { border-color: var(--blue); color: var(--blue); }

/* signature: hero axis with ticks drawing in */
.axis { margin-top: clamp(40px, 6vw, 64px); height: 46px; overflow: visible; display: block; width: 100%; }
.axis .base { stroke: var(--ink); stroke-width: 2.5; }
.axis .tick {
  stroke: var(--blue); stroke-width: 2.5;
  stroke-dasharray: 30; stroke-dashoffset: 30;
  animation: tick-in .5s ease-out forwards;
}
.axis .tick:nth-child(2) { animation-delay: .15s; }
.axis .tick:nth-child(3) { animation-delay: .3s; }
.axis .tick:nth-child(4) { animation-delay: .45s; }
.axis .tick:nth-child(5) { animation-delay: .6s; }
@keyframes tick-in { to { stroke-dashoffset: 0; } }

/* ---------- sections ---------- */
section { padding: clamp(56px, 8vw, 104px) 0; }
.section-head { margin-bottom: clamp(32px, 4vw, 52px); }
.section-head p { margin-top: 14px; color: var(--slate); }

/* scroll reveal (restrained) */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .55s ease, transform .55s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }

/* ---------- stats band (proof) ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(24px, 3vw, 44px); }
@media (max-width: 980px) { .stats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .stats { grid-template-columns: 1fr; } }
.stats article { border-top: 2.5px solid var(--blue-dark); padding-top: 20px; }
.stat {
  font-family: var(--display); font-weight: 500;
  font-size: clamp(2.6rem, 4.5vw, 3.6rem); line-height: 1; color: #fff;
}
.stat-label {
  font-family: var(--mono); font-size: 13.5px; color: var(--blue-dark);
  margin: 10px 0 12px;
}
.stats article > p:last-child { font-size: 15px; }

/* ---------- lead & standout copy ---------- */
.lead { font-size: clamp(1.05rem, 1.6vw, 1.22rem); line-height: 1.6; }
.lead + .lead { margin-top: 18px; }
.standout {
  font-family: var(--display); font-weight: 500;
  font-size: clamp(1.4rem, 2.6vw, 1.9rem); line-height: 1.3;
  color: var(--ink); max-width: 30ch; margin-top: 32px;
}
.standout em { color: var(--blue); font-style: normal; }

/* ---------- cards ---------- */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
@media (max-width: 900px) { .cards { grid-template-columns: 1fr; } }
.card {
  background: #fff; border: 1px solid var(--mist); border-radius: 12px;
  padding: 32px 28px;
  display: flex; flex-direction: column; gap: 14px;
  color: var(--ink); transition: border-color .18s, transform .18s, box-shadow .18s;
  box-shadow: 0 1px 3px rgba(17,20,24,.04);
}
a.card:hover {
  text-decoration: none; border-color: var(--blue);
  transform: translateY(-4px); box-shadow: 0 14px 36px rgba(17,20,24,.1);
}
.card .num { font-family: var(--mono); font-size: 13.5px; color: var(--blue); }
.card h3 { padding-bottom: 12px; border-bottom: 2.5px solid var(--ink); }
.card p { font-size: 15.5px; color: var(--slate); }
.card .proof-line { font-size: 14.5px; color: var(--ink); font-weight: 500; margin-top: auto; }
.card .go { color: var(--blue); font-weight: 500; font-size: 15px; }
a.card:hover .go { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- work portfolio grid ---------- */
.work-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; }
.work-card {
  display: block; background: #fff; border: 1px solid var(--mist); border-radius: 12px; overflow: hidden;
  color: var(--ink); transition: border-color .18s, transform .18s, box-shadow .18s;
  box-shadow: 0 1px 3px rgba(17,20,24,.04);
}
.work-card:hover { text-decoration: none; border-color: var(--blue); transform: translateY(-4px); box-shadow: 0 14px 36px rgba(17,20,24,.1); }
.work-card img { width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; display: block; border-bottom: 1px solid var(--mist); }
.work-card .body { padding: 18px 20px; }
.work-card .tag {
  display: inline-block; font-family: var(--mono); font-size: 11px; color: var(--blue);
  background: rgba(36,88,230,.08); padding: 3px 9px; border-radius: 20px; margin-bottom: 10px;
}
.work-card h3 { font-size: 16px; margin-bottom: 6px; }
.work-card p { font-size: 14px; color: var(--slate); }

/* ---------- how we work ---------- */
.how { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(24px, 3vw, 40px); }
@media (max-width: 900px) { .how { grid-template-columns: 1fr; } }
.how > div { border-top: 2.5px solid var(--ink); padding-top: 20px; }
.how .num { font-family: var(--mono); font-size: 13.5px; color: var(--blue); display: block; margin-bottom: 10px; }
.how h3 { margin-bottom: 12px; }
.how p { color: var(--slate); font-size: 15.5px; }

/* ---------- founder teaser / about ---------- */
.founder { display: grid; grid-template-columns: 340px 1fr; gap: clamp(28px, 5vw, 64px); align-items: start; }
@media (max-width: 860px) { .founder { grid-template-columns: 1fr; } }
.founder img { width: 100%; height: auto; max-width: 340px; border-radius: 12px; display: block; box-shadow: 0 10px 30px rgba(17,20,24,.12); }
.founder .text p + p { margin-top: 16px; }

/* ---------- facts rail ---------- */
.facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px 28px; margin-top: 8px; }
@media (max-width: 760px) { .facts { grid-template-columns: 1fr; } }
.facts div { background: var(--tint); border-radius: 10px; padding: 20px 24px; }
.facts .label { display: block; margin-bottom: 8px; color: var(--blue); }
.facts p { font-size: 15px; }

/* ---------- case study pages ---------- */
.case-meta {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 18px 32px; background: var(--tint); border-radius: 12px;
  padding: 28px 32px; margin: 40px 0 8px;
}
.case-meta .label { display: block; margin-bottom: 6px; color: var(--blue); }
.case-meta p { font-size: 15px; font-weight: 500; }

.prose { max-width: 70ch; }
.prose h2 { margin: clamp(44px, 6vw, 72px) 0 20px; }
.prose h2::before {
  content: ""; display: block; width: 40px; height: 3.5px;
  background: var(--blue); margin-bottom: 18px;
}
.prose p + p { margin-top: 16px; }
.prose ul { margin: 18px 0 18px 4px; list-style: none; }
.prose li { margin-bottom: 14px; padding-left: 22px; position: relative; }
.prose li::before {
  content: ""; position: absolute; left: 0; top: .55em;
  width: 10px; height: 3px; background: var(--blue);
}

blockquote {
  font-family: var(--display); font-weight: 500; font-size: clamp(1.25rem, 2vw, 1.5rem);
  line-height: 1.35; color: var(--ink);
  border-left: 3.5px solid var(--blue); padding: 8px 0 8px 24px;
  margin: 36px 0; max-width: 46ch;
}

/* live demo facade */
.demo {
  margin: 44px 0; border: 1px solid var(--mist); border-radius: 12px; overflow: hidden;
  background: var(--tint);
}
.demo .demo-inner {
  aspect-ratio: 16 / 10; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 14px; text-align: center; padding: 24px;
  background:
    linear-gradient(var(--tint) 0 0) padding-box,
    repeating-linear-gradient(0deg, transparent 0 47px, var(--mist) 47px 48px),
    repeating-linear-gradient(90deg, transparent 0 47px, var(--mist) 47px 48px);
}
.demo .demo-inner > p:first-child { font-family: var(--display); font-size: 1.3rem; color: var(--ink); }
.demo iframe { width: 100%; aspect-ratio: 16 / 10; border: 0; display: block; }
.demo .label { max-width: 46ch; }

/* let an embedded live app break out of the reading column to the full
   content width, where its panels/legends have room and don't overlap */
.demo.demo-wide { width: calc(min(100vw, var(--max)) - 2 * var(--pad)); max-width: none; }

/* screenshot placeholder (pre-launch) */
.shot {
  margin: 44px 0; border: 1.5px dashed var(--slate-dark); background: var(--tint); border-radius: 12px;
  aspect-ratio: 16 / 9; display: flex; align-items: center; justify-content: center;
  color: var(--slate); font-family: var(--mono); font-size: 13.5px; text-align: center; padding: 20px;
}

/* captioned screenshot (real image) */
.figure { margin: 44px 0; }
.figure img {
  width: 100%; height: auto; display: block; border-radius: 12px; border: 1px solid var(--mist);
  box-shadow: 0 12px 34px rgba(17,20,24,.14);
}
.figure figcaption {
  margin-top: 12px; font-family: var(--mono); font-size: 13px; color: var(--slate);
  text-align: center; max-width: 62ch; margin-left: auto; margin-right: auto;
}

/* pagination between case studies */
.case-nav { display: flex; justify-content: space-between; gap: 20px; margin-top: 72px; flex-wrap: wrap; }
.case-nav a { font-weight: 500; }

/* ---------- big CTA ---------- */
.big-cta h2 { max-width: 26ch; }
.big-cta p { margin-top: 18px; }
.big-cta .actions { margin-top: 30px; }

/* dark CTA panel (used inside light pages) */
.panel-dark {
  background: var(--ink); color: var(--mist); border-radius: 14px;
  padding: clamp(32px, 5vw, 52px);
}
.panel-dark p { color: var(--slate-dark); }
.panel-dark p strong { color: #fff; font-family: var(--display); font-weight: 500; font-size: 1.5rem; line-height: 1.3; }
.panel-dark .actions { margin-top: 22px; }

/* ---------- footer (dark) ---------- */
.site-footer { background: var(--ink); padding: 48px 0 60px; border-top: 1px solid rgba(232,234,237,.14); }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; align-items: center; }
.site-footer img { height: 26px; width: auto; display: block; }
.site-footer nav { display: flex; gap: 22px; flex-wrap: wrap; }
.site-footer a { color: var(--slate-dark); font-size: 14.5px; }
.site-footer a:hover { color: var(--blue-dark); }
.site-footer .fine { font-family: var(--mono); font-size: 12.5px; color: var(--slate-dark); width: 100%; margin-top: 10px; }
