:root {
    color-scheme: light;
    --paper: #f6f3ee;
    --paper-2: #fffdf8;
    --ink: #171513;
    --ink-soft: #34302a;
    --muted: #706b63;
    --line: rgba(23, 21, 19, 0.16);
    --line-strong: rgba(23, 21, 19, 0.32);
    --rose: #d84677;
    --blue: #277da7;
    --green: #5a8f6f;
    --ochre: #b9802e;
    --dark: #161718;
    --dark-2: #202326;
    --radius: 6px;
    --max: 1180px;
    --font-main: "Aptos", "Segoe UI", system-ui, -apple-system, sans-serif;
    --font-display: "Arial Narrow", "Aptos Display", "Segoe UI", system-ui, sans-serif;
    --font-mono: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
}

* {
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-width: 320px;
    overflow-x: clip;
    background:
        linear-gradient(90deg, rgba(23, 21, 19, 0.045) 1px, transparent 1px),
        linear-gradient(rgba(23, 21, 19, 0.035) 1px, transparent 1px),
        var(--paper);
    background-size: 88px 88px, 100% 44px;
    color: var(--ink);
    font-family: var(--font-main);
    font-size: 16px;
    line-height: 1.55;
    text-rendering: optimizeLegibility;
}

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

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

button,
input,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

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

h1,
h2,
h3,
p,
dl {
    margin-top: 0;
}

.skip-link {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 50;
    transform: translateY(-140%);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--paper-2);
    padding: 10px 14px;
    font-weight: 800;
}

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

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 18px;
    width: min(var(--max), calc(100% - 28px));
    margin: 14px auto 0;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(246, 243, 238, 0.9);
    padding: 10px;
    backdrop-filter: blur(14px);
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border: 1px solid var(--ink);
    border-radius: var(--radius);
    background: var(--ink);
    color: var(--paper-2);
    font-family: var(--font-mono);
    font-weight: 900;
}

.header-role {
    margin: 0;
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    text-transform: uppercase;
}

.site-nav {
    display: flex;
    gap: 2px;
}

.site-nav a {
    border-radius: var(--radius);
    padding: 10px 12px;
    color: var(--ink-soft);
    font-size: 0.95rem;
}

.site-nav a:hover {
    background: var(--ink);
    color: var(--paper-2);
}

.section-pad {
    width: min(var(--max), calc(100% - 28px));
    margin: 0 auto;
    padding: 96px 0;
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.16fr) minmax(300px, 0.52fr);
    gap: clamp(28px, 6vw, 82px);
    align-items: center;
    min-height: clamp(560px, calc(100vh - 260px), 720px);
    padding-top: clamp(56px, 6vw, 72px);
    padding-bottom: clamp(56px, 6vw, 72px);
}

.hero > * {
    min-width: 0;
}

.hero-copy {
    max-width: 900px;
}

.eyebrow,
.section-kicker {
    margin-bottom: 14px;
    color: var(--rose);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.hero h1,
.project-hero h1 {
    margin-bottom: 24px;
    font-family: var(--font-display);
    font-size: clamp(4rem, 6.5vw, 5.8rem);
    font-weight: 900;
    letter-spacing: 0;
    line-height: 0.82;
    text-transform: uppercase;
}

.hero h1 span {
    display: block;
}

.hero h1 .first-name {
    color: transparent;
    -webkit-text-stroke: 1.5px var(--ink);
}

.hero h1 .last-name {
    color: var(--ink);
}

.hero-line {
    max-width: 760px;
    margin-bottom: 0;
    color: var(--ink-soft);
    font-size: clamp(1.18rem, 2.1vw, 1.72rem);
    line-height: 1.25;
}

.hero-actions,
.contact-actions,
.admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-top: 28px;
}

.button,
.mini-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    border: 1px solid var(--ink);
    border-radius: var(--radius);
    padding: 0 16px;
    background: transparent;
    color: var(--ink);
    font-weight: 850;
    line-height: 1;
    transition: transform 160ms ease, background 160ms ease, color 160ms ease;
}

.button:hover,
.mini-button:hover {
    transform: translateY(-2px);
}

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

.button.secondary {
    background: var(--paper-2);
}

.button.light.primary {
    border-color: var(--paper-2);
    background: var(--paper-2);
    color: var(--ink);
}

