/* ==========================================================================
   FrontierMech v0.1 Teaser — Technical Minimalist / Swiss Editorial CSS
   Zero gradients, zero glow orbs, zero backdrop-blur, zero heavy shadows.
   Layout: Standalone Full-Width Hero -> Sticky Left Sidebar from Section 01.
   ========================================================================== */

:root,
[data-theme="dark"] {
  --bg: #0A0A0A;
  --surface: #141414;
  --surface-alt: #101010;
  --border: #222222;
  --border-strong: #343434;
  --text: #F0F0F0;
  --text-secondary: #A0A0A0;
  --text-muted: #6C6C6C;
  --accent: #FF4F00;
  --accent-tint: rgba(255, 79, 0, 0.10);
  --accent-text: #FFFFFF;
  --grid-line: rgba(255, 255, 255, 0.035);
  --scrim: rgba(0, 0, 0, 0.72);
}

[data-theme="light"] {
  --bg: #FAFAFA;
  --surface: #FFFFFF;
  --surface-alt: #F4F4F4;
  --border: #E5E5E5;
  --border-strong: #C8C8C8;
  --text: #171717;
  --text-secondary: #525252;
  --text-muted: #767676;
  --accent: #FF4F00;
  --accent-tint: rgba(255, 79, 0, 0.08);
  --accent-text: #FFFFFF;
  --grid-line: rgba(0, 0, 0, 0.04);
  --scrim: rgba(23, 23, 23, 0.45);
}

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

html {
  scroll-behavior: smooth;
  background-color: var(--bg);
  color: var(--text);
  overflow-x: clip;
}

body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

.mono {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-variant-numeric: tabular-nums;
}

.muted {
  color: var(--text-muted);
}

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

a {
  color: inherit;
  text-decoration: none;
}

code {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.9em;
  padding: 1px 4px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  border-radius: 2px;
}

/* ---------- Fixed Minimal Top Bar (Wordmark Left + Theme Toggle Right) ---------- */

.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 64px;
  z-index: 60;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.top-bar-inner {
  max-width: 1240px;
  height: 100%;
  margin: 0 auto;
  padding: 0 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.top-bar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.wordmark {
  display: inline-block;
  font-family: "Space Grotesk", "Inter", -apple-system, sans-serif;
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.04em;
  color: var(--text);
  line-height: 1;
}

.wordmark-light {
  font-weight: 500;
  color: var(--text-secondary);
}

.control-btn {
  height: 34px;
  padding: 0 12px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 2px;
  font-size: 11px;
  letter-spacing: 0.08em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color 120ms ease, color 120ms ease;
}

.control-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.menu-toggle {
  display: none;
  min-width: 64px;
}

/* ---------- Standalone Full-Width Hero (Zero Sidebar) ---------- */

.hero-band {
  width: 100%;
  padding-top: 64px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.hero-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 48px;
  min-height: min(calc(84vh - 64px), 660px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-copy {
  padding: 72px 0 80px;
  max-width: 960px;
}

.status-pill {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--accent);
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 5px 10px;
  border-radius: 2px;
  margin-bottom: 26px;
}

.hero-title {
  margin: 0 0 26px;
  font-family: "Instrument Serif", Georgia, "Times New Roman", serif;
  font-weight: 400;
  font-size: clamp(44px, 6vw, 78px);
  line-height: 1.03;
  letter-spacing: -0.02em;
  color: var(--text);
  max-width: 940px;
}

.hero-thesis {
  margin: 0;
  font-size: 17px;
  line-height: 1.65;
  color: var(--text-secondary);
  max-width: 740px;
}

/* ---------- Two-Column Body Shell (Sticky Left Sidebar Starts at Section 01) ---------- */

.body-shell {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 48px 96px;
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
  gap: 56px;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: 64px;
  align-self: start;
  height: calc(100vh - 64px);
  padding: 64px 24px 32px 0;
  border-right: 1px solid var(--border);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  z-index: 40;
}

.sidebar-mobile-bar {
  display: none;
  justify-content: flex-end;
  margin-bottom: 20px;
}

.menu-close {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 10px;
  letter-spacing: 0.08em;
  padding: 6px 8px;
  border-radius: 2px;
  cursor: pointer;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  font-size: 13px;
  color: var(--text-secondary);
  border-left: 2px solid transparent;
  transition: color 120ms ease, border-color 120ms ease, background-color 120ms ease;
}

.nav-link:hover {
  color: var(--text);
  background: var(--surface-alt);
}

.nav-link.active {
  color: var(--text);
  border-left-color: var(--accent);
  background: var(--surface);
  font-weight: 500;
}

.nav-num {
  font-size: 11px;
  color: var(--text-muted);
  min-width: 18px;
}

.nav-link.active .nav-num {
  color: var(--accent);
}

.drawer-scrim {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--scrim);
  z-index: 45;
}

/* ---------- Main Sections ---------- */

.main-content {
  min-width: 0;
}

.section {
  padding: 64px 0 72px;
  border-bottom: 1px solid var(--border);
  scroll-margin-top: 64px;
}

.section:last-child {
  border-bottom: none;
}

.section-header {
  margin-bottom: 28px;
}

.section-index {
  display: block;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.section-title {
  margin: 0;
  font-family: "Inter", -apple-system, sans-serif;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--text);
}

/* ---------- 01. Video Showcase ---------- */

.video-stack {
  display: flex;
  flex-direction: column;
  gap: 36px;
}

.media-block {
  margin: 0;
}

.video-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #0D0D0D;
  border: 1px solid var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.video-frame video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #0D0D0D;
}

