/* ==========================================================================
   styles.css — Technical / industrial portfolio theme
   All colors live in CSS variables below. Edit the palette here, or set
   "site.accentColor" in portfolio.json to change the accent without CSS.
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --container: 1200px;
  --gutter: clamp(18px, 4vw, 40px);
  --gap: clamp(16px, 2.4vw, 28px);
  --radius: 2px;
  --header-h: 60px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* Light (default) */
:root,
[data-theme="light"] {
  --bg: #f5f5f2;
  --surface: #ffffff;
  --surface-2: #ecede9;
  --ink: #0c0e11;
  --ink-2: #353b43;
  --muted: #6a7077;
  --line: #d7d9d8;
  --line-strong: #0c0e11;
  --grid-minor: rgba(12, 14, 17, 0.035);
  --grid-major: rgba(12, 14, 17, 0.06);
  --accent: #ff4f00;
  --accent-ink: #ffffff;
  --accent-soft: rgba(255, 79, 0, 0.1);
  --backdrop: rgba(10, 12, 15, 0.55);
  --shadow: 0 1px 0 rgba(0, 0, 0, 0.03), 0 18px 40px -24px rgba(0, 0, 0, 0.25);
  color-scheme: light;
}

/* Dark */
[data-theme="dark"] {
  --bg: #0a0c0f;
  --surface: #111419;
  --surface-2: #181c22;
  --ink: #eceef0;
  --ink-2: #c3c8ce;
  --muted: #8a919a;
  --line: #262b33;
  --line-strong: #eceef0;
  --grid-minor: rgba(255, 255, 255, 0.025);
  --grid-major: rgba(255, 255, 255, 0.045);
  --accent: #ff6a1f;
  --accent-ink: #0a0c0f;
  --accent-soft: rgba(255, 106, 31, 0.14);
  --backdrop: rgba(0, 0, 0, 0.7);
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.02), 0 18px 40px -24px rgba(0, 0, 0, 0.8);
  color-scheme: dark;
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
[hidden] { display: none !important; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background-color: var(--bg);
  /* Subtle engineering-paper grid: 24px minor, 120px major */
  background-image:
    linear-gradient(var(--grid-major) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-major) 1px, transparent 1px),
    linear-gradient(var(--grid-minor) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-minor) 1px, transparent 1px);
  background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px;
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color 0.25s var(--ease), color 0.25s var(--ease);
}
body.modal-open { overflow: hidden; }

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; padding: 0; }
ul, ol { padding: 0; list-style: none; }
h1, h2, h3, h4 { line-height: 1.15; letter-spacing: -0.02em; font-weight: 600; }
::selection { background: var(--accent); color: var(--accent-ink); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.mono { font-family: var(--font-mono); font-feature-settings: "zero" 1; }
.muted { color: var(--muted); }

.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 100;
  padding: 8px 14px; background: var(--ink); color: var(--bg); text-decoration: none;
}
.skip-link:focus { top: 12px; }

.icon { width: 18px; height: 18px; flex: none; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar__inner { height: 100%; display: flex; align-items: center; gap: 24px; }

.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; flex: none; }
.brand__mark {
  display: inline-grid; place-items: center;
  width: 30px; height: 30px;
  background: var(--ink); color: var(--bg);
  font-size: 12px; font-weight: 600; letter-spacing: 0.02em;
}
.brand__name { font-weight: 600; font-size: 15px; letter-spacing: -0.01em; }

.nav {
  margin-left: auto;
  display: flex; gap: 4px;
  overflow-x: auto; scrollbar-width: none;
}
.nav::-webkit-scrollbar { display: none; }
.nav a {
  display: inline-flex; align-items: baseline; gap: 6px;
  padding: 6px 10px;
  font-size: 13.5px; font-weight: 500; text-decoration: none; white-space: nowrap;
  color: var(--ink-2);
  border: 1px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.nav a span { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.nav a:hover { color: var(--ink); }
.nav a[aria-current="true"] { color: var(--ink); border-color: var(--line); background: var(--surface); }
.nav a[aria-current="true"] span { color: var(--accent); }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 36px; height: 36px; flex: none;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  transition: border-color 0.2s, color 0.2s, background-color 0.2s;
}
.icon-btn:hover { border-color: var(--line-strong); }

.theme-toggle .icon--moon { display: none; }
[data-theme="dark"] .theme-toggle .icon--sun { display: none; }
[data-theme="dark"] .theme-toggle .icon--moon { display: block; }

/* ---------- Hero ---------- */
.hero { padding: clamp(56px, 9vw, 112px) 0 clamp(56px, 8vw, 96px); }
.loading { color: var(--muted); font-size: 13px; }

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr);
  gap: clamp(32px, 6vw, 80px);
  align-items: start;
}
.hero__grid--single { grid-template-columns: minmax(0, 1fr); max-width: 860px; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted);
}
.eyebrow::before { content: ""; width: 8px; height: 8px; background: var(--accent); }

