/* ============ BRAND FONTS ============ */
@font-face {
  font-family: 'Salaryman';
  src: url('../fonts/salaryman.woff2') format('woff2');
  font-weight: normal; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Arkhip';
  src: url('../fonts/arkhip.woff2') format('woff2');
  font-weight: normal; font-style: normal; font-display: swap;
}

/* ============ TOKENS ============ */
:root {
  --navy: #011530;
  --navy-deep: #000B1F;
  --navy-raised: #0A1F3C;
  --navy-90: rgba(1, 21, 48, 0.9);
  --ink-soft: rgba(250, 250, 248, 0.72);
  --paper: #FAFAF8;
  --paper-dim: #F2F1ED;
  --grey-line: #E0E0E0;
  --grey-mid: #8B919C;
  --redline: #E25837;
  --rule: rgba(250, 250, 248, 0.14);
  --rule-strong: rgba(250, 250, 248, 0.32);
  --rule-navy: rgba(1, 21, 48, 0.16);
  --rule-navy-strong: rgba(1, 21, 48, 0.34);
  --rail-w: 92px;
  --sheet-pad: clamp(24px, 5vw, 72px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
::selection { background: var(--paper); color: var(--navy); }

body {
  background: var(--navy);
  color: var(--paper);
  font-family: 'IBM Plex Sans', -apple-system, sans-serif;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Custom scrollbar */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--navy-deep); }
::-webkit-scrollbar-thumb { background: var(--grey-mid); }

.salaryman {
  font-family: 'Salaryman', 'IBM Plex Sans', sans-serif;
  text-transform: uppercase;
  line-height: 0.92;
  letter-spacing: 0.005em;
}
.arkhip {
  font-family: 'Arkhip', 'IBM Plex Sans', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.24em;
  line-height: 1.4;
}
.mono {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ============ DRAWING GRID BACKDROP ============ */
.sheet-grid {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    linear-gradient(var(--rule) 1px, transparent 1px),
    linear-gradient(90deg, var(--rule) 1px, transparent 1px),
    linear-gradient(rgba(250,250,248,0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(250,250,248,0.045) 1px, transparent 1px);
  background-size: 160px 160px, 160px 160px, 32px 32px, 32px 32px;
  opacity: 0.5;
}

/* ============ SHEET REGISTER RAIL (desktop) ============ */
.register {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--rail-w);
  border-right: 1px solid var(--rule);
  background: var(--navy);
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 18px 0;
  gap: 0;
}
.register-mark {
  width: 44px; height: 44px;
  display: block;
  flex-shrink: 0;
}
.register-mark img { width: 100%; height: 100%; display: block; border: 1px solid var(--rule); }
.register-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1;
  gap: 4px;
  width: 100%;
}
.register-list a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 14px 0;
  text-decoration: none;
  color: var(--grey-mid);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  border-left: 2px solid transparent;
  transition: color 0.25s, border-color 0.25s;
  width: 100%;
}
.register-list a .sheet-no { font-weight: 500; font-size: 0.7rem; }
.register-list a.active {
  color: var(--paper);
  border-left-color: var(--redline);
}
.register-list a:hover { color: var(--paper); }
.register-foot {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  color: var(--grey-mid);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  flex-shrink: 0;
}

/* ============ MAIN CANVAS ============ */
main {
  margin-left: var(--rail-w);
  position: relative;
  z-index: 1;
}

/* ============ TOP BAR ============ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px var(--sheet-pad);
  background: rgba(1, 21, 48, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}
.topbar .brand { display: flex; align-items: center; text-decoration: none; }
.brand-word { display: flex; align-items: center; }
.bw-full { font-size: 0.82rem; color: var(--paper); letter-spacing: 0.22em; white-space: nowrap; }
.topbar-right { display: flex; align-items: center; gap: 28px; }
.topbar-right .status { color: var(--grey-mid); }
.topbar-right .status b { color: var(--paper); font-weight: 500; }
.cta-chip {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--navy);
  background: var(--paper);
  padding: 11px 20px;
  border: 1px solid var(--paper);
  transition: background 0.2s, color 0.2s;
}
.cta-chip:hover { background: var(--redline); border-color: var(--redline); color: var(--paper); }

/* ============ SHEET HEADERS ============ */
.sheet {
  position: relative;
  padding: clamp(80px, 11vh, 140px) var(--sheet-pad);
  border-bottom: 1px solid var(--rule);
}
.sheet-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: clamp(40px, 7vh, 80px);
  border-bottom: 1px solid var(--rule-strong);
  padding-bottom: 14px;
}
.sheet-id { color: var(--redline); font-weight: 500; }
.sheet-title-label { color: var(--grey-mid); }

