:root {
  --bg: #0a0b0d;
  --panel: #111316;
  --panel-2: #161a1f;
  --line: #22262d;
  --line-2: #2d3138;
  --text: #dcdee2;
  --text-2: #a0a4aa;
  --muted: #686c74;
  --faint: #3a3e46;
  --accent: oklch(0.82 0.17 85);
  --accent-dim: oklch(0.55 0.12 85);
  --accent-faint: oklch(0.35 0.08 85);
  --green: oklch(0.78 0.16 150);
  --red: oklch(0.70 0.18 25);

  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --sans: "Inter", "Noto Sans TC", -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01", "cv11";
}

body {
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 80% -20%, oklch(0.25 0.03 85 / 0.15), transparent 60%),
    radial-gradient(1000px 500px at 0% 100%, oklch(0.20 0.02 240 / 0.12), transparent 60%),
    var(--bg);
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
img { display: block; max-width: 100%; }

.mono { font-family: var(--mono); font-feature-settings: "zero", "ss01"; }
.num { font-variant-numeric: tabular-nums; font-family: var(--mono); }

/* ========== NAV ========== */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(10, 11, 13, 0.78);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: 1440px; margin: 0 auto;
  padding: 0 32px;
  height: 64px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 48px;
}
.logo {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--mono); font-weight: 700; letter-spacing: -0.01em;
  font-size: 15px;
}
.logo-mark {
  width: 28px; height: 28px;
  border: 1px solid var(--accent);
  display: grid; place-items: center;
  position: relative;
}
.logo-mark::before {
  content: ""; position: absolute; inset: 3px;
  background: var(--accent);
  clip-path: polygon(50% 10%, 90% 90%, 10% 90%);
  opacity: 0.95;
}
.logo-sub { color: var(--muted); font-weight: 400; font-size: 11px; letter-spacing: 0.08em; }

.nav-links { display: flex; gap: 4px; justify-self: center; }
.nav-link {
  padding: 8px 14px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--text-2);
  border-radius: 2px;
  position: relative;
  transition: color .15s, background .15s;
}
.nav-link:hover { color: var(--text); background: var(--panel); }
.nav-link.active {
  color: var(--accent);
}
.nav-link.active::before {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 2px;
  height: 1px; background: var(--accent);
}
.nav-link-num { color: var(--faint); margin-right: 6px; }
.nav-link.active .nav-link-num { color: var(--accent-dim); }

.nav-right { display: flex; align-items: center; gap: 16px; }
.nav-status {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 11px; color: var(--muted);
  letter-spacing: 0.05em;
}
.status-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: 0.4; } }

.lang-toggle {
  display: flex; border: 1px solid var(--line); border-radius: 2px;
  font-family: var(--mono); font-size: 11px;
}
.lang-toggle button {
  padding: 5px 9px; color: var(--muted);
}
.lang-toggle button.active { background: var(--accent); color: var(--bg); }

/* ========== SHELL ========== */
.shell {
  max-width: 1440px; margin: 0 auto;
  padding: 0 32px;
}
.page { padding-block: 48px 120px; }
.section { padding-block: 80px; }
.section + .section { border-top: 1px solid var(--line); }

/* section header */
.sec-head {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 48px;
  padding-bottom: 40px;
  margin-bottom: 40px;
  border-bottom: 1px solid var(--line);
}
.sec-label {
  font-family: var(--mono); font-size: 11px; color: var(--muted);
  letter-spacing: 0.12em;
}
.sec-label-num { color: var(--accent); margin-right: 8px; }
.sec-title {
  font-size: 44px; line-height: 1.05; letter-spacing: -0.02em;
  font-weight: 500;
}
.sec-title .zh { display: block; }
.sec-title .en { display: block; font-family: var(--mono); font-size: 15px; color: var(--muted); letter-spacing: 0.1em; margin-top: 10px; font-weight: 400; }

/* ========== HERO (default: spectrum/waveform viz) ========== */
.hero {
  position: relative;
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 32px 32px 0;
  margin-top: 24px;
  overflow: hidden;
}
.hero-topbar {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  font-family: var(--mono); font-size: 11px; color: var(--muted);
  letter-spacing: 0.08em;
  padding-bottom: 18px; margin-bottom: 28px;
  border-bottom: 1px dashed var(--line);
}
.hero-topbar .chip {
  display: inline-flex; gap: 10px; align-items: center;
}
.hero-topbar .chip span { color: var(--text-2); }

