/* ==========================================================================
   ARRON PORTFOLIO — Swiss Engineering Editorial × Hairline Blueprint System
   Zero-dependency, dual-theme (Blueprint Paper / Carbon CAD), CJK-polished
   ========================================================================== */

:root {
  /* Light Theme: Industrial Blueprint Paper (Teenage Engineering / Braun inspired) */
  --bg: #f2f1ec;
  --bg-grid-dot: rgba(20, 20, 19, 0.085);
  --surface: #faf9f6;
  --surface-alt: #f4f3ee;
  --surface-hover: #ffffff;
  --surface-inset: #ecebe4;
  --ink: #141413;
  --ink-2: #484743;
  --ink-3: #6b6963;
  --line: #d5d3ca;
  --line-strong: #141413;
  --accent: #e84a1a;
  --accent-hover: #c93b10;
  --accent-soft: rgba(232, 74, 26, 0.09);
  --accent-border: rgba(232, 74, 26, 0.35);
  --ok: #15803d;
  --ok-soft: rgba(21, 128, 61, 0.1);
  --overlay: rgba(20, 20, 19, 0.42);
  --nav-bg: rgba(242, 241, 236, 0.88);
  --shadow-drawer: -16px 0 48px rgba(20, 20, 19, 0.14);

  /* Typography */
  --font-sans: 'Space Grotesk', 'Noto Sans SC', 'HarmonyOS Sans SC', 'MiSans', 'PingFang SC',
    'Hiragino Sans GB', 'Microsoft YaHei UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Cascadia Code', 'Fira Code', ui-monospace, SFMono-Regular,
    Menlo, Consolas, monospace;

  /* Geometry */
  --radius-outer: 4px;
  --radius-sm: 2px;
  --max-w: 1180px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

[data-theme='dark'] {
  /* Dark Theme: Carbon Precision Instrument */
  --bg: #0b0c0e;
  --bg-grid-dot: rgba(241, 242, 244, 0.075);
  --surface: #121418;
  --surface-alt: #16191f;
  --surface-hover: #191d24;
  --surface-inset: #0e1013;
  --ink: #f1f2f4;
  --ink-2: #a8aeb9;
  --ink-3: #7e8696;
  --line: #252932;
  --line-strong: #e4e6eb;
  --accent: #ff5722;
  --accent-hover: #ff6e40;
  --accent-soft: rgba(255, 87, 34, 0.13);
  --accent-border: rgba(255, 87, 34, 0.42);
  --ok: #22c55e;
  --ok-soft: rgba(34, 197, 94, 0.14);
  --overlay: rgba(0, 0, 0, 0.68);
  --nav-bg: rgba(11, 12, 14, 0.88);
  --shadow-drawer: -20px 0 60px rgba(0, 0, 0, 0.55);
}

/* Reset & Base */
*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background-color: var(--bg);
  background-image: radial-gradient(var(--bg-grid-dot) 1px, transparent 1px);
  background-size: 24px 24px;
  color: var(--ink);
  line-height: 1.65;
  font-size: 15px;
  transition: background-color 0.25s var(--ease), color 0.25s var(--ease);
  overflow-x: hidden;
}

body.drawer-open {
  overflow: hidden;
}

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

button {
  font-family: inherit;
  cursor: pointer;
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
}

::selection {
  background: var(--accent);
  color: #ffffff;
}

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

/* Layout Shell */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

/* ==========================================================================
   Top Instrument Bar (Sticky Navigation)
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand-mark {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  flex-shrink: 0;
}

.brand-doc {
  font-size: 11px;
  font-weight: 400;
  color: var(--ink-3);
  padding-left: 10px;
  border-left: 1px solid var(--line);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--ink-2);
  padding: 6px 11px;
  border-radius: var(--radius-sm);
  transition: color 0.18s ease, background-color 0.18s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.nav-link .nav-num {
  color: var(--ink-3);
  font-size: 10px;
}

.nav-link:hover,
.nav-link.active {
  color: var(--ink);
  background: var(--surface-inset);
}

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

.nav-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ctrl-btn {
  height: 32px;
  min-width: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  transition: border-color 0.18s ease, background-color 0.18s ease, color 0.18s ease;
}

.ctrl-btn:hover {
  border-color: var(--line-strong);
  background: var(--surface-hover);
}

.ctrl-btn svg {
  width: 14px;
  height: 14px;
}

/* ==========================================================================
   Hairline Bento Grid Primitives
   ========================================================================== */
