/* ==================================================================
   site.css — new layout and design layer
   Loaded AFTER style.css. Your original stylesheet is untouched.
   Everything here overrides it by load order, not by !important
   hacks, so it stays readable.
   ================================================================== */

:root {
    /* Palette sampled from your own research materials.
       --navy is the exact blue of your "Why backbone in space"
       diagram (#203864). --amber matches the satellite markers in
       your visualisation. Nothing here is invented. */
    --navy:        #203864;
    --navy-deep:   #16264a;
    --navy-ink:    #0d1830;
    --amber:       #d9962b;
    --paper:       #f3f4f5;
    --surface:     #ffffff;
    --grey:        #d9d9d9;
    --rule:        #ccd0d6;
    --ink:         #17202e;
    --ink-soft:    #515c6b;
    --ink-faint:   #7c8794;

    /* placeholder styling */
    --ph-line:     #b9a878;
    --ph-bg:       #faf5e6;
    --ph-ink:      #7d6b3c;

    --measure: 66ch;
}

/* ---------- reset-ish ---------- */

html, body {
    height: auto;
    min-height: 100%;
    background: var(--paper);
    color: var(--ink);
    font-family: "IBM Plex Sans", "Segoe UI", Calibri, system-ui, sans-serif;
    font-size: 17px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

#main-container {
    height: auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1, h2, h3, .display {
    font-family: Newsreader, "Iowan Old Style", Georgia, serif;
    font-weight: 500;
    letter-spacing: -0.011em;
    color: var(--ink);
}

img { max-width: 100%; }

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

.wrap {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 2rem;
}


/* ==================================================================
   NAVBAR
   ================================================================== */

.navbar.my-navbar {
    background: var(--navy-ink) !important;
    border-bottom: 1px solid #ffffff1f;
    padding: 0.35rem 0;
    position: sticky;
    top: 0;
    z-index: 50;
}

.my-navbar .navbar-brand {
    font-family: Newsreader, Georgia, serif;
    color: #fff;
    letter-spacing: -0.015em;
}

.my-navbar .navbar-brand b { font-weight: 600; }

.my-navbar .my-nav-link {
    color: #c9d2e0;
    font-size: 0.95rem;
    padding: 0.5rem 0.15rem;
    transition: color 0.14s ease;
}

.my-navbar .my-nav-link:hover { color: #fff; }

.nav-tab { margin-left: 1.6rem; }

.nav-tab.is-active {
    border-bottom: 2px solid var(--amber);
}

.nav-tab.is-active .my-nav-link {
    color: #fff;
    cursor: default;
}

.navbar-toggler {
    border-color: #ffffff40;
    padding: 0.25rem 0.5rem;
}

.navbar-toggler-icon {
    filter: invert(1) brightness(1.6);
}


/* ==================================================================
   HERO — the one place the design is loud
   ================================================================== */

#hero {
    background:
        radial-gradient(120% 130% at 78% 40%, #2c4a80 0%, var(--navy-deep) 46%, var(--navy-ink) 100%);
    color: #fff;
    padding: 4.5rem 0 4rem;
    border-bottom: 1px solid var(--navy-ink);
}

#hero .wrap {
    display: grid;
    grid-template-columns: minmax(0, 1.02fr) minmax(0, 0.98fr);
    gap: 3.5rem;
    align-items: center;
}

#hero h1 {
    color: #fff;
    font-size: clamp(2.1rem, 3.7vw, 3.15rem);
    line-height: 1.13;
    margin: 0 0 1.4rem;
    max-width: 15ch;
    font-weight: 400;
}

.hero-lede {
    color: #d3dcea;
    font-size: 1.06rem;
    line-height: 1.72;
    margin: 0 0 1.25rem;
    max-width: 54ch;
}

.hero-who {
    color: #9fb0c8;
    font-size: 0.98rem;
    line-height: 1.7;
    margin: 0;
    max-width: 54ch;
    padding-top: 1.1rem;
    border-top: 1px solid #ffffff26;
}

