/* OmaStudio Showcase — Optical Darkroom & Archival Paper Design System */

@property --fade-start {
  syntax: "<length>";
  inherits: false;
  initial-value: 0px;
}

@property --fade-end {
  syntax: "<length>";
  inherits: false;
  initial-value: 0px;
}

:root {
  /* Raw palette pairs (Archival Paper Light / Darkroom Obsidian Dark) */
  --bg-light: #f6f5f0;
  --bg-dark: #0c1016;
  --surface-light: #ffffff;
  --surface-dark: #121821;
  --surface-elevated-light: #efede6;
  --surface-elevated-dark: #18212d;
  --surface-code-light: #131922;
  --surface-code-dark: #0a0e14;

  --ink-light: #101923;
  --ink-dark: #eef2f6;
  --ink-muted-light: #4a5766;
  --ink-muted-dark: #94a3b5;
  --ink-subtle-light: #697586;
  --ink-subtle-dark: #6f7f93;

  --border-light: rgba(16, 25, 35, 0.11);
  --border-dark: rgba(238, 242, 246, 0.10);
  --border-strong-light: rgba(16, 25, 35, 0.22);
  --border-strong-dark: rgba(238, 242, 246, 0.20);

  /* Authentic OmaStudio Optical Teal (#00c8b7 from assets/icon.svg) */
  --accent-light: #00756b;
  --accent-dark: #00c8b7;
  --accent-hover-light: #005d55;
  --accent-hover-dark: #2be0d0;
  --accent-ink-light: #ffffff;
  --accent-ink-dark: #061816;
  --accent-soft-light: rgba(0, 117, 107, 0.10);
  --accent-soft-dark: rgba(0, 200, 183, 0.13);

  /* Warm darkroom amber accent for secondary badges/EXIF highlights */
  --amber-light: #9a5200;
  --amber-dark: #e5a54b;

  --shadow-frame-light: 0 28px 70px -24px rgba(16, 25, 35, 0.22), 0 4px 16px -4px rgba(16, 25, 35, 0.08);
  --shadow-frame-dark: 0 32px 84px -20px rgba(0, 0, 0, 0.65), 0 6px 20px -4px rgba(0, 0, 0, 0.45);

  --scrollbar-track-light: #e8e6de;
  --scrollbar-track-dark: #121821;
  --scrollbar-thumb-light: #7c8794;
  --scrollbar-thumb-dark: #49596e;

  /* Default light values for browsers without light-dark() */
  --bg: var(--bg-light);
  --surface: var(--surface-light);
  --surface-elevated: var(--surface-elevated-light);
  --surface-code: var(--surface-code-light);
  --ink: var(--ink-light);
  --ink-muted: var(--ink-muted-light);
  --ink-subtle: var(--ink-subtle-light);
  --border: var(--border-light);
  --border-strong: var(--border-strong-light);
  --accent: var(--accent-light);
  --accent-hover: var(--accent-hover-light);
  --accent-ink: var(--accent-ink-light);
  --accent-soft: var(--accent-soft-light);
  --amber: var(--amber-light);
  --shadow-frame: var(--shadow-frame-light);
  --scrollbar-track: var(--scrollbar-track-light);
  --scrollbar-thumb: var(--scrollbar-thumb-light);

  /* Fallback for browsers without light-dark() */
  @media (prefers-color-scheme: dark) {
    --bg: var(--bg-dark);
    --surface: var(--surface-dark);
    --surface-elevated: var(--surface-elevated-dark);
    --surface-code: var(--surface-code-dark);
    --ink: var(--ink-dark);
    --ink-muted: var(--ink-muted-dark);
    --ink-subtle: var(--ink-subtle-dark);
    --border: var(--border-dark);
    --border-strong: var(--border-strong-dark);
    --accent: var(--accent-dark);
    --accent-hover: var(--accent-hover-dark);
    --accent-ink: var(--accent-ink-dark);
    --accent-soft: var(--accent-soft-dark);
    --amber: var(--amber-dark);
    --shadow-frame: var(--shadow-frame-dark);
    --scrollbar-track: var(--scrollbar-track-dark);
    --scrollbar-thumb: var(--scrollbar-thumb-dark);
  }

  /* Dynamic light-dark() tokens following computed color-scheme */
  @supports (color: light-dark(white, black)) {
    --bg: light-dark(var(--bg-light), var(--bg-dark));
    --surface: light-dark(var(--surface-light), var(--surface-dark));
    --surface-elevated: light-dark(var(--surface-elevated-light), var(--surface-elevated-dark));
    --surface-code: light-dark(var(--surface-code-light), var(--surface-code-dark));
    --ink: light-dark(var(--ink-light), var(--ink-dark));
    --ink-muted: light-dark(var(--ink-muted-light), var(--ink-muted-dark));
    --ink-subtle: light-dark(var(--ink-subtle-light), var(--ink-subtle-dark));
    --border: light-dark(var(--border-light), var(--border-dark));
    --border-strong: light-dark(var(--border-strong-light), var(--border-strong-dark));
    --accent: light-dark(var(--accent-light), var(--accent-dark));
    --accent-hover: light-dark(var(--accent-hover-light), var(--accent-hover-dark));
    --accent-ink: light-dark(var(--accent-ink-light), var(--accent-ink-dark));
    --accent-soft: light-dark(var(--accent-soft-light), var(--accent-soft-dark));
    --amber: light-dark(var(--amber-light), var(--amber-dark));
    --shadow-frame: light-dark(var(--shadow-frame-light), var(--shadow-frame-dark));
    --scrollbar-track: light-dark(var(--scrollbar-track-light), var(--scrollbar-track-dark));
    --scrollbar-thumb: light-dark(var(--scrollbar-thumb-light), var(--scrollbar-thumb-dark));
  }

  /* Typography & layout scale */
  --font-sans: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-serif: "Newsreader", Georgia, "Times New Roman", serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --container-max: 1180px;

  /* MANDATORY: Keep base declaration as light dark and map <meta> override back to CSS */
  color-scheme: light dark;
  accent-color: var(--accent);
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);

  &:has(> head > meta[name="color-scheme"][content="dark"]) {
    color-scheme: dark;
  }

  &:has(> head > meta[name="color-scheme"][content="light"]) {
    color-scheme: light;
  }
}