.button.light.secondary {
    border-color: rgba(255, 253, 248, 0.5);
    background-color: transparent;
    color: var(--paper-2);
}

.button.danger {
    border-color: #c43b4c;
    background: #c43b4c;
    color: white;
}

.hero-facts {
    display: grid;
    grid-template-columns: 1fr;
    align-self: end;
    gap: 1px;
    margin: 0;
    border: 1px solid var(--line);
    background: var(--line);
}

.hero-facts div {
    min-height: 128px;
    background: rgba(255, 253, 248, 0.78);
    padding: 16px;
}

.hero-facts dt {
    margin-bottom: 14px;
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 0.74rem;
    font-weight: 800;
    text-transform: uppercase;
}

.hero-facts dd {
    margin: 0;
    color: var(--ink);
    font-weight: 800;
    line-height: 1.25;
}

.split-layout {
    display: grid;
    grid-template-columns: minmax(0, 0.78fr) minmax(340px, 0.82fr);
    gap: clamp(28px, 7vw, 92px);
    align-items: start;
}

.split-layout h2,
.section-heading h2,
.contact-panel h2 {
    margin-bottom: 0;
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 5.6vw, 6.1rem);
    font-weight: 900;
    line-height: 0.9;
    text-transform: uppercase;
}

.split-layout h2 {
    max-width: 9ch;
}

.rich-copy {
    border-left: 2px solid var(--ink);
    padding-left: 24px;
    color: var(--ink-soft);
    font-size: 1.08rem;
}

.rich-copy p {
    margin-bottom: 18px;
}

.dark-band {
    width: 100%;
    max-width: none;
    border-block: 1px solid var(--ink);
    background:
        linear-gradient(90deg, rgba(255, 253, 248, 0.07) 1px, transparent 1px),
        var(--dark);
    background-size: 88px 100%;
    color: var(--paper-2);
}

.dark-band > * {
    width: min(var(--max), calc(100% - 28px));
    margin-inline: auto;
}

.section-heading {
    display: block;
    max-width: 980px;
    margin-bottom: 38px;
}

.section-heading.compact {
    max-width: 820px;
}

.project-grid,
.stack-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border: 1px solid var(--line);
    background: var(--line);
    gap: 1px;
}

.project-card,
.stack-group,
.empty-state,
.admin-card,
.admin-table-wrap,
.project-form,
.danger-zone {
    border-radius: var(--radius);
    background: rgba(255, 253, 248, 0.9);
}

.project-card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 430px;
    padding: 22px;
    color: var(--ink);
}

.project-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 5px;
    background: var(--accent, var(--rose));
}

.project-card img {
    width: 100%;
    height: 180px;
    margin-bottom: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    object-fit: cover;
}

.project-card-top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.project-card-top,
.project-role,
.mosaic-tile span {
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
}

.project-card h3,
.stack-group h3,
.mosaic-tile h3 {
    margin-bottom: 12px;
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 2.8vw, 2.25rem);
    line-height: 0.96;
    text-transform: uppercase;
}

.project-card p,
.stack-group p {
    color: var(--ink-soft);
}

.project-role {
    color: var(--rose);
}

.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: auto;
}

.tag-row span {
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: transparent;
    padding: 5px 9px;
    color: var(--ink-soft);
    font-family: var(--font-mono);
    font-size: 0.72rem;
}

.project-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 22px;
}

.project-links a,
.text-link {
    border-bottom: 1px solid currentColor;
    color: var(--rose);
    font-weight: 900;
}

.empty-state {
    max-width: 720px;
    border: 1px solid rgba(255, 253, 248, 0.22);
    background: rgba(255, 253, 248, 0.08);
    padding: 28px;
    color: var(--paper-2);
}

.empty-state span {
    color: #f3a2bd;
    font-family: var(--font-mono);
    font-size: 0.76rem;
    font-weight: 800;
    text-transform: uppercase;
}

.empty-state h3,
.empty-state h2 {
    margin: 8px 0;
    font-family: var(--font-display);
    font-size: 2.2rem;
    line-height: 0.95;
    text-transform: uppercase;
}

.empty-state p {
    color: rgba(255, 253, 248, 0.72);
}

.stack-grid {
    margin-top: 34px;
}

