:root {
  color-scheme: dark;
  --bg: #08111f;
  --bg-deep: #050b14;
  --surface: #0f1b2e;
  --surface-raised: #14243a;
  --surface-soft: #10192e;
  --text: #f8fafc;
  --text-soft: #cbd5e1;
  --muted: #8fa3bd;
  --primary: #79a7ff;
  --primary-strong: #a9c7ff;
  --accent: #22c98b;
  --accent-strong: #55e3ac;
  --warning: #f6c453;
  --danger: #fb7185;
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(121, 167, 255, 0.34);
  --shadow-sm: 0 12px 32px rgba(0, 0, 0, 0.18);
  --shadow-lg: 0 32px 80px rgba(0, 0, 0, 0.34);
  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 32px;
  --container: 1180px;
  --nav-height: 72px;
  --font-heading: "Lexend", "Segoe UI", "Microsoft YaHei", sans-serif;
  --font-body: "Source Sans 3", "Segoe UI", "Microsoft YaHei", sans-serif;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-height) + 24px);
}

body {
  margin: 0;
  min-width: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 78% 4%, rgba(44, 111, 224, 0.16), transparent 34rem),
    radial-gradient(circle at 10% 36%, rgba(5, 150, 105, 0.1), transparent 28rem),
    var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  pointer-events: none;
  opacity: 0.28;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, black, transparent 82%);
}

a { color: inherit; text-decoration: none; }
button, a { touch-action: manipulation; }
button, input, textarea { font: inherit; }
img, svg { max-width: 100%; }
button { color: inherit; }

::selection { background: rgba(121, 167, 255, 0.3); color: #fff; }

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 1000;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--text);
  color: var(--bg);
  transform: translateY(-160%);
}

.skip-link:focus { transform: translateY(0); }

:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 4px;
}

.container {
  width: min(calc(100% - 40px), var(--container));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-height);
  border-bottom: 1px solid transparent;
  transition: background 220ms var(--ease), border-color 220ms var(--ease), box-shadow 220ms var(--ease);
}

.site-header.is-scrolled {
  border-color: var(--border);
  background: rgba(8, 17, 31, 0.88);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(16px);
}

.nav-shell { display: flex; height: 100%; align-items: center; justify-content: space-between; gap: 24px; }

.brand { display: inline-flex; min-height: 48px; align-items: center; gap: 12px; font-weight: 700; }
.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(121, 167, 255, 0.45);
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(121, 167, 255, 0.22), rgba(34, 201, 139, 0.12));
  color: var(--primary-strong);
  font-family: var(--font-heading);
  font-size: 15px;
  letter-spacing: -0.04em;
}
.brand-text { font-family: var(--font-heading); letter-spacing: -0.02em; }

.nav-links { display: flex; margin-left: auto; align-items: center; gap: 4px; }
.nav-links a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  padding: 0 14px;
  border-radius: 10px;
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 600;
  transition: color 180ms var(--ease), background 180ms var(--ease);
}
.nav-links a:hover, .nav-links a[aria-current="page"] { background: rgba(255, 255, 255, 0.06); color: var(--text); }

.language-toggle {
  display: inline-flex;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  margin-left: 6px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: rgba(121, 167, 255, 0.08);
  color: var(--primary-strong);
  font-size: 14px;
  font-weight: 700;
}
.language-toggle:hover { border-color: var(--primary); background: rgba(121, 167, 255, 0.15); }

.nav-toggle {
  display: none;
  width: 46px;
  height: 46px;
  cursor: pointer;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
}
.nav-toggle svg { width: 22px; height: 22px; }