/* Fallback for browsers supporting scrollbar-color poorly */
@supports not (scrollbar-color: auto) {
  ::-webkit-scrollbar {
    width: 10px;
    height: 10px;
  }

  ::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
  }

  ::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 5px;
  }
}

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

html {
  scroll-behavior: smooth;
  text-size-adjust: 100%;
}

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

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 90% 42% at 50% -8%, var(--accent-soft), transparent 72%);
  background-repeat: no-repeat;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--accent-soft);
  color: var(--ink);
}

a {
  color: var(--accent);
  text-decoration: none;
  text-underline-offset: 3px;
}

a:hover {
  text-decoration: underline;
}

a:focus-visible,
button:focus-visible,
summary:focus-visible,
[tabindex="0"]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

img {
  display: block;
  max-inline-size: 100%;
  block-size: auto;
}

code,
pre {
  font-family: var(--font-mono);
}

.sr-only {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  inset-block-start: -100%;
  inset-inline-start: 1rem;
  z-index: 200;
  padding: 0.6rem 1rem;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: var(--radius-sm);
  font-weight: 600;
}

.skip-link:focus {
  inset-block-start: 1rem;
}

.container {
  inline-size: min(100% - 2.5rem, var(--container-max));
  margin-inline: auto;
}

@media (max-width: 640px) {
  .container {
    inline-size: calc(100% - 1.5rem);
  }
}

/* ==========================================================================
   Sticky Top Navigation
   ========================================================================== */

