/*
    TCT Networks Corporation
    main.css

    Base element and component styles. Colors, fonts, and radii come from
    tokens.css only.
*/

/* Base */

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--f-body);
    font-size: var(--fs-base);
    line-height: var(--lh-body);
    color: var(--c-ink);
    background-color: var(--c-paper);
}

h1,
h2,
h3,
h4 {
    font-family: var(--f-display);
    font-weight: var(--w-display);
    letter-spacing: var(--ls-display);
    line-height: var(--lh-snug);
    color: var(--c-head);
    margin: 0 0 var(--space-md) 0;
}

h1 {
    font-size: var(--fs-hero);
    line-height: var(--lh-tight);
}

h2 {
    font-size: var(--fs-3xl);
}

h3 {
    font-size: var(--fs-2xl);
}

h4 {
    font-size: var(--fs-xl);
}

p {
    margin: 0 0 var(--space-md) 0;
}

img {
    max-width: 100%;
    height: auto;
}

/* Skip navigation */

.skip-nav {
    position: absolute;
    top: -100px;
    left: 0;
    z-index: 100;
    background-color: var(--c-cta);
    color: var(--c-on-cta);
    padding: 0.75rem 1.25rem;
    border-radius: 0 0 var(--radius) 0;
    text-decoration: none;
}

.skip-nav:focus {
    top: 0;
}

/* Links */

a {
    color: var(--c-link);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

p a,
li a {
    text-decoration: underline;
}

:focus-visible {
    outline: 2px solid var(--c-focus);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* Layout */

.container {
    max-width: var(--maxw);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--gutter);
    padding-right: var(--gutter);
}

.section {
    padding-top: var(--space-2xl);
    padding-bottom: var(--space-2xl);
}

.section-alt {
    background-color: var(--c-surface-2);
}

/* Band: a dark full-width section */

.band {
    background-color: var(--c-band);
    color: var(--c-on-band);
    padding-top: var(--space-2xl);
    padding-bottom: var(--space-2xl);
}

.band h1,
.band h2,
.band h3,
.band h4 {
    color: var(--c-on-band);
}

.band p {
    color: var(--c-on-band);
}

.band .muted {
    color: var(--c-on-band-muted);
}

.band a {
    color: var(--c-band-accent);
}

.band .btn-primary {
    background-color: var(--c-band-accent);
    color: var(--c-band);
}

.band .btn-primary:hover {
    background-color: var(--c-on-band);
    color: var(--c-band);
}

.band .btn-secondary {
    color: var(--c-band-accent);
    border-color: var(--c-band-accent);
}

.band .btn-secondary:hover {
    color: var(--c-on-band);
    border-color: var(--c-on-band);
}

.band :focus-visible {
    outline-color: var(--c-band-accent);
}

/* Text utilities */

.muted {
    color: var(--c-muted);
}

.lead {
    font-size: var(--fs-lg);
}

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

/* Buttons */

.btn {
    display: inline-block;
    font-family: var(--f-body);
    font-size: var(--fs-base);
    font-weight: 600;
    line-height: 1;
    padding: 0.9rem 1.5rem;
    min-height: 44px;
    border-radius: var(--radius);
    border: 2px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: background-color var(--speed) var(--ease),
                border-color var(--speed) var(--ease),
                color var(--speed) var(--ease),
                transform var(--speed) var(--ease);
}

.btn:hover {
    text-decoration: none;
    transform: translateY(-2px);
}

.btn-primary {
    background-color: var(--c-cta);
    color: var(--c-on-cta);
}

.btn-primary:hover {
    background-color: var(--c-cta-hover);
    color: var(--c-on-cta);
}

.btn-secondary {
    background-color: transparent;
    color: var(--c-link);
    border-color: var(--c-link);
}

.btn-secondary:hover {
    color: var(--c-cta-hover);
    border-color: var(--c-cta-hover);
}

/* Cards */

.card {
    background-color: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: var(--space-lg);
}

.card h3,
.card h4 {
    margin-top: 0;
}

/* Form fields */

.field {
    margin-bottom: var(--space-lg);
}

.field label {
    display: block;
    font-weight: 600;
    margin-bottom: var(--space-2xs);
    color: var(--c-head);
}

.field input,
.field textarea,
.field select {
    width: 100%;
    font-family: var(--f-body);
    font-size: var(--fs-base);
    color: var(--c-ink);
    background-color: var(--c-surface);
    border: 1px solid var(--c-muted);
    border-radius: var(--radius);
    padding: 0.7rem 0.9rem;
    min-height: 44px;
}

.contact-direct-title {
    font-size: var(--fs-2xl);
}

.field input:focus-visible,
.field textarea:focus-visible,
.field select:focus-visible {
    outline: 2px solid var(--c-focus);
    outline-offset: 1px;
}

/* Placeholder: labeled slot for imagery that does not exist yet */

.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    border: 2px dashed var(--c-border);
    border-radius: var(--radius-lg);
    color: var(--c-muted);
    font-family: var(--f-mono);
    font-size: var(--fs-sm);
    padding: var(--space-md);
    min-height: 180px;
}

/* Header */

.site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    background-color: var(--c-surface);
    border-bottom: 1px solid var(--c-border);
}

.header-inner {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    min-height: 68px;
}

