:root {
  --bg: #eef2f0;
  --surface: #ffffff;
  --ink: #161616;
  --muted: #62605a;
  --line: rgba(22, 22, 22, 0.14);
  --accent: #1c7c68;
  --accent-strong: #0f5f50;
  --gold: #c79a34;
  --danger: #a64b3c;
  --shadow: 0 24px 80px rgba(27, 30, 27, 0.14);
  --header-h: 72px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(22, 22, 22, 0.04) 1px, transparent 1px),
    linear-gradient(180deg, rgba(22, 22, 22, 0.035) 1px, transparent 1px),
    var(--bg);
  background-size: 42px 42px;
}

body.nav-open {
  overflow: hidden;
}

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

button {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--header-h);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 0 clamp(18px, 4vw, 54px);
  border-bottom: 1px solid var(--line);
  background: rgba(238, 242, 240, 0.86);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: max-content;
}

.brand strong {
  display: block;
  font-size: 18px;
  line-height: 1;
}

.brand small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border: 2px solid var(--ink);
  border-radius: 4px;
  background:
    linear-gradient(90deg, transparent 0 12%, var(--gold) 12% 18%, transparent 18% 28%, var(--gold) 28% 34%, transparent 34% 44%, var(--gold) 44% 50%, transparent 50% 60%, var(--gold) 60% 66%, transparent 66%),
    linear-gradient(180deg, var(--accent), #113f38);
  background-size: 100% 30%, 100% 100%;
  background-position: bottom, center;
  background-repeat: no-repeat;
}

.site-nav {
  display: flex;
  justify-content: center;
  gap: 4px;
}

.nav-link {
  padding: 10px 12px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 14px;
  transition: background 180ms ease, color 180ms ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--ink);
  background: rgba(22, 22, 22, 0.07);
}

.language-switch {
  display: inline-flex;
  align-items: center;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.64);
}

.language-switch button {
  min-width: 48px;
  min-height: 34px;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.language-switch button.active {
  color: #fff;
  background: var(--ink);
}

.menu-toggle {
  display: none;
}

#app {
  min-height: calc(100svh - var(--header-h));
  animation: pageIn 360ms ease both;
}

.section {
  padding: clamp(56px, 8vw, 108px) clamp(18px, 5vw, 70px);
}

.section.tight {
  padding-top: clamp(36px, 6vw, 70px);
}

.inner {
  width: min(1180px, 100%);
  margin: 0 auto;
}

.hero {
  position: relative;
  min-height: calc(100svh - var(--header-h));
  display: grid;
  align-items: center;
  overflow: hidden;
  padding: clamp(36px, 7vw, 84px) clamp(18px, 5vw, 70px);
  color: #fff;
  background: #121614;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(10, 14, 12, 0.94), rgba(10, 14, 12, 0.58) 45%, rgba(10, 14, 12, 0.12)),
    url("assets/ram-module-ddr4.jpg") center right / cover no-repeat;
  transform: scale(1.02);
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 34%;
  background: linear-gradient(180deg, transparent, rgba(18, 22, 20, 0.82));
}

.hero-content {
  position: relative;
  z-index: 1;
  width: min(720px, 100%);
  animation: riseIn 700ms ease both;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 13px;
}

.eyebrow::before {
  content: "";
  width: 38px;
  height: 1px;
  background: var(--gold);
}

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

h1 {
  margin-bottom: 20px;
  font-size: clamp(42px, 8vw, 96px);
  line-height: 0.96;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 18px;
  font-size: clamp(32px, 5vw, 62px);
  line-height: 1;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 10px;
  font-size: clamp(20px, 2.5vw, 28px);
  line-height: 1.1;
}

.lead {
  max-width: 760px;
  color: var(--muted);
  font-size: clamp(18px, 2vw, 22px);
  line-height: 1.55;
}

.hero .lead {
  color: rgba(255, 255, 255, 0.84);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: #fff;
  background: var(--accent);
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

.btn:hover {
  transform: translateY(-2px);
  background: var(--accent-strong);
}

.btn.secondary {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.42);
  background: rgba(255, 255, 255, 0.1);
}

.btn.secondary:hover {
  background: rgba(255, 255, 255, 0.18);
}

.detail-panel .btn.secondary,
.demo-report .btn.secondary {
  color: var(--ink);
  border-color: var(--line);
  background: #fff;
}

.detail-panel .btn.secondary:hover,
.demo-report .btn.secondary:hover {
  background: rgba(22, 22, 22, 0.06);
}

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(240px, 0.42fr);
  gap: clamp(26px, 6vw, 86px);
  align-items: end;
  margin-bottom: clamp(28px, 5vw, 64px);
}

.kicker {
  margin: 0 0 12px;
  color: var(--accent-strong);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 12px;
}

.flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  border: 1px solid var(--line);
  background: var(--line);
}

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

.flow-step {
  min-height: 142px;
  display: grid;
  align-content: space-between;
  padding: 20px;
  background: rgba(255, 255, 255, 0.76);
}

.flow-step span {
  color: var(--muted);
  font-size: 13px;
}

.flow-step strong {
  display: block;
  font-size: clamp(18px, 2vw, 24px);
  line-height: 1.12;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(280px, 0.58fr);
  gap: clamp(30px, 6vw, 86px);
  align-items: center;
}

.visual-panel {
  position: relative;
  overflow: hidden;
  min-height: 420px;
  border: 1px solid var(--line);
  background: #151916;
  box-shadow: var(--shadow);
}

.visual-panel img {
  width: 100%;
  height: 100%;
  min-height: 420px;
  display: block;
  object-fit: cover;
  opacity: 0.88;
}

