/* ==========================================================================
   Deliberate Works — Design System
   Set in Fraunces (display), Hanken Grotesk (text), IBM Plex Mono (meta).
   Warm paper, ink, one ember accent. One shared file for every page.
   ========================================================================== */

:root {
    --paper: #FAF7F2;
    --paper-2: #F3EDE2;
    --ink: #1C1B1A;
    --ink-2: #55504A;
    --ink-3: #8A8379;
    --ember: #BC4B22;
    --ember-2: #9C3B16;
    --hairline: #E0D8C9;
    --dark: #171512;
    --dark-2: #221F1A;
    --dark-hairline: #3A362E;
    --dark-text: #EDE8DF;
    --dark-muted: #A79F91;

    --font-display: 'Fraunces', 'Iowan Old Style', Georgia, serif;
    --font-text: 'Hanken Grotesk', 'Helvetica Neue', Arial, sans-serif;
    --font-mono: 'IBM Plex Mono', 'SF Mono', Menlo, monospace;

    --measure: 44rem;
    --container: 1120px;
    --space-section: clamp(5rem, 10vw, 8.5rem);
}

/* ---------- Reset & base ---------- */

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-text);
    font-size: 1.0625rem;
    font-weight: 400;
    line-height: 1.65;
    color: var(--ink);
    background: var(--paper);
    font-feature-settings: 'onum' 1;
    -webkit-font-smoothing: antialiased;
}

/* Paper grain at threshold of perception */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 2147483647;
    opacity: 0.35;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0.35 0 0 0 0 0.3 0 0 0 0 0.24 0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

::selection { background: var(--ember); color: var(--paper); }

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

img { max-width: 100%; height: auto; display: block; }

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 200;
    background: var(--ink);
    color: var(--paper);
    padding: 0.75rem 1.25rem;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-decoration: none;
}

.skip-link:focus { left: 0; }

/* ---------- Typography ---------- */

h1, h2, h3 {
    font-family: var(--font-display);
    font-weight: 480;
    line-height: 1.12;
    letter-spacing: -0.015em;
    text-wrap: balance;
    font-variant-numeric: lining-nums;
}

h1 { font-size: clamp(2.6rem, 6.2vw, 4.6rem); }
h2 { font-size: clamp(1.9rem, 3.6vw, 2.7rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.5rem); line-height: 1.25; }

p { max-width: var(--measure); }

strong { font-weight: 600; }
em { font-style: italic; }

a {
    color: var(--ember);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    text-decoration-color: color-mix(in srgb, var(--ember) 45%, transparent);
    transition: color 140ms ease, text-decoration-color 140ms ease;
}

a:hover {
    color: var(--ember-2);
    text-decoration-color: currentColor;
}

.eyebrow {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ember);
    margin-bottom: 1.25rem;
}

.section-no {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ink-3);
}

.lede {
    font-size: clamp(1.15rem, 1.8vw, 1.35rem);
    line-height: 1.55;
    color: var(--ink-2);
    font-weight: 400;
}

.mono-note {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--ink-3);
    letter-spacing: 0.02em;
}

/* ---------- Layout ---------- */

.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 clamp(1.25rem, 4vw, 2.5rem);
}

section { padding: var(--space-section) 0; }

.rule {
    border: 0;
    border-top: 1px solid var(--hairline);
    margin: 0;
}

.section-head {
    display: flex;
    align-items: baseline;
    gap: 1.5rem;
    margin-bottom: clamp(2.5rem, 5vw, 4rem);
}

.section-head h2 { flex: 1; }

@media (max-width: 760px) {
    .section-head { flex-direction: column; gap: 0.9rem; }
}

/* ---------- Nav ---------- */

.site-nav {
    border-bottom: 1px solid var(--hairline);
    background: color-mix(in srgb, var(--paper) 92%, transparent);
    backdrop-filter: blur(8px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.site-nav .container {
    display: flex;
    align-items: center;
    gap: 2rem;
    height: 76px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    text-decoration: none;
    color: var(--ink);
    margin-right: auto;
}

.brand img { height: 46px; width: auto; }

.brand-name {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 520;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.9rem;
    list-style: none;
}

.nav-links a {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-2);
    text-decoration: none;
    padding: 0.35rem 0;
    border-bottom: 1px solid transparent;
    transition: color 140ms ease, border-color 140ms ease;
}

.nav-links a:hover { color: var(--ink); border-bottom-color: var(--ember); }
.nav-links a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ember); }

.nav-cta {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--paper) !important;
    background: var(--ink);
    padding: 0.65rem 1.1rem !important;
    border-bottom: none !important;
    text-decoration: none;
    transition: background 140ms ease;
}

.nav-cta:hover { background: var(--ember-2); }

.menu-toggle {
    display: none;
    background: none;
    border: 1px solid var(--hairline);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink);
    padding: 0.55rem 0.9rem;
    cursor: pointer;
}