/* ============ HERO / S-01 ============ */
.hero { min-height: calc(100vh - 64px); display: flex; flex-direction: column; justify-content: center; }
.hero-kicker {
  display: flex; gap: 32px; flex-wrap: wrap;
  color: var(--grey-mid);
  margin-bottom: clamp(32px, 5vh, 56px);
}
.hero-kicker .sep { color: var(--redline); }
.hero-h1 {
  font-size: clamp(1.05rem, 3.85vw, 4.1rem);
  color: var(--paper);
  position: relative;
}
.hero-h1 .row { display: block; position: relative; overflow: hidden; }
.hero-h1 { line-height: 0.98; }
.hero-h1 .row span { display: inline-block; transform: translateY(110%); animation: riseUp 1s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.hero-h1 .row:nth-child(2) span { animation-delay: 0.12s; }
.hero-h1 .row:nth-child(3) span { animation-delay: 0.24s; }
@keyframes riseUp { to { transform: translateY(0); } }

/* Dimension line under headline */
.dim-line {
  position: relative;
  margin: clamp(28px, 4.5vh, 48px) 0 0;
  height: 32px;
  max-width: 720px;
}
.dim-line .bar {
  position: absolute; left: 0; right: 0; top: 50%;
  height: 1px; background: var(--redline);
}
.dim-line .tick {
  position: absolute; top: calc(50% - 8px);
  width: 1px; height: 16px; background: var(--redline);
}
.dim-line .tick.start { left: 0; }
.dim-line .tick.end { right: 0; }
.dim-line .dim-label {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  background: var(--navy);
  padding: 0 16px;
  color: var(--redline);
  white-space: nowrap;
}
.hero-sub-row {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: clamp(32px, 6vw, 96px);
  align-items: end;
  margin-top: clamp(40px, 7vh, 72px);
}
.hero-sub {
  font-size: clamp(1.02rem, 1.4vw, 1.22rem);
  font-weight: 300;
  color: var(--ink-soft);
  max-width: 54ch;
}
.hero-sub strong { font-weight: 500; color: var(--paper); }
.hero-ctas { display: flex; flex-direction: column; gap: 12px; align-items: stretch; }
.btn {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 18px 24px;
  text-decoration: none;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: background 0.25s, color 0.25s, border-color 0.25s, transform 0.25s;
}
.btn svg { flex-shrink: 0; transition: transform 0.25s; }
.btn:hover svg { transform: translateX(5px); }
.btn-solid { background: var(--paper); color: var(--navy); border: 1px solid var(--paper); }
.btn-solid:hover { background: var(--redline); border-color: var(--redline); color: var(--paper); }
.btn-line { background: transparent; color: var(--paper); border: 1px solid var(--rule-strong); }
.btn-line:hover { background: var(--paper); color: var(--navy); border-color: var(--paper); }
.btn-play { background: transparent; color: var(--beam); border: 1px solid var(--beam); }
.btn-play:hover { background: var(--beam); color: var(--navy); border-color: var(--beam); }

/* ============ CODES MARQUEE ============ */
.marquee {
  border-bottom: 1px solid var(--rule);
  overflow: hidden;
  padding: 18px 0;
  background: var(--navy-deep);
  position: relative;
}
.marquee-track {
  display: flex;
  gap: 64px;
  width: max-content;
  animation: scroll-x 38s linear infinite;
}
.marquee-track span {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.76rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--grey-mid);
  white-space: nowrap;
}
.marquee-track span b { color: var(--paper); font-weight: 500; }
@keyframes scroll-x { to { transform: translateX(-50%); } }

/* ============ S-02 CAPABILITIES SCHEDULE ============ */
.caps {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border-top: 1px solid var(--rule-strong);
  border-left: 1px solid var(--rule-strong);
}
.cap {
  border-right: 1px solid var(--rule-strong);
  border-bottom: 1px solid var(--rule-strong);
  padding: clamp(28px, 3.5vw, 48px);
  position: relative;
  transition: background 0.3s;
  cursor: default;
}
.cap:hover { background: var(--paper); }
.cap:hover .cap-ref { color: var(--redline); }
.cap:hover .cap-name { color: var(--navy); }
.cap:hover .cap-desc { color: #34415c; }
.cap:hover .cap-codes span { border-color: var(--rule-navy-strong); color: #34415c; }
.cap-ref {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  color: var(--grey-mid);
  margin-bottom: 22px;
  transition: color 0.3s;
}
.cap-name {
  font-size: clamp(1.2rem, 1.8vw, 1.55rem);
  font-weight: 500;
  letter-spacing: -0.01em;
  margin-bottom: 12px;
  color: var(--paper);
  transition: color 0.3s;
}
.cap-desc {
  font-size: 0.94rem;
  font-weight: 300;
  color: var(--ink-soft);
  max-width: 44ch;
  transition: color 0.3s;
  margin-bottom: 18px;
}
.cap-codes { display: flex; flex-wrap: wrap; gap: 6px; }
.cap-codes span {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  padding: 4px 8px;
  border: 1px solid var(--rule);
  color: var(--grey-mid);
  transition: border-color 0.3s, color 0.3s;
}

/* ============ S-03 PROJECT REGISTER (dark) ============ */
.sheet-dark {
  background: var(--paper);
  color: var(--navy);
  border-bottom: none;
  position: relative;
  overflow: hidden;
}
.sheet-dark .sheet-head { border-bottom-color: var(--rule-navy-strong); }
.sheet-dark .sheet-title-label { color: rgba(1,21,48,0.5); }
.sheet-dark::after {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--rule-navy) 1px, transparent 1px),
    linear-gradient(90deg, var(--rule-navy) 1px, transparent 1px);
  background-size: 160px 160px;
  opacity: 0.5;
  pointer-events: none;
}
.sheet-dark > * { position: relative; z-index: 1; }
.proj-watermark {
  position: absolute;
  bottom: 0; right: 24px;
  width: clamp(180px, 24vw, 320px);
  opacity: 0.05;
  pointer-events: none;
  z-index: 0 !important;
}
.proj-list { list-style: none; border-top: 1px solid var(--rule-navy-strong); }
.proj {
  display: grid;
  grid-template-columns: 90px minmax(0, 1.3fr) minmax(0, 1.7fr) auto 48px;
  gap: clamp(16px, 2.5vw, 40px);
  align-items: baseline;
  padding: clamp(24px, 3.2vh, 38px) 0;
  border-bottom: 1px solid var(--rule-navy);
  transition: padding-left 0.35s;
  cursor: default;
}
.proj:hover { padding-left: 22px; }
.proj:hover .proj-name { color: var(--redline); }
.proj:hover .proj-arrow { color: var(--redline); transform: translateX(6px); }
.proj-ref {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.7rem; letter-spacing: 0.12em;
  color: rgba(1,21,48,0.45);
}
.proj-name {
  font-size: clamp(1.25rem, 2.1vw, 1.7rem);
  font-weight: 400; letter-spacing: -0.01em;
  transition: color 0.35s;
}
.proj-scope {
  font-size: 0.93rem; font-weight: 300;
  color: rgba(1,21,48,0.66);
}
.proj-meta {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: rgba(1,21,48,0.55);
  white-space: nowrap;
}
.proj-arrow {
  text-align: right;
  color: rgba(1,21,48,0.4);
  transition: color 0.35s, transform 0.35s;
}
.proj-note {
  margin-top: clamp(36px, 5vh, 56px);
  font-size: 0.84rem;
  font-style: italic;
  font-weight: 300;
  color: rgba(1,21,48,0.6);
  max-width: 72ch;
}

