/* ============================================================
   BUILD ON PURPOSE — Design System
   Light Editorial Premium · Masterbrand: Build on Purpose · Builder: Tom Frerich
   Ref: Apple · Linear · Notion · Editorial Magazine
   Typo Option B: Instrument Serif (display) + Inter Tight (UI) + JetBrains Mono (labels)
   Linked by all rebuilt Build-on-Purpose pages (NOT sacred product pages).
   ============================================================ */

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

:root {
  /* --- Color: Light Editorial Premium (monochrome, warm paper, no gradient) --- */
  --bg:        #FAFAF8;   /* warm off-white */
  --bg-soft:   #F5F3EE;   /* warm paper, alternating sections */
  --surface:   #FFFFFF;   /* cards */
  --ink:       #111111;   /* text + primary accent */
  --muted:     #6B6862;   /* secondary text */
  --faint:     #9A968E;   /* captions, tertiary */
  --hairline:  #E7E4DD;   /* borders */
  --accent:    #111111;   /* = ink, monochrome */

  /* --- Type --- */
  --font-display: "Instrument Serif", Georgia, serif;
  --font-ui: "Inter Tight", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* --- Spacing scale (4-base) --- */
  --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px; --s5: 24px;
  --s6: 32px; --s7: 48px; --s8: 64px; --s9: 96px; --s10: 128px; --s11: 160px;

  /* --- Containers --- */
  --wide: 1200px;
  --container: 1080px;
  --reading: 680px;
  --gutter: 24px;

  --radius: 16px;
  --radius-sm: 10px;
  --pill: 100px;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --nav-h: 64px;
}

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--ink);
  font-size: 17px;
  line-height: 1.6;
  font-weight: 400;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
::selection { background: var(--ink); color: var(--bg); }

/* --- Type scale --- */
.display {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(56px, 11vw, 132px);
  line-height: 0.95;
  letter-spacing: -0.02em;
}
h1, .h1 { font-family: var(--font-ui); font-weight: 600; font-size: clamp(40px, 6vw, 64px); line-height: 1.05; letter-spacing: -0.03em; }
h2, .h2 { font-family: var(--font-ui); font-weight: 600; font-size: clamp(28px, 4vw, 40px); line-height: 1.1; letter-spacing: -0.025em; }
h3, .h3 { font-family: var(--font-ui); font-weight: 600; font-size: clamp(20px, 2.2vw, 24px); line-height: 1.2; letter-spacing: -0.015em; }
.lead { font-size: clamp(19px, 2.4vw, 22px); line-height: 1.5; color: var(--muted); font-weight: 400; }
.body { font-size: 17px; line-height: 1.65; }
.small { font-size: 15px; color: var(--muted); }
.label {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--faint);
}
.serif { font-family: var(--font-display); font-weight: 400; letter-spacing: -0.01em; }