.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 64px;
  align-items: end;
  padding-bottom: 40px;
}
.hero-title {
  font-size: 88px; line-height: 0.92; letter-spacing: -0.035em;
  font-weight: 500;
}
.hero-title .stroke {
  -webkit-text-stroke: 1px var(--text);
  color: transparent;
}
.hero-title .accent { color: var(--accent); }
.hero-sub {
  font-family: var(--mono); font-size: 13px; color: var(--text-2);
  line-height: 1.7;
  max-width: 420px;
  margin-top: 24px;
}
.hero-cta-row {
  margin-top: 32px; display: flex; gap: 12px; align-items: center;
}

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 18px;
  border: 1px solid var(--line-2);
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em;
  color: var(--text);
  transition: all .15s;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn-primary { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.btn-primary:hover { background: transparent; color: var(--accent); }
.btn .arr { transition: transform .15s; }
.btn:hover .arr { transform: translateX(3px); }

.hero-right {
  border-left: 1px solid var(--line);
  padding-left: 32px;
  padding-bottom: 40px;
}

/* hero bottom measurement bar */
.hero-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  margin-left: -32px; margin-right: -32px;
}
.hero-metric {
  padding: 20px 24px;
  border-right: 1px solid var(--line);
}
.hero-metric:last-child { border-right: 0; }
.hero-metric .k { font-family: var(--mono); font-size: 10px; color: var(--muted); letter-spacing: 0.12em; }
.hero-metric .v { font-family: var(--mono); font-size: 22px; color: var(--text); margin-top: 6px; letter-spacing: -0.01em; }
.hero-metric .v .unit { font-size: 12px; color: var(--text-2); margin-left: 4px; }

/* frequency analyzer */
.analyzer {
  height: 280px;
  position: relative;
  background:
    linear-gradient(to right, var(--line) 1px, transparent 1px) 0 0 / 10% 100%,
    linear-gradient(to bottom, var(--line) 1px, transparent 1px) 0 0 / 100% 25%;
  background-color: #0c0d10;
  border: 1px solid var(--line);
}
.analyzer-labels {
  position: absolute; inset: 0;
  font-family: var(--mono); font-size: 10px; color: var(--muted);
  pointer-events: none;
}
.analyzer-x { position: absolute; bottom: 4px; left: 0; right: 0; display: flex; justify-content: space-between; padding: 0 6px; }
.analyzer-y { position: absolute; top: 0; bottom: 0; left: 4px; display: flex; flex-direction: column; justify-content: space-between; padding: 4px 0; }
.analyzer-svg { position: absolute; inset: 0; width: 100%; height: 100%; }

/* ========== SERVICES ========== */
.services-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 0;
  border: 1px solid var(--line);
  border-bottom: 0;
}
.service-card {
  grid-column: span 6;
  padding: 32px;
  border-bottom: 1px solid var(--line);
  position: relative;
  background: var(--panel);
  transition: background .2s;
  cursor: pointer;
  min-height: 280px;
  display: flex; flex-direction: column;
}
.service-card:nth-child(odd) { border-right: 1px solid var(--line); }
.service-card:hover { background: var(--panel-2); }
.service-card:hover .service-arr { transform: translate(4px, -4px); color: var(--accent); }

.service-num {
  font-family: var(--mono); font-size: 11px; color: var(--accent);
  letter-spacing: 0.1em;
  display: flex; justify-content: space-between; align-items: center;
}
.service-arr {
  color: var(--muted);
  transition: all .2s;
  font-size: 16px;
}
.service-title {
  font-size: 28px; line-height: 1.1; letter-spacing: -0.02em;
  margin-top: 48px; font-weight: 500;
}
.service-title .en {
  display: block;
  font-family: var(--mono); font-size: 12px; color: var(--muted);
  letter-spacing: 0.08em;
  margin-top: 8px; font-weight: 400;
}
.service-desc {
  margin-top: 16px;
  color: var(--text-2);
  font-size: 13.5px;
  max-width: 440px;
}
.service-specs {
  margin-top: auto; padding-top: 24px;
  display: flex; flex-wrap: wrap; gap: 6px;
}
.spec {
  font-family: var(--mono); font-size: 10px;
  padding: 4px 8px;
  border: 1px solid var(--line-2);
  color: var(--text-2);
  letter-spacing: 0.04em;
}

