/* ============================================================
   Permissionless Labs — styles
   Editorial, warm-paper minimalism inspired by research-lab sites.
   ============================================================ */

:root {
  /* palette */
  --paper:      #f4f1ea;   /* warm off-white background */
  --paper-2:    #efeae0;   /* slightly deeper panel */
  --paper-3:    #e9e3d6;   /* deepest panel / cards */
  --ink:        #17150f;   /* warm near-black text */
  --ink-soft:   #56534a;   /* muted body text */
  --ink-faint:  #6f6a5e;   /* captions / labels */
  --line:       rgba(23, 21, 15, 0.14);
  --line-soft:  rgba(23, 21, 15, 0.08);
  --accent:       #c0502b; /* terracotta */
  --accent-ink:   #a5401f;
  --accent-light: #e5825a; /* terracotta for dark backgrounds */

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

  /* rhythm */
  --wrap: 1200px;
  --gutter: clamp(20px, 5vw, 64px);
  --section-y: clamp(72px, 11vw, 152px);
  --radius: 14px;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  font-feature-settings: "kern" 1, "liga" 1;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
h1, h2, h3 { margin: 0; font-weight: 400; letter-spacing: -0.02em; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul { margin: 0; padding: 0; list-style: none; }
::selection { background: var(--accent); color: var(--paper); }

/* paper grain overlay */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.5;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.045'/%3E%3C/svg%3E");
}

/* ---------- layout ---------- */
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.section { padding-block: var(--section-y); position: relative; z-index: 2; }
main { position: relative; z-index: 2; }
/* offset in-page anchor targets so they clear the sticky header */
[id] { scroll-margin-top: 96px; }

/* ---------- shared type bits ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 22px;
}
.eyebrow-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(192, 80, 43, 0.14);
}
.section-title {
  font-family: var(--serif);
  font-size: clamp(30px, 4.4vw, 54px);
  line-height: 1.08;
  letter-spacing: -0.025em;
  max-width: 16ch;
}
.section-title em { font-style: italic; color: var(--accent); }
.section-sub {
  margin-top: 22px;
  max-width: 54ch;
  color: var(--ink-soft);
  font-size: clamp(16px, 1.4vw, 19px);
}
.section-head { margin-bottom: clamp(40px, 6vw, 72px); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.01em;
  padding: 11px 20px;
  border-radius: 100px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .25s cubic-bezier(.2,.7,.2,1), background .25s, color .25s, border-color .25s;
  white-space: nowrap;
}
.btn-solid { background: var(--ink); color: var(--paper); }
.btn-solid:hover { background: var(--accent); transform: translateY(-2px); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ink); background: rgba(23,21,15,0.04); transform: translateY(-2px); }

/* ---------- brand ---------- */
.brand { display: inline-flex; align-items: center; gap: 11px; }
.brand-mark {
  width: 26px; height: 26px;
  border: 1.5px solid var(--ink);
  border-radius: 7px;
  display: grid; place-items: center;
  transition: border-color .3s, transform .5s cubic-bezier(.2,.7,.2,1);
}
.brand-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent);
  transition: transform .5s cubic-bezier(.2,.7,.2,1);
}
.brand:hover .brand-mark { transform: rotate(45deg); }
.brand:hover .brand-dot { transform: scale(1.15); }
.brand-name {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.02em;
}

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  transition: background .3s, border-color .3s, backdrop-filter .3s;
  border-bottom: 1px solid transparent;
}
.site-header.scrolled {
  background: rgba(244, 241, 234, 0.82);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom-color: var(--line-soft);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px;
  height: 74px;
}
.nav { display: flex; gap: 30px; }
.nav a {
  font-size: 15px; color: var(--ink-soft);
  position: relative; padding: 4px 0;
  transition: color .2s;
}
.nav a::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: 0;
  height: 1.5px; background: var(--accent);
  transition: right .3s cubic-bezier(.2,.7,.2,1);
}
.nav a:hover { color: var(--ink); }
.nav a:hover::after { right: 0; }
.header-actions { display: flex; gap: 12px; align-items: center; }