.stack-group {
    min-height: 196px;
    padding: 22px;
}

.stack-group h3 {
    color: var(--ink);
}

.mosaic {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    grid-auto-rows: minmax(172px, auto);
    border: 1px solid var(--line);
    background: var(--line);
    gap: 1px;
}

.mosaic-tile {
    display: flex;
    min-height: 172px;
    flex-direction: column;
    justify-content: space-between;
    background: rgba(255, 253, 248, 0.78);
    padding: 20px;
}

.mosaic-tile:nth-child(2) {
    background: rgba(39, 125, 167, 0.12);
}

.mosaic-tile:nth-child(4) {
    background: rgba(90, 143, 111, 0.13);
}

.mosaic-tile.wide {
    grid-column: span 2;
}

.mosaic-tile.tall {
    grid-row: span 2;
}

.mosaic-tile h3 {
    margin-bottom: 0;
}

.contact-panel {
    max-width: 980px;
}

.contact-panel p {
    max-width: 620px;
    color: rgba(255, 253, 248, 0.72);
    font-size: 1.1rem;
}

.social-row {
    display: flex;
    gap: 14px;
    margin-top: 18px;
}

.social-row a {
    color: var(--paper-2);
    font-weight: 900;
}

.site-footer {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    width: min(var(--max), calc(100% - 28px));
    margin: 0 auto;
    padding: 30px 0 44px;
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 0.78rem;
}

.site-footer p {
    margin: 0;
}

.project-detail {
    padding-top: 92px;
}

.project-hero {
    margin-top: 52px;
    padding-bottom: 48px;
    border-bottom: 1px solid var(--line);
}

.project-hero p {
    max-width: 760px;
    color: var(--ink-soft);
    font-size: 1.2rem;
}

.role-pill {
    display: inline-flex;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #f7dbe5;
    padding: 8px 12px;
    color: #91304f;
    font-weight: 800;
}

.project-detail-grid {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 56px;
    padding-top: 46px;
}

.project-meta {
    position: sticky;
    top: 98px;
    align-self: start;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 253, 248, 0.86);
    padding: 22px;
}

.project-meta h2 {
    margin-bottom: 16px;
    font-size: 1.1rem;
}

.vertical,
.vertical-links {
    flex-direction: column;
    align-items: flex-start;
}

.prose {
    max-width: 780px;
    color: var(--ink-soft);
    font-size: 1.08rem;
}

.prose h1,
.prose h2,
.prose h3 {
    margin: 1.6em 0 0.45em;
    color: var(--ink);
    line-height: 1.05;
}

.prose p,
.prose ul,
.prose ol {
    margin-bottom: 1.05em;
}

.prose a {
    color: var(--rose);
    font-weight: 800;
}

.admin-page {
    background: var(--paper);
}

.admin-auth {
    display: grid;
    min-height: 70vh;
    place-items: center;
}

.admin-card,
.admin-table-wrap,
.project-form,
.danger-zone,
.admin-stats div {
    border: 1px solid var(--line);
    background: rgba(255, 253, 248, 0.9);
}

.admin-card {
    width: min(440px, 100%);
    padding: 30px;
}

.admin-card h1 {
    margin-bottom: 24px;
    font-size: 2.4rem;
    line-height: 1;
}

.admin-card label,
.project-form label {
    display: grid;
    gap: 8px;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 800;
}

.admin-card input,
.project-form input,
.project-form textarea {
    width: 100%;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: var(--paper-2);
    padding: 12px 13px;
    color: var(--ink);
    resize: vertical;
}

.form-error {
    border: 1px solid rgba(196, 59, 76, 0.25);
    border-radius: var(--radius);
    background: rgba(196, 59, 76, 0.08);
    padding: 10px 12px;
    color: #9d2635;
    font-weight: 800;
}

.form-note {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(39, 125, 167, 0.08);
    padding: 10px 12px;
    color: var(--ink-soft);
    line-height: 1.4;
}

.admin-shell {
    padding-top: 72px;
}

.admin-topbar {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: flex-start;
    margin-bottom: 28px;
}

.admin-topbar h1 {
    margin-bottom: 6px;
    font-size: clamp(2.2rem, 6vw, 5rem);
    line-height: 0.92;
}