@media (max-width: 900px) {
    .menu-toggle { display: block; }
    .nav-links {
        display: none;
        position: absolute;
        top: 76px;
        left: 0;
        right: 0;
        background: var(--paper);
        border-bottom: 1px solid var(--hairline);
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 0.5rem 0 1rem;
    }
    .nav-links.open { display: flex; }
    .nav-links li { padding: 0 clamp(1.25rem, 4vw, 2.5rem); }
    .nav-links a { display: block; padding: 0.85rem 0; border-bottom: 1px solid var(--hairline); }
    .nav-links a[aria-current="page"] { border-bottom-color: var(--hairline); color: var(--ember); }
    .nav-links .nav-cta {
        margin-top: 1rem;
        text-align: center;
        border-bottom: none !important;
    }
}

/* ---------- Buttons ---------- */

.btn {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-decoration: none;
    padding: 0.95rem 1.6rem;
    border: 1px solid var(--ink);
    cursor: pointer;
    transition: background 140ms ease, color 140ms ease, border-color 140ms ease;
}

.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: var(--ember-2); border-color: var(--ember-2); color: var(--paper); }

.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { border-color: var(--ember); color: var(--ember-2); }

.btn-row { display: flex; gap: 1rem; flex-wrap: wrap; }

/* ---------- Hero ---------- */

.hero {
    position: relative;
    padding: clamp(5rem, 12vh, 9rem) 0 clamp(4rem, 9vh, 7rem);
    overflow: hidden;
}

.hero-canvas {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.hero .container { position: relative; }

.hero h1 { max-width: 17ch; margin-bottom: 1.75rem; }
.hero .lede { margin-bottom: 2.5rem; }

/* ---------- Footer ---------- */

.site-footer {
    background: var(--dark);
    color: var(--dark-text);
    padding: clamp(3.5rem, 7vw, 5.5rem) 0 2rem;
}

.site-footer a { color: var(--dark-text); text-decoration-color: color-mix(in srgb, var(--dark-text) 35%, transparent); }
.site-footer a:hover { color: #fff; }

.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 3rem;
    padding-bottom: 3rem;
    border-bottom: 1px solid var(--dark-hairline);
}

.footer-brand { display: flex; flex-direction: column; gap: 1rem; align-items: flex-start; }
.footer-brand img { height: 60px; width: auto; }
.footer-brand p { color: var(--dark-muted); font-size: 0.95rem; max-width: 30ch; }

.footer-col h4 {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--dark-muted);
    margin-bottom: 1.1rem;
}

.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 0.6rem; }
.footer-col a { text-decoration: none; font-size: 0.95rem; }
.footer-col a:hover { text-decoration: underline; text-underline-offset: 3px; }

.footer-colophon {
    display: flex;
    justify-content: space-between;
    gap: 2rem;
    flex-wrap: wrap;
    padding-top: 1.75rem;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.03em;
    color: var(--dark-muted);
}

@media (max-width: 760px) {
    .footer-grid { grid-template-columns: 1fr; gap: 2.25rem; }
}

/* ---------- Cards & grids ---------- */

.card-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

@media (max-width: 960px) { .card-grid { grid-template-columns: 1fr; } }

.card {
    border: 1px solid var(--hairline);
    background: var(--paper);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.card .index {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    color: var(--ember);
}

/* ---------- Client logos ---------- */

.logo-strip {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(1.75rem, 5vw, 3.5rem);
    row-gap: 1.75rem;
    flex-wrap: wrap;
}

.logo-strip img {
    height: 26px;
    width: auto;
    opacity: 0.55;
    filter: grayscale(1) contrast(0.6) brightness(0.6);
    transition: opacity 140ms ease, filter 140ms ease;
}

/* Optical normalization — logos are pre-trimmed; heights tuned per mark weight */
.logo-strip img[alt="PG&E"] { height: 26px; }
.logo-strip img[alt="Akamai"] { height: 32px; }
.logo-strip img[alt="MITRE"] { height: 21px; }
.logo-strip img[alt="FreshDirect"] { height: 24px; }
.logo-strip img[alt="Les Mills"] { height: 16px; }
.logo-strip img[alt="Gitcoin"] { height: 20px; }
.logo-strip img[alt="RescueTime"] { height: 24px; }

.logo-strip img:hover { opacity: 0.9; filter: grayscale(1) contrast(0.8) brightness(0.4); }

/* ---------- Proof grid (testimonial pairs) ---------- */

.proof-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(2.5rem, 6vw, 5rem);
}

@media (max-width: 860px) { .proof-grid { grid-template-columns: 1fr; } }

/* ---------- Testimonials ---------- */

