:root {
    color-scheme: light;
    --page: #f1f3f6;
    --surface: #f8f9fb;
    --surface-raised: #e5e9f0;
    --text: #172033;
    --muted: #596579;
    --subtle: #5b687d;
    --line: #d7dde7;
    --accent: #a30f24;
    --secondary: #006b66;
    --accent-ink: #ffffff;
    --display: "Manrope", sans-serif;
    --body: "DM Sans", sans-serif;
    --mono: "DM Mono", monospace;
    font-family: var(--body);
    font-synthesis: none;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
    scroll-padding-top: 5rem;
}

:root[data-theme="mist"] {
    color-scheme: light;
    --page: #e9edf3;
    --surface: #f4f6f9;
    --surface-raised: #dce2ec;
    --text: #1b2940;
    --muted: #596a83;
    --subtle: #5b687d;
    --line: #cfd7e4;
    --accent: #a30f24;
    --secondary: #006b66;
    --accent-ink: #ffffff;
}

:root[data-theme="midnight"] {
    color-scheme: dark;
    --page: #101827;
    --surface: #172236;
    --surface-raised: #202f48;
    --text: #eef3fc;
    --muted: #aab8cd;
    --subtle: #aab8cd;
    --line: #2a3a54;
    --accent: #ff5964;
    --secondary: #55d6c2;
    --accent-ink: #101827;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--page);
    color: var(--text);
    transition: background-color 220ms ease, color 220ms ease;
}

a { color: inherit; text-decoration: none; }
button, select { font: inherit; }
::selection { background: var(--accent); color: var(--accent-ink); }

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    z-index: 10;
    top: 8px;
    left: 8px;
    padding: 12px 16px;
    transform: translateY(-150%);
    border-radius: 3px;
    background: var(--accent);
    color: var(--accent-ink);
    font-weight: 700;
}
.skip-link:focus { transform: translateY(0); }

.page-shell, .section-shell { width: min(1120px, calc(100% - 64px)); margin-inline: auto; }
site-header, site-footer { display: block; }
.site-header {
    width: min(1120px, calc(100% - 64px));
    height: 88px;
    margin-inline: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--line);
}
.wordmark { font: 800 23px/1 var(--display); letter-spacing: .08em; }
.wordmark span, .accent-text, .footer-spark { color: var(--accent); }
.main-nav { display: flex; align-items: center; gap: 28px; margin-left: auto; color: var(--muted); font-size: 13px; }
.main-nav a, .text-link { transition: color 160ms ease; }
.main-nav a { padding-block: 10px; }
.main-nav a:hover, .text-link:hover { color: var(--accent); }
.theme-control { display: grid; width: 28px; height: 28px; place-items: center; padding: 0; border: 0; background: transparent; color: var(--accent); cursor: pointer; }
.theme-icon { font-size: 18px; line-height: 1; }

.hero { min-height: 510px; display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(220px, .65fr); align-items: center; gap: 90px; padding-block: 75px 80px; }
.hero-copy { min-width: 0; }
.eyebrow, .project-type { margin: 0; color: var(--muted); font: 10px/1.5 var(--mono); letter-spacing: 1.55px; }
.status-dot { display: inline-block; width: 7px; height: 7px; margin: 0 8px 1px 0; border-radius: 50%; background: var(--secondary); box-shadow: 0 0 11px color-mix(in srgb, var(--secondary), transparent 35%); }
.eyebrow-divider { padding-inline: 8px; color: var(--subtle); }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-family: var(--display); }
.hero h1 { margin: 25px 0 12px; font-size: clamp(55px, 7vw, 84px); line-height: 1.02; letter-spacing: -5px; font-weight: 600; }
.hero-role { margin-bottom: 17px; color: var(--accent); font: 500 16px/1.5 var(--mono); }
.hero-description { max-width: 490px; margin-bottom: 25px; color: var(--muted); font-size: 15px; line-height: 1.8; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 25px; }
.hero-action-row { display: contents; }
.button { min-height: 47px; display: inline-flex; align-items: center; justify-content: center; gap: 20px; padding: 0 18px; border-radius: 3px; font-size: 14px; font-weight: 700; transition: transform 160ms ease, background-color 160ms ease; }
.hero-actions .button { flex: 0 0 auto; }
.button:hover { transform: translateY(-2px); }
.button-primary { background: var(--accent); color: var(--accent-ink); }
.button-primary:hover { background: color-mix(in srgb, var(--accent), white 12%); }
.button-secondary { border: 1px solid var(--line); }
.text-link { color: var(--text); font-size: 12px; }
.text-link span { margin-left: 6px; color: var(--accent); }
.hero-note { display: flex; align-items: center; gap: 11px; margin-top: 34px; color: var(--subtle); font: 10px/1.5 var(--mono); }
.note-line { width: 28px; height: 1px; background: var(--accent); }
.hero-summary { padding-left: 27px; border-left: 1px solid var(--line); }
.strength-list { margin: 16px 0 0; padding: 0; list-style: none; }
.strength-list li { padding: 12px 0; border-bottom: 1px solid var(--line); color: var(--text); font-size: 14px; }