.brand {
    display: inline-flex;
    align-items: center;
    margin-right: auto;
}

.brand img {
    width: 164px;
    height: 56px;
    object-fit: contain;
}

.logo-dark {
    display: none;
}

[data-scheme="dark"] .logo-light {
    display: none;
}

[data-scheme="dark"] .logo-dark {
    display: inline-block;
}

.site-nav ul {
    display: flex;
    align-items: center;
    gap: var(--space-2xs);
    list-style: none;
    margin: 0;
    padding: 0;
}

.site-nav a {
    display: inline-block;
    position: relative;
    color: var(--c-ink);
    font-weight: 500;
    padding: 0.6rem 0.8rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
}

.site-nav a::after {
    content: "";
    position: absolute;
    left: 0.8rem;
    right: 0.8rem;
    bottom: 0.35rem;
    height: 2px;
    background-color: var(--c-link);
    transform: scaleX(0);
    transform-origin: 0 50%;
    transition: transform var(--speed) var(--ease);
}

.site-nav a:hover::after {
    transform: scaleX(1);
}

.site-nav a[aria-current="page"]::after,
.site-nav a.nav-cta::after {
    display: none;
}

.site-nav a:hover {
    color: var(--c-link);
    text-decoration: none;
}

.site-nav a[aria-current="page"] {
    color: var(--c-link);
    font-weight: 600;
    box-shadow: inset 0 -2px 0 var(--c-link);
    border-radius: 0;
}

.site-nav a.nav-cta {
    color: var(--c-on-cta);
    font-weight: 600;
    padding: 0.7rem 1.1rem;
    margin-left: var(--space-xs);
    box-shadow: none;
    border-radius: var(--radius);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 10px;
    background: none;
    border: none;
    cursor: pointer;
}

.nav-toggle-bar {
    display: block;
    width: 100%;
    height: 2px;
    background-color: var(--c-head);
}

.scheme-toggle {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    color: var(--c-ink);
    background: none;
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    cursor: pointer;
}

.scheme-toggle:hover {
    color: var(--c-link);
    border-color: var(--c-link);
}

.scheme-toggle svg {
    grid-area: 1 / 1;
    transition: opacity var(--speed) var(--ease),
                transform var(--speed) var(--ease);
}

.scheme-toggle .icon-sun {
    opacity: 0;
    transform: rotate(-90deg) scale(0.6);
}

[data-scheme="dark"] .scheme-toggle .icon-moon {
    opacity: 0;
    transform: rotate(90deg) scale(0.6);
}

[data-scheme="dark"] .scheme-toggle .icon-sun {
    opacity: 1;
    transform: rotate(0) scale(1);
}

@media (max-width: 900px) {
    .nav-toggle {
        display: flex;
    }

    .site-nav {
        display: grid;
        grid-template-rows: 0fr;
        visibility: hidden;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: var(--c-surface);
        border-bottom: 1px solid var(--c-border);
        box-shadow: var(--shadow-card);
        transition: grid-template-rows var(--speed) var(--ease),
                    visibility var(--speed) var(--ease);
    }

    .nav-open .site-nav {
        grid-template-rows: 1fr;
        visibility: visible;
    }

    .site-nav-inner {
        min-height: 0;
        overflow: hidden;
    }

    .site-nav ul {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: var(--space-sm) var(--gutter) var(--space-md);
    }

    .site-nav a {
        display: block;
        padding: 0.8rem 0.5rem;
    }

    .site-nav a[aria-current="page"] {
        box-shadow: inset 3px 0 0 var(--c-link);
        padding-left: 0.9rem;
    }

    .site-nav a.nav-cta {
        margin-left: 0;
        margin-top: var(--space-sm);
        text-align: center;
    }
}

/* CTA band */

.cta-band {
    scroll-margin-top: 84px;
}

.cta-band-sub {
    max-width: 560px;
}

.cta-band-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    margin-top: var(--space-lg);
    margin-bottom: var(--space-lg);
}

.cta-band-address {
    font-size: var(--fs-sm);
    margin-bottom: 0;
}

/* Footer */

.site-footer {
    background-color: var(--c-surface-2);
    border-top: 1px solid var(--c-border);
    padding-top: var(--space-2xl);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: var(--space-xl);
    padding-bottom: var(--space-xl);
}

.footer-brand img {
    width: 147px;
    height: 50px;
    object-fit: contain;
    margin-bottom: var(--space-sm);
}

.footer-brand p {
    max-width: 300px;
}

.footer-heading {
    font-size: var(--fs-base);
    margin-top: 0;
    margin-bottom: var(--space-sm);
}

.footer-col ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-col li {
    margin-bottom: var(--space-xs);
}

.footer-col a {
    color: var(--c-ink);
    text-decoration: none;
}

.footer-col a:hover {
    color: var(--c-link);
    text-decoration: underline;
}

.footer-linkedin {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
}

.icon-linkedin {
    flex: none;
    width: 22px;
    height: 22px;
    background-color: currentColor;
    -webkit-mask: url("/img/linkedin.png") center / contain no-repeat;
    mask: url("/img/linkedin.png") center / contain no-repeat;
}

@media (forced-colors: active) {
    .icon-linkedin {
        forced-color-adjust: none;
        background-color: LinkText;
    }
}

