/* ==========================================================================
   DoAI Works — Architectural Minimalist Design System
   Faithful to DoAI Monogram 01 study: Swiss hairline grid, mineral glass,
   editorial typography, and studio dark mode.
   ========================================================================== */

:root {
  --ink: #242724;
  --muted: #656963;
  --subtle: #8b9088;
  --line: #dedfda;
  --line-strong: #a9aca5;
  --paper: #ffffff;
  --paper-glass: rgba(255, 255, 255, 0.86);
  --surface: #f3f4f1;
  --surface-hover: #eceee9;
  --surface-elevated: #fafbf9;
  --accent: #527a70;
  --accent-soft: rgba(82, 122, 112, 0.11);
  --accent-border: rgba(82, 122, 112, 0.34);
  --status-live: #3d7a64;
  --status-dev: #8b6f36;
  --status-plan: #68737b;
  --shadow-drawer: -12px 0 48px rgba(24, 30, 26, 0.09);
  --shadow-modal: 0 24px 64px rgba(24, 30, 26, 0.14);
  --backdrop: rgba(24, 28, 25, 0.32);

  --font-sans: 'Helvetica Neue', 'Inter', Arial, 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Yu Gothic', Meiryo, sans-serif;
  --font-mono: ui-monospace, 'SFMono-Regular', 'JetBrains Mono', Menlo, Consolas, monospace;

  --ease-out: cubic-bezier(0.2, 0.65, 0.2, 1);
  --ease-snappy: cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] {
  --ink: #f1f4ef;
  --muted: #b4bcb4;
  --subtle: #8c958d;
  --line: #2c3330;
  --line-strong: #54615b;
  --paper: #131614;
  --paper-glass: rgba(19, 22, 20, 0.88);
  --surface: #1b201d;
  --surface-hover: #222926;
  --surface-elevated: #181d1a;
  --accent: #82b8aa;
  --accent-soft: rgba(130, 184, 170, 0.16);
  --accent-border: rgba(130, 184, 170, 0.44);
  --status-live: #6ec0a2;
  --status-dev: #d8b062;
  --status-plan: #98a8b4;
  --shadow-drawer: -16px 0 56px rgba(0, 0, 0, 0.45);
  --shadow-modal: 0 28px 72px rgba(0, 0, 0, 0.56);
  --backdrop: rgba(6, 8, 7, 0.62);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
  overflow-x: clip;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font-sans);
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  transition: background-color 0.28s var(--ease-out), color 0.28s var(--ease-out);
}

body.has-modal {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease, border-color 0.2s ease;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

a:hover {
  color: var(--accent);
}

.wrap {
  width: min(1220px, calc(100% - 112px));
  margin-inline: auto;
}

.skip {
  position: absolute;
  left: -9999px;
}

.skip:focus {
  left: 16px;
  top: 16px;
  padding: 8px 14px;
  background: var(--paper);
  border: 1px solid var(--accent);
  z-index: 200;
  font-size: 12px;
}

.sr-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* ==========================================================================
   Architectural 12-Column Grid Overlay (Toggle with G)
   ========================================================================== */
.arch-grid-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 90;
  opacity: 0;
  transition: opacity 0.25s ease;
}

body.show-grid .arch-grid-overlay {
  opacity: 1;
}

.arch-grid-columns {
  height: 100%;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 20px;
}

.arch-grid-columns span {
  height: 100%;
  background: var(--accent-soft);
  border-inline: 1px dashed var(--accent-border);
  opacity: 0.45;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--line);
  background: var(--paper-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

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

.logo {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-weight: 650;
  font-size: 24px;
  letter-spacing: -1.3px;
  white-space: nowrap;
}

.logo:hover {
  color: var(--ink);
}

.logo-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
  transform: translateY(-2px);
}

.primary-nav {
  display: flex;
  align-items: center;
  gap: 34px;
  font-size: 13px;
  letter-spacing: 0.01em;
}

.primary-nav a {
  position: relative;
  padding: 6px 0;
  color: var(--muted);
}

.primary-nav a:hover,
.primary-nav a.is-current {
  color: var(--ink);
}

.primary-nav a::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s var(--ease-out);
}

.primary-nav a.is-current::after,
.primary-nav a:hover::after {
  transform: scaleX(1);
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tool-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
  transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}

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

.tool-btn.icon-only {
  width: 32px;
  padding: 0;
}

