/* ==========================================================================
   MDB Development — October 2026 rebuild
   Editorial serif headlines, Inter body, one copper accent from the wordmark.
   Built against Vercel's Web Interface Guidelines. No build step.
   Light/dark via [data-theme] (set before first paint in index.html).
   ========================================================================== */

:root {
    --bg: #f6f4ef;
    --bg-2: #eeebe3;
    --surface: #fffdf9;
    --ink: #1a1815;
    --ink-2: #4a463f;
    --muted: #6f6a61;
    --line: rgba(60, 48, 30, 0.14);
    --line-strong: rgba(60, 48, 30, 0.28);
    --accent: #a85f1e;
    --accent-hover: #8a4c14;
    --accent-soft: rgba(168, 95, 30, 0.1);
    --on-accent: #fffdf9;
    --danger: #b3261e;
    --ok: #2f6b3a;
    --shadow: 0 1px 2px rgba(60, 40, 15, 0.06), 0 18px 40px -20px rgba(60, 40, 15, 0.28);

    --font-display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
    --font-sans: "Hanken Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

    --wrap: 1200px;
    --gutter: max(20px, env(safe-area-inset-left), env(safe-area-inset-right));
    --nav-h: 68px;
    --radius: 8px;
    --radius-lg: 14px;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);

    color-scheme: light;
}

[data-theme="dark"] {
    --bg: #121110;
    --bg-2: #1a1816;
    --surface: #1f1d1a;
    --ink: #f2eee7;
    --ink-2: #cdc6ba;
    --muted: #9b958a;
    --line: rgba(240, 225, 200, 0.1);
    --line-strong: rgba(240, 225, 200, 0.22);
    --accent: #e09a55;
    --accent-hover: #f0b273;
    --accent-soft: rgba(224, 154, 85, 0.12);
    --on-accent: #1a1209;
    --danger: #ff8a80;
    --ok: #8fd19e;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 22px 48px -22px rgba(0, 0, 0, 0.8);

    color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}
@media (pointer: fine) { html { overscroll-behavior: none; } }
body {
    margin: 0;
    overflow-x: hidden;
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.6;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, p, dl, dd { margin: 0; }
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }
[id] { scroll-margin-top: calc(var(--nav-h) + 16px); }
::selection { background: var(--accent); color: var(--on-accent); }

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 4px;
}

.visually-hidden {
    position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
    position: absolute; left: var(--gutter); top: 8px; z-index: 100;
    padding: 10px 14px; background: var(--ink); color: var(--bg);
    border-radius: var(--radius); font-weight: 600;
    transform: translateY(-150%);
    transition: transform 0.2s var(--ease);
}
.skip-link:focus-visible { transform: translateY(0); }