/* mobile menu button */
.menu-toggle {
  display: none;
  flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer;
  /* keep a >=44px tap target while staying visually aligned to the gutter */
  padding: 12px;
  margin-right: -12px;
}
.menu-toggle span {
  width: 22px; height: 1.5px; background: var(--ink);
  transition: transform .3s, opacity .3s;
}
.menu-toggle[aria-expanded="true"] span:first-child { transform: translateY(6.5px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:last-child { transform: translateY(-6.5px) rotate(-45deg); }

.mobile-nav {
  display: none;
  flex-direction: column;
  padding: 8px var(--gutter) 24px;
  background: var(--paper);
  border-bottom: 1px solid var(--line-soft);
}
.mobile-nav a {
  padding: 14px 0;
  font-size: 18px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink);
}
.mobile-nav a:last-child { border-bottom: none; }
.mobile-nav .mobile-cta { color: var(--accent); font-weight: 500; }
.site-header.menu-open .mobile-nav { display: flex; }

/* ---------- active nav ---------- */
.nav a.active { color: var(--ink); }
.nav a.active::after { right: 0; }
.mobile-nav a[aria-current="page"] { color: var(--accent); }

/* ---------- page hero (sub-pages) ---------- */
.page-hero {
  padding-top: clamp(36px, 6vw, 72px);
  padding-bottom: clamp(40px, 6vw, 72px);
  border-bottom: 1px solid var(--line);
  position: relative; z-index: 2;
}
.page-hero .eyebrow { margin-bottom: 20px; }
.page-hero-title {
  font-family: var(--serif);
  font-size: clamp(38px, 6.4vw, 76px);
  line-height: 1.03;
  letter-spacing: -0.035em;
  max-width: 18ch;
}
.page-hero-title em { font-style: italic; color: var(--accent); }
.page-hero-sub {
  margin-top: 24px;
  max-width: 60ch;
  color: var(--ink-soft);
  font-size: clamp(17px, 1.5vw, 20px);
  line-height: 1.55;
}

/* ---------- service teasers (home) ---------- */
/* when this section leads the page (home hero removed) */
.teasers-lead { padding-top: clamp(52px, 8vw, 108px); }
.teasers { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(18px, 2.4vw, 30px); }
.teaser {
  display: flex; flex-direction: column;
  padding: clamp(24px, 2.8vw, 34px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.32);
  transition: transform .35s cubic-bezier(.2,.7,.2,1), border-color .3s, background .3s;
}
.teaser:hover { transform: translateY(-5px); border-color: var(--accent); background: rgba(255, 255, 255, 0.6); }
.teaser-index { font-family: var(--mono); font-size: 13px; letter-spacing: .06em; color: var(--accent); }
.teaser h3 { font-family: var(--serif); font-size: clamp(24px, 2.4vw, 30px); letter-spacing: -.02em; margin: 14px 0 12px; }
.teaser p { color: var(--ink-soft); font-size: 15px; line-height: 1.55; flex: 1 1 auto; }
.teaser .arrow-link { margin-top: 22px; }

/* ---------- open-source teaser (home, dark) ---------- */
.open-teaser { background: var(--ink); color: var(--paper); }
.open-teaser .eyebrow { color: rgba(244, 241, 234, 0.55); }
.open-teaser .eyebrow-dot { box-shadow: 0 0 0 4px rgba(229, 130, 90, 0.2); }
.open-teaser-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: clamp(32px, 5vw, 80px); align-items: center; }
.open-teaser h2 {
  font-family: var(--serif);
  font-size: clamp(28px, 3.6vw, 46px);
  line-height: 1.08; letter-spacing: -0.025em;
  max-width: 18ch;
}
.open-teaser h2 em { font-style: italic; color: var(--accent-light); }
.open-teaser > div > p { margin-top: 20px; max-width: 48ch; color: rgba(244, 241, 234, 0.75); font-size: clamp(16px, 1.4vw, 18px); line-height: 1.55; }
.open-teaser-links { display: flex; flex-direction: column; gap: 12px; margin-top: 28px; }
.open-teaser .arrow-link { color: var(--accent-light); margin-top: 0; font-size: 13.5px; }
.open-teaser .arrow-link:hover { border-bottom-color: var(--accent-light); }
.open-teaser-list { display: flex; flex-direction: column; }
.open-teaser-list li {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  padding: 20px 0;
  border-top: 1px solid rgba(244, 241, 234, 0.16);
}
.open-teaser-list li:last-child { border-bottom: 1px solid rgba(244, 241, 234, 0.16); }
.open-teaser-list .k { font-family: var(--serif); font-size: clamp(20px, 1.8vw, 24px); letter-spacing: -.02em; }
.open-teaser-list .v { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent-light); }