/* ============ S-04 METHODOLOGY ============ */
.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  position: relative;
  gap: clamp(20px, 3vw, 48px);
  padding-top: 26px;
}
.steps::before {
  content: '';
  position: absolute;
  top: 0; left: 4px; right: 4px;
  height: 1px;
  background: var(--redline);
}
.step { position: relative; }
.step::before {
  content: '';
  position: absolute;
  top: -26px; left: 0;
  width: 1px; height: 14px;
  background: var(--redline);
}
.step-ref {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.7rem; letter-spacing: 0.12em;
  color: var(--redline);
  margin-bottom: 18px;
}
.step-name {
  font-size: clamp(1.25rem, 1.8vw, 1.6rem);
  font-weight: 500; letter-spacing: -0.01em;
  margin-bottom: 12px;
}
.step-desc {
  font-size: 0.93rem; font-weight: 300;
  color: var(--ink-soft);
}

/* ============ S-05 CONTACT ============ */
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: clamp(40px, 6vw, 96px);
  align-items: start;
}
.contact-h {
  font-size: clamp(2.1rem, 5.2vw, 4.9rem);
  color: var(--paper);
}
.contact-h .arkhip-line {
  display: block;
  font-family: 'Arkhip', sans-serif;
  font-size: clamp(0.8rem, 1.6vw, 1.35rem);
  letter-spacing: 0.24em;
  margin-top: 22px;
  color: var(--ink-soft);
}
.contact-sub {
  margin-top: 28px;
  font-size: 1.05rem;
  font-weight: 300;
  color: var(--ink-soft);
  max-width: 44ch;
}
.contact-rows { display: flex; flex-direction: column; }
.crow {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 20px;
  padding: 18px 0;
  border-bottom: 1px solid var(--rule);
  align-items: baseline;
}
.crow:first-child { border-top: 1px solid var(--rule-strong); }
.crow .k {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--grey-mid);
}
.crow .v { font-size: 1rem; color: var(--paper); }
.crow .v a {
  color: var(--paper);
  text-decoration: none;
  border-bottom: 1px solid var(--redline);
  transition: color 0.2s;
}
.crow .v a:hover { color: var(--redline); }