.site-header {
  position: sticky;
  inset-block-start: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-block-end: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-block-size: 62px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--ink);
  font-weight: 600;
  font-size: 1.02rem;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.brand:hover {
  text-decoration: none;
}

.brand img {
  inline-size: 28px;
  block-size: 28px;
  border-radius: 6px;
}

.brand-version {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--ink-muted);
  padding: 0.12rem 0.45rem;
  border-radius: 4px;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.4rem;
}

.site-nav a {
  color: var(--ink-muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.15s ease;
}

.site-nav a:hover {
  color: var(--ink);
  text-decoration: none;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-block-size: 36px;
  min-inline-size: 36px;
  padding: 0 0.65rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--ink-muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

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

.icon-btn svg {
  inline-size: 16px;
  block-size: 16px;
}

/* Color-scheme toggle branching (non-color markup switched in CSS per dark-mode-toggle) */
.theme-toggle .option-to-light {
  display: none;
}

.theme-toggle .option-to-dark {
  display: inline-flex;
  align-items: center;
}

@media (prefers-color-scheme: dark) {
  :root:not(:has(> head > meta[name="color-scheme"][content="light"])) .theme-toggle .option-to-light {
    display: inline-flex;
    align-items: center;
  }

  :root:not(:has(> head > meta[name="color-scheme"][content="light"])) .theme-toggle .option-to-dark {
    display: none;
  }
}

:root:has(> head > meta[name="color-scheme"][content="dark"]) .theme-toggle .option-to-light {
  display: inline-flex;
  align-items: center;
}

:root:has(> head > meta[name="color-scheme"][content="dark"]) .theme-toggle .option-to-dark {
  display: none;
}

:root:has(> head > meta[name="color-scheme"][content="light"]) .theme-toggle .option-to-light {
  display: none;
}

:root:has(> head > meta[name="color-scheme"][content="light"]) .theme-toggle .option-to-dark {
  display: inline-flex;
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-block-size: 40px;
  padding: 0 1.05rem;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.btn:hover {
  text-decoration: none;
}

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

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

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

.btn-secondary:hover {
  background: var(--surface-elevated);
}

.btn-compact {
  min-block-size: 36px;
  padding: 0 0.85rem;
  font-size: 0.84rem;
}

@media (max-width: 920px) {
  .site-nav {
    display: none;
  }
}

@media (max-width: 560px) {
  .brand-version,
  .header-actions .btn-primary {
    display: none;
  }
}

/* ==========================================================================
   Hero Section
   ========================================================================== */

.hero {
  padding-block: clamp(3rem, 6vw, 4.75rem) clamp(2.5rem, 5vw, 4rem);
}

.hero-copy {
  max-inline-size: 780px;
  margin-inline: auto;
  text-align: center;
}

.hero-eyebrow {
  margin: 0 0 1rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero h1 {
  margin: 0 0 1.15rem;
  font-size: clamp(2.35rem, 5.4vw, 3.85rem);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.035em;
  color: var(--ink);
  text-wrap: balance;
}

.hero h1 em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.015em;
}

.hero-lead {
  margin: 0 auto 1.85rem;
  max-inline-size: 64ch;
  font-size: clamp(1.02rem, 1.5vw, 1.18rem);
  line-height: 1.62;
  color: var(--ink-muted);
  text-wrap: pretty;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-block-end: 2.25rem;
}

/* Concise specification strip (not a dashboard — typographic hairline bar) */
.spec-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-block: 1px solid var(--border);
  margin-block-end: clamp(2.25rem, 4.5vw, 3.25rem);
}

.spec-cell {
  padding: 1rem 1.15rem;
  text-align: left;
}

.spec-cell + .spec-cell {
  border-inline-start: 1px solid var(--border);
}

.spec-value {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.96rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.spec-label {
  display: block;
  margin-block-start: 0.2rem;
  font-size: 0.82rem;
  color: var(--ink-muted);
  line-height: 1.4;
}

@media (max-width: 820px) {
  .spec-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .spec-cell:nth-child(3) {
    border-inline-start: 0;
  }

  .spec-cell:nth-child(n + 3) {
    border-block-start: 1px solid var(--border);
  }
}

@media (max-width: 480px) {
  .spec-strip {
    grid-template-columns: 1fr;
  }

  .spec-cell + .spec-cell {
    border-inline-start: 0;
    border-block-start: 1px solid var(--border);
  }
}

/* Hero Application Frame */
.app-stage {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-frame);
}

.app-stage-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  background: var(--surface-elevated);
  border-block-end: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--ink-muted);
}