.main-content {
  padding: 24px 0 88px;
}

.section-block {
  margin-top: 64px;
  scroll-margin-top: 76px;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.section-kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title {
  margin: 0;
  font-size: clamp(22px, 2.7vw, 29px);
  font-weight: 650;
  letter-spacing: -0.025em;
  line-height: 1.22;
}

html[lang^='zh'] .section-title,
html[lang^='zh'] .bio-lead,
html[lang^='zh'] .contact-title,
html[lang^='zh'] .drawer-title {
  font-weight: 600;
}

.section-desc {
  margin: 0;
  max-width: 460px;
  font-size: 13.5px;
  color: var(--ink-2);
  text-align: right;
  line-height: 1.58;
}

.bento-frame {
  display: grid;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius-outer);
  overflow: hidden;
}

.bento-cell {
  background: var(--surface);
  position: relative;
  transition: background-color 0.22s var(--ease);
}

/* Blueprint corner ticks on interactive cards */
.corner-ticks::before,
.corner-ticks::after {
  content: '';
  position: absolute;
  width: 8px;
  height: 8px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.corner-ticks::before {
  top: 8px;
  left: 8px;
  border-top: 1.5px solid var(--accent);
  border-left: 1.5px solid var(--accent);
}

.corner-ticks::after {
  bottom: 8px;
  right: 8px;
  border-bottom: 1.5px solid var(--accent);
  border-right: 1.5px solid var(--accent);
}

.corner-ticks:hover::before,
.corner-ticks:hover::after {
  opacity: 1;
}

/* ==========================================================================
   HERO BENTO (6 + 6 Split + 12-col Spec Strip — Swiss Editorial Rhythm)
   ========================================================================== */
.hero-grid {
  grid-template-columns: repeat(12, minmax(0, 1fr));
}

.hero-main {
  grid-column: span 6;
  padding: 32px 34px 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 0;
  min-width: 0;
}

.hero-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.status-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--ink-2);
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 0 rgba(21, 128, 61, 0.5);
  animation: pulse 2.2s infinite;
  flex-shrink: 0;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.55);
  }
  70% {
    box-shadow: 0 0 0 7px rgba(34, 197, 94, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
  }
}

.eyebrow-code {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-3);
  letter-spacing: 0.09em;
}

.hero-title {
  margin: 2px 0 0;
  font-size: clamp(27px, 3.1vw, 38px);
  font-weight: 650;
  line-height: 1.22;
  letter-spacing: -0.025em;
  color: var(--ink);
  text-wrap: balance;
}

html[lang^='zh'] .hero-title {
  font-size: clamp(24px, 2.55vw, 32px);
  font-weight: 600;
  line-height: 1.28;
  letter-spacing: -0.02em;
}

.hero-title .line-accent {
  display: block;
  margin-top: 4px;
  color: var(--ink);
}

.hero-title .accent-dot {
  color: var(--accent);
}

.hero-subtitle {
  margin: 0;
  max-width: 560px;
  font-size: 14.8px;
  line-height: 1.72;
  color: var(--ink-2);
}

/* Editorial 3-Item Hairline Proof Strip */
.hero-proof-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  padding: 13px 0;
  margin-top: 2px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.hero-proof-strip:empty {
  display: none;
}

.hero-proof-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  padding-left: 14px;
  border-left: 1px solid var(--line);
}

.hero-proof-item:first-child {
  padding-left: 0;
  border-left: none;
}

.proof-val {
  font-family: var(--font-mono);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.015em;
  line-height: 1.25;
}

.proof-lbl {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-3);
  letter-spacing: 0.04em;
  line-height: 1.35;
}

.hero-actions {
  margin-top: auto;
  padding-top: 4px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  height: 39px;
  padding: 0 17px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  transition: transform 0.15s ease, background-color 0.18s ease, border-color 0.18s ease,
    color 0.18s ease;
  white-space: nowrap;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

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

.btn-outline {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
}

.btn-outline:hover {
  border-color: var(--line-strong);
  background: var(--surface-hover);
}

.btn-ghost {
  background: var(--surface-alt);
  color: var(--ink-2);
  border-color: var(--line);
  font-family: var(--font-mono);
  font-size: 12px;
}

.btn-ghost:hover {
  color: var(--ink);
  border-color: var(--line-strong);
}

.btn svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

/* Right Hero Cell: Interactive CAD Viewport + FeatureManager Dock */
.hero-side {
  grid-column: span 6;
  display: flex;
  flex-direction: column;
  background: var(--surface-alt);
  min-width: 0;
}

.cad-card {
  padding: 14px 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--surface-alt);
  min-width: 0;
}

