/* =========================================================================
   YOSHIMITSU SYSTEMS  ·  良光
   Heritage computing, rendered as light.
   A restrained fusion of Star Trek LCARS chrome + Japanese industrial design.
   ========================================================================= */

/* ---- 1. TOKENS ---------------------------------------------------------- */
:root {
  /* palette */
  --void:        #080a0f;
  --void-2:      #0b0e15;
  --panel:       #12151e;
  --panel-2:     #171b26;
  --line:        #232838;

  --fortune:     #ffc24b;   /* the amber "light" — primary accent           */
  --fortune-dim: #b8863a;
  --coral:       #f2765c;   /* LCARS salmon — secondary                     */
  --periwinkle:  #9aa7e6;   /* LCARS lavender — links / tertiary            */
  --jade:        #7fd1b9;   /* status: online / good fortune                */

  --ivory:       #f4efe6;   /* primary text                                 */
  --mist:        #b9c0d0;   /* secondary text                               */
  --slate:       #6e7891;   /* muted labels / mono metadata                 */

  /* type — Noto Sans JP trails each stack so CJK glyphs always resolve */
  --display: "Chakra Petch", "Noto Sans JP", system-ui, sans-serif;
  --body:    "IBM Plex Sans", "Noto Sans JP", system-ui, sans-serif;
  --mono:    "IBM Plex Mono", "Noto Sans JP", ui-monospace, monospace;
  --jp:      "Noto Sans JP", sans-serif;

  /* structure */
  --rail: 132px;
  --elbow: 46px;
  --radius: 4px;
  --pill: 999px;
  --maxw: 1160px;
  --gutter: clamp(1.25rem, 4vw, 3.5rem);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.85);
}

/* ---- 2. RESET / BASE ---------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  font-family: var(--body);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.075rem);
  line-height: 1.65;
  color: var(--ivory);
  background-color: var(--void);
  background-image:
    radial-gradient(60rem 40rem at 78% -6%, rgba(255, 194, 75, 0.10), transparent 60%),
    radial-gradient(48rem 40rem at -8% 12%, rgba(154, 167, 230, 0.08), transparent 55%),
    radial-gradient(40rem 44rem at 50% 118%, rgba(242, 118, 92, 0.07), transparent 60%),
    linear-gradient(var(--void), var(--void));
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* faint precision grid overlay */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(154, 167, 230, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(154, 167, 230, 0.035) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(120% 90% at 50% 0%, #000 40%, transparent 100%);
}

img, svg { display: block; max-width: 100%; }
a { color: var(--periwinkle); text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible {
  outline: 2px solid var(--fortune);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---- 3. TYPE SCALE ------------------------------------------------------ */
h1, h2, h3, h4 { font-family: var(--display); font-weight: 600; line-height: 1.04; letter-spacing: -0.01em; }

.eyebrow {
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--fortune);
  display: inline-flex;
  align-items: center;
  gap: 0.7em;
}
.eyebrow::before {
  content: "";
  width: 1.6rem;
  height: 1px;
  background: var(--fortune);
  opacity: 0.7;
}

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

/* ---- 4. APP SHELL: RAIL + ELBOW + VIEWPORT ------------------------------ */
.shell { position: relative; z-index: 1; min-height: 100vh; }

/* left brand rail (the LCARS spine) */
.rail {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--rail);
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.4rem 0.6rem 1.4rem;
  background:
    linear-gradient(180deg, var(--panel-2), var(--panel) 22%, var(--void-2));
  border-right: 1px solid var(--line);
  overflow: hidden;
}
/* amber cap at top of rail + the sweeping elbow into the header */
.rail::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 6px;
  background: var(--fortune);
  box-shadow: 0 0 22px rgba(255, 194, 75, 0.5);
}

.rail__mark { width: 52px; height: 52px; margin-bottom: 1.6rem; }

.rail__spine {
  writing-mode: vertical-rl;
  font-family: var(--jp);
  font-weight: 700;
  font-size: 2.1rem;
  letter-spacing: 0.32em;
  color: var(--ivory);
  margin: 0.4rem 0;
  text-shadow: 0 0 26px rgba(255, 194, 75, 0.28);
}
.rail__spine b { color: var(--fortune); font-weight: 700; }