.tool-btn kbd,
.telemetry-controls kbd,
.cmd-dialog kbd {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 1px 5px;
  border: 1px solid var(--line);
  color: var(--subtle);
  background: var(--surface-elevated);
}

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

.mobile-menu-btn {
  display: none;
}

.mobile-menu-btn .icon-close {
  display: none;
}

.mobile-menu-btn[aria-expanded="true"] .icon-menu {
  display: none;
}

.mobile-menu-btn[aria-expanded="true"] .icon-close {
  display: block;
}

.mobile-nav {
  border-top: 1px solid var(--line);
  background: var(--paper);
  animation: fadeSlide 0.18s var(--ease-snappy);
}

.mobile-nav[hidden] {
  display: none;
}

.mobile-nav-inner {
  display: flex;
  flex-direction: column;
  padding: 6px 0 14px;
}

.mobile-nav-inner a {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 13px 2px;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
  color: var(--ink);
}

.mobile-nav-inner a:last-child {
  border-bottom: 0;
}

.mobile-nav-inner a span:first-child {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--accent);
}

/* ==========================================================================
   Hero & Interactive Monogram 01
   ========================================================================== */
.hero {
  display: grid;
  grid-template-columns: 42% 58%;
  align-items: center;
  padding: 46px 0 64px;
  gap: 0;
}

.intro {
  padding-right: 36px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 11px;
  letter-spacing: 0.13em;
  color: var(--muted);
  margin: 0 0 34px;
}

.status-pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--status-live);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.intro h1 {
  font-size: clamp(29px, 3.1vw, 46px);
  line-height: 1.62;
  letter-spacing: 0.03em;
  font-weight: 500;
  margin: 0 0 24px;
  white-space: nowrap;
}

html[lang="en"] .intro h1 {
  font-size: clamp(26px, 2.75vw, 40px);
  line-height: 1.32;
  letter-spacing: -0.02em;
  white-space: normal;
}

html[lang="ja"] p,
html[lang="ja"] li,
html[lang="ja"] dd,
html[lang="ja"] .book-detail {
  line-break: strict;
  word-break: auto-phrase;
  overflow-wrap: break-word;
  text-wrap: pretty;
}

.intro .lead {
  font-size: 14px;
  line-height: 2.15;
  color: var(--muted);
  max-width: 396px;
  margin: 0;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 22px;
  margin-top: 32px;
}

.link {
  display: inline-flex;
  gap: 28px;
  align-items: center;
  border-bottom: 1px solid var(--ink);
  padding: 12px 0;
  font-size: 13px;
}

.link:hover {
  border-color: var(--accent);
}

.link .arrow {
  transition: transform 0.25s var(--ease-out);
}

.link:hover .arrow {
  transform: translate(3px, -3px);
}

.subtle-action {
  background: transparent;
  border: 0;
  padding: 12px 0;
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--muted);
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.subtle-action:hover {
  color: var(--accent);
  border-color: var(--accent-border);
}

.hero-specs {
  margin: 44px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  max-width: 390px;
}

.hero-specs dt {
  font-size: 10px;
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--subtle);
  margin-bottom: 5px;
}

.hero-specs dd {
  margin: 0;
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--ink);
}

/* Hero Artwork Stage */
.art {
  margin: 0;
  position: relative;
  background: var(--surface);
  aspect-ratio: 1.16;
  overflow: hidden;
  border: 1px solid var(--line);
  user-select: none;
  touch-action: pan-y;
  cursor: grab;
}

.art.is-dragging {
  cursor: grabbing;
}

.art-gl {
  display: block;
  width: 100%;
  height: 100%;
  position: relative;
  z-index: 1;
}

.art-fallback {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--ink);
  font-size: 48px;
  font-weight: 600;
  letter-spacing: -0.04em;
}

.art-fallback[hidden] {
  display: none;
}

.art-fallback small {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.art-hud-top {
  position: absolute;
  top: 15px;
  left: 20px;
  right: 20px;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.055em;
  color: var(--muted);
  opacity: 0.72;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.art:hover .art-hud-top {
  opacity: 0.96;
}

.art-caption {
  position: absolute;
  bottom: 14px;
  left: 20px;
  right: 20px;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.055em;
}

.art-caption-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.art-title-tag {
  color: var(--ink);
  font-weight: 500;
}

.art-subtitle-tag {
  color: var(--muted);
}

.explode-meter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: transparent;
  padding: 4px 0;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--muted);
  transition: color 0.2s ease;
}