.stage-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stage-tag {
  color: var(--accent);
  font-weight: 600;
}

.stage-zoom-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--ink-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 5px;
  cursor: pointer;
  flex-shrink: 0;
}

.stage-zoom-btn:hover {
  color: var(--ink);
  border-color: var(--border-strong);
}

.app-stage-viewport {
  position: relative;
  aspect-ratio: 1440 / 920;
  background: #0e131b;
  cursor: zoom-in;
}

.app-stage-viewport img {
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
}

/* Interactive Theme & View Switcher beneath the window */
.stage-switcher {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border-block-start: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}

.stage-switcher::-webkit-scrollbar {
  display: none;
}

.stage-pill {
  flex: none;
  padding: 0.4rem 0.78rem;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--ink-muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.stage-pill:hover {
  color: var(--ink);
  background: var(--surface-elevated);
}

.stage-pill[aria-pressed="true"] {
  color: var(--ink);
  background: var(--surface-elevated);
  border-color: var(--border-strong);
  box-shadow: inset 0 -2px 0 0 var(--accent);
}

/* ==========================================================================
   Section Framing & Editorial Alternating Spotlights
   ========================================================================== */

.section {
  padding-block: clamp(3.25rem, 6.5vw, 5.25rem);
  border-block-start: 1px solid var(--border);
  scroll-margin-top: 76px;
}

.section-header {
  max-inline-size: 680px;
  margin-block-end: clamp(2rem, 4vw, 3rem);
}

.section-kicker {
  margin: 0 0 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

.section-header h2 {
  margin: 0 0 0.7rem;
  font-size: clamp(1.65rem, 3.2vw, 2.35rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--ink);
  text-wrap: balance;
}

.section-header p {
  margin: 0;
  font-size: 1.02rem;
  color: var(--ink-muted);
  text-wrap: pretty;
}

/* Editorial alternating feature spotlights */
.spotlights {
  display: flex;
  flex-direction: column;
  gap: clamp(3rem, 6vw, 4.75rem);
}

.spotlight {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.18fr);
  align-items: center;
  gap: clamp(1.75rem, 4vw, 3.5rem);
}

.spotlight.reverse .spotlight-media {
  order: -1;
}

.spotlight-copy h3 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.3rem, 2.2vw, 1.65rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.22;
}

.spotlight-copy p {
  margin: 0 0 1.15rem;
  color: var(--ink-muted);
  font-size: 0.97rem;
}

.spotlight-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.55rem;
}

.spotlight-list li {
  position: relative;
  padding-inline-start: 1.15rem;
  font-size: 0.91rem;
  color: var(--ink);
}

.spotlight-list li::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  inset-block-start: 0.62em;
  inline-size: 6px;
  block-size: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.spotlight-media {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color 0.2s ease, transform 0.25s ease;
}

.spotlight-media:hover {
  border-color: var(--border-strong);
}

.media-trigger {
  display: block;
  inline-size: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
  text-align: left;
}

.spotlight-media figcaption {
  padding: 0.65rem 0.9rem;
  border-block-start: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink-muted);
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}

@media (max-width: 900px) {
  .spotlight {
    grid-template-columns: 1fr;
  }

  .spotlight.reverse .spotlight-media {
    order: 0;
  }
}

/* ==========================================================================
   Curated Screenshot Gallery Grid
   ========================================================================== */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.15rem;
}

.gallery-card {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color 0.18s ease, transform 0.2s ease;
}

