:root {
    color-scheme: light;
    --page: #f5f5f2;
    --surface: #ffffff;
    --surface-soft: #eef1f3;
    --header: #111c28;
    --text: #1d2732;
    --muted: #5d6874;
    --line: #d9dee2;
    --accent: #d96f12;
    --accent-dark: #a94f08;
    --link: #165d8c;
    --success: #247247;
    --danger: #a33c3c;
    --wrap: min(1060px, calc(100% - 40px));
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 90px;
}

body {
    margin: 0;
    min-width: 320px;
    background: var(--page);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

body.menu-open {
    overflow: hidden;
}

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

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

button,
input,
select,
textarea {
    font: inherit;
}

:focus-visible {
    outline: 3px solid #f29a48;
    outline-offset: 3px;
}

.skip-link {
    position: fixed;
    top: 8px;
    left: 8px;
    z-index: 1000;
    padding: 8px 12px;
    background: #fff;
    color: #111;
    transform: translateY(-150%);
}

.skip-link:focus {
    transform: translateY(0);
}

.wrap {
    width: var(--wrap);
    margin: 0 auto;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--header);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-row {
    min-height: 74px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    text-decoration: none;
}

.brand-name {
    font-size: 1.03rem;
    font-weight: 750;
    letter-spacing: -0.01em;
}

.brand-role {
    padding-left: 10px;
    border-left: 1px solid rgba(255, 255, 255, 0.25);
    color: #9fabb6;
    font-size: 0.76rem;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 26px;
}

.main-nav a {
    position: relative;
    padding: 7px 9px;
    border-radius: 5px;
    color: #d9e0e7;
    font-size: 0.92rem;
    font-weight: 600;
    text-decoration: none;
}

.main-nav a:hover,
.main-nav a[aria-current="page"] {
    color: #fff;
}

.main-nav a[aria-current="page"] {
    background: rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 -2px 0 #e47b1b;
}

.menu-toggle {
    display: none;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    background: transparent;
    color: #fff;
}

.menu-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    margin: 4px auto;
    background: currentColor;
}

.intro {
    padding: 72px 0 64px;
    border-bottom: 1px solid var(--line);
    display: grid;
    grid-template-columns: minmax(0, 1fr) 200px;
    align-items: center;
    gap: 64px;
}

.intro-label {
    margin: 0 0 10px;
    color: var(--accent-dark);
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

h1,
h2,
h3 {
    margin-top: 0;
    color: var(--text);
    line-height: 1.25;
}

h1 {
    margin-bottom: 8px;
    font-size: clamp(2.25rem, 5vw, 3.25rem);
    letter-spacing: -0.025em;
}

.intro-title {
    margin: 0 0 22px;
    color: var(--muted);
    font-size: clamp(1.15rem, 2vw, 1.4rem);
    font-weight: 500;
}

.mobile-break {
    display: none;
}

.intro-copy {
    max-width: 700px;
    margin: 0;
    color: #44505b;
    font-size: 1.06rem;
}

.intro-photo {
    width: 180px;
    height: 180px;
    border: 4px solid #fff;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 2px 10px rgba(17, 28, 40, 0.15);
}

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

.button {
    min-height: 42px;
    padding: 9px 16px;
    border: 1px solid #b9c1c8;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    color: var(--text);
    font-weight: 650;
    text-decoration: none;
    cursor: pointer;
}

.button:hover {
    border-color: #8e99a2;
    background: #f8f9f9;
}

.button-primary {
    border-color: var(--accent);
    background: var(--accent);
    color: #fff;
}

.button-primary:hover {
    border-color: var(--accent-dark);
    background: var(--accent-dark);
}

.section {
    padding: 58px 0;
    border-bottom: 1px solid var(--line);
}

.section-heading {
    margin-bottom: 28px;
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 30px;
}

.section-heading h2 {
    margin-bottom: 4px;
    font-size: clamp(1.65rem, 3vw, 2rem);
}

.section-heading p {
    max-width: 620px;
    margin: 0;
    color: var(--muted);
}

.text-link {
    flex: 0 0 auto;
    font-size: 0.92rem;
    font-weight: 650;
    text-decoration: none;
}

.project-list {
    display: grid;
    gap: 18px;
}

.project-row {
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 8px;
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    align-items: center;
    gap: 28px;
    background: var(--surface);
}

.project-row img {
    width: 260px;
    height: 146px;
    border-radius: 5px;
    object-fit: cover;
}

.project-row h3 {
    margin-bottom: 4px;
    font-size: 1.25rem;
}

.project-company {
    margin: 0 0 12px;
    color: var(--accent-dark);
    font-size: 0.82rem;
    font-weight: 700;
}

.project-row p:last-of-type {
    margin-bottom: 0;
    color: var(--muted);
}

.project-row a {
    display: inline-block;
    margin-top: 14px;
    font-size: 0.9rem;
    font-weight: 650;
    text-decoration: none;
}

.current-project-section {
    padding-bottom: 26px;
}

.current-project {
    padding: 22px;
    border: 1px solid var(--line);
    border-left: 3px solid var(--accent);
    border-radius: 7px;
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr) auto;
    align-items: center;
    gap: 30px;
    background: var(--surface);
}

