/* ===================== Tokens ===================== */
:root {
    --bg: #08080a;
    --bg-raised: #111114;
    --bg-raised-2: #16161a;
    --border: #222228;
    --border-soft: #1a1a1f;
    --text: #ededef;
    --text-muted: #9a9aa3;
    --text-faint: #5d5d66;
    --gold: #d4af5a;
    --gold-bright: #e8c878;
    --red: #e03d3d;
    --red-dim: rgba(224, 61, 61, 0.14);
    --radius: 10px;
    --max-width: 1240px;
    --font-sans:
        "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-mono: "IBM Plex Mono", "SF Mono", monospace;
}

* {
    box-sizing: border-box;
}
html {
    scroll-behavior: smooth;
}
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    -webkit-font-smoothing: antialiased;
    line-height: 1.5;
}
img,
svg {
    display: block;
    max-width: 100%;
}
a {
    color: inherit;
    text-decoration: none;
}
ul,
ol {
    margin: 0;
    padding: 0;
    list-style: none;
}
h1,
h2,
h3,
p {
    margin: 0;
}

.grid-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
    background-size: 72px 72px;
    mask-image: radial-gradient(
        ellipse 90% 60% at 50% 0%,
        black 30%,
        transparent 100%
    );
}

.section-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 32px;
    position: relative;
    z-index: 1;
}
.section-inner.narrow {
    max-width: 720px;
}

.eyebrow {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 18px;
    font-weight: 500;
}
.hero .eyebrow {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.18em;
    color: var(--gold-bright);
}

.section-head h2 {
    font-size: clamp(26px, 3.6vw, 40px);
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.2;
    color: var(--text);
    margin-bottom: 20px;
}
.section-sub {
    font-size: 17px;
    line-height: 1.7;
    color: var(--text-muted);
}

/* ===================== Buttons / Links ===================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 14px;
    padding: 11px 22px;
    border-radius: 6px;
    border: 1px solid transparent;
    cursor: pointer;
    transition:
        background 0.18s ease,
        transform 0.18s ease;
    white-space: nowrap;
    text-decoration: none;
}
.btn-primary {
    background: var(--gold);
    color: #13100a;
}
.btn-primary:hover {
    background: var(--gold-bright);
    transform: translateY(-1px);
}
.btn-lg {
    padding: 16px 32px;
    font-size: 15px;
}
.btn-block {
    width: 100%;
}

.link-arrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    transition: color 0.18s ease;
}
.link-arrow:hover {
    color: var(--text);
}
.link-arrow span {
    transition: transform 0.18s ease;
}
.link-arrow:hover span {
    transform: translateX(3px);
}

/* ===================== Header ===================== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(8, 8, 10, 0.8);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-soft);
}
.header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 18px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
}
.logo-mark {
    color: var(--gold);
    display: flex;
}
.logo-text {
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.1em;
}
.logo-sm .logo-text {
    font-size: 12px;
}

/* ===================== Reveal ===================== */
.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition:
        opacity 0.7s ease,
        transform 0.7s ease;
}
.reveal.in-view {
    opacity: 1;
    transform: translateY(0);
}

/* ===================== Hero ===================== */
.hero {
    position: relative;
    padding: 120px 32px 100px;
    text-align: center;
    overflow: hidden;
}
.hero::before {
    content: "";
    position: absolute;
    top: -240px;
    left: 50%;
    width: 1000px;
    height: 580px;
    background: radial-gradient(
        ellipse at center,
        rgba(212, 175, 90, 0.13),
        transparent 68%
    );
    transform: translateX(-50%);
    z-index: 0;
    pointer-events: none;
}
.hero-inner {
    max-width: 1120px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 28px;
}
.hero h1 {
    font-size: clamp(32px, 5vw, 58px);
    font-weight: 800;
    letter-spacing: -0.025em;
    line-height: 1.1;
    color: var(--text);
}
.hero-sub {
    font-size: clamp(16px, 1.5vw, 18px);
    line-height: 1.65;
    color: var(--text-muted);
    max-width: 580px;
}
.hero-fade {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: linear-gradient(transparent, var(--bg));
    pointer-events: none;
}

/* ===================== Lifecycle Diagram ===================== */
.lifecycle {
    display: grid;
    grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr;
    align-items: start;
    gap: 0;
    width: 100%;
    max-width: 1120px;
    margin: 12px auto 0;
    text-align: left;
}
.lifecycle-phase {
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 20px 18px 22px;
    position: relative;
    transition: border-color 0.2s ease;
}
.lifecycle-phase:hover {
    border-color: rgba(212, 175, 90, 0.3);
}
.lifecycle-phase[data-phase="1"] .phase-num {
    color: #d4af5a;
}
.lifecycle-phase[data-phase="2"] .phase-num {
    color: #a8c4d4;
}
.lifecycle-phase[data-phase="3"] .phase-num {
    color: #a0c8a0;
}
.lifecycle-phase[data-phase="4"] .phase-num {
    color: #c4a8d4;
}

