/* davidbdavis.com — a single static page. No framework, no build step, no JS.
   Theme follows the OS via prefers-color-scheme; both schemes are held above 4.5:1. */

:root {
    --ink:        #16191d;
    --ink-soft:   #4d5560;
    --ink-faint:  #6b7480;
    --bg:         #fbfaf8;
    --surface:    #ffffff;
    --line:       #e3e0da;
    --accent:     #0f5f56;   /* 7.2:1 on --bg  */
    --accent-lit: #0b4740;
    --shadow:     0 1px 2px rgba(20, 25, 30, .05), 0 8px 24px rgba(20, 25, 30, .06);
    --radius:     14px;
    --measure:    68ch;
}

@media (prefers-color-scheme: dark) {
    :root {
        --ink:        #e9eaec;
        --ink-soft:   #a8b0b9;
        --ink-faint:  #8a929c;
        --bg:         #101317;
        --surface:    #171b20;
        --line:       #2a2f36;
        --accent:     #5fd0be;   /* 8.9:1 on --bg */
        --accent-lit: #8ae3d4;
        --shadow:     0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35);
    }
}

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

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

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 400 17px/1.65 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

.wrap { width: min(100% - 2.5rem, 1080px); margin-inline: auto; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent-lit); }
/* Visible focus everywhere — keyboard users should never have to guess. */
a:focus-visible, .btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 3px;
}

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

/* ---------- header ---------- */

.masthead { padding: 5rem 0 3.25rem; }

.name {
    margin: 0;
    font-size: clamp(2.4rem, 6vw, 3.6rem);
    line-height: 1.05;
    letter-spacing: -.022em;
    font-weight: 700;
}

.role {
    margin: .6rem 0 0;
    font-size: clamp(1.05rem, 2.4vw, 1.3rem);
    color: var(--accent);
    font-weight: 600;
    letter-spacing: -.01em;
}

.intro {
    margin: 1.4rem 0 0;
    max-width: var(--measure);
    color: var(--ink-soft);
    font-size: 1.08rem;
}

.actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 2rem; }

.btn {
    display: inline-block;
    padding: .62rem 1.15rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--ink);
    font-size: .95rem;
    font-weight: 600;
    text-decoration: none;
    transition: border-color .15s ease, color .15s ease;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }

.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--bg);
}
.btn-primary:hover { background: var(--accent-lit); border-color: var(--accent-lit); color: var(--bg); }

/* ---------- sections ---------- */

section { padding-block: 2.5rem; }

.section-title {
    margin: 0 0 1.75rem;
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--ink-faint);
}

/* ---------- project cards ---------- */

.project {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 2rem;
}

.project-media { background: #0d1013; border-bottom: 1px solid var(--line); }
.project-media img { width: 100%; }

.project-body { padding: 1.6rem 1.75rem 1.85rem; }

.project h3 {
    margin: 0;
    font-size: 1.45rem;
    letter-spacing: -.015em;
}
.project h3 a { text-decoration: none; color: var(--ink); }
.project h3 a:hover { color: var(--accent); text-decoration: underline; }

.project-meta {
    margin: .35rem 0 0;
    font-size: .85rem;
    color: var(--ink-faint);
    letter-spacing: .01em;
}

.project p.desc { margin: .9rem 0 0; color: var(--ink-soft); max-width: var(--measure); }

.tags { display: flex; flex-wrap: wrap; gap: .4rem; margin: 1.1rem 0 0; padding: 0; list-style: none; }
.tags li {
    font-size: .78rem;
    font-weight: 600;
    color: var(--ink-faint);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: .18rem .6rem;
}

/* Ultra-wide Quest captures: a scroll strip beats squashing them into a grid.
   Flex rather than grid because the columns must size to each image. The captures are not all
   the same aspect ratio — robot-1 is 2.97:1, the rest about 3.62:1 — so matching their heights
   means letting the widths differ. Nothing is cropped; robot-1 simply sits narrower. */
.shots {
    display: flex;
    align-items: center;
    gap: .75rem;
    overflow-x: auto;
    padding: .75rem;
    background: #0d1013;
    scroll-snap-type: x mandatory;
    overscroll-behavior-x: contain;
}
.shots img {
    scroll-snap-align: center;
    border-radius: 6px;
    flex: 0 0 auto;
    height: clamp(130px, 16vw, 200px);
    width: auto;
    max-width: none;    /* overrides the global img rule, which would re-crush the width */
}

/* ---------- link list (smaller work) ---------- */

.links { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

.link-card {
    display: block;
    padding: 1.15rem 1.3rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    text-decoration: none;
    color: inherit;
    transition: border-color .15s ease, transform .15s ease;
}
.link-card:hover { border-color: var(--accent); transform: translateY(-1px); }
@media (prefers-reduced-motion: reduce) { .link-card:hover { transform: none; } }

.link-card strong { display: block; font-size: 1.05rem; letter-spacing: -.01em; }
.link-card span { display: block; margin-top: .3rem; font-size: .9rem; color: var(--ink-soft); }
.link-card .host { margin-top: .55rem; font-size: .8rem; color: var(--accent); font-weight: 600; }

/* ---------- credentials ---------- */

.creds { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }

.cred {
    padding: 1.2rem 1.35rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}
.cred h3 { margin: 0; font-size: 1.05rem; letter-spacing: -.01em; }
.cred p { margin: .35rem 0 .9rem; font-size: .9rem; color: var(--ink-soft); }
/* Padded to clear the WCAG 2.2 24px minimum target size — the bare text sat at 23px on a
   phone. The negative inline margin keeps the row visually flush with the copy above it. */
.cred-links { display: flex; flex-wrap: wrap; gap: .2rem .5rem; font-size: .88rem; font-weight: 600; margin-inline-start: -.4rem; }
.cred-links a { display: inline-block; padding: .28rem .4rem; }

/* ---------- footer ---------- */

footer {
    margin-top: 3rem;
    padding: 2.25rem 0 3.5rem;
    border-top: 1px solid var(--line);
    color: var(--ink-faint);
    font-size: .88rem;
}
footer .wrap { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; justify-content: space-between; align-items: center; }
footer a { display: inline-block; padding: .3rem 0; } /* 24px minimum target */

/* ---------- consent bar ---------- */

.consent-bar {
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    z-index: 50;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: .75rem 1.5rem;
    padding: .9rem 1.25rem;
    background: var(--surface);
    border-top: 1px solid var(--line);
    box-shadow: 0 -6px 24px rgba(0, 0, 0, .10);
}
.consent-bar[hidden] { display: none; }   /* [hidden] loses to display:flex without this */

.consent-copy { margin: 0; font-size: .92rem; color: var(--ink-soft); }
.consent-actions { display: flex; gap: .5rem; }

.btn-consent {
    font: inherit;
    font-size: .9rem;
    font-weight: 600;
    padding: .45rem 1.05rem;
    min-height: 40px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: transparent;
    color: var(--ink);
    cursor: pointer;
}
.btn-consent:hover { border-color: var(--accent); color: var(--accent); }
.btn-consent:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.btn-consent-allow { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.btn-consent-allow:hover { background: var(--accent-lit); border-color: var(--accent-lit); color: var(--bg); }

@media (max-width: 560px) {
    .consent-bar { flex-direction: column; align-items: stretch; text-align: center; }
    .consent-actions { justify-content: center; }
}

@media (max-width: 560px) {
    body { font-size: 16px; }
    .masthead { padding: 3.25rem 0 2.25rem; }
    .project-body { padding: 1.3rem 1.25rem 1.5rem; }
    .actions .btn { flex: 1 1 auto; text-align: center; }
}