/* ---------- services ---------- */
.service-list { display: flex; flex-direction: column; }
.service {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: clamp(20px, 4vw, 56px);
  padding: clamp(34px, 4.5vw, 56px) 0;
  border-top: 1px solid var(--line);
  transition: padding-left .4s cubic-bezier(.2,.7,.2,1);
}
.service:last-child { border-bottom: 1px solid var(--line); }
.service:hover { padding-left: 10px; }
.service-index {
  font-family: var(--mono);
  font-size: 15px;
  color: var(--accent);
  letter-spacing: .06em;
  padding-top: 8px;
}
.service-title {
  font-family: var(--serif);
  font-size: clamp(28px, 3.4vw, 40px);
  letter-spacing: -.025em;
  margin-bottom: 16px;
}
.platform-tag {
  display: inline-flex; align-items: center; gap: 9px;
  margin: -4px 0 20px;
  font-family: var(--mono);
  font-size: 12.5px; letter-spacing: .01em;
  color: var(--ink-soft);
  transition: color .2s;
}
.platform-tag .pill {
  padding: 3px 10px;
  border: 1px solid var(--accent);
  border-radius: 100px;
  color: var(--accent);
  font-size: 11px; letter-spacing: .04em;
  transition: background .2s, color .2s;
}
.platform-tag:hover { color: var(--ink); }
.platform-tag:hover .pill { background: var(--accent); color: var(--paper); }
.service-desc {
  color: var(--ink-soft);
  max-width: 58ch;
  font-size: clamp(16px, 1.35vw, 18px);
  margin-bottom: 26px;
}
.service-desc strong, .teaser p strong { color: var(--ink); font-weight: 600; }
.service-features {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 32px;
  max-width: 640px;
}
.service-features li {
  font-size: 14.5px;
  color: var(--ink);
  padding-left: 20px;
  position: relative;
}
.service-features li::before {
  content: ""; position: absolute; left: 0; top: 9px;
  width: 8px; height: 8px; border-radius: 2px;
  border: 1.5px solid var(--accent);
}

/* ---------- approach ---------- */
.approach { background: var(--paper-2); }
.approach-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(40px, 6vw, 96px);
  align-items: start;
}
.approach-intro .section-title { max-width: 20ch; }
.approach-intro .section-title em { color: var(--accent); }
.pillars {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(24px, 3vw, 40px);
}
.pillar {
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.pillar-num {
  display: block;
  font-family: var(--serif);
  font-size: 21px;
  letter-spacing: -.02em;
  margin-bottom: 12px;
}
.pillar p { color: var(--ink-soft); font-size: 15.5px; line-height: 1.55; }

/* reusable inline "→ link" */
.arrow-link {
  display: inline-flex; align-items: center; gap: 6px;
  width: fit-content;
  margin-top: 14px;
  font-family: var(--mono);
  font-size: 12.5px; letter-spacing: .02em;
  color: var(--accent);
  border-bottom: 1px solid transparent;
  transition: gap .25s cubic-bezier(.2,.7,.2,1), border-color .25s;
}
.arrow-link:hover { gap: 11px; border-bottom-color: var(--accent); }
.section-head .arrow-link { margin-top: 24px; }

/* ---------- open source (dark manifesto) ---------- */
.open { background: var(--ink); color: var(--paper); }
.open .eyebrow { color: rgba(244, 241, 234, 0.55); }
.open .eyebrow-dot { box-shadow: 0 0 0 4px rgba(229, 130, 90, 0.2); }

.open-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(24px, 3.2vw, 44px);
  margin-bottom: clamp(40px, 5vw, 60px);
}
.open-card { padding-top: 26px; border-top: 1px solid rgba(244, 241, 234, 0.16); }
.open-k {
  display: block;
  font-family: var(--mono);
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent-light);
  margin-bottom: 16px;
}
.open-card h2 {
  font-family: var(--serif);
  font-size: clamp(22px, 2.2vw, 28px);
  letter-spacing: -0.02em;
  margin-bottom: 14px;
}
.open-card p { color: rgba(244, 241, 234, 0.7); font-size: 15.5px; line-height: 1.56; }

