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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}
html[data-font="large"]   { font-size: 18px; }
html[data-font="x-large"] { font-size: 20px; }

:root {
    /* Type */
    --sf:
        -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", system-ui,
        sans-serif;
    --sf-display:
        -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", system-ui,
        sans-serif;
    --sf-mono: ui-monospace, "SF Mono", "Menlo", monospace;

    /* Palette — cool gray pairing */
    --bg-light: #fafbfc;
    --bg-dark: #eef0f2;
    --rule-strong: #b8bcc2;
    --rule-on-light: #e3e5e8;
    --rule-on-dark: #d8dade;

    --ink: #1a1a1a;
    --ink-2: #333333;
    --ink-soft: #555555;
    --ink-mute: #8a8d92;

    --accent: #de5833; /* DuckDuckGo orange */
    --accent-soft: #ffd4c2; /* used for the highlight wash */

    /* Brand colors (for the chip backgrounds, used as fallback color) */
    --brand-automattic: #3499cd;
    --brand-tumblr: #001935;
    --brand-wordpress: #21759b;
    --brand-gutenberg: #1a1a1a;
    --brand-gravatar: #1d4fc4;
    --brand-sosafe: #de5833;

    /* Layout */
    --nav-h: 52px;
    --band-pad-y: 56px;
    --band-pad-x: clamp(20px, 5vw, 64px);
    --content-max: 1100px;

    --nav-bg: rgba(250, 251, 252, 0.78);
}

html.dark {
    --bg-light:      #111213;
    --bg-dark:       #1a1b1e;
    --rule-strong:   #2e3035;
    --rule-on-light: #2a2c30;
    --rule-on-dark:  #252729;
    --ink:           #f0f0f0;
    --ink-2:         #d0d2d6;
    --ink-soft:      #9ea3aa;
    --ink-mute:      #60646b;
    --accent:        #f07d5a;
    --accent-soft:   #5c2010;
    --nav-bg:        rgba(17, 18, 19, 0.82);
}

html,
body {
    background: var(--bg-light);
}

body {
    font-family: var(--sf);
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
    letter-spacing: -0.011em;
    line-height: 1.5;
    padding-top: var(--nav-h);
}

a {
    color: inherit;
}

/* ── Sticky frosted nav ── */
.topnav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--nav-h);
    background: var(--nav-bg);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--rule-on-light);
    z-index: 100;
}
.topnav-inner {
    max-width: var(--content-max);
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--band-pad-x);
}
.topnav-mark {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: opacity 0.2s ease;
}
.topnav-mark img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    opacity: 0.75;
}
html.dark .topnav-mark img {
    filter: invert(1);
    opacity: 0.8;
}
.topnav-mark:hover {
    opacity: 0.8;
}

.topnav-theme {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--ink);
    font-size: 1rem;
    opacity: 0.75;
    display: inline-flex;
    align-items: center;
    padding: 4px;
    transition:
        color 0.2s ease,
        opacity 0.2s ease;
}
.topnav-theme:hover {
    color: var(--accent);
    opacity: 1;
}

.topnav-controls {
    display: flex;
    align-items: center;
    gap: 2px;
}
.topnav-controls .topnav-theme {
    margin-left: 6px;
}
.topnav-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--ink);
    font-size: 0.75rem;
    font-weight: 600;
    font-family: var(--sf);
    letter-spacing: 0;
    opacity: 0.75;
    padding: 4px 6px;
    line-height: 1;
    transition: color 0.2s ease, opacity 0.2s ease;
}
.topnav-btn:hover:not(:disabled) {
    color: var(--accent);
    opacity: 1;
}
.topnav-btn:disabled {
    opacity: 0.3;
    cursor: default;
}

.topnav-links {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 1.75rem;
}
.topnav-links a {
    font-size: 0.8125rem;
    text-decoration: none;
    color: var(--ink-soft);
    transition: color 0.2s ease;
    padding-bottom: 2px;
    border-bottom: 1px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
}
.topnav-links a:hover,
.topnav-links a.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* ── Bands ── */
.band {
    border-top: 1px solid var(--rule-strong);
}
.band:first-of-type {
    border-top: none;
}
.band-light {
    background: var(--bg-light);
}
.band-dark {
    background: var(--bg-dark);
}
.band-inner {
    max-width: var(--content-max);
    margin: 0 auto;
    padding: var(--band-pad-y) var(--band-pad-x);
}

