/* ============================================================
   CharlesEZE — Archive & Digital Portfolio
   Minimal · technical · editorial. Monochrome.
   ============================================================ */

:root {
    /* palette — dark · near-black + four greys */
    --paper: #0e0e0f; /* background */
    --panel: #1a1a1c; /* raised surfaces */
    --ink: #e6e6e6; /* primary text, active states */
    --ink-2: #b9b9bb; /* body copy */
    --mute: #9a9a9a; /* secondary text, inactive nav */
    --faint: #66666a; /* tertiary / index numbers */
    --line: #2a2a2d; /* hairlines, borders */
    --line-2: #3a3a3e; /* slightly stronger borders */
    --wash: #1a1a1c; /* subtle panel / active boxed row */

    /* accent — warm amber, used sparingly for life + focus */
    --accent: #e0a06a;
    --accent-2: #f0c08a;
    --accent-soft: rgba(224, 160, 106, 0.14);
    --accent-line: rgba(224, 160, 106, 0.4);

    /* type */
    --serif: "Newsreader", Georgia, "Times New Roman", serif;
    --sans: "Hanken Grotesk", system-ui, -apple-system, sans-serif;
    --mono: "IBM Plex Mono", "SFMono-Regular", Menlo, monospace;

    /* rhythm — overridden by density */
    --base: 17px;
    --pad-x: 56px;
    --pad-y: 52px;
    --section-gap: 64px;
    --read: 760px;
    --sidebar-w: 286px;

    --t: 180ms cubic-bezier(0.4, 0, 0.2, 1);
}

[data-density="compact"] {
    --base: 15px;
    --pad-x: 40px;
    --pad-y: 36px;
    --section-gap: 44px;
    --read: 700px;
    --sidebar-w: 252px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    height: 100%;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--sans);
    font-size: var(--base);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
    opacity: 0.5;
}

#root {
    height: 100%;
}

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

a {
    color: inherit;
}

/* ---- shared atoms ---------------------------------------- */

.kicker {
    font-family: var(--mono);
    font-size: 0.7rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--mute);
    font-weight: 500;
}

.mono {
    font-family: var(--mono);
}

.h-display {
    font-family: var(--serif);
    font-weight: 420;
    letter-spacing: -0.015em;
    line-height: 1.04;
    margin: 0;
    color: var(--ink);
    text-wrap: balance;
}

.lede {
    font-family: var(--serif);
    font-size: 1.45rem;
    line-height: 1.42;
    font-weight: 400;
    color: var(--ink-2);
    margin: 0;
    text-wrap: pretty;
}

.body-copy {
    max-width: var(--read);
    color: var(--ink-2);
    text-wrap: pretty;
    font-size: 0.95rem;
}
.body-copy p {
    margin: 0 0 1.1em;
}

.rule {
    height: 1px;
    background: var(--line);
    border: 0;
    margin: 0;
}

/* ============================================================
   APP FRAME
   ============================================================ */

.app {
    height: 100%;
    display: flex;
    flex-direction: column;
    background: var(--paper);
}

/* top header bar (both directions) -------------- */
.topbar {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--pad-x);
    height: 66px;
    border-bottom: 1px solid var(--line);
    background: rgba(14, 14, 15, 0.82);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    z-index: 5;
}
.topbar .brand {
    display: flex;
    align-items: baseline;
    gap: 14px;
    min-width: 0;
}
.topbar .brand .name {
    font-family: var(--mono);
    font-size: 0.84rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--ink);
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
    transition: opacity var(--t);
}
.topbar .brand .name:hover {
    opacity: 0.78;
}
.topbar .brand .sep {
    color: var(--line-2);
}
.topbar .brand .sub {
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    color: var(--mute);
}
.topbar .status {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    color: var(--mute);
    white-space: nowrap;
}
.dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent-line);
    position: relative;
}
.dot::after {
    content: "";
    position: absolute;
    inset: -4px;
    border: 1px solid var(--accent);
    border-radius: 50%;
    opacity: 0.4;
    animation: pulse 2.4s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 0.5;
    }
    70% {
        transform: scale(1.9);
        opacity: 0;
    }
    100% {
        opacity: 0;
    }
}
@media (prefers-reduced-motion: reduce) {
    .dot::after {
        animation: none;
        opacity: 0.4;
    }
}