.gallery-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.gallery-card img {
  aspect-ratio: 1440 / 920;
  object-fit: cover;
}

.gallery-card figcaption {
  padding: 0.65rem 0.85rem;
  border-block-start: 1px solid var(--border);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

.gallery-title {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink);
}

.gallery-sub {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-subtle);
}

@media (max-width: 900px) {
  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .gallery-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Architecture Pipeline Flow
   ========================================================================== */

.pipeline {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.85rem;
  margin-block-end: 2rem;
}

.pipeline-step {
  position: relative;
  padding: 1.1rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.pipeline-index {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent);
  margin-block-end: 0.4rem;
}

.pipeline-step h3 {
  margin: 0 0 0.35rem;
  font-size: 0.94rem;
  font-weight: 600;
  color: var(--ink);
}

.pipeline-step p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--ink-muted);
  line-height: 1.48;
}

@media (max-width: 980px) {
  .pipeline {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .pipeline {
    grid-template-columns: 1fr;
  }
}

.arch-note {
  padding: 1.1rem 1.25rem;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  color: var(--ink-muted);
}

.arch-note strong {
  color: var(--ink);
}

/* ==========================================================================
   Responsive Hardware & ARM64 Table (@container per responsive-table guide)
   ========================================================================== */

.table-wrapper {
  overflow: auto;
  max-inline-size: 100%;
  max-block-size: min(620px, 78vh);
  container-type: inline-size;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.hw-table {
  inline-size: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.88rem;
  text-align: left;
}

.hw-table caption {
  padding: 0.85rem 1.1rem;
  text-align: left;
  font-size: 0.82rem;
  font-family: var(--font-mono);
  color: var(--ink-muted);
  background: var(--surface-elevated);
  border-block-end: 1px solid var(--border);
}

.hw-table thead {
  position: sticky;
  inset-block-start: 0;
  z-index: 2;
}

.hw-table thead th {
  padding: 0.78rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
  background: var(--surface-elevated);
  border-block-end: 1px solid var(--border-strong);
  white-space: nowrap;
}

.hw-table tbody th,
.hw-table tbody td {
  padding: 0.85rem 1rem;
  border-block-end: 1px solid var(--border);
  vertical-align: top;
}

.hw-table tbody tr:last-child th,
.hw-table tbody tr:last-child td {
  border-block-end: 0;
}

.hw-table tbody th {
  position: sticky;
  inset-inline-start: 0;
  z-index: 1;
  font-weight: 600;
  color: var(--ink);
  background: var(--surface);
  min-inline-size: 210px;
}

.hw-table tbody td {
  color: var(--ink-muted);
}

.hw-table code {
  font-size: 0.8rem;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  background: var(--surface-elevated);
  color: var(--ink);
}

.arch-tag {
  display: inline-block;
  margin-inline-start: 0.35rem;
  padding: 0.08rem 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--accent);
  vertical-align: middle;
}

.arch-tag-x86 {
  background: var(--surface-elevated);
  color: var(--ink-muted);
}

@container (width < 680px) {
  .hw-table,
  .hw-table thead,
  .hw-table tbody,
  .hw-table tr,
  .hw-table th,
  .hw-table td {
    display: block;
  }

  .hw-table thead {
    /* MANDATORY: Hide column header from layout and screen readers in stacked mode */
    display: none;
  }

  .hw-table tbody tr {
    border-block-end: 1px solid var(--border-strong);
    padding-block-end: 0.5rem;
  }

  .hw-table tbody th {
    position: sticky;
    inset-block-start: 0;
    z-index: 2;
    background: var(--surface-elevated);
    border-block-end: 1px solid var(--border);
    min-inline-size: 0;
  }

  .hw-table tbody td {
    border-block-end: 0;
    padding-block: 0.45rem;
  }

  .hw-table tbody td:nth-child(2)::before {
    content: var(--col-2, "Vulkan / GPU") ": ";
    font-family: var(--font-mono);
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--ink);
  }

  .hw-table tbody td:nth-child(3)::before {
    content: var(--col-3, "Local AI (ONNX)") ": ";
    font-family: var(--font-mono);
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--ink);
  }
}