.about-section { display: grid; grid-template-columns: 1fr 1fr; gap: 70px; padding-block: 117px 122px; border-top: 1px solid var(--line); }
.heading-number { margin-left: 11px; color: var(--secondary); font-size: 9px; }
.section-heading h2, .work-heading h2, .contact-section h2 { margin: 22px 0 0; font-size: clamp(33px, 4vw, 47px); line-height: 1.18; letter-spacing: -2px; font-weight: 600; }
.muted-text { color: var(--muted); }
.about-content { padding-top: 38px; }
.about-lead { max-width: 450px; margin-bottom: 15px; font: 600 19px/1.55 var(--display); letter-spacing: -.4px; }
.about-body { max-width: 465px; margin-bottom: 25px; color: var(--muted); font-size: 15px; line-height: 1.8; }
.skill-list { display: flex; flex-wrap: wrap; gap: 8px; }
.skill-list span, .project-tags span { padding: 7px 10px; border: 1px solid var(--line); border-radius: 2px; color: var(--muted); font: 9px var(--mono); }

.experience-section { padding-block: 100px 110px; border-top: 1px solid var(--line); }
.experience-list { border-top: 1px solid var(--line); }
.experience-entry { display: grid; grid-template-columns: minmax(140px, .35fr) 1fr; gap: 35px; padding: 27px 0; border-bottom: 1px solid var(--line); }
.experience-date { padding-top: 4px; color: var(--accent); font: 11px/1.6 var(--mono); }
.experience-details h3 { margin: 0; font-size: 19px; letter-spacing: -.4px; font-weight: 600; }
.experience-company { margin: 7px 0 13px; color: var(--muted); font-size: 13px; }
.experience-details ul { margin: 0; padding-left: 17px; color: var(--muted); font-size: 14px; line-height: 1.75; }
.experience-details li + li { margin-top: 4px; }

.work-section { padding-block: 100px 116px; border-top: 1px solid var(--line); }
.work-heading { display: flex; align-items: end; justify-content: space-between; gap: 25px; margin-bottom: 41px; }
.work-heading h2 { margin-top: 19px; }
.work-intro { max-width: 310px; margin: 0 0 3px; color: var(--muted); font-size: 12px; line-height: 1.75; }
.project-grid { display: grid; grid-template-columns: 1fr; }
.project-card { display: block; min-width: 0; padding: 25px 0 27px; border-top: 1px solid var(--line); }
.project-card:last-child { border-bottom: 1px solid var(--line); }
.project-meta { display: flex; align-items: center; justify-content: space-between; }
.project-type { font-size: 8px; letter-spacing: 1.2px; }
.project-meta h3 { margin: 8px 0 0; font-size: 20px; letter-spacing: -.5px; font-weight: 600; transition: color 160ms ease; }
.project-card:hover .project-meta h3, .project-card:focus-visible .project-meta h3 { color: var(--accent); }
.project-description { max-width: 620px; margin: 12px 0 14px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.project-read-more { display: inline-flex; align-items: center; gap: 7px; color: var(--accent); font-size: 11px; font-weight: 700; }
.project-read-more span { transition: transform 160ms ease; }
.project-card:hover .project-read-more span, .project-card:focus-visible .project-read-more span { transform: translate(2px, -2px); }

.project-detail { padding-block: 60px 110px; }
.back-link { display: inline-block; margin-bottom: 50px; color: var(--muted); font-size: 12px; transition: color 160ms ease; }
.back-link:hover { color: var(--accent); }
.project-detail > h1 { max-width: 800px; margin: 20px 0 16px; font-size: clamp(46px, 7vw, 76px); line-height: 1.08; letter-spacing: -4px; font-weight: 600; }
.project-detail-lead { max-width: 630px; margin-bottom: 65px; color: var(--muted); font-size: 16px; line-height: 1.8; }
.project-detail-content { max-width: 800px; border-top: 1px solid var(--line); }
.project-detail-content section { display: grid; grid-template-columns: minmax(145px, .4fr) 1fr; column-gap: 35px; padding: 26px 0; border-bottom: 1px solid var(--line); }
.project-detail-content section > .eyebrow { grid-row: span 2; margin: 5px 0 0; }
.project-detail-content h2 { margin: 0 0 10px; font-size: 21px; letter-spacing: -.5px; font-weight: 600; }
.project-detail-content section > p:last-child { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.8; }

.contact-section { position: relative; overflow: hidden; padding-block: 85px 94px; border-top: 1px solid var(--line);}
.contact-layout { position: relative; z-index: 1; display: flex; align-items: end; justify-content: space-between; gap: 25px; }
.contact-section h2 { margin-top: 20px; font-size: clamp(42px, 6vw, 70px); line-height: 1.08; letter-spacing: -3.5px; }
.contact-copy { width: min(320px, 40%); padding-bottom: 5px; }
.contact-copy p { margin-bottom: 19px; color: var(--muted); font-size: 15px; line-height: 1.8; }
.contact-email { text-decoration: underline; text-underline-offset: 3px; }
.site-footer { min-height: 78px; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); color: var(--subtle); font: 9px var(--mono); }
.site-footer p { margin: 0; }
.footer-wordmark { color: var(--text); font-size: 18px; }

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