.rail__tick {
  writing-mode: vertical-rl;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--slate);
  margin-top: auto;
}
.rail__status {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.24em;
  color: var(--jade);
  margin-top: 1rem;
  writing-mode: vertical-rl;
}
.rail__status .dot {
  writing-mode: horizontal-tb;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--jade);
  box-shadow: 0 0 0 0 rgba(127, 209, 185, 0.6);
  animation: pulse 2.6s var(--ease) infinite;
}

/* main column sits to the right of the rail */
.main { margin-left: var(--rail); }

/* header bar with LCARS elbow at its inner corner */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 1rem;
  height: 68px;
  padding: 0 var(--gutter) 0 calc(var(--elbow) + 0.5rem);
  background: rgba(8, 10, 15, 0.72);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
/* the elbow: an amber quarter that visually joins rail-cap to top bar */
.topbar::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: var(--elbow);
  height: var(--elbow);
  background: var(--fortune);
  box-shadow: 0 0 22px rgba(255, 194, 75, 0.4);
  -webkit-mask: radial-gradient(circle at 100% 100%, transparent var(--elbow), #000 0);
          mask: radial-gradient(circle at 100% 100%, transparent var(--elbow), #000 0);
}

.brand { display: flex; align-items: baseline; gap: 0.7rem; margin-right: auto; }
.brand__name {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ivory);
}
.brand__jp { font-family: var(--jp); font-weight: 700; color: var(--fortune); font-size: 1.05rem; }

/* primary nav — numeric codes are a genuine LCARS convention */
.nav { display: flex; align-items: center; gap: 0.4rem; }
.nav a {
  display: inline-flex;
  align-items: baseline;
  gap: 0.5em;
  padding: 0.5rem 0.95rem;
  border-radius: var(--pill);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mist);
  background: var(--panel);
  border: 1px solid var(--line);
  transition: color 0.25s, background 0.25s, border-color 0.25s;
}
.nav a .idx { color: var(--slate); font-size: 0.66rem; }
.nav a:hover { color: var(--void); background: var(--fortune); border-color: var(--fortune); }
.nav a:hover .idx { color: rgba(8, 10, 15, 0.6); }
.nav a[aria-current="page"] {
  color: var(--fortune);
  border-color: var(--fortune-dim);
  background: rgba(255, 194, 75, 0.08);
}

.nav__toggle { display: none; }

/* ---- 5. LAYOUT PRIMITIVES ---------------------------------------------- */
.section { padding-block: clamp(3.5rem, 7vw, 6.5rem); }
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }

.section-head { max-width: 46ch; margin-bottom: clamp(2rem, 4vw, 3rem); }
.section-head h2 { font-size: clamp(1.9rem, 1.2rem + 2.6vw, 3.1rem); margin-top: 0.7rem; }
.section-head p { color: var(--mist); margin-top: 1rem; font-size: 1.05rem; }

/* ---- 6. HERO ------------------------------------------------------------ */
.hero {
  position: relative;
  min-height: calc(100vh - 68px);
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  gap: 2rem;
  padding-block: clamp(2.5rem, 6vw, 5rem);
}
.hero__copy { max-width: 40ch; }
.hero h1 {
  font-size: clamp(2.6rem, 1.4rem + 5vw, 5.4rem);
  margin: 1.1rem 0 0;
  letter-spacing: -0.02em;
}
.hero h1 .glow { color: var(--fortune); text-shadow: 0 0 44px rgba(255, 194, 75, 0.35); }
.hero__lede {
  color: var(--mist);
  font-size: clamp(1.05rem, 1rem + 0.4vw, 1.25rem);
  margin-top: 1.4rem;
  max-width: 42ch;
}