/* ── Hero ── */
.hero .band-inner {
    padding-top: 96px;
    padding-bottom: 80px;
    text-align: center;
}
.eyebrow {
    font-size: 0.6875rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-mute);
    margin-bottom: 20px;
}
.name {
    font-family: var(--sf-display);
    font-size: clamp(2.25rem, 6vw, 4.5rem);
    font-weight: 500;
    letter-spacing: -0.035em;
    line-height: 1;
    color: var(--ink);
    margin-bottom: 16px;
}
.period {
    color: var(--accent);
}
.hero-tag {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    font-size: 0.9375rem;
    color: var(--ink-soft);
}
.hero-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 28px;
    margin-top: 32px;
}
.hero-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 0.8125rem;
    color: var(--ink-soft);
    text-decoration: none;
    transition: color 0.2s ease;
}
.hero-link i {
    font-size: 1.375rem;
}
.hero-link:hover {
    color: var(--accent);
}
.hero-link-pdf {
    padding: 6px 12px 6px 10px;
    border: 1px solid var(--rule-strong);
    border-radius: 999px;
    color: var(--ink-2);
    transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}
.hero-link-pdf span {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.hero-link-pdf i {
    font-size: 1.125rem;
}
.hero-link-pdf:hover {
    color: var(--accent);
    border-color: var(--accent);
    background-color: var(--accent-soft);
}

/* ── Section labels ── */
.sec-label-row {
    display: flex;
    align-items: baseline;
    gap: 14px;
    margin-bottom: 32px;
}
.sec-label {
    font-size: 0.6875rem;
    font-weight: normal;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-mute);
    flex-shrink: 0;
}
.sec-rule {
    flex: 1;
    height: 1px;
    background: var(--rule-on-light);
}
.band-dark .sec-rule {
    background: var(--rule-on-dark);
}

/* ── About ── */
.about-lede {
    font-size: clamp(1.125rem, 2vw, 1.375rem);
    line-height: 1.5;
    color: var(--ink);
    max-width: 64ch;
    letter-spacing: -0.014em;
    margin-bottom: 36px;
}
.about-lede + .about-lede {
    margin-top: -24px;
}
.highlight {
    background: linear-gradient(transparent 60%, var(--accent-soft) 60%);
    padding: 0 2px;
}
.about-extras {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    padding-top: 28px;
    border-top: 1px solid var(--rule-on-dark);
}
.extra-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}
.extra-icon {
    font-size: 18px;
    color: var(--accent);
}
.extra-name {
    font-size: 0.875rem;
    font-weight: 500;
}
.extra-desc {
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--ink-soft);
}
.about-close {
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--ink-mute);
    margin-top: 28px;
    max-width: 64ch;
    text-align: center;
    margin-left: auto;
    margin-right: auto;
}

/* ── Skills ── */
.skills-rows {
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.skill-row {
    display: flex;
    align-items: baseline;
    gap: 24px;
}
.skill-cat {
    font-size: 0.6875rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-mute);
    white-space: nowrap;
    min-width: 140px;
}
.skill-row-content {
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--ink);
}
.muted {
    color: var(--ink-mute);
}
.skill-sub {
    display: block;
    font-size: 0.8125rem;
    color: var(--ink-mute);
    line-height: 1.5;
    margin-top: 1px;
}

.skills-exploring {
    margin-top: 32px;
    display: flex;
    align-items: baseline;
    gap: 16px;
    flex-wrap: wrap;
}
.skills-exploring .skill-cat {
    margin-bottom: 0;
    white-space: nowrap;
}
.exploring-items {
    font-size: 0.9375rem;
    color: var(--ink);
    line-height: 1.75;
}

/* ── Experience ── */
.exp {
    padding-bottom: 40px;
    border-bottom: 1px solid var(--rule-on-dark);
    margin-bottom: 40px;
}
.exp:last-child {
    padding-bottom: 0;
    border-bottom: none;
    margin-bottom: 0;
}
.exp-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 20px;
}
.exp-id {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;
}

/* Company wordmark — drop in a transparent-bg PNG and it stays the right height.
   Logo height is fixed; width flexes to the image's natural aspect ratio. */