.open-foot {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 24px 40px;
  padding-top: clamp(32px, 4vw, 46px);
  border-top: 1px solid rgba(244, 241, 234, 0.16);
}
.open-quote {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(18px, 1.9vw, 24px);
  line-height: 1.4;
  color: rgba(244, 241, 234, 0.92);
  max-width: 42ch;
}
.open .arrow-link { color: var(--accent-light); margin-top: 0; font-size: 13px; }
.open .arrow-link:hover { border-bottom-color: var(--accent-light); }

/* ---------- platform / pipeline ---------- */
.platform .section-head { margin-bottom: clamp(36px, 5vw, 60px); }
.pipeline {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: center;
  gap: 20px;
  padding: clamp(28px, 3.6vw, 44px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-2);
}
.pipe-step { display: flex; flex-direction: column; gap: 10px; }
.pipe-k { font-family: var(--mono); font-size: 12px; letter-spacing: .08em; color: var(--accent); text-transform: uppercase; }
.pipe-step p { color: var(--ink-soft); font-size: 15px; }
.pipe-arrow { font-size: 26px; color: var(--ink-faint); text-align: center; }

/* ---------- company ---------- */
.company { background: var(--paper-2); }
.company-grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: clamp(32px, 6vw, 88px);
  align-items: start;
}
.company-copy { display: flex; flex-direction: column; gap: 22px; }
.company-copy p {
  font-family: var(--serif);
  font-size: clamp(19px, 1.9vw, 24px);
  line-height: 1.5;
  color: var(--ink);
  letter-spacing: -.01em;
}

/* ---------- careers ---------- */
.careers-intro { max-width: 62ch; color: var(--ink-soft); font-size: clamp(16px, 1.4vw, 19px); margin-bottom: clamp(44px, 6vw, 72px); }
.roles-group { margin-bottom: clamp(44px, 6vw, 76px); }
.roles-group:last-of-type { margin-bottom: 0; }
.roles-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 4px; }
.roles-head .eyebrow { margin: 0; }
.roles-count { font-family: var(--mono); font-size: 12px; color: var(--ink-faint); }

/* role = native <details> disclosure */
.role { border-top: 1px solid var(--line); }
.roles-group .role:last-child { border-bottom: 1px solid var(--line); }
.role-summary {
  list-style: none;
  cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: clamp(22px, 2.6vw, 30px) 0;
  transition: padding-left .3s cubic-bezier(.2,.7,.2,1);
}
.role-summary::-webkit-details-marker { display: none; }
.role-summary:hover { padding-left: 8px; }
.role-summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }
.role-headline { display: flex; flex-direction: column; gap: 8px; }
.role-title { font-family: var(--serif); font-size: clamp(20px, 2vw, 27px); letter-spacing: -.02em; color: var(--ink); }
.role-meta { font-family: var(--mono); font-size: 12.5px; color: var(--ink-faint); letter-spacing: .02em; }
.role-toggle { position: relative; flex: none; width: 24px; height: 24px; }
.role-toggle::before, .role-toggle::after {
  content: ""; position: absolute; background: var(--accent);
  transition: opacity .25s, transform .25s;
}
.role-toggle::before { left: 3px; right: 3px; top: 50%; height: 1.6px; transform: translateY(-50%); }
.role-toggle::after { top: 3px; bottom: 3px; left: 50%; width: 1.6px; transform: translateX(-50%); }
.role[open] .role-toggle::after { opacity: 0; transform: translateX(-50%) rotate(90deg); }

