:root {
    color-scheme: dark;
    --bg: #0b1017;
    --panel: #131a24;
    --ink: #eef4fb;
    --muted: #9db0c6;
    --accent: #4aa8ff;
    --rule: rgba(150, 180, 215, 0.18);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: "Segoe UI", -apple-system, Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }

main {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 24px 96px;
}

main.narrow { max-width: 780px; }

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

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    max-width: 1080px;
    margin: 0 auto;
    padding: 16px 24px;
    background: rgba(11, 16, 23, 0.9);
    backdrop-filter: blur(12px);
}

.site-name {
    font-weight: 600;
    color: var(--ink);
    text-decoration: none;
}

.site-header nav {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    font-size: 14px;
}

.site-header nav a { text-decoration: none; color: var(--muted); }
.site-header nav a:hover { color: var(--ink); }
.site-header nav a.cta { color: var(--accent); font-weight: 600; }

/* ---------- hero ---------- */

.hero { padding: 56px 0 44px; }

.eyebrow {
    margin: 0 0 10px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
}

.hero h1 {
    margin: 0;
    font-size: clamp(34px, 6vw, 56px);
    font-weight: 200;
    line-height: 1.05;
}

.hero-role {
    margin: 10px 0 0;
    font-size: clamp(17px, 2.4vw, 21px);
    color: var(--ink);
}

.hero-pitch {
    margin: 18px 0 0;
    max-width: 64ch;
    color: var(--muted);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 26px;
}

.button {
    display: inline-block;
    padding: 10px 18px;
    border: 1px solid var(--rule);
    color: var(--ink);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    border-radius: 3px;
}

.button:hover { border-color: var(--accent); }
/* Always the site accent, never the per-project one — some are too dark for dark text. */
.button.primary { background: #4aa8ff; border-color: #4aa8ff; color: #05121f; font-weight: 600; }
.button.ghost { border-style: dashed; }

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

section { padding-top: 44px; }

h2 {
    margin: 0 0 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--rule);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted);
}

.subhead {
    margin: 34px 0 14px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
}

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

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.card {
    display: flex;
    flex-direction: column;
    padding: 20px;
    background: var(--panel);
    border-left: 3px solid var(--accent);
    border-radius: 3px;
}

.card-link { text-decoration: none; color: inherit; flex: 1; display: block; }

.card h3 { margin: 0; font-size: 20px; font-weight: 500; }

/* Not the project accent: several of those are dark enough to be unreadable as text.
   The accent stays on the card's left border, where contrast does not matter. */
.card-tagline { margin: 4px 0 0; font-size: 14px; color: #8fc4f5; }
.card-summary { margin: 10px 0 14px; font-size: 14.5px; color: var(--muted); }
.card-link:hover h3 { color: var(--accent); }

.cards.compact .card { padding: 16px; }
.cards.compact .card h3 { font-size: 17px; }
.cards.compact .card-summary { font-size: 13.5px; }

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.chips li {
    padding: 3px 9px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    font-size: 12px;
    color: var(--muted);
}

/* ---------- experience ---------- */

.job { margin-bottom: 30px; }
.job h3 { margin: 0; font-size: 19px; font-weight: 500; }
.job-role { margin-top: 16px; }
.job-role h4 { margin: 0 0 6px; font-size: 15px; font-weight: 600; color: var(--accent); }
.job-role ul { margin: 0; padding-left: 20px; color: var(--muted); font-size: 14.5px; }
.job-role li { margin-bottom: 7px; }

.muted { color: var(--muted); font-size: 13.5px; margin: 2px 0 0; }

/* ---------- writing ---------- */

.writeup-link {
    display: block;
    padding: 20px;
    background: var(--panel);
    border-radius: 3px;
    text-decoration: none;
    color: inherit;
}

.writeup-link h3 { margin: 0; font-size: 20px; font-weight: 500; }
.writeup-link p { margin: 8px 0 0; font-size: 14.5px; color: var(--muted); }
.writeup-link:hover h3 { color: var(--accent); }

/* ---------- about ---------- */

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

.about-grid h3 {
    margin: 0 0 12px;
    font-size: 16px;
    font-weight: 600;
}

.skill-group { margin-bottom: 14px; }
.skill-group h4 { margin: 0 0 6px; font-size: 13px; font-weight: 500; color: var(--muted); }

.plain {
    margin: 0 0 22px;
    padding-left: 18px;
    font-size: 14px;
    color: var(--muted);
}

.plain li { margin-bottom: 8px; }
.plain strong { color: var(--ink); font-weight: 500; }

/* ---------- project page ---------- */

.back { display: inline-block; margin: 28px 0 8px; font-size: 14px; text-decoration: none; color: #8fc4f5; }
.back:hover { text-decoration: underline; }

.project-page h1 {
    margin: 12px 0 0;
    font-size: clamp(30px, 5vw, 44px);
    font-weight: 200;
    line-height: 1.1;
}

.project-page h2 {
    margin-top: 34px;
    border-bottom-color: rgba(150, 180, 215, 0.35);
}

.project-page ul { padding-left: 20px; color: var(--muted); }
.project-page ul.chips { padding-left: 0; }
.project-page li { margin-bottom: 8px; }
.project-page p { max-width: 68ch; }

/* ---------- before/after wipes ---------- */

.ppc-list { margin: 26px 0 8px; display: grid; gap: 26px; }

.ppc { margin: 0; }

.ppc-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border: 1px solid var(--rule);
    background: #060b12;
    cursor: ew-resize;
    touch-action: none;
    user-select: none;
}

.ppc-frame img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ppc-after { clip-path: inset(0 50% 0 0); }

.ppc-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 2px;
    margin-left: -1px;
    background: #fff;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.8);
    pointer-events: none;
}