.current-project h3 {
    margin: 0;
    font-size: 1.35rem;
}

.current-project p {
    margin: 0;
    color: var(--muted);
}

.current-project .project-company {
    margin-bottom: 5px;
    color: var(--accent-dark);
}

.current-project a {
    white-space: nowrap;
}

.metric-value {
    color: var(--accent-dark);
    font-size: 1em;
    font-weight: 650;
    white-space: nowrap;
}

.experience-list {
    border-top: 1px solid var(--line);
}

.experience-row {
    padding: 22px 0;
    border-bottom: 1px solid var(--line);
    display: grid;
    grid-template-columns: 155px minmax(220px, 0.8fr) minmax(0, 1.4fr);
    gap: 28px;
}

.experience-row time {
    color: var(--muted);
    font-size: 0.86rem;
}

.experience-row h3 {
    margin-bottom: 3px;
    font-size: 1.05rem;
}

.experience-role {
    margin: 0;
    color: var(--accent-dark);
    font-size: 0.86rem;
    font-weight: 650;
}

.experience-summary {
    margin: 0;
    color: var(--muted);
}

.focus-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 40px;
}

.focus-item {
    padding: 20px 0;
    border-top: 1px solid var(--line);
}

.focus-item h3 {
    margin-bottom: 6px;
    font-size: 1.05rem;
}

.focus-item p {
    margin: 0;
    color: var(--muted);
}

.contact-band {
    margin: 56px 0;
    padding: 30px 34px;
    border: 1px solid #ccd2d7;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    background: var(--surface);
}

.contact-band h2 {
    margin-bottom: 5px;
    font-size: 1.5rem;
}

.contact-band p {
    margin: 0;
    color: var(--muted);
}

/* Interior pages */
.page-intro {
    padding: 58px 0 46px;
    border-bottom: 1px solid var(--line);
}

.page-intro h1 {
    margin-bottom: 14px;
}

.page-intro p:last-child {
    max-width: 760px;
    margin-bottom: 0;
    color: var(--muted);
    font-size: 1.05rem;
}

.page-intro p.now-intro-copy {
    max-width: none;
}

.page-note {
    margin-top: 20px;
    padding: 13px 16px;
    border-left: 3px solid var(--accent);
    background: #fff;
    color: var(--muted);
    font-size: 0.9rem;
}

.career-list {
    border-top: 1px solid var(--line);
}

.career-entry {
    padding: 34px 0;
    border-bottom: 1px solid var(--line);
    display: grid;
    grid-template-columns: 170px minmax(0, 1fr);
    gap: 34px;
}

.career-meta {
    color: var(--muted);
    font-size: 0.86rem;
}

.career-meta time {
    display: block;
    margin-bottom: 8px;
    color: var(--accent-dark);
    font-weight: 700;
}

.career-entry h2 {
    margin-bottom: 3px;
    font-size: 1.4rem;
}

.career-title {
    margin: 0 0 15px;
    color: var(--muted);
    font-weight: 600;
}

.career-entry > div > p:not(.career-title) {
    max-width: 770px;
    color: #46525d;
}

.plain-list {
    max-width: 790px;
    margin: 16px 0 0;
    padding-left: 20px;
}

.plain-list li {
    margin: 7px 0;
    padding-left: 4px;
    color: var(--muted);
}

.technology-line {
    margin-top: 16px;
    color: #3f4c58;
    font-size: 0.86rem;
}

.technology-line strong {
    color: var(--text);
}

.skills-table {
    border-top: 1px solid var(--line);
}