/* ============ TITLE BLOCK FOOTER (signature) ============ */
.titleblock {
  margin: 0;
  border: 2px solid var(--paper);
  border-left: none;
  border-right: none;
  background: var(--navy-deep);
  position: relative;
  z-index: 1;
  margin-left: var(--rail-w);
}
.tb-grid {
  display: grid;
  grid-template-columns: minmax(200px, 1.3fr) minmax(180px, 1fr) minmax(180px, 1fr) minmax(220px, 1.2fr);
}
.tb-cell {
  border-right: 1px solid var(--rule-strong);
  padding: 18px 22px;
  min-height: 96px;
}
.tb-cell:last-child { border-right: none; }
.tb-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--grey-mid);
  margin-bottom: 8px;
}
.tb-value {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  color: var(--paper);
  line-height: 1.6;
}
.tb-value a { color: var(--paper); text-decoration: none; border-bottom: 1px solid var(--rule-strong); }
.tb-value a:hover { color: var(--redline); border-color: var(--redline); }
.tb-row-2 {
  display: grid;
  grid-template-columns: minmax(200px, 1.3fr) minmax(180px, 1fr) minmax(180px, 1fr) minmax(220px, 1.2fr);
  border-top: 1px solid var(--rule-strong);
}
.tb-logo-cell {
  display: flex;
  align-items: center;
  gap: 16px;
}
.tb-logo-cell img.mark { width: 52px; height: auto; }
.tb-logo-cell img.word { height: 26px; width: auto; }
.tb-rev-table { width: 100%; border-collapse: collapse; }
.tb-rev-table td {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  padding: 3px 8px 3px 0;
  color: var(--paper);
  vertical-align: top;
}
.tb-rev-table td.rev-no { color: var(--redline); font-weight: 500; white-space: nowrap; }
.tb-bottom {
  border-top: 1px solid var(--rule-strong);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 22px;
}
.tb-bottom .mono { color: var(--grey-mid); font-size: 0.64rem; }
.tb-bottom .sheet-stamp {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  color: var(--navy);
  background: var(--paper);
  padding: 6px 14px;
}

/* ============ BACK TO TOP ============ */
.to-top {
  position: fixed;
  bottom: 28px; right: 28px;
  width: 52px; height: 52px;
  background: var(--navy);
  border: 1px solid var(--rule-strong); cursor: pointer;
  padding: 9px;
  opacity: 0; transform: translateY(16px);
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s, background 0.2s;
  z-index: 80;
}
.to-top.visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.to-top:hover { border-color: var(--redline); background: var(--navy-raised); }
.to-top img { width: 100%; height: 100%; display: block; }

/* ============ SCROLL REVEALS ============ */
.sr {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.85s cubic-bezier(0.16, 1, 0.3, 1), transform 0.85s cubic-bezier(0.16, 1, 0.3, 1);
}
.sr.in { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .hero-h1 .row span { transform: none; }
  .sr { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}

/* ============ FOCUS ============ */
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--redline);
  outline-offset: 3px;
}


/* ============ FUTURIST LAYER ============ */
:root { --beam: #56E8DC; --beam-dim: rgba(86, 232, 220, 0.55); }

/* Boot sequence */
.boot {
  position: fixed; inset: 0; z-index: 300;
  background: var(--navy-deep);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 26px;
  animation: bootOut 0.45s ease 1.15s forwards;
}
.boot img { width: 72px; height: 72px; border: 1px solid var(--rule); }
.boot .boot-line {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.7rem; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--grey-mid);
}
.boot .boot-line b { color: var(--beam); font-weight: 500; }
.boot .boot-bar {
  width: 220px; height: 1px; background: var(--rule); position: relative; overflow: hidden;
}
.boot .boot-bar::after {
  content: ''; position: absolute; inset: 0;
  background: var(--beam);
  transform: scaleX(0); transform-origin: left;
  animation: bootFill 0.9s cubic-bezier(0.6, 0, 0.3, 1) 0.1s forwards;
}
@keyframes bootFill { to { transform: scaleX(1); } }
@keyframes bootOut { to { opacity: 0; visibility: hidden; } }

/* Scanline sweep */
.scanline {
  position: fixed; left: 0; right: 0; top: -5vh; height: 1px;
  background: linear-gradient(90deg, transparent, var(--beam-dim), transparent);
  opacity: 0.16; z-index: 2; pointer-events: none;
  animation: scanY 10s linear infinite;
}
@keyframes scanY { to { transform: translateY(115vh); } }

/* CAD crosshair + coordinate readout */
.xh-x, .xh-y {
  position: fixed; z-index: 4; pointer-events: none;
  background: var(--beam); opacity: 0;
  transition: opacity 0.3s;
}
.xh-x { left: 0; right: 0; height: 1px; }
.xh-y { top: 0; bottom: 0; width: 1px; }
body.xh-on .xh-x, body.xh-on .xh-y { opacity: 0.12; }
.coord-chip {
  position: fixed; z-index: 4; pointer-events: none;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.62rem; letter-spacing: 0.1em;
  color: var(--beam); opacity: 0;
  transition: opacity 0.3s;
  white-space: nowrap;
  text-shadow: 0 0 8px rgba(86, 232, 220, 0.4);
}
body.xh-on .coord-chip { opacity: 0.75; }

/* Sheet registration ticks (crop marks) */
.ticks { position: absolute; inset: 10px; pointer-events: none; }
.ticks i {
  position: absolute; width: 15px; height: 15px;
  background:
    linear-gradient(var(--rule-strong), var(--rule-strong)) center / 100% 1px no-repeat,
    linear-gradient(var(--rule-strong), var(--rule-strong)) center / 1px 100% no-repeat;
}
.ticks i:nth-child(1) { top: 0; left: 0; }
.ticks i:nth-child(2) { top: 0; right: 0; }
.ticks i:nth-child(3) { bottom: 0; left: 0; }
.ticks i:nth-child(4) { bottom: 0; right: 0; }
.sheet-dark .ticks i {
  background:
    linear-gradient(var(--rule-navy-strong), var(--rule-navy-strong)) center / 100% 1px no-repeat,
    linear-gradient(var(--rule-navy-strong), var(--rule-navy-strong)) center / 1px 100% no-repeat;
}