.ppc-handle span {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 28px;
    height: 28px;
    margin: -14px 0 0 -14px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.45);
}

.ppc-label {
    position: absolute;
    bottom: 10px;
    padding: 3px 9px;
    background: rgba(0, 0, 0, 0.66);
    color: #fff;
    font-size: 11px;
    letter-spacing: 0.04em;
    pointer-events: none;
}

.ppc-label.left { left: 10px; }
.ppc-label.right { right: 10px; }

.ppc input[type="range"] {
    width: 100%;
    margin: 10px 0 4px;
    accent-color: var(--accent);
}

.ppc figcaption {
    font-size: 12.5px;
    color: var(--muted);
    line-height: 1.45;
}

.shot-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px;
    margin: 26px 0 8px;
}

.shot-row figure { margin: 0; }

.shot-row img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border: 1px solid var(--rule);
    display: block;
}

.shot-row figcaption {
    margin-top: 6px;
    font-size: 12px;
    color: var(--muted);
    line-height: 1.4;
}

.project-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }

/* ---------- gallery lightbox ---------- */

.plb {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 24px;
    background: rgba(4, 8, 13, 0.94);
}

.plb figure {
    margin: 0;
    max-width: min(1400px, 88vw);
    text-align: center;
}

.plb-stage {
    position: relative;
    overflow: hidden;
    display: inline-block;
    touch-action: none;
}

.plb img {
    display: block;
    max-width: 100%;
    max-height: 82vh;
    object-fit: contain;
    border: 1px solid var(--rule);
    cursor: crosshair;
    transition: transform 0.15s ease-out;
}

.plb-lens {
    display: none;
    position: absolute;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.85);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6), 0 6px 24px rgba(0, 0, 0, 0.55);
    background-repeat: no-repeat;
    pointer-events: none;
}

.plb figcaption {
    margin-top: 10px;
    font-size: 13.5px;
    color: var(--muted);
}

.plb-num { display: block; margin-top: 4px; font-size: 12px; color: var(--muted); }

.plb-x,
.plb-nav {
    flex: none;
    background: none;
    border: 1px solid var(--rule);
    color: var(--ink);
    font-size: 26px;
    line-height: 1;
    width: 44px;
    height: 44px;
    cursor: pointer;
    border-radius: 3px;
}

.plb-x { position: absolute; top: 18px; right: 18px; font-size: 18px; }
.plb-x:hover, .plb-nav:hover { border-color: var(--accent); color: var(--accent); }

@media (max-width: 620px) {
    .plb { padding: 12px; gap: 4px; }
    .plb-nav { width: 36px; height: 36px; }
}

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

.site-footer {
    max-width: 1080px;
    margin: 0 auto;
    padding: 28px 24px 56px;
    border-top: 1px solid var(--rule);
    font-size: 14px;
}

.site-footer p { margin: 0 0 4px; }

@media (max-width: 620px) {
    .hero { padding: 34px 0 30px; }
    section { padding-top: 34px; }
}