.hero-who strong { color: #e6ecf5; font-weight: 600; }

.hero-figure {
    margin: 0;
    border: 1px solid #ffffff2e;
    border-radius: 3px;
    overflow: hidden;
    background: #000;
    box-shadow: 0 18px 50px -18px rgba(0, 0, 0, 0.75);
}

.hero-figure img { display: block; width: 100%; }

.hero-figure figcaption {
    font-size: 0.79rem;
    color: #a7b6cb;
    padding: 0.6rem 0.85rem;
    background: #ffffff0d;
    border-top: 1px solid #ffffff1f;
    line-height: 1.5;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    margin-top: 1.9rem;
}


/* ---------- buttons ---------- */

.btn-solid,
.btn-ghost,
.btn-quiet {
    display: inline-block;
    font-size: 0.93rem;
    font-weight: 600;
    padding: 0.62rem 1.15rem;
    border-radius: 2px;
    border: 1px solid transparent;
    text-decoration: none;
    transition: background 0.14s ease, color 0.14s ease, border-color 0.14s ease;
    cursor: pointer;
}

.btn-solid {
    background: var(--amber);
    color: #241a05;
    border-color: var(--amber);
}
.btn-solid:hover { background: #eaa63c; color: #241a05; }

.btn-ghost {
    background: transparent;
    color: #e3e9f2;
    border-color: #ffffff59;
}
.btn-ghost:hover { background: #ffffff17; color: #fff; }

.btn-quiet {
    background: transparent;
    color: var(--navy);
    border-color: var(--rule);
}
.btn-quiet:hover { background: var(--navy); color: #fff; border-color: var(--navy); }


/* ==================================================================
   FACTS BAND
   ================================================================== */

#facts {
    background: var(--surface);
    border-bottom: 1px solid var(--rule);
    padding: 2.6rem 0;
}

.fact-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
}

.fact {
    padding: 0 1.6rem;
    border-left: 1px solid var(--rule);
}
.fact:first-child { padding-left: 0; border-left: 0; }

.fact-n {
    font-family: Newsreader, Georgia, serif;
    font-size: 2.4rem;
    line-height: 1;
    color: var(--navy);
    font-weight: 400;
    font-variant-numeric: lining-nums tabular-nums;
}

.fact-l {
    font-size: 0.9rem;
    color: var(--ink-soft);
    line-height: 1.5;
    margin-top: 0.55rem;
}


/* ==================================================================
   GENERIC SECTION RHYTHM
   ================================================================== */

.band { padding: 4.2rem 0; }
.band-tint { background: var(--surface); border-block: 1px solid var(--rule); }

.band-head { margin-bottom: 2.4rem; max-width: var(--measure); }

.band-head h2 {
    font-size: clamp(1.6rem, 2.6vw, 2.1rem);
    margin: 0 0 0.6rem;
    line-height: 1.2;
}

.band-head p {
    color: var(--ink-soft);
    margin: 0;
    font-size: 1.02rem;
}


/* ==================================================================
   WORK ENTRIES — hierarchy is deliberate.
   The FAROS entry is large. The others are lighter. They are not
   three identical cards, because they are not three equal things.
   ================================================================== */

.entry-lead {
    display: grid;
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
    gap: 2.6rem;
    align-items: start;
    background: var(--surface);
    border: 1px solid var(--rule);
    border-top: 3px solid var(--navy);
    padding: 2.2rem;
}

.entry-lead h3 {
    font-size: 1.55rem;
    margin: 0 0 0.85rem;
    line-height: 1.25;
}

.entry-lead p { color: var(--ink-soft); margin: 0 0 0.9rem; }

.entry-media { margin: 0; }
.entry-media img {
    display: block;
    width: 100%;
    border: 1px solid var(--rule);
    background: #000;
}
.entry-media figcaption {
    font-size: 0.8rem;
    color: var(--ink-faint);
    margin-top: 0.55rem;
    line-height: 1.5;
}

.entry-pair {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.entry {
    background: var(--surface);
    border: 1px solid var(--rule);
    padding: 1.6rem 1.7rem;
    display: flex;
    flex-direction: column;
}

.entry h3 { font-size: 1.2rem; margin: 0 0 0.6rem; }
.entry p { color: var(--ink-soft); margin: 0 0 1rem; font-size: 0.98rem; }
.entry .btn-quiet { align-self: flex-start; margin-top: auto; }

.spec {
    list-style: none;
    padding: 0;
    margin: 0 0 1.25rem;
    border-top: 1px solid var(--rule);
}

.spec li {
    display: grid;
    grid-template-columns: 11.5rem 1fr;
    gap: 1rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--rule);
    font-size: 0.94rem;
    align-items: baseline;
}

.spec dt, .spec .k {
    color: var(--ink-faint);
    font-size: 0.86rem;
}

.spec .v { color: var(--ink); }


/* ==================================================================
   STORY
   ================================================================== */

#story .wrap {
    display: grid;
    grid-template-columns: 210px minmax(0, 1fr);
    gap: 3rem;
    align-items: start;
}

.portrait {
    margin: 0;
    border: 1px solid var(--rule);
    background: var(--surface);
    padding: 0.5rem;
}
.portrait img { display: block; width: 100%; }

#story h2 { font-size: 1.75rem; margin: 0 0 1.1rem; }

#bio-description {
    margin-top: 0;
    line-height: 1.78;
    font-size: 1.03rem;
    color: var(--ink-soft);
    max-width: var(--measure);
}
#bio-description p { margin-bottom: 1.1rem; }