.footer-legal {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-sm);
    border-top: 1px solid var(--c-border);
    padding-top: var(--space-md);
    padding-bottom: var(--space-md);
}

.footer-legal p {
    font-size: var(--fs-sm);
    margin: 0;
}

@media (max-width: 900px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-lg);
    }

    .footer-brand {
        grid-column: 1 / -1;
    }
}

@media (max-width: 520px) {
    .footer-grid {
        grid-template-columns: 1fr;
    }
}

.footer-pref {
    margin: 0;
    color: var(--c-muted);
}

.footer-pref label {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    min-height: 44px;
    cursor: pointer;
}

.footer-pref input {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--c-cta);
}

/* Split section */

.section-split {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: var(--space-xl);
    padding-bottom: var(--space-2xl);
}

@media (max-width: 800px) {
    .section-split {
        grid-template-columns: 1fr;
    }
}

.contact-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.contact-list li {
    margin-bottom: var(--space-sm);
}

/* Hero: full screen, map, scroll cue */

.hero {
    position: relative;
    display: flex;
    align-items: center;
    min-height: calc(100svh - 70px);
    overflow: hidden;
    --c-map-line: 74, 168, 108;
    --c-map-hi: 168, 228, 170;
}

.hero-media {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 50%;
    padding-left: 1rem;
    padding-right: max(84px, ((100% - var(--maxw)) / 2 + var(--gutter)) / 2);
    -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 10%);
    mask-image: linear-gradient(to right, transparent 0%, #000 10%);
}

.hero-map {
    position: absolute;
    top: 0;
    left: 0;
    display: block;
    width: 100%;
    height: 100%;
}

.hero-inner {
    position: relative;
    z-index: 1;
    width: 100%;
}

.hero-title,
.hero-sub,
.hero .hero-actions {
    max-width: min(36rem, calc(50vw - max(var(--gutter), (100vw - var(--maxw)) / 2 + var(--gutter)) - 2rem));
}

.hero-title {
    white-space: pre-line;
    font-size: var(--fs-hero);
    line-height: var(--lh-tight);
}

.hero-sub {
    margin-top: var(--space-md);
    color: var(--c-on-band-muted);
}

.hero-scroll {
    position: absolute;
    left: 50%;
    bottom: var(--space-lg);
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    margin-left: -24px;
    border: 2px solid var(--c-band-accent);
    border-radius: 50%;
    color: var(--c-band-accent);
}

.hero-scroll svg,
.svc-jump-chev svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.hero-scroll:hover {
    color: var(--c-on-band);
    border-color: var(--c-on-band);
}

@media (prefers-reduced-motion: no-preference) {
    .hero-scroll svg {
        animation: hero-nudge 1.2s ease-in-out 3;
    }
}

@keyframes hero-nudge {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(5px); }
}

@media (max-width: 899px) and (orientation: portrait), (max-width: 599px) {
    .hero {
        flex-direction: column;
        align-items: stretch;
        justify-content: center;
        padding-top: var(--space-xl);
        padding-bottom: var(--space-3xl);
    }

    .hero-media {
        position: relative;
        left: auto;
        order: 2;
        flex: 1 1 auto;
        min-height: 240px;
        max-height: 90vw;
        margin-top: var(--space-lg);
        padding-left: var(--gutter);
        padding-right: var(--gutter);
        -webkit-mask-image: none;
        mask-image: none;
        --map-extent: state;
    }

    .hero-title,
    .hero-sub,
    .hero .hero-actions {
        max-width: 36rem;
    }
}