.role-body { padding: 4px 0 clamp(28px, 3vw, 38px); max-width: 880px; animation: roleIn .4s cubic-bezier(.2,.7,.2,1); }
@keyframes roleIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.role-lead { color: var(--ink-soft); font-size: 15.5px; line-height: 1.6; margin-bottom: 24px; max-width: 72ch; }
.role-cols { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(22px, 3vw, 48px); margin-bottom: 28px; }
.role-col h4 { font-family: var(--mono); font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint); margin: 0 0 14px; }
.role-col ul { display: flex; flex-direction: column; gap: 10px; }
.role-col li { position: relative; padding-left: 19px; font-size: 14.5px; line-height: 1.5; color: var(--ink); }
.role-col li::before { content: ""; position: absolute; left: 0; top: 8px; width: 7px; height: 7px; border-radius: 2px; border: 1.5px solid var(--accent); }

.roles-note {
  margin-top: clamp(44px, 6vw, 72px);
  padding: clamp(26px, 3vw, 36px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-2);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 32px;
}
.roles-note p { color: var(--ink-soft); font-size: 15.5px; max-width: 60ch; }
.roles-note .arrow-link { margin: 0; }

/* ---------- blog index ---------- */
.post-list { display: flex; flex-direction: column; }
.post-item {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: clamp(18px, 4vw, 56px);
  padding: clamp(28px, 3.5vw, 44px) 0;
  border-top: 1px solid var(--line);
  transition: padding-left .4s cubic-bezier(.2,.7,.2,1);
}
.post-list .post-item:last-child { border-bottom: 1px solid var(--line); }
.post-item:hover { padding-left: 10px; }
.post-date { font-family: var(--mono); font-size: 13px; color: var(--accent); letter-spacing: .04em; padding-top: 7px; }
.post-item h2 { font-family: var(--serif); font-size: clamp(24px, 2.8vw, 34px); letter-spacing: -.02em; margin-bottom: 12px; }
.post-item h2 a { transition: color .2s; }
.post-item:hover h2 a { color: var(--accent); }
.post-excerpt { color: var(--ink-soft); max-width: 62ch; font-size: clamp(15.5px, 1.3vw, 17px); line-height: 1.6; margin-bottom: 18px; }
.post-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.post-tag {
  font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-faint);
  padding: 3px 11px; border: 1px solid var(--line); border-radius: 100px;
}