/* ========== CASES ========== */
.cases-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.case-card {
  background: var(--panel);
  padding: 20px;
  cursor: pointer;
  transition: background .2s;
  display: flex; flex-direction: column; gap: 16px;
}
.case-card:hover { background: var(--panel-2); }
.case-thumb {
  aspect-ratio: 3/2;
  position: relative;
  background: #0c0d10;
  overflow: hidden;
  border: 1px solid var(--line);
}
.case-meta {
  display: flex; justify-content: space-between; align-items: baseline;
  font-family: var(--mono); font-size: 11px; color: var(--muted);
  letter-spacing: 0.06em;
}
.case-title {
  font-size: 18px; line-height: 1.25; font-weight: 500; letter-spacing: -0.01em;
}
.case-sub { font-size: 12px; color: var(--text-2); }
.case-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: auto; padding-top: 12px; }
.tag {
  font-family: var(--mono); font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.04em;
}
.tag::before { content: "#"; color: var(--faint); margin-right: 2px; }

/* placeholder image */
.ph {
  width: 100%; height: 100%;
  background-image:
    repeating-linear-gradient(45deg, #15181d, #15181d 6px, #191c22 6px, #191c22 12px);
  display: grid; place-items: center;
  color: var(--muted);
  font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.1em;
  position: relative;
}
.ph::after {
  content: ""; position: absolute; inset: 10px;
  border: 1px dashed var(--line-2);
}
.ph span { position: relative; z-index: 1; background: #0c0d10; padding: 4px 10px; border: 1px solid var(--line); }

/* filters */
.case-filters {
  display: flex; gap: 2px; margin-bottom: 24px;
  border: 1px solid var(--line);
  width: fit-content;
}
.case-filter {
  padding: 10px 16px;
  font-family: var(--mono); font-size: 11px;
  color: var(--muted); letter-spacing: 0.06em;
  border-right: 1px solid var(--line);
}
.case-filter:last-child { border-right: 0; }
.case-filter.active { background: var(--accent); color: var(--bg); }
.case-filter:hover:not(.active) { color: var(--text); background: var(--panel); }

/* ========== TECH ========== */
.tech-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px solid var(--line); }
.tech-row {
  grid-column: 1 / -1;
  display: grid; grid-template-columns: 120px 1fr 180px 120px 40px;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background .15s;
  gap: 24px;
}
.tech-row:hover { background: var(--panel); }
.tech-row:last-child { border-bottom: 0; }
.tech-row .date { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.tech-row .title { font-size: 16px; line-height: 1.3; }
.tech-row .tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tech-row .read { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.tech-row .arr { color: var(--muted); text-align: right; }
.tech-row:hover .arr { color: var(--accent); }
.tech-featured {
  grid-column: 1 / -1;
  padding: 40px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  display: grid; grid-template-columns: 1fr 1fr; gap: 40px;
  align-items: center;
}
.tech-featured .thumb {
  aspect-ratio: 16/10;
  border: 1px solid var(--line);
}
.tech-featured h3 { font-size: 28px; letter-spacing: -0.02em; margin-top: 12px; line-height: 1.15; }
.tech-featured p { color: var(--text-2); margin-top: 16px; }

/* ========== TEAM ========== */
.team-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.member {
  background: var(--panel);
  padding: 32px;
  display: flex; flex-direction: column; gap: 16px;
  transition: background .2s;
}
.member:hover { background: var(--panel-2); }
.member-photo {
  aspect-ratio: 1/1;
  border: 1px solid var(--line);
}
.member-name {
  font-size: 22px; letter-spacing: -0.01em; font-weight: 500;
  display: flex; justify-content: space-between; align-items: baseline;
}
.member-name .en { font-family: var(--mono); font-size: 11px; color: var(--muted); font-weight: 400; }
.member-role {
  font-family: var(--mono); font-size: 11px;
  color: var(--accent); letter-spacing: 0.08em;
}
.member-bio { color: var(--text-2); font-size: 13px; line-height: 1.6; }
.member-specs {
  margin-top: 8px; padding-top: 16px; border-top: 1px dashed var(--line);
  font-family: var(--mono); font-size: 10px; color: var(--muted);
  display: grid; gap: 4px;
}
.member-specs .row { display: flex; justify-content: space-between; }
.member-specs .row span:last-child { color: var(--text-2); }

/* ========== CONTACT ========== */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px solid var(--line); }
.contact-left { padding: 48px; border-right: 1px solid var(--line); background: var(--panel); }
.contact-right { padding: 48px; }

.contact-item { padding: 20px 0; border-bottom: 1px dashed var(--line); display: grid; grid-template-columns: 100px 1fr; gap: 20px; align-items: baseline; }
.contact-item .k { font-family: var(--mono); font-size: 11px; color: var(--muted); letter-spacing: 0.08em; }
.contact-item .v { font-family: var(--mono); font-size: 15px; color: var(--text); }

.form-row { margin-bottom: 20px; }
.form-row label { display: block; font-family: var(--mono); font-size: 10px; color: var(--muted); letter-spacing: 0.1em; margin-bottom: 6px; }
.form-row input, .form-row textarea, .form-row select {
  width: 100%;
  background: transparent;
  border: 0; border-bottom: 1px solid var(--line-2);
  padding: 10px 0;
  color: var(--text);
  font-family: var(--mono); font-size: 13px;
  outline: none;
  transition: border-color .15s;
}
.form-row input:focus, .form-row textarea:focus, .form-row select:focus { border-color: var(--accent); }
.form-row textarea { resize: vertical; min-height: 100px; }

/* ========== FOOTER ========== */
.footer {
  border-top: 1px solid var(--line);
  margin-top: 80px;
  background: var(--bg);
}
.footer-inner {
  max-width: 1440px; margin: 0 auto;
  padding: 64px 32px 40px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 40px;
}
.footer-col h4 { font-family: var(--mono); font-size: 11px; color: var(--muted); letter-spacing: 0.12em; margin-bottom: 16px; }
.footer-col ul { list-style: none; display: grid; gap: 8px; }
.footer-col a { font-size: 13px; color: var(--text-2); transition: color .15s; }
.footer-col a:hover { color: var(--accent); }
.footer-bottom {
  max-width: 1440px; margin: 0 auto;
  padding: 20px 32px; border-top: 1px solid var(--line);
  display: flex; justify-content: space-between;
  font-family: var(--mono); font-size: 11px; color: var(--muted);
  letter-spacing: 0.05em;
}

/* ========== LIGHTBOX ========== */
.lightbox {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0, 0, 0, 0.94);
  display: grid; place-items: center;
  padding: 40px;
}
.lb-panel {
  width: min(1200px, 100%);
  max-height: 88vh;
  background: var(--panel);
  border: 1px solid var(--line);
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
}
.lb-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono); font-size: 11px; color: var(--muted); letter-spacing: 0.08em;
}
.lb-close { color: var(--text); font-size: 16px; }
.lb-close:hover { color: var(--accent); }
.lb-main {
  display: grid; grid-template-columns: 1fr 340px;
  overflow: hidden;
}
.lb-image {
  position: relative;
  background: #050608;
  display: grid; place-items: center;
  min-height: 500px;
}
.lb-image .ph { width: 90%; height: 90%; }
.lb-meta {
  padding: 32px;
  border-left: 1px solid var(--line);
  overflow-y: auto;
}
.lb-meta h3 { font-size: 22px; letter-spacing: -0.01em; line-height: 1.2; }
.lb-meta .sub { font-family: var(--mono); color: var(--muted); font-size: 12px; margin-top: 8px; letter-spacing: 0.06em; }
.lb-meta .detail { margin-top: 24px; color: var(--text-2); font-size: 13.5px; }
.lb-meta dl { margin-top: 24px; border-top: 1px solid var(--line); padding-top: 20px; }
.lb-meta dt { font-family: var(--mono); font-size: 10px; color: var(--muted); letter-spacing: 0.1em; margin-top: 14px; }
.lb-meta dd { font-family: var(--mono); font-size: 13px; color: var(--text); margin-top: 4px; }
.lb-thumbs {
  display: flex; gap: 6px; overflow-x: auto;
  padding: 12px 20px;
  border-top: 1px solid var(--line);
}
.lb-thumb {
  width: 80px; height: 54px; flex-shrink: 0;
  border: 1px solid var(--line);
  cursor: pointer;
  background: #0c0d10;
  transition: border-color .15s;
}
.lb-thumb.active { border-color: var(--accent); }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; display: grid; place-items: center; background: rgba(0,0,0,0.6); color: var(--text); font-family: var(--mono); }
.lb-nav:hover { color: var(--accent); }
.lb-nav.prev { left: 16px; }
.lb-nav.next { right: 16px; }