.admin-topbar p {
    color: var(--muted);
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

.admin-stats div {
    padding: 22px;
}

.admin-stats span {
    display: block;
    font-size: 2.4rem;
    font-weight: 900;
    line-height: 1;
}

.admin-stats p {
    margin: 8px 0 0;
    color: var(--muted);
    font-weight: 800;
}

.admin-actions.inline {
    margin-top: 0;
}

.admin-table-wrap {
    margin-top: 28px;
    overflow-x: auto;
    padding: 18px;
}

.admin-table-wrap h2 {
    margin-bottom: 12px;
}

.admin-table {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    border-bottom: 1px solid var(--line);
    padding: 14px 10px;
    text-align: left;
    vertical-align: middle;
}

.admin-table th {
    color: var(--muted);
    font-size: 0.8rem;
    text-transform: uppercase;
}

.admin-table small {
    display: block;
    color: var(--muted);
}

.row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.row-actions form {
    margin: 0;
}

.mini-button {
    min-height: 34px;
    padding: 0 10px;
    font-size: 0.82rem;
}

.project-form,
.danger-zone {
    padding: 24px;
}

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

.span-2 {
    grid-column: span 2;
}

.toggle-row {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    margin-top: 20px;
}

.check-label {
    display: inline-flex !important;
    grid-template-columns: none !important;
    width: fit-content;
    align-items: center;
    gap: 10px !important;
    color: var(--ink) !important;
}

.check-label input {
    width: 18px;
    height: 18px;
    accent-color: var(--rose);
}

.danger-zone {
    margin-top: 22px;
    border-color: rgba(196, 59, 76, 0.32);
}

.danger-zone h2 {
    margin-bottom: 6px;
}

.admin-empty {
    margin-top: 24px;
}

[data-reveal] {
    opacity: 1;
    transform: none;
}

.magnetic-card {
    transition: background-color 160ms ease, box-shadow 160ms ease;
}

.magnetic-card:hover {
    box-shadow: inset 0 0 0 1px rgba(216, 70, 119, 0.26);
}

.stack-group.magnetic-card:hover {
    background: rgba(39, 125, 167, 0.08);
}

.project-card.magnetic-card:hover {
    background: rgba(255, 253, 248, 0.96);
}

@media (max-width: 960px) {
    .hero,
    .split-layout,
    .project-detail-grid {
        grid-template-columns: 1fr;
    }

    .hero {
        min-height: auto;
        padding-top: 64px;
    }

    .hero-facts {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        margin-top: 42px;
    }

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

    .section-heading {
        display: block;
    }

    .project-meta {
        position: static;
    }
}

@media (max-width: 720px) {
    .site-header {
        grid-template-columns: auto 1fr;
        width: calc(100% - 20px);
        margin-top: 10px;
    }

    .header-role {
        display: none;
    }

    .site-nav {
        justify-content: flex-end;
    }

    .site-nav a {
        padding: 9px 7px;
        font-size: 0.82rem;
    }

    .section-pad {
        width: calc(100% - 24px);
        padding: 70px 0;
    }

    .hero h1,
    .project-hero h1 {
        font-size: clamp(3rem, 11vw, 4.15rem);
    }

    .hero h1 .last-name {
        font-size: 0.78em;
        line-height: 0.94;
    }

    .project-grid,
    .stack-grid,
    .mosaic,
    .admin-stats,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .hero-facts {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        margin-top: 32px;
    }

    .hero-facts div {
        min-height: 158px;
        padding: 12px;
    }

    .hero-facts dt {
        margin-bottom: 12px;
        font-size: 0.62rem;
    }

    .hero-facts dd {
        font-size: 0.86rem;
        line-height: 1.2;
    }

    .mosaic-tile.wide,
    .mosaic-tile.tall,
    .span-2 {
        grid-column: auto;
        grid-row: auto;
    }

    .admin-topbar,
    .site-footer {
        display: block;
    }

    .admin-actions.inline {
        margin-top: 20px;
    }
}

@media (max-width: 470px) {
    .brand-mark {
        width: 42px;
        height: 42px;
    }

    .site-header {
        align-items: start;
    }

    .site-nav {
        flex-wrap: wrap;
    }

    .hero-actions,
    .contact-actions,
    .admin-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .button {
        width: 100%;
    }

}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.001ms !important;
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
    }
}
