/* ─── Tokens ─────────────────────────────────────────────── */
:root {
  --bg: #ecedef;
  --bg-card: #efeeec;
  --bg-badge: #ececea;
  --ink: #101012;
  --ink-2: #111114;
  --muted: #7c7c79;
  --muted-2: #4a4a48;
  --paper: #f4f4f2;
  --red: #ff2d2d;
  --dark: #0c0c0e;

  --font-display: "Anton", "Impact", sans-serif;
  --font-body: "Archivo", system-ui, sans-serif;
  --font-jp: "Noto Sans JP", sans-serif;
  --font-mono: "Space Mono", ui-monospace, monospace;

  --wrap: 1400px;
  --gutter: 40px;
  --radius: 6px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p, ul, dl, dd, hr { margin: 0; }
ul { padding: 0; list-style: none; }

/* ─── Shared ─────────────────────────────────────────────── */
.wrap {
  width: min(100%, var(--wrap));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.display {
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  color: var(--ink);
  letter-spacing: 0;
}
.display--xl { font-size: clamp(56px, 6.4vw, 92px); line-height: 0.9; }
.display--lg { font-size: clamp(44px, 5vw, 72px); line-height: 1; }
.display--md { font-size: clamp(34px, 3.4vw, 48px); line-height: 0.96; }
.display--sm { font-size: 24px; line-height: 1.1; }

.lede { color: var(--muted); font-size: 14px; }

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

.badge {
  display: inline-flex;
  align-items: center;
  padding: 7px 13px;
  border-radius: 100px;
  background: var(--bg-badge);
  border: 1px solid rgba(17, 17, 20, 0.22);
  font-family: var(--font-jp);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 1px;
  color: #2a2a28;
  line-height: 1.2;
}
.badge--sm { font-size: 10px; padding: 6px 11px; border-color: rgba(17, 17, 20, 0.2); }
.badge--ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.25);
  color: rgba(255, 255, 255, 0.85);
  letter-spacing: 1.5px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  padding: 15px 18px 15px 22px;
  border-radius: 100px;
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  white-space: nowrap;
  transition: transform 0.2s ease, background 0.2s ease;
}
.btn img { width: 14px; height: 14px; transition: transform 0.2s ease; }
.btn:hover img { transform: translate(2px, -2px); }
.btn--dark { background: var(--ink); color: #fff; }
.btn--dark:hover { background: #000; }
.btn--light { background: var(--paper); color: var(--ink); }
.btn--light:hover { background: #fff; }
.btn--outline {
  background: #fafaf8;
  color: var(--ink);
  border: 1px solid rgba(17, 17, 20, 0.35);
  padding: 20px 34px 20px 30px;
  min-width: 320px;
}
.btn--outline:hover { background: #fff; }
.btn--wide { min-width: 320px; padding: 20px 40px 20px 30px; }

/* ─── Nav ────────────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  /* no backdrop-filter here: it would turn .nav into the containing block
     for the fixed-position mobile menu */
  background: color-mix(in srgb, var(--bg) 94%, transparent);
}
.nav__inner {
  width: min(100%, var(--wrap));
  margin-inline: auto;
  padding: 26px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.nav__logo,
.footer__logo {
  font-weight: 600;
  font-size: 16px;
  letter-spacing: 1.5px;
  color: var(--ink-2);
  white-space: nowrap;
}
.nav__links {
  display: flex;
  gap: 30px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--muted-2);
}
.nav__links a:hover { color: var(--ink); }
.nav__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 100px;
  background: var(--ink-2);
  color: #fff;
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.3px;
  white-space: nowrap;
}
.nav__cta .jp { color: var(--red); font-size: 12px; }
.nav__cta--mobile { display: none; }

.burger {
  display: none;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}
.burger span {
  display: block;
  width: 24px;
  height: 2px;
  margin-inline: auto;
  background: var(--ink);
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.burger[aria-expanded="true"] span:first-child { transform: translateY(4px) rotate(45deg); }
.burger[aria-expanded="true"] span:last-child { transform: translateY(-4px) rotate(-45deg); }

/* ─── Hero ───────────────────────────────────────────────── */
.hero { overflow: hidden; }
.hero__inner {
  position: relative;
  width: min(100%, var(--wrap));
  margin-inline: auto;
  height: 640px;
}
.hero__kanji {
  position: absolute;
  inset: 0;
  left: auto;
  width: 60%;
  pointer-events: none;
  font-family: var(--font-jp);
  font-weight: 700;
  font-size: clamp(120px, 18vw, 260px);
  line-height: 1;
  color: rgba(17, 17, 20, 0.1);
  white-space: nowrap;
}
.hero__kanji span { position: absolute; }
.hero__kanji-a { right: 0.15em; top: -0.18em; }
.hero__kanji-b { right: -0.15em; top: 0.9em; }

.hero__img {
  position: absolute;
  left: 50%;
  top: -20px;
  height: 618px;
  width: auto;
  max-width: none;
  transform: translateX(-38%);
}
.hero__copy {
  position: absolute;
  left: var(--gutter);
  top: 176px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 26px;
  z-index: 2;
}
.hero__copy .btn { gap: 44px; }

/* ─── Suits ──────────────────────────────────────────────── */
.suits {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 46px;
  padding-block: 62px;
}
.suits__head {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-items: center;
}

.showcase {
  position: relative;
  width: 100%;
  aspect-ratio: 1360 / 620;
  min-height: 360px;
  border-radius: var(--radius);
  overflow: hidden;
  background: #0e0e11;
}
.showcase__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 8%; /* keep the character's face in frame */
}
.showcase__cta {
  position: absolute;
  left: 28px;
  bottom: 22px;
  padding: 13px 16px 13px 20px;
}

.hud {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 176px;
  padding: 11px 13px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(6px);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.5px;
  line-height: 1.3;
}
.hud div { display: flex; justify-content: space-between; }
.hud dt { color: rgba(255, 255, 255, 0.45); }
.hud dd { color: var(--red); }

.stats {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  padding: 20px 10px 0;
}
.stats li {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  padding: 12px;
  margin: -12px;              /* hit-area for the hover effect without shifting layout */
  border-radius: 12px;
  transform-style: preserve-3d;
  transition: transform 0.18s ease-out, background 0.3s ease;
  will-change: transform;
}
.stats li:hover { background: rgba(17, 17, 20, 0.03); }
.stats li > * {
  transition: transform 0.18s ease-out;
  will-change: transform;
}
.stats li:not(:hover),
.stats li:not(:hover) > * { transition-duration: 0.5s; }

/* same cursor-tilt treatment on technology cards and posts */
.card, .post {
  transform-style: preserve-3d;
  transition: transform 0.18s ease-out, background 0.3s ease, border-color 0.3s ease;
  will-change: transform;
}
.card:hover, .post:hover { background: rgba(17, 17, 20, 0.025); border-color: rgba(17, 17, 20, 0.22); }
.card__media img, .card h3, .card p,
.post__media img, .post h3, .post p, .post__meta, .post__link {
  transition: transform 0.18s ease-out;
  will-change: transform;
}
.card:not(:hover), .card:not(:hover) *,
.post:not(:hover), .post:not(:hover) * { transition-duration: 0.5s; }
.card__media { overflow: visible; }  /* let the image drift past its box a little */
.stats .display { font-size: 50px; line-height: 1; }
.stats li > span:last-child { color: var(--muted); font-size: 13px; }

/* ─── Systems ────────────────────────────────────────────── */
.systems { overflow: hidden; }
.systems__inner {
  position: relative;
  width: min(100%, var(--wrap));
  margin-inline: auto;
  height: 560px;
}
.systems__canvas {
  position: absolute;
  left: 50%;
  top: 20px;
  height: 520px;
  width: auto;                /* follows the frame's intrinsic ratio (set by JS) */
  transform: translateX(-50%);
  pointer-events: none;
  filter: drop-shadow(0 30px 40px rgba(0, 0, 0, 0.08));
}
/* Scroll-scrub mode (set by JS once frames are loaded): the section grows and
   the inner block pins while the helmet turns to face the reader. Taller
   section = slower turn per scroll step. */
.systems.is-scrub { height: 420vh; overflow: visible; }
.systems.is-scrub .systems__inner {
  position: sticky;
  top: 0;
  height: 100vh;
  display: grid;
  align-content: center;
}
.systems.is-scrub .systems__ring,
.systems.is-scrub .systems__canvas,
.systems.is-scrub .systems__tb { top: 50%; }
.systems.is-scrub .systems__ring { transform: translate(-50%, -50%); }
.systems.is-scrub .systems__canvas { transform: translate(-50%, -50%); }
.systems.is-scrub .systems__tb--hud { transform: translateY(-190px); }
.systems.is-scrub .systems__tb--life { transform: translateY(120px); }
.systems.is-scrub .systems__img { display: none; }
.systems.is-scrub .systems__tb--life {
  opacity: var(--life-in, 0);
  transition: opacity 0.2s linear;
}
.systems__ring {
  position: absolute;
  left: 50%;
  top: 0;
  width: 560px;
  height: 560px;
  transform: translateX(-56%);
  border-radius: 50%;
  border: 1px solid rgba(17, 17, 20, 0.08);
}
.systems__img {
  position: absolute;
  left: 50%;
  top: 20px;
  height: 520px;
  width: auto;
  max-width: none;
  transform: translateX(-50%);
  filter: drop-shadow(0 30px 40px rgba(0, 0, 0, 0.08));
}
.systems__tb {
  position: absolute;
  display: flex;
  flex-direction: column;
  gap: 18px;
  z-index: 2;
}
.systems__tb--hud { left: var(--gutter); top: 70px; }
.systems__tb--life { right: var(--gutter); top: 380px; width: 305px; }

/* ─── Technology ─────────────────────────────────────────── */
.tech {
  display: flex;
  align-items: flex-start;
  gap: 44px;
  padding-block: 86px 92px;
}
.tech__intro {
  flex: 0 0 348px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
}
.cards {
  flex: 1 1 0;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}
.card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px 16px 20px;
  border-radius: 14px;
  background: transparent;
  border: 1px solid rgba(17, 17, 20, 0.12);
}
.card__media {
  height: 168px;
  border-radius: 4px;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.card__media img { width: 100%; height: 100%; object-fit: contain; }
/* glove: tight cut-out, fills the slot width and sits centred vertically */
.card:first-child .card__media img { object-fit: contain; object-position: center; }
/* helmets: keep both fully inside the slot, centred, with breathing room */
.card:last-child .card__media { display: grid; place-items: center; }
.card:last-child .card__media img { object-fit: contain; object-position: center; width: 92%; height: 92%; }
.card p { color: var(--muted); font-size: 13.5px; }

/* ─── Dark CTA ───────────────────────────────────────────── */
.cta {
  position: relative;
  height: 520px;
  overflow: hidden;
  background: #08080a;
  color: var(--paper);
}
.cta__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: right center;
}
.cta__inner {
  position: relative;
  z-index: 2;
  width: min(100%, var(--wrap));
  margin-inline: auto;
  height: 100%;
  padding-inline: var(--gutter);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  text-align: center;
  /* content sits centre-left so it clears the model's face */
  padding-right: 34%;
}
.cta .display { color: var(--paper); font-size: clamp(48px, 5.2vw, 74px); line-height: 0.92; }
.cta p { color: rgba(255, 255, 255, 0.5); font-weight: 500; font-size: 14.5px; }

/* ─── Mission log ────────────────────────────────────────── */
.log {
  display: flex;
  flex-direction: column;
  gap: 46px;
  padding-block: 86px 92px;
}
.log__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.log__tb {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
}
.log .display--lg { font-size: 56px; line-height: 0.96; }

.posts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.post {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 16px 22px;
  border-radius: 14px;
  border: 1px solid rgba(17, 17, 20, 0.12);
}
.post__media {
  width: 100%;
  height: 240px;
  border-radius: 10px;
  overflow: hidden;
  background: #dad9d5;
}
.post__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.post:hover .post__media img { transform: scale(1.03); }
.post__meta {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.5px;
  color: var(--muted);
}
.post h3 { font-size: 26px; line-height: 1.04; }
.post p { color: var(--muted); font-size: 13.5px; }
.post__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.post__link img { width: 14px; height: 14px; transition: transform 0.2s ease; }
.post__link:hover img { transform: translate(2px, -2px); }

/* ─── Scroll reveal (left → right cascade) ───────────────── */
/* uses `translate` (not `transform`) so it composes with elements that already
   carry a transform, e.g. .hero__img / .systems__img */
.js [data-reveal] {
  opacity: 0;
  translate: -36px 0;
  transition:
    opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
    translate 0.9s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--reveal-delay, 0ms);
}
.js [data-reveal].is-visible {
  opacity: 1;
  translate: 0 0;
}
/* exit is driven by scroll position (inline opacity/translate) — no transition,
   and promoted to its own layer so mobile compositors don't repaint per frame */