/* ============================================================
   DIRECTION A — ARCHIVE (sidebar)
   ============================================================ */
.archive-body {
    flex: 1 1 auto;
    display: flex;
    min-height: 0;
}

.sidebar {
    flex: 0 0 var(--sidebar-w);
    width: var(--sidebar-w);
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    background: var(--paper);
    overflow: hidden;
}

.side-nav {
    padding: 22px 0 8px;
}

.nav-item {
    display: flex;
    align-items: baseline;
    gap: 14px;
    width: 100%;
    text-align: left;
    background: none;
    border: 0;
    cursor: pointer;
    padding-top: 13px;
    padding-bottom: 13px;
    padding-right: var(--pad-x);
    padding-left: 28px;
    color: var(--mute);
    transition:
        color var(--t),
        background var(--t),
        transform var(--t);
    position: relative;
    font-family: var(--sans);
}
.nav-item .n-index {
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.05em;
    color: var(--faint);
    transition: color var(--t);
}
.nav-item .n-label {
    font-size: 1.02rem;
    font-weight: 500;
    letter-spacing: -0.01em;
}
.nav-item::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    width: 0;
    height: 2px;
    background: var(--accent);
    border-radius: 1px;
    transform: translateY(-50%);
    transition: width var(--t);
}
.nav-item:hover {
    color: var(--ink);
    transform: translateX(6px);
}
.nav-item:hover .n-index {
    color: var(--mute);
}
.nav-item:hover::before {
    width: 16px;
}

.nav-item.active {
    color: var(--ink);
    transform: translateX(8px);
}
.nav-item.active .n-index {
    color: var(--accent);
}
.nav-item.active::before {
    width: 18px;
}

/* sidebar style: numbered (default) adds separators */
[data-sidebar="numbered"] .nav-item:not(:last-child)::after {
    content: "";
    position: absolute;
    left: 28px;
    right: var(--pad-x);
    bottom: 0;
    height: 1px;
    background: var(--line);
}

/* sidebar style: minimal — no numbers, lighter */
[data-sidebar="minimal"] .nav-item .n-index {
    display: none;
}
[data-sidebar="minimal"] .nav-item {
    padding-top: 9px;
    padding-bottom: 9px;
}

/* sidebar style: boxed — architectural, ruled blocks */
[data-sidebar="boxed"] .side-nav {
    padding-top: 0;
}
[data-sidebar="boxed"] .nav-item {
    border-top: 1px solid var(--line);
    padding-top: 20px;
    padding-bottom: 20px;
}
[data-sidebar="boxed"] .nav-item .n-label {
    font-size: 1.12rem;
}
[data-sidebar="boxed"] .nav-item.active {
    background: var(--wash);
}

.side-meta {
    margin-top: auto;
    border-top: 1px solid var(--line);
    padding: 22px 28px 24px;
    display: flex;
    flex-direction: column;
    gap: 11px;
}
.side-meta .row {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.side-meta .row .k {
    font-family: var(--mono);
    font-size: 0.64rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--faint);
}
.side-meta .row .v {
    font-size: 0.84rem;
    color: var(--ink-2);
}

.archive-main {
    flex: 1 1 auto;
    overflow-y: auto;
    min-width: 0;
}
.archive-main .stage {
    padding: var(--pad-y) var(--pad-x) calc(var(--pad-y) * 1.6);
    max-width: 980px;
}

/* ============================================================
   DIRECTION B — EDITORIAL (top-nav, centered)
   ============================================================ */
