/* domain-v1 — surgical-instrument minimalism
   Palette:
     #F7F7F7 Surgical White (background)
     #1C1C1C Obsidian (primary FG, headings, active notch)
     #4A4A4A Tungsten (body)
     #9C9C9C Titanium (codes, incidental)
     #D4D4D4 Nickel (rules, dividers)
     #6E6E6E Graphite (hover state)
     #B0B0B0 (notch resting)
     #0E0E0E Void (terminus background)
*/

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

html {
    scroll-snap-type: y proximity;
    scroll-behavior: smooth;
}

body {
    background: #F7F7F7;
    color: #4A4A4A;
    font-family: 'Archivo', system-ui, sans-serif;
    font-weight: 400;
    font-size: clamp(0.9rem, 1vw, 1rem);
    line-height: 1.85;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* ----- The blade: centered narrow column ----- */
.content-blade {
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
    padding: 0 24px;
    text-align: left;
}

/* ----- Viewports / scroll-snap targets ----- */
.viewport {
    min-height: 100vh;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    scroll-snap-align: start;
    position: relative;
}

/* ----- Hero / Incision Point ----- */
.viewport-hero {
    justify-content: flex-start;
    padding-top: 40vh;
}

.domain-title {
    font-family: 'Archivo', sans-serif;
    font-weight: 200;
    font-size: clamp(2.8rem, 7vw, 5.5rem);
    letter-spacing: 0.20em;
    text-transform: uppercase;
    color: #1C1C1C;
    line-height: 1;
    margin-bottom: 80px;
}

.golden-line {
    position: relative;
    margin-bottom: 24px;
    width: 61.8%;
    height: 20px;
    display: flex;
    align-items: center;
}

.rule {
    display: block;
    height: 1px;
    background: #D4D4D4;
    transition: background-color 300ms ease-out;
}

.rule-golden {
    width: 100%;
}

.rule-full {
    width: 100%;
}

.rule-wrap {
    position: relative;
    margin-top: 80px;
    height: 20px;
    display: flex;
    align-items: center;
}

.rule-hitbox {
    position: absolute;
    inset: 0;
    height: 20px;
    cursor: pointer;
}

.rule-wrap .rule,
.golden-line .rule {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
}

.rule-wrap.is-hover .rule,
.golden-line.is-hover .rule {
    background: #1C1C1C;
    transition: background-color 150ms ease-out;
}

.hero-descriptor {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: 9px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #9C9C9C;
}

/* ----- Content sections ----- */
.viewport-section .content-blade > * {
    opacity: 0;
    transform: translateX(-8px);
    transition: opacity 300ms ease-out, transform 300ms ease-out;
}

.viewport-section .content-blade > .body-text {
    transform: none;
}

.viewport-section.is-revealed .section-code {
    opacity: 1;
    transform: translateX(0);
}

.viewport-section.is-revealed .section-title {
    opacity: 1;
    transform: translateX(0);
    transition-delay: 80ms;
}

.viewport-section.is-revealed .body-text {
    opacity: 1;
    transition-delay: 160ms;
}

.viewport-section.is-revealed .rule-wrap {
    opacity: 1;
    transition-delay: 240ms;
}

.section-code {
    display: block;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 10px;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: #9C9C9C;
    margin-bottom: 40px;
    transition: letter-spacing 200ms ease-out, color 200ms ease-out;
    cursor: default;
    display: inline-block;
}

.section-code:hover {
    letter-spacing: 0.35em;
    color: #6E6E6E;
}

.section-title {
    font-family: 'Archivo', sans-serif;
    font-weight: 500;
    font-size: clamp(1.3rem, 2.8vw, 2rem);
    letter-spacing: 0.06em;
    line-height: 1.15;
    color: #1C1C1C;
    margin-bottom: 40px;
    position: relative;
    display: inline-block;
    transform-origin: left center;
    transition: transform 250ms ease-out;
    cursor: default;
}

.section-title::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -8px;
    height: 1px;
    width: 0;
    background: #6E6E6E;
    transition: width 300ms ease-out;
}

.section-title:hover {
    transform: scale(1.015);
}

.section-title:hover::after {
    width: 100%;
}

.section-title.is-leaving::after {
    width: 0;
    transition: width 300ms ease-out;
}

.body-text {
    font-family: 'Archivo', sans-serif;
    font-weight: 400;
    color: #4A4A4A;
    margin-bottom: 40px;
}

.body-text:last-of-type {
    margin-bottom: 0;
}

/* ----- Interstice panels ----- */
.interstice {
    position: relative;
}

.ghost-code {
    position: absolute;
    top: 50vh;
    left: calc(50% + 20%);
    transform: translate(-50%, -50%);
    font-family: 'Archivo', sans-serif;
    font-weight: 200;
    font-size: 14px;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: #D4D4D4;
    opacity: 0.3;
    transition: opacity 600ms ease-out;
}

.interstice.is-active .ghost-code {
    opacity: 0.8;
}

/* ----- Notch rail ----- */
.notch-rail {
    position: fixed;
    top: 0;
    left: 24px;
    height: 100vh;
    width: 14px;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    align-items: flex-start;
    padding: 18vh 0;
    z-index: 50;
    pointer-events: none;
}

.notch {
    display: block;
    width: 3px;
    height: 1px;
    background: #B0B0B0;
    position: relative;
    transition: width 200ms ease-out, background-color 200ms ease-out;
    pointer-events: auto;
    cursor: pointer;
}

.notch.is-active {
    width: 12px;
    background: #1C1C1C;
}

.notch::after {
    content: "";
    position: absolute;
    left: 100%;
    top: 50%;
    width: 8px;
    height: 0.5px;
    background: #D4D4D4;
    transform-origin: left center;
    transform: translateY(-50%) rotate(-45deg);
    opacity: 0;
}

.notch.spark::after {
    animation: spark 400ms ease-out 1;
}

@keyframes spark {
    0% { opacity: 0; }
    40% { opacity: 0.6; }
    100% { opacity: 0; }
}

/* ----- Terminus ----- */
.viewport-terminal {
    background: #F7F7F7;
    color: #F7F7F7;
    transition: background-color 200ms steps(1, end);
}

.viewport-terminal.step-1 { background: #B0B0B0; }
.viewport-terminal.step-2 { background: #4A4A4A; }
.viewport-terminal.step-3 { background: #0E0E0E; }

.terminal-blade {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    min-height: 100vh;
    padding-top: 0;
}

.terminal-name {
    font-family: 'Archivo', sans-serif;
    font-weight: 200;
    font-size: 0.75rem;
    letter-spacing: 0.30em;
    text-transform: uppercase;
    color: #D4D4D4;
    margin-bottom: 24px;
    align-self: flex-start;
    opacity: 0;
    transition: opacity 600ms ease-out 600ms, color 200ms ease-out;
}

.viewport-terminal.step-3 .terminal-name {
    color: #F7F7F7;
    opacity: 1;
}

.terminal-rule {
    display: block;
    width: 100%;
    height: 1px;
    background: #F7F7F7;
    clip-path: inset(0 100% 0 0);
    transition: clip-path 1000ms ease-out 200ms, background-color 200ms ease-out;
}

.viewport-terminal.step-3 .terminal-rule {
    clip-path: inset(0);
    background: #F7F7F7;
}

/* ----- Responsive trim ----- */
@media (max-width: 720px) {
    .notch-rail { left: 10px; }
    .content-blade { padding: 0 32px; }
    .ghost-code { left: 70%; }
}