/* ---------- blog article ---------- */
.post-head .eyebrow { margin-bottom: 18px; }
.post-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px;
  margin-top: 22px;
  font-family: var(--mono); font-size: 12.5px; letter-spacing: .02em;
  color: var(--ink-faint);
}
.post-meta .dot { opacity: .5; }
.post-body { max-width: 720px; }
.post-body h2 { font-family: var(--serif); font-size: clamp(24px, 2.6vw, 32px); letter-spacing: -.02em; margin: clamp(34px, 4vw, 52px) 0 16px; }
.post-body h3 { font-family: var(--serif); font-size: clamp(20px, 2vw, 24px); letter-spacing: -.02em; margin: clamp(28px, 3vw, 40px) 0 12px; }
.post-body p { font-size: 17.5px; line-height: 1.75; color: var(--ink); margin-bottom: 20px; }
.post-body .post-lead { font-size: clamp(18px, 1.7vw, 21px); line-height: 1.6; color: var(--ink-soft); margin-bottom: 24px; }
.post-body ul, .post-body ol { display: flex; flex-direction: column; gap: 10px; margin: 0 0 22px; padding: 0; }
.post-body li { position: relative; padding-left: 24px; font-size: 17.5px; line-height: 1.7; color: var(--ink); }
.post-body ul li::before { content: ""; position: absolute; left: 2px; top: 11px; width: 7px; height: 7px; border-radius: 2px; border: 1.5px solid var(--accent); }
.post-body ol { counter-reset: li; }
.post-body ol li { counter-increment: li; }
.post-body ol li::before { content: counter(li); position: absolute; left: 0; top: 1px; font-family: var(--mono); font-size: 13px; color: var(--accent); }
.post-body a { color: var(--accent); border-bottom: 1px solid transparent; transition: border-color .2s; }
.post-body a:hover { border-bottom-color: var(--accent); }
.post-body strong { font-weight: 600; }
.post-body blockquote {
  margin: 28px 0; padding: 4px 0 4px 24px;
  border-left: 2px solid var(--accent);
  font-family: var(--serif); font-style: italic;
  font-size: clamp(19px, 2vw, 23px); line-height: 1.5; color: var(--ink);
}
.post-body figure { margin: 28px 0; }
.post-body figure img { width: 100%; border-radius: var(--radius); border: 1px solid var(--line); }
.post-body figcaption { margin-top: 10px; font-family: var(--mono); font-size: 12px; color: var(--ink-faint); text-align: center; }
.post-body pre {
  background: var(--ink); color: var(--paper);
  border-radius: var(--radius);
  padding: 18px 20px; overflow-x: auto; margin: 0 0 22px;
  font-family: var(--mono); font-size: 13.5px; line-height: 1.6;
}
.post-body :not(pre) > code {
  font-family: var(--mono); font-size: .88em;
  background: var(--paper-3); padding: 2px 6px; border-radius: 5px;
}
.post-body hr { border: none; border-top: 1px solid var(--line); margin: clamp(36px, 4vw, 52px) 0; }
.post-back { margin-bottom: 26px; }
.post-foot {
  max-width: 720px;
  margin-top: clamp(40px, 5vw, 64px);
  padding-top: 28px;
  border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 32px;
}
.post-foot p { color: var(--ink-soft); font-size: 15.5px; }

/* ---------- 404 ---------- */
.error-hero {
  min-height: 66vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  padding: clamp(56px, 9vw, 110px) 0;
  position: relative; z-index: 2;
}
.nf-code {
  font-family: var(--serif); font-weight: 300;
  font-size: clamp(112px, 24vw, 280px);
  line-height: 0.86; letter-spacing: -0.04em;
  color: var(--ink);
  margin-bottom: clamp(16px, 3vw, 30px);
}
.nf-code em {
  font-style: italic; color: var(--accent);
  display: inline-block;
  animation: nfFloat 4.5s ease-in-out infinite;
}
@keyframes nfFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-0.07em); } }
.error-hero h1 {
  font-family: var(--serif);
  font-size: clamp(26px, 3.6vw, 44px);
  letter-spacing: -0.025em; line-height: 1.1;
  max-width: 20ch;
}
.error-hero h1 em { font-style: italic; color: var(--accent); }
.error-sub { margin-top: 18px; max-width: 52ch; color: var(--ink-soft); font-size: clamp(16px, 1.4vw, 19px); line-height: 1.55; }
.error-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: clamp(28px, 4vw, 38px); }
.error-links {
  display: flex; flex-wrap: wrap; gap: 12px 26px; justify-content: center;
  width: 100%; max-width: 540px;
  margin-top: clamp(36px, 5vw, 52px); padding-top: 26px;
  border-top: 1px solid var(--line);
}
.error-links a {
  font-family: var(--mono); font-size: 12.5px; letter-spacing: .04em;
  color: var(--ink-soft); transition: color .2s;
}
.error-links a:hover { color: var(--accent); }