/* ==================================================================
   CLOSING CTA
   ================================================================== */

#closing {
    background: var(--navy-ink);
    color: #fff;
    padding: 3.4rem 0;
}
#closing h2 { color: #fff; font-size: 1.8rem; margin: 0 0 0.7rem; }
#closing p { color: #b6c3d6; margin: 0 0 1.6rem; max-width: 52ch; }
#closing .hero-actions { margin-top: 0; }


/* ==================================================================
   PROJECTS PAGE
   ================================================================== */

#projects-page { height: auto; overflow: visible; }

.page-head {
    background: var(--navy-ink);
    color: #fff;
    padding: 3rem 0 2.6rem;
}
.page-head h1 { color: #fff; font-size: 2.3rem; margin: 0 0 0.6rem; }
.page-head p { color: #b6c3d6; margin: 0; max-width: 58ch; }

.section-head {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    border-bottom: 2px solid var(--navy);
    padding-bottom: 0.6rem;
    margin-bottom: 2rem;
}
.section-head h2 { font-size: 1.65rem; margin: 0; }
.section-head span { color: var(--ink-faint); font-size: 0.92rem; }

.proj {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: 2rem;
    background: var(--surface);
    border: 1px solid var(--rule);
    padding: 1.6rem;
    margin-bottom: 1.5rem;
    align-items: start;
}

.proj-media { margin: 0; }
.proj-media img { display: block; width: 100%; border: 1px solid var(--rule); }

.proj h3 { font-size: 1.3rem; margin: 0 0 0.7rem; line-height: 1.28; }
.proj p { color: var(--ink-soft); margin: 0 0 0.9rem; font-size: 0.98rem; }

.proj-links { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.1rem; }
.proj-links:empty { display: none; }

/* Space work reads as primary; software as secondary. */
#space-research .proj { border-left: 3px solid var(--navy); }
#software .proj { background: #fbfbfc; }


/* ==================================================================
   PLACEHOLDERS
   Deliberately loud so unfinished slots cannot ship by accident.
   ================================================================== */

.ph {
    color: var(--ph-ink) !important;
    background: var(--ph-bg);
    border-left: 3px solid var(--ph-line);
    padding: 0.55rem 0.8rem;
    font-style: italic;
    display: block;
    font-size: 0.94rem;
    line-height: 1.6;
}

.ph-slot {
    border: 2px dashed var(--ph-line);
    background: var(--ph-bg);
    color: var(--ph-ink);
    min-height: 13rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0.5rem;
    padding: 1.2rem;
    font-size: 0.82rem;
    line-height: 1.6;
}
.ph-slot b { font-size: 0.86rem; letter-spacing: 0.04em; }
.ph-slot code { color: var(--ph-ink); opacity: 0.85; font-size: 0.78rem; }

[data-status="placeholder"] { border-left-color: var(--ph-line) !important; }


/* ==================================================================
   ABOUT / CONTACT
   ================================================================== */

#about-page, #contact-page {
    height: auto;
    min-height: 0;
    display: block;
}

.video-wrap {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    border: 1px solid var(--rule);
    background: #000;
}
.video-wrap iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}