.button-row { display: flex; flex-wrap: wrap; gap: 12px; }
.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 20px;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: 13px;
  font-weight: 700;
  line-height: 1;
  transition: transform 180ms var(--ease), background 180ms var(--ease), border-color 180ms var(--ease), box-shadow 180ms var(--ease);
}
.button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
.button:hover { transform: translateY(-2px); }
.button:active { transform: translateY(0); }
.button-primary { background: var(--accent); color: #031810; box-shadow: 0 14px 30px rgba(34, 201, 139, 0.22); }
.button-primary:hover { background: var(--accent-strong); }
.button-secondary { border-color: var(--border-strong); background: rgba(121, 167, 255, 0.08); color: var(--primary-strong); }
.button-secondary:hover { border-color: var(--primary); background: rgba(121, 167, 255, 0.14); }
.text-link { display: inline-flex; min-height: 44px; align-items: center; gap: 8px; color: var(--primary-strong); font-weight: 700; }
.text-link:hover { color: var(--accent-strong); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.eyebrow::before { width: 28px; height: 1px; content: ""; background: currentColor; }

.hero { min-height: calc(100dvh - var(--nav-height)); padding: 88px 0 72px; }
.hero-grid { display: grid; align-items: center; grid-template-columns: minmax(0, 1.02fr) minmax(420px, 0.98fr); gap: 64px; }
.hero h1, .project-hero h1 {
  max-width: 820px;
  margin: 0 0 24px;
  font-family: var(--font-heading);
  font-size: clamp(46px, 7vw, 82px);
  line-height: 1.04;
  letter-spacing: -0.055em;
}
.project-hero h1 { font-size: clamp(42px, 6vw, 72px); }
.gradient-text { color: var(--primary-strong); background: linear-gradient(95deg, #dbe8ff, #79a7ff 42%, #55e3ac); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.hero-lead { max-width: 680px; margin: 0 0 32px; color: var(--text-soft); font-size: clamp(18px, 2vw, 21px); line-height: 1.7; }

.hero-panel {
  position: relative;
  overflow: hidden;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, rgba(20, 36, 58, 0.95), rgba(9, 20, 35, 0.96));
  box-shadow: var(--shadow-lg);
}
.hero-panel::before { position: absolute; inset: 0 0 auto; height: 1px; content: ""; background: linear-gradient(90deg, transparent, var(--primary), transparent); opacity: 0.7; }
.mini-window { overflow: hidden; border: 1px solid var(--border); border-radius: 20px; background: var(--bg-deep); }
.window-bar { display: flex; height: 42px; align-items: center; gap: 7px; padding: 0 16px; border-bottom: 1px solid var(--border); }
.window-bar span { width: 8px; height: 8px; border-radius: 50%; background: #40516a; }
.window-bar span:first-child { background: var(--danger); }
.window-bar span:nth-child(2) { background: var(--warning); }
.window-bar span:nth-child(3) { background: var(--accent); }
.window-content { padding: 24px; }
.status-line { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--border); color: var(--text-soft); }
.status-line:last-child { border: 0; }
.status-line strong { color: var(--text); font-size: 14px; }
.status-pill { display: inline-flex; align-items: center; gap: 7px; color: var(--accent-strong); font-size: 13px; font-weight: 700; }
.status-pill::before { width: 7px; height: 7px; content: ""; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 5px rgba(34, 201, 139, 0.1); }

.trust-strip { display: grid; margin-top: 48px; grid-template-columns: repeat(3, 1fr); gap: 1px; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--border); }
.trust-item { padding: 20px; background: rgba(15, 27, 46, 0.9); }
.trust-item strong { display: block; font-family: var(--font-heading); font-size: 24px; }
.trust-item span { color: var(--muted); font-size: 13px; }
.direction-strip { grid-template-columns: repeat(4, 1fr); }
.direction-strip .trust-item { padding: 18px 16px; }
.direction-strip .trust-item strong { font-size: 16px; }

.portfolio-hero { min-height: auto; padding-bottom: 96px; }
.panel-heading { display: grid; gap: 4px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.panel-heading span, .panel-note { color: var(--muted); font-family: var(--font-heading); font-size: 12px; font-weight: 700; letter-spacing: 0.12em; }
.panel-heading strong { font-family: var(--font-heading); font-size: 22px; }
.engineering-path { display: grid; gap: 0; margin: 10px 0 0; padding: 0; list-style: none; }
.engineering-path li { display: grid; align-items: center; grid-template-columns: 44px 1fr; gap: 12px; padding: 17px 0; border-bottom: 1px solid var(--border); }
.engineering-path li > span { display: grid; width: 36px; height: 36px; place-items: center; border: 1px solid var(--border-strong); border-radius: 11px; color: var(--primary-strong); font-family: var(--font-heading); font-size: 12px; font-weight: 800; }
.engineering-path div { display: grid; gap: 2px; }
.engineering-path strong { font-family: var(--font-heading); }
.engineering-path small { color: var(--muted); font-size: 13px; }
.panel-note { margin: 20px 0 0; color: var(--accent-strong); }

.section { padding: 104px 0; }
.section-compact { padding: 72px 0; }
.section-muted { border-block: 1px solid var(--border); background: rgba(5, 11, 20, 0.42); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 32px; margin-bottom: 44px; }
.section-heading h2 { max-width: 760px; margin: 0; font-family: var(--font-heading); font-size: clamp(32px, 5vw, 52px); line-height: 1.12; letter-spacing: -0.045em; }
.section-heading p { max-width: 480px; margin: 0; color: var(--muted); }

.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.card {
  position: relative;
  overflow: hidden;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: linear-gradient(145deg, rgba(20, 36, 58, 0.76), rgba(15, 27, 46, 0.58));
  box-shadow: var(--shadow-sm);
}
.card::after { position: absolute; inset: auto -30% -55% 20%; height: 180px; content: ""; border-radius: 50%; background: rgba(121, 167, 255, 0.08); filter: blur(32px); }
.card-icon { display: grid; width: 46px; height: 46px; margin-bottom: 24px; place-items: center; border: 1px solid rgba(121, 167, 255, 0.28); border-radius: 13px; background: rgba(121, 167, 255, 0.1); color: var(--primary-strong); }
.card-icon svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.card h3 { position: relative; z-index: 1; margin: 0 0 12px; font-family: var(--font-heading); font-size: 21px; letter-spacing: -0.02em; }
.card p { position: relative; z-index: 1; margin: 0; color: var(--muted); }

.about-layout { display: grid; align-items: start; grid-template-columns: minmax(0, 0.88fr) minmax(0, 1.12fr); gap: 52px; }
.about-profile { padding: 32px; border-left: 2px solid var(--accent); background: linear-gradient(90deg, rgba(34, 201, 139, 0.08), transparent); }
.about-lead { margin: 0 0 24px; color: var(--text-soft); font-size: clamp(19px, 2.2vw, 24px); line-height: 1.65; }
.principle-grid { display: grid; gap: 12px; }
.principle-card { display: grid; grid-template-columns: 42px 1fr; column-gap: 16px; padding: 20px 22px; border: 1px solid var(--border); border-radius: 16px; background: rgba(15, 27, 46, 0.62); }
.principle-card > span { grid-row: 1 / 3; color: var(--primary-strong); font-family: var(--font-heading); font-size: 13px; font-weight: 800; }
.principle-card h3 { margin: 0 0 4px; font-family: var(--font-heading); font-size: 18px; }
.principle-card p { margin: 0; color: var(--muted); font-size: 14px; }

.featured-project { display: grid; overflow: hidden; grid-template-columns: minmax(0, 0.9fr) minmax(420px, 1.1fr); border: 1px solid var(--border-strong); border-radius: var(--radius-lg); background: linear-gradient(145deg, rgba(20, 36, 58, 0.94), rgba(8, 17, 31, 0.94)); box-shadow: var(--shadow-lg); }
.featured-project-copy { padding: 42px; }
.project-kicker, .project-card-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; color: var(--accent-strong); font-size: 12px; font-weight: 800; letter-spacing: 0.08em; }
.project-kicker span:last-child { color: var(--muted); letter-spacing: normal; }
.featured-project h3 { margin: 20px 0 14px; font-family: var(--font-heading); font-size: clamp(34px, 4vw, 50px); letter-spacing: -0.045em; }
.featured-project-copy > p { margin: 0 0 24px; color: var(--text-soft); font-size: 18px; }
.project-highlight { display: grid; gap: 5px; margin: 20px 0; padding: 15px 16px; border-left: 2px solid var(--primary); background: rgba(121, 167, 255, 0.07); }
.project-highlight small { color: var(--muted); font-size: 12px; }
.project-highlight strong { color: var(--text-soft); font-size: 14px; }
.project-tag-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.project-tag { display: inline-flex; min-height: 30px; align-items: center; padding: 0 10px; border: 1px solid var(--border); border-radius: 999px; background: rgba(5, 11, 20, 0.46); color: var(--text-soft); font-size: 12px; font-weight: 700; }
.project-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; margin-top: 28px; }
.featured-project-media { display: flex; min-width: 0; margin: 0; flex-direction: column; border-left: 1px solid var(--border); background: var(--bg-deep); }
.featured-project-media img { width: 100%; height: 100%; min-height: 360px; object-fit: cover; object-position: left top; }
.featured-project-media figcaption { padding: 12px 16px; border-top: 1px solid var(--border); color: var(--muted); font-size: 12px; }
.project-card-grid { display: grid; margin-top: 20px; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.project-card { display: flex; min-height: 390px; padding: 28px; border: 1px solid var(--border); border-radius: var(--radius-md); background: linear-gradient(145deg, rgba(20, 36, 58, 0.76), rgba(15, 27, 46, 0.55)); flex-direction: column; transition: transform 180ms var(--ease), border-color 180ms var(--ease); }
.project-card:hover { transform: translateY(-3px); border-color: var(--border-strong); }
.project-category { color: var(--accent-strong); }
.project-index { color: rgba(169, 199, 255, 0.46); font-family: var(--font-heading); font-size: 22px; }
.project-card h2, .project-card h3 { margin: 22px 0 12px; font-family: var(--font-heading); font-size: 26px; letter-spacing: -0.03em; }
.project-card > p { margin: 0; color: var(--muted); }
.project-card .project-actions { margin-top: auto; padding-top: 22px; }
.project-card .project-tag-list { margin-top: 4px; }
.section-actions { display: flex; justify-content: center; margin-top: 36px; }

.skill-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.skill-group { padding: 30px; border: 1px solid var(--border); border-radius: var(--radius-md); background: rgba(15, 27, 46, 0.66); }
.skill-number { color: var(--primary-strong); font-family: var(--font-heading); font-size: 13px; font-weight: 800; }
.skill-group h3 { margin: 16px 0 10px; font-family: var(--font-heading); font-size: 24px; }
.skill-group p { margin: 0 0 22px; color: var(--muted); }

.focus-layout { display: grid; align-items: start; grid-template-columns: minmax(0, 0.72fr) minmax(0, 1.28fr); gap: 64px; }
.section-heading.stacked { display: block; margin: 0; }
.section-heading.stacked p { margin-top: 20px; }
.focus-list { display: grid; margin: 0; padding: 0; list-style: none; }
.focus-list li { display: grid; grid-template-columns: 56px 1fr; gap: 14px; padding: 24px 0; border-bottom: 1px solid var(--border); }
.focus-list li:first-child { padding-top: 0; }
.focus-list > li > span { color: var(--accent-strong); font-family: var(--font-heading); font-size: 13px; font-weight: 800; }
.focus-list strong { display: block; margin-bottom: 5px; font-family: var(--font-heading); font-size: 20px; }
.focus-list p { margin: 0; color: var(--muted); }

.split-callouts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.callout { padding: 40px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: linear-gradient(145deg, rgba(20, 36, 58, 0.76), rgba(8, 17, 31, 0.72)); }
.callout-accent { border-color: rgba(34, 201, 139, 0.28); background: linear-gradient(145deg, rgba(34, 201, 139, 0.12), rgba(15, 27, 46, 0.72)); }
.callout h2 { margin: 0 0 14px; font-family: var(--font-heading); font-size: clamp(28px, 4vw, 42px); letter-spacing: -0.04em; }
.callout p { margin: 0 0 28px; color: var(--muted); }

.contact-grid-three { grid-template-columns: repeat(3, 1fr); }

.page-hero { padding: 80px 0 52px; }
.page-hero h1 { max-width: 880px; margin: 0 0 20px; font-family: var(--font-heading); font-size: clamp(42px, 7vw, 72px); line-height: 1.05; letter-spacing: -0.05em; }
.page-hero .hero-lead { margin-bottom: 0; }
.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 32px; }
.filter-button { min-height: 44px; padding: 0 16px; cursor: pointer; border: 1px solid var(--border); border-radius: 999px; background: rgba(15, 27, 46, 0.7); color: var(--text-soft); font-weight: 700; transition: background 180ms var(--ease), border-color 180ms var(--ease), color 180ms var(--ease); }
.filter-button:hover, .filter-button[aria-pressed="true"] { border-color: var(--border-strong); background: rgba(121, 167, 255, 0.13); color: var(--text); }
.projects-page-grid .project-card { min-height: 400px; }
.projects-page-grid .project-card[hidden] { display: none; }
.empty-state { padding: 40px; border: 1px dashed var(--border-strong); border-radius: var(--radius-md); background: rgba(15, 27, 46, 0.48); }
.empty-state h2 { margin: 0 0 10px; font-family: var(--font-heading); font-size: 30px; }
.empty-state p { margin: 0; color: var(--muted); }
.resume-shell { max-width: 780px; padding: 48px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: rgba(15, 27, 46, 0.68); }
.resume-shell h1 { margin-top: 0; font-family: var(--font-heading); font-size: clamp(38px, 7vw, 64px); line-height: 1.08; }
.resume-shell p { color: var(--text-soft); font-size: 18px; }
.terminal-card { max-width: 760px; padding: 28px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg-deep); box-shadow: var(--shadow-lg); }
.terminal-line { margin: 0 0 10px; color: var(--muted); font-family: Consolas, "SFMono-Regular", monospace; }
.terminal-line .prompt { color: var(--accent-strong); }
.terminal-card h1 { margin: 20px 0 12px; font-family: var(--font-heading); font-size: clamp(44px, 9vw, 86px); line-height: 1; }
.terminal-card > p:not(.terminal-line) { margin: 0 0 28px; color: var(--text-soft); }
.spaced-top { margin-top: 20px; }
.section-actions-start { justify-content: flex-start; }