.cad-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.07em;
  color: var(--ink-3);
}

.cad-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.cad-micro-btn {
  height: 19px;
  padding: 0 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--ink-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.cad-micro-btn:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}

.cad-micro-btn.active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--surface);
}

#cad-reset-btn {
  border-color: var(--accent-border);
  background: var(--accent-soft);
  color: var(--accent);
}

#cad-reset-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.cad-badge-live {
  color: var(--accent);
  font-weight: 600;
  margin-left: 2px;
}

.cad-canvas-wrap {
  position: relative;
  flex: 1;
  min-height: 210px;
  margin: 8px 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-inset);
  overflow: hidden;
  cursor: grab;
  touch-action: none;
}

.cad-canvas-wrap:active {
  cursor: grabbing;
}

.cad-canvas-wrap canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.cad-bbox {
  position: absolute;
  right: 8px;
  top: 6px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--ink-3);
  pointer-events: none;
  background: var(--surface-inset);
  padding: 1px 4px;
  border-radius: 2px;
}

.cad-coords {
  position: absolute;
  left: 8px;
  bottom: 6px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--ink-3);
  pointer-events: none;
  background: var(--surface-inset);
  padding: 1px 4px;
  border-radius: 2px;
}

.cad-mass {
  position: absolute;
  right: 8px;
  bottom: 6px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--ink-2);
  pointer-events: none;
  background: var(--surface-inset);
  padding: 1px 4px;
  border-radius: 2px;
}

.cad-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.cad-modes {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface);
  flex-shrink: 0;
}

.cad-mode-btn {
  border: none;
  background: transparent;
  padding: 3px 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  color: var(--ink-2);
  border-right: 1px solid var(--line);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.cad-mode-btn:last-child {
  border-right: none;
}

.cad-mode-btn:hover {
  color: var(--ink);
  background: var(--surface-inset);
}

.cad-mode-btn.active {
  background: var(--ink);
  color: var(--surface);
}

.cad-hint {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-3);
  white-space: nowrap;
}

/* Interactive SolidWorks FeatureManager Tree Strip (5 compact 22px rows = ~112px) */
.cad-feature-tree {
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.cad-feature-tree:empty {
  display: none;
}

.cad-feat-item {
  appearance: none;
  width: 100%;
  height: 22px;
  padding: 0 9px;
  border: none;
  border-bottom: 1px solid var(--line);
  background: transparent;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: background-color 0.14s ease, color 0.14s ease, opacity 0.14s ease;
}

.cad-feat-item:last-child {
  border-bottom: none;
}

.feat-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ok);
  border: 1px solid transparent;
  flex-shrink: 0;
  transition: transform 0.14s ease, background-color 0.14s ease, border-color 0.14s ease;
}

.feat-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
  color: var(--ink);
}

.feat-spec {
  flex-shrink: 0;
  color: var(--ink-3);
  font-size: 9.5px;
  white-space: nowrap;
}