.editorial-body {
    flex: 1 1 auto;
    overflow-y: auto;
    min-height: 0;
}
.edi-nav {
    display: flex;
    justify-content: center;
    gap: 30px;
    padding: 20px var(--pad-x);
    border-bottom: 1px solid var(--line);
    background: rgba(14, 14, 15, 0.82);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    position: sticky;
    top: 0;
    z-index: 4;
    flex-wrap: wrap;
}
.edi-nav .nav-link {
    background: none;
    border: 0;
    cursor: pointer;
    font-family: var(--mono);
    font-size: 0.74rem;
    letter-spacing: 0.06em;
    color: var(--mute);
    padding: 4px 0;
    position: relative;
    transition: color var(--t);
    display: inline-flex;
    align-items: baseline;
    gap: 7px;
}
.edi-nav .nav-link .ni {
    color: var(--faint);
    font-size: 0.66rem;
}
.edi-nav .nav-link::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -2px;
    height: 2px;
    background: var(--accent);
    border-radius: 1px;
    transform: scaleX(0);
    transition: transform var(--t);
    transform-origin: left;
}
.edi-nav .nav-link.active .ni {
    color: var(--accent);
}
.edi-nav .nav-link:hover {
    color: var(--ink);
}
.edi-nav .nav-link.active {
    color: var(--ink);
}
.edi-nav .nav-link.active::after {
    transform: scaleX(1);
}

.edi-stage {
    max-width: var(--read);
    margin: 0 auto;
    padding: calc(var(--pad-y) * 1.3) var(--pad-x) calc(var(--pad-y) * 2);
}
.edi-stage .section-head {
    text-align: center;
}
.edi-stage .section-head .kicker {
    display: block;
}

/* ============================================================
   SECTION CONTENT (shared)
   ============================================================ */
.section {
    animation: rise 320ms cubic-bezier(0.22, 0.61, 0.36, 1) both;
}
@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.section-head {
    margin-bottom: var(--section-gap);
}
.section-head .kicker {
    margin-bottom: 18px;
}
.section-head .h-display {
    font-size: clamp(2.6rem, 5vw, 4rem);
}
.edi-stage .section-head .h-display {
    font-size: clamp(2.4rem, 4.5vw, 3.6rem);
}

/* about */
.archive-main .stage:has(.about-grid),
.edi-stage:has(.about-grid) {
    padding-top: 24px;
    padding-bottom: 32px;
}
.about-grid .h-display {
    margin-bottom: 28px;
    font-size: clamp(1.4rem, 4.5vw, 3.4rem);
}
.edi-stage .about-grid .h-display {
    font-size: clamp(1.2rem, 3.5vw, 2.2rem);
}
.about-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 48px;
    align-items: start;
}
.edi-stage .about-grid {
    grid-template-columns: 1fr;
}
.about-lede {
    margin-bottom: 28px;
}
.fact-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.fact-list .fact {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 13px 0;
    border-top: 1px solid var(--line);
    transition: background var(--t);
}
.fact-list .fact:hover {
    background: rgba(255, 255, 255, 0.015);
}
.fact-list .fact:last-child {
    border-bottom: 1px solid var(--line);
}
.fact-list .fact .k {
    font-family: var(--mono);
    font-size: 0.64rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--faint);
}
.fact-list .fact .v {
    font-size: 0.95rem;
    color: var(--ink);
}

.portrait {
    width: 100%;
    aspect-ratio: 4 / 5;
    border: 1px solid var(--line);
    max-height: 42vh;
}

/* filled image (portrait, etc.) */
.ph.has-img {
    background: none;
}
.ph.has-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
}
.ph.has-img::after {
    content: "";
}

/* image placeholder — subtle dot-grid pattern */
.ph {
    background-color: var(--wash);
    background-image: radial-gradient(
        circle,
        rgba(255, 255, 255, 0.06) 1px,
        transparent 1px
    );
    background-size: 16px 16px;
    display: flex;
    align-items: flex-end;
    position: relative;
    overflow: hidden;
}
.ph::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        transparent 60%,
        rgba(0, 0, 0, 0.25) 100%
    );
    pointer-events: none;
}
.ph .ph-tag {
    font-family: var(--mono);
    font-size: 0.62rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--mute);
    background: var(--paper);
    border: 1px solid var(--line);
    padding: 4px 8px;
    margin: 10px;
    position: relative;
    z-index: 1;
}