/* ==========================================================================
   Install Tabs (following tabs guide strictly)
   ========================================================================== */

.tabs-shell {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.tablist-scroller {
  display: flex;
  align-items: center;
  overflow-x: auto;
  scroll-snap-type: inline proximity;
  scroll-padding-inline: 2.5rem;
  border-block-end: 1px solid var(--border);
  background: var(--surface-elevated);
  scrollbar-width: none;
  --fade-size: 2.5rem;
  --fade-dir: right;
  --fade-start-pos: 0;
  --fade-end-pos: 100%;
  mask:
    linear-gradient(black, black) no-clip subtract,
    linear-gradient(to var(--fade-dir), black, transparent) var(--fade-start-pos) 0 / var(--fade-start) 100% no-repeat no-clip,
    linear-gradient(to var(--fade-dir), transparent, black) var(--fade-end-pos) 0 / var(--fade-end) 100% no-repeat no-clip;
  animation: reveal-fade-start linear both, hide-fade-end linear both;
  animation-timeline: scroll(self inline);
  animation-range: 0 var(--fade-size), calc(100% - var(--fade-size)) 100%;
}

.tablist-scroller::-webkit-scrollbar {
  display: none;
}

@keyframes reveal-fade-start {
  to {
    --fade-start: var(--fade-size);
  }
}

@keyframes hide-fade-end {
  from {
    --fade-end: var(--fade-size);
  }
}

.tablist-scroller.more-start {
  --fade-start: var(--fade-size);
}

.tablist-scroller.more-end {
  --fade-end: var(--fade-size);
}

.tablist-scroller [role="tab"],
.tablist-scroller button {
  position: relative;
  flex: none;
  scroll-snap-align: start;
  padding: 0.85rem 1.2rem;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink-muted);
  background: transparent;
  border: 0;
  cursor: pointer;
  white-space: nowrap;
}

.tablist-scroller button:hover {
  color: var(--ink);
}

/* Style selected tab from aria-selected with non-color underline (border, not box-shadow) */
.tablist-scroller button[aria-selected="true"] {
  color: var(--accent);
}

.tablist-scroller button[aria-selected="true"]::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  border-block-end: 2.5px solid var(--accent);
}

/* Stack panels in same grid cell; NO padding/border/background on [role="tabpanel"] itself */
.tabpanels-stack {
  display: grid;
}

.tabpanels-stack > [role="tabpanel"] {
  grid-area: 1 / 1;
}

.panel-inner {
  padding: 1.35rem 1.45rem;
}

.panel-inner p {
  margin: 0 0 1rem;
  font-size: 0.93rem;
  color: var(--ink-muted);
}

/* Code blocks (always crisp dark terminal surface) */
.code-block {
  position: relative;
  color-scheme: dark;
  background: var(--surface-code);
  color: #e6edf3;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.85rem;
  border-block-end: 1px solid rgba(255, 255, 255, 0.07);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: #8b99ab;
}

.copy-btn {
  padding: 0.22rem 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: #d0dae6;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.copy-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.code-block pre {
  margin: 0;
  padding: 0.95rem 1.05rem;
  overflow-x: auto;
  font-size: 0.84rem;
  line-height: 1.58;
}

.code-block .comment {
  color: #7c8c9e;
}

/* ==========================================================================
   Omarchy 4.6 Integration Cards (2x2 clean grid, zero over-nesting)
   ========================================================================== */

.omarchy-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.15rem;
}

.omarchy-card {
  padding: 1.35rem 1.4rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.omarchy-card h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.omarchy-card p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--ink-muted);
}

.omarchy-card .code-block {
  margin-block-start: auto;
}