.testimonial blockquote {
    font-family: var(--font-display);
    font-size: clamp(1.2rem, 2vw, 1.5rem);
    font-weight: 420;
    line-height: 1.45;
    letter-spacing: -0.01em;
    max-width: 38ch;
    text-indent: -0.45ch; /* hang the opening quote */
}

.testimonial cite {
    display: block;
    margin-top: 1.25rem;
    font-family: var(--font-mono);
    font-style: normal;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-3);
}

/* ---------- FAQ ---------- */

.faq-list { border-top: 1px solid var(--hairline); max-width: 50rem; }

.faq-list details { border-bottom: 1px solid var(--hairline); }

.faq-list summary {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 480;
    padding: 1.4rem 2.5rem 1.4rem 0;
    cursor: pointer;
    list-style: none;
    position: relative;
    transition: color 140ms ease;
}

.faq-list summary::-webkit-details-marker { display: none; }

.faq-list summary::after {
    content: '+';
    position: absolute;
    right: 0.25rem;
    top: 50%;
    transform: translateY(-50%);
    font-family: var(--font-mono);
    font-size: 1.1rem;
    color: var(--ember);
    transition: transform 180ms ease;
}

.faq-list details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq-list summary:hover { color: var(--ember-2); }

.faq-list .faq-body { padding: 0 0 1.6rem; color: var(--ink-2); }
.faq-list .faq-body p { margin-bottom: 1rem; }
.faq-list .faq-body p:last-child { margin-bottom: 0; }

/* ---------- Forms ---------- */

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }

.field label {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.field input, .field textarea, .field select {
    width: 100%;
    font-family: var(--font-text);
    font-size: 1rem;
    padding: 0.8rem 0.9rem;
    border: 1px solid var(--hairline);
    background: var(--paper);
    color: var(--ink);
    border-radius: 0;
    transition: border-color 140ms ease;
}

.field input:focus, .field textarea:focus, .field select:focus {
    outline: none;
    border-color: var(--ember);
}

.field textarea { resize: vertical; min-height: 8rem; }

/* Dark section variants */
.dark-section { background: var(--dark); color: var(--dark-text); }
.dark-section .eyebrow { color: var(--ember); }
.dark-section .lede { color: var(--dark-muted); }
.dark-section a { color: var(--dark-text); }
.dark-section .field label { color: var(--dark-muted); }
.dark-section .field input,
.dark-section .field textarea {
    background: var(--dark-2);
    border-color: var(--dark-hairline);
    color: var(--dark-text);
}
.dark-section .btn-primary { background: var(--ember); border-color: var(--ember); color: #fff; }
.dark-section .btn-primary:hover { background: var(--ember-2); border-color: var(--ember-2); }
.dark-section .mono-note { color: var(--dark-muted); }

/* ---------- Essay / prose ---------- */

.prose {
    max-width: var(--measure);
    margin: 0 auto;
}

.prose p, .prose ul, .prose ol, .prose blockquote {
    font-size: 1.125rem;
    line-height: 1.75;
    margin-bottom: 1.5rem;
}

.prose h2 {
    font-size: 1.75rem;
    margin: 3rem 0 1.25rem;
}

.prose h3 { font-size: 1.3rem; margin: 2.25rem 0 1rem; }

.prose ul, .prose ol { padding-left: 1.4rem; }
.prose li { margin-bottom: 0.5rem; }

.prose blockquote {
    border-left: 2px solid var(--ember);
    padding-left: 1.5rem;
    font-style: italic;
    color: var(--ink-2);
}

.prose img { margin: 2.5rem 0; }

.prose hr {
    border: 0;
    text-align: center;
    margin: 3rem 0;
}

.prose hr::after {
    content: '· · ·';
    font-family: var(--font-mono);
    color: var(--ink-3);
    letter-spacing: 0.5em;
}

/* ---------- Essay list ---------- */

.essay-list { border-top: 1px solid var(--hairline); }
.essay-list a {
    display: grid;
    grid-template-columns: 5rem 1fr auto;
    gap: 1.5rem;
    align-items: baseline;
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--hairline);
    text-decoration: none;
    color: var(--ink);
}
.essay-list a:hover h3 { color: var(--ember-2); }
.essay-list .no {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.14em;
    color: var(--ink-3);
}
.essay-list h3 { font-size: 1.35rem; transition: color 140ms ease; }
.essay-list p { color: var(--ink-2); font-size: 0.95rem; margin-top: 0.3rem; }
.essay-list .read {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ember);
}
@media (max-width: 700px) {
    .essay-list a { grid-template-columns: 1fr; gap: 0.4rem; }
    .essay-list .read { display: none; }
}

/* ---------- Utilities ---------- */

.measure { max-width: var(--measure); }
.center { text-align: center; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mt-3 { margin-top: 3rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.mb-3 { margin-bottom: 3rem; }
.stack > * + * { margin-top: 1.25rem; }

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