/* Terminal:Contract website: landing page and devlog. */

:root {
    --teal: #39d0b8;            /* the web build's accent */
    --cyan: #00d9ff;
    --orange: #ff6b35;
    --amber: #ffbf00;
    --violet: #8b5cf6;
    --green: #20c20e;
    --red: #ff4d4d;

    --bg: #05060a;
    --bg-raised: #0a0d13;
    --bg-panel: rgba(12, 16, 23, 0.92);
    --line: rgba(57, 208, 184, 0.18);
    --line-strong: rgba(57, 208, 184, 0.45);
    --text: #dfe6ea;
    --text-dim: #9aa7b0;
    --text-faint: #65717a;

    --font-heading: 'Orbitron', sans-serif;
    --font-mono: 'Share Tech Mono', ui-monospace, monospace;
    --font-body: 'Electrolize', system-ui, sans-serif;

    --header-h: 68px;
    --page-w: 1180px;
}

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

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 1.65;
    overflow-x: hidden;
    padding-bottom: 30px;      /* room for the fixed status bar */
}

img, video { max-width: 100%; display: block; }
a { color: var(--teal); }
a:hover { color: #fff; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }

.sr-only {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap;
}

/* Faint scanlines over everything, and a grid behind it. */
body::before {
    content: "";
    position: fixed; inset: 0;
    background: linear-gradient(rgba(0, 0, 0, 0) 50%, rgba(0, 0, 0, 0.14) 50%);
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 1000;
}

.grid-bg {
    position: fixed; inset: 0; z-index: -1;
    background-image:
        linear-gradient(rgba(57, 208, 184, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(57, 208, 184, 0.04) 1px, transparent 1px);
    background-size: 40px 40px;
}

/* --- Header ----------------------------------------------------------------- */

.site-header {
    position: sticky; top: 0; z-index: 100;
    height: var(--header-h);
    display: flex; align-items: center; justify-content: space-between; gap: 24px;
    padding: 0 clamp(16px, 4vw, 48px);
    background: rgba(6, 8, 12, 0.86);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--teal);
    text-decoration: none;
    text-shadow: 0 0 12px rgba(57, 208, 184, 0.45);
    white-space: nowrap;
}

.logo small {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    letter-spacing: 1px;
    color: var(--text-faint);
    margin-left: 8px;
    text-shadow: none;
}

.site-nav ul { display: flex; align-items: center; gap: clamp(14px, 2vw, 28px); list-style: none; }

.site-nav a {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-decoration: none;
    white-space: nowrap;
    color: var(--text);
    padding: 6px 0;
    border-bottom: 1px solid transparent;
    transition: color 0.2s, border-color 0.2s;
}

.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--teal); border-bottom-color: var(--line-strong); }
.site-nav a.nav-portal { color: var(--orange); }
.site-nav a.nav-portal:hover { color: #fff; border-bottom-color: var(--orange); }

.nav-toggle {
    display: none;
    background: none;
    border: 1px solid var(--line-strong);
    color: var(--teal);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    letter-spacing: 1px;
    padding: 8px 12px;
    cursor: pointer;
}

/* --- Buttons ---------------------------------------------------------------- */

.btn {
    display: inline-block;
    padding: 14px 34px;
    background: transparent;
    border: 1px solid var(--teal);
    color: var(--teal);
    font-family: var(--font-mono);
    font-size: 0.95rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}

.btn:hover { background: var(--teal); color: #03110e; box-shadow: 0 0 22px rgba(57, 208, 184, 0.45); }
.btn.btn-solid { background: var(--teal); color: #03110e; }
.btn.btn-solid:hover { background: #fff; border-color: #fff; }
.btn.btn-quiet { border-color: rgba(255, 255, 255, 0.25); color: var(--text); }
.btn.btn-quiet:hover { background: rgba(255, 255, 255, 0.1); color: #fff; box-shadow: none; }

/* --- Announcement strip ------------------------------------------------------ */

.announce {
    display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px 14px;
    padding: 10px 16px;
    background: linear-gradient(90deg, rgba(255, 107, 53, 0.14), rgba(57, 208, 184, 0.12));
    border-bottom: 1px solid var(--line);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    text-align: center;
    text-decoration: none;
    color: var(--text);
}

.announce:hover { color: #fff; }
.announce .tag-new { color: #1a0b04; background: var(--orange); padding: 1px 8px; letter-spacing: 1px; font-size: 0.75rem; }
.announce .go { color: var(--teal); }

/* --- Hero ------------------------------------------------------------------- */

.hero {
    position: relative;
    min-height: min(820px, calc(100vh - var(--header-h) - 40px));
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center;
    padding: 80px 6vw;
    overflow: hidden;
    isolation: isolate;
}

.hero-bg-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }

.hero-overlay {
    position: absolute; inset: 0; z-index: -1;
    background:
        radial-gradient(circle, rgba(5, 6, 10, 0.45) 0%, rgba(5, 6, 10, 0.82) 100%),
        linear-gradient(to bottom, transparent 60%, var(--bg));
}

.sub-intro {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: clamp(0.85rem, 1.6vw, 1.25rem);
    letter-spacing: clamp(2px, 0.5vw, 5px);
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.55);
    margin-bottom: 18px;
}

.hero h1 {
    font-family: var(--font-heading);
    font-size: clamp(1.1rem, 5.6vw, 4.8rem);
    letter-spacing: clamp(1px, 0.9vw, 14px);
    max-width: 100%;
    text-transform: uppercase;
    color: var(--green);
    text-shadow: 0 0 5px var(--green), 0 0 18px rgba(32, 194, 14, 0.55);
    margin-bottom: 18px;
}

.hero h1 span { color: #fff; text-shadow: 0 0 18px #fff; }

.hero-lede {
    font-family: var(--font-mono);
    font-size: clamp(1rem, 1.6vw, 1.2rem);
    color: var(--teal);
    max-width: 760px;
    margin-bottom: 34px;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }

.hero-note { margin-top: 22px; font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-faint); letter-spacing: 1px; }

/* --- Sections --------------------------------------------------------------- */

.section { padding: clamp(60px, 9vw, 110px) clamp(16px, 5vw, 60px); border-top: 1px solid var(--line); }
.section.alt { background: rgba(10, 13, 19, 0.7); }
.section-inner { max-width: var(--page-w); margin: 0 auto; }

.eyebrow {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: var(--teal);
    margin-bottom: 12px;
}

.section h2 {
    font-family: var(--font-heading);
    font-size: clamp(1.5rem, 3.2vw, 2.2rem);
    letter-spacing: 3px;
    text-transform: uppercase;
    color: #fff;
    margin-bottom: 20px;
}

.section p { color: var(--text-dim); max-width: 68ch; }
.section p + p { margin-top: 14px; }
.section-head { margin-bottom: 44px; }

.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 64px); align-items: center; }

/* Dev log window */
.log-terminal {
    background: #05060a;
    border: 1px solid var(--line);
    border-radius: 6px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.6);
    overflow: hidden;
    font-family: var(--font-mono);
}

.log-header { display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: var(--bg-raised); border-bottom: 1px solid var(--line); }
.log-header .dot { width: 8px; height: 8px; border-radius: 50%; }
.log-header .dot.red { background: #ff5f56; }
.log-header .dot.yellow { background: #ffbd2e; }
.log-header .dot.green { background: #27c93f; }
.log-header .title { margin-left: 8px; font-size: 0.75rem; letter-spacing: 2px; color: var(--text-faint); }

.log-body { height: 208px; padding: 14px; overflow: hidden; font-size: 0.8rem; line-height: 1.5; color: #a0c0b4; }
.log-line { margin-bottom: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.log-time { color: rgba(255, 255, 255, 0.3); }
.log-status { font-weight: bold; padding-right: 4px; }
.log-status.info { color: var(--teal); }
.log-status.success { color: var(--green); }
.log-status.alert { color: var(--amber); }
.log-status.trace { color: var(--violet); }
.log-status.danger { color: var(--orange); }

/* Feature cards */
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 22px; }

.card {
    position: relative;
    background: var(--bg-panel);
    border: 1px solid var(--line);
    padding: 30px 28px;
    transition: transform 0.25s, border-color 0.25s;
}

.card::after {
    content: "";
    position: absolute; top: -1px; left: -1px;
    width: 18px; height: 18px;
    border-top: 2px solid var(--teal);
    border-left: 2px solid var(--teal);
}

.card:hover { transform: translateY(-6px); border-color: var(--line-strong); }
.card h3 { font-family: var(--font-heading); font-size: 1rem; letter-spacing: 2px; text-transform: uppercase; color: var(--teal); margin-bottom: 14px; }
.card p { font-size: 0.95rem; color: var(--text-dim); }
.card .phase { margin-top: 16px; font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 1px; color: var(--text-faint); }
.card .phase.c-teal { color: var(--teal); }
.card .phase.c-orange { color: var(--orange); }
.card .phase.c-violet { color: var(--violet); }

/* Teaser gallery */
.shots { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; }
.shot { grid-column: span 4; }
.shot.wide { grid-column: span 8; }
.shot.half { grid-column: span 6; }

.shot button {
    display: block; width: 100%;
    padding: 0;
    background: #000;
    border: 1px solid var(--line);
    cursor: zoom-in;
    overflow: hidden;
    transition: border-color 0.25s, box-shadow 0.25s;
}

.shot button:hover { border-color: var(--line-strong); box-shadow: 0 0 26px rgba(57, 208, 184, 0.18); }
.shot img { width: 100%; height: 100%; aspect-ratio: 16 / 9; object-fit: cover; transition: transform 0.5s; }
.shot button:hover img { transform: scale(1.03); }

.shot figcaption { margin-top: 8px; font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-dim); }
.shot figcaption b { color: var(--teal); font-weight: normal; letter-spacing: 1px; text-transform: uppercase; }

.lightbox {
    position: fixed; inset: 0; z-index: 900;
    display: none; align-items: center; justify-content: center; flex-direction: column; gap: 14px;
    padding: 24px;
    background: rgba(3, 4, 7, 0.94);
    cursor: zoom-out;
}

.lightbox.open { display: flex; }
.lightbox img { max-width: min(1600px, 100%); max-height: calc(100vh - 110px); border: 1px solid var(--line-strong); }
.lightbox p { font-family: var(--font-mono); font-size: 0.9rem; color: var(--text); text-align: center; }
.lightbox-close { position: absolute; top: 14px; right: 18px; background: none; border: 0; color: var(--teal); font-size: 2rem; cursor: pointer; line-height: 1; }

/* Devlog teaser on the landing page */
.post-card {
    display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    border: 1px solid var(--line);
    background: var(--bg-panel);
    text-decoration: none;
    color: inherit;
    transition: border-color 0.25s, box-shadow 0.25s;
}

.post-card:hover { border-color: var(--line-strong); box-shadow: 0 0 30px rgba(57, 208, 184, 0.14); color: inherit; }
.post-card img { width: 100%; height: 100%; object-fit: cover; min-height: 220px; }
.post-card-body { padding: clamp(22px, 3vw, 38px); }
.post-card h3 { font-family: var(--font-heading); font-size: clamp(1.1rem, 2vw, 1.45rem); letter-spacing: 2px; text-transform: uppercase; color: #fff; margin: 8px 0 12px; }
.post-card p { color: var(--text-dim); font-size: 0.98rem; }
.post-meta { font-family: var(--font-mono); font-size: 0.8rem; letter-spacing: 2px; text-transform: uppercase; color: var(--orange); }
.post-card .go { display: inline-block; margin-top: 16px; font-family: var(--font-mono); letter-spacing: 1px; color: var(--teal); }

/* Development status */
.status-panel { background: var(--bg-panel); border: 1px solid var(--line); border-radius: 6px; padding: 28px; font-family: var(--font-mono); }
.status-panel h3 { font-family: var(--font-heading); font-size: 1.05rem; letter-spacing: 2px; color: var(--teal); margin-bottom: 16px; }
.status-panel h3 span { font-family: var(--font-mono); font-size: 0.8rem; color: var(--orange); margin-left: 8px; }
.status-list { list-style: none; display: grid; gap: 10px; font-size: 0.88rem; color: var(--text); }
.status-list li { display: grid; grid-template-columns: 34px 1fr; }
.status-list .done { color: var(--green); }
.status-list .now { color: var(--orange); }
.status-list .next { color: var(--cyan); }

/* Call to action */
.cta { display: flex; align-items: center; justify-content: space-between; gap: 40px; flex-wrap: wrap; }
.cta-actions { display: flex; flex-wrap: wrap; gap: 14px; }

/* Footer and status bar */
.site-footer { padding: 34px clamp(16px, 5vw, 60px) 48px; border-top: 1px solid var(--line); font-family: var(--font-mono); font-size: 0.82rem; color: var(--text-faint); }
.site-footer .section-inner { display: flex; flex-wrap: wrap; gap: 12px 30px; justify-content: space-between; }
.site-footer a { color: var(--text-dim); text-decoration: none; margin-right: 18px; }
.site-footer a:hover { color: var(--teal); }

.status-bar {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
    height: 30px;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 18px;
    background: rgba(6, 12, 13, 0.94);
    border-top: 1px solid var(--line);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 1px;
    color: var(--teal);
}

/* --- Sign-up modal ---------------------------------------------------------- */

.modal-overlay {
    position: fixed; inset: 0; z-index: 500;
    display: flex; align-items: center; justify-content: center;
    background: rgba(5, 6, 10, 0.86);
    backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s, visibility 0.25s;
}

.modal-overlay.active { opacity: 1; visibility: visible; }

.modal-content {
    position: relative;
    width: min(500px, 92vw);
    padding: 38px;
    background: var(--bg-panel);
    border: 1px solid var(--teal);
    box-shadow: 0 0 34px rgba(57, 208, 184, 0.2);
    transform: scale(0.94);
    transition: transform 0.25s;
}

.modal-overlay.active .modal-content { transform: scale(1); }
.modal-content h2 { font-family: var(--font-heading); font-size: 1.4rem; letter-spacing: 2px; color: var(--teal); margin-bottom: 12px; }
.modal-content h2 span { color: #fff; }
.modal-content p { font-size: 0.95rem; color: var(--text-dim); margin-bottom: 22px; }
.modal-close { position: absolute; top: 10px; right: 14px; background: none; border: 0; font-size: 1.8rem; line-height: 1; color: var(--teal); cursor: pointer; }
.modal-close:hover { color: #fff; }

.subscribe-form { display: flex; flex-direction: column; gap: 18px; }
.input-wrapper { display: flex; align-items: center; border: 1px solid var(--line-strong); background: rgba(0, 0, 0, 0.4); }
.input-wrapper:focus-within { border-color: var(--teal); box-shadow: 0 0 10px rgba(57, 208, 184, 0.3); }
.input-wrapper .prompt { font-family: var(--font-mono); color: var(--teal); padding-left: 14px; }
.input-wrapper input { width: 100%; padding: 14px 14px 14px 10px; background: transparent; border: 0; outline: 0; color: #fff; font-family: var(--font-mono); font-size: 1rem; }
.input-wrapper input::placeholder { color: rgba(255, 255, 255, 0.3); }
.form-note { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-faint); }

.status-msg { margin-top: 16px; min-height: 22px; font-family: var(--font-mono); font-size: 0.88rem; }
.status-msg.info { color: var(--teal); }
.status-msg.success { color: var(--green); }
.status-msg.error { color: var(--orange); }

/* --- Glitch (title only, brief, and off for reduced motion) ------------------ */

@keyframes glitch {
    0%, 6%, 94%, 100% { transform: none; }
    1% { transform: translate(-3px, 2px) skew(-10deg); }
    3% { transform: translate(3px, -2px) skew(12deg); }
    5% { transform: translate(-2px, -2px) skew(-6deg); }
    95% { transform: translate(3px, 2px) skew(10deg); }
    97% { transform: translate(-3px, -1px) skew(-12deg); }
    99% { transform: translate(2px, 2px) skew(6deg); }
}

.glitch { animation: glitch 6s infinite steps(1); }
.glitch-prompt { text-align: center; padding: 44px 0; font-family: var(--font-mono); font-size: 1.6rem; color: var(--amber); }
.glitch-prompt span { display: inline-block; }

/* --- Devlog post ------------------------------------------------------------ */

.post-hero { padding: clamp(50px, 8vw, 96px) clamp(16px, 5vw, 60px) 0; }
.post-hero .section-inner, .post-body { max-width: 860px; margin: 0 auto; }

.post-hero h1 {
    font-family: var(--font-heading);
    font-size: clamp(1.7rem, 4.6vw, 3rem);
    line-height: 1.2;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #fff;
    margin: 12px 0 18px;
}

.post-hero h1 em { font-style: normal; color: var(--teal); text-shadow: 0 0 16px rgba(57, 208, 184, 0.4); }
.post-standfirst { font-size: clamp(1.05rem, 1.8vw, 1.25rem); color: var(--text); max-width: 60ch; }
.post-figure-lead { max-width: 1180px; margin: clamp(30px, 5vw, 54px) auto 0; padding: 0 clamp(16px, 5vw, 60px); }

.post-body { padding: clamp(34px, 5vw, 60px) clamp(16px, 5vw, 60px) 40px; }
.post-body h2 { font-family: var(--font-heading); font-size: clamp(1.15rem, 2.3vw, 1.5rem); letter-spacing: 2px; text-transform: uppercase; color: var(--teal); margin: 52px 0 16px; }
.post-body h2:first-child { margin-top: 0; }
.post-body h3 { font-family: var(--font-mono); font-size: 1rem; letter-spacing: 1px; text-transform: uppercase; color: #fff; margin: 26px 0 8px; }
.post-body p { color: var(--text); margin-bottom: 16px; }
.post-body ul { margin: 0 0 18px 0; list-style: none; }
.post-body li { position: relative; padding-left: 24px; margin-bottom: 9px; color: var(--text); }
.post-body li::before { content: ">"; position: absolute; left: 2px; font-family: var(--font-mono); color: var(--teal); }
.post-body strong { color: #fff; }

.tldr { border: 1px solid var(--line-strong); border-left: 3px solid var(--teal); background: var(--bg-panel); padding: 22px 24px; margin-bottom: 40px; }
.tldr h2 { margin: 0 0 12px; font-size: 0.95rem; }
.tldr ul { margin-bottom: 0; }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin: 26px 0 30px; }
.fact { border: 1px solid var(--line); background: var(--bg-panel); padding: 16px; }
.fact b { display: block; font-family: var(--font-heading); font-size: 1.6rem; color: var(--teal); line-height: 1.2; }
.fact span { font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 1px; text-transform: uppercase; color: var(--text-dim); }

.compare { width: 100%; border-collapse: collapse; margin: 18px 0 26px; font-size: 0.95rem; }
.compare th, .compare td { text-align: left; vertical-align: top; padding: 11px 12px; border-bottom: 1px solid var(--line); }
.compare th { font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 1px; text-transform: uppercase; color: var(--teal); }
.compare td:first-child { color: var(--text-dim); white-space: nowrap; }

.post-figure { margin: 30px 0; }
.post-figure.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.post-figure .shot { grid-column: auto; }

.post-cta { border: 1px solid var(--line-strong); background: var(--bg-panel); padding: 28px; margin-top: 50px; }
.post-cta h2 { margin-top: 0; }
.post-cta .cta-actions { margin-top: 18px; }

.back-link { font-family: var(--font-mono); font-size: 0.85rem; letter-spacing: 1px; text-decoration: none; }

/* --- Small screens ---------------------------------------------------------- */

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

    .site-nav {
        position: absolute; top: var(--header-h); left: 0; right: 0;
        display: none;
        background: rgba(6, 8, 12, 0.98);
        border-bottom: 1px solid var(--line);
    }

    .site-nav.open { display: block; }
    .site-nav ul { flex-direction: column; align-items: stretch; gap: 0; padding: 8px 0; }
    .site-nav a { display: block; padding: 14px clamp(16px, 4vw, 48px); border: 0; }

    .split, .post-card { grid-template-columns: 1fr; }
    .shot, .shot.wide, .shot.half { grid-column: span 12; }
    .post-figure.pair { grid-template-columns: 1fr; }
    .compare td:first-child { white-space: normal; }
    .compare { display: block; overflow-x: auto; }
    .post-hero h1 { font-size: clamp(1.2rem, 5.4vw, 3rem); letter-spacing: 1px; overflow-wrap: anywhere; }
    .post-body h2 { overflow-wrap: anywhere; }
    .status-bar .hide-small { display: none; }
}

@media (max-width: 520px) {
    .logo { font-size: 0.9rem; letter-spacing: 2px; }
    .logo small { display: none; }
    .hero { padding: 60px 18px; }
    .btn { padding: 13px 22px; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .glitch { animation: none; }
    * { transition-duration: 0.01ms !important; }
}
