/* ericbrockway.com */

/* ------------------------------------------------------------------
   Fonts: IBM Plex (SIL Open Font License, see /assets/fonts/OFL.txt)
   ------------------------------------------------------------------ */

@font-face {
    font-family: "IBM Plex Sans";
    src: url("/assets/fonts/plex-sans-400.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "IBM Plex Sans";
    src: url("/assets/fonts/plex-sans-400-italic.woff2") format("woff2");
    font-weight: 400;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: "IBM Plex Sans";
    src: url("/assets/fonts/plex-sans-600.woff2") format("woff2");
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "IBM Plex Serif";
    src: url("/assets/fonts/plex-serif-500.woff2") format("woff2");
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "IBM Plex Mono";
    src: url("/assets/fonts/plex-mono-400.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* ------------------------------------------------------------------
   Design tokens
   ------------------------------------------------------------------ */

:root {
    --font-sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-serif: "IBM Plex Serif", Georgia, "Times New Roman", serif;
    --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Consolas, monospace;

    --step--1: clamp(0.84rem, 0.82rem + 0.1vw, 0.9rem);
    --step-0: clamp(1rem, 0.97rem + 0.15vw, 1.1rem);
    --step-1: clamp(1.2rem, 1.12rem + 0.4vw, 1.45rem);
    --step-2: clamp(1.5rem, 1.3rem + 0.9vw, 2rem);
    --step-3: clamp(2.4rem, 1.8rem + 3vw, 4rem);

    --space-1: 0.5rem;
    --space-2: 1rem;
    --space-3: 1.5rem;
    --space-4: 2.5rem;
    --space-5: 4rem;
    --space-6: 6rem;

    --radius: 0.5rem;
    --container: 68rem;
    --measure: 42rem;

    color-scheme: light dark;
}

:root[data-mode="light"] {
    color-scheme: light;
}

:root[data-mode="dark"] {
    color-scheme: dark;
}

/* Palette: Teal (default). Each value is light-dark(light mode, dark mode). */
:root,
:root[data-palette="teal"] {
    --bg: light-dark(#fafaf7, #0b1120);
    --surface: light-dark(#ffffff, #111827);
    --text: light-dark(#0f172a, #e5e7eb);
    --muted: light-dark(#475569, #9ca3af);
    --line: light-dark(#e2e8f0, #1f2937);
    --accent: light-dark(#0f766e, #2dd4bf);
    --accent-ink: light-dark(#ffffff, #042f2e);
    --accent-soft: light-dark(#e6f4f1, #0f2e2b);
}

/* Palette: Navy & Brass */
:root[data-palette="brass"] {
    --bg: light-dark(#faf8f3, #0e1524);
    --surface: light-dark(#ffffff, #141c2e);
    --text: light-dark(#1e2a44, #e7e5e4);
    --muted: light-dark(#4a5568, #a1a1aa);
    --line: light-dark(#e7e2d6, #1f2a40);
    --accent: light-dark(#a16207, #e0b04a);
    --accent-ink: light-dark(#ffffff, #1c1404);
    --accent-soft: light-dark(#f6eedc, #2a2214);
}

/* Older browsers without light-dark(): light mode only */
@supports not (color: light-dark(#000, #fff)) {
    :root {
        color-scheme: light;
    }

    :root,
    :root[data-palette="teal"] {
        --bg: #fafaf7;
        --surface: #ffffff;
        --text: #0f172a;
        --muted: #475569;
        --line: #e2e8f0;
        --accent: #0f766e;
        --accent-ink: #ffffff;
        --accent-soft: #e6f4f1;
    }

    :root[data-palette="brass"] {
        --bg: #faf8f3;
        --surface: #ffffff;
        --text: #1e2a44;
        --muted: #4a5568;
        --line: #e7e2d6;
        --accent: #a16207;
        --accent-ink: #ffffff;
        --accent-soft: #f6eedc;
    }
}

/* ------------------------------------------------------------------
   Base
   ------------------------------------------------------------------ */

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

* {
    margin: 0;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: 5rem;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: var(--step-0);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

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

a {
    color: var(--accent);
    text-decoration-thickness: 0.08em;
    text-underline-offset: 0.2em;
}

a:hover {
    text-decoration-thickness: 0.14em;
}

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

h1,
h2,
h3 {
    font-family: var(--font-serif);
    font-weight: 500;
    line-height: 1.15;
    letter-spacing: -0.01em;
    text-wrap: balance;
}

p {
    text-wrap: pretty;
}

::selection {
    background: var(--accent);
    color: var(--accent-ink);
}

.skip-link {
    position: absolute;
    left: var(--space-2);
    top: -4rem;
    z-index: 100;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    background: var(--accent);
    color: var(--accent-ink);
}

.skip-link:focus {
    top: var(--space-2);
}

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

.container {
    width: min(100% - 2.5rem, var(--container));
    margin-inline: auto;
}

.section {
    padding-block: var(--space-5);
    border-top: 1px solid var(--line);
}

.section__header {
    max-width: var(--measure);
    margin-bottom: var(--space-4);
}

.section__title {
    margin-top: 0.4rem;
    font-size: var(--step-2);
}

.section__intro {
    margin-top: var(--space-2);
    color: var(--muted);
}

.eyebrow {
    font-family: var(--font-mono);
    font-size: var(--step--1);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--accent);
}

/* ------------------------------------------------------------------
   Header
   ------------------------------------------------------------------ */

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 1px solid var(--line);
    background: var(--bg);
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: blur(8px);
}

.site-header__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.25rem var(--space-3);
    min-height: 4rem;
    padding-block: 0.5rem;
}

.site-name {
    font-family: var(--font-serif);
    font-size: var(--step-1);
    font-weight: 500;
    color: var(--text);
    text-decoration: none;
}

.site-nav {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1) var(--space-3);
    padding: 0;
    list-style: none;
    font-size: var(--step--1);
}

.site-nav a {
    color: var(--muted);
    text-decoration: none;
}

.site-nav a:hover {
    color: var(--text);
}

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

.hero {
    padding-block: var(--space-6) var(--space-5);
}

.hero__inner {
    display: grid;
    gap: var(--space-4);
    align-items: center;
}

@media (min-width: 52rem) {
    .hero__inner {
        grid-template-columns: 1fr auto;
    }

    .hero__inner .portrait {
        order: 2;
    }
}

.hero__title {
    margin-top: var(--space-2);
    font-size: var(--step-3);
}

.hero__lead {
    max-width: 38rem;
    margin-top: var(--space-3);
    font-size: var(--step-1);
    line-height: 1.5;
}

.hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-top: var(--space-4);
}

.portrait {
    display: grid;
    place-items: center;
    width: clamp(8rem, 22vw, 13rem);
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 50%;
    background: var(--accent);
    color: var(--accent-ink);
    font-family: var(--font-serif);
    font-size: clamp(2.6rem, 6vw, 4.2rem);
    letter-spacing: 0.02em;
    box-shadow: 0 0 0 6px var(--bg), 0 0 0 7px var(--line);
}

.portrait img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.highlights {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
    gap: var(--space-3);
    margin-top: var(--space-5);
    padding: 0;
    list-style: none;
}

.highlight {
    padding: var(--space-3);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}

.highlight__value {
    font-family: var(--font-serif);
    font-size: var(--step-2);
    line-height: 1.1;
    color: var(--accent);
}

.highlight__label {
    margin-top: var(--space-1);
    font-size: var(--step--1);
    color: var(--muted);
}

/* ------------------------------------------------------------------
   Buttons and tags
   ------------------------------------------------------------------ */

.button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border: 1px solid transparent;
    border-radius: var(--radius);
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.button--primary {
    background: var(--accent);
    color: var(--accent-ink);
}

.button--primary:hover {
    background: color-mix(in srgb, var(--accent) 85%, var(--text));
}

.button--secondary {
    border-color: var(--line);
    background: var(--surface);
    color: var(--text);
}

.button--secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    padding: 0;
    list-style: none;
}

.tag {
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 0.8rem;
}

/* ------------------------------------------------------------------
   Case studies
   ------------------------------------------------------------------ */

.cases {
    display: grid;
    gap: var(--space-3);
}

@media (min-width: 52rem) {
    .cases {
        grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr));
    }
}

.case {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    padding: var(--space-3);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}

.case__meta {
    font-family: var(--font-mono);
    font-size: var(--step--1);
    color: var(--muted);
}

.case__title {
    font-size: var(--step-1);
}

.case__facts {
    display: grid;
    gap: var(--space-2);
}

.case__facts dt {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--accent);
}

.case__facts dd {
    margin-top: 0.15rem;
}

.case .tags {
    margin-top: auto;
    padding-top: var(--space-1);
}

/* ------------------------------------------------------------------
   Experience
   ------------------------------------------------------------------ */

.timeline {
    display: grid;
    gap: var(--space-4);
    max-width: 48rem;
    padding: 0;
    list-style: none;
}

.role {
    position: relative;
    display: grid;
    gap: 0.35rem;
    padding-left: var(--space-3);
    border-left: 2px solid var(--line);
}

.role::before {
    content: "";
    position: absolute;
    top: 0.45rem;
    left: -7px;
    width: 12px;
    height: 12px;
    border: 2px solid var(--accent);
    border-radius: 50%;
    background: var(--bg);
}

.role__dates {
    font-family: var(--font-mono);
    font-size: var(--step--1);
    color: var(--muted);
}

.role__title {
    font-size: var(--step-1);
}

.role__org {
    font-weight: 600;
    color: var(--accent);
}

.role__summary {
    max-width: var(--measure);
}

/* ------------------------------------------------------------------
   Expertise
   ------------------------------------------------------------------ */

.expertise {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
    gap: var(--space-4) var(--space-5);
}

.skill-group h3 {
    margin-bottom: var(--space-2);
    font-family: var(--font-sans);
    font-size: var(--step-0);
    font-weight: 600;
    letter-spacing: 0;
}

/* ------------------------------------------------------------------
   Bio and contact
   ------------------------------------------------------------------ */

.bio {
    max-width: var(--measure);
    padding: var(--space-3);
    border: 1px solid var(--line);
    border-left: 4px solid var(--accent);
    border-radius: var(--radius);
    background: var(--surface);
}

.bio p + p {
    margin-top: var(--space-2);
}

.contact__card {
    display: grid;
    gap: var(--space-2);
    max-width: 48rem;
    padding: var(--space-4);
    border-radius: calc(var(--radius) * 2);
    background: var(--accent-soft);
}

.contact__title {
    font-size: var(--step-2);
}

.contact__card .hero__actions {
    margin-top: var(--space-1);
}

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

.site-footer {
    padding-block: var(--space-4);
    border-top: 1px solid var(--line);
    font-size: var(--step--1);
    color: var(--muted);
}

.site-footer__inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: var(--space-2);
}

.footer-links {
    display: flex;
    gap: var(--space-3);
    padding: 0;
    list-style: none;
}

.footer-links a {
    color: var(--muted);
}

/* Room for the floating preview switcher */
body:has(.switcher) .site-footer {
    padding-bottom: 7rem;
}

/* ------------------------------------------------------------------
   Placeholders (preview only) and the error page
   ------------------------------------------------------------------ */

.is-placeholder {
    outline: 2px dashed color-mix(in srgb, var(--accent) 55%, transparent);
    outline-offset: 3px;
}

.placeholder-note {
    display: inline-block;
    justify-self: start;
    align-self: flex-start;
    padding: 0.1rem 0.55rem;
    border-radius: 999px;
    background: var(--accent);
    color: var(--accent-ink);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.error-page {
    max-width: var(--measure);
    padding-block: var(--space-6);
}

.error-page p {
    margin-top: var(--space-2);
}

/* ------------------------------------------------------------------
   Preview switcher
   ------------------------------------------------------------------ */

.switcher {
    position: fixed;
    bottom: 1rem;
    left: 50%;
    z-index: 50;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    max-width: calc(100% - 2rem);
    padding: 0.45rem 0.7rem;
    border: 1px solid var(--line);
    border-radius: 1.5rem;
    background: var(--surface);
    box-shadow: 0 10px 30px rgb(0 0 0 / 0.18);
    font-size: 0.85rem;
    transform: translateX(-50%);
}

.switcher__label {
    padding-inline: 0.3rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}

.switcher__group {
    display: flex;
    gap: 0.2rem;
    padding: 0.2rem;
    border-radius: 999px;
    background: var(--bg);
}

.switcher a {
    padding: 0.3rem 0.8rem;
    border-radius: 999px;
    color: var(--text);
    text-decoration: none;
    white-space: nowrap;
}

.switcher a[aria-current="true"] {
    background: var(--accent);
    color: var(--accent-ink);
}

/* ------------------------------------------------------------------
   Print: a clean one-page résumé from "Print → Save as PDF"
   ------------------------------------------------------------------ */

@media print {
    :root,
    :root[data-palette] {
        color-scheme: light;
        --bg: #ffffff;
        --surface: #ffffff;
        --text: #000000;
        --muted: #333333;
        --line: #cccccc;
        --accent: #000000;
        --accent-ink: #ffffff;
        --accent-soft: #ffffff;
    }

    body {
        font-size: 10.5pt;
        line-height: 1.45;
    }

    .site-header,
    .switcher,
    .skip-link,
    .portrait,
    .hero__actions,
    .is-placeholder {
        display: none !important;
    }

    .hero {
        padding-block: 0 1rem;
    }

    .section {
        padding-block: 1rem;
    }

    .section__header {
        margin-bottom: 0.75rem;
    }

    .highlights {
        margin-top: 1rem;
    }

    .highlight,
    .case,
    .role,
    .bio {
        break-inside: avoid;
    }

    a {
        color: inherit;
        text-decoration: none;
    }

    .footer-links a::after {
        content: " (" attr(href) ")";
    }
}
