/* ============================================================
   csoftlabs — scene presentation
   full-screen scenes · schematic visuals · italic display · zero radius
   accent = brand red from the original site (one token: --accent)
   ============================================================ */

:root {
    --bg:       #0d0a09;
    --surface:  #151110;
    --ink:      #f4efe9;
    --muted:    #a59c95;
    --line:     #36302c;
    --accent:   #ff4a3d;
    --accent-2: #8a241b;

    --sans: 'IBM Plex Sans', Arial, sans-serif;
    --mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
    --pad:  clamp(24px, 6vw, 112px);
    --ease: cubic-bezier(.2, .75, .15, 1);

    color-scheme: dark;
    font-family: var(--sans);
    font-synthesis: none;
    background: var(--bg);
    color: var(--ink);
}

*, *::before, *::after { box-sizing: border-box; border-radius: 0; }
html, body { max-width: 100%; overflow-x: clip; }
body { margin: 0; background: var(--bg); }
body.enhanced { height: 100dvh; overflow: hidden; overscroll-behavior: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: default; opacity: .25; }
h1, h2, h3, p, ol, ul { margin: 0; padding: 0; }
ol, ul { list-style: none; }
h1, h2 { text-wrap: balance; }
em { font-style: italic; color: var(--accent); }
img, svg { display: block; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 6px; }
::selection { background: var(--accent); color: var(--bg); }

.svg-library { position: absolute; width: 0; height: 0; overflow: hidden; }
svg use { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: square; stroke-linejoin: miter; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: fixed; z-index: 100; left: 24px; top: 12px; transform: translateY(-150%); padding: 12px 18px; background: var(--accent); color: var(--bg); }
.skip-link:focus { transform: none; }

/* ---------- header ---------- */
.site-header {
    position: fixed; inset: 0 0 auto; z-index: 40; height: 86px; padding: 0 var(--pad);
    display: flex; align-items: center; justify-content: space-between;
    border-bottom: 1px solid var(--line); background: var(--bg);
    transition: color 500ms, border-color 500ms, background 500ms;
}
.wordmark { display: inline-flex; align-items: baseline; gap: 10px; min-height: 44px; align-items: center; }
.wordmark b { font-size: 26px; font-style: italic; font-weight: 600; letter-spacing: -1px; }
.wordmark small { font: 10px/1 var(--mono); letter-spacing: 2px; color: var(--muted); }
.header-right { display: flex; gap: 32px; align-items: center; }
.header-link { display: flex; gap: 9px; align-items: center; font-size: 14px; min-height: 44px; }
.header-link svg { width: 16px; height: 16px; transition: transform 180ms; }
.header-link:hover svg { transform: translate(2px, -2px); }
.status-tag { display: flex; gap: 9px; align-items: center; font: 11px/1 var(--mono); letter-spacing: 1.7px; white-space: nowrap; }
.status-tag::before { content: ''; width: 7px; height: 7px; background: var(--accent); }
.icon-button { width: 46px; height: 46px; display: grid; place-items: center; border: 1px solid var(--line); transition: background 180ms, color 180ms, border-color 180ms; }
.icon-button svg { width: 19px; height: 19px; }
.icon-button:hover:not(:disabled) { background: var(--accent); color: var(--bg); border-color: var(--accent); }