.hero__name {
  margin-top: 20px;
  font-size: clamp(2.6rem, 7vw, 5.25rem);
  font-weight: 650;
  letter-spacing: -0.045em;
  line-height: 0.98;
}

/* Dimension line under the name: |<----- label ----->| */
.dim-line {
  display: flex; align-items: center; gap: 12px;
  margin: 22px 0 26px;
  max-width: 520px;
  font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted);
}
.dim-line::before, .dim-line::after {
  content: ""; flex: 1; height: 9px;
  border-inline: 1px solid var(--muted);
  background: linear-gradient(var(--muted), var(--muted)) center / 100% 1px no-repeat;
}

.hero__headline {
  font-size: clamp(1.2rem, 2.2vw, 1.55rem);
  line-height: 1.35; font-weight: 500; letter-spacing: -0.015em;
  max-width: 34ch;
}
.hero__bio { margin-top: 18px; color: var(--ink-2); max-width: 62ch; }
.hero__bio p + p { margin-top: 12px; }

.hero__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 32px; }

.btn {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 10px 16px;
  font-size: 14px; font-weight: 500; text-decoration: none; line-height: 1.2;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink);
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.btn:hover { background: var(--ink); color: var(--bg); }
.btn--primary { background: var(--ink); color: var(--bg); }
.btn--primary:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn .icon { width: 16px; height: 16px; }

/* Spec sheet card (right side of hero) */
.spec-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
/* Corner registration marks */
.spec-card::before, .spec-card::after {
  content: ""; position: absolute; width: 14px; height: 14px; pointer-events: none;
  border-color: var(--accent); border-style: solid;
}
.spec-card::before { top: -6px; left: -6px; border-width: 2px 0 0 2px; }
.spec-card::after { bottom: -6px; right: -6px; border-width: 0 2px 2px 0; }

.spec-card__photo { aspect-ratio: 1 / 1; overflow: hidden; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.spec-card__photo img { width: 100%; height: 100%; object-fit: cover; }
.spec-card__head {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 10px 16px; border-bottom: 1px solid var(--line);
  font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted);
}
.spec-list { padding: 4px 16px 8px; }
.spec-list > div {
  display: grid; grid-template-columns: 110px 1fr; gap: 12px;
  padding: 11px 0; border-bottom: 1px dashed var(--line);
}
.spec-list > div:last-child { border-bottom: 0; }
.spec-list dt { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); padding-top: 2px; }
.spec-list dd { font-size: 14px; font-weight: 500; }
.status-dot { display: inline-block; width: 7px; height: 7px; margin-right: 8px; border-radius: 50%; background: #18a957; box-shadow: 0 0 0 3px rgba(24, 169, 87, 0.18); vertical-align: 1px; }

/* ---------- Sections ---------- */
.section { padding: clamp(64px, 9vw, 120px) 0; border-top: 1px solid var(--line); }
.section__head { margin-bottom: clamp(28px, 4vw, 48px); max-width: 760px; }
.section__eyebrow {
  display: flex; align-items: center; gap: 12px;
  font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
}
.section__num { color: var(--accent); font-weight: 600; }
.section__rule { width: 40px; height: 1px; background: var(--muted); }
.section__title { margin-top: 14px; font-size: clamp(1.9rem, 4vw, 2.9rem); letter-spacing: -0.035em; }
.section__intro { margin-top: 14px; color: var(--ink-2); max-width: 62ch; }

/* ---------- Filters ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.filter {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  transition: all 0.2s var(--ease);
}
.filter:hover { border-color: var(--line-strong); color: var(--ink); }
.filter[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.filter__count { font-size: 10.5px; opacity: 0.6; }

/* ---------- Project cards ---------- */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: var(--gap);
}