.explode-meter:hover {
  color: var(--ink);
}

.explode-track {
  width: 56px;
  height: 1.5px;
  background: var(--line-strong);
  position: relative;
  overflow: hidden;
}

.explode-fill {
  position: absolute;
  inset: 0;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
}

.explode-pct {
  min-width: 24px;
  text-align: right;
  color: var(--ink);
}

/* ==========================================================================
   Core Editorial Section Grid (27% / 73%)
   ========================================================================== */
.section {
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 27% 73%;
  padding: 76px 0;
  gap: 0;
}

.section-rail {
  padding-right: 32px;
}

.section-index {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.1em;
  margin-bottom: 10px;
}

.section h2 {
  font-size: 26px;
  font-weight: 500;
  letter-spacing: -0.6px;
  margin: 0 0 8px;
}

.sub {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

.rail-note {
  margin: 26px 0 0;
  font-size: 12px;
  line-height: 1.9;
  color: var(--subtle);
  max-width: 244px;
}

/* ==========================================================================
   Section 01: Works & Project Cards
   ========================================================================== */
.filter-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  margin-top: 28px;
}

.filter-btn {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-width: 164px;
  padding: 6px 0;
  background: transparent;
  border: 0;
  border-bottom: 1px solid transparent;
  font-size: 12px;
  color: var(--muted);
  text-align: left;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.filter-btn .count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--subtle);
}

.filter-btn:hover {
  color: var(--ink);
}

.filter-btn.is-active {
  color: var(--ink);
  border-color: var(--accent);
}

.filter-btn.is-active .count {
  color: var(--accent);
}

.projects {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 32px;
  row-gap: 44px;
}

.project {
  position: relative;
  border-top: 1px solid var(--line-strong);
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  transition: border-color 0.25s ease;
}

.project::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 0;
  width: 0;
  height: 1.5px;
  background: var(--accent);
  transition: width 0.42s var(--ease-out);
}

.project:hover::before,
.project:focus-within::before {
  width: 100%;
}

.project--live .project-showcase {
  margin-top: 14px;
}

.project--live .project-copy {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.project--featured {
  grid-column: 1 / -1;
}

.project--featured .project-showcase {
  margin-top: 0;
}

.project--featured .project-featured-body {
  display: grid;
  grid-template-columns: 1.24fr 0.76fr;
  gap: 30px;
  align-items: stretch;
  margin-top: 16px;
}

.project--featured h3 {
  margin-top: 2px;
  font-size: 27px;
}

.title-arrow {
  font-size: 18px;
  color: var(--subtle);
  transition: transform 0.25s var(--ease-out), color 0.2s ease;
}

.project:hover .title-arrow {
  color: var(--accent);
  transform: translate(3px, -3px);
}

/* Framed Real-Site Hero Showcase for External Live Services */
.project-showcase {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 12px 12px 0;
  overflow: hidden;
  transition: border-color 0.28s var(--ease-out), background-color 0.28s var(--ease-out), transform 0.35s var(--ease-out);
}

.project-showcase:hover {
  border-color: var(--line-strong);
  background: var(--surface-hover);
  color: inherit;
}

.browser-chrome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 11px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 6px 6px 0 0;
}

.chrome-dots {
  display: inline-flex;
  gap: 5px;
}

.chrome-dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--line-strong);
  opacity: 0.72;
  display: block;
}

.chrome-url {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.02em;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chrome-ext {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--subtle);
  transition: color 0.2s ease, transform 0.25s var(--ease-out);
}

.project-showcase:hover .chrome-ext {
  color: var(--accent);
  transform: translate(2px, -2px);
}

.showcase-media {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-bottom: 0;
  background: var(--surface-elevated);
  aspect-ratio: 16 / 10;
  box-shadow: 0 12px 28px rgba(24, 30, 26, 0.08);
}

.showcase-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top left;
  transition: transform 0.55s var(--ease-out);
}

.project-showcase:hover .showcase-media img {
  transform: scale(1.028);
}

.project-metrics {
  margin: 20px 0 0;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.project-metrics dt {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--subtle);
  margin-bottom: 4px;
}

.project-metrics dd {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 500;
  color: var(--ink);
}

.external-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  background: var(--ink);
  color: var(--paper);
  border: 1px solid var(--ink);
  font-size: 12px;
  transition: background-color 0.22s ease, border-color 0.22s ease, color 0.22s ease;
}

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

.project-visual-link {
  display: block;
}