/* Hero ambient glow */
.hero::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(640px 420px at 78% 22%, rgba(86, 232, 220, 0.07), transparent 65%),
    radial-gradient(520px 380px at 12% 85%, rgba(226, 88, 55, 0.06), transparent 65%);
}

/* Wireframe model */
.wireframe {
  position: absolute;
  top: clamp(60px, 9vh, 120px);
  right: calc(var(--sheet-pad) * 0.6);
  width: clamp(300px, 30vw, 470px);
  z-index: 0;
  pointer-events: none;
  filter: drop-shadow(0 0 10px rgba(86, 232, 220, 0.18));
  will-change: transform;
}
.hero > .sheet-head, .hero > .hero-kicker, .hero > .hero-h1,
.hero > .dim-line, .hero > .hero-sub-row, .hero > .hud { position: relative; z-index: 1; }
.wireframe .wf {
  stroke: var(--beam); stroke-width: 1.1; fill: none;
  opacity: 0.5; stroke-linecap: square;
}
.wireframe .wf-draw {
  stroke-dasharray: 1; stroke-dashoffset: 1;
  animation: wfDraw 1.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  animation-delay: var(--d, 0s);
}
@keyframes wfDraw { to { stroke-dashoffset: 0; } }
.wireframe .wf-node {
  fill: var(--beam); stroke: none; opacity: 0;
  animation: nodeIn 0.5s ease forwards, nodePulse 3s ease-in-out 2s infinite;
  animation-delay: var(--d, 1.4s), calc(var(--d, 1.4s) + 1s);
}
@keyframes nodeIn { to { opacity: 0.85; } }
@keyframes nodePulse { 0%, 100% { opacity: 0.85; } 50% { opacity: 0.3; } }
.wireframe .wf-anno {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10.5px; letter-spacing: 0.08em;
  fill: var(--beam); opacity: 0;
  animation: nodeIn 0.6s ease forwards;
  animation-delay: var(--d, 1.8s);
}
.wireframe .wf-leader {
  stroke: var(--beam-dim); stroke-width: 0.8; fill: none; opacity: 0;
  animation: nodeIn 0.6s ease forwards;
  animation-delay: var(--d, 1.7s);
}
.wireframe .wf-dim { stroke: var(--redline); stroke-width: 0.9; fill: none; opacity: 0;
  animation: nodeIn 0.6s ease forwards; animation-delay: 2s; }
.wireframe .wf-dimtext {
  font-family: 'IBM Plex Mono', monospace; font-size: 10.5px; letter-spacing: 0.08em;
  fill: var(--redline); opacity: 0;
  animation: nodeIn 0.6s ease forwards; animation-delay: 2.1s;
}

/* HUD status strip */
.hud {
  margin-top: clamp(36px, 6vh, 64px);
  border-top: 1px solid var(--rule);
  padding-top: 14px;
  display: flex; gap: 28px; flex-wrap: wrap;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.64rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--grey-mid);
}
.hud b { color: var(--beam); font-weight: 500; }
.hud .hud-live { color: var(--redline); animation: blinkSoft 2.2s steps(2) infinite; }
@keyframes blinkSoft { 50% { opacity: 0.25; } }

/* Capability icons */
.cap-icon {
  width: 34px; height: 34px;
  stroke: var(--beam); stroke-width: 1.3; fill: none;
  opacity: 0.85; margin-bottom: 18px;
  stroke-linecap: square;
  transition: stroke 0.3s;
  display: block;
}
.cap:hover .cap-icon { stroke: var(--navy); }

/* Methodology flowing connector */
.steps::before {
  background: repeating-linear-gradient(90deg, var(--redline) 0 10px, transparent 10px 20px);
  background-size: 40px 1px;
  animation: dashFlow 1.4s linear infinite;
}
@keyframes dashFlow { to { background-position: 40px 0; } }

/* Contact blinking cursor */
.blink {
  display: inline-block;
  width: 0.42em; height: 0.78em;
  background: var(--redline);
  margin-left: 0.12em;
  vertical-align: baseline;
  animation: cursorBlink 1.05s steps(2) infinite;
  box-shadow: 0 0 12px rgba(226, 88, 55, 0.5);
}
@keyframes cursorBlink { 50% { opacity: 0; } }

/* Glow accents */
.dim-line .bar, .dim-line .tick { box-shadow: 0 0 8px rgba(226, 88, 55, 0.45); }
.register-list a.active { text-shadow: 0 0 10px rgba(250, 250, 248, 0.35); }