/* boot console */
.boot {
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.9;
  color: var(--jade);
  margin-top: 1.8rem;
  padding: 1rem 1.2rem;
  border: 1px solid var(--line);
  border-left: 2px solid var(--jade);
  border-radius: var(--radius);
  background: rgba(11, 14, 21, 0.6);
  min-height: 8.5rem;
}
.boot .ok { color: var(--fortune); }
.boot .ln { display: block; opacity: 0; transform: translateY(4px); }
.boot .ln.in { opacity: 1; transform: none; transition: opacity 0.4s, transform 0.4s; }
.boot .caret {
  display: inline-block;
  width: 0.6em; height: 1.05em;
  vertical-align: -0.15em;
  background: var(--jade);
  margin-left: 0.15em;
  animation: blink 1.05s steps(1) infinite;
}

.hero__actions { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 2rem; }

/* the aperture core — signature element */
.hero__core { display: grid; place-items: center; }
.core { width: min(78%, 430px); aspect-ratio: 1; filter: drop-shadow(0 0 60px rgba(255, 194, 75, 0.28)); }

/* ---- 7. BUTTONS / PILLS ------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  padding: 0.85rem 1.5rem;
  border-radius: var(--pill);
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.2s var(--ease), background 0.25s, box-shadow 0.25s, color 0.25s;
}
.btn:active { transform: translateY(1px); }
.btn--primary {
  background: var(--fortune);
  color: var(--void);
  box-shadow: 0 0 0 0 rgba(255, 194, 75, 0.5);
}
.btn--primary:hover { box-shadow: 0 12px 30px -8px rgba(255, 194, 75, 0.55); transform: translateY(-2px); }
.btn--ghost {
  background: transparent;
  color: var(--ivory);
  border-color: var(--line);
}
.btn--ghost:hover { border-color: var(--fortune); color: var(--fortune); }
.btn .arrow { transition: transform 0.25s var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }

/* ---- 8. HERITAGE STAT STRIP -------------------------------------------- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-block: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(23, 27, 38, 0.5), transparent);
}
.stat { padding: 1.6rem var(--gutter); border-left: 1px solid var(--line); }
.stat:first-child { border-left: 0; }
.stat__k {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.6rem, 1rem + 1.8vw, 2.5rem);
  color: var(--fortune);
  line-height: 1;
}
.stat__l {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--slate);
  margin-top: 0.6rem;
}

/* ---- 9. SYSTEMS / CARD GRID -------------------------------------------- */
.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15.5rem, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.card {
  position: relative;
  padding: 1.9rem 1.7rem 2.1rem;
  background: linear-gradient(180deg, var(--panel), var(--void-2));
  transition: background 0.3s;
  overflow: hidden;
}
.card:hover { background: linear-gradient(180deg, var(--panel-2), var(--panel)); }
.card__code {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  color: var(--coral);
}
.card h3 { font-size: 1.4rem; margin: 0.9rem 0 0.6rem; color: var(--ivory); }
.card p { color: var(--mist); font-size: 0.98rem; }
.card__spec {
  display: flex;
  gap: 0.4rem 1.2rem;
  flex-wrap: wrap;
  margin-top: 1.3rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--slate);
}
.card__spec b { color: var(--periwinkle); font-weight: 500; }
/* corner accent tab */
.card::after {
  content: "";
  position: absolute;
  top: 0; right: 0;
  width: 34px; height: 5px;
  background: var(--fortune);
  opacity: 0.55;
  transition: width 0.35s var(--ease), opacity 0.35s;
}
.card:hover::after { width: 64px; opacity: 1; }

/* ---- 10. PHILOSOPHY / SPLIT ------------------------------------------- */
.split {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
}
.kanji-plate {
  position: relative;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  background:
    radial-gradient(60% 60% at 50% 42%, rgba(255, 194, 75, 0.14), transparent 70%),
    linear-gradient(160deg, var(--panel), var(--void-2));
  overflow: hidden;
}
.kanji-plate__big {
  font-family: var(--jp);
  font-weight: 700;
  font-size: clamp(6rem, 22vw, 13rem);
  color: var(--ivory);
  line-height: 0.9;
  text-shadow: 0 0 60px rgba(255, 194, 75, 0.35);
}
.kanji-plate__cap {
  position: absolute;
  bottom: 1.1rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--slate);
}
.split h2 { font-size: clamp(1.8rem, 1.1rem + 2.4vw, 2.8rem); }
.split p { color: var(--mist); margin-top: 1.1rem; }
.split p + p { margin-top: 1rem; }