.project .meta {
  font-size: 11px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--muted);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.status-dot.live { background: var(--status-live); }
.status-dot.dev { background: var(--status-dev); }
.status-dot.plan { background: var(--status-plan); }

.project-visual {
  margin: 14px 0 0;
  height: 136px;
  background: var(--surface);
  border: 1px solid var(--line);
  overflow: hidden;
  position: relative;
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

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

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

.project-visual .diagram-accent {
  stroke: var(--accent);
  transition: transform 0.55s var(--ease-out);
}

.project:hover .project-visual .diagram-shift {
  transform: translate(5px, -3px);
}

/* Under Construction / To-Be Architectural Styling (Rail Room & Little House) */
.project--wip {
  border-top: 1px dashed var(--line-strong);
}

.project--wip .project-foot {
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
}

.project-visual--wip {
  height: 158px;
  border-style: dashed;
}

.project-visual--wip svg {
  opacity: 0.42;
  filter: saturate(0.7);
  transition: opacity 0.3s ease;
}

.project--wip:hover .project-visual--wip svg {
  opacity: 0.62;
}

.wip-tape {
  position: absolute;
  left: 0;
  right: 0;
  height: 7px;
  background: repeating-linear-gradient(
    -45deg,
    rgba(163, 126, 56, 0.36) 0 7px,
    rgba(36, 39, 36, 0.14) 7px 14px
  );
  pointer-events: none;
  z-index: 2;
}

[data-theme="dark"] .wip-tape {
  background: repeating-linear-gradient(
    -45deg,
    rgba(216, 176, 98, 0.42) 0 7px,
    rgba(19, 22, 20, 0.45) 7px 14px
  );
}

.wip-tape--top {
  top: 0;
  border-bottom: 1px solid var(--line);
}

.wip-tape--bottom {
  bottom: 0;
  border-top: 1px solid var(--line);
}

.wip-stamp {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  background: var(--paper-glass);
  border: 1px solid var(--line-strong);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 6px 20px rgba(24, 30, 26, 0.06);
  white-space: nowrap;
  pointer-events: none;
  transition: border-color 0.25s ease, transform 0.25s var(--ease-out);
}

.project--wip:hover .wip-stamp {
  border-color: var(--status-dev);
  transform: translate(-50%, -52%);
}

.wip-stamp-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: rgba(163, 126, 56, 0.13);
  border: 1px solid rgba(163, 126, 56, 0.34);
  color: var(--status-dev);
}

.wip-stamp-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.wip-stamp-text strong {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.11em;
  color: var(--ink);
}

.wip-stamp-text small {
  font-size: 10.5px;
  color: var(--muted);
}

.wip-progress {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}

.wip-progress-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--subtle);
  margin-bottom: 6px;
}

.wip-progress-bar {
  height: 3px;
  background: var(--line);
  position: relative;
  overflow: hidden;
}

.wip-progress-bar span {
  display: block;
  height: 100%;
  background: repeating-linear-gradient(
    -45deg,
    var(--status-dev) 0 5px,
    var(--accent) 5px 10px
  );
}

.drawer-wip-banner {
  flex-shrink: 0;
  border: 1px dashed var(--line-strong);
  background: var(--surface);
  overflow: hidden;
}

.drawer-wip-tape {
  display: block;
  height: 6px;
  background: repeating-linear-gradient(
    -45deg,
    rgba(163, 126, 56, 0.42) 0 7px,
    rgba(36, 39, 36, 0.14) 7px 14px
  );
  border-bottom: 1px solid var(--line);
}