@media (max-width: 1100px) {
  .wireframe { display: none; }
}
@media (hover: none), (pointer: coarse) {
  .xh-x, .xh-y, .coord-chip { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .boot { display: none; }
  .scanline { display: none; }
  .wireframe .wf-draw { stroke-dashoffset: 0; animation: none; }
  .wireframe .wf-node, .wireframe .wf-anno, .wireframe .wf-leader,
  .wireframe .wf-dim, .wireframe .wf-dimtext { opacity: 0.85; animation: none; }
  .xh-x, .xh-y, .coord-chip { display: none; }
}


/* ============ S-05 SANDBOX GAME ============ */
.game-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr);
  gap: clamp(28px, 4vw, 56px);
  align-items: start;
}
.game-stage {
  position: relative;
  border: 1px solid var(--rule-strong);
  background: var(--navy-deep);
  overflow: hidden;
}
.game-stage svg { display: block; width: 100%; height: auto; }
.game-stage .stage-grid line { stroke: rgba(86,232,220,0.07); stroke-width: 1; }
.game-stage .gnode { fill: rgba(86,232,220,0.35); }
.game-stage .ground { stroke: var(--paper); stroke-width: 1.4; opacity: 0.7; }
.game-stage .ghatch { stroke: rgba(250,250,248,0.25); stroke-width: 1; }
.member { stroke-linecap: square; transition: opacity 0.2s; }
.member.std { stroke: var(--paper); stroke-width: 4; }
.member.led { stroke: var(--beam); stroke-width: 3; }
.member.brc { stroke: var(--beam); stroke-width: 2; stroke-dasharray: none; opacity: 0.85; }
.member.dek { fill: rgba(250,250,248,0.85); stroke: var(--paper); stroke-width: 1; }
.member.bas { fill: var(--paper); }
.hit { stroke: transparent; fill: transparent; cursor: crosshair; }
.hit:hover { stroke: rgba(86,232,220,0.12); }
#ghost { pointer-events: none; stroke: var(--beam); stroke-width: 2.5; stroke-dasharray: 6 5; opacity: 0; fill: rgba(86,232,220,0.15); }
#ghost.on { opacity: 0.8; }
.fall { animation: memberFall 0.95s cubic-bezier(0.5, 0, 0.9, 0.4) forwards; }
@keyframes memberFall {
  30% { transform: translateY(8px) rotate(2deg); }
  100% { transform: translateY(440px) rotate(24deg); opacity: 0; }
}
.stage-shake { animation: stageShake 0.5s ease-in-out 2; }
@keyframes stageShake {
  0%,100% { transform: translateX(0); }
  25% { transform: translateX(-5px); } 75% { transform: translateX(5px); }
}
.stage-sway .swaygroup { animation: gentleSway 1.6s ease-in-out 2; transform-origin: 50% 100%; }
@keyframes gentleSway {
  0%,100% { transform: rotate(0deg); } 30% { transform: rotate(0.7deg); } 70% { transform: rotate(-0.7deg); }
}
.stamp {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) rotate(-9deg) scale(1.5);
  font-family: 'Salaryman', sans-serif;
  text-transform: uppercase;
  font-size: clamp(2rem, 5vw, 3.4rem);
  letter-spacing: 0.04em;
  padding: 10px 30px 6px;
  border: 4px solid;
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
}
.stamp.show { animation: stampIn 0.35s cubic-bezier(0.2, 1.4, 0.4, 1) forwards; }
@keyframes stampIn { to { opacity: 0.92; transform: translate(-50%, -50%) rotate(-9deg) scale(1); } }
.stamp.pass { color: var(--beam); border-color: var(--beam); text-shadow: 0 0 18px rgba(86,232,220,0.5); }
.stamp.fail { color: var(--redline); border-color: var(--redline); text-shadow: 0 0 18px rgba(226,88,55,0.5); }

.game-side { display: flex; flex-direction: column; gap: 20px; }
.tool-row { display: flex; flex-wrap: wrap; gap: 8px; }
.tool-btn, .act-btn {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 10px 14px;
  background: transparent;
  border: 1px solid var(--rule-strong);
  color: var(--paper);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}
.tool-btn:hover { border-color: var(--beam); }
.tool-btn.active { background: var(--beam); border-color: var(--beam); color: var(--navy); }
.act-btn { border-color: var(--rule); color: var(--grey-mid); }
.act-btn:hover { border-color: var(--redline); color: var(--paper); }
.act-btn.primary { border-color: var(--redline); color: var(--redline); }
.act-btn.primary:hover { background: var(--redline); color: var(--paper); }
.game-counts {
  display: flex; flex-wrap: wrap; gap: 16px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.64rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--grey-mid);
  border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
  padding: 12px 0;
}
.game-counts b { color: var(--beam); font-weight: 500; }
.game-log {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.7rem; line-height: 1.9; letter-spacing: 0.04em;
  color: var(--grey-mid);
  min-height: 130px; max-height: 190px; overflow-y: auto;
  border-left: 2px solid var(--rule-strong);
  padding-left: 14px;
}
.game-log .ok { color: var(--beam); }
.game-log .bad { color: var(--redline); }
.game-hint { font-size: 0.82rem; font-weight: 300; color: var(--ink-soft); max-width: 44ch; }
@media (max-width: 900px) {
  .game-wrap { grid-template-columns: 1fr; }
}