@media (max-width: 780px) {
  .omarchy-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Native Details Accordion (following accordion guide strictly)
   ========================================================================== */

.accordion {
  display: flex;
  flex-direction: column;
  border-block-start: 1px solid var(--border);
}

.accordion details {
  border-block-end: 1px solid var(--border);
}

.accordion summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 1.1rem 0.25rem;
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
}

.accordion summary::-webkit-details-marker {
  display: none;
}

.accordion summary::before {
  content: "";
  inline-size: 1em;
  block-size: 1em;
  flex-shrink: 0;
  background-color: var(--accent);
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='black' d='M4.2 5.7a.75.75 0 0 1 1.06 0L8 8.44l2.74-2.74a.75.75 0 1 1 1.06 1.06l-3.27 3.27a.75.75 0 0 1-1.06 0L4.2 6.76a.75.75 0 0 1 0-1.06Z'/%3E%3C/svg%3E") no-repeat center / contain;
  rotate: -90deg;
}

.accordion details[open] > summary::before {
  rotate: 0deg;
}

@media (prefers-reduced-motion: no-preference) {
  .accordion summary::before {
    transition: rotate 0.2s ease;
  }
}

.accordion details::details-content {
  interpolate-size: allow-keywords;
  overflow: clip;
  contain: layout;
}

.accordion details:not([open])::details-content {
  block-size: 0;
}

@media (prefers-reduced-motion: no-preference) {
  .accordion details::details-content {
    transition: block-size 0.26s ease, content-visibility 0.26s ease, display 0.26s ease;
    transition-behavior: allow-discrete;
  }
}

.accordion-body {
  padding: 0 0.25rem 1.2rem 1.7rem;
  font-size: 0.92rem;
  color: var(--ink-muted);
  max-inline-size: 76ch;
}

.accordion-body p {
  margin: 0 0 0.65rem;
}

.accordion-body p:last-child {
  margin-block-end: 0;
}

/* ==========================================================================
   Native Modal Lightbox Dialog (light-dismiss + prevent-page-scroll guides)
   ========================================================================== */

dialog.lightbox {
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--ink);
  max-inline-size: min(94vw, 1340px);
  max-block-size: 92vh;
  box-shadow: var(--shadow-frame);
}

dialog.lightbox:modal {
  /* MANDATORY: Prevent scroll gestures inside modal from chaining to page */
  overscroll-behavior: contain;
}

dialog.lightbox::backdrop {
  background: rgba(6, 10, 16, 0.78);
  backdrop-filter: blur(6px);
  /* MANDATORY: Turn ::backdrop into non-scrollable scroll container to block page scroll */
  overflow: hidden;
  overscroll-behavior: contain;
}

.lightbox-shell {
  display: flex;
  flex-direction: column;
}

.lightbox-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 1rem;
  background: var(--surface-elevated);
  border-block-end: 1px solid var(--border);
}

.lightbox-title {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
}

.lightbox-controls {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.lightbox-img-wrap {
  background: #0b0f16;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
}

.lightbox-img-wrap img {
  max-block-size: calc(92vh - 96px);
  inline-size: auto;
  block-size: auto;
}

.lightbox-caption {
  padding: 0.6rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--ink-muted);
  border-block-start: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

/* ==========================================================================
   Scroll-Driven Reveal Progressive Enhancement (scroll-entry-exit-effects)
   ========================================================================== */

@media (prefers-reduced-motion: no-preference) {
  @supports ((animation-timeline: view()) and (animation-range: entry)) {
    @keyframes reveal-up {
      from {
        opacity: 0.08;
        transform: translateY(18px);
      }
      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    .reveal {
      animation: reveal-up auto linear backwards;
      animation-timeline: view();
      animation-range: entry 0% entry 32%;
    }
  }
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  border-block-start: 1px solid var(--border);
  padding-block: 2.5rem 3rem;
  font-size: 0.86rem;
  color: var(--ink-muted);
}

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

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
}

.footer-links a {
  color: var(--ink-muted);
}

.footer-links a:hover {
  color: var(--ink);
}