/* ========== TWEAKS PANEL ========== */
.tweaks {
  position: fixed; bottom: 20px; right: 20px; z-index: 200;
  background: var(--panel);
  border: 1px solid var(--line-2);
  width: 320px;
  font-family: var(--mono);
  font-size: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}
.tweaks-head {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center;
  letter-spacing: 0.08em; font-size: 11px; color: var(--muted);
}
.tweaks-body { padding: 16px 14px; display: grid; gap: 16px; }
.tweaks-row > label { display: block; font-size: 10px; color: var(--muted); letter-spacing: 0.1em; margin-bottom: 8px; }
.tweaks-options { display: grid; gap: 4px; }
.tweaks-opt {
  padding: 8px 10px;
  border: 1px solid var(--line);
  color: var(--text-2); font-size: 11px;
  text-align: left;
  cursor: pointer;
  transition: all .15s;
}
.tweaks-opt:hover { border-color: var(--line-2); color: var(--text); }
.tweaks-opt.active { background: var(--accent); color: var(--bg); border-color: var(--accent); }

/* utility */
.divider-label {
  display: flex; align-items: center; gap: 16px;
  font-family: var(--mono); font-size: 11px; color: var(--muted); letter-spacing: 0.12em;
  margin: 48px 0 24px;
}
.divider-label::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* process steps */
.process {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border: 1px solid var(--line);
}
.process-step {
  padding: 32px;
  border-right: 1px solid var(--line);
  min-height: 240px;
  display: flex; flex-direction: column;
  position: relative;
}
.process-step:last-child { border-right: 0; }
.process-step .n {
  font-family: var(--mono); font-size: 11px; color: var(--accent); letter-spacing: 0.12em;
  margin-bottom: 24px;
}
.process-step h4 { font-size: 20px; margin-bottom: 12px; letter-spacing: -0.01em; font-weight: 500; }
.process-step h4 .en { display: block; font-family: var(--mono); font-size: 10px; color: var(--muted); letter-spacing: 0.08em; font-weight: 400; margin-top: 4px;}
.process-step p { color: var(--text-2); font-size: 12.5px; line-height: 1.65; }
.process-step .glyph {
  margin-top: auto; padding-top: 20px;
  color: var(--faint); font-family: var(--mono); font-size: 10px;
  display: flex; justify-content: space-between;
}

