:root {
  --bg: #faf8f5;
  --surface: #ffffff;
  --ink: #1f1d1a;
  --muted: #6b6660;
  --line: #e7e2db;
  --accent: #d4532c;
  --accent-ink: #ffffff;
  --radius: 16px;
  --wrap: 1120px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141311;
    --surface: #1d1b19;
    --ink: #f3efe9;
    --muted: #a39d95;
    --line: #2e2b28;
    --accent: #f07a52;
    --accent-ink: #141311;
    color-scheme: dark;
  }
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.65 var(--font);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-underline-offset: 3px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 0.5em; font-weight: 600; }
h1 { font-size: clamp(2.25rem, 5.5vw, 4rem); letter-spacing: -0.035em; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 24px; }
@media (max-width: 600px) { .wrap { padding-inline: 16px; } }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; z-index: 10; background: var(--surface); padding: 8px 12px; }

.eyebrow { font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin-bottom: 1rem; }
.eyebrow a { text-decoration: none; }
.lead { font-size: clamp(1.1rem, 2vw, 1.3rem); color: var(--muted); max-width: 40ch; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.brand { font-weight: 700; text-decoration: none; letter-spacing: -0.01em; }
.site-header nav { display: flex; gap: clamp(14px, 3vw, 28px); }
.site-header nav a { text-decoration: none; color: var(--muted); font-weight: 500; font-size: 0.95rem; }
.site-header nav a:hover, .site-header nav a[aria-current="page"] { color: var(--ink); }

/* Buttons */
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 2rem; }
.button { display: inline-flex; align-items: center; min-height: 48px; padding: 0 22px; border-radius: 999px; background: var(--ink); color: var(--bg); text-decoration: none; font-weight: 600; transition: transform 0.15s ease; }
.button:hover { color: var(--bg); transform: translateY(-1px); }
.button-ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.button-ghost:hover { color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }

/* Sections */
.hero { padding-block: clamp(64px, 12vw, 140px) clamp(48px, 8vw, 96px); }
.hero h1 { max-width: 18ch; }
.page-head { padding-block: clamp(48px, 9vw, 96px) 16px; }
.section { padding-block: clamp(40px, 6vw, 72px); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.section-head a { color: var(--muted); text-decoration: none; font-weight: 500; }

/* Cards */
.grid { list-style: none; padding: 0; margin: 24px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr)); gap: 24px; }
.card a { display: block; height: 100%; text-decoration: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: transform 0.2s ease, box-shadow 0.2s ease; }
.card a:hover { color: inherit; transform: translateY(-3px); box-shadow: 0 16px 40px -20px rgb(0 0 0 / 0.3); }
.card-cover { aspect-ratio: 16 / 10; overflow: hidden; background: var(--line); }
.card-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.card a:hover .card-cover img { transform: scale(1.03); }
.card-body { padding: 20px 22px 24px; }
.card-body p { color: var(--muted); margin-bottom: 0.75em; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags span { font-size: 0.75rem; font-weight: 500; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.outcome { font-weight: 600; color: var(--accent) !important; }
.outcome-large { font-size: 1.25rem; margin-top: 1.5rem; }

.cover-placeholder { width: 100%; height: 100%; display: grid; place-items: center; font-size: 5rem; font-weight: 700; color: var(--accent); background: radial-gradient(circle at 30% 20%, color-mix(in srgb, var(--accent) 22%, var(--surface)), var(--surface) 70%); }

/* Process */
.process { list-style: none; padding: 0; margin: 24px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.process li { padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.process p { color: var(--muted); margin: 0; }
.step { display: block; font-size: 0.85rem; font-weight: 600; color: var(--accent); margin-bottom: 12px; }

/* About */
.about { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 80px); padding-bottom: 72px; }
@media (max-width: 760px) { .about { grid-template-columns: 1fr; } }
.chips { list-style: none; padding: 0; margin: 0 0 24px; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { padding: 6px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 0.9rem; }

/* Case study */
.case-head { padding-block: clamp(40px, 7vw, 80px) 32px; }
.case-head h1 { max-width: 20ch; }
.meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 24px; margin: 40px 0 0; padding-top: 24px; border-top: 1px solid var(--line); }
.meta dt { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 4px; }
.meta dd { margin: 0; font-weight: 500; }
.case-cover > * { aspect-ratio: 16 / 9; width: 100%; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--line); }
.case-body { padding-block: 56px 32px; }

.prose { max-width: 68ch; }
.case-body.prose { margin-inline: auto; }
.prose h2 { margin-top: 2.2em; }
.prose h3 { margin-top: 1.8em; }
.prose ul { padding-left: 1.2em; margin: 0 0 1em; }
.prose li { margin-bottom: 0.35em; }
.prose figure { margin: 2em 0; }
.prose figure img { border-radius: 12px; border: 1px solid var(--line); }
.prose figcaption { font-size: 0.9rem; color: var(--muted); margin-top: 8px; text-align: center; }

/* Before/after slider */
.compare { position: relative; overflow: hidden; border-radius: 12px; border: 1px solid var(--line); }
.compare img { width: 100%; border: 0 !important; border-radius: 0 !important; }
.compare .compare-before { position: absolute; inset: 0; height: 100%; object-fit: cover; clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.compare::after { content: ""; position: absolute; top: 0; bottom: 0; left: var(--pos); width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 8px rgb(0 0 0 / 0.4); pointer-events: none; }
.compare input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; }
.compare input:focus-visible + * , .compare:focus-within { outline: 2px solid var(--accent); outline-offset: 3px; }
.compare-label { position: absolute; top: 12px; padding: 3px 10px; border-radius: 999px; background: rgb(0 0 0 / 0.6); color: #fff; font-size: 0.75rem; font-weight: 500; pointer-events: none; }
.compare-label-before { left: 12px; }
.compare-label-after { right: 12px; }

.next { padding-block: 32px 80px; border-top: 1px solid var(--line); }
.next a { font-size: clamp(1.5rem, 3vw, 2.25rem); font-weight: 600; letter-spacing: -0.02em; text-decoration: none; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); margin-top: 48px; padding-block: 64px 32px; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 32px; }
.footer-cta { font-size: clamp(1.4rem, 4vw, 2.5rem); font-weight: 600; letter-spacing: -0.02em; margin: 0; overflow-wrap: anywhere; }
.footer-cta a { text-decoration: none; }
.footer-links { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 20px; }
.footer-links a { color: var(--muted); text-decoration: none; font-weight: 500; }
.footer-meta { display: flex; justify-content: space-between; gap: 16px; margin-top: 48px; color: var(--muted); font-size: 0.85rem; }