/* Sandbox v2 — lateral stability */
.wall-face { fill: rgba(250,250,248,0.08); stroke: rgba(250,250,248,0.35); stroke-width: 1; }
.wall-hatch { stroke: rgba(250,250,248,0.22); stroke-width: 1; }
.wall-label { font-family: 'IBM Plex Mono', monospace; font-size: 9px; letter-spacing: 0.16em; fill: rgba(250,250,248,0.4); }
.member.tie { stroke: var(--redline); stroke-width: 3; }
.member.tiepad { fill: var(--redline); }
.swaygroup { transition: transform 0.25s ease-out; transform-origin: 78px 410px; }
.wind-row { display: flex; align-items: center; gap: 14px; }
.wind-row label {
  font-family: 'IBM Plex Mono', monospace; font-size: 0.66rem;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--grey-mid);
  white-space: nowrap;
}
.wind-row b { color: var(--beam); font-weight: 500; min-width: 64px; display: inline-block; }
#windSlider {
  flex: 1; appearance: none; -webkit-appearance: none;
  height: 2px; background: var(--rule-strong); outline: none;
}
#windSlider::-webkit-slider-thumb {
  appearance: none; -webkit-appearance: none;
  width: 16px; height: 16px; background: var(--beam);
  border: 2px solid var(--navy-deep); cursor: ew-resize;
  box-shadow: 0 0 10px rgba(86,232,220,0.5);
}
#windSlider::-moz-range-thumb {
  width: 14px; height: 14px; background: var(--beam);
  border: 2px solid var(--navy-deep); cursor: ew-resize; border-radius: 0;
}
.defl-line {
  font-family: 'IBM Plex Mono', monospace; font-size: 0.68rem;
  letter-spacing: 0.08em; color: var(--grey-mid);
  border-top: 1px solid var(--rule); padding-top: 12px;
  min-height: 44px;
}
.defl-line b { color: var(--paper); font-weight: 500; }
.defl-line.warn b { color: var(--redline); }
.gust-streak {
  position: absolute; left: -100px;
  width: 90px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--beam));
  opacity: 0; pointer-events: none;
  animation: gustMove 0.7s ease-out forwards;
}
@keyframes gustMove {
  10% { opacity: 0.55; }
  100% { transform: translateX(calc(100vw)); opacity: 0; }
}
.lesson {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.68rem; line-height: 1.7; letter-spacing: 0.05em;
  color: var(--beam);
  border-left: 2px solid var(--beam);
  padding-left: 14px;
  min-height: 38px;
  opacity: 0.9;
}


.defl-line .scale-blocks { display: inline-flex; gap: 3px; margin: 0 10px; vertical-align: middle; }
.defl-line .scale-blocks i {
  width: 14px; height: 8px; background: var(--rule-strong); display: inline-block;
}
.defl-line .scale-blocks i.on { background: var(--beam); }
.defl-line.warn .scale-blocks i.on { background: var(--redline); }

/* ============ RESPONSIVE ============ */
@media (max-width: 1080px) {
  .proj { grid-template-columns: 64px minmax(0, 1fr) auto; }
  .proj-scope { grid-column: 2 / 4; grid-row: 2; }
  .proj-arrow { display: none; }
}
@media (max-width: 900px) {
  :root { --rail-w: 0px; }
  .register { display: none; }
  main, .titleblock { margin-left: 0; }
  .caps { grid-template-columns: 1fr; border-left: none; }
  .cap { border-right: none; border-left: 1px solid var(--rule-strong); }
  .steps { grid-template-columns: 1fr 1fr; row-gap: 40px; }
  .steps::before { display: none; }
  .step::before { display: none; }
  .step { border-top: 1px solid var(--redline); padding-top: 16px; }
  .contact-grid { grid-template-columns: 1fr; }
  .hero-sub-row { grid-template-columns: 1fr; }
  .tb-grid, .tb-row-2 { grid-template-columns: 1fr 1fr; }
  .tb-cell { min-height: auto; }
  .tb-cell:nth-child(2n) { border-right: none; }
  .tb-cell:nth-child(-n+2) { border-bottom: 1px solid var(--navy); }
  .topbar .status { display: none; }
}
@media (max-width: 560px) {
  .tb-grid, .tb-row-2 { grid-template-columns: 1fr; }
  .tb-cell { border-right: none; border-bottom: 1px solid var(--navy); }
  .tb-cell:last-child { border-bottom: none; }
  .proj { grid-template-columns: 1fr; gap: 6px; }
  .proj-ref { order: -1; }
  .proj-scope { grid-column: auto; grid-row: auto; }
}

/* ============ MULTI-PAGE NAV ============ */
.top-nav {
  display: flex;
  gap: 30px;
  align-items: center;
  margin-left: auto;
  margin-right: 28px;
}
.top-nav a {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--grey-mid);
  text-decoration: none;
  position: relative;
  padding: 4px 0;
  transition: color 0.2s;
}
.top-nav a:hover { color: var(--paper); }
.top-nav a.current { color: var(--paper); }
.top-nav a.current::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: -2px;
  height: 1px; background: var(--redline);
}
.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--rule-strong);
  color: var(--paper);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 9px 14px;
  cursor: pointer;
  margin-left: auto;
  margin-right: 14px;
}
/* register rail links become page links — active per page */
.register-list a.current { color: var(--paper); border-left-color: var(--redline); }
.register-list a.current .sheet-no { color: var(--paper); }