/* marquee tech specs strip */
.specs-strip {
  border-block: 1px solid var(--line);
  padding: 14px 0;
  overflow: hidden; white-space: nowrap;
  font-family: var(--mono); font-size: 11px; color: var(--muted);
  letter-spacing: 0.12em;
}
.specs-strip .track { display: inline-flex; gap: 40px; animation: scroll 40s linear infinite; }
.specs-strip .track > span::before { content: "●"; color: var(--accent); margin-right: 16px; }
@keyframes scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ========== MOBILE NAV (hamburger + drawer) ========== */
.nav-burger {
  display: none;
  width: 44px; height: 44px;
  align-items: center; justify-content: center;
  border: 1px solid var(--line);
  color: var(--text);
}
.nav-burger span {
  display: block; width: 18px; height: 1px; background: currentColor;
  position: relative;
}
.nav-burger span::before, .nav-burger span::after {
  content: ""; position: absolute; left: 0; width: 18px; height: 1px; background: currentColor;
}
.nav-burger span::before { top: -6px; }
.nav-burger span::after { top: 6px; }

.nav-drawer {
  display: none;
  position: fixed; inset: 64px 0 0 0; z-index: 49;
  background: rgba(10, 11, 13, 0.98);
  backdrop-filter: blur(20px);
  padding: 24px 20px;
  overflow-y: auto;
  border-top: 1px solid var(--line);
}
.nav-drawer.open { display: block; }
.nav-drawer .drawer-link {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 4px;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 16px;
  color: var(--text);
}
.nav-drawer .drawer-link .num { color: var(--faint); font-size: 11px; letter-spacing: 0.1em; }
.nav-drawer .drawer-link .arr { color: var(--muted); font-size: 14px; }
.nav-drawer .drawer-link.active { color: var(--accent); }
.nav-drawer .drawer-link.active .num { color: var(--accent-dim); }
.nav-drawer .drawer-foot {
  margin-top: 32px; padding-top: 20px; border-top: 1px dashed var(--line);
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--mono); font-size: 11px; color: var(--muted);
  letter-spacing: 0.08em;
}