.skills-row {
    padding: 18px 0;
    border-bottom: 1px solid var(--line);
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 30px;
}

.skills-row h3 {
    margin: 0;
    font-size: 1rem;
}

.skills-row p {
    margin: 0;
    color: var(--muted);
}

.project-detail {
    padding: 40px 0;
    border-bottom: 1px solid var(--line);
}

.project-detail-head {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    align-items: start;
    gap: 34px;
}

.project-detail-image {
    width: 260px;
    height: 146px;
    border: 1px solid var(--line);
    border-radius: 6px;
    object-fit: cover;
}

.project-detail h2 {
    margin-bottom: 3px;
    font-size: 1.55rem;
}

.project-detail-company {
    margin: 0 0 14px;
    color: var(--accent-dark);
    font-size: 0.86rem;
    font-weight: 700;
}

.project-detail-summary {
    max-width: 720px;
    margin-bottom: 14px;
    color: #46525d;
}

.project-facts {
    margin: 24px 0 0 294px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 34px;
}

.project-fact {
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.project-fact h3 {
    margin-bottom: 5px;
    color: var(--accent-dark);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.project-fact p {
    margin: 0;
    color: var(--muted);
}

.archive-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.archive-item {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 7px;
    display: grid;
    grid-template-columns: 140px minmax(0, 1fr);
    gap: 18px;
    background: var(--surface);
}

.archive-item img {
    width: 140px;
    height: 79px;
    border-radius: 4px;
    object-fit: cover;
}

.archive-item h3 {
    margin-bottom: 5px;
    font-size: 1rem;
}

.archive-item .archive-meta {
    margin: 0 0 5px;
    color: var(--accent-strong);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.archive-item p {
    margin: 0;
    color: var(--muted);
    font-size: 0.88rem;
}

.now-list {
    border-top: 1px solid var(--line);
}

.now-entry {
    padding: 24px 0;
    border-bottom: 1px solid var(--line);
    display: grid;
    grid-template-columns: 190px minmax(0, 1fr);
    gap: 30px;
}

.now-entry h2 {
    margin: 0;
    font-size: 1.15rem;
}

.now-entry p {
    max-width: 720px;
    margin: 0;
    color: var(--muted);
}

.reading-list {
    columns: 2;
    column-gap: 50px;
    margin: 0;
    padding-left: 20px;
}

.reading-list li {
    break-inside: avoid;
    margin: 0 0 12px;
    color: var(--muted);
}

.reading-list strong {
    color: var(--text);
}

.contact-layout {
    padding: 52px 0 64px;
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    align-items: start;
    gap: 60px;
}

.contact-aside {
    color: var(--muted);
}

.contact-aside h2 {
    margin-bottom: 9px;
    font-size: 1.25rem;
}

.contact-aside a {
    font-weight: 650;
    text-decoration: none;
}

.contact-form {
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.form-group {
    margin-bottom: 18px;
}

.form-group-full {
    grid-column: 1 / -1;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    color: #35414c;
    font-size: 0.86rem;
    font-weight: 650;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    border: 1px solid #bfc7ce;
    border-radius: 5px;
    background: #fff;
    color: var(--text);
}

.form-group input,
.form-group select {
    min-height: 44px;
    padding: 0 11px;
}

.form-group textarea {
    min-height: 150px;
    padding: 10px 11px;
    resize: vertical;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--accent);
    outline: 0;
    box-shadow: 0 0 0 3px rgba(217, 111, 18, 0.13);
}

.form-honeypot {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.form-note,
.form-status {
    color: var(--muted);
    font-size: 0.82rem;
}

.form-status {
    min-height: 24px;
    margin-top: 12px;
}

.form-status.success {
    color: var(--success);
}

.form-status.error {
    color: var(--danger);
}

.button-loader {
    width: 16px;
    height: 16px;
    margin-left: 7px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 700ms linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

[hidden] {
    display: none !important;
}

.not-found {
    min-height: calc(100vh - 74px);
    padding: 90px 0;
}

.not-found-code {
    margin: 0 0 8px;
    color: var(--accent-dark);
    font-weight: 750;
}

.not-found p {
    max-width: 580px;
    color: var(--muted);
}

.site-footer {
    padding: 34px 0;
    background: var(--header);
    color: #abb5bf;
    font-size: 0.86rem;
}

.footer-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 30px;
}

.footer-row p {
    grid-column: 2;
    grid-row: 1;
    margin: 0;
    text-align: center;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 18px;
}

.footer-links a,
.analytics-preferences-button {
    padding: 0;
    border: 0;
    background: transparent;
    color: #d7dde3;
    font-size: inherit;
    text-decoration: none;
    cursor: pointer;
}

.footer-social-icons {
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
    gap: 12px;
}

.footer-social-icons a {
    width: 34px;
    height: 34px;
    border-radius: 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #d7dde3;
    font-size: 1.35rem;
}

.footer-social-icons a:hover {
    background: rgba(255, 255, 255, 0.1);
}

.footer-social-icons img {
    width: 30px;
    height: 30px;
    border-radius: 4px;
    object-fit: cover;
}

.footer-links a:hover,
.analytics-preferences-button:hover {
    color: #fff;
}

.footer-row > .analytics-preferences-button {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
    min-height: 34px;
    padding: 0 8px;
    border-radius: 5px;
}

.footer-row > .analytics-preferences-button:hover {
    background: rgba(255, 255, 255, 0.1);
}

.analytics-consent {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 600;
    width: min(440px, calc(100% - 36px));
    padding: 18px;
    border: 1px solid #c9d0d6;
    border-radius: 8px;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 18px;
    background: #fff;
    box-shadow: 0 8px 28px rgba(17, 28, 40, 0.18);
}

.analytics-consent strong {
    color: var(--text);
}

.analytics-consent p {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.45;
}

.analytics-consent-actions {
    display: flex;
    gap: 7px;
}

.analytics-consent-actions button {
    min-height: 38px;
    padding: 7px 10px;
    border: 1px solid #b9c1c8;
    border-radius: 5px;
    background: #fff;
    color: var(--text);
    font-size: 0.76rem;
    font-weight: 650;
    cursor: pointer;
}

.analytics-consent-actions .analytics-consent-accept {
    border-color: var(--accent);
    background: var(--accent);
    color: #fff;
}

@media (max-width: 760px) {
    :root {
        --wrap: calc(100% - 30px);
    }

    .nav-row {
        min-height: 66px;
    }

    .brand-role {
        display: none;
    }

    .menu-toggle {
        display: block;
    }

    .main-nav {
        position: fixed;
        top: 66px;
        right: 15px;
        left: 15px;
        padding: 16px;
        border: 1px solid #34414e;
        border-radius: 7px;
        display: none;
        align-items: stretch;
        gap: 0;
        background: var(--header);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    }

    .main-nav.is-open {
        display: grid;
    }

    .main-nav a {
        padding: 10px 8px;
    }

    .intro {
        padding: 45px 0;
        grid-template-columns: 1fr;
        gap: 28px;
        text-align: center;
    }

    .mobile-break {
        display: inline;
    }

    .desktop-separator {
        display: none;
    }

    .career-entry,
    .skills-row,
    .project-detail-head,
    .now-entry,
    .contact-layout {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .project-detail-image {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
    }

    .project-facts {
        margin-left: 0;
        grid-template-columns: 1fr;
    }

    .archive-list,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .archive-item {
        grid-template-columns: 1fr;
    }

    .archive-item img {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
    }

    .reading-list {
        columns: 1;
    }

    .intro-photo {
        width: 128px;
        height: 128px;
        grid-row: 1;
        margin-inline: auto;
    }

    .actions {
        justify-content: center;
    }

    .projects-page .page-intro > .intro-label,
    .projects-page .page-intro > h1 {
        text-align: center;
    }

    .section {
        padding: 44px 0;
    }

    .section-heading,
    .contact-band {
        align-items: flex-start;
        flex-direction: column;
    }

    .footer-row {
        grid-template-columns: 1fr;
        justify-items: center;
        gap: 14px;
    }

    .footer-row p {
        grid-column: 1;
        grid-row: 1;
        justify-self: center;
    }

    .footer-social-icons {
        grid-column: 1;
        grid-row: 2;
        justify-self: center;
    }

    .footer-row > .analytics-preferences-button {
        grid-column: 1;
        grid-row: 3;
        justify-self: center;
    }

    .project-row {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .current-project {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .project-row img {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
    }

    .experience-row {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .focus-list {
        grid-template-columns: 1fr;
    }

    .analytics-consent {
        grid-template-columns: 1fr;
    }
}
