/* =========================================================
   CORNERSTONE TECHDEV
   DESIGN SYSTEM
   Tokens and components shared by every page: type, buttons,
   tags, browser frames, reveals and the closing call to action.
   Prefixed .cs- so nothing clashes with index.css. Uses the
   brand tokens from index.css (--black, --beige-light ...).
========================================================= */


/* =========================================================
   TOKENS
========================================================= */

:root {
    --cs-font: "Space Grotesk", Arial, Helvetica, sans-serif;
    --cs-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;

    --cs-bg: #15120f;
    --cs-bg-2: #1a1612;
    --cs-card: #1e1915;
    --cs-card-hi: #241e19;
    --cs-line: rgba(255, 255, 255, 0.07);
    --cs-line-2: rgba(255, 255, 255, 0.12);
    --cs-gold: var(--beige-light, #e4b96f);
    --cs-amber: var(--beige, #c58a3d);
    --cs-gold-line: rgba(228, 185, 111, 0.22);
    --cs-gold-glow: rgba(228, 185, 111, 0.14);
    --cs-dim: #a39282;
    --cs-faint: #8a7a6a;
    --cs-ok: #9dbf7a;

    --cs-ease: cubic-bezier(0.22, 1, 0.36, 1);
    --cs-radius: 14px;
}


/* =========================================================
   BASICS
========================================================= */

.cs {
    font-family: var(--cs-font);
    color: var(--text-light);
}

.cs h1, .cs h2, .cs h3 { font-family: var(--cs-font); }

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

.cs-visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.cs-wrap {
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 24px;
}

.cs-section {
    position: relative;
    z-index: 2;
    padding: clamp(80px, 11vw, 140px) 0;
    background: var(--cs-bg);
    border-top: 1px solid var(--cs-line);
}

.cs-eyebrow {
    font-family: var(--cs-mono);
    font-size: 0.8rem;
    color: var(--cs-gold);
    margin-bottom: 18px;
}

.cs-h2 {
    font-size: clamp(2.2rem, 4.6vw, 3.7rem);
    line-height: 1.02;
    font-weight: 600;
    letter-spacing: -0.03em;
    color: var(--white);
    max-width: 780px;
    text-wrap: balance;
}
.cs-h2 span { display: block; color: var(--cs-dim); }
.cs-h2-sm { font-size: clamp(2rem, 3.6vw, 2.8rem); }

.cs-head { margin-bottom: clamp(44px, 6vw, 72px); }
.cs-head-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
}

.cs-lead {
    max-width: 580px;
    margin-top: 22px;
    color: var(--text-muted);
    font-size: 1.05rem;
    line-height: 1.7;
}

.cs-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }

.cs-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 50px;
    padding: 0 24px;
    border-radius: 10px;
    border: 1px solid transparent;
    font-family: var(--cs-font);
    font-size: 0.98rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.3s, border-color 0.3s, color 0.3s, transform 0.3s var(--cs-ease), box-shadow 0.3s;
}
.cs-btn:active { transform: translateY(1px); }
.cs-btn span { transition: transform 0.3s var(--cs-ease); }
.cs-btn:hover span { transform: translateX(3px); }

.cs-btn-primary {
    background: var(--cs-amber);
    color: #15120f;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 10px 30px -14px rgba(228, 185, 111, 0.7);
}
.cs-btn-primary:hover { background: var(--cs-gold); }

.cs-btn-ghost {
    background: rgba(255, 255, 255, 0.02);
    border-color: var(--cs-line-2);
    color: var(--white);
}
.cs-btn-ghost:hover { border-color: var(--cs-gold-line); background: var(--cs-gold-glow); }
.cs-btn-ghost.cs-mono { font-weight: 500; font-size: 0.92rem; }

.cs-link {
    font-family: var(--cs-mono);
    font-size: 0.86rem;
    color: var(--cs-gold);
    text-decoration: none;
    white-space: nowrap;
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s;
}
.cs-link:hover { border-color: currentColor; }

.cs-tags { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; }
.cs-tags li {
    font-family: var(--cs-mono);
    font-size: 0.72rem;
    padding: 4px 9px;
    border-radius: 6px;
    border: 1px solid var(--cs-line-2);
    color: var(--cs-dim);
}