@media (max-width: 760px) {
    .page-shell, .section-shell, .site-header { width: min(100% - 40px, 560px); }
    .site-header { height: 72px; }
    .main-nav { gap: 17px; font-size: 11px; }
    .hero { min-height: auto; grid-template-columns: 1fr; gap: 38px; padding-block: 70px 74px; }
    .hero h1 { font-size: clamp(47px, 10vw, 67px); letter-spacing: -3px; }
    .hero-note { margin-top: 35px; }
    .hero-summary { padding-left: 20px; }
    .about-section { grid-template-columns: 1fr; gap: 5px; padding-block: 76px 82px; }
    .about-content { padding-top: 17px; }
    .experience-section { padding-block: 76px 85px; }
    .experience-entry { grid-template-columns: 1fr; gap: 9px; }
    .work-section { padding-block: 76px 85px; }
    .project-detail { padding-block: 45px 85px; }
    .back-link { margin-bottom: 40px; }
    .project-detail-lead { margin-bottom: 45px; }
    .project-detail-content section { grid-template-columns: 1fr; row-gap: 12px; }
    .project-detail-content section > .eyebrow { grid-row: auto; }
    .about-content { max-width: 560px; }
    .contact-section { padding-block: 70px 76px; }
}

@media (max-width: 520px) {
    .page-shell, .section-shell, .site-header { width: calc(100% - 36px); }
    .site-header { height: 68px; }
    .wordmark { font-size: 20px; }
    .main-nav { gap: 10px; font-size: 9px; }
    .hero { padding-top: 62px; }
    .hero h1 { font-size: clamp(42px, 11.3vw, 58px); }
    .hero-description { max-width: 355px; font-size: 14px; }
    .hero-note { font-size: 9px; }
    .section-heading h2, .work-heading h2 { font-size: 35px; }
    .about-section { padding-block: 68px 72px; }
    .experience-section { padding-block: 67px 73px; }
    .work-section { padding-block: 67px 73px; }
    .work-heading { display: block; margin-bottom: 28px; }
    .work-intro { margin-top: 16px; }
    .project-grid { grid-template-columns: 1fr; gap: 38px; }
    .contact-layout { display: block; }
    .contact-section h2 { font-size: 54px; }
    .contact-copy { width: min(310px, 100%); margin-top: 25px; }
    .site-footer { min-height: 72px; font-size: 8px; }
    .site-footer p:nth-child(2) { display: none; }
}

@media (max-width: 440px) {
    .hero-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; }
    .hero-action-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 14px; max-width: 100%; }
}

@media (max-width: 360px) {
    .site-header { height: auto; min-height: 68px; flex-wrap: wrap; gap: 8px 16px; padding-block: 12px; }
    .main-nav { width: 100%; justify-content: space-between; gap: 8px; margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