.js [data-reveal].is-leaving { transition: none; will-change: opacity, translate; }
@media (prefers-reduced-motion: reduce) {
  .js [data-reveal] { opacity: 1; translate: none; transition: none; }
}

/* ─── Footer ─────────────────────────────────────────────── */
.footer { background: var(--dark); color: var(--paper); }
.footer__inner {
  width: min(100%, var(--wrap));
  margin-inline: auto;
  padding: 40px var(--gutter) 38px;
  display: flex;
  flex-direction: column;
  gap: 26px;
}
.footer__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.footer__logo { color: var(--paper); }
.footer__links {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.55);
}
.footer__links a:hover { color: #fff; }
.footer hr { border: 0; height: 1px; background: rgba(255, 255, 255, 0.1); }
.footer__fine {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.5px;
  color: rgba(255, 255, 255, 0.4);
}

/* ─── Responsive ─────────────────────────────────────────── */
@media (max-width: 1100px) {
  .hero__img { transform: translateX(-30%); }
  .systems__tb--life { top: 400px; }
  .tech { flex-direction: column; }
  .tech__intro { flex-basis: auto; }
  .cards { width: 100%; }
  .posts { grid-template-columns: repeat(2, 1fr); }
  .cta__inner { padding-right: 30%; }
}

/* Tablet & below: burger nav */
@media (max-width: 900px) {
  :root { --gutter: 24px; }

  .nav__links {
    position: fixed;
    inset: 0;
    z-index: 40;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 28px;
    padding: 96px var(--gutter) 40px;
    background: var(--bg);
    font-size: 18px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s linear 0.25s;
  }
  .nav.is-open .nav__links {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
  }
  .nav__cta--desktop { display: none; }
  .nav__cta--mobile { display: inline-flex; margin-top: 12px; font-family: var(--font-body); }
  .burger { display: flex; position: relative; z-index: 60; }
  .nav__logo { position: relative; z-index: 60; }
  body.nav-locked { overflow: hidden; }

  .hero__inner { height: auto; padding-bottom: 32px; }
  .hero__img {
    position: relative;
    left: auto;
    top: 0;
    transform: none;
    height: auto;
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
  }
  /* kanji stay behind the cut-out, scaled to the image height */
  .hero__kanji {
    width: 100%;
    height: min(100vw, 560px);      /* same box as the image */
    inset: 0 0 auto 0;
    font-size: clamp(110px, 34vw, 190px);
  }
  .hero__kanji-a { right: -0.12em; top: -0.12em; }
  .hero__kanji-b { right: -0.3em;  top: 0.92em; }
  .hero__img { position: relative; z-index: 1; }
  .hero__copy { position: relative; left: 0; top: 0; padding-inline: var(--gutter); }

  .stats { grid-template-columns: repeat(2, 1fr); gap: 32px 24px; }

  .systems__inner { height: auto; display: flex; flex-direction: column; align-items: center; gap: 32px; padding-block: 40px; }
  .systems__ring { display: none; }
  .systems__img {
    position: static;
    inset: auto;
    transform: none;
    height: auto;
    width: min(84vw, 480px);
    max-width: 84vw;
    margin: 8px auto;
    align-self: center;
  }
  .systems__tb { position: static; width: 100%; padding-inline: var(--gutter); }

  /* scroll-scrub on mobile: pin the block, helmet centred, copy top & bottom */
  .systems.is-scrub { height: 320vh; }
  .systems.is-scrub .systems__inner {
    display: block;
    height: 100vh;
    height: 100svh;
    padding: 0;
  }
  .systems.is-scrub .systems__canvas {
    position: absolute;
    left: 50%;
    top: 50%;
    width: min(72vw, 420px);
    height: auto;
    transform: translate(-50%, -46%);
  }
  .systems.is-scrub .systems__tb {
    position: absolute;
    left: 0;
    width: 100%;
    transform: none;
  }
  .systems.is-scrub .systems__tb--hud { top: 12vh; top: 12svh; }
  .systems.is-scrub .systems__tb--life { top: auto; bottom: 8vh; bottom: 8svh; }

  .cta { height: auto; min-height: 520px; }
  .cta__inner { padding: 72px var(--gutter); align-items: flex-start; text-align: left; }
  .cta__bg { opacity: 0.6; object-position: 78% center; }
  .cta::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(8, 8, 10, 0.92) 0%, rgba(8, 8, 10, 0.55) 55%, rgba(8, 8, 10, 0.1) 100%);
  }
  .cta__inner { z-index: 2; }
}

@media (max-width: 600px) {
  .nav__inner { padding-block: 18px; }
  .display--xl { font-size: clamp(52px, 15vw, 72px); }
  .showcase { aspect-ratio: auto; height: 380px; }
  .hud { width: 150px; top: 16px; right: 16px; }
  .cards { grid-template-columns: 1fr; }
  .posts { grid-template-columns: 1fr; }
  .log .display--lg { font-size: 44px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stats .display { font-size: 40px; }
  .btn { gap: 24px; }
}