.wrap {
    width: 100%;
    max-width: calc(var(--wrap) + var(--gutter) * 2);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

em { font-style: normal; color: var(--accent); }

.label {
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

/* ---------- Buttons & links ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    min-height: 44px; padding: 0 20px;
    border-radius: 999px;
    font-weight: 600; font-size: 15px; line-height: 1;
    border: 1px solid transparent;
    transition: background-color 0.18s, color 0.18s, border-color 0.18s, transform 0.18s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { background: var(--accent); color: var(--on-accent); }
.btn-ghost { border-color: var(--line-strong); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink); background: var(--bg-2); }
.btn-sm { min-height: 40px; padding: 0 16px; font-size: 14px; }
.btn-lg { min-height: 52px; padding: 0 26px; font-size: 16px; }
.btn-full { width: 100%; }
.btn[disabled] { cursor: progress; opacity: 0.85; }

.link-arrow {
    display: inline-flex; align-items: center; gap: 6px;
    min-height: 44px;
    font-weight: 600; color: var(--accent);
    transition: color 0.18s;
}
.link-arrow::after { content: "↗"; transition: transform 0.18s var(--ease); }
.link-arrow:hover { color: var(--accent-hover); }
.link-arrow:hover::after { transform: translate(2px, -2px); }

.icon-btn {
    display: inline-grid; place-items: center;
    width: 44px; height: 44px; border-radius: 999px;
    color: var(--ink-2);
    transition: background-color 0.18s, color 0.18s;
}
.icon-btn:hover { background: var(--bg-2); color: var(--ink); }
.i-sun { display: none; }
[data-theme="dark"] .i-sun { display: block; }
[data-theme="dark"] .i-moon { display: none; }

/* ---------- Nav ---------- */
.nav {
    position: sticky; top: 0; z-index: 50;
    padding-top: env(safe-area-inset-top);
    background: color-mix(in srgb, var(--bg) 86%, transparent);
    -webkit-backdrop-filter: saturate(1.4) blur(12px);
    backdrop-filter: saturate(1.4) blur(12px);
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}
.nav.scrolled { border-bottom-color: var(--line); }
.nav-row { display: flex; align-items: center; gap: 16px; height: var(--nav-h); }

.brand { display: inline-flex; align-items: baseline; gap: 2px; min-height: 44px; align-items: center; }
.brand-mark { font-family: var(--font-display); font-weight: 800; font-size: 24px; line-height: 1; letter-spacing: -0.04em; }
.brand-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin: 10px 8px 0 2px; align-self: center; }
.brand-name { font-size: 13px; color: var(--muted); font-weight: 500; letter-spacing: 0.02em; }

.nav-links { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.nav-links a:not(.btn) {
    display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px;
    font-size: 15px; color: var(--ink-2); border-radius: 999px;
    transition: color 0.18s, background-color 0.18s;
}
.nav-links a:not(.btn):hover { color: var(--ink); background: var(--bg-2); }
.nav-links .btn { margin-left: 8px; }
.nav-tools { display: flex; align-items: center; gap: 2px; }

.nav-toggle { display: none; position: relative; }
.nav-toggle span {
    position: absolute; left: 13px; right: 13px; height: 1.5px; background: currentColor; border-radius: 2px;
    transition: transform 0.2s var(--ease);
}
.nav-toggle span:first-child { transform: translateY(-4px); }
.nav-toggle span:last-child { transform: translateY(4px); }
.nav-toggle[aria-expanded="true"] span:first-child { transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:last-child { transform: rotate(-45deg); }

@media (max-width: 820px) {
    .nav-toggle { display: inline-grid; }
    .nav-tools { margin-left: auto; }
    .nav-links {
        position: fixed; inset: calc(var(--nav-h) + env(safe-area-inset-top)) 0 auto 0;
        flex-direction: column; align-items: stretch; gap: 0;
        padding: 8px var(--gutter) 20px;
        background: var(--bg);
        border-bottom: 1px solid var(--line);
        box-shadow: var(--shadow);
        overscroll-behavior: contain;
        visibility: hidden; opacity: 0; transform: translateY(-8px);
        transition: opacity 0.2s, transform 0.2s var(--ease), visibility 0s linear 0.2s;
    }
    .nav-links.open { visibility: visible; opacity: 1; transform: none; transition-delay: 0s; }
    .nav-links a:not(.btn) { min-height: 48px; font-size: 17px; border-radius: var(--radius); }
    .nav-links .btn { margin: 12px 0 0; min-height: 48px; }
}

/* ---------- Hero ---------- */
.hero { padding: clamp(56px, 10vw, 128px) 0 clamp(48px, 7vw, 88px); }
.eyebrow { font-family: var(--font-mono); font-size: 13px; color: var(--muted); letter-spacing: 0.04em; }
.hero h1 {
    margin-top: 20px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(42px, 7.6vw, 100px);
    line-height: 0.96;
    letter-spacing: -0.035em;
    max-width: 16ch;
}
.lead { margin-top: 28px; max-width: 58ch; font-size: clamp(17px, 2vw, 20px); color: var(--ink-2); }
.hero-actions { margin-top: 36px; display: flex; flex-wrap: wrap; gap: 12px; }

.hero-clients {
    margin-top: clamp(48px, 7vw, 80px); padding-top: 20px;
    border-top: 1px solid var(--line);
    display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px;
}
.hero-clients ul { display: flex; flex-wrap: wrap; gap: 4px 28px; }
.hero-clients a {
    display: inline-flex; align-items: center; min-height: 44px;
    font-family: var(--font-display); font-weight: 600; font-size: clamp(18px, 2vw, 22px); letter-spacing: -0.02em;
    color: var(--ink-2);
    transition: color 0.18s;
}
.hero-clients a:hover { color: var(--accent); }

/* ---------- Sections ---------- */
.section { padding: clamp(72px, 10vw, 128px) 0; }
.section-alt { background: var(--bg-2); }
.section-head { max-width: 760px; margin-bottom: clamp(40px, 6vw, 72px); }
.section-head h2, .about h2, .contact h2 {
    margin-top: 14px;
    font-family: var(--font-display); font-weight: 700;
    font-size: clamp(32px, 4.6vw, 56px); line-height: 1.04; letter-spacing: -0.035em;
}
.section-sub { margin-top: 18px; font-size: 18px; color: var(--ink-2); max-width: 60ch; }

/* ---------- Work ---------- */
.project {
    display: grid; gap: clamp(24px, 4vw, 56px);
    grid-template-columns: minmax(0, 1fr);
    align-items: center;
    padding: clamp(32px, 5vw, 56px) 0;
    border-top: 1px solid var(--line);
}
.project:first-of-type { border-top: 0; padding-top: 0; }
@media (min-width: 900px) {
    .project { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
    .project-flip .shot { order: 2; }
}

.shot {
    display: block; overflow: hidden;
    border-radius: var(--radius-lg);
    border: 1px solid var(--line-strong);
    background: var(--surface);
    box-shadow: var(--shadow);
    transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
.shot:hover { transform: translateY(-4px); }
.shot img { width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; }
.shot-bar {
    display: flex; align-items: center; gap: 6px;
    height: 34px; padding: 0 12px;
    border-bottom: 1px solid var(--line);
    background: var(--bg-2);
}
.shot-bar i { width: 9px; height: 9px; border-radius: 50%; background: var(--line-strong); }
.shot-bar span {
    min-width: 0; margin-left: 10px;
    font-family: var(--font-mono); font-size: 12px; color: var(--muted);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.project-meta { min-width: 0; }
.project-meta h3 {
    margin-top: 10px;
    font-family: var(--font-display); font-weight: 700;
    font-size: clamp(26px, 3vw, 38px); line-height: 1.08; letter-spacing: -0.03em;
    overflow-wrap: anywhere;
}
.project-meta > p:not(.label) { margin-top: 16px; color: var(--ink-2); }
.tags { margin: 20px 0 8px; display: flex; flex-wrap: wrap; gap: 8px; }
.tags li {
    padding: 5px 11px; border-radius: 999px;
    border: 1px solid var(--line-strong);
    font-size: 13px; color: var(--ink-2);
}

/* ---------- Services ---------- */
.services { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.service {
    padding: clamp(24px, 3vw, 36px);
    border-radius: var(--radius-lg);
    background: var(--surface);
    border: 1px solid var(--line);
}
.num { font-family: var(--font-mono); font-size: 12px; color: var(--accent); letter-spacing: 0.06em; font-variant-numeric: tabular-nums; }
.service h3 { margin-top: 18px; font-size: 22px; font-weight: 600; letter-spacing: -0.01em; }
.service > p:not(.num) { margin-top: 10px; color: var(--ink-2); }
.checks { margin-top: 20px; display: grid; gap: 10px; }
.checks li { position: relative; padding-left: 26px; font-size: 15px; }
.checks li::before {
    content: ""; position: absolute; left: 2px; top: 7px;
    width: 12px; height: 7px;
    border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent);
    transform: rotate(-45deg);
}

/* ---------- Process ---------- */
.steps { display: grid; gap: 0; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); counter-reset: step; }
.steps li { padding: 28px 24px 28px 0; border-top: 2px solid var(--ink); margin-right: 16px; }
.steps h3 { margin-top: 14px; font-size: 20px; font-weight: 600; }
.steps li > p:not(.num) { margin-top: 10px; color: var(--ink-2); font-size: 15px; }

/* ---------- About ---------- */
.about { display: grid; gap: 32px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .about { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 64px; } }
.about-body > p { font-size: 18px; color: var(--ink-2); }
.about-body > p + p { margin-top: 18px; }
.facts {
    margin-top: 36px;
    display: grid; gap: 1px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr));
    background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden;
}
.facts div { padding: 20px; background: var(--bg-2); }
.facts dt { font-size: 13px; color: var(--muted); }
.facts dd { margin-top: 6px; font-family: var(--font-display); font-weight: 700; letter-spacing: -0.03em; font-size: 28px; line-height: 1.1; font-variant-numeric: tabular-nums; }

/* ---------- Contact ---------- */
.contact { display: grid; gap: 40px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .contact { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 64px; } }
.contact-info > p:not(.label) { margin-top: 18px; font-size: 18px; color: var(--ink-2); }
.contact-details { margin-top: 32px; display: grid; gap: 16px; }
.contact-details dt { font-size: 13px; color: var(--muted); }
.contact-details dd { margin-top: 2px; overflow-wrap: anywhere; }
.contact-details a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.contact-details a:hover { color: var(--accent-hover); }

.form {
    display: grid; gap: 18px;
    padding: clamp(20px, 3vw, 36px);
    border-radius: var(--radius-lg);
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}
.form-row { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.field { display: grid; gap: 6px; min-width: 0; }
.field label { font-size: 14px; font-weight: 600; }
.field input, .field select, .field textarea {
    width: 100%; min-height: 48px; padding: 12px 14px;
    font: inherit; font-size: 16px; /* ≥16px prevents iOS zoom */
    color: var(--ink); background-color: var(--bg);
    border: 1px solid var(--line-strong); border-radius: var(--radius);
    transition: border-color 0.18s, box-shadow 0.18s;
}
.field textarea { resize: vertical; min-height: 140px; }
.field select option { background-color: var(--bg); color: var(--ink); }
.field input::placeholder, .field textarea::placeholder { color: var(--muted); opacity: 1; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: var(--ink-2); }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible {
    outline: none; /* replaced by the ring below */
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft), 0 0 0 1px var(--accent);
}
.field [aria-invalid="true"] { border-color: var(--danger); }
.field-err { min-height: 0; font-size: 14px; color: var(--danger); }
.field-err:empty { display: none; }
.field-err::before { content: "⚠ "; }
.field-hint { font-size: 13px; color: var(--muted); }
kbd {
    font-family: var(--font-mono); font-size: 12px;
    padding: 1px 6px; border: 1px solid var(--line-strong); border-radius: 4px; background: var(--bg-2);
}
@media (pointer: coarse) { .field-hint { display: none; } }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.spinner {
    display: none; width: 16px; height: 16px; border-radius: 50%;
    border: 2px solid currentColor; border-right-color: transparent;
    animation: spin 0.7s linear infinite;
}
.btn.loading .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.form-status { font-size: 15px; }
.form-status:empty { display: none; }
.form-status.success { color: var(--ok); }
.form-status.success::before { content: "✓ "; }
.form-status.error { color: var(--danger); }
.form-status.error::before { content: "⚠ "; }

/* ---------- Footer ---------- */
.footer { padding: 40px 0 calc(40px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.footer-row { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 32px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 0 4px; margin-left: auto; }
.footer-links a {
    display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px;
    font-size: 14px; color: var(--ink-2); transition: color 0.18s;
}
.footer-links a:hover { color: var(--accent); }
.footer-note { flex-basis: 100%; font-size: 13px; color: var(--muted); }

/* ---------- Reveal (progressive: visible without JS) ---------- */
.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.js .reveal.in-view { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
    .js .reveal { opacity: 1; transform: none; }
    .shot:hover { transform: none; }
    .spinner { animation: spin 1.6s linear infinite !important; animation-duration: 1.6s !important; animation-iteration-count: infinite !important; }
}