.card {
  position: relative;
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  text-decoration: none;
  transition: border-color 0.25s var(--ease), transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
  animation: fade-up 0.45s var(--ease) both;
}
.card:hover { border-color: var(--line-strong); transform: translateY(-3px); box-shadow: var(--shadow); }

.card__media { position: relative; aspect-ratio: 4 / 3; overflow: hidden; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s var(--ease); }
.card:hover .card__media img { transform: scale(1.035); }
.card__count {
  position: absolute; left: 10px; bottom: 10px;
  padding: 3px 7px; font-size: 10.5px; letter-spacing: 0.06em;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink-2);
}
.card__badge {
  position: absolute; top: 10px; right: 10px; z-index: 1;
  padding: 3px 8px; font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase;
  background: var(--accent); color: var(--accent-ink);
}
.card--noimg .card__badge { position: static; align-self: flex-start; margin: 16px 20px 0; }

.card__body { display: flex; flex-direction: column; flex: 1; gap: 10px; padding: 18px 20px 20px; }
.card__meta {
  display: flex; flex-wrap: wrap; gap: 6px 14px;
  font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted);
}
.card__meta .card__index { color: var(--accent); font-weight: 600; }
.card__title { font-size: 1.22rem; letter-spacing: -0.02em; }
.card__summary { font-size: 14.5px; color: var(--ink-2); }
.card__cta {
  margin-top: auto; padding-top: 12px;
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase;
  border-top: 1px solid var(--line);
}
.card__cta .icon { width: 14px; height: 14px; transition: transform 0.25s var(--ease); }
.card:hover .card__cta { color: var(--accent); }
.card:hover .card__cta .icon { transform: translateX(4px); }

/* ---------- Tags ---------- */
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  display: inline-block;
  padding: 3px 8px;
  font-family: var(--font-mono); font-size: 11.5px; line-height: 1.5;
  border: 1px solid var(--line); background: var(--bg); color: var(--ink-2);
}
.tag--more { color: var(--muted); border-style: dashed; }

/* ---------- Modal ---------- */
.modal {
  width: min(1120px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 0;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 40px 120px -30px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}
.modal[open] { animation: modal-in 0.28s var(--ease); }
.modal::backdrop { background: var(--backdrop); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.modal__inner { display: flex; flex-direction: column; max-height: calc(100dvh - 34px); }

.modal__bar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px 14px 10px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.modal__crumb { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; }
.modal__crumb b { color: var(--accent); font-weight: 600; }

.modal__scroll { overflow-y: auto; overscroll-behavior: contain; padding: clamp(20px, 3.5vw, 40px); }
.modal__head { max-width: 820px; margin-bottom: 26px; }
.modal__title { font-size: clamp(1.7rem, 3.6vw, 2.6rem); letter-spacing: -0.035em; }
.modal__summary { margin-top: 12px; font-size: 1.06rem; color: var(--ink-2); }

.modal__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: clamp(28px, 4vw, 56px);
  margin-top: clamp(28px, 4vw, 44px);
}
.modal__grid--single { grid-template-columns: minmax(0, 1fr); }
.modal__main > section + section { margin-top: 40px; }
.modal__side > section + section { margin-top: 28px; }
.modal__side { align-self: start; position: sticky; top: 0; }

.block-title {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 14px;
  font-family: var(--font-mono); font-size: 12px; font-weight: 500;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted);
}
.block-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.prose p { color: var(--ink-2); max-width: 70ch; }
.prose p + p { margin-top: 12px; }

.bullets { margin-top: 14px; display: grid; gap: 8px; }
.bullets li { position: relative; padding-left: 20px; color: var(--ink-2); }
.bullets li::before { content: ""; position: absolute; left: 2px; top: 0.7em; width: 8px; height: 1px; background: var(--accent); }