.phase-head {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 10px;
}
.phase-num {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
}
.phase-label {
    font-size: 17px;
    font-weight: 700;
    color: var(--text);
}
.phase-copy {
    font-size: 14px;
    line-height: 1.55;
    color: var(--text-faint);
}
.lifecycle-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 8px;
    margin-top: 32px;
    color: var(--text-faint);
    flex-shrink: 0;
}

/* ===================== Proof Section ===================== */
.proof-section {
    padding: 100px 0 110px;
    border-top: 1px solid var(--border-soft);
}
.section-head {
    margin-bottom: 44px;
}
.section-head h2 {
    max-width: 800px;
}

.proof-player {
    position: relative;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 30px 90px -20px rgba(0, 0, 0, 0.8);
    background: #0c0c0f;
    line-height: 0;
}
.proof-gif {
    display: block;
    width: 100%;
    height: auto;
}
.proof-player:fullscreen {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0;
}
.proof-player:fullscreen .proof-gif {
    max-height: 100%;
    width: auto;
}

/* custom video controls */
.pp-controls {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    line-height: 1;
    background: linear-gradient(
        to top,
        rgba(8, 8, 10, 0.92) 0%,
        rgba(8, 8, 10, 0.55) 60%,
        rgba(8, 8, 10, 0) 100%
    );
    opacity: 0;
    transform: translateY(6px);
    transition:
        opacity 0.25s ease,
        transform 0.25s ease;
}
.proof-player:hover .pp-controls,
.proof-player:focus-within .pp-controls,
.pp-controls.pp-visible {
    opacity: 1;
    transform: translateY(0);
}
.pp-btn {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    transition:
        color 0.15s ease,
        background 0.15s ease;
}
.pp-btn:hover {
    color: var(--gold-bright);
    background: rgba(212, 175, 90, 0.12);
}
.pp-btn:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
}
.pp-icon-pause {
    display: none;
}
.proof-player.pp-playing .pp-icon-play {
    display: none;
}
.proof-player.pp-playing .pp-icon-pause {
    display: block;
}

.pp-track {
    position: relative;
    flex: 1 1 auto;
    height: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
}
.pp-track::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    height: 4px;
    border-radius: 4px;
    background: rgba(237, 237, 239, 0.22);
}
.pp-fill {
    position: absolute;
    left: 0;
    height: 4px;
    width: 0;
    border-radius: 4px;
    background: var(--gold);
}
.pp-thumb {
    position: absolute;
    left: 0;
    width: 12px;
    height: 12px;
    margin-left: -6px;
    border-radius: 50%;
    background: var(--gold-bright);
    box-shadow: 0 0 0 3px rgba(212, 175, 90, 0.25);
    opacity: 0;
    transition: opacity 0.15s ease;
}
.pp-track:hover .pp-thumb,
.pp-track:focus-visible .pp-thumb {
    opacity: 1;
}
.pp-track:focus-visible {
    outline: none;
}
.pp-time {
    flex: none;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-muted);
    letter-spacing: 0.02em;
    font-variant-numeric: tabular-nums;
}
.terminal-player {
    background: #0c0c0f;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 30px 90px -20px rgba(0, 0, 0, 0.8);
    position: relative;
}
.terminal-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 18px;
    background: var(--bg-raised-2);
    border-bottom: 1px solid var(--border);
}
.tbar-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}
.tbar-red {
    background: #ff5f57;
}
.tbar-yellow {
    background: #ffbd2e;
}
.tbar-green {
    background: #28c841;
}
.tbar-title {
    flex: 1;
    text-align: center;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-faint);
    letter-spacing: 0.04em;
    margin-right: 26px;
}
.terminal-body {
    padding: 28px 30px 36px;
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.7;
    min-height: 280px;
    position: relative;
}
.term-lines {
    position: relative;
    z-index: 1;
}
.term-line {
    display: flex;
    align-items: baseline;
    gap: 8px;
    opacity: 0;
    transform: translateY(4px);
    transition:
        opacity 0.25s ease,
        transform 0.25s ease;
}
.term-line.show {
    opacity: 1;
    transform: translateY(0);
}
.term-prompt {
    color: var(--gold);
    flex-shrink: 0;
    user-select: none;
}
.term-cmd {
    color: var(--text);
}
.term-info {
    color: #6a8faf;
    padding-left: 2px;
}
.term-success {
    color: #5ab870;
}
.term-warn {
    color: #e0a030;
}
.term-error {
    color: var(--red);
    font-weight: 600;
}
.term-spacer {
    height: 10px;
}
.term-cursor {
    display: inline-block;
    width: 8px;
    height: 15px;
    background: var(--gold);
    margin-left: 2px;
    vertical-align: middle;
    animation: blink 1s step-end infinite;
    opacity: 0;
    transition: opacity 0.1s;
}
.term-cursor.visible {
    opacity: 1;
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

/* Red validation flash */
.term-flash {
    position: absolute;
    inset: 0;
    background: rgba(180, 20, 20, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s ease;
    z-index: 10;
    pointer-events: none;
}
.term-flash.show {
    opacity: 1;
}
.flash-inner {
    text-align: center;
}
.flash-icon {
    font-size: 48px;
    color: #fff;
    margin-bottom: 14px;
}
.flash-title {
    font-family: var(--font-mono);
    font-size: clamp(18px, 3vw, 28px);
    font-weight: 600;
    color: #fff;
    letter-spacing: 0.04em;
    margin-bottom: 10px;
}
.flash-sub {
    font-family: var(--font-mono);
    font-size: 16px;
    color: rgba(255, 255, 255, 0.75);
    letter-spacing: 0.02em;
}

/* Black cut with logo */
.term-blackout {
    position: absolute;
    inset: 0;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: 20;
    pointer-events: none;
}
.term-blackout.show {
    opacity: 1;
}
.blackout-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}
.blackout-logo span {
    font-family: var(--font-mono);
    font-size: 14px;
    letter-spacing: 0.14em;
    color: var(--gold);
}

.proof-caption {
    margin-top: 30px;
    font-size: 15px;
    line-height: 1.65;
    color: var(--text-muted);
    max-width: 680px;
}
.proof-caption strong {
    color: var(--text);
}
.proof-cta {
    margin-top: 18px;
}

/* ===================== Thesis ===================== */
.thesis-section {
    padding: 110px 0;
    border-top: 1px solid var(--border-soft);
    background: linear-gradient(
        to bottom,
        rgba(212, 175, 90, 0.03),
        transparent 60%
    );
}
.thesis-section .section-head {
    margin-bottom: 50px;
}
.thesis-section .section-head h2 {
    font-size: clamp(28px, 4vw, 44px);
    max-width: 100%;
}
.thesis-body {
    display: flex;
    flex-direction: column;
    gap: 32px;
}
.thesis-body p {
    font-size: 18px;
    line-height: 1.75;
    color: var(--text-muted);
    padding-bottom: 32px;
    border-bottom: 1px solid var(--border-soft);
}
.thesis-body p:last-child {
    padding-bottom: 0;
    border-bottom: none;
}
.thesis-body strong {
    color: var(--text);
    font-weight: 600;
}

/* ===================== Gate / Form ===================== */
.gate-section {
    padding: 100px 0 140px;
    border-top: 1px solid var(--border-soft);
}
.gate-head {
    margin-bottom: 48px;
}
.gate-head h2 {
    font-size: clamp(26px, 3.8vw, 42px);
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-bottom: 20px;
}
.gate-head .section-sub {
    max-width: 640px;
}

.apply-form {
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 42px;
    display: flex;
    flex-direction: column;
    gap: 22px;
    box-shadow: 0 40px 100px -30px rgba(0, 0, 0, 0.7);
}
.form-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.form-row-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
}
.form-row label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
}
.form-row input,
.form-row select,
.form-row textarea {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 7px;
    padding: 13px 14px;
    font-family: var(--font-sans);
    font-size: 15px;
    color: var(--text);
    outline: none;
    width: 100%;
    transition: border-color 0.15s ease;
}
.form-row select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%239a9aa3'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    cursor: pointer;
}
.form-row textarea {
    resize: vertical;
    min-height: 80px;
    font-family: var(--font-sans);
}
.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
    border-color: var(--gold);
}
.form-row input::placeholder,
.form-row textarea::placeholder {
    color: var(--text-faint);
}
.apply-form .btn-lg {
    margin-top: 6px;
}
.form-status {
    text-align: center;
    font-size: 14px;
    color: var(--gold);
    min-height: 18px;
}

/* ===================== Footer ===================== */
.site-footer {
    border-top: 1px solid var(--border-soft);
    padding: 32px;
}
.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}
.footer-copy {
    font-size: 13px;
    color: var(--text-faint);
}
.footer-links {
    display: flex;
    gap: 20px;
    margin-left: auto;
}
.footer-links a {
    font-size: 13px;
    color: var(--text-faint);
    transition: color 0.15s ease;
}
.footer-links a:hover {
    color: var(--text-muted);
}

/* ===================== Responsive ===================== */
@media (max-width: 900px) {
    .lifecycle {
        grid-template-columns: 1fr;
        max-width: 420px;
    }
    .lifecycle-arrow {
        margin: 0;
        padding: 6px 0;
        transform: rotate(90deg);
    }
}

@media (max-width: 600px) {
    .hero {
        padding: 100px 20px 80px;
    }
    .section-inner {
        padding: 0 20px;
    }
    .apply-form {
        padding: 28px 22px;
    }
    .form-row-group {
        grid-template-columns: 1fr;
    }
    .footer-links {
        margin-left: 0;
    }
    .terminal-body {
        padding: 20px 18px 28px;
        font-size: 11.5px;
    }
}