/* ---------- scene system ---------- */
.scene { position: relative; min-height: 100svh; overflow: hidden; background: var(--bg); }
.scene::before { content: ''; position: absolute; top: 0; bottom: 0; left: 54%; width: 1px; background: #ffffff07; pointer-events: none; }
.enhanced main { position: fixed; inset: 0; }
.enhanced .scene {
    position: absolute; inset: 0; min-height: 0; height: 100%;
    visibility: hidden; pointer-events: none; overflow: auto;
    scrollbar-width: thin; scrollbar-color: var(--line) transparent; overscroll-behavior: contain;
}
.enhanced .scene.is-current { visibility: visible; pointer-events: auto; }
.enhanced .scene.is-leaving { visibility: visible; pointer-events: none; }
[hidden] { display: none !important; }

.scene-grid {
    min-height: 100svh; padding: 118px var(--pad) 116px;
    display: grid; grid-template-columns: 1fr 1fr; gap: clamp(36px, 5vw, 110px); align-items: center;
}
/* at least one screen tall, grows with content so bottom padding stays
   below the last item (a fixed height pushed it under the footer) */
.enhanced .scene-grid { min-height: 100%; height: auto; align-content: center; }
.copy { position: relative; z-index: 2; max-width: 650px; }
.eyebrow { font: 11px/1.5 var(--mono); letter-spacing: 1.7px; text-transform: uppercase; color: var(--muted); margin-bottom: 34px; }
.section-title { font-size: clamp(43px, 5.4vw, 88px); font-weight: 420; line-height: 1.04; letter-spacing: -.055em; margin-bottom: 34px; }
.section-title em { font-weight: 460; }
.description { font-size: clamp(16px, 1.25vw, 20px); line-height: 1.6; color: var(--muted); max-width: 480px; text-wrap: pretty; }
.side-caption { padding-top: 28px; margin-top: 36px; border-top: 1px solid var(--line); color: var(--muted); font-size: 15px; line-height: 1.5; max-width: 100%; width: max-content; }
.side-caption b { color: var(--ink); font-weight: 500; }
.edge-note { position: absolute; bottom: 128px; right: var(--pad); writing-mode: vertical-rl; font: 9px/1 var(--mono); letter-spacing: 2px; color: #7c726b; }

.button {
    display: inline-flex; align-items: center; justify-content: space-between; gap: 32px;
    min-height: 54px; padding: 15px 22px; font-size: 15px; font-weight: 500;
    transition: transform 180ms, box-shadow 180ms;
}
.button svg { width: 20px; height: 20px; flex-shrink: 0; transition: transform 180ms; }
.button:hover { transform: translate(-3px, -3px); box-shadow: 5px 5px 0 var(--accent-2); }
.button:hover svg { transform: translateX(3px); }
.button:active { transform: none; box-shadow: none; }
.primary { background: var(--accent); color: var(--bg); }

/* ---------- hero ---------- */
.hero-name { position: relative; display: table; font-size: clamp(84px, 10.5vw, 176px); font-style: italic; font-weight: 600; letter-spacing: -.075em; line-height: .84; padding-right: .1em; margin-left: -.04em; margin-bottom: 30px; }
.hero-name > span { position: absolute; right: 0; bottom: 0; font: 10px/1 var(--mono); font-style: normal; letter-spacing: 3px; color: var(--muted); transform: translate(10px, 20px); }
.hero-promise { font-size: clamp(30px, 3vw, 52px); font-weight: 420; line-height: 1.05; letter-spacing: -.04em; margin-bottom: 24px; }
.hero .button { margin-top: 30px; }

.visual { position: relative; width: 100%; height: min(58vh, 550px); min-height: 360px; transform: translate3d(var(--px, 0px), var(--py, 0px), 0); will-change: transform; }
.visual-topline { position: absolute; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; gap: 20px; padding-bottom: 17px; border-bottom: 1px solid var(--line); font: 9px/1.5 var(--mono); letter-spacing: 1.2px; color: var(--muted); }

.hero-visual { isolation: isolate; }
.axis { position: absolute; background: var(--line); opacity: .6; }
.axis-x { left: 0; right: 0; top: 50%; height: 1px; }
.axis-y { top: 0; bottom: 0; left: 50%; width: 1px; }
.coordinate { position: absolute; font: 9px/1 var(--mono); letter-spacing: 2px; color: var(--muted); }
.coordinate.top { left: 0; top: 0; }
.coordinate.bottom { right: 0; bottom: 0; }
.plane { position: absolute; width: 56%; aspect-ratio: 4 / 5; left: 22%; top: 50%; transform: translateY(-50%); border: 1px solid #6e625a; }
.plane-back { transform: translate(40px, calc(-50% - 40px)); opacity: .3; }
.plane-mid { transform: translate(20px, calc(-50% - 20px)); opacity: .6; }
.plane-front { border: 0; overflow: hidden; background: var(--surface); box-shadow: 14px 14px 0 #000; }
.plane-front img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.1) brightness(.92); }
.plane-front::after { content: ''; position: absolute; inset: 0; background: linear-gradient(200deg, transparent 45%, var(--accent)); mix-blend-mode: multiply; opacity: .55; }
.plane-tag { position: absolute; z-index: 2; top: 12px; left: 12px; font: 9px/1 var(--mono); letter-spacing: 1.5px; background: var(--bg); padding: 7px 9px; }
.visual-caption { position: absolute; bottom: 5%; left: 4%; z-index: 3; display: flex; align-items: center; gap: 10px; font: 11px/1.5 var(--mono); color: var(--muted); background: var(--bg); padding: 10px 12px; }
.visual-caption b { color: var(--ink); font-weight: 500; }
body[data-motion=on] .is-current .plane-back { animation: back-plane 7s ease-in-out infinite alternate; }
body[data-motion=on] .is-current .plane-mid { animation: mid-plane 7s ease-in-out infinite alternate; }
@keyframes back-plane { to { transform: translate(56px, calc(-50% - 56px)); } }
@keyframes mid-plane { to { transform: translate(29px, calc(-50% - 29px)); } }

/* ---------- numbered list (whoami / principles) ---------- */
.points { border-top: 1px solid var(--line); }
.point { display: grid; grid-template-columns: 46px 1fr; gap: 14px; padding: 20px 0; border-bottom: 1px solid var(--line); transition: padding-left 220ms var(--ease); }
.point:hover { padding-left: 10px; }
.point-n { font: 10px/2 var(--mono); color: var(--accent); letter-spacing: 1px; }
.point h3 { font-size: clamp(18px, 1.5vw, 24px); font-weight: 500; letter-spacing: -.02em; margin-bottom: 6px; }
.point p { font-size: 14px; line-height: 1.5; color: var(--muted); }
.points.muted .point-n { color: var(--muted); }
.points.muted h3 { color: var(--muted); }

/* ---------- stack schematic ---------- */
.schematic-lines { position: absolute; inset: 10% 0 0; width: 100%; height: 84%; fill: none; stroke: var(--line); stroke-width: 1; }
.signal-path { stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 36 380; }
body[data-motion=on] .is-current .signal-path { animation: signal 6s linear infinite; }
@keyframes signal { to { stroke-dashoffset: -832; } }
.core { position: absolute; left: 50%; top: 52%; transform: translate(-50%, -50%); width: 104px; height: 96px; display: grid; align-content: center; text-align: center; background: var(--accent); color: var(--bg); box-shadow: 0 0 0 12px var(--bg); }
.core > b { font-size: 40px; line-height: 1; font-weight: 600; font-style: italic; letter-spacing: -3px; }
.core > small { font: 9px/1 var(--mono); letter-spacing: 2px; margin-top: 10px; }
.choice { position: absolute; width: 38%; text-align: left; padding: 14px 16px 13px; border: 1px solid var(--line); background: var(--bg); font-size: clamp(20px, 2.1vw, 32px); font-style: italic; letter-spacing: -1px; line-height: 1.1; transition: color 220ms, border-color 220ms, transform 220ms; }
.choice small { display: block; margin-bottom: 10px; font: 9px/1 var(--mono); font-style: normal; letter-spacing: 1.5px; color: var(--muted); }
.choice > span { position: absolute; right: 14px; bottom: 15px; font-size: 20px; font-style: normal; opacity: 0; transition: opacity 180ms; }
.choice:hover { border-color: var(--muted); transform: translateY(-3px); }
.choice.selected { border-color: var(--accent); color: var(--accent); }
.choice.selected > span { opacity: 1; }
.c-web { left: 0; top: 17%; } .c-data { right: 0; top: 17%; }
.c-platform { left: 0; bottom: 17%; } .c-ai { right: 0; bottom: 17%; }
.schematic-caption { position: absolute; bottom: 3%; left: 0; right: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; justify-content: center; font: 11px/1.4 var(--mono); }
.schematic-caption #stack-name { color: var(--accent); }
.schematic-caption #stack-tools { color: var(--muted); }

/* ---------- workbench (work / awards) ---------- */
.workbench { position: relative; border: 1px solid #574b44; background: #110d0c; box-shadow: 12px 12px 0 #000; align-self: center; transform: translate3d(var(--px, 0px), var(--py, 0px), 0); }
.wb-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 18px 20px; border-bottom: 1px solid var(--line); font: 10px/1.4 var(--mono); letter-spacing: 1px; }
.wb-head small { color: var(--muted); font-size: 8px; letter-spacing: .5px; }
.wb-head .dot { display: inline-block; width: 7px; height: 7px; margin-right: 8px; background: var(--accent); vertical-align: middle; }
.tabs { display: flex; border-bottom: 1px solid var(--line); }
.tabs button { flex: 1; min-height: 47px; padding: 10px 4px; font: 10px/1 var(--mono); letter-spacing: .5px; color: var(--muted); border-right: 1px solid var(--line); transition: background 180ms, color 180ms; }
.tabs button:last-child { border-right: 0; }
.tabs button[aria-selected=true] { background: var(--accent); color: var(--bg); }
.tabs button:hover:not([aria-selected=true]) { color: var(--ink); background: #ffffff08; }
.panel { height: clamp(250px, 40vh, 360px); overflow-y: auto; padding: 6px 22px 10px; scrollbar-width: thin; scrollbar-color: var(--line) transparent; overscroll-behavior: contain; }
.row { display: grid; grid-template-columns: 26px 1fr auto; gap: 12px; align-items: baseline; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.row:last-child { border-bottom: 0; }
.row > span:first-child { font: 9px/1 var(--mono); color: var(--muted); }
.row strong { display: block; font-weight: 500; font-size: 16px; letter-spacing: -.01em; }
.row p { margin-top: 4px; font-size: 12.5px; line-height: 1.45; color: var(--muted); }
.row .meta { font: 9px/1.4 var(--mono); color: var(--muted); letter-spacing: .5px; white-space: nowrap; text-align: right; }
a.row:hover strong { color: var(--accent); }
a.row:hover .meta { color: var(--accent); }
.row-empty { padding: 28px 0; font: 11px/1.6 var(--mono); color: var(--muted); }
.wb-foot { display: flex; gap: 9px; align-items: center; padding: 15px 22px; border-top: 1px solid var(--line); font: 9px/1.5 var(--mono); color: var(--muted); }

/* ---------- principles graph ---------- */
.graph-lines { position: absolute; inset: 0; width: 100%; height: 100%; fill: none; stroke: var(--line); stroke-width: 1; }
.node { position: absolute; display: flex; flex-direction: column; gap: 8px; max-width: 42%; padding: 10px 14px; background: var(--bg); border: 1px solid var(--line); }
.node > span { font-size: 19px; font-style: italic; letter-spacing: -.5px; }
.node > small { font: 9px/1.5 var(--mono); color: var(--muted); letter-spacing: .4px; }
.n-drums { left: 0; top: 16%; } .n-psy { right: 0; top: 15%; }
.n-ctf { right: 0; bottom: 28%; } .n-pet { left: 0; bottom: 25%; }
.graph-caption { position: absolute; left: 0; bottom: 0; font-size: 12px; line-height: 1.6; color: var(--muted); }

/* ---------- contact scene ---------- */
.contact-scene { background: var(--accent); color: #160807; }
.contact-scene::before { display: none; }
.contact-copy { position: relative; z-index: 2; min-height: 100svh; padding: 120px var(--pad) 110px; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; }
.enhanced .contact-copy { min-height: 100%; height: auto; }
.contact-copy .eyebrow { color: #5c1610; margin-bottom: 26px; }
.contact-title { font-size: clamp(80px, 11.5vw, 196px); font-weight: 600; font-style: italic; letter-spacing: -.07em; line-height: .84; padding-right: .1em; }
.contact-title > span { display: block; margin-left: 12vw; }
.contact-desc { font-size: clamp(18px, 1.7vw, 26px); line-height: 1.35; margin-top: 34px; max-width: 30ch; }
.contact-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 18px 34px; margin-top: 30px; }
.dark { background: #160807; color: var(--accent); }
.dark:hover { box-shadow: 5px 5px 0 #a5291e; }
.contact-link { display: inline-flex; gap: 9px; align-items: center; font: 13px/1 var(--mono); letter-spacing: .5px; border-bottom: 1px solid currentColor; padding-bottom: 5px; }
.contact-link svg { width: 14px; height: 14px; }
.contact-mark { position: absolute; right: -2%; top: 50%; transform: translateY(-50%); font-style: italic; font-size: min(62vw, 92vh); font-weight: 600; line-height: 1; color: transparent; -webkit-text-stroke: 1px #b8352a; opacity: .55; pointer-events: none; }
.contact-grid { position: absolute; inset: 0; background-image: linear-gradient(#2a080512 1px, transparent 1px), linear-gradient(90deg, #2a080512 1px, transparent 1px); background-size: 110px 110px; }
.contact-sign { position: absolute; right: var(--pad); bottom: 128px; font: 10px/1 var(--mono); letter-spacing: 2px; writing-mode: vertical-rl; }

/* ---------- footer nav ---------- */
.site-footer { position: fixed; z-index: 40; bottom: 0; left: 0; right: 0; min-height: 94px; padding: 20px var(--pad) 26px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 26px; background: var(--bg); border-top: 1px solid var(--line); transition: color 400ms, background 500ms; }
body[data-scene=contact] .site-footer { background: var(--accent); }
body:not(.enhanced) .site-footer { display: none; }
.scroll-hint { display: flex; align-items: center; gap: 13px; color: var(--muted); font-size: 11px; }
.hint-line { position: relative; display: block; width: 20px; height: 28px; border-left: 1px solid var(--line); }
.hint-line::after { content: ''; position: absolute; left: -2px; top: 3px; width: 3px; height: 8px; background: var(--accent); }
body[data-motion=on] .hint-line::after { animation: hint 2s ease-in-out infinite; }
@keyframes hint { 50% { transform: translateY(12px); opacity: .4; } }
.scene-nav { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; }
.scene-nav a { width: 44px; flex-shrink: 0; min-height: 46px; display: flex; flex-direction: column; justify-content: center; gap: 10px; color: #9a908a; font: 10px/1 var(--mono); transition: color 180ms; }
.scene-nav i { position: relative; height: 2px; width: 100%; background: var(--line); }
.scene-nav i::after { content: ''; position: absolute; inset: 0; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform 400ms var(--ease); }
.scene-nav a.current { color: var(--accent); }
.scene-nav a.current i::after { transform: scaleX(1); }
.scene-nav a:hover { color: var(--ink); }
.scene-arrows { display: flex; gap: 8px; justify-content: flex-end; }
.previous svg { transform: rotate(180deg); }

body[data-scene=contact] { --ink: #160807; --muted: #5c1610; --line: #c2392d; }
body[data-scene=contact] .site-header { background: var(--accent); }
body[data-scene=contact] .site-header, body[data-scene=contact] .site-footer { color: #160807; }
body[data-scene=contact] .status-tag::before, body[data-scene=contact] .scene-nav i::after, body[data-scene=contact] .hint-line::after { background: #160807; }
body[data-scene=contact] .scene-nav a, body[data-scene=contact] .scene-nav a.current { color: #160807; }
body[data-scene=contact] .icon-button:hover:not(:disabled) { background: #160807; color: var(--accent); border-color: #160807; }
body[data-scene=contact] :focus-visible { outline-color: #160807; }

/* ---------- responsive ---------- */
@media (min-width: 761px) and (max-height: 760px) {
    .scene-grid { padding-top: 100px; padding-bottom: 94px; }
    .hero-name { font-size: 120px; margin-bottom: 22px; }
    .hero-promise { font-size: 34px; }
    .section-title { font-size: 56px; margin-bottom: 24px; }
    .eyebrow { margin-bottom: 22px; }
    .visual { max-height: 410px; min-height: 290px; }
    .panel { height: 230px; }
    .point { padding: 14px 0; }
    .contact-title { font-size: 130px; }
}
@media (max-width: 1100px) {
    .header-right { gap: 22px; }
    .scene-grid { gap: 30px; }
    .edge-note { display: none; }
    .section-title { font-size: 52px; }
    .side-caption { display: none; }
    .node > span { font-size: 15px; }
}
@media (max-width: 760px) {
    :root { --pad: 22px; }
    .site-header { height: 70px; }
    .header-link, .status-tag { display: none; }
    /* single column, content flows from top — centering in a scroll
       container clips the top when content is taller than the viewport */
    /* generous bottom padding so content clears the fixed footer nav */
    .scene-grid { grid-template-columns: 1fr; gap: 26px; padding: 92px var(--pad) calc(108px + env(safe-area-inset-bottom)); align-content: start; align-items: start; }
    .enhanced .scene-grid { height: auto; min-height: 100%; align-content: start; }
    .scene::before, .enhanced .scene::before { display: none; }
    .copy, .hero-lede { max-width: 100%; }
    /* captions sit inside their fixed-height visual box, clear of the footer */
    .visual-caption { bottom: 0; background: var(--bg); }
    .hero-name { font-size: clamp(76px, 23vw, 140px); padding-right: 0; }
    .hero-name > span { position: static; display: block; transform: none; margin-top: 8px; }
    .hero-promise { font-size: clamp(28px, 7vw, 42px); }
    .section-title { font-size: clamp(38px, 9vw, 58px); margin-bottom: 20px; }
    .eyebrow { font-size: 10px; margin-bottom: 20px; }
    .description { font-size: 15px; line-height: 1.5; }
    .visual { height: 300px; min-height: 240px; }
    .hero-visual { height: 280px; max-width: 360px; justify-self: center; }
    .plane { width: auto; height: 82%; left: 50%; transform: translate(-50%, -50%); }
    .plane-mid { transform: translate(calc(-50% + 15px), calc(-50% - 15px)); }
    .plane-back { transform: translate(calc(-50% + 29px), calc(-50% - 29px)); }
    body[data-motion=on] .is-current .plane-back, body[data-motion=on] .is-current .plane-mid { animation: none; }
    .axis-y { display: none; }
    .choice { font-size: 22px; padding: 11px 12px; }
    .core { width: 70px; height: 66px; }
    .core > b { font-size: 28px; }
    .row { grid-template-columns: 22px 1fr; }
    .row .meta { grid-column: 2; text-align: left; }
    .panel { height: 300px; padding: 4px 16px 8px; }
    .node { padding: 7px 9px; }
    .node > small { display: none; }
    .site-footer { min-height: 80px; padding: 12px var(--pad) calc(18px + env(safe-area-inset-bottom)); display: flex; gap: 12px; }
    .scroll-hint, .previous { display: none; }
    .scene-nav { flex: 1; justify-content: space-between; gap: 0; }
    .scene-nav a { width: 38px; }
    .scene-arrows { margin-left: auto; }
    .contact-title > span { margin-left: 8vw; }
}

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