.steps { display: grid; gap: 0; border-top: 1px solid var(--line); }
.steps li { display: grid; grid-template-columns: 44px 1fr; gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.step__num { font-size: 12px; font-weight: 600; color: var(--accent); padding-top: 3px; }
.steps h4 { font-size: 15.5px; margin-bottom: 4px; }
.steps p { color: var(--ink-2); font-size: 15px; }

.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.metric { padding: 16px; border: 1px solid var(--line); border-top: 2px solid var(--ink); background: var(--bg); }
.metric__value { display: block; font-size: clamp(1.6rem, 3vw, 2.1rem); font-weight: 650; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.metric__label { display: block; margin-top: 6px; font-size: 13px; color: var(--muted); line-height: 1.4; }
.metrics + .bullets { margin-top: 18px; }

.side-list > div { display: grid; grid-template-columns: 96px 1fr; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.side-list > div:first-child { padding-top: 0; }
.side-list dt { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); padding-top: 2px; }
.side-list dd { font-weight: 500; }

.link-list { display: grid; gap: 8px; }
.link-list .btn { justify-content: space-between; width: 100%; }

.modal__pager {
  display: flex; justify-content: space-between; gap: 12px;
  margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--line);
}
.pager-btn { display: inline-flex; flex-direction: column; gap: 2px; max-width: 48%; text-align: left; padding: 6px 0; }
.pager-btn--next { margin-left: auto; text-align: right; align-items: flex-end; }
.pager-btn small { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.pager-btn span { font-weight: 600; transition: color 0.2s; }
.pager-btn:hover span { color: var(--accent); }

/* ---------- Gallery ---------- */
.gallery__stage {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--surface-2);
  border: 1px solid var(--line);
  overflow: hidden;
  touch-action: pan-y;
}
.gallery__img { width: 100%; height: 100%; object-fit: contain; transition: opacity 0.25s var(--ease); }
.gallery__img.is-loading { opacity: 0; }
.gallery__missing {
  position: absolute; inset: 0;
  display: none; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  font-size: 12px; color: var(--muted); text-align: center; padding: 20px;
}
.gallery__missing code { font-size: 11.5px; color: var(--ink-2); word-break: break-all; }
.gallery__stage.is-broken .gallery__img { visibility: hidden; }
.gallery__stage.is-broken .gallery__missing { display: flex; }

.gallery__nav { position: absolute; top: 50%; transform: translateY(-50%); background: color-mix(in srgb, var(--surface) 88%, transparent); }
.gallery__nav--prev { left: 12px; }
.gallery__nav--next { right: 12px; }
.gallery__counter {
  position: absolute; right: 12px; bottom: 12px;
  padding: 3px 8px; font-size: 11px; letter-spacing: 0.06em;
  background: var(--surface); border: 1px solid var(--line);
}
.gallery__caption {
  display: flex; gap: 10px;
  margin-top: 10px; font-size: 13.5px; color: var(--ink-2);
}
.gallery__caption::before { content: "FIG."; font-family: var(--font-mono); font-size: 11px; color: var(--accent); padding-top: 2px; letter-spacing: 0.06em; }

.gallery__thumbs { display: flex; gap: 8px; margin-top: 12px; overflow-x: auto; padding-bottom: 4px; }
.gallery__thumb {
  flex: none; width: 92px; aspect-ratio: 16 / 10;
  border: 1px solid var(--line); background: var(--surface-2);
  opacity: 0.6; overflow: hidden;
  transition: opacity 0.2s, border-color 0.2s;
}
.gallery__thumb img { width: 100%; height: 100%; object-fit: cover; }
.gallery__thumb:hover { opacity: 1; }
.gallery__thumb[aria-current="true"] { opacity: 1; border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }

/* ---------- Timeline ---------- */
.timeline { position: relative; }
.timeline::before {
  content: ""; position: absolute; top: 8px; bottom: 8px;
  left: calc(170px + 24px + 11px); width: 1px; background: var(--line);
}
.tl-item {
  position: relative;
  display: grid; grid-template-columns: 170px 23px minmax(0, 1fr); gap: 0 24px;
  padding-bottom: 40px;
}
.tl-item:last-child { padding-bottom: 0; }
.tl-item__date { font-size: 12.5px; color: var(--muted); padding-top: 3px; text-align: right; letter-spacing: 0.02em; }
.tl-item__marker {
  position: relative; z-index: 1;
  width: 11px; height: 11px; margin: 7px auto 0;
  background: var(--bg); border: 2px solid var(--ink);
  transform: rotate(45deg);
}
.tl-item--education .tl-item__marker { border-color: var(--accent); }
.tl-item--leadership .tl-item__marker { background: var(--ink); }

.tl-card { padding: 20px 22px; background: var(--surface); border: 1px solid var(--line); }
.tl-card__top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 8px; }
.badge {
  display: inline-block; padding: 2px 8px;
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase;
  border: 1px solid var(--line); color: var(--ink-2);
}
.tl-item--education .badge { border-color: var(--accent); color: var(--accent); }
.tl-card h3 { font-size: 1.15rem; }
.tl-card__org { margin-top: 2px; color: var(--ink-2); font-weight: 500; font-size: 15px; }
.tl-card__org a { text-decoration: none; border-bottom: 1px solid var(--line); }
.tl-card__org a:hover { border-color: var(--accent); }
.tl-card__loc { color: var(--muted); font-weight: 400; }
.tl-card__summary { margin-top: 10px; color: var(--ink-2); font-size: 15px; }
.tl-card .bullets { font-size: 15px; }
.tl-card .side-list { margin-top: 14px; }
.tl-card .tags { margin-top: 14px; }

