:root {
  color-scheme: dark;
  --bg: #000;
  --text: #fff;
  --muted: rgba(255, 255, 255, 0.72);
  --faint: rgba(255, 255, 255, 0.48);
  --line: rgba(255, 255, 255, 0.18);
  --line-soft: rgba(255, 255, 255, 0.1);
  --panel: #000;
  --control: #111;
  --control-hover: #222;
  --max: 1180px;
  --article: 840px;
  --unit: 4px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  line-height: 1.75;
  text-rendering: geometricPrecision;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

iframe {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

:focus-visible {
  outline: 1px solid #fff;
  outline-offset: 3px;
}

html[data-lang="ja"] .lang-en,
html[data-lang="en"] .lang-ja {
  display: none !important;
}

.site-header {
  position: fixed;
  z-index: 20;
  inset: 0 0 auto;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 18px clamp(18px, 4vw, 56px);
  color: #fff;
  mix-blend-mode: difference;
}

.brand {
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.nav {
  display: flex;
  justify-content: flex-end;
  gap: 18px;
  min-width: 0;
  font-size: 13px;
  line-height: 1;
}

.nav a {
  color: #fff;
  opacity: 0.72;
  text-decoration: none;
}

.nav a:hover {
  opacity: 1;
}

.lang-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.24);
}

.lang-switch button {
  min-width: 44px;
  min-height: 30px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: #fff;
  cursor: pointer;
  font-family: Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 11px;
  letter-spacing: 0.05em;
}

.lang-switch button:last-child {
  border-right: 0;
}

html[data-lang="ja"] .lang-switch [data-set-lang="ja"],
html[data-lang="en"] .lang-switch [data-set-lang="en"] {
  background: #fff;
  color: #000;
}

.wrap,
.hero-inner {
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
}

.hero {
  min-height: 100svh;
  display: grid;
  align-items: end;
  padding: 112px 0 72px;
  border-bottom: 1px solid var(--line);
  background: #000;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.96fr) minmax(320px, 0.72fr);
  gap: clamp(32px, 6vw, 84px);
  align-items: end;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 20px;
  color: var(--muted);
  font-family: Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 44px;
  height: 1px;
  background: #fff;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 980px;
  margin-bottom: 28px;
  font-size: clamp(56px, 9vw, 132px);
  font-weight: 100;
  letter-spacing: -0.02em;
  line-height: 0.92;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
}

.project-title {
  font-size: clamp(54px, 6.4vw, 92px);
  line-height: 0.96;
}

.history-title {
  font-size: clamp(42px, 5.8vw, 86px);
  line-height: 0.98;
  overflow-wrap: normal;
  word-break: normal;
}

.history-title span {
  display: block;
  white-space: nowrap;
}

h2 {
  max-width: 980px;
  margin-bottom: 28px;
  font-size: clamp(34px, 5vw, 72px);
  font-weight: 200;
  letter-spacing: -0.02em;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

h3 {
  margin-bottom: 10px;
  font-size: 20px;
  font-weight: 450;
  line-height: 1.28;
  overflow-wrap: anywhere;
}

.hero-copy {
  max-width: 760px;
  margin-bottom: 32px;
  color: var(--muted);
  font-size: clamp(18px, 2.2vw, 25px);
  font-weight: 300;
  line-height: 1.62;
  overflow-wrap: anywhere;
}

.hero-actions,
.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 12px 18px;
  border: 1px solid #333;
  border-radius: 4px;
  background: #111;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.button:hover {
  border-color: #fff;
  background: #222;
  transform: translateY(-2px);
}

.button.primary {
  border-color: #fff;
  background: #fff;
  color: #000;
}

.button.ghost {
  background: transparent;
}

.media-surface {
  border: 1px solid var(--line);
  background: #000;
}

.media-surface img {
  width: 100%;
  height: auto;
  object-fit: contain;
}

.media-caption {
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-family: Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 11px;
  line-height: 1.45;
}

.video-section {
  padding: clamp(44px, 8vw, 96px) 0;
  border-bottom: 1px solid var(--line);
}

.video-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  background: #000;
}

.video-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.reference-video-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(18px, 3vw, 28px);
  margin-top: 28px;
}

.reference-video-card {
  min-width: 0;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}

.reference-video-card .video-frame {
  border: 0;
  border-bottom: 1px solid var(--line);
}