.drawer-wip-copy {
  padding: 11px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.drawer-wip-copy strong {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  color: var(--status-dev);
}

.drawer-wip-copy span {
  font-size: 12px;
  line-height: 1.65;
  color: var(--muted);
}

.project h3 {
  font-size: 24px;
  line-height: 1.45;
  font-weight: 500;
  letter-spacing: -0.5px;
  margin: 18px 0 10px;
}

.project-title-btn {
  border: 0;
  background: transparent;
  padding: 0;
  text-align: left;
  color: inherit;
  font: inherit;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.project-title-btn:hover {
  color: var(--accent);
}

.project p {
  font-size: 14px;
  line-height: 1.95;
  color: var(--muted);
  margin: 0;
}

.project-foot {
  margin-top: auto;
  padding-top: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

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

.tech-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 7px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: var(--surface-elevated);
}

.inspect-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  padding: 4px 0;
  font-size: 12px;
  color: var(--ink);
  border-bottom: 1px solid var(--line-strong);
  transition: color 0.2s ease, border-color 0.2s ease;
}

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

/* ==========================================================================
   Section 02: Books & Publications (Co-authored + 5-Volume Kindle Shelf)
   ========================================================================== */
.book-feature {
  border-top: 1px solid var(--line-strong);
  padding: 26px 0 36px;
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
  gap: 36px;
  align-items: center;
}

.book-jacket-link {
  display: flex;
  justify-content: center;
  padding: 22px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  transition: border-color 0.25s ease, background-color 0.25s ease;
}

.book-jacket-link:hover {
  border-color: var(--line-strong);
  background: var(--surface-hover);
}

.book-feature-cover {
  position: relative;
  width: 168px;
  border-radius: 2px;
  overflow: hidden;
  border: 1px solid rgba(36, 39, 36, 0.14);
  box-shadow:
    -6px 12px 24px rgba(24, 30, 26, 0.18),
    -2px 3px 6px rgba(24, 30, 26, 0.10);
  transition: transform 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out);
}

.book-jacket-link:hover .book-feature-cover {
  transform: translateY(-4px) rotate(-0.8deg);
  box-shadow:
    -8px 18px 30px rgba(24, 30, 26, 0.22),
    -2px 4px 8px rgba(24, 30, 26, 0.12);
}

.book-feature-cover img {
  display: block;
  width: 100%;
  height: auto;
}

.book-feature-copy {
  display: flex;
  flex-direction: column;
}

.book-meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

.book-role-pill {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  padding: 2px 8px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  color: var(--accent);
}

.book-feature-copy h3 {
  margin: 0;
  font-size: 26px;
  font-weight: 500;
  letter-spacing: -0.5px;
}

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

.book-credit {
  margin: 8px 0 0;
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--subtle);
}

.book-desc {
  margin: 14px 0 0;
  font-size: 14px;
  line-height: 1.95;
  color: var(--muted);
}

.book-feature-foot {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

/* 5-Volume Self-Published Kindle Bookshelf */
.books-series-block {
  padding-top: 32px;
  border-top: 1px solid var(--line);
}

.series-lead {
  margin: 0 0 22px;
  font-size: 13.5px;
  line-height: 1.9;
  color: var(--muted);
  max-width: 680px;
}

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

.book-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  color: inherit;
}

.book-card:hover {
  color: inherit;
}

.book-cover-wrap {
  position: relative;
  aspect-ratio: 520 / 736;
  background: var(--surface);
  border: 1px solid var(--line);
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(24, 30, 26, 0.08);
  transition: transform 0.35s var(--ease-out), box-shadow 0.35s var(--ease-out), border-color 0.25s ease;
}

.book-card:hover .book-cover-wrap {
  transform: translateY(-4px);
  border-color: var(--accent-border);
  box-shadow: 0 14px 28px rgba(24, 30, 26, 0.14);
}

.book-cover-wrap img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.book-new-tag {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  padding: 2px 6px;
  background: #c4623f;
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.book-card-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
}

.book-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
}

.book-code {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
}

.book-level {
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--accent);
}

.book-track {
  font-size: 11px;
  line-height: 1.4;
  color: var(--muted);
}

.book-detail {
  font-size: 10.5px;
  line-height: 1.45;
  color: var(--subtle);
}

.book-amazon-link {
  margin-top: auto;
  padding-top: 6px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink);
  transition: color 0.2s ease;
}

.book-card:hover .book-amazon-link {
  color: var(--accent);
}

/* ==========================================================================
   Section 02: Approach, Interactive Pipeline & Capabilities
   ========================================================================== */
.detail {
  display: grid;
  grid-template-columns: 35% 65%;
  gap: 0;
  border-top: 1px solid var(--line);
  padding: 24px 0;
}

.detail:first-child {
  border-color: var(--line-strong);
}

.detail h3 {
  margin: 0;
  padding-right: 20px;
  font-size: 16px;
  font-weight: 500;
}

.detail-index {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--subtle);
  margin-bottom: 6px;
}

.detail p {
  font-size: 14px;
  line-height: 1.95;
  color: var(--muted);
  margin: 0;
}

.detail-points {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.detail-points li {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 3px 8px;
}

.subblock-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 18px;
}

.subblock-head h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
}

.mono-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  color: var(--subtle);
}

/* ==========================================================================
   Section 04: About
   ========================================================================== */