@media (max-width: 599px) {
    .hero-media {
        flex: none;
        height: 75vw;
        padding-left: 0;
        padding-right: 0;
        -webkit-mask-image: linear-gradient(to bottom, #000 70%, transparent 100%);
        mask-image: linear-gradient(to bottom, #000 70%, transparent 100%);
        --map-extent: upstate;
    }
}

@media (orientation: landscape) and (max-height: 500px) {
    .hero-title {
        font-size: 2.3rem;
    }
}

/* Band placeholders */

.band .placeholder {
    border-color: var(--c-on-band-muted);
    color: var(--c-on-band-muted);
}

/* Service index */

.teaser-intro {
    max-width: 640px;
}

.svc-index {
    list-style: none;
    margin: var(--space-xl) 0 0 0;
    padding: 0;
    border-top: 1px solid var(--c-border);
}

.svc-index li {
    border-bottom: 1px solid var(--c-border);
}

.svc-index a {
    position: relative;
    display: grid;
    grid-template-columns: minmax(11rem, 17rem) 1fr;
    gap: var(--space-2xs) var(--space-lg);
    align-items: baseline;
    padding: var(--space-lg) var(--space-xs) calc(var(--space-lg) + 26px);
    color: inherit;
    text-decoration: none;
}

.svc-index-name {
    font-family: var(--f-display);
    font-size: var(--fs-xl);
    line-height: var(--lh-snug);
    color: var(--c-head);
    transition: color var(--speed) var(--ease);
}

.svc-index-line {
    color: var(--c-muted);
}

.svc-index-chips {
    grid-column: 2;
    margin-top: var(--space-xs);
}

@media (hover: hover) {
    .svc-index a:hover .svc-index-name {
        color: var(--c-link);
    }
}

@media (max-width: 800px) {
    .svc-index a {
        grid-template-columns: 1fr;
    }

    .svc-index-line,
    .svc-index-chips {
        grid-column: 1;
    }
}

/* Service jump rows: in-page links with a down chevron */

.svc-jump a {
    grid-template-columns: minmax(11rem, 17rem) 1fr auto;
    padding-bottom: calc(var(--space-md) + 26px);
    border-radius: var(--radius);
    transition: background-color var(--speed) var(--ease);
}

.svc-jump .svc-jump-chev {
    align-self: center;
    grid-row: 1;
    grid-column: 3;
    margin-bottom: 18px;
}

.svc-jump-chev {
    align-self: center;
    grid-row: 1;
    grid-column: 3;
    margin-bottom: 18px;
}

.svc-jump-chev {
    display: inline-grid;
    place-items: center;
    color: var(--c-link);
    transition: transform var(--speed) var(--ease);
}

@media (hover: hover) {
    .svc-jump a:hover {
        background-color: var(--c-surface-2);
    }

    .svc-jump a:hover .svc-jump-chev {
        transform: translateY(3px);
    }
}

@media (max-width: 800px) {
    .svc-jump a {
        grid-template-columns: 1fr auto;
    }

    .svc-jump .svc-index-line {
        grid-column: 1;
    }

    .svc-jump .svc-jump-chev {
        grid-column: 2;
        grid-row: 1 / span 2;
    }
}

/* Connector: a cable runs in and seats into a port, which lights up.
   Every length is a ratio of --h, the connector height in pixels, so the
   whole assembly scales from one number. The plug rides the cable's
   leading edge; the port is drawn in two layers with the plug between
   them, so the faceplate occludes the plug's tip. */

.conn-sprite {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

.run {
    --h: var(--conn-h, 26);
    position: absolute;
    left: 0;
    right: 0;
    bottom: calc(var(--h) * -0.62px);
    height: calc(var(--h) * 1.35px);
    overflow: hidden;
    pointer-events: none;
}

.run .cable {
    position: absolute;
    left: 0;
    top: calc(var(--h) * 0.888px);
    z-index: 2;
    width: 0;
    height: 2px;
    margin-top: -1px;
    background-color: var(--c-art-line);
    transform: translateX(calc(var(--h) * -2.484px));
    transition: width 0.5s cubic-bezier(0.3, 0.7, 0.3, 1),
                transform 0.5s cubic-bezier(0.3, 0.7, 0.3, 1);
}

.run .plug {
    position: absolute;
    right: calc(var(--h) * -2.484px);
    top: calc(var(--h) * -0.5px);
    width: calc(var(--h) * 2.484px);
    height: calc(var(--h) * 1px);
}

.run .port {
    position: absolute;
    right: 0;
    top: 0;
    z-index: 1;
    width: calc(var(--h) * 1.768px);
    height: calc(var(--h) * 1.35px);
}

.run .port-front {
    z-index: 3;
}

.is-connected .cable {
    width: calc(100% - var(--h) * 2.984px);
    transform: none;
}

.is-connected {
    --led-a: var(--c-art-led-link);
    --led-b: var(--c-art-led-act);
    --led-op: 1;
    --led-b-blink: led-blink 0.5s steps(1) 2;
}

@media (hover: hover) {
    .svc-index a:hover .cable {
        width: calc(100% - var(--h) * 2.984px);
        transform: none;
    }

    .svc-index a:hover {
        --led-a: var(--c-art-led-link);
        --led-b: var(--c-art-led-act);
        --led-op: 1;
        --led-b-blink: led-blink 0.5s steps(1) 2;
    }
}

/* Bit flip: site.js scrambles the real words and resolves them back, so a
   script that never runs leaves plain readable text. The font never
   changes; the box is locked to the final text's size while it flips. */

.bitflip.is-flipping {
    max-width: 100%;
    overflow: hidden;
    vertical-align: top;
}

/* Photo handover: the image is pinned while the panel below rises over it
   under a gradient. The gradient resolves at exactly --stage, and the
   panel's top padding matches, so text always starts where the photo
   ends. */

.handover {
    --stage: min(100svh, 720px);
    position: relative;
    background-color: var(--c-paper);
}

.handover .stage {
    position: sticky;
    top: 0;
    height: var(--stage);
    overflow: hidden;
}

.handover .stage-photo {
    height: 100%;
    background-image: url("/img/rack.jpg");
    background-size: cover;
    background-position: center top;
}

.handover .over {
    position: relative;
    margin-top: calc(-1 * var(--stage));
    padding-top: calc(var(--stage) + var(--space-xl));
    padding-bottom: var(--space-3xl);
    background-image: linear-gradient(to bottom,
                rgba(0, 0, 0, 0) 0%,
                var(--c-paper) var(--stage),
                var(--c-paper) 100%);
}

/* Disclosures */

@supports (interpolate-size: allow-keywords) {
    :root {
        interpolate-size: allow-keywords;
    }
}

/* Service features: each has a presence, a drawing built by scroll position */

.feature {
    position: relative;
    overflow: hidden;
    padding-top: var(--space-3xl);
    padding-bottom: var(--space-3xl);
    scroll-margin-top: 84px;
}

.feature-wrap {
    position: relative;
}

.feature-text {
    position: relative;
    z-index: 1;
    max-width: 34rem;
}

.feature-center {
    max-width: 40rem;
    margin: 0 auto;
    text-align: center;
}

.feature-center .feature-chips {
    justify-content: center;
}

.feature-lead {
    margin-top: var(--space-sm);
    font-family: var(--f-display);
    font-size: var(--fs-xl);
    line-height: var(--lh-snug);
    color: var(--c-head);
}

.feature-chips {
    margin-top: var(--space-md);
}

.more-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    min-height: 44px;
    margin-top: var(--space-md);
    font-weight: 600;
}

.more-link-arrow {
    transition: transform var(--speed) var(--ease);
}

@media (hover: hover) {
    .more-link:hover .more-link-arrow {
        transform: translateX(4px);
    }
}

.presence {
    --p: 1;
    pointer-events: none;
}

.presence-rack {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: calc(100% - 36rem);
    display: flex;
    align-items: center;
    justify-content: center;
}

.presence-rack svg {
    height: 100%;
    max-height: 560px;
    width: auto;
}

.d-line {
    fill: none;
    stroke: var(--c-head);
    stroke-opacity: 0.32;
    stroke-width: 1.2;
    vector-effect: non-scaling-stroke;
}

.d-faint {
    fill: none;
    stroke: var(--c-head);
    stroke-opacity: 0.2;
    stroke-width: 1;
    vector-effect: non-scaling-stroke;
}

.d-box {
    fill: var(--c-paper);
}

.d-u {
    font-family: var(--f-mono);
    font-size: 9px;
    fill: var(--c-muted);
    opacity: 0.6;
}

.d-led {
    fill: var(--c-art-led-link);
    opacity: clamp(0, calc((var(--p) - var(--t) - 0.08) * 10), 0.9);
}

.d-unit {
    opacity: clamp(0, calc((var(--p) - var(--t)) * 7), 1);
    transform: translateX(calc((1 - clamp(0, calc((var(--p) - var(--t)) * 7), 1)) * 40px));
}

.d-link {
    fill: none;
    stroke: var(--c-head);
    stroke-opacity: 0.3;
    stroke-width: 1.4;
    stroke-dasharray: 1;
    stroke-dashoffset: calc(1 - clamp(0, calc((var(--p) - var(--t)) * 6), 1));
    vector-effect: non-scaling-stroke;
}

.d-node {
    opacity: clamp(0.25, calc((var(--p) - var(--t)) * 8), 1);
}

.d-lock {
    fill: none;
    stroke: var(--c-accent);
    stroke-width: 1.4;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: clamp(0, calc((var(--p) - var(--t)) * 8), 0.9);
}

/* Network diagram */

.feature-net {
    min-height: 640px;
}

.presence-net-outside,
.presence-net-inside {
    position: absolute;
    top: 50%;
    width: min(300px, calc((min(100%, var(--maxw)) - 40rem) / 2 - 2.5rem));
    transform: translateY(-50%);
}

.presence-net-outside {
    left: max(var(--gutter), calc((100% - var(--maxw)) / 2));
}

.presence-net-inside {
    right: max(var(--gutter), calc((100% - var(--maxw)) / 2));
}

.presence-net-outside svg,
.presence-net-inside svg {
    display: block;
    width: 100%;
    height: auto;
}

.presence-net-stacked {
    display: none;
}

.d-fill {
    fill: var(--c-paper);
}

.section-alt .d-fill {
    fill: var(--c-surface-2);
}

.d-tip {
    fill: none;
    stroke: var(--c-head);
    stroke-opacity: 0.35;
    stroke-width: 1.4;
    opacity: clamp(0, calc((var(--p) - var(--t)) * 8), 1);
    vector-effect: non-scaling-stroke;
}

.d-bound {
    fill: none;
    stroke: var(--c-accent);
    stroke-width: 1.4;
    stroke-dasharray: 6 6;
    opacity: clamp(0, calc((var(--p) - var(--t)) * 6), 0.55);
    vector-effect: non-scaling-stroke;
}

.d-lock-body {
    fill: var(--c-surface-2);
    stroke: var(--c-accent);
    stroke-width: 1.4;
    vector-effect: non-scaling-stroke;
}

.d-dev-node {
    opacity: clamp(0, calc((var(--p) - var(--t)) * 8), 1);
}

@media (max-width: 1150px) {
    .presence-net-outside,
    .presence-net-inside {
        display: none;
    }

    .feature-net {
        min-height: 0;
    }

    .presence-net-stacked {
        display: block;
        max-width: 360px;
        margin: var(--space-xl) auto 0;
    }

    .presence-net-stacked svg {
        width: 100%;
        height: auto;
    }
}

@media (max-width: 800px) {
    .feature-text,
    .feature-center {
        max-width: none;
        margin: 0;
        text-align: left;
    }

    .feature-center .feature-chips {
        justify-content: flex-start;
    }

    .presence-rack {
        position: relative;
        inset: auto;
        width: auto;
        margin-top: var(--space-xl);
    }

    .presence-rack svg {
        height: 300px;
    }
}

/* AI Integration band: How can AI help you? */

.ai-band {
    padding-top: var(--space-3xl);
    padding-bottom: var(--space-3xl);
    scroll-margin-top: 84px;
}

.ai-band-head {
    display: flex;
    gap: var(--space-lg);
    align-items: flex-start;
    max-width: 820px;
}

.ai-band-icon {
    flex: none;
    width: 64px;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke: var(--c-band-accent);
    stroke-width: 1.25;
}

.ai-band-lead {
    margin-top: var(--space-sm);
    color: var(--c-on-band);
    font-family: var(--f-body);
    font-size: var(--fs-lg);
    line-height: var(--lh-body);
}

.ai-band-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: var(--space-xl);
    align-items: start;
    margin-top: var(--space-xl);
}

.ai-points {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg) var(--space-xl);
    margin: 0;
    padding: 0;
    list-style: none;
}