/* experience timeline */
/* timeline */
.timeline {
    display: flex;
    flex-direction: column;
}
.tl-row {
    display: grid;
    grid-template-columns: 168px 1fr;
    gap: 32px;
    padding: 26px 0;
    border-top: 1px solid var(--line);
    transition:
        background var(--t),
        padding var(--t);
}
.tl-row:hover {
    background: rgba(255, 255, 255, 0.015);
}
.tl-row:last-child {
    border-bottom: 1px solid var(--line);
}
.edi-stage .tl-row {
    grid-template-columns: 1fr;
    gap: 8px;
    text-align: left;
}
.tl-row .period {
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    color: var(--mute);
    padding-top: 4px;
}
.tl-row .tl-role {
    font-family: var(--serif);
    font-size: 1.5rem;
    font-weight: 440;
    line-height: 1.15;
    color: var(--ink);
    margin: 0 0 2px;
}
.tl-row .tl-org {
    font-size: 0.9rem;
    color: var(--mute);
    margin: 0 0 10px;
}
.tl-row .tl-detail {
    color: var(--ink-2);
    max-width: 56ch;
    margin: 0;
}

/* services */
.services {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}
.edi-stage .services {
    grid-template-columns: 1fr;
}
.svc {
    padding: 30px 36px 34px 0;
    border-top: 1px solid var(--line);
    transition: background var(--t);
}
.svc:hover {
    background: rgba(255, 255, 255, 0.015);
}
.services .svc:nth-child(odd) {
    padding-right: 36px;
}
.services .svc:nth-child(even) {
    padding-left: 36px;
    padding-right: 0;
    border-left: 1px solid var(--line);
}
.edi-stage .services .svc:nth-child(even) {
    padding-left: 0;
    border-left: 0;
}
.svc .svc-no {
    font-family: var(--mono);
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    color: var(--faint);
    margin-bottom: 14px;
}
.svc .svc-title {
    font-family: var(--serif);
    font-size: 1.5rem;
    font-weight: 440;
    margin: 0 0 10px;
    color: var(--ink);
}
.svc .svc-body {
    color: var(--ink-2);
    margin: 0;
    max-width: 44ch;
}

/* projects */
.projects {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px 40px;
}
.edi-stage .projects {
    grid-template-columns: 1fr;
    gap: 48px;
}
.project {
    cursor: pointer;
    display: block;
    text-decoration: none;
}
.project .p-img {
    width: 100%;
    aspect-ratio: 16 / 10;
    border: 1px solid var(--line);
    margin-bottom: 16px;
    transition:
        border-color var(--t),
        box-shadow var(--t),
        transform var(--t);
}
.project:hover .p-img {
    border-color: var(--accent-line);
    box-shadow:
        0 8px 30px rgba(0, 0, 0, 0.4),
        0 0 0 1px var(--accent-soft);
    transform: translateY(-3px);
}
.project:hover .p-title {
    color: var(--ink);
}
.project .p-meta {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
}
.project .p-title {
    font-family: var(--serif);
    font-size: 1.4rem;
    font-weight: 440;
    color: var(--ink-2);
    margin: 0;
    transition: color var(--t);
}
.project:hover .p-title {
    color: var(--ink);
}
.project .p-year {
    font-family: var(--mono);
    font-size: 0.72rem;
    color: var(--mute);
}
.project .p-tag {
    font-family: var(--mono);
    font-size: 0.66rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--faint);
    margin-bottom: 8px;
}
.project .p-blurb {
    color: var(--ink-2);
    margin: 0;
    max-width: 46ch;
}
.project .p-link {
    display: inline-block;
    margin-top: 12px;
    font-family: var(--mono);
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--accent);
    transition: color var(--t);
}
.project.is-live:hover .p-link {
    color: var(--ink);
}