/* ---- 11. TIMELINE (about) --------------------------------------------- */
.timeline { display: grid; gap: 0; margin-top: 1rem; }
.tl {
  display: grid;
  grid-template-columns: 8.5rem 1fr;
  gap: clamp(1rem, 3vw, 2.5rem);
  padding: 1.7rem 0;
  border-top: 1px solid var(--line);
  position: relative;
}
.tl:last-child { border-bottom: 1px solid var(--line); }
.tl__year {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.7rem;
  color: var(--fortune);
}
.tl__era {
  display: block;
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--slate);
  margin-top: 0.3rem;
}
.tl__body h3 { font-size: 1.25rem; color: var(--ivory); }
.tl__body p { color: var(--mist); margin-top: 0.4rem; max-width: 60ch; }
.tl__marker {
  position: absolute;
  left: 8.5rem;
  top: 1.9rem;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--fortune);
  transform: translateX(-50%);
  box-shadow: 0 0 0 4px rgba(255, 194, 75, 0.12);
}

/* ---- 12. VALUES ROW ---------------------------------------------------- */
.values { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; }
.value { padding: 1.5rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.value__i { font-family: var(--jp); font-size: 1.9rem; color: var(--coral); }
.value h3 { font-size: 1.15rem; margin: 0.7rem 0 0.4rem; }
.value p { color: var(--mist); font-size: 0.95rem; }

/* ---- 13. CONTACT ------------------------------------------------------- */
.contact { display: grid; grid-template-columns: 1fr 0.85fr; gap: clamp(2rem, 5vw, 4rem); align-items: start; }

.console {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--panel), var(--void-2));
  padding: clamp(1.5rem, 3vw, 2.5rem);
  position: relative;
}
.console__bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--slate);
  padding-bottom: 1.2rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--line);
}
.console__bar .lamp { width: 8px; height: 8px; border-radius: 50%; background: var(--coral); }
.console__bar .lamp + .lamp { background: var(--fortune); }
.console__bar .lamp + .lamp + .lamp { background: var(--jade); }
.console__bar span:last-child { margin-left: auto; }

.field { margin-bottom: 1.2rem; }
.field label {
  display: block;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--periwinkle);
  margin-bottom: 0.5rem;
}
.field label .req { color: var(--coral); }
.field input, .field textarea, .field select {
  width: 100%;
  padding: 0.85rem 1rem;
  background: var(--void-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ivory);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field textarea { resize: vertical; min-height: 8rem; }
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none;
  border-color: var(--fortune);
  box-shadow: 0 0 0 3px rgba(255, 194, 75, 0.15);
}
.field input::placeholder, .field textarea::placeholder { color: var(--slate); }
.field .err {
  display: none;
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--coral);
  margin-top: 0.4rem;
  letter-spacing: 0.04em;
}
.field.invalid input, .field.invalid textarea { border-color: var(--coral); }
.field.invalid .err { display: block; }

.form__foot { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-top: 0.5rem; }
.form__note { font-family: var(--mono); font-size: 0.66rem; color: var(--slate); letter-spacing: 0.06em; }

.form__ok {
  display: none;
  text-align: center;
  padding: 3rem 1rem;
}
.form__ok.show { display: block; animation: rise 0.6s var(--ease); }
.form__ok .glyph { font-family: var(--jp); font-size: 3.4rem; color: var(--fortune); text-shadow: 0 0 40px rgba(255, 194, 75, 0.4); }
.form__ok h3 { font-size: 1.6rem; margin: 0.8rem 0 0.5rem; }
.form__ok p { color: var(--mist); font-family: var(--mono); font-size: 0.85rem; }
.console.sent .form__body { display: none; }