.feat-toggle-tag {
  flex-shrink: 0;
  min-width: 34px;
  height: 15px;
  padding: 0 5px;
  border-radius: 2px;
  border: 1px solid var(--line);
  background: var(--surface-alt);
  color: var(--ink-3);
  font-size: 8.8px;
  font-weight: 600;
  letter-spacing: 0.04em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.cad-feat-item:hover,
.cad-feat-item.is-hovered {
  background: var(--accent-soft);
}

.cad-feat-item:hover .feat-dot,
.cad-feat-item.is-hovered .feat-dot {
  background: var(--accent);
  transform: scale(1.2);
}

.cad-feat-item:hover .feat-name,
.cad-feat-item.is-hovered .feat-name {
  color: var(--accent);
}

.cad-feat-item:hover .feat-toggle-tag,
.cad-feat-item.is-hovered .feat-toggle-tag {
  border-color: var(--accent-border);
  color: var(--accent);
}

.cad-feat-item.is-suppressed {
  background: var(--surface-alt);
}

.cad-feat-item.is-suppressed .feat-dot {
  background: transparent;
  border-color: var(--ink-3);
}

.cad-feat-item.is-suppressed .feat-name,
.cad-feat-item.is-suppressed .feat-spec {
  text-decoration: line-through;
  color: var(--ink-3);
  opacity: 0.72;
}

.cad-feat-item.is-suppressed .feat-toggle-tag {
  border-color: var(--accent-border);
  background: var(--accent-soft);
  color: var(--accent);
}

.cad-feat-item.is-locked {
  cursor: default;
}

.cad-feat-item.is-locked .feat-dot {
  background: var(--ink-3);
  border-radius: 1px;
}

.cad-feat-item.is-locked .feat-toggle-tag {
  border-style: dashed;
  opacity: 0.72;
}

/* Bottom Full-Width Spec Strip (12-col Title Block Bar, ~52px height) */
.hero-spec-bar {
  grid-column: span 12;
  background: var(--line);
  min-width: 0;
}

.spec-strip {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
}

.spec-row {
  background: var(--surface);
  padding: 9px 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  min-width: 0;
}

.spec-key {
  font-family: var(--font-mono);
  font-size: 9.8px;
  color: var(--ink-3);
  letter-spacing: 0.08em;
  line-height: 1.25;
  text-transform: uppercase;
}

.spec-val {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ==========================================================================
   01 // SELECTED WORKS (De-Boxed Editorial Cards + Compact Archive)
   ========================================================================== */
.projects-grid {
  grid-template-columns: repeat(12, minmax(0, 1fr));
}

.project-card {
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  cursor: pointer;
  min-width: 0;
}

.project-card:hover {
  background: var(--surface-hover);
}

.project-card.span-wide {
  grid-column: span 7;
}

.project-card.span-narrow {
  grid-column: span 5;
}

.project-card.span-full {
  grid-column: span 12;
  display: grid;
  grid-template-columns: 0.92fr 1.28fr;
  gap: 32px;
  align-items: center;
}

.project-card.span-full-compact {
  grid-column: span 12;
  display: grid;
  grid-template-columns: 1.35fr 0.85fr;
  gap: 28px;
  align-items: center;
}

.project-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.project-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.project-index {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.project-index strong {
  color: var(--accent);
}

/* De-boxed editorial project badge */
.project-badge {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  padding: 2px 0;
  border: none;
  background: transparent;
  color: var(--ink-3);
  letter-spacing: 0.06em;
}

.project-badge.featured {
  padding: 2px 8px;
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent);
}

.project-title {
  margin: 0;
  font-size: 22px;
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.25;
  display: flex;
  align-items: center;
  gap: 8px;
}

html[lang^='zh'] .project-title {
  font-weight: 600;
}

.project-subtitle {
  margin: 4px 0 0;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-2);
}

.project-summary {
  margin: 10px 0 0;
  font-size: 14px;
  line-height: 1.68;
  color: var(--ink-2);
}

/* Visual Preview Stages inside Project Cards */
.project-visual {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-inset);
  overflow: hidden;
  position: relative;
  min-width: 0;
}

.project-visual-svg {
  padding: 14px;
  min-height: 168px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.project-visual-svg svg {
  width: 100%;
  height: auto;
  display: block;
}

.project-visual-img {
  min-height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0d1016;
  padding: 12px;
}

.project-visual-img img {
  width: 100%;
  height: auto;
  max-height: 360px;
  object-fit: contain;
  border-radius: 2px;
  transition: transform 0.45s var(--ease);
}

.project-card:hover .project-visual-img img {
  transform: scale(1.02);
}

.visual-caption {
  position: absolute;
  left: 10px;
  bottom: 10px;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background: rgba(14, 16, 20, 0.78);
  color: #f1f2f4;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  backdrop-filter: blur(6px);
}

/* De-boxed Borderless Typographic Metrics Row */
.metrics-inline {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 12px;
  padding: 10px 0;
  border-top: 1px dashed var(--line);
  border-bottom: 1px dashed var(--line);
}

.project-card.span-full .metrics-inline {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 18px;
}

.metric-item {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.metric-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-3);
  letter-spacing: 0.04em;
  line-height: 1.3;
}

.metric-value {
  display: block;
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.35;
}

/* Legacy fallback if referenced in drawer */
.metrics-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 10px 0;
  border-top: 1px dashed var(--line);
  border-bottom: 1px dashed var(--line);
}

.metric-chip {
  min-width: 0;
}