.co-wordmark {
    display: inline-flex;
    align-items: center;
    height: 36px;
    max-width: 100%;
    text-decoration: none;
    transition: opacity 0.2s ease;
}
.co-wordmark:hover {
    opacity: 0.7;
}
.co-wordmark img {
    display: block;
    max-height: 100%;
    max-width: 100%;
    height: auto;
    width: auto;
    object-fit: contain;
}

/* Automattic wordmark is dark-on-transparent; invert to white in dark mode */
html.dark .co-wordmark-automattic img {
    filter: brightness(0) invert(1);
}

/* SOSAFE's lockup is icon+wordmark, so the wordmark portion reads smaller
   at the same overall height. Bump up to match Automattic's visual weight. */
.co-wordmark.co-wordmark-sosafe {
    height: 46px;
}

.exp-sub {
    font-size: 0.875rem;
    color: var(--ink-soft);
    display: flex;
    align-items: center;
    gap: 0;
    flex-wrap: wrap;
}
.exp-role {
    font-weight: 500;
    color: var(--ink);
}
.exp-co-dot {
    margin: 0 6px;
    color: var(--ink-mute);
}
.exp-period {
    font-family: var(--sf-mono);
    font-size: 0.75rem;
    color: var(--ink-mute);
    white-space: nowrap;
}

/* Bulleted achievements with logo chips */
.exp-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.exp-list li {
    font-size: 0.906rem;
    line-height: 1.6;
    color: var(--ink-2);
    display: flex;
    align-items: flex-start;
    gap: 12px;
}
.exp-list strong {
    font-weight: 500;
    color: var(--ink);
}

/* Trailing wrap-up paragraph after an .exp-list, for cross-cutting work
   that doesn't belong to a single product bullet. */
.exp-note {
    margin-top: 14px;
    font-size: 0.906rem;
    line-height: 1.6;
    color: var(--ink-2);
}
.exp-note strong {
    font-weight: 500;
    color: var(--ink);
}

/* The little brand chips in front of each bullet */
.bullet-logo {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-top: 1px;
    background: var(--ink);
}
.bullet-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 3px;
    display: block;
}
/* Tumblr & WordPress: logo fills the chip edge-to-edge, no padding, no bg */
.bullet-tumblr,
.bullet-wordpress {
    background: transparent;
}
.bullet-tumblr img,
.bullet-wordpress img {
    padding: 0;
}

/* Gutenberg: white chip with hairline outline */
.bullet-gutenberg {
    background: #fff;
    border: 1px solid var(--rule-on-dark);
}

/* Gravatar: keep the branded blue chip */
.bullet-gravatar {
    background: var(--brand-gravatar);
}

/* Plain (no-logo) variant for SOSAFE achievements */
.exp-list-plain li {
    padding: 2px 0 2px 18px;
    position: relative;
    display: block;
}
.exp-list-plain li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 13px;
    width: 8px;
    height: 1px;
    background: var(--ink-mute);
}

.inline-link {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid var(--rule-on-dark);
    transition:
        color 0.2s ease,
        border-color 0.2s ease;
}
.inline-link:hover {
    color: var(--accent);
    border-bottom-color: var(--accent);
}
html.dark .inline-link {
    border-bottom-color: var(--ink-mute);
}

/* ── Projects ── */
.proj {
    padding-top: 40px;
    margin-top: 40px;
    border-top: 1px solid var(--rule-on-light);
}
.proj:first-of-type {
    padding-top: 0;
    margin-top: 0;
    border-top: none;
}
.proj-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 20px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}
.proj-name {
    font-family: var(--sf-display);
    font-size: 1.75rem;
    font-weight: 500;
    letter-spacing: -0.028em;
    line-height: 1.1;
}
.proj-links {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}
.proj-link {
    font-size: 0.75rem;
    color: var(--accent);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: opacity 0.2s ease;
}
.proj-link i {
    font-size: 0.6875rem;
}
.proj-link:hover {
    opacity: 0.75;
}

.proj-kind {
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-mute);
    margin-bottom: 16px;
}
.proj-desc {
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--ink-2);
    max-width: 72ch;
    margin-bottom: 20px;
}
.proj-desc em {
    font-style: italic;
    color: var(--ink-mute);
}
.proj-stack {
    font-size: 0.75rem;
    color: var(--ink-mute);
    line-height: 1.7;
    margin-top: 14px;
}