.ai-points-wide {
    grid-template-columns: repeat(4, 1fr);
    margin-top: var(--space-xl);
}

.ai-points li {
    padding-top: var(--space-md);
    border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.ai-points h3 {
    margin: 0 0 var(--space-2xs) 0;
    font-size: var(--fs-lg);
    color: var(--c-on-band);
}

.ai-points p {
    margin: 0;
    color: var(--c-on-band-muted);
}

.ai-feature {
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.22);
    background-color: rgba(255, 255, 255, 0.04);
}

.ai-feature h3 {
    font-size: var(--fs-xl);
}

.ai-feature p {
    color: var(--c-on-band-muted);
}

.more-link-band {
    color: var(--c-band-accent);
}

@media (max-width: 1000px) {
    .ai-points-wide {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 800px) {
    .ai-band-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 520px) {
    .ai-points {
        grid-template-columns: 1fr;
    }
}

/* Page header */

.page-header {
    padding-bottom: var(--space-lg);
}

.notfound-links {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    margin-top: var(--space-lg);
}

.page-header .lead {
    max-width: 640px;
}

/* Services page */

.faq-jump {
    margin-top: var(--space-lg);
    margin-bottom: var(--space-2xl);
}

.faq-jump a {
    grid-template-columns: minmax(11rem, 17rem) 1fr auto;
    padding-top: var(--space-md);
    padding-bottom: var(--space-md);
    border-radius: var(--radius);
    transition: background-color var(--speed) var(--ease);
}

.faq-chev,
.faq-mark {
    display: inline-grid;
    place-items: center;
    align-self: center;
    color: var(--c-link);
    transition: transform var(--speed) var(--ease);
}

.faq-chev svg,
.faq-mark svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

@media (hover: hover) {
    .faq-jump a:hover {
        background-color: var(--c-surface-2);
    }

    .faq-jump a:hover .faq-chev {
        transform: translateY(3px);
    }
}

.faq-area {
    padding-top: var(--space-3xl);
    padding-bottom: var(--space-3xl);
    border-top: 1px solid var(--c-border);
    scroll-margin-top: 84px;
}

.faq-grid {
    display: grid;
    grid-template-columns: 0.85fr 1.15fr;
    gap: var(--space-2xl);
    align-items: start;
}

.faq-sub {
    margin-top: var(--space-lg);
    font-size: var(--fs-lg);
}

.faq-covers {
    margin: var(--space-xs) 0 0 0;
    padding-left: 1.2rem;
    color: var(--c-muted);
}

.faq-covers li {
    margin-bottom: var(--space-2xs);
}

.faq-q {
    border-top: 1px solid var(--c-border);
    scroll-margin-top: 90px;
}

.faq-q:last-child {
    border-bottom: 1px solid var(--c-border);
}

.faq-q summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    min-height: 44px;
    padding: var(--space-md) 0;
    cursor: pointer;
    list-style: none;
}