/* De-boxed Plain Mono Tags & Aligned Card Bottom */
.project-bottom {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tags-inline {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  line-height: 1.5;
}

.tags-inline .tag-sep,
.tags-inline .dot {
  color: var(--ink-3);
  opacity: 0.55;
}

.tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  color: var(--ink-2);
  background: var(--surface);
}

.project-footer {
  padding-top: 14px;
  border-top: 1px dashed var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.project-bottom .project-footer {
  padding-top: 0;
  border-top: none;
}

.project-link-btn {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  padding: 2px 0;
  transition: color 0.16s ease;
}

.project-link-btn .arrow {
  transition: transform 0.2s var(--ease);
}

.project-card:hover .project-link-btn.primary-action {
  color: var(--accent);
}

.project-card:hover .project-link-btn.primary-action .arrow {
  transform: translateX(4px);
}

.repo-ext {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-2);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 0;
  border-bottom: 1px solid transparent;
  transition: border-color 0.16s ease, color 0.16s ease;
}

.repo-ext:hover {
  border-bottom-color: var(--ink);
  color: var(--ink);
}

/* ==========================================================================
   01B // COMPACT EXPERIMENTS & ARCHIVE INDEX
   ========================================================================== */
.archive-block {
  margin-top: 38px;
}

.archive-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.archive-head-left .section-kicker {
  margin-bottom: 4px;
}

.archive-title {
  margin: 0;
  font-size: clamp(17px, 2vw, 20px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.archive-desc {
  margin: 0;
  max-width: 440px;
  font-size: 13px;
  color: var(--ink-2);
  text-align: right;
  line-height: 1.5;
}

.archive-list {
  grid-template-columns: 1fr;
}

.archive-row {
  display: grid;
  grid-template-columns: 44px minmax(160px, 0.9fr) 2fr auto 24px;
  align-items: baseline;
  gap: 18px;
  padding: 15px 22px;
  min-width: 0;
  transition: background-color 0.18s var(--ease);
}

.archive-row:hover {
  background: var(--surface-hover);
}

.archive-row-index,
.archive-index,
.archive-row > :nth-child(1) {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-3);
  letter-spacing: 0.06em;
}

.archive-row-title,
.archive-item-title,
.archive-row > :nth-child(2) {
  margin: 0;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  transition: color 0.18s ease, transform 0.2s var(--ease);
}

.archive-row-summary,
.archive-summary,
.archive-row-desc,
.archive-row > :nth-child(3) {
  margin: 0;
  font-size: 13.5px;
  color: var(--ink-2);
  line-height: 1.55;
  min-width: 0;
}

.archive-row-stack,
.archive-stack,
.archive-row-meta,
.archive-row > :nth-child(4) {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
  white-space: nowrap;
}

.archive-row-arrow,
.archive-arrow,
.archive-row > :nth-child(5) {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink-3);
  justify-self: end;
  transition: color 0.18s ease, transform 0.2s var(--ease);
}

.archive-row:hover .archive-row-title,
.archive-row:hover .archive-item-title,
.archive-row:hover > :nth-child(2) {
  color: var(--accent);
  transform: translateX(3px);
}

.archive-row:hover .archive-row-arrow,
.archive-row:hover .archive-arrow,
.archive-row:hover > :nth-child(5) {
  color: var(--accent);
  transform: translate(2px, -1px);
}

/* ==========================================================================
   02 // ABOUT & EDITORIAL FOCUS DOMAINS
   ========================================================================== */
.about-grid {
  grid-template-columns: repeat(12, minmax(0, 1fr));
}

.about-bio {
  grid-column: span 7;
  padding: 32px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
  min-width: 0;
}

.bio-lead {
  margin: 0 0 14px;
  font-size: 21px;
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.35;
}

.bio-text {
  margin: 0 0 12px;
  font-size: 14.5px;
  line-height: 1.78;
  color: var(--ink-2);
}

.bio-text:last-of-type {
  margin-bottom: 0;
}

.principles-box {
  padding-top: 20px;
  border-top: 1px dashed var(--line);
}

.principles-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  color: var(--ink-3);
  margin-bottom: 12px;
}

.principles-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.principle-item {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 10px;
  align-items: baseline;
  font-size: 13.5px;
  color: var(--ink);
}

.principle-num {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
}