.cs a:focus-visible,
.cs button:focus-visible,
.cs summary:focus-visible,
.cs [tabindex]:focus-visible {
    outline: 2px solid var(--cs-gold);
    outline-offset: 3px;
}

/* scroll reveal, only hidden once JS has marked the page */
.cs-js .reveal { transition: opacity 0.9s var(--cs-ease), transform 0.9s var(--cs-ease); }
.cs-js .reveal:not(.is-in) { opacity: 0; transform: translateY(26px); }



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

.cs-cta { background: var(--cs-bg); }

.cs-start {
    position: relative;
    overflow: hidden;
    padding: clamp(40px, 7vw, 88px) clamp(24px, 6vw, 80px);
    border-radius: 24px;
    border: 1px solid var(--cs-gold-line);
    background: #1a1511;
    text-align: center;
}
.cs-start-glow {
    position: absolute;
    left: 50%; bottom: -60%;
    width: 120%;
    aspect-ratio: 2;
    transform: translateX(-50%);
    border-radius: 50%;
    background: radial-gradient(closest-side, rgba(197, 138, 61, 0.35), transparent);
    pointer-events: none;
}
.cs-start-body { position: relative; max-width: 720px; margin: 0 auto; }
.cs-start h2 {
    font-size: clamp(2.2rem, 5vw, 3.8rem);
    line-height: 1.02;
    font-weight: 700;
    letter-spacing: -0.04em;
    color: var(--white);
}
.cs-start h2 span { display: block; color: var(--cs-gold); }