/* ---------- Skills ---------- */
.skills-legend {
  display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 18px;
  font-size: 11px; letter-spacing: 0.04em; color: var(--muted); text-transform: uppercase;
}
.skills-legend span { display: inline-flex; align-items: center; gap: 6px; }
.skills-legend b { color: var(--ink); font-weight: 600; }

.skills-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr)); gap: var(--gap); }
.skill-group { background: var(--surface); border: 1px solid var(--line); }
.skill-group__head { display: flex; align-items: baseline; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.skill-group__code { font-size: 11px; color: var(--accent); font-weight: 600; letter-spacing: 0.06em; }
.skill-group__head h3 { font-size: 1.05rem; }
.skill-group__desc { padding: 12px 20px 0; font-size: 13.5px; color: var(--muted); }
.skill-list { padding: 6px 20px 12px; }
.skill {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 14.5px;
}
.skill:last-child { border-bottom: 0; }
.skill__name small { display: block; font-family: var(--font-mono); font-size: 11px; color: var(--muted); }

.meter { display: inline-flex; gap: 3px; flex: none; }
.meter i { width: 9px; height: 9px; border: 1px solid var(--line-strong); opacity: 0.25; }
.meter i.on { background: var(--ink); opacity: 1; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 36px 0 44px; font-size: 13px; color: var(--muted); }
.footer__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px; }
.footer__links { display: flex; gap: 8px; }
.footer__links .icon-btn { width: 34px; height: 34px; color: var(--ink-2); }
.footer__links .icon-btn:hover { color: var(--accent); border-color: var(--accent); }
.footer__note { margin-top: 4px; font-size: 11.5px; letter-spacing: 0.04em; }

/* ---------- Error / noscript ---------- */
.error-box { max-width: 720px; padding: 28px; border: 1px solid var(--line); border-left: 3px solid var(--accent); background: var(--surface); }
.error-box h2 { margin: 8px 0 10px; font-size: 1.5rem; }
.error-box p { color: var(--ink-2); }
.error-box p + p { margin-top: 10px; }
.error-box code { font-family: var(--font-mono); font-size: 13px; padding: 2px 6px; background: var(--surface-2); }
.noscript { padding: 40px var(--gutter); }

/* ---------- Animations ---------- */
@keyframes fade-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(14px) scale(0.99); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero__grid { grid-template-columns: minmax(0, 1fr); }
  .spec-card { max-width: 520px; }
  .spec-card__photo { aspect-ratio: 16 / 10; }
  .modal__grid { grid-template-columns: minmax(0, 1fr); }
  .modal__side { position: static; }
}

@media (max-width: 720px) {
  .brand__name { display: none; }
  .topbar__inner { gap: 12px; }
  .nav a { padding: 6px 8px; }
  .nav a span { display: none; }

  .timeline::before { left: 5px; }
  .tl-item { grid-template-columns: 11px minmax(0, 1fr); gap: 6px 18px; }
  .tl-item__marker { grid-column: 1; grid-row: 1; margin: 6px 0 0; }
  .tl-item__date { grid-column: 2; grid-row: 1; text-align: left; }
  .tl-card { grid-column: 2; }
}

@media (max-width: 640px) {
  .modal { width: 100vw; max-height: 100dvh; height: 100dvh; border: 0; }
  .modal__inner { max-height: 100dvh; height: 100%; }
  .gallery__stage { aspect-ratio: 4 / 3; }
  .gallery__nav { width: 32px; height: 32px; }
  .spec-list > div { grid-template-columns: 96px 1fr; }
}

@media print {
  .topbar, .theme-toggle, .filters, .modal { display: none !important; }
  body { background: #fff; }
  .card, .tl-card, .skill-group { break-inside: avoid; }
}