.faq-q summary::-webkit-details-marker {
    display: none;
}

.faq-q summary h3 {
    margin: 0;
    font-size: var(--fs-lg);
    line-height: var(--lh-snug);
}

.faq-q[open] .faq-mark {
    transform: rotate(180deg);
}

.faq-q:target summary h3 {
    color: var(--c-link);
}

.faq-a {
    padding: 0 0 var(--space-lg) 0;
}

.faq-a p {
    margin-top: 0;
}

.faq-a a {
    font-weight: 600;
}

@supports (interpolate-size: allow-keywords) {
    .faq-q::details-content {
        block-size: 0;
        overflow: hidden;
        transition: block-size 0.3s var(--ease), content-visibility 0.3s allow-discrete;
    }

    .faq-q[open]::details-content {
        block-size: auto;
    }
}

@media (max-width: 800px) {
    .faq-grid {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }

    .faq-jump a {
        grid-template-columns: 1fr auto;
    }

    .faq-jump .svc-index-line {
        grid-column: 1;
    }

    .faq-jump .faq-chev {
        grid-column: 2;
        grid-row: 1 / span 2;
    }
}

/* About page */

.story-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: var(--space-2xl);
    align-items: start;
}

.story-fact {
    font-family: var(--f-mono);
    font-size: var(--fs-sm);
    margin-bottom: var(--space-lg);
}

.story-art .placeholder {
    min-height: 280px;
}

@media (max-width: 800px) {
    .story-grid {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }
}

.mission-body {
    max-width: 640px;
    font-size: var(--fs-lg);
}

.chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    list-style: none;
    margin: var(--space-lg) 0 0 0;
    padding: 0;
}