/* page intro block shared */
.page-intro {
  max-width: 60ch;
  font-size: clamp(1.05rem, 1.5vw, 1.3rem);
  font-weight: 300;
  color: var(--ink-soft);
  margin-bottom: clamp(40px, 6vh, 72px);
}
.page-intro strong { color: var(--paper); font-weight: 500; }

/* generic two-col feature row */
.feature-row {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 80px;
  padding: clamp(40px, 6vh, 72px) 0;
  border-top: 1px solid var(--rule);
}
.feature-row:last-child { border-bottom: 1px solid var(--rule); }
.feature-label { color: var(--grey-mid); padding-top: 6px; }
.feature-body { max-width: 62ch; }
.feature-body h3 {
  font-size: clamp(1.3rem, 2vw, 1.7rem);
  font-weight: 500; color: var(--paper);
  margin-bottom: 16px; letter-spacing: -0.01em;
}
.feature-body p { color: var(--ink-soft); font-weight: 300; margin-bottom: 14px; }
.feature-body p:last-child { margin-bottom: 0; }

/* about: stat band */
.statband {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--rule-strong);
  margin: clamp(40px, 6vh, 64px) 0;
}
.statband .stat {
  padding: 32px 28px;
  border-right: 1px solid var(--rule);
}
.statband .stat:last-child { border-right: none; }
.statband .stat .num {
  font-family: 'Salaryman', sans-serif;
  font-size: clamp(2rem, 4vw, 3.2rem);
  color: var(--beam);
  line-height: 1; margin-bottom: 12px;
}
.statband .stat .lbl {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.66rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--grey-mid);
}

/* page hero (smaller than landing) */
.page-hero {
  padding-top: clamp(40px, 7vh, 90px);
}
.page-hero h1 {
  font-size: clamp(2.4rem, 6vw, 5.6rem);
  color: var(--paper);
  line-height: 0.98;
  margin-bottom: 28px;
}
.page-hero h1 .accent { color: var(--beam); }

/* cross-page CTA cards on landing */
.nav-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--rule-strong);
  border-left: 1px solid var(--rule-strong);
}
.nav-card {
  border-right: 1px solid var(--rule-strong);
  border-bottom: 1px solid var(--rule-strong);
  padding: clamp(28px, 3vw, 44px);
  text-decoration: none;
  display: block;
  transition: background 0.3s;
  position: relative;
}
.nav-card:hover { background: var(--navy-raised); }
.nav-card:hover .nav-card-go { color: var(--beam); transform: translateX(6px); }
.nav-card .nav-card-ref {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.7rem; letter-spacing: 0.12em; color: var(--redline);
  margin-bottom: 20px;
}
.nav-card h3 {
  font-size: clamp(1.3rem, 1.9vw, 1.7rem);
  font-weight: 500; color: var(--paper);
  margin-bottom: 12px; letter-spacing: -0.01em;
}
.nav-card p {
  font-size: 0.92rem; font-weight: 300; color: var(--ink-soft);
  max-width: 38ch; margin-bottom: 28px;
}
.nav-card-go {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--grey-mid);
  display: inline-flex; align-items: center; gap: 10px;
  transition: color 0.3s, transform 0.3s;
}

@media (max-width: 1100px) {
  .nav-cards { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .top-nav {
    position: fixed;
    top: 62px; left: 0; right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: var(--navy-deep);
    border-bottom: 1px solid var(--rule);
    padding: 8px 24px 16px;
    margin: 0;
    transform: translateY(-120%);
    transition: transform 0.35s cubic-bezier(0.16,1,0.3,1);
    z-index: 49;
  }
  .top-nav.open { transform: translateY(0); }
  .top-nav a { padding: 13px 0; width: 100%; border-bottom: 1px solid var(--rule); }
  .top-nav a:last-child { border-bottom: none; }
  .nav-toggle { display: block; }
  .feature-row { grid-template-columns: 1fr; gap: 16px; }
  .statband { grid-template-columns: 1fr 1fr; }
  .statband .stat:nth-child(2n) { border-right: none; }
  .statband .stat:nth-child(-n+2) { border-bottom: 1px solid var(--rule); }
  .nav-cards { grid-template-columns: 1fr; border-left: none; }
  .nav-card { border-right: none; border-left: 1px solid var(--rule-strong); }
}

/* ============ MOBILE HEADER FIXES ============ */
@media (max-width: 900px) {
  .bw-full { font-size: 0.6rem; letter-spacing: 0.14em; }
  .topbar { gap: 10px; }
  .cta-chip { padding: 9px 12px; font-size: 0.64rem; white-space: nowrap; }
  .top-nav { top: 60px; z-index: 55; }
}
@media (max-width: 620px) {
  /* Switch to short wordmark on very narrow screens */
  .bw-full { font-size: 0.56rem; letter-spacing: 0.1em; max-width: 130px; line-height: 1.3; white-space: normal; }
  .topbar { padding: 12px 16px; }
  .cta-chip { padding: 8px 10px; font-size: 0.58rem; }
  .nav-toggle { padding: 8px 10px; font-size: 0.62rem; margin-right: 8px; }
}