/* ========== TABLET / SMALL DESKTOP (≤ 960px) ========== */
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; gap: 32px; }
  .hero-right { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 32px;}
  .hero-title { font-size: 56px; }
  .hero-metrics { grid-template-columns: repeat(2, 1fr); }
  .hero-metric:nth-child(2) { border-right: 0; }
  .services-grid .service-card { grid-column: span 12; border-right: 0 !important; }
  .cases-grid { grid-template-columns: 1fr 1fr; }
  .team-grid { grid-template-columns: 1fr 1fr; }
  .process { grid-template-columns: 1fr 1fr; }
  .process-step:nth-child(2) { border-right: 0; }
  .process-step { border-bottom: 1px solid var(--line); }
  .sec-head { grid-template-columns: 1fr; gap: 16px; }
  .sec-title { font-size: 32px; }
  .contact-grid { grid-template-columns: 1fr; }
  .contact-left { border-right: 0; border-bottom: 1px solid var(--line); }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .nav-links { display: none; }
  .nav-burger { display: flex; }
  .nav-status span:nth-child(2) { display: none; }
  .tech-row { grid-template-columns: 80px 1fr 40px; }
  .tech-row .tags, .tech-row .read { display: none; }
  .lb-main { grid-template-columns: 1fr; }
  .lb-meta { border-left: 0; border-top: 1px solid var(--line); }
  .tech-featured { grid-template-columns: 1fr; gap: 24px; padding: 24px; }
}