.inspect-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.inspect-tag {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  color: #fff;
  background: rgba(17, 19, 18, 0.76);
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 999px;
  backdrop-filter: blur(8px);
  font-size: 12px;
}

.inspect-tag::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
}

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

.item {
  min-height: 238px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px;
  background: rgba(255, 255, 255, 0.74);
  transition: transform 180ms ease, background 180ms ease;
}

.item:hover {
  transform: translateY(-4px);
  background: #fff;
}

.item p {
  color: var(--muted);
  line-height: 1.55;
}

.item .meta,
.case .meta {
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 700;
}

.text-list {
  display: grid;
  gap: 14px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
}

.text-list li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  color: var(--muted);
  line-height: 1.45;
}

.text-list li::before {
  content: "";
  width: 9px;
  height: 9px;
  margin-top: 8px;
  flex: 0 0 auto;
  background: var(--accent);
}

.grade-band {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  border: 1px solid var(--line);
  background: var(--line);
}

.grade {
  min-height: 300px;
  padding: 24px;
  background: #fff;
}

.grade h3 {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.grade h3 span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.grade ul {
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.7;
}

.cases {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.case {
  display: grid;
  gap: 16px;
  padding: 22px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.74);
}

.case-top {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: start;
}

.badge {
  display: inline-flex;
  min-width: 56px;
  height: 34px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: #fff;
  background: var(--accent);
  font-weight: 800;
}

.badge.b {
  background: #b9822d;
}

.badge.c {
  background: var(--danger);
}

.case dl,
.detail dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 14px;
  margin: 0;
  color: var(--muted);
}

.case dt,
.detail dt {
  color: var(--ink);
  font-weight: 700;
}

.detail {
  display: grid;
  grid-template-columns: minmax(0, 0.68fr) minmax(280px, 0.32fr);
  gap: clamp(26px, 5vw, 60px);
}

.detail-panel {
  padding: 24px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
}

.checklist {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 0;
  list-style: none;
}

.checklist li {
  padding: 12px;
  border: 1px solid var(--line);
  background: #fff;
}

.demo-shell {
  display: grid;
  grid-template-columns: minmax(260px, 0.35fr) minmax(0, 0.65fr);
  gap: 24px;
  align-items: start;
}

.demo-controls,
.demo-report {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
}

.demo-controls {
  padding: 22px;
}

.demo-option {
  width: 100%;
  min-height: 58px;
  margin-top: 10px;
  padding: 0 16px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.demo-option.active {
  border-color: var(--accent);
  box-shadow: inset 4px 0 0 var(--accent);
}

.demo-report {
  min-height: 420px;
  padding: 28px;
}

.analysis-state {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--accent-strong);
  font-weight: 700;
}

.pulse {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 1.2s ease infinite;
}

.result-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 16px;
  align-items: center;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

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

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

.timeline-item {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 28px;
  padding: 26px;
  background: rgba(255, 255, 255, 0.78);
}

.timeline-item strong {
  color: var(--accent-strong);
  font-size: 24px;
}

.note {
  margin-top: 26px;
  padding: 18px 20px;
  border-left: 4px solid var(--accent);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.64);
  line-height: 1.55;
}

.site-footer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  padding: 30px clamp(18px, 5vw, 70px);
  border-top: 1px solid var(--line);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.52);
  font-size: 13px;
}

.site-footer strong {
  display: block;
  color: var(--ink);
}

.site-footer p {
  max-width: 620px;
  margin: 0;
  line-height: 1.5;
}

.site-footer a {
  color: var(--accent-strong);
  text-decoration: underline;
  text-underline-offset: 3px;
}

@keyframes pageIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.8);
    opacity: 0.38;
  }
}

@media (max-width: 980px) {
  .site-header {
    grid-template-columns: auto auto 1fr;
  }

  .menu-toggle {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    margin-left: auto;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
  }

  .menu-toggle span {
    width: 18px;
    height: 2px;
    margin: 3px 0;
    background: var(--ink);
  }

  .site-nav {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    display: none;
    flex-direction: column;
    padding: 18px;
    border-bottom: 1px solid var(--line);
    background: rgba(238, 242, 240, 0.98);
  }

  .site-nav.open {
    display: flex;
  }

  .nav-link {
    border-radius: 8px;
    padding: 14px;
    font-size: 18px;
  }

  .language-switch {
    justify-self: end;
  }

  .section-head,
  .split,
  .detail,
  .demo-shell {
    grid-template-columns: 1fr;
  }

  .flow,
  .flow.long,
  .grade-band,
  .cases {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 640px) {
  :root {
    --header-h: 68px;
  }

  .site-header {
    gap: 10px;
    padding: 0 14px;
  }

  .brand small {
    display: none;
  }

  .language-switch button {
    min-width: 42px;
  }

  .hero {
    min-height: calc(92svh - var(--header-h));
  }

  .hero::before {
    background:
      linear-gradient(180deg, rgba(10, 14, 12, 0.9), rgba(10, 14, 12, 0.62)),
      url("assets/ram-module-ddr4.jpg") center / cover no-repeat;
  }

  .flow,
  .flow.long,
  .grid,
  .grade-band,
  .cases,
  .checklist {
    grid-template-columns: 1fr;
  }

  .flow-step,
  .item,
  .grade {
    min-height: auto;
  }

  .visual-panel,
  .visual-panel img {
    min-height: 300px;
  }

  .result-row {
    grid-template-columns: 1fr auto;
  }

  .confidence {
    grid-column: 1 / -1;
  }

  .timeline-item {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .site-footer {
    grid-template-columns: 1fr;
  }
}