.case-hero { padding-bottom: 72px; }
.case-hero-grid { display: grid; align-items: end; grid-template-columns: minmax(0, 1fr) minmax(320px, 0.46fr); gap: 56px; }
.case-hero h1 { max-width: 900px; margin: 18px 0 24px; font-family: var(--font-heading); font-size: clamp(42px, 6.6vw, 76px); line-height: 1.04; letter-spacing: -0.055em; }
.case-hero-aside { padding: 24px; border: 1px solid var(--border); border-radius: var(--radius-md); background: rgba(15, 27, 46, 0.7); }
.case-hero-aside > span { display: block; margin-bottom: 16px; color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: 0.1em; }
.case-hero-aside dl { display: grid; gap: 14px; margin: 0; }
.case-hero-aside div { display: grid; grid-template-columns: 92px 1fr; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.case-hero-aside div:last-child { padding-bottom: 0; border-bottom: 0; }
.case-hero-aside dt { color: var(--muted); font-size: 13px; }
.case-hero-aside dd { margin: 0; color: var(--text-soft); font-weight: 700; }
.case-copy-grid { display: grid; align-items: start; grid-template-columns: minmax(0, 1.12fr) minmax(300px, 0.58fr); gap: 56px; }
.case-copy h2, .case-block h2 { margin: 0 0 18px; font-family: var(--font-heading); font-size: clamp(30px, 4.5vw, 48px); line-height: 1.14; letter-spacing: -0.04em; }
.case-copy h3, .case-block h3 { margin: 32px 0 10px; font-family: var(--font-heading); font-size: 22px; }
.case-copy p, .case-block > p { margin: 0 0 18px; color: var(--text-soft); font-size: 18px; }
.case-aside { display: grid; gap: 12px; }
.case-note { padding: 22px; border: 1px solid var(--border); border-radius: 16px; background: rgba(15, 27, 46, 0.66); }
.case-note span { display: block; margin-bottom: 8px; color: var(--accent-strong); font-size: 12px; font-weight: 800; letter-spacing: 0.08em; }
.case-note strong { font-family: var(--font-heading); font-size: 18px; }
.case-note p { margin: 8px 0 0; color: var(--muted); font-size: 14px; }
.case-list { display: grid; gap: 12px; margin: 22px 0 0; padding: 0; list-style: none; }
.case-list li { position: relative; padding-left: 28px; color: var(--text-soft); }
.case-list li::before { position: absolute; top: 0.72em; left: 2px; width: 9px; height: 9px; content: ""; border: 2px solid var(--accent); border-radius: 50%; }
.decision-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.decision-card { padding: 26px; border: 1px solid var(--border); border-radius: 18px; background: rgba(15, 27, 46, 0.66); }
.decision-card span { color: var(--primary-strong); font-family: var(--font-heading); font-size: 13px; font-weight: 800; }
.decision-card h3 { margin: 14px 0 8px; font-family: var(--font-heading); font-size: 20px; }
.decision-card p { margin: 0; color: var(--muted); }
.case-result-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.case-result { padding: 26px; border: 1px solid var(--border); border-radius: 18px; background: linear-gradient(145deg, rgba(20, 36, 58, 0.72), rgba(15, 27, 46, 0.54)); }
.case-result strong { display: block; margin-bottom: 8px; color: var(--primary-strong); font-family: var(--font-heading); font-size: 24px; }
.case-result span { color: var(--muted); }
.project-boundary { padding: 24px; border-left: 3px solid var(--warning); border-radius: 0 16px 16px 0; background: rgba(246, 196, 83, 0.07); color: var(--text-soft); }
.project-boundary strong { color: var(--warning); }

.media-carousel { position: relative; }
.carousel-viewport { display: grid; gap: 18px; }
.carousel-slide { overflow: hidden; margin: 0; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--bg-deep); box-shadow: var(--shadow-lg); }
.carousel-slide img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: contain; background: #07101d; }
.carousel-slide figcaption { min-height: 58px; padding: 15px 20px; border-top: 1px solid var(--border); color: var(--text-soft); font-size: 14px; }
.carousel-controls { display: none; align-items: center; justify-content: space-between; gap: 16px; margin-top: 18px; }
.carousel-ready .carousel-controls { display: flex; }
.carousel-button, .carousel-dot { cursor: pointer; border: 1px solid var(--border); background: rgba(15, 27, 46, 0.82); color: var(--text); transition: border-color 180ms var(--ease), background 180ms var(--ease), transform 180ms var(--ease); }
.carousel-button { display: grid; width: 48px; height: 48px; flex: 0 0 auto; place-items: center; border-radius: 14px; }
.carousel-button:hover { border-color: var(--border-strong); background: rgba(121, 167, 255, 0.14); transform: translateY(-1px); }
.carousel-button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.carousel-position { display: flex; min-width: 0; align-items: center; justify-content: center; gap: 16px; }
.carousel-dots { display: flex; flex-wrap: wrap; justify-content: center; gap: 9px; }
.carousel-dot { width: 44px; height: 44px; padding: 0; border-color: transparent; border-radius: 50%; background: transparent; }
.carousel-dot::before { display: block; width: 9px; height: 9px; margin: auto; content: ""; border-radius: 50%; background: var(--muted); transition: width 180ms var(--ease), background 180ms var(--ease); }
.carousel-dot[aria-current="true"]::before { width: 24px; border-radius: 999px; background: var(--accent); }
.carousel-status { min-width: 42px; color: var(--muted); font-variant-numeric: tabular-nums; font-size: 13px; text-align: center; }
.carousel-help { margin: 14px 0 0; color: var(--muted); font-size: 13px; }
.image-slot-note { display: inline-flex; margin-top: 14px; padding: 8px 11px; border: 1px dashed var(--border-strong); border-radius: 10px; color: var(--primary-strong); font-size: 12px; }