/* Screenshot frames — drop in any image, it will fit cleanly */
.proj-shot {
    background: var(--rule-on-light);
    border: 1px solid var(--rule-on-light);
    border-radius: 6px;
    overflow: hidden;
    display: block;
}
.proj-shot img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.proj-shot-desktop {
    aspect-ratio: 16 / 9;
}
.proj-shot-mobile {
    width: 220px;
    aspect-ratio: 9 / 19;
    border-radius: 22px;
    flex-shrink: 0;
}

/* App Store screenshot strip — wide, multiple phones side by side.
   No fixed aspect ratio; let the image set its own height. */
.proj-shot-strip {
    background: transparent;
    border: none;
    border-radius: 0;
    margin-top: 20px;
}
.proj-shot-strip img {
    height: auto;
    object-fit: contain;
}

/* The Beach Tennis body block needs its own stack-grid styling now
   that it's no longer in the side-by-side layout */
.proj-body {
    margin-bottom: 0;
}

/* Side-by-side: text + mobile screenshot */
.proj-with-shot {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 36px;
    align-items: start;
}
.proj-stack-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--rule-on-light);
}
.stack-cell {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.stack-label {
    font-size: 0.6875rem;
    color: var(--ink-mute);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.stack-val {
    font-size: 0.8125rem;
    line-height: 1.5;
    color: var(--ink);
}

/* ── Footer ── */
.footer .band-inner {
    padding-top: 28px;
    padding-bottom: 28px;
}
.footer-inner {
    display: flex;
    justify-content: space-between;
    font-size: 0.6875rem;
    color: var(--ink-mute);
    letter-spacing: 0.04em;
}
.footer-inner a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s ease;
}
.footer-inner a:hover {
    color: var(--accent);
}

/* ── Animations ── */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(22px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.animate {
    opacity: 0;
}
.animate.visible {
    animation: fadeUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.sec,
.hero {
    opacity: 0;
    transform: translateY(40px);
    transition:
        opacity 0.9s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}
.sec.visible,
.hero.visible {
    opacity: 1;
    transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
    .animate {
        opacity: 1;
    }
    .animate.visible {
        animation: none;
    }
    .sec,
    .hero {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* ── Responsive ── */
@media (max-width: 900px) {
    .proj-stack-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 720px) {
    .topnav-links {
        display: none;
    }
    .hero .band-inner {
        padding-top: 64px;
        padding-bottom: 56px;
    }
    .about-extras {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .exp-head {
        flex-direction: column;
        gap: 8px;
    }
    .proj-with-shot {
        grid-template-columns: 1fr;
    }
    .proj-shot-mobile {
        width: 100%;
        max-width: 240px;
        margin: 0 auto;
    }
    .proj-name {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .skill-row {
        flex-direction: column;
        gap: 4px;
    }
    .proj-stack-grid {
        grid-template-columns: 1fr;
    }
}

@media print {
    @page {
        margin: 18mm 20mm;
    }

    :root {
        --accent:        #1a1a1a;
        --accent-soft:   transparent;
        --bg-light:      #fff;
        --bg-dark:       #fff;
        --band-pad-y:    24px;
        --ink:           #1a1a1a;
        --ink-2:         #2a2a2a;
        --ink-soft:      #555;
        --ink-mute:      #888;
        --rule-on-light: #ddd;
        --rule-on-dark:  #ddd;
        --rule-strong:   #ccc;
    }

    body {
        padding: 0;
        background: #fff;
    }

    .topnav {
        display: none;
    }

    .band {
        border-top: 1px solid #ddd;
        background: #fff;
    }
    .band:first-of-type {
        border-top: none;
    }

    .animate,
    .sec,
    .hero {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
        animation: none !important;
    }

    .hero .band-inner {
        padding-top: 0;
        padding-bottom: 20px;
    }

    .hero-link i {
        display: none;
    }
    .hero-link::after {
        content: attr(aria-label);
        font-size: 0.8125rem;
        color: var(--ink-soft);
    }
    .hero-link-pdf {
        display: none;
    }

    .highlight {
        background: none;
        padding: 0;
    }

    .bullet-logo {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .inline-link {
        border-bottom: 1px solid #ccc;
    }

    .proj-link i {
        display: none;
    }

    .proj-shot {
        display: none;
    }

    .proj-stack-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .exp,
    .proj {
        break-inside: avoid;
    }
}