/* --- Layout --- */
.container { max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
.wide { max-width: var(--wide); margin: 0 auto; padding: 0 var(--gutter); }
.reading { max-width: var(--reading); margin: 0 auto; padding: 0 var(--gutter); }
section { padding: clamp(64px, 11vw, 160px) 0; }
.section-soft { background: var(--bg-soft); }
.divider { height: 1px; background: var(--hairline); border: 0; }

/* --- Navigation --- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--nav-h);
  display: flex; align-items: center;
  background: rgba(250,250,248,0);
  transition: background 300ms var(--ease), border-color 300ms var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.scrolled { background: rgba(250,250,248,0.82); backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px); border-bottom-color: var(--hairline); }
.nav-in { width: 100%; max-width: var(--wide); margin: 0 auto; padding: 0 var(--gutter); display: flex; align-items: center; justify-content: space-between; gap: var(--s5); }
.wordmark { font-family: var(--font-mono); font-weight: 600; font-size: 13px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink); white-space: nowrap; }
.nav-links { display: flex; align-items: center; gap: 2px; }
.nav-links a { font-size: 14px; font-weight: 500; color: var(--muted); padding: 8px 12px; border-radius: 8px; transition: color 160ms var(--ease); position: relative; }
.nav-links a:hover { color: var(--ink); }
.nav-links a.ext::after { content: "↗"; font-size: 10px; margin-left: 3px; opacity: .5; }
.nav-author { font-size: 12px; color: var(--faint); white-space: nowrap; }
.nav-author b { color: var(--ink); font-weight: 600; }
.burger { display: none; background: none; border: 0; font-size: 22px; color: var(--ink); cursor: pointer; padding: 6px; line-height: 1; }

/* mobile menu */
.mobile-menu { position: fixed; inset: var(--nav-h) 0 0 0; background: var(--bg); z-index: 99; transform: translateY(-8px); opacity: 0; pointer-events: none; transition: opacity 240ms var(--ease), transform 240ms var(--ease); padding: var(--s6) var(--gutter); display: flex; flex-direction: column; gap: 2px; }
.mobile-menu.open { opacity: 1; transform: translateY(0); pointer-events: auto; }
.mobile-menu a { font-family: var(--font-ui); font-size: 26px; font-weight: 600; letter-spacing: -0.02em; color: var(--ink); padding: 12px 0; border-bottom: 1px solid var(--hairline); }
.mobile-menu .mm-author { margin-top: auto; font-size: 13px; color: var(--faint); border: 0; padding-top: var(--s6); }

/* --- Buttons --- */
.btn { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-ui); font-size: 15px; font-weight: 600; padding: 14px 26px; border-radius: var(--pill); border: 1px solid transparent; cursor: pointer; transition: all 240ms var(--ease); letter-spacing: -0.01em; white-space: nowrap; }
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { background: #2a2a2a; transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--hairline); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-wa { background: #111; color: #fff; }
.btn-wa svg { width: 16px; height: 16px; }
.btn-row { display: flex; gap: var(--s3); flex-wrap: wrap; }

/* --- Cards --- */
.card { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius); padding: var(--s6); transition: border-color 240ms var(--ease), transform 240ms var(--ease); }
.card:hover { border-color: var(--ink); transform: translateY(-2px); }
.grid { display: grid; gap: var(--s5); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

/* work / proof cards */
.work-card { display: flex; flex-direction: column; gap: var(--s3); min-height: 240px; }
.work-card .wc-meta { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); }
.work-card .wc-role { margin-top: auto; font-size: 13px; color: var(--muted); }
.work-card .wc-arrow { font-size: 13px; color: var(--ink); opacity: 0; transform: translateX(-4px); transition: all 240ms var(--ease); }
.work-card:hover .wc-arrow { opacity: 1; transform: translateX(0); }

/* --- Sticky mobile WhatsApp --- */
.sticky-cta { display: none; }

/* --- Footer --- */
.footer { background: var(--bg-soft); border-top: 1px solid var(--hairline); padding: var(--s9) 0 var(--s7); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: var(--s7); }
.footer .wordmark { font-size: 15px; margin-bottom: var(--s3); }
.footer-tag { font-family: var(--font-display); font-size: 22px; color: var(--ink); margin-bottom: var(--s3); }
.footer h4 { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); margin-bottom: var(--s4); font-weight: 500; }
.footer-links { display: flex; flex-direction: column; gap: var(--s3); }
.footer-links a { font-size: 15px; color: var(--muted); transition: color 160ms; }
.footer-links a:hover { color: var(--ink); }
.footer-bottom { margin-top: var(--s8); padding-top: var(--s5); border-top: 1px solid var(--hairline); display: flex; justify-content: space-between; gap: var(--s4); flex-wrap: wrap; font-size: 13px; color: var(--faint); }

/* --- Reveal on scroll --- */
.reveal { opacity: 0; transform: translateY(12px); transition: opacity 600ms var(--ease), transform 600ms var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* --- Responsive --- */
@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: var(--s6); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .nav-links, .nav-author { display: none; }
  .burger { display: block; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  section { padding: 72px 0; }
  /* sticky WhatsApp on mobile — contact never more than 1 tap away */
  .sticky-cta { display: flex; position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 95; }
  .sticky-cta .btn { flex: 1; justify-content: center; box-shadow: 0 8px 30px rgba(0,0,0,.18); }
  body { padding-bottom: 84px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}