.about-copy {
  max-width: 640px;
}

.about-lead {
  margin: 0;
  font-size: 17px;
  font-weight: 500;
  line-height: 1.9;
}

.about-body {
  margin: 16px 0 0;
  font-size: 14px;
  line-height: 2.1;
  color: var(--muted);
}

.profile-specs {
  margin: 34px 0 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border-top: 1px solid var(--line-strong);
}

.profile-specs div {
  padding: 16px 16px 16px 0;
  border-bottom: 1px solid var(--line);
}

.profile-specs dt {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--subtle);
  margin-bottom: 6px;
}

.profile-specs dd {
  margin: 0;
  font-size: 13.5px;
  color: var(--ink);
}

.profile-specs .spec-full {
  grid-column: 1 / -1;
  padding-right: 0;
}

.cert-list {
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cert-list li {
  font-size: 12.5px;
  line-height: 1.4;
  padding: 5px 11px;
  border: 1px solid var(--line-strong);
  background: var(--surface-elevated);
  color: var(--ink);
}

.cert-list li:first-child {
  border-color: var(--accent-border);
  background: var(--accent-soft);
  color: var(--accent);
}

/* ==========================================================================
   Section 04: Contact
   ========================================================================== */
.contact-grid {
  display: grid;
  grid-template-columns: 0.92fr 1.08fr;
  gap: 44px;
  align-items: start;
}

.contact-lead {
  margin: 0;
  font-size: 14px;
  line-height: 2;
  color: var(--muted);
}

.contact-direct {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.mono-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--subtle);
  margin-bottom: 8px;
}

.email-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.email-address {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--ink);
  word-break: break-all;
}

.pill-btn {
  flex-shrink: 0;
  border: 1px solid var(--line-strong);
  background: var(--paper);
  padding: 5px 10px;
  font-size: 11px;
  font-family: var(--font-mono);
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

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

.about-links {
  margin-top: 4px;
  display: flex;
  flex-direction: column;
}

.social-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
}

.social-link-main {
  display: inline-flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.social-link-main strong {
  font-weight: 500;
  color: var(--ink);
}

.social-link-note {
  font-size: 12px;
  color: var(--muted);
}

.social-link-handle {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  transition: color 0.2s ease;
}

.social-link:hover .social-link-handle,
.social-link:hover .social-link-main strong {
  color: var(--accent);
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-row label {
  font-size: 12px;
  color: var(--muted);
}

.form-row input,
.form-row select,
.form-row textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: var(--surface-elevated);
  font-size: 13.5px;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
  border-color: var(--accent);
  background: var(--paper);
  outline: none;
}

.form-row textarea {
  resize: vertical;
  min-height: 104px;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.submit-btn {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 11px 20px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  font-size: 13px;
  transition: background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

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

.submit-btn:disabled {
  opacity: 0.55;
  cursor: progress;
}

.form-status {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.form-status.is-error {
  color: #b44338;
}

.form-status.is-ok {
  color: var(--accent);
}

/* ==========================================================================
   Footer & Telemetry Colophon
   ========================================================================== */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 24px 0 34px;
}

.telemetry-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.telemetry-items {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.telemetry-chip {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--muted);
  padding: 3px 8px;
  border: 1px solid var(--line);
  background: var(--surface-elevated);
}

.telemetry-controls {
  display: flex;
  align-items: center;
  gap: 14px;
}

.text-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  padding: 4px 0;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}

.text-btn:hover {
  color: var(--accent);
}

.foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
}

.foot-note {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--subtle);
}

/* ==========================================================================
   Slide-Over Project Drawer & Interactive Micro-Demos
   ========================================================================== */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: var(--backdrop);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: flex-end;
}

.drawer-backdrop[hidden] {
  display: none;
}

.drawer {
  width: min(640px, 100%);
  height: 100%;
  background: var(--paper);
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow-drawer);
  display: flex;
  flex-direction: column;
  animation: slideInRight 0.3s var(--ease-snappy);
}