.about-stack {
  grid-column: span 5;
  padding: 32px 28px;
  background: var(--surface-alt);
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.stack-header {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--ink-3);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

/* Editorial Focus Domains (Zero skill-tag boxes) */
.focus-list {
  display: flex;
  flex-direction: column;
}

.focus-item {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.focus-item:first-child {
  padding-top: 2px;
}

.focus-item:last-child {
  border-bottom: none;
  padding-bottom: 4px;
}

.focus-item-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.focus-code {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.06em;
  flex-shrink: 0;
}

.focus-title {
  margin: 0;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.focus-summary {
  margin: 0;
  font-size: 13.2px;
  line-height: 1.65;
  color: var(--ink-2);
}

.focus-detail {
  margin: 2px 0 0;
  font-family: var(--font-mono);
  font-size: 10.8px;
  color: var(--ink-3);
  letter-spacing: 0.02em;
}

/* Engineering Baseline Readout (<dl id="facts-list">) */
.facts-list {
  margin: auto 0 0;
  padding-top: 16px;
  border-top: 1px dashed var(--line);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 14px;
  align-items: baseline;
}

.facts-list:has(> div) {
  grid-template-columns: 1fr;
  gap: 8px;
}

.facts-list > div,
.fact-row,
.fact-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 7px;
  border-bottom: 1px dotted var(--line);
}

.facts-list > div:last-child,
.fact-row:last-child,
.fact-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.facts-list dt,
.fact-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-3);
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

.facts-list dd,
.fact-value {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink);
  text-align: right;
}

/* ==========================================================================
   03 // NOW & LOG
   ========================================================================== */
.now-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.now-card {
  padding: 24px 26px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.now-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.now-tag {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
}

.now-tag.tone-accent {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: var(--accent-border);
}

.now-tag.tone-ok {
  color: var(--ok);
  background: var(--ok-soft);
  border-color: rgba(34, 197, 94, 0.35);
}

.now-tag.tone-muted {
  color: var(--ink-2);
  background: var(--surface-alt);
}

.now-date {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
}

.now-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.38;
  letter-spacing: -0.015em;
}

.now-detail {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.68;
  color: var(--ink-2);
}

/* ==========================================================================
   04 // CONTACT & FOOTER
   ========================================================================== */
.contact-frame {
  grid-template-columns: 1.35fr 0.85fr;
}

.contact-left {
  padding: 34px 36px;
}

.contact-title {
  margin: 0 0 12px;
  font-size: clamp(22px, 2.5vw, 28px);
  font-weight: 650;
  line-height: 1.28;
  letter-spacing: -0.02em;
}

.contact-desc {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.72;
  color: var(--ink-2);
  max-width: 560px;
}

.contact-right {
  padding: 32px;
  background: var(--surface-alt);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
}

.contact-email-hint {
  margin: 4px 0 0;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
}

.contact-links-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 8px;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 24px 0 36px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-3);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-shortcuts {
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink-2);
}

/* ==========================================================================
   CASE STUDY DRAWER (Slide-over Blueprint Sheet with Offscreen Hygiene)
   ========================================================================== */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: var(--overlay);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s var(--ease);
}

.drawer-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.drawer-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  width: min(700px, 100vw);
  background: var(--surface);
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow-drawer);
  transform: translateX(100%);
  visibility: hidden;
  pointer-events: none;
  transition: transform 0.3s var(--ease), visibility 0s linear 0.3s;
  display: flex;
  flex-direction: column;
}

.drawer-panel.open {
  transform: translateX(0);
  visibility: visible;
  pointer-events: auto;
  transition: transform 0.3s var(--ease), visibility 0s linear 0s;
}

.drawer-header {
  padding: 18px 26px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--surface-alt);
  flex-shrink: 0;
}

.drawer-kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--accent);
  font-weight: 600;
}

.drawer-close {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 6px 11px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-2);
}

.drawer-close:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}

.drawer-body {
  padding: 28px 28px 36px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.drawer-title {
  margin: 0;
  font-size: 26px;
  font-weight: 650;
  letter-spacing: -0.025em;
}

.drawer-subtitle {
  margin: 6px 0 0;
  font-size: 15px;
  color: var(--ink-2);
}

.drawer-section-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 10px;
}

.drawer-text {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.76;
  color: var(--ink-2);
}