/* writing */
.writing {
    display: flex;
    flex-direction: column;
}
.post {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 20px 32px;
    align-items: baseline;
    padding: 24px 0;
    border-top: 1px solid var(--line);
    cursor: pointer;
    text-decoration: none;
    transition:
        padding var(--t),
        background var(--t);
}
.writing .post:last-child {
    border-bottom: 1px solid var(--line);
}
.post {
    position: relative;
}
.post::before {
    content: "";
    position: absolute;
    left: 0;
    top: 14px;
    bottom: 14px;
    width: 2px;
    background: var(--accent);
    border-radius: 1px;
    transform: scaleY(0);
    transform-origin: top;
    transition: transform var(--t);
}
.post:hover::before {
    transform: scaleY(1);
}
.post:hover {
    padding-left: 16px;
    background: rgba(255, 255, 255, 0.015);
}
.post:hover .post-title {
    color: var(--accent-2);
}
.post .post-title {
    font-family: var(--serif);
    font-size: 1.35rem;
    font-weight: 440;
    line-height: 1.2;
    color: var(--ink);
    margin: 0 0 8px;
    transition: color var(--t);
}
.post .post-blurb {
    color: var(--ink-2);
    margin: 0;
    max-width: 60ch;
}
.post .post-meta {
    font-family: var(--mono);
    font-size: 0.7rem;
    letter-spacing: 0.03em;
    color: var(--mute);
    white-space: nowrap;
    text-align: right;
}
.edi-stage .post {
    text-align: left;
}

/* contact */
.archive-main .stage:has(.contact-email),
.edi-stage:has(.contact-email) {
    padding-top: 24px;
    padding-bottom: 36px;
}
.section:has(.contact-email) .section-head {
    margin-bottom: 28px;
}
.section:has(.contact-email) .section-head .h-display {
    font-size: clamp(2rem, 4vw, 3rem);
}
.section:has(.contact-email) .stage-foot {
    margin-top: 28px;
}
.contact-lede {
    margin-bottom: 20px;
    font-size: 1.2rem;
}
.contact-links .clink {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 12px 0;
    border-top: 1px solid var(--line);
    text-decoration: none;
    transition:
        padding var(--t),
        background var(--t);
}
.contact-links .clink:hover {
    padding-left: 12px;
    background: rgba(255, 255, 255, 0.015);
}
.contact-email {
    font-family: var(--serif);
    font-size: clamp(1.4rem, 3vw, 2.2rem);
    font-weight: 420;
    color: var(--ink);
    text-decoration: none;
    border-bottom: 1px solid var(--line-2);
    padding-bottom: 4px;
    transition: border-color var(--t);
    display: inline-block;
    margin-bottom: 28px;
}
.contact-email:hover {
    border-color: var(--accent);
    color: var(--accent-2);
}
.contact-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    max-width: 540px;
}
.edi-stage .contact-links {
    margin: 0 auto;
}
.contact-links .clink .k {
    font-family: var(--mono);
    font-size: 0.64rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--faint);
}
.contact-links .clink .v {
    font-size: 0.98rem;
    color: var(--ink);
}

/* ---- contact form layout ---- */
.contact-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 56px;
    align-items: start;
}
.edi-stage .contact-grid {
    grid-template-columns: 1fr;
    gap: 40px;
}
.contact-aside .contact-lede {
    margin-bottom: 24px;
}
.contact-aside .contact-links {
    grid-template-columns: 1fr;
    max-width: none;
}
.contact-or {
    display: block;
    font-family: var(--mono);
    font-size: 0.64rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--faint);
    margin-bottom: 12px;
}

/* form fields */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.field-k {
    font-family: var(--mono);
    font-size: 0.64rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--mute);
}
.contact-form input,
.contact-form select,
.contact-form textarea {
    font-family: var(--sans);
    font-size: 0.95rem;
    color: var(--ink);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--line);
    border-radius: 2px;
    padding: 12px 14px;
    width: 100%;
    transition:
        border-color var(--t),
        background var(--t),
        box-shadow var(--t);
    -webkit-appearance: none;
    appearance: none;
}
.contact-form textarea {
    resize: vertical;
    min-height: 120px;
    line-height: 1.5;
}
.contact-form select {
    cursor: pointer;
    background-image: linear-gradient(45deg, transparent 50%, var(--mute) 50%),
        linear-gradient(135deg, var(--mute) 50%, transparent 50%);
    background-position:
        calc(100% - 18px) 50%,
        calc(100% - 13px) 50%;
    background-size:
        5px 5px,
        5px 5px;
    background-repeat: no-repeat;
}
.contact-form select:invalid {
    color: var(--mute);
}
.contact-form input::placeholder,
.contact-form textarea::placeholder {
    color: var(--faint);
}
.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--accent-line);
    background: rgba(255, 255, 255, 0.03);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

/* submit button */
.form-submit {
    align-self: flex-start;
    appearance: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: var(--ink);
    border: 1px solid var(--ink);
    color: var(--paper);
    font-family: var(--mono);
    font-size: 0.76rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 13px 26px;
    border-radius: 2px;
    transition: all 240ms cubic-bezier(0.4, 0, 0.2, 1);
}
.form-submit:hover:not(:disabled) {
    background: var(--accent);
    border-color: var(--accent);
}
.form-submit:hover:not(:disabled) .form-arrow {
    transform: translateX(5px);
}
.form-submit:active:not(:disabled) {
    transform: scale(0.98);
}
.form-submit:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}
.form-arrow {
    transition: transform 240ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* notices + success */
.form-notice {
    font-size: 0.85rem;
    color: var(--mute);
    margin: 0;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-left: 2px solid var(--accent);
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.015);
}
.form-notice-error {
    border-left-color: #e0746a;
}
.form-done {
    border: 1px solid var(--line);
    border-radius: 3px;
    padding: 40px 32px;
    text-align: center;
    animation: rise 320ms cubic-bezier(0.22, 0.61, 0.36, 1) both;
}
.form-done-mark {
    width: 46px;
    height: 46px;
    margin: 0 auto 18px;
    border-radius: 50%;
    border: 1px solid var(--accent-line);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    background: var(--accent-soft);
}
.form-done h3 {
    font-family: var(--serif);
    font-size: 1.5rem;
    font-weight: 440;
    color: var(--ink);
    margin: 0 0 10px;
}
.form-done p {
    color: var(--ink-2);
    max-width: 42ch;
    margin: 0 auto 22px;
}
.form-reset {
    appearance: none;
    cursor: pointer;
    background: none;
    border: 1px solid var(--line-2);
    color: var(--ink);
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 10px 20px;
    border-radius: 2px;
    transition: border-color var(--t);
}
.form-reset:hover {
    border-color: var(--accent-line);
}

/* footer line inside stage */
.stage-foot {
    margin-top: var(--section-gap);
    padding-top: 20px;
    border-top: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    font-family: var(--mono);
    font-size: 0.68rem;
    letter-spacing: 0.04em;
    color: var(--faint);
    flex-wrap: wrap;
}
.foot-legal {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}
.foot-legal a {
    color: var(--mute);
    text-decoration: none;
    transition: color var(--t);
}
.foot-legal a:hover {
    color: var(--accent-2);
}
.foot-legal .foot-sep {
    color: var(--line-2);
}

/* ---- legal pages (privacy / terms) ---- */
.legal .legal-title {
    font-size: clamp(2.2rem, 4vw, 3.2rem);
    margin-bottom: 14px;
}
.legal .legal-updated {
    font-family: var(--mono);
    font-size: 0.68rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--faint);
    margin: 0 0 28px;
}
.legal .legal-intro {
    max-width: var(--read);
    margin-bottom: 8px;
}
.legal .legal-body {
    max-width: var(--read);
    counter-reset: legal;
}
.legal .legal-block {
    padding: 26px 0;
    border-top: 1px solid var(--line);
}
.legal .legal-block:first-child {
    margin-top: 20px;
}
.legal .legal-h {
    counter-increment: legal;
    font-family: var(--serif);
    font-size: 1.3rem;
    font-weight: 440;
    color: var(--ink);
    margin: 0 0 12px;
    display: flex;
    align-items: baseline;
    gap: 14px;
}
.legal .legal-h::before {
    content: counter(legal, decimal-leading-zero);
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    color: var(--accent);
    font-weight: 500;
}
.legal .legal-block p {
    color: var(--ink-2);
    margin: 0 0 0.9em;
    text-wrap: pretty;
}
.legal .legal-block p:last-child {
    margin-bottom: 0;
}
.edi-stage .legal .legal-title,
.edi-stage .legal .legal-h {
    text-align: left;
}