/* contact side info */
.coords { display: grid; gap: 1.4rem; }
.coord {
  border: 1px solid var(--line);
  border-left: 2px solid var(--coral);
  border-radius: var(--radius);
  padding: 1.2rem 1.4rem;
  background: var(--panel);
}
.coord:nth-child(2) { border-left-color: var(--fortune); }
.coord:nth-child(3) { border-left-color: var(--periwinkle); }
.coord:nth-child(4) { border-left-color: var(--jade); }
.coord h4 {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--slate);
}
.coord p { margin-top: 0.5rem; color: var(--ivory); }
.coord p.mono { font-family: var(--mono); font-size: 0.9rem; color: var(--mist); }

/* ---- 14. FOOTER -------------------------------------------------------- */
.footer {
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, transparent, var(--void-2));
  margin-top: 2rem;
}
.footer__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2rem;
  padding-block: clamp(2.5rem, 5vw, 4rem);
}
.footer__mark { display: flex; align-items: center; gap: 0.8rem; margin-bottom: 1rem; }
.footer__mark img { width: 42px; height: 42px; }
.footer__mark b { font-family: var(--display); letter-spacing: 0.2em; text-transform: uppercase; font-size: 0.95rem; }
.footer p { color: var(--slate); font-size: 0.9rem; max-width: 34ch; }
.footer h5 {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--fortune);
  margin-bottom: 0.9rem;
}
.footer ul { list-style: none; padding: 0; display: grid; gap: 0.5rem; }
.footer ul a { color: var(--mist); font-size: 0.92rem; }
.footer ul a:hover { color: var(--fortune); }
.footer__base {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.6rem;
  padding: 1.2rem 0 2rem;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  color: var(--slate);
}

/* ---- 15. SCROLL REVEAL -------------------------------------------------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ---- 16. ANIMATIONS ----------------------------------------------------- */
@keyframes spin  { to { transform: rotate(360deg); } }
@keyframes spinr { to { transform: rotate(-360deg); } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(127, 209, 185, 0.55); }
  70%  { box-shadow: 0 0 0 8px rgba(127, 209, 185, 0); }
  100% { box-shadow: 0 0 0 0 rgba(127, 209, 185, 0); }
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes coreGlow {
  0%, 100% { opacity: 0.85; }
  50%      { opacity: 1; }
}

/* core internals (driven by classes on the inline SVG) */
.core .rot   { transform-box: fill-box; transform-origin: center; animation: spin 64s linear infinite; }
.core .rot-r { transform-box: fill-box; transform-origin: center; animation: spinr 42s linear infinite; }
.core .orbit { transform-box: fill-box; transform-origin: center; animation: spin 18s linear infinite; }
.core .glowc { animation: coreGlow 4s ease-in-out infinite; }

/* ---- 17. RESPONSIVE ----------------------------------------------------- */
@media (max-width: 960px) {
  :root { --rail: 0px; }
  .rail { display: none; }
  .main { margin-left: 0; }
  .topbar { padding-left: var(--gutter); }
  .topbar::before { display: none; }
  .hero { grid-template-columns: 1fr; text-align: left; }
  .hero__core { grid-row: 1; margin-bottom: 1rem; }
  .core { width: min(64%, 320px); }
  .split, .contact { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(3) { border-left: 0; }
  .stat:nth-child(1), .stat:nth-child(2) { border-bottom: 1px solid var(--line); }
  .values { grid-template-columns: 1fr; }
  .footer__grid { grid-template-columns: 1fr; gap: 1.5rem; }
}

@media (max-width: 640px) {
  .nav { display: none; }
  .nav.open {
    display: flex;
    position: absolute;
    top: 68px; right: var(--gutter);
    flex-direction: column;
    align-items: stretch;
    padding: 0.6rem;
    background: var(--panel-2);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    min-width: 190px;
  }
  .nav__toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5em;
    padding: 0.55rem 0.9rem;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--pill);
    font-family: var(--mono);
    font-size: 0.7rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ivory);
    cursor: pointer;
  }
  .stats { grid-template-columns: 1fr; }
  .stat { border-left: 0; border-bottom: 1px solid var(--line); }
  .tl { grid-template-columns: 1fr; gap: 0.4rem; }
  .tl__marker { display: none; }
}

/* ---- 18. MOTION / A11Y -------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
  .boot .ln { opacity: 1; transform: none; }
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