.caption {
  margin-top: 10px;
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-secondary);
  text-align: left;
}

.caption strong {
  color: var(--text);
  font-weight: 500;
}

/* ---------- 02. Automation Spectrum ---------- */

.spectrum-panel {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 2px;
  padding: 22px;
  margin-bottom: 28px;
}

.spectrum-axis-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.spectrum-bar {
  display: flex;
  width: 100%;
  height: 54px;
  border: 1px solid var(--border-strong);
  background: var(--bg);
  overflow: hidden;
}

.spectrum-seg {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  border-right: 1px solid var(--border-strong);
  min-width: 0;
  overflow: hidden;
}

.spectrum-seg:last-child {
  border-right: none;
}

.spectrum-seg.is-target {
  background: var(--accent-tint);
  border-top: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
}

.seg-code {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  white-space: nowrap;
}

.spectrum-seg.is-target .seg-code {
  color: var(--accent);
}

.seg-pct {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
}

.spectrum-seg.is-target .seg-pct {
  color: var(--accent);
}

.spectrum-legend {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin-top: 18px;
  border-top: 1px solid var(--border);
}

.legend-item {
  padding: 16px 16px 2px 0;
  border-right: 1px solid var(--border);
}

.legend-item:nth-child(2),
.legend-item:nth-child(3) {
  padding-left: 16px;
}

.legend-item:last-child {
  border-right: none;
  padding-right: 0;
}

.legend-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.legend-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

.legend-item.is-target .legend-name {
  color: var(--accent);
}

.legend-chip {
  font-size: 11px;
  color: var(--text-muted);
}

.legend-item.is-target .legend-chip {
  color: var(--accent);
}