.chip-list li {
    font-family: var(--f-mono);
    font-size: var(--fs-sm);
    color: var(--c-head);
    background-color: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    padding: 0.45rem 0.9rem;
}

/* Research page */

.research-band {
    position: relative;
    overflow: hidden;
    background-color: var(--c-band);
    background-image: radial-gradient(circle at 100% 100%, var(--c-art-space) 0%, var(--c-art-space) 18%, var(--c-band) 62%);
}

.research-band-inner {
    position: relative;
    z-index: 1;
}

.research-text {
    max-width: 640px;
}

.research-stars {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    fill: var(--c-on-band);
    mask-image: linear-gradient(to right, rgba(0, 0, 0, 0.35), #000 60%);
    -webkit-mask-image: linear-gradient(to right, rgba(0, 0, 0, 0.35), #000 60%);
}

.research-orbit {
    position: absolute;
    right: 0;
    bottom: 0;
    width: clamp(320px, 42vw, 640px);
    height: auto;
    overflow: visible;
}

.research-credit {
    position: absolute;
    right: var(--gutter);
    bottom: var(--space-sm);
    z-index: 1;
    margin: 0;
    font-family: var(--f-mono);
    font-size: var(--fs-label);
    color: var(--c-on-band-muted);
    background-color: var(--c-art-space);
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius);
    opacity: 0.85;
}

@media (max-width: 800px) {
    .research-band {
        padding-bottom: calc(var(--space-2xl) + 220px);
    }

    .research-text {
        max-width: none;
    }

    .research-orbit {
        width: 320px;
    }
}

/* Research band art. Stars cover the band and thin out behind the text;
   Earth sits in the bottom-right corner with three satellites orbiting it.
   The orbits are larger than the Earth SVG's box (overflow visible) and
   are clipped by the band itself, so satellites leave at the band edge.
   Text never overlaps Earth: the text column is capped on desktop and
   the band gains a bottom strip for the art on narrow screens. Ambient,
   not a reveal; stopped by the global reduced-motion rule. Art colours
   are fixed across schemes, so they live as --c-art-* tokens. */

.orbit,
.sat {
    transform-box: view-box;
    animation-name: orbit-spin;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
}

.orbit {
    transform-origin: 640px 640px;
}

.sat {
    transform-box: fill-box;
    transform-origin: center;
    animation-direction: reverse;
}

.orbit-near,
.sat-near {
    animation-duration: 36s;
}

.orbit-mid,
.sat-mid {
    animation-duration: 58s;
}

.orbit-far,
.sat-far {
    animation-duration: 84s;
}

@keyframes orbit-spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.focus-group {
    margin-top: var(--space-lg);
}

.focus-group h3 {
    font-size: var(--fs-lg);
    margin-bottom: var(--space-xs);
}

.focus-group .chip-list {
    margin-top: 0;
}

.chip-list-band li {
    position: relative;
    z-index: 0;
    color: var(--c-on-band);
    background-color: transparent;
    border-color: var(--c-on-band-muted);
}

.chip-list-band li::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    border: 2px solid var(--c-band-accent);
    border-radius: inherit;
    clip-path: inset(0 0 100% 0);
    transition: clip-path var(--speed) var(--ease);
}

@media (hover: hover) {
    .chip-list-band li:hover::before {
        clip-path: inset(0 0 0 0);
    }
}

.research-project-desc {
    max-width: 720px;
}

.doc-links {
    list-style: none;
    margin: var(--space-md) 0 0 0;
    padding: 0;
}

.doc-links li {
    margin-bottom: var(--space-sm);
}

.new-tab-note {
    font-size: var(--fs-sm);
    color: var(--c-muted);
}

.program-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-lg);
    margin-top: var(--space-xl);
}

.program-card h3 {
    font-size: var(--fs-xl);
}

.program-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
}

.program-sponsor {
    font-family: var(--f-mono);
    font-size: var(--fs-label);
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--c-accent);
}

.program-years {
    font-family: var(--f-mono);
    font-size: var(--fs-label);
    color: var(--c-muted);
}

.type-badge {
    display: inline-block;
    font-family: var(--f-mono);
    font-size: var(--fs-label);
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--c-accent);
    border: 1px solid var(--c-accent);
    border-radius: var(--radius-sm);
    padding: 0.15rem 0.5rem;
}

.ledger {
    margin-top: var(--space-xl);
    max-width: 900px;
}

.ledger-year {
    display: grid;
    grid-template-columns: 90px 1fr;
    gap: var(--space-lg);
    padding-top: var(--space-lg);
    padding-bottom: var(--space-md);
    border-top: 1px solid var(--c-border);
}

.ledger-year-label {
    position: sticky;
    top: 84px;
    font-family: var(--f-mono);
    font-size: var(--fs-xl);
    font-weight: 500;
    color: var(--c-muted);
    margin: 0;
}

.ledger-entries {
    display: grid;
    gap: var(--space-lg);
}

.ledger-entry {
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: var(--space-md);
    align-items: start;
}

.ledger-badges {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2xs);
}

.ledger-title {
    font-size: var(--fs-lg);
    margin-bottom: var(--space-2xs);
}

.pub-citation {
    margin-bottom: 0;
    font-size: var(--fs-sm);
}