/* ==================================================================
   RESPONSIVE
   ================================================================== */

@media (max-width: 980px) {
    #hero .wrap,
    .entry-lead,
    .proj,
    #story .wrap {
        grid-template-columns: minmax(0, 1fr);
        gap: 1.8rem;
    }
    #hero h1 { max-width: none; }
    .hero-figure { order: -1; }
    .entry-pair { grid-template-columns: minmax(0, 1fr); }
    .fact-row { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 1.6rem; }
    .fact:nth-child(3) { padding-left: 0; border-left: 0; }
    #story .wrap { grid-template-columns: minmax(0, 1fr); }
    .portrait { max-width: 180px; }
}

@media (max-width: 620px) {
    body { font-size: 16px; }
    .wrap { padding: 0 1.15rem; }
    #hero { padding: 2.6rem 0 2.4rem; }
    .band { padding: 2.8rem 0; }
    .fact-row { grid-template-columns: minmax(0, 1fr); row-gap: 1.4rem; }
    .fact { padding-left: 0; border-left: 0; border-top: 1px solid var(--rule); padding-top: 1.1rem; }
    .fact:first-child { border-top: 0; padding-top: 0; }
    .spec li { grid-template-columns: minmax(0, 1fr); gap: 0.15rem; }
    .entry-lead, .proj { padding: 1.2rem; }
    .nav-tab { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
}


/* ==================================================================
   FAROS PAGE
   ================================================================== */

/* spec list inside the dark hero */
.spec-dark { border-top-color: #ffffff2b; margin-bottom: 1.6rem; }
.spec-dark li { border-bottom-color: #ffffff2b; }
.spec-dark .k { color: #93a6c0; }
.spec-dark .v { color: #e4eaf3; }

.doc-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
}

.doc {
    display: block;
    border: 1px solid var(--rule);
    background: var(--surface);
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.doc:hover {
    border-color: var(--navy);
    box-shadow: 0 6px 22px -12px rgba(32, 56, 100, 0.55);
    color: inherit;
}

.doc img {
    display: block;
    width: 100%;
    height: 15.5rem;
    object-fit: cover;
    object-position: top center;
    border-bottom: 1px solid var(--rule);
    background: #000;
}

.doc-cap { padding: 0.95rem 1.1rem; }
.doc-cap b { display: block; font-size: 1.03rem; color: var(--ink); }
.doc-cap span { display: block; font-size: 0.88rem; color: var(--ink-faint); margin-top: 0.18rem; }

.prose {
    max-width: var(--measure);
    color: var(--ink-soft);
    font-size: 1.04rem;
    line-height: 1.8;
}
.prose p { margin-bottom: 1.15rem; }
.prose p:first-child { font-size: 1.12rem; color: var(--ink); }


/* ==================================================================
   CONTACT PAGE
   ================================================================== */

.contact-card {
    background: var(--surface);
    border: 1px solid var(--rule);
    border-top: 3px solid var(--navy);
    padding: 2.4rem;
    max-width: 640px;
}

.contact-mail {
    font-family: Newsreader, Georgia, serif;
    font-size: 1.6rem;
    color: var(--navy);
    display: inline-block;
    margin-bottom: 1.8rem;
    word-break: break-word;
}
.contact-mail:hover { color: var(--navy-deep); text-decoration: underline; }

.contact-links { display: flex; flex-wrap: wrap; gap: 2rem; }

.contact-link {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    color: var(--ink);
    text-decoration: none;
    font-weight: 500;
}
.contact-link:hover { color: var(--navy); }
.contact-link img { width: 30px; height: 30px; object-fit: contain; }


@media (max-width: 760px) {
    .doc-grid { grid-template-columns: minmax(0, 1fr); }
    .doc img { height: 12rem; }
    .contact-card { padding: 1.5rem; }
}


/* ==================================================================
   CAD VIEWER
   The still image is what everyone sees. The WebGL context is only
   created when someone clicks, so the page stays fast.
   ================================================================== */

.cad {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    background: var(--navy-ink);
    border: 1px solid var(--rule);
    overflow: hidden;
}

.cad-poster {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: var(--navy-ink);
    cursor: pointer;
    display: block;
    transition: opacity 0.25s ease;
}

.cad-poster.is-hidden { opacity: 0; pointer-events: none; }

.cad-poster img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    background: var(--navy-ink);
}

.cad-cue {
    position: absolute;
    left: 0.85rem;
    bottom: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--amber);
    color: #241a05;
    font-size: 0.84rem;
    font-weight: 600;
    padding: 0.42rem 0.8rem;
    border-radius: 2px;
    box-shadow: 0 4px 14px -4px rgba(0, 0, 0, 0.6);
}

.cad-cue-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #241a05;
}

.cad-poster:hover .cad-cue { background: #f0b043; }

.cad-stage {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.cad-stage canvas { display: block; width: 100% !important; height: 100% !important; }

.cad-bar {
    position: absolute;
    top: 0.6rem;
    right: 0.6rem;
    display: flex;
    gap: 0.32rem;
    flex-wrap: wrap;
    justify-content: flex-end;
    max-width: calc(100% - 1.2rem);
}

.cad-btn {
    font: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    color: #dbe4f0;
    background: #12203ccc;
    border: 1px solid #ffffff2e;
    border-radius: 2px;
    padding: 0.3rem 0.6rem;
    cursor: pointer;
    backdrop-filter: blur(4px);
    transition: background 0.13s ease, color 0.13s ease;
}

.cad-btn:hover:not(:disabled) { background: #24406e; color: #fff; }
.cad-btn.is-on { background: var(--amber); color: #241a05; border-color: var(--amber); }
.cad-btn:disabled { opacity: 0.35; cursor: not-allowed; }

.cad-hint {
    position: absolute;
    left: 0.7rem;
    bottom: 0.6rem;
    font-size: 0.75rem;
    color: #93a6c0;
    pointer-events: none;
}

.cad-dims {
    position: absolute;
    right: 0.7rem;
    bottom: 0.6rem;
    font-size: 0.75rem;
    color: #93a6c0;
    pointer-events: none;
}

.cad-status {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #bccbe0;
    font-size: 0.9rem;
    pointer-events: none;
    z-index: 2;
}

.cad-status[hidden] { display: none; }


/* ---------- drawing sheets ---------- */

.sheets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 0.8rem;
    margin-top: 1.1rem;
}

.sheet {
    display: block;
    border: 1px solid var(--rule);
    background: #fff;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s ease;
}

.sheet:hover { border-color: var(--navy); color: inherit; }

.sheet img {
    display: block;
    width: 100%;
    aspect-ratio: 1.4 / 1;
    object-fit: cover;
    object-position: center;
    border-bottom: 1px solid var(--rule);
}

.sheet span {
    display: block;
    padding: 0.45rem 0.6rem;
    font-size: 0.8rem;
    color: var(--ink-soft);
}


/* ---------- small key/value strip under a part ---------- */

.kv {
    display: flex;
    flex-wrap: wrap;
    gap: 0 1.6rem;
    margin: 0 0 1rem;
    padding: 0.7rem 0;
    border-top: 1px solid var(--rule);
    border-bottom: 1px solid var(--rule);
    font-size: 0.88rem;
}

.kv div { display: flex; gap: 0.4rem; padding: 0.12rem 0; }
.kv b { color: var(--ink-faint); font-weight: 500; }
.kv span { color: var(--ink); }

.proj-note {
    font-size: 0.86rem;
    color: var(--ink-faint);
    border-left: 2px solid var(--rule);
    padding-left: 0.75rem;
    margin-top: 1rem;
}

@media (max-width: 620px) {
    .cad { aspect-ratio: 1 / 1; }
    .cad-hint { display: none; }
}

.section-intro {
    max-width: 66ch;
    color: var(--ink-soft);
    margin: -0.6rem 0 2rem;
}


/* A placeholder caption inside the dark hero: the figcaption rule is
   more specific than .ph, so without this the placeholder text renders
   dark-on-dark and disappears. */
.hero-figure figcaption.ph {
    background: var(--ph-bg);
    border-top: 0;
}