.cs-start-pick { border: 0; margin: 36px 0 0; padding: 0; }
.cs-start-pick legend { width: 100%; margin-bottom: 14px; font-family: var(--cs-mono); font-size: 0.8rem; color: var(--cs-dim); }
.cs-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.cs-chip {
    padding: 10px 16px;
    border-radius: 999px;
    border: 1px solid var(--cs-line-2);
    background: rgba(255, 255, 255, 0.02);
    font-family: var(--cs-font);
    font-size: 0.94rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: border-color 0.3s, background 0.3s, color 0.3s;
}
.cs-chip:hover { border-color: var(--cs-gold-line); color: var(--white); }
.cs-chip[aria-pressed="true"] { background: var(--cs-gold); border-color: var(--cs-gold); color: #15120f; font-weight: 600; }

.cs-start-msg {
    max-width: 560px;
    margin: 22px auto 0;
    padding: 14px 18px;
    border-radius: 10px;
    border: 1px dashed var(--cs-gold-line);
    background: #120f0c;
    font-family: var(--cs-mono);
    font-size: 0.84rem;
    color: var(--text-light);
    text-align: left;
    transition: filter 0.12s, opacity 0.12s;
}
.cs-start-msg.is-swapping { filter: blur(3px); opacity: 0.5; }
.cs-start-msg-key { color: var(--cs-gold); margin-right: 6px; }
.cs-start .cs-actions { justify-content: center; }




/* =========================================================
   SHARED PIECES (hero grid, status pill, frames, command line)
========================================================= */

.cs-hero-grid-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(var(--cs-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--cs-line) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(80% 80% at 60% 40%, #000 30%, transparent 80%);
    -webkit-mask-image: radial-gradient(80% 80% at 60% 40%, #000 30%, transparent 80%);
}

.cs-status {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 7px 14px 7px 12px;
    margin-bottom: 26px;
    border: 1px solid var(--cs-line-2);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.03);
    font-family: var(--cs-mono);
    font-size: 0.76rem;
    color: var(--text-muted);
}
.cs-status-dot {
    position: relative;
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--cs-ok);
}
.cs-status-dot::after {
    content: "";
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 1px solid var(--cs-ok);
    animation: cs-ping 2.2s var(--cs-ease) infinite;
}
@keyframes cs-ping {
    from { transform: scale(0.6); opacity: 1; }
    to   { transform: scale(1.8); opacity: 0; }
}

.cs-frame {
    display: block;
    overflow: hidden;
    border-radius: 12px;
    border: 1px solid var(--cs-line-2);
    background: #120f0c;
    box-shadow: 0 30px 60px -36px rgba(0, 0, 0, 0.9);
    transition: border-color 0.4s, transform 0.6s var(--cs-ease);
}
.cs-frame-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 9px 12px;
    background: #1a1612;
    border-bottom: 1px solid var(--cs-line);
}
.cs-frame-bar i { width: 8px; height: 8px; border-radius: 50%; background: #3a322b; }
.cs-frame-bar span { margin-left: 10px; font-family: var(--cs-mono); font-size: 0.7rem; color: var(--cs-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cs-frame img {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    object-position: left top;
    transition: transform 1s var(--cs-ease);
}
.cs-frame:hover { border-color: var(--cs-gold-line); }
.cs-frame:hover img { transform: scale(1.03); }

.cs-cmd {
    display: inline-block;
    margin-top: 22px;
    padding: 9px 14px;
    border-radius: 8px;
    border: 1px solid var(--cs-line);
    background: #120f0c;
    font-family: var(--cs-mono);
    font-size: 0.84rem;
    color: var(--text-muted);
}
.cs-cmd span { color: var(--cs-gold); margin-right: 6px; }



/* =========================================================
   PROCESS PIPELINE
   <ol class="cs-pipeline" data-pipeline style="--cols: 3">
   The track fills as it scrolls into view (js/site.js).
========================================================= */

.cs-pipeline {
    --cols: 4;
    --gap: 24px;
    --progress: 0;
    position: relative;
    display: grid;
    grid-template-columns: repeat(var(--cols), 1fr);
    gap: var(--gap);
    list-style: none;
    padding-top: 30px;
}
.cs-pipeline::before,
.cs-pipeline::after {                            /* the track, and its fill: first node to last node */
    content: "";
    position: absolute;
    top: 52px;
    left: 23px;
    right: calc((100% - (var(--cols) - 1) * var(--gap)) / var(--cols) - 23px);
    height: 2px;
    border-radius: 2px;
    background: var(--cs-line-2);
}
.cs-pipeline::after {
    background: linear-gradient(90deg, var(--cs-amber), var(--cs-gold));
    box-shadow: 0 0 14px rgba(228, 185, 111, 0.5);
    transform-origin: left;
    transform: scaleX(var(--progress));
    transition: transform 0.2s linear;
}
.cs-stage { position: relative; z-index: 1; }
.cs-node {
    display: grid;
    place-items: center;
    width: 46px; height: 46px;
    margin-bottom: 26px;
    border-radius: 12px;
    border: 1px solid var(--cs-line-2);
    background: #1e1915;
    font-family: var(--cs-mono);
    font-size: 0.82rem;
    color: var(--cs-dim);
    transition: border-color 0.4s, color 0.4s, background 0.4s, box-shadow 0.4s;
}
.cs-stage.is-done .cs-node {
    border-color: var(--cs-gold);
    color: #15120f;
    background: var(--cs-gold);
    box-shadow: 0 0 24px rgba(228, 185, 111, 0.4);
}
.cs-stage-time { font-family: var(--cs-mono); font-size: 0.74rem; color: var(--cs-gold); margin-bottom: 8px; }
.cs-stage h3 { font-size: 1.4rem; font-weight: 600; letter-spacing: -0.02em; color: var(--white); margin-bottom: 10px; }
.cs-stage p:last-child { color: var(--text-muted); line-height: 1.6; font-size: 0.97rem; }
.cs-stage.is-live.is-done .cs-node { background: var(--cs-ok); border-color: var(--cs-ok); box-shadow: 0 0 24px rgba(157, 191, 122, 0.45); }

@media (max-width: 1080px) {
    .cs-pipeline { grid-template-columns: 1fr 1fr; row-gap: 44px; }
    .cs-pipeline::before, .cs-pipeline::after { display: none; }
}

@media (max-width: 720px) {
    .cs-pipeline { grid-template-columns: 1fr; row-gap: 32px; }
}


/* =========================================================
   REDUCED MOTION
========================================================= */

@media (prefers-reduced-motion: reduce) {
    .cs *, .cs *::before, .cs *::after { animation: none !important; transition-duration: 0.01ms !important; transition-delay: 0s !important; }
}