.legend-desc {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.target-tag {
  display: inline-block;
  margin-top: 8px;
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 2px 6px;
  border-radius: 2px;
}

/* ---------- Image Strips & Evaluation Visual Gallery ---------- */

.image-strip {
  display: grid;
  gap: 20px;
}

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

.slot-figure {
  margin: 0;
}

.slot-frame {
  width: 100%;
  background-color: var(--surface);
  background-image:
    linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
  background-size: 20px 20px;
  border: 1px solid var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.ratio-16-10 {
  aspect-ratio: 16 / 10;
}

.ratio-16-9 {
  aspect-ratio: 16 / 9;
}

.slot-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---------- 03. Evaluation Pipeline + 4-Dim Visual Gallery ---------- */

.pipeline-wrap {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 2px;
  padding: 24px 22px 18px;
  margin-bottom: 32px;
}

.pipeline-grid {
  display: grid;
  grid-template-columns: 1fr 22px 1fr 22px 1fr 22px 1fr;
  align-items: stretch;
  gap: 0;
}

.pipe-node {
  border: 1px solid var(--border-strong);
  background: var(--bg);
  padding: 14px;
  border-radius: 2px;
  min-width: 0;
}

.pipe-node-accent {
  border-color: var(--accent);
}

.pipe-head {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--text);
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.pipe-node-accent .pipe-head {
  color: var(--accent);
}

.pipe-body {
  margin: 0;
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-secondary);
}

.pipe-connector {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.pipe-connector svg {
  width: 18px;
  height: 18px;
}

.arrow-v {
  display: none;
}

.pipeline-loop {
  margin-top: 8px;
  color: var(--text-muted);
}

.loop-svg {
  display: block;
  width: 100%;
  height: 32px;
  color: var(--accent);
}

.loop-label {
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--accent);
  text-align: right;
  padding-right: 10%;
  margin-top: 2px;
}

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

/* ---------- 04. Notify & Footer ---------- */

.notify-section {
  padding-bottom: 32px;
}

.notify-form {
  display: flex;
  align-items: stretch;
  max-width: 460px;
  gap: 8px;
}

.notify-input {
  flex: 1;
  min-width: 0;
  height: 42px;
  padding: 0 12px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: 2px;
  font-size: 13px;
  outline: none;
  transition: border-color 120ms ease;
}

.notify-input::placeholder {
  color: var(--text-muted);
}

.notify-input:focus {
  border-color: var(--accent);
}

.notify-btn {
  height: 42px;
  padding: 0 18px;
  background: var(--accent);
  color: var(--accent-text);
  border: 1px solid var(--accent);
  border-radius: 2px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.05em;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 120ms ease;
}

.notify-btn:hover {
  opacity: 0.88;
}

.notify-feedback {
  margin-top: 10px;
  min-height: 18px;
  font-size: 12px;
  color: var(--text-secondary);
}

.notify-feedback.is-ok {
  color: var(--accent);
}

.notify-feedback.is-err {
  color: #E5484D;
}

.site-footer {
  margin-top: 56px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text-muted);
}

.site-footer a {
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-strong);
  transition: color 120ms ease, border-color 120ms ease;
}

.site-footer a:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* ---------- Responsive (Tablet & Mobile iOS/Android) ---------- */

@media (max-width: 960px) {
  .top-bar-inner {
    padding: 0 20px;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .wordmark {
    font-size: 19px;
  }

  .hero-inner {
    padding: 0 20px;
    min-height: auto;
  }

  .hero-copy {
    padding: 48px 0 56px;
  }

  .body-shell {
    display: block;
    padding: 0 20px 72px;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 264px;
    height: 100dvh;
    padding: 24px 20px 24px;
    border-right: 1px solid var(--border);
    transform: translateX(-100%);
    transition: transform 160ms ease;
    z-index: 70;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-mobile-bar {
    display: flex;
  }

  .drawer-scrim {
    z-index: 65;
  }

  .drawer-scrim.open {
    display: block;
  }

  .section {
    padding: 52px 0;
  }

  .strip-3 {
    grid-template-columns: 1fr;
  }

  .eval-gallery {
    grid-template-columns: 1fr;
  }

  .spectrum-legend {
    grid-template-columns: 1fr;
  }

  .legend-item,
  .legend-item:nth-child(2),
  .legend-item:nth-child(3) {
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 14px 0;
  }

  .legend-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
  }

  .pipeline-grid {
    grid-template-columns: 1fr;
  }

  .pipe-connector {
    height: 28px;
  }

  .arrow-h {
    display: none;
  }

  .arrow-v {
    display: block;
  }

  .loop-svg {
    display: none;
  }

  .loop-label {
    text-align: left;
    padding-right: 0;
    padding-top: 10px;
    border-top: 1px dashed var(--accent);
  }

  .notify-form {
    flex-direction: column;
    max-width: 100%;
  }

  .notify-btn {
    width: 100%;
  }
}