/* ---------- legal / prose pages ---------- */
.legal { max-width: 760px; }
.legal .legal-meta {
  font-family: var(--mono);
  font-size: 12.5px; letter-spacing: .02em;
  color: var(--ink-faint);
  margin-bottom: clamp(28px, 4vw, 44px);
}
.legal h2 {
  font-family: var(--serif);
  font-size: clamp(22px, 2.4vw, 30px);
  letter-spacing: -.02em;
  margin: clamp(30px, 4vw, 46px) 0 14px;
}
.legal h2:first-of-type { margin-top: 0; }
.legal p { color: var(--ink-soft); font-size: 16.5px; line-height: 1.7; margin-bottom: 16px; }
.legal ul { display: flex; flex-direction: column; gap: 9px; margin: 0 0 18px; }
.legal li {
  position: relative; padding-left: 20px;
  color: var(--ink-soft); font-size: 16.5px; line-height: 1.6;
}
.legal li::before {
  content: ""; position: absolute; left: 0; top: 9px;
  width: 7px; height: 7px; border-radius: 2px;
  border: 1.5px solid var(--accent);
}
.legal a { color: var(--accent); border-bottom: 1px solid transparent; transition: border-color .2s; }
.legal a:hover { border-bottom-color: var(--accent); }

/* ---------- footer ---------- */
.site-footer {
  position: relative; z-index: 2;
  border-top: 1px solid var(--line);
  padding-top: clamp(48px, 6vw, 76px);
  padding-bottom: 34px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: clamp(28px, 4vw, 56px);
  padding-bottom: clamp(40px, 5vw, 64px);
}
.footer-tagline {
  margin-top: 18px;
  color: var(--ink-soft);
  font-size: 15px;
  max-width: 34ch;
}
.footer-col { display: flex; flex-direction: column; gap: 12px; }
.footer-h {
  font-family: var(--mono);
  font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 4px;
}
.footer-col a { font-size: 15px; color: var(--ink-soft); transition: color .2s; width: fit-content; }
.footer-col a:hover { color: var(--accent); }
.footer-bottom {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 28px;
  border-top: 1px solid var(--line-soft);
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--ink-faint);
}
.footer-bottom-right { display: flex; align-items: center; gap: clamp(16px, 3vw, 26px); }
.footer-legal { display: flex; gap: 22px; }
.footer-legal a:hover { color: var(--ink); }

/* social icon buttons */
.socials { display: inline-flex; gap: 9px; }
.social {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink-soft);
  transition: color .2s, border-color .2s, background .2s, transform .25s cubic-bezier(.2,.7,.2,1);
}
.social:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(192, 80, 43, 0.06);
  transform: translateY(-2px);
}
.social svg { width: 16px; height: 16px; fill: currentColor; }

/* ---------- reveal animation ---------- */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .7s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1);
}
.reveal.in { opacity: 1; transform: none; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 940px) {
  .nav, .header-actions { display: none; }
  .menu-toggle { display: flex; }

  .teasers { grid-template-columns: 1fr; }
  .open-teaser-grid { grid-template-columns: 1fr; gap: 40px; }
  .approach-grid { grid-template-columns: 1fr; gap: 40px; }
  .company-grid { grid-template-columns: 1fr; gap: 24px; }
  .open-grid { grid-template-columns: 1fr; }
  .pipeline { grid-template-columns: 1fr; }
  .pipe-arrow { transform: rotate(90deg); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 620px) {
  body { font-size: 16px; }

  /* dial the big serif display type down so it doesn't crowd the gutters
     on phones (the desktop clamp floors read oversized under ~620px) */
  .page-hero-title { font-size: clamp(30px, 8vw, 42px); line-height: 1.07; letter-spacing: -0.02em; }
  .section-title { font-size: clamp(26px, 7vw, 40px); }
  .open-teaser h2 { font-size: clamp(25px, 6.6vw, 40px); }

  .service { grid-template-columns: 1fr; gap: 14px; }
  .service-index { padding-top: 0; }
  .service:hover { padding-left: 0; }
  .service-features { grid-template-columns: 1fr; }
  .pillars { grid-template-columns: 1fr; }
  .role-cols { grid-template-columns: 1fr; }
  .role-summary { gap: 16px; }
  .role-summary:hover { padding-left: 0; }
  .post-item { grid-template-columns: 1fr; gap: 10px; }
  .post-date { padding-top: 0; }
  .post-item:hover { padding-left: 0; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 14px; }
}

/* ---------- motion preference ---------- */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
}