/* ============================================================
   FRONT COVER (standalone landing)
   ============================================================ */
/* cover */
.cover {
    height: 100%;
    background: var(--paper);
    background-image:
        radial-gradient(
            120% 80% at 50% -10%,
            rgba(224, 160, 106, 0.07),
            transparent 55%
        ),
        radial-gradient(circle, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
    background-size:
        100% 100%,
        24px 24px;
    display: flex;
    overflow: hidden;
}
.cover-frame {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 24px;
    margin: 16px;
    padding: clamp(20px, 4vw, 44px);
    border: 1px solid var(--line);
    min-height: 0;
    animation: coverRise 680ms cubic-bezier(0.22, 0.61, 0.36, 1) both;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.03),
        0 0 60px rgba(0, 0, 0, 0.4);
}
@keyframes coverRise {
    from {
        opacity: 0;
        transform: translateY(24px) scale(0.985);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* top rule */
.cover-top {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    padding: 12px 20px;
    background: linear-gradient(180deg, #181719, #141315);
    border: 1px solid var(--line);
}
.cover-top span:first-child {
    color: var(--accent);
}
.cover-top span:last-child {
    color: var(--faint);
}

/* center block */
.cover-center {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0;
}
.cover-kicker {
    margin-bottom: 16px;
    color: var(--mute);
    animation: rise 480ms cubic-bezier(0.22, 0.61, 0.36, 1) both;
}
.cover-name {
    font-family: var(--serif);
    font-weight: 420;
    line-height: 1;
    letter-spacing: -0.025em;
    margin: 0;
    color: var(--ink);
    white-space: nowrap;
    animation: nameReveal 800ms cubic-bezier(0.22, 0.61, 0.36, 1) 200ms both;
}
@keyframes nameReveal {
    from {
        opacity: 0;
        transform: translateY(12px);
        filter: blur(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}
.cover-name .cover-name-1,
.cover-name .cover-name-2 {
    font-size: clamp(2.8rem, 9vw, 7.5rem);
}
.cover-name .cover-name-1 {
    color: var(--ink);
}
.cover-name .cover-name-2 {
    color: var(--mute);
    text-transform: uppercase;
}
.cover-tagline {
    font-family: var(--serif);
    font-weight: 400;
    font-size: clamp(1.2rem, 2.4vw, 1.9rem);
    line-height: 1.4;
    color: var(--ink-2);
    max-width: 30ch;
    margin: clamp(16px, 2.5vw, 28px) 0 0;
    text-wrap: pretty;
    animation: rise 560ms cubic-bezier(0.22, 0.61, 0.36, 1) 400ms both;
}

/* bottom block */
.cover-bottom {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 32px;
    flex-wrap: wrap;
    padding: 22px;
    background: linear-gradient(180deg, #181719, #141315);
    border: 1px solid var(--line);
}
.cover-meta {
    display: flex;
    gap: 0;
    flex-wrap: wrap;
}
.cover-meta .cm {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-right: 32px;
}
.cover-meta .cm + .cm {
    padding-left: 32px;
    border-left: 1px solid var(--line);
}
.cover-meta .cm .k {
    font-family: var(--mono);
    font-size: 0.62rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--faint);
}
.cover-meta .cm .v {
    font-size: 0.92rem;
    color: var(--ink-2);
}

/* enter button */
.cover-enter {
    appearance: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--line-2);
    color: var(--ink);
    font-family: var(--mono);
    font-size: 0.78rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    padding: 14px 26px;
    transition: all 280ms cubic-bezier(0.4, 0, 0.2, 1);
}
.cover-enter:hover {
    background: var(--accent-soft);
    border-color: var(--accent-line);
    color: var(--accent-2);
    box-shadow:
        0 0 0 1px var(--accent-soft),
        0 0 36px rgba(224, 160, 106, 0.1);
}
.cover-enter:hover .cover-arrow {
    color: var(--accent-2);
}
.cover-enter:active {
    transform: scale(0.98);
}
.cover-enter .cover-arrow {
    transition: transform 280ms cubic-bezier(0.4, 0, 0.2, 1);
}
.cover-enter:hover .cover-arrow {
    transform: translateX(6px);
}

/* ---- scrollbar (dark theme) ---- */
.archive-main::-webkit-scrollbar,
.editorial-body::-webkit-scrollbar {
    width: 6px;
}
.archive-main::-webkit-scrollbar-track,
.editorial-body::-webkit-scrollbar-track {
    background: transparent;
}
.archive-main::-webkit-scrollbar-thumb,
.editorial-body::-webkit-scrollbar-thumb {
    background: var(--line);
    border-radius: 3px;
}
.archive-main::-webkit-scrollbar-thumb:hover,
.editorial-body::-webkit-scrollbar-thumb:hover {
    background: var(--line-2);
}

/* ---- focus-visible (accessibility) ---- */
.nav-item:focus-visible,
.nav-link:focus-visible,
.cover-enter:focus-visible,
.project:focus-visible,
.post:focus-visible,
.contact-email:focus-visible,
.clink:focus-visible {
    outline: 2px solid var(--ink);
    outline-offset: 2px;
    border-radius: 2px;
}

/* responsive */
@media (max-width: 920px) {
    .about-grid,
    .services,
    .projects {
        grid-template-columns: 1fr;
    }
    .services .svc:nth-child(even) {
        padding-left: 0;
        border-left: 0;
    }
    .tl-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .projects {
        gap: 36px;
    }
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
}

@media (max-width: 560px) {
    .field-row {
        grid-template-columns: 1fr;
    }
}

/* tablet / small laptop — narrow the sidebar before collapsing */
@media (max-width: 860px) {
    :root {
        --sidebar-w: 230px;
        --pad-x: 36px;
    }
}

/* mobile — collapse Archive sidebar into a scrollable top nav bar */
@media (max-width: 720px) {
    :root {
        --pad-x: 22px;
    }

    .topbar {
        height: 58px;
    }
    .topbar .brand .sub {
        display: none;
    }

    .archive-body {
        flex-direction: column;
    }
    .sidebar {
        flex: 0 0 auto;
        width: 100%;
        border-right: 0;
        border-bottom: 1px solid var(--line);
        position: sticky;
        top: 0;
        z-index: 4;
        background: rgba(14, 14, 15, 0.9);
        backdrop-filter: blur(18px);
        -webkit-backdrop-filter: blur(18px);
    }
    .side-nav {
        display: flex;
        gap: 4px;
        padding: 0 var(--pad-x);
        overflow-x: auto;
        scrollbar-width: none;
        scroll-snap-type: x proximity;
    }
    .side-nav::-webkit-scrollbar {
        display: none;
    }
    .nav-item {
        width: auto;
        flex: 0 0 auto;
        padding: 16px 4px !important;
        border-top: 0 !important;
        scroll-snap-align: start;
    }
    /* horizontal layout kills the translateX hover + side rules */
    .nav-item:hover,
    .nav-item.active {
        transform: none;
    }
    .nav-item::before {
        top: auto;
        bottom: 0;
        transform: none;
        height: 2px;
    }
    .nav-item:hover::before,
    .nav-item.active::before {
        width: 100%;
    }
    [data-sidebar="numbered"] .nav-item:not(:last-child)::after,
    [data-sidebar="minimal"] .nav-item .n-index {
        display: none;
    }
    .nav-item .n-index {
        display: none;
    }
    [data-sidebar="boxed"] .nav-item.active {
        background: none;
    }
    .side-meta {
        display: none;
    }

    .cover-frame {
        margin: 10px;
    }
    .cover-name {
        white-space: normal;
    }
    .cover-bottom {
        align-items: flex-start;
        flex-direction: column;
    }
    .cover-enter {
        width: 100%;
        justify-content: center;
    }
}

/* small phones */
@media (max-width: 440px) {
    :root {
        --pad-x: 16px;
    }
    .topbar .status span:last-child {
        display: none;
    }
    .cover-meta .cm {
        padding-right: 20px;
    }
    .cover-meta .cm + .cm {
        padding-left: 20px;
    }
    .contact-links {
        grid-template-columns: 1fr;
    }
    .stage-foot {
        font-size: 0.62rem;
    }
}