.reference-video-card h3 {
  margin: 0;
  padding: 16px 16px 0;
  font-size: clamp(16px, 2vw, 22px);
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.reference-video-card p {
  margin: 0;
  padding: 12px 16px 18px;
  color: var(--muted);
}

.section {
  padding: clamp(72px, 10vw, 128px) 0;
  border-bottom: 1px solid var(--line-soft);
}

.section[id] {
  scroll-margin-top: 78px;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(30px, 6vw, 88px);
  align-items: start;
}

.lead {
  max-width: 820px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: clamp(18px, 2vw, 24px);
  font-weight: 300;
  line-height: 1.72;
  overflow-wrap: anywhere;
}

.body-copy {
  color: var(--muted);
  font-size: 16px;
  font-weight: 300;
  overflow-wrap: anywhere;
}

.body-copy p:last-child {
  margin-bottom: 0;
}

.panel-grid,
.statement,
.metric-row,
.link-panel,
.intro-grid,
.question-list {
  display: grid;
  gap: 0;
  border: 1px solid var(--line);
  background: var(--line);
}

.statement,
.link-panel,
.intro-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.metric-row {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.panel,
.statement-panel,
.metric,
.link-panel > div,
.intro-grid > div,
.question,
.timeline-item,
.flow-step,
.application,
.concept-card {
  min-width: 0;
  background: #000;
  color: #fff;
}

.statement-panel,
.metric,
.link-panel > div,
.intro-grid > div,
.question {
  padding: clamp(24px, 4.5vw, 48px);
}

.statement-label,
.section-kicker,
.metric small,
.panel-label {
  margin-bottom: 16px;
  color: var(--faint);
  font-family: Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.statement-text {
  margin: 0;
  color: #fff;
  font-size: clamp(26px, 3.6vw, 48px);
  font-weight: 200;
  line-height: 1.18;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

.metric {
  min-height: 156px;
  padding: 22px;
}

.metric strong {
  display: block;
  margin-bottom: 10px;
  font-family: Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 400;
  line-height: 1;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.timeline {
  display: grid;
  gap: 1px;
  margin-top: 32px;
  border: 1px solid var(--line);
  background: var(--line);
}

.timeline-item {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 24px;
  padding: 24px;
}

.timeline-item time {
  color: #fff;
  font-family: Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
  line-height: 1.4;
}

.timeline-item p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.pipeline,
.flow-grid,
.application-grid {
  display: grid;
  gap: 1px;
  margin-top: 32px;
  border: 1px solid var(--line);
  background: var(--line);
}

.pipeline,
.flow-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.application-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.pipeline-step,
.flow-step,
.application {
  min-width: 0;
  min-height: 196px;
  padding: 22px;
  background: #000;
}

.step-number,
.flow-step span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin-bottom: 18px;
  border: 1px solid #fff;
  color: #fff;
  font-family: Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
  line-height: 1;
}

.pipeline-step p,
.flow-step p,
.application p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.gallery {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  margin-top: 36px;
}

.gallery img {
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  object-fit: contain;
}

.gallery-side {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.caption {
  margin: 14px 0 0;
  color: var(--faint);
  font-family: Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 11px;
}

.link-list,
.toc {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.link-list a,
.toc a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 58px;
  padding: 14px 16px;
  border: 1px solid #333;
  background: #111;
  text-decoration: none;
  transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.link-list a:hover,
.toc a:hover {
  border-color: #fff;
  background: #222;
  transform: translateY(-2px);
}

.link-list a::after,
.toc a::after {
  content: "↗";
  flex: 0 0 auto;
  color: var(--muted);
}

.article {
  max-width: var(--article);
  margin: 0 auto;
}

.article.wide {
  max-width: var(--max);
}

.article p {
  color: var(--muted);
  font-size: 17px;
  font-weight: 300;
  line-height: 1.9;
  overflow-wrap: anywhere;
}

.pull {
  margin: clamp(36px, 6vw, 64px) 0;
  padding: clamp(26px, 5vw, 48px);
  border: 1px solid var(--line);
  background: #000;
  color: #fff;
  font-size: clamp(25px, 3.2vw, 44px);
  font-weight: 200;
  line-height: 1.32;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

.question-list {
  margin: 32px 0 0;
}

.question {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr);
  gap: 24px;
}

.question strong {
  color: #fff;
  font-family: Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 26px;
  font-weight: 400;
  line-height: 1;
}

.question p {
  margin: 0;
  color: #fff;
  font-size: clamp(18px, 2vw, 23px);
  line-height: 1.6;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 28px;
  border: 1px solid var(--line);
  background: #000;
  color: #fff;
  font-size: 14px;
}

th,
td {
  padding: 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  line-height: 1.6;
}

th {
  color: var(--faint);
  font-family: Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

td {
  color: var(--muted);
}

tr:last-child td {
  border-bottom: 0;
}

.credit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin-top: 30px;
  border: 1px solid var(--line);
  background: var(--line);
}

.credit-grid div {
  padding: 20px;
  background: #000;
}

.credit-grid dt {
  margin-bottom: 6px;
  color: var(--faint);
  font-family: Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.credit-grid dd {
  margin: 0;
  color: var(--muted);
}

.footer {
  padding: 34px 0;
  border-top: 1px solid var(--line);
  background: #000;
  color: var(--faint);
  font-family: Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 11px;
}

.footer .wrap {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

@media (max-width: 960px) {
  .site-header {
    position: absolute;
    grid-template-columns: auto auto;
    mix-blend-mode: normal;
  }

  .nav {
    display: none;
  }

  .hero-grid,
  .split,
  .statement,
  .link-panel,
  .intro-grid {
    grid-template-columns: 1fr;
  }

  .metric-row,
  .pipeline,
  .flow-grid,
  .reference-video-grid,
  .application-grid,
  .credit-grid,
  .gallery-side {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .wrap,
  .hero-inner {
    width: min(100% - 32px, var(--max));
  }

  .hero {
    min-height: auto;
    padding: 96px 0 52px;
  }

  h1 {
    font-size: 48px;
  }

  h2 {
    font-size: 36px;
  }

  .hero-copy,
  .article p {
    font-size: 16px;
  }

  .button {
    width: 100%;
  }

  .metric-row,
  .pipeline,
  .flow-grid,
  .reference-video-grid,
  .application-grid,
  .credit-grid,
  .gallery-side {
    grid-template-columns: 1fr;
  }

  .timeline-item,
  .question {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .works-table {
    table-layout: fixed;
    white-space: normal;
  }

  .works-table th,
  .works-table td {
    padding: 12px 10px;
    overflow-wrap: anywhere;
    word-break: break-word;
  }
}