@media (max-width: 640px) {
    .ledger-year {
        grid-template-columns: 1fr;
        gap: var(--space-sm);
    }

    .ledger-entry {
        grid-template-columns: 1fr;
        gap: var(--space-xs);
    }

    .ledger-badges {
        flex-direction: row;
    }
}

/* Card hover */

.program-card {
    transition: transform var(--speed) var(--ease),
                box-shadow var(--speed) var(--ease),
                border-color var(--speed) var(--ease);
}

.program-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-card-hover);
}

/* Hover draws a border downward, the same gesture as the focus chips */

.program-card {
    position: relative;
}

.program-card::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    border: 2px solid var(--c-accent);
    border-radius: inherit;
    clip-path: inset(0 0 100% 0);
    transition: clip-path var(--speed) var(--ease);
}

.program-card:hover::before {
    clip-path: inset(0 0 0 0);
}

/* Scroll-driven reveals

   Progressive enhancement only. The hidden starting state is declared
   inside both guards so that a browser without scroll timelines, or a
   visitor who prefers reduced motion, never gets an element stuck at zero
   opacity. */

@keyframes rise-in {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes header-settle {
    from {
        box-shadow: none;
    }

    to {
        box-shadow: var(--shadow-card);
    }
}

@keyframes read-progress {
    from {
        transform: scaleX(0);
    }

    to {
        transform: scaleX(1);
    }
}

@supports (animation-timeline: view()) {
    @media (prefers-reduced-motion: no-preference) {
        .ledger-entry {
            animation: rise-in linear both;
            animation-timeline: view();
            animation-range: entry 5% cover 30%;
        }

        .program-card {
            animation: rise-in linear both;
            animation-timeline: view();
            animation-range: entry 5% cover 30%;
        }

        .story-grid > div,
        .mission-band h2 {
            animation: fade-in linear both;
            animation-timeline: view();
            animation-range: entry 10% cover 32%;
        }

        .mission-body {
            animation: fade-in linear both;
            animation-timeline: view();
            animation-range: entry 10% cover 42%;
        }

    }
}

@supports (animation-timeline: scroll()) {
    @media (prefers-reduced-motion: no-preference) {
        .site-header {
            animation: header-settle linear both;
            animation-timeline: scroll(root);
            animation-range: 0 80px;
        }

        .read-progress {
            animation: read-progress linear both;
            animation-timeline: scroll(root);
        }
    }
}

/* Reading progress bar */

.read-progress {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background-color: var(--c-accent);
    transform: scaleX(0);
    transform-origin: 0 50%;
    z-index: 45;
}

/* Back to top: shown by site.js once the page scrolls */

.to-top {
    position: fixed;
    right: max(var(--space-md), env(safe-area-inset-right));
    bottom: max(var(--space-md), env(safe-area-inset-bottom));
    z-index: 44;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 44px;
    padding: 0 1rem 0 0.75rem;
    border: 1px solid var(--c-border);
    border-radius: 999px;
    background-color: var(--c-surface);
    box-shadow: var(--shadow-card);
    color: var(--c-link);
    font-family: var(--f-body);
    font-size: var(--fs-sm);
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity var(--speed) var(--ease),
                transform var(--speed) var(--ease),
                visibility 0s linear var(--speed);
}

.to-top.is-shown {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: opacity var(--speed) var(--ease),
                transform var(--speed) var(--ease);
}

.to-top:hover {
    color: var(--c-cta-hover);
    border-color: var(--c-cta-hover);
    text-decoration: none;
}

.to-top svg {
    flex: none;
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

@media print {
    .to-top {
        display: none;
    }
}

/* Focus band reveal

   Mobile only, and borders only, for the focus chips and both card types.
   Nothing here hides content: every element is always visible, and the only
   thing that changes is the decorative border on ::before, whose hidden
   state is already the default (it is what :hover reveals on desktop). So a
   stale, blocked or broken site.js costs the effect and nothing else.

   One-shot rather than scroll-scrubbed - a scroll timeline runs backwards
   when you scroll back up, and this has to stay drawn once drawn.
   IntersectionObserver in site.js adds .is-revealed.

   On desktop the band is already fully on screen at load, so nothing
   reveals there and :hover owns the effect. */

@media (max-width: 900px) {
    @media (prefers-reduced-motion: no-preference) {
        .focus-group .chip-list-band li::before,
        .program-card::before {
            transition-duration: var(--speed-reveal);
            transition-timing-function: var(--ease-reveal);
        }

        .focus-group.is-revealed .chip-list-band li::before,
        .program-card.is-revealed::before {
            clip-path: inset(0 0 0 0);
        }

        .focus-group .chip-list-band li:nth-child(5n + 2)::before {
            transition-delay: 0.6s;
        }

        .focus-group .chip-list-band li:nth-child(5n + 3)::before {
            transition-delay: 1.2s;
        }

        .focus-group .chip-list-band li:nth-child(5n + 4)::before {
            transition-delay: 1.8s;
        }

        .focus-group .chip-list-band li:nth-child(5n + 5)::before {
            transition-delay: 2.4s;
        }
    }
}

/* Anchor scrolling and page transitions */

@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

@view-transition {
    navigation: auto;
}

/* Motion preference */

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

    details::details-content {
        transition: none !important;
    }
}