.project-feature { display: grid; align-items: center; grid-template-columns: 0.82fr 1.18fr; gap: 56px; }
.project-feature.reverse { grid-template-columns: 1.18fr 0.82fr; }
.project-feature.reverse .feature-copy { order: 2; }
.feature-copy h2 { margin: 0 0 20px; font-family: var(--font-heading); font-size: clamp(32px, 4vw, 48px); line-height: 1.15; letter-spacing: -0.04em; }
.feature-copy > p { margin: 0 0 28px; color: var(--text-soft); font-size: 18px; }
.check-list { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
.check-list li { display: grid; grid-template-columns: 24px 1fr; gap: 12px; color: var(--text-soft); }
.check-list svg { width: 22px; height: 22px; color: var(--accent); fill: none; stroke: currentColor; stroke-width: 2; }

.visual-frame { overflow: hidden; border: 1px solid var(--border); border-radius: 26px; background: #0b1423; box-shadow: var(--shadow-lg); }
.visual-frame img { display: block; width: 100%; height: auto; }
.visual-caption { padding: 14px 18px; border-top: 1px solid var(--border); color: var(--muted); font-size: 13px; }

.gallery-grid { display: grid; gap: 24px; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.detail-grid .card p { margin: 0 0 20px; }
.code-block {
  position: relative;
  z-index: 1;
  overflow-x: auto;
  margin: 0;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg-deep);
  color: #dbe8ff;
  font: 13px/1.75 "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  white-space: pre;
}
.output-card { align-self: stretch; }
.output-card > p { margin: 20px 0 0; color: var(--muted); }
.project-disclaimer { max-width: 860px; margin: 28px auto 0; color: var(--muted); font-size: 13px; text-align: center; }

.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.metric { padding: 24px; border: 1px solid var(--border); border-radius: 18px; background: rgba(15, 27, 46, 0.76); }
.metric strong { display: block; margin-bottom: 6px; color: var(--primary-strong); font-family: var(--font-heading); font-size: 27px; font-variant-numeric: tabular-nums; }
.metric span { color: var(--muted); font-size: 14px; }

.architecture-wrap { padding: 18px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: linear-gradient(145deg, rgba(20, 36, 58, 0.7), rgba(5, 11, 20, 0.72)); box-shadow: var(--shadow-lg); }
.architecture-wrap img { display: block; width: 100%; border-radius: 20px; }

.comparison { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-md); background: rgba(15, 27, 46, 0.72); }
.comparison table { width: 100%; min-width: 760px; border-collapse: collapse; }
.comparison th, .comparison td { padding: 18px 20px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.comparison th { color: var(--text); font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; }
.comparison td { color: var(--text-soft); }
.comparison tr:last-child td { border-bottom: 0; }
.comparison td:first-child { color: var(--text); font-weight: 700; }

.free-banner { position: relative; overflow: hidden; padding: 48px; border: 1px solid rgba(34, 201, 139, 0.32); border-radius: var(--radius-lg); background: linear-gradient(125deg, rgba(34, 201, 139, 0.16), rgba(20, 36, 58, 0.92) 55%, rgba(121, 167, 255, 0.12)); box-shadow: var(--shadow-lg); }
.free-banner::after { position: absolute; top: -100px; right: -80px; width: 320px; height: 320px; content: ""; border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 50%; box-shadow: 0 0 0 56px rgba(255, 255, 255, 0.025), 0 0 0 112px rgba(255, 255, 255, 0.018); }
.free-banner-content { position: relative; z-index: 1; display: grid; align-items: center; grid-template-columns: 1fr auto; gap: 32px; }
.free-banner h2 { margin: 0 0 12px; font-family: var(--font-heading); font-size: clamp(30px, 4vw, 46px); letter-spacing: -0.04em; }
.free-banner p { max-width: 720px; margin: 0; color: var(--text-soft); }
.free-label { display: inline-flex; min-height: 40px; align-items: center; gap: 8px; margin-bottom: 18px; padding: 0 14px; border: 1px solid rgba(85, 227, 172, 0.34); border-radius: 999px; background: rgba(34, 201, 139, 0.1); color: var(--accent-strong); font-size: 14px; font-weight: 800; }

.contact-grid { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 20px; }
.contact-card { display: flex; min-height: 96px; align-items: center; gap: 18px; padding: 22px; border: 1px solid var(--border); border-radius: 18px; background: rgba(15, 27, 46, 0.72); transition: border-color 180ms var(--ease), transform 180ms var(--ease); }
.contact-card:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.contact-card .card-icon { flex: 0 0 auto; margin: 0; }
.contact-card small { display: block; color: var(--muted); }
.contact-card strong { display: block; margin-top: 2px; font-size: 18px; word-break: break-all; }

.notice { padding: 18px 20px; border-left: 3px solid var(--warning); border-radius: 0 12px 12px 0; background: rgba(246, 196, 83, 0.08); color: var(--text-soft); }
.notice strong { color: var(--warning); }

.project-hero { padding: 92px 0 64px; }
.project-hero-grid { display: grid; align-items: center; grid-template-columns: minmax(0, 0.95fr) minmax(480px, 1.05fr); gap: 48px; }
.badge-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 28px; }
.badge { display: inline-flex; min-height: 32px; align-items: center; padding: 0 12px; border: 1px solid var(--border); border-radius: 999px; background: rgba(15, 27, 46, 0.7); color: var(--text-soft); font-size: 13px; font-weight: 700; }
.badge.accent { border-color: rgba(34, 201, 139, 0.32); color: var(--accent-strong); }

.persona-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.persona { min-height: 250px; }
.persona .persona-tag { display: inline-flex; margin-bottom: 32px; color: var(--accent-strong); font-size: 13px; font-weight: 800; letter-spacing: 0.08em; }
.persona ul { margin: 18px 0 0; padding-left: 18px; color: var(--muted); }

.flow { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.flow-step { position: relative; min-height: 168px; padding: 22px 18px; border: 1px solid var(--border); border-radius: 16px; background: rgba(15, 27, 46, 0.74); }
.flow-step:not(:last-child)::after { position: absolute; top: 50%; right: -13px; z-index: 2; width: 13px; height: 1px; content: ""; background: var(--primary); }
.flow-step span { display: block; margin-bottom: 18px; color: var(--primary-strong); font-family: var(--font-heading); font-size: 13px; font-weight: 800; }
.flow-step strong { display: block; margin-bottom: 8px; }
.flow-step p { margin: 0; color: var(--muted); font-size: 14px; }

.footer { padding: 40px 0; border-top: 1px solid var(--border); color: var(--muted); }
.footer-grid { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 18px; }
.footer a:hover { color: var(--text); }

.reveal { opacity: 1; transform: none; }
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity 420ms var(--ease), transform 420ms var(--ease); }
.js .reveal.is-visible { opacity: 1; transform: none; }

@media (max-width: 1024px) {
  .hero-grid, .project-hero-grid { grid-template-columns: 1fr; }
  .hero-panel { max-width: 760px; }
  .card-grid, .persona-grid { grid-template-columns: repeat(2, 1fr); }
  .project-feature, .project-feature.reverse { grid-template-columns: 1fr; }
  .project-feature.reverse .feature-copy { order: initial; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .flow { grid-template-columns: repeat(2, 1fr); }
  .flow-step:not(:last-child)::after { display: none; }
  .direction-strip { grid-template-columns: repeat(2, 1fr); }
  .featured-project { grid-template-columns: 1fr; }
  .featured-project-media { border-top: 1px solid var(--border); border-left: 0; }
  .contact-grid-three { grid-template-columns: 1fr 1fr; }
  .case-hero-grid, .case-copy-grid { grid-template-columns: 1fr; }
  .case-hero-aside { max-width: 720px; }
}

@media (max-width: 768px) {
  :root { --nav-height: 64px; }
  .container { width: min(calc(100% - 32px), var(--container)); }
  .js .nav-toggle { display: grid; place-items: center; }
  .nav-links {
    position: absolute;
    top: calc(var(--nav-height) - 1px);
    right: 16px;
    left: 16px;
    display: flex;
    align-items: stretch;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: rgba(8, 17, 31, 0.98);
    box-shadow: var(--shadow-lg);
    flex-direction: column;
    order: 4;
  }
  .brand { order: 1; }
  .language-toggle { order: 2; margin-left: auto; }
  .nav-toggle { order: 3; }
  .js .nav-links { display: none; }
  .js .nav-links.is-open { display: flex; }
  .nav-links a { width: 100%; }
  .hero, .project-hero { min-height: auto; padding: 64px 0 48px; }
  .hero-grid, .project-hero-grid { gap: 40px; }
  .hero h1, .project-hero h1 { font-size: clamp(40px, 13vw, 60px); }
  .hero-lead { font-size: 18px; }
  .trust-strip { grid-template-columns: 1fr; }
  .section, .section-compact { padding: 72px 0; }
  .section-heading { align-items: start; flex-direction: column; }
  .card-grid, .persona-grid, .metric-grid, .flow, .contact-grid, .contact-grid-three, .project-card-grid, .skill-grid, .split-callouts, .focus-layout, .about-layout, .decision-grid, .case-result-grid { grid-template-columns: 1fr; }
  .focus-layout { gap: 40px; }
  .featured-project-copy { padding: 30px 24px; }
  .featured-project-media img { min-height: 0; }
  .callout { padding: 32px 24px; }
  .page-hero { padding-top: 56px; }
  .case-hero { padding: 56px 0 48px; }
  .case-hero-grid { gap: 36px; }
  .carousel-controls { gap: 8px; }
  .carousel-position { gap: 6px; }
  .free-banner { padding: 32px 24px; }
  .free-banner-content { grid-template-columns: 1fr; }
  .footer-grid { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 420px) {
  .container { width: min(calc(100% - 24px), var(--container)); }
  .nav-shell { gap: 8px; }
  .brand-text { display: none; }
  .hero-panel { padding: 14px; border-radius: 22px; }
  .window-content, .card { padding: 22px; }
  .button-row, .button { width: 100%; }
  .direction-strip { grid-template-columns: 1fr; }
  .project-card { min-height: auto; padding: 22px; }
  .resume-shell { padding: 32px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
  .js .reveal { opacity: 1; transform: none; }
}

@media print {
  .site-header, .nav-toggle, .button-row { display: none !important; }
  body { background: #fff; color: #111827; }
  .card, .metric, .comparison, .architecture-wrap, .visual-frame { border-color: #cbd5e1; background: #fff; box-shadow: none; }
}