/* ========== MOBILE (≤ 640px) ========== */
@media (max-width: 640px) {
  body { font-size: 13.5px; }
  .shell { padding: 0 16px; }
  .page { padding-block: 24px 64px; }
  .section { padding-block: 48px; }

  /* Nav */
  .nav-inner {
    padding: 0 16px;
    gap: 12px;
    grid-template-columns: auto 1fr auto;
  }
  .logo { font-size: 13px; gap: 8px; }
  .logo-sub { font-size: 9px; }
  .logo-mark { width: 24px; height: 24px; }
  .nav-status { display: none; }
  .lang-toggle { font-size: 10px; }
  .lang-toggle button { padding: 6px 8px; min-width: 32px; min-height: 32px; }

  /* Hero — spectrum */
  .hero { padding: 20px 16px 0; margin-top: 12px; }
  .hero-topbar {
    grid-template-columns: 1fr;
    gap: 6px;
    font-size: 10px;
    padding-bottom: 14px; margin-bottom: 20px;
  }
  .hero-topbar > div { text-align: left !important; }
  .hero-title { font-size: 40px; line-height: 1; }
  .hero-sub { font-size: 12px; margin-top: 16px; }
  .hero-cta-row { margin-top: 20px; flex-direction: column; align-items: stretch; }
  .hero-cta-row .btn { justify-content: center; padding: 14px 18px; }
  .hero-right { padding-top: 24px; }
  .hero-right > div { flex-direction: column-reverse !important; gap: 24px !important; }
  .hero-right > div > div:last-child { flex-direction: row !important; padding-top: 0 !important; justify-content: center; gap: 16px !important; }
  .analyzer { height: 180px !important; }
  .hero-metrics { grid-template-columns: repeat(2, 1fr); margin-left: -16px; margin-right: -16px; }
  .hero-metric { padding: 14px 16px; }
  .hero-metric .k { font-size: 9px; }
  .hero-metric .v { font-size: 18px; }
  .hero-metric:nth-child(odd) { border-right: 1px solid var(--line); }
  .hero-metric:nth-child(even) { border-right: 0; }
  .hero-metric:nth-child(1), .hero-metric:nth-child(2) { border-bottom: 1px solid var(--line); }

  /* Section header */
  .sec-head { padding-bottom: 24px; margin-bottom: 24px; gap: 10px; }
  .sec-title { font-size: 26px; letter-spacing: -0.015em; }
  .sec-title .en { font-size: 12px; margin-top: 8px; }
  .sec-label { font-size: 10px; }

  /* About section grid */
  .section [style*="grid-template-columns: 1.1fr 1fr"],
  .section [style*="grid-template-columns: 1.2fr 1fr"] {
    grid-template-columns: 1fr !important;
    gap: 32px !important;
  }

  /* Services */
  .service-card { padding: 20px; min-height: auto; }
  .service-title { font-size: 22px; margin-top: 32px; }
  .service-desc { font-size: 13px; margin-top: 12px; }
  .service-specs { padding-top: 18px; }
  .spec { font-size: 9px; padding: 4px 7px; }

  /* Toolchain 6-col → 2-col */
  [style*="grid-template-columns: repeat(6, 1fr)"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  [style*="grid-template-columns: repeat(6, 1fr)"] > div:nth-child(2n) {
    border-right: 0 !important;
  }
  [style*="grid-template-columns: repeat(6, 1fr)"] > div:not(:nth-last-child(-n+2)) {
    border-bottom: 1px solid var(--line);
  }

  /* Cases */
  .cases-grid { grid-template-columns: 1fr; }
  .case-card { padding: 16px; }
  .case-title { font-size: 16px; }
  .case-filters {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .case-filters::-webkit-scrollbar { display: none; }
  .case-filter { padding: 10px 14px; white-space: nowrap; min-height: 40px; }
  .case-filter span { display: none; }
  /* filter row container */
  .page > div[style*="justify-content: space-between"] {
    flex-direction: column;
    align-items: stretch !important;
    gap: 12px;
  }

  /* Team */
  .team-grid { grid-template-columns: 1fr; }
  .member { padding: 20px; }
  .member-photo { aspect-ratio: 4/3; }

  /* Tech */
  .tech-row {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 18px 16px;
  }
  .tech-row .date { font-size: 10px; }
  .tech-row .title { font-size: 14px; line-height: 1.35; }
  .tech-row .arr { display: none; }
  .tech-featured { padding: 20px; gap: 16px; }
  .tech-featured h3 { font-size: 22px; }
  .tech-featured p { font-size: 13px; }

  /* Process */
  .process { grid-template-columns: 1fr; }
  .process-step { padding: 20px; min-height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .process-step:last-child { border-bottom: 0; }
  .process-step .n { margin-bottom: 12px; }
  .process-step h4 { font-size: 17px; }
  .process-step p { font-size: 12.5px; }

  /* Contact */
  .contact-left, .contact-right { padding: 24px 20px; }
  .contact-item { grid-template-columns: 80px 1fr; gap: 12px; padding: 14px 0; }
  .contact-item .v { font-size: 13px; word-break: break-all; }
  .contact-right [style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }
  .form-row input, .form-row textarea, .form-row select {
    font-size: 16px; /* prevent iOS zoom */
    padding: 12px 0;
  }
  .form-row label { font-size: 10px; }

  /* Footer */
  .footer { margin-top: 48px; }
  .footer-inner { grid-template-columns: 1fr; padding: 40px 16px 24px; gap: 32px; }
  .footer-bottom {
    padding: 16px; flex-direction: column; gap: 8px;
    font-size: 10px; text-align: center;
  }

  /* Manifesto hero */
  .hero [style*="grid-template-columns: 1fr 1fr"][style*="min-height: 560px"] {
    grid-template-columns: 1fr !important;
    min-height: auto !important;
  }
  .hero [style*="border-right: 1px solid var(--line)"][style*="padding: 56px 48px"] {
    padding: 28px 20px !important;
    border-right: 0 !important;
    border-bottom: 1px solid var(--line);
  }
  .hero [style*="background: #0a0b0d"][style*="padding: 32px"] {
    padding: 24px 16px !important;
  }

  /* Lightbox */
  .lightbox { padding: 0; }
  .lb-panel { max-height: 100vh; height: 100vh; width: 100%; border: 0; }
  .lb-image { min-height: 280px; }
  .lb-meta { padding: 20px; }
  .lb-meta h3 { font-size: 18px; }
  .lb-thumbs { padding: 10px 12px; }
  .lb-thumb { width: 60px; height: 40px; }
  .lb-nav { width: 36px; height: 36px; }

  /* Tweaks panel */
  .tweaks { left: 12px; right: 12px; bottom: 12px; width: auto; }

  /* Buttons bigger for touch */
  .btn { padding: 13px 16px; min-height: 44px; }

  /* Specs strip */
  .specs-strip { padding: 10px 0; font-size: 10px; }
  .specs-strip .track { gap: 24px; }

  /* Divider label */
  .divider-label { margin: 32px 0 16px; font-size: 10px; }
}

/* ========== EXTRA SMALL (≤ 380px) ========== */
@media (max-width: 380px) {
  .hero-title { font-size: 34px; }
  .sec-title { font-size: 22px; }
  .logo > div > div:first-child { font-size: 12px; }
  .logo-sub { display: none; }
}