.pipeline-flow {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.pipeline-node {
  font-family: var(--font-mono);
  font-size: 11.5px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  color: var(--ink);
}

.pipeline-arrow {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
}

.highlights-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.highlights-list li {
  padding: 8px 0 8px 14px;
  border-left: 2px solid var(--accent);
  font-size: 13.8px;
  line-height: 1.65;
  color: var(--ink);
}

.drawer-image-box {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #0d1016;
}

.drawer-image-box img {
  width: 100%;
  height: auto;
}

.drawer-footer {
  padding: 16px 26px;
  border-top: 1px solid var(--line);
  background: var(--surface-alt);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

/* ==========================================================================
   TOAST NOTIFICATION
   ========================================================================== */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 120;
  transform: translate(-50%, 16px);
  opacity: 0;
  pointer-events: none;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: var(--surface);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  border: 1px solid var(--line-strong);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
  transition: opacity 0.2s ease, transform 0.22s var(--ease);
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ==========================================================================
   LAB MATRIX VISUAL FALLBACK
   ========================================================================== */
.lab-visual-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 16px;
}

.lab-slot {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.lab-slot-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-3);
}

.lab-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.lab-dot.ok {
  background: var(--ok);
}

.lab-slot-title {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
}

.lab-slot-sub {
  font-size: 11.5px;
  color: var(--ink-2);
  line-height: 1.45;
}

/* ==========================================================================
   RESPONSIVE BREAKPOINTS
   ========================================================================== */
@media (max-width: 980px) {
  .hero-main {
    grid-column: span 12;
  }

  .hero-side {
    grid-column: span 12;
  }

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

  .project-card.span-wide,
  .project-card.span-narrow {
    grid-column: span 12;
  }

  .project-card.span-full,
  .project-card.span-full-compact {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .about-bio,
  .about-stack {
    grid-column: span 12;
  }

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

  .contact-frame {
    grid-template-columns: 1fr;
  }

  .section-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .section-desc {
    text-align: left;
  }
}

@media (max-width: 860px) {
  .archive-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .archive-desc {
    text-align: left;
  }

  .archive-row {
    grid-template-columns: 36px minmax(0, 1fr) auto;
    gap: 5px 12px;
    padding: 14px 18px;
  }

  .archive-row-summary,
  .archive-summary,
  .archive-row-desc,
  .archive-row > :nth-child(3) {
    grid-column: 2 / -1;
    order: 4;
  }

  .archive-row-stack,
  .archive-stack,
  .archive-row-meta,
  .archive-row > :nth-child(4) {
    grid-column: 2 / -1;
    order: 5;
    white-space: normal;
  }
}

@media (max-width: 680px) {
  .container {
    padding: 0 16px;
  }

  .section-block {
    margin-top: 48px;
    scroll-margin-top: 106px;
  }

  .brand-doc {
    display: none;
  }

  .site-header .nav-inner {
    height: auto;
    padding: 10px 16px;
    flex-wrap: wrap;
    row-gap: 8px;
  }

  .nav-links {
    display: flex;
    order: 3;
    width: 100%;
    justify-content: space-between;
    border-top: 1px solid var(--line);
    padding-top: 8px;
    gap: 2px;
  }

  .nav-link {
    padding: 4px 8px;
    font-size: 11.5px;
  }

  .hero-main {
    padding: 24px 20px;
  }

  .hero-proof-strip {
    gap: 10px;
  }

  .hero-proof-item {
    padding-left: 10px;
  }

  .proof-val {
    font-size: 12.5px;
  }

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

  .spec-row {
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 18px;
  }

  .spec-val {
    text-align: right;
  }

  .project-card {
    padding: 20px;
  }

  .project-visual-svg {
    min-height: auto;
    padding: 10px;
  }

  .project-visual-img {
    min-height: auto;
    padding: 8px;
  }

  .about-bio,
  .about-stack,
  .contact-left,
  .contact-right {
    padding: 22px 20px;
  }

  .facts-list dd,
  .fact-value {
    white-space: normal;
  }

  .lab-visual-grid {
    grid-template-columns: 1fr;
  }

  .contact-links-row {
    grid-template-columns: 1fr;
  }

  .drawer-body,
  .drawer-header,
  .drawer-footer {
    padding-left: 18px;
    padding-right: 18px;
  }

  .footer-shortcuts {
    display: none;
  }
}

@media (max-width: 480px) {
  .feat-spec {
    display: none;
  }

  .cad-hint {
    display: none;
  }

  .hero-proof-strip {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .hero-proof-item {
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
    padding-left: 0;
    border-left: none;
  }
}

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