@keyframes slideInRight {
  from { transform: translateX(28px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.drawer-head {
  height: 64px;
  flex-shrink: 0;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.drawer-nav-group {
  display: flex;
  align-items: center;
  gap: 16px;
}

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

.drawer-arrows {
  display: inline-flex;
  gap: 6px;
}

.icon-btn {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 13px;
}

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

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

.drawer-body > * {
  flex-shrink: 0;
}

.drawer-title-block h2 {
  margin: 10px 0 8px;
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.6px;
}

.drawer-title-block p {
  margin: 0;
  font-size: 14px;
  line-height: 1.9;
  color: var(--muted);
}

.drawer-meta-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.drawer-meta-bar div {
  padding: 12px 12px 12px 0;
}

.drawer-meta-bar dt {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--subtle);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.drawer-meta-bar dd {
  margin: 0;
  font-size: 12.5px;
}

/* Interactive Micro-Demo Container inside Drawer */
.demo-stage {
  border: 1px solid var(--line);
  background: var(--surface);
}

.demo-head {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  background: var(--surface-elevated);
}

.demo-title {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.demo-badge {
  font-size: 9.5px;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 2px 6px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.demo-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.demo-btn {
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--muted);
  padding: 4px 9px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  transition: border-color 0.18s ease, color 0.18s ease, background-color 0.18s ease;
}

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

.demo-btn.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.demo-canvas-wrap {
  padding: 16px;
}

.demo-note {
  padding: 8px 14px;
  border-top: 1px solid var(--line);
  font-size: 11.5px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  background: var(--surface-elevated);
}

/* Rail Room & Little House Canvas/SVG Stage */
.toy-svg {
  width: 100%;
  height: auto;
  display: block;
  background: var(--paper);
  border: 1px solid var(--line);
  cursor: pointer;
}

/* Drawer Narrative Sections */
.drawer-section h3 {
  margin: 0 0 10px;
  font-size: 13px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--subtle);
}

.drawer-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.drawer-list li {
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--muted);
  padding-left: 14px;
  position: relative;
}

.drawer-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  width: 5px;
  height: 1px;
  background: var(--accent);
}

.drawer-cta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

/* ==========================================================================
   Command Palette & System Spec Modal
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 140;
  background: var(--backdrop);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 12vh 16px 24px;
}

.modal-backdrop[hidden] {
  display: none;
}

.cmd-dialog {
  width: min(560px, 100%);
  background: var(--paper);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-modal);
  overflow: hidden;
  animation: fadeSlide 0.2s var(--ease-snappy);
}

@keyframes fadeSlide {
  from { opacity: 0; transform: translateY(-8px) scale(0.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.cmd-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.cmd-prompt {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 14px;
}

.cmd-input-row input {
  flex: 1;
  border: 0;
  background: transparent;
  font-size: 14px;
  outline: none;
}

.cmd-list {
  margin: 0;
  padding: 6px;
  list-style: none;
  max-height: 320px;
  overflow-y: auto;
}

.cmd-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  font-size: 13px;
  cursor: pointer;
  color: var(--ink);
}

.cmd-item[aria-selected="true"],
.cmd-item:hover {
  background: var(--surface);
  color: var(--accent);
}

.cmd-item-sub {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--subtle);
}

.cmd-empty {
  padding: 18px 12px;
  font-size: 12.5px;
  color: var(--muted);
  text-align: center;
}

.cmd-foot {
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  background: var(--surface-elevated);
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--subtle);
}

/* System Spec Modal */
.spec-dialog {
  width: min(580px, 100%);
  background: var(--paper);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-modal);
  animation: fadeSlide 0.2s var(--ease-snappy);
}

.spec-dialog-head {
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.spec-dialog-head h3 {
  margin: 6px 0 0;
  font-size: 18px;
  font-weight: 500;
}

.spec-dialog-body {
  padding: 20px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.spec-table {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border-top: 1px solid var(--line);
}

.spec-table div {
  padding: 12px 12px 12px 0;
  border-bottom: 1px solid var(--line);
}

.spec-table dt {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--subtle);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.spec-table dd {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink);
}

.spec-notes {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.8;
  color: var(--muted);
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 160;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 12px;
  box-shadow: var(--shadow-modal);
}

/* 404 Page */
.not-found {
  padding: 96px 0 120px;
  max-width: 600px;
}

.not-found h1 {
  font-size: clamp(26px, 4vw, 38px);
  font-weight: 500;
  margin: 0 0 16px;
}

.not-found .lead {
  font-size: 14px;
  line-height: 2;
  color: var(--muted);
  margin: 0;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 1020px) {
  .wrap {
    width: 90%;
  }

  .hero {
    grid-template-columns: 44% 56%;
  }

  .intro {
    padding-right: 22px;
  }

  .intro h1 {
    font-size: clamp(24px, 3vw, 35px);
  }

  .project--featured .project-featured-body {
    grid-template-columns: 1fr;
    gap: 20px;
  }

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

  .contact-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}

@media (max-width: 780px) {
  html {
    scroll-padding-top: 80px;
  }

  .wrap {
    width: calc(100% - 36px);
  }

  .nav {
    height: 66px;
    gap: 12px;
  }

  .logo {
    font-size: 20px;
    letter-spacing: -1px;
  }

  .primary-nav {
    display: none;
  }

  .mobile-menu-btn {
    display: inline-flex;
  }

  .tool-label,
  .kbd-desktop {
    display: none;
  }

  .tool-btn {
    min-width: 36px;
    height: 36px;
    padding: 0 9px;
  }

  .tool-btn.icon-only {
    width: 36px;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 28px 0 44px;
  }

  .intro {
    padding-right: 0;
  }

  .intro h1 {
    font-size: clamp(28px, 7.6vw, 40px);
    line-height: 1.5;
    white-space: normal;
  }

  html[lang="en"] .intro h1 {
    font-size: clamp(26px, 7vw, 36px);
    line-height: 1.28;
  }

  .intro .lead {
    max-width: 480px;
    line-height: 2;
  }

  .eyebrow {
    margin-bottom: 18px;
  }

  .hero-actions {
    margin-top: 24px;
    gap: 16px;
  }

  .hero-specs {
    margin-top: 28px;
    max-width: none;
    gap: 12px;
  }

  .art {
    aspect-ratio: 1 / 1.04;
  }

  .art-hud-top {
    top: 12px;
    left: 14px;
    right: 14px;
    font-size: 9.5px;
  }

  .art-caption {
    left: 14px;
    right: 14px;
    bottom: 10px;
  }

  .art-subtitle-tag {
    display: none;
  }

  .explode-meter {
    padding: 8px 10px;
    background: var(--paper-glass);
    border: 1px solid var(--line);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }

  .section {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 46px 0;
  }

  .section-rail {
    padding-right: 0;
  }

  .filter-group {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
  }

  .filter-btn {
    min-width: auto;
    min-height: 36px;
    padding: 6px 11px;
    gap: 8px;
    border: 1px solid var(--line);
    background: var(--surface-elevated);
  }

  .filter-btn.is-active {
    border-color: var(--accent);
    background: var(--accent-soft);
  }

  .rail-note {
    max-width: none;
    margin-top: 14px;
  }

  .projects {
    grid-template-columns: 1fr;
    row-gap: 38px;
  }

  .book-feature {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .books-shelf {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }

  .project h3 {
    font-size: 22px;
  }

  .detail {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  /* Prevent iOS Safari auto-zoom on input focus */
  .form-row input,
  .form-row select,
  .form-row textarea,
  .cmd-input-row input {
    font-size: 16px;
  }

  .submit-btn,
  .external-cta-btn {
    min-height: 44px;
    justify-content: center;
  }

  .drawer-head {
    padding: 0 18px;
  }

  .icon-btn {
    width: 38px;
    height: 38px;
  }

  .drawer-body {
    padding: 20px 18px calc(32px + env(safe-area-inset-bottom));
  }

  .demo-btn {
    min-height: 34px;
    padding: 6px 10px;
  }

  .demo-note {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .telemetry-bar {
    gap: 12px;
  }

  #gridToggleBtn {
    display: none;
  }

  .site-footer {
    padding-bottom: calc(32px + env(safe-area-inset-bottom));
  }

  .toast {
    left: 18px;
    right: 18px;
    bottom: calc(16px + env(safe-area-inset-bottom));
    text-align: center;
  }
}

@media (max-width: 480px) {
  .wrap {
    width: calc(100% - 28px);
  }

  .hud-readout {
    display: none;
  }

  .art-hud-top {
    justify-content: flex-end;
  }

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

  .hero-specs > div:last-child {
    grid-column: 1 / -1;
    padding-top: 10px;
    border-top: 1px solid var(--line);
  }

  .subtle-action {
    display: none;
  }

  .project-foot {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }

  .external-cta-btn,
  .submit-btn {
    width: 100%;
  }

  .profile-specs,
  .drawer-meta-bar,
  .spec-table {
    grid-template-columns: 1fr;
  }

  .email-row {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .pill-btn {
    min-height: 38px;
    text-align: center;
  }

  .drawer-cta-row {
    flex-direction: column;
    align-items: stretch;
  }

  .modal-backdrop {
    padding: 8vh 12px 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
