:root {
  color-scheme: light dark;

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

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

  /* Fonts (strictly 2 families) */
  --font-sans: "Outfit", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* 3-size body typography scale */
  --text-heading: 1.5rem;
  --text-body: 1rem;
  --text-sm: 0.875rem;

  /* Core palette (light / dark via light-dark) */
  --bg: light-dark(#efefef, #0a0a0a);
  --surface: light-dark(#e7e6e4, #171718);
  --surface-raised-top: light-dark(#f6f6f5, #222224);
  --surface-raised-bottom: light-dark(#dcdbd8, #141416);
  --surface-recess: light-dark(#deddd9, #121213);
  --ink: light-dark(#171717, #f5f5f5);
  --ink-muted: light-dark(#525252, #a1a1a1);
  --rule: light-dark(rgb(23 23 23 / 0.1), rgb(245 245 245 / 0.12));

  /* Tactile lighting tokens (consistent top-left studio key light) */
  --rim-light: light-dark(rgb(255 255 255 / 0.92), rgb(255 255 255 / 0.14));
  --rim-edge: light-dark(rgb(0 0 0 / 0.06), rgb(0 0 0 / 0.6));
  --cast-shadow: light-dark(
    0 1px 1px rgb(34 31 28 / 0.06),
    0 8px 18px rgb(34 31 28 / 0.09),
    0 22px 42px rgb(34 31 28 / 0.08),
    0 12px 26px rgb(0 0 0 / 0.52)
  );
  --cast-shadow-sm: light-dark(
    0 2px 5px rgb(34 31 28 / 0.09),
    0 6px 14px rgb(0 0 0 / 0.45)
  );
  --recess-shadow: light-dark(
    inset 0 2px 6px rgb(34 31 28 / 0.14),
    inset 0 2px 8px rgb(0 0 0 / 0.72)
  );
  --recess-catchlight: light-dark(
    inset 0 -1px 0 rgb(255 255 255 / 0.75),
    inset 0 -1px 0 rgb(255 255 255 / 0.08)
  );

  /* Signature hardware accent */
  --accent: #ff6e00;
  --accent-track: #e47742;
  --led-red: #ff3529;
  --code-accent: light-dark(#255ba8, #8dbaff);

  /* Motion */
  --ease-tactile: cubic-bezier(0.22, 1, 0.36, 1);
  --radius-card: 22px;
  --radius-key: 12px;
  --radius-pill: 999px;
}

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

html {
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: 16px;
  line-height: 1.55;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  min-height: 100dvh;
  background-color: var(--bg);
  color: var(--ink);
  transition-property: background-color, color;
  transition-duration: 220ms;
  transition-timing-function: var(--ease-tactile);
}

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

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

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.container {
  width: min(72rem, 100%);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 2.5rem);
}

/* =========================
   Header (Single-line minimal)
   ========================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background-color: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition-property: border-color, background-color;
  transition-duration: 180ms;
  transition-timing-function: var(--ease-tactile);
}

.site-header.is-scrolled {
  border-bottom-color: var(--rule);
}

.header-inner {
  min-height: 5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.nav-left,
.nav-right {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2.5vw, 2rem);
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: -0.04em;
  color: var(--ink);
}

.brand-svg {
  width: 3.4rem;
  height: 1.35rem;
  display: block;
}

.nav-link {
  font-size: var(--text-sm);
  font-weight: 400;
  color: var(--ink-muted);
  transition-property: color;
  transition-duration: 160ms;
  transition-timing-function: var(--ease-tactile);
}

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

.icon-link,
.creator-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.creator-avatar,
.card-avatar,
.dialog-avatar,
.footer-avatar {
  border-radius: 50%;
  object-fit: cover;
  display: block;
  box-shadow:
    0 0 0 2px var(--surface-raised-top),
    0 2px 6px rgb(0 0 0 / 0.16);
}

.creator-avatar {
  width: 28px;
  height: 28px;
}

.card-avatar {
  width: 20px;
  height: 20px;
}

.dialog-avatar {
  width: 34px;
  height: 34px;
}

.footer-avatar {
  width: 52px;
  height: 52px;
}

.footer-creator {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 1.75rem;
  text-align: left;
}

.footer-creator-meta {
  display: grid;
  gap: 0.15rem;
}

.footer-creator-name {
  font-size: var(--text-body);
  font-weight: 500;
  color: var(--ink);
}

.footer-creator-role {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--ink-muted);
}

.creator-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 3px 12px 3px 3px;
  border-radius: var(--radius-pill);
  font-size: var(--text-sm);
  font-weight: 400;
  color: var(--ink);
  background: linear-gradient(155deg, var(--surface-raised-top), var(--surface-raised-bottom));
  box-shadow:
    inset 1px 1px 0 var(--rim-light),
    inset -1px -1px 0 var(--rim-edge),
    var(--cast-shadow-sm);
  transition-property: transform;
  transition-duration: 140ms;
  transition-timing-function: var(--ease-tactile);
}

.creator-pill:hover {
  transform: translateY(-1px);
}

.creator-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.creator-handle {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--ink-muted);
}

/* =========================
   Tactile Ceramic Primitives
   ========================= */
.ceramic-surface {
  background: linear-gradient(155deg, var(--surface-raised-top), var(--surface-raised-bottom));
  box-shadow:
    inset 1px 1px 0 var(--rim-light),
    inset -1px -1px 0 var(--rim-edge),
    var(--cast-shadow);
}

.ceramic-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 0;
  border-radius: var(--radius-pill);
  padding: 0.65rem 1.35rem;
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  background: linear-gradient(155deg, var(--surface-raised-top), var(--surface-raised-bottom));
  box-shadow:
    inset 1px 1px 0 var(--rim-light),
    inset -1px -1px 0 var(--rim-edge),
    var(--cast-shadow-sm);
  transition-property: transform, box-shadow, color;
  transition-duration: 120ms;
  transition-timing-function: var(--ease-tactile);
}

.ceramic-btn:hover {
  transform: translateY(-1px);
}

.ceramic-btn:active {
  transform: translateY(1.5px) scale(0.985);
}

.ceramic-btn--accent {
  background: linear-gradient(155deg, #ff7e1c, #e55e00);
  color: #ffffff;
  box-shadow:
    inset 1px 1px 0 rgb(255 255 255 / 0.42),
    0 6px 18px rgb(255 110 0 / 0.28);
}

.recess-track {
  background: var(--surface-recess);
  box-shadow: var(--recess-shadow), var(--recess-catchlight);
}

/* Segmented Theme / Filter Pill */
.segmented {
  display: inline-flex;
  align-items: center;
  padding: 4px;
  border-radius: var(--radius-pill);
  gap: 2px;
}

.segmented-item {
  border: 0;
  background: transparent;
  color: var(--ink-muted);
  font-size: var(--text-sm);
  font-weight: 400;
  padding: 0.42rem 0.95rem;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition-property: color, background-color, box-shadow, transform;
  transition-duration: 150ms;
  transition-timing-function: var(--ease-tactile);
}

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

.segmented-item[aria-selected="true"],
.segmented-item[aria-pressed="true"] {
  color: var(--ink);
  font-weight: 500;
  background: linear-gradient(155deg, var(--surface-raised-top), var(--surface-raised-bottom));
  box-shadow:
    inset 1px 1px 0 var(--rim-light),
    0 2px 6px rgb(0 0 0 / 0.14);
}

/* Theme toggle icon visibility */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 0;
  padding: 0.42rem 0.85rem;
  border-radius: var(--radius-pill);
  font-size: var(--text-sm);
  cursor: pointer;
  background: linear-gradient(155deg, var(--surface-raised-top), var(--surface-raised-bottom));
  box-shadow:
    inset 1px 1px 0 var(--rim-light),
    inset -1px -1px 0 var(--rim-edge),
    var(--cast-shadow-sm);
  transition-property: transform;
  transition-duration: 120ms;
  transition-timing-function: var(--ease-tactile);
}

.theme-toggle:active {
  transform: translateY(1px);
}

.theme-icon-dark {
  display: none;
}

@media (prefers-color-scheme: dark) {
  :root:not(:has(> head > meta[name="color-scheme"][content="light"])) .theme-icon-light {
    display: none;
  }
  :root:not(:has(> head > meta[name="color-scheme"][content="light"])) .theme-icon-dark {
    display: inline-flex;
  }
}

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

:root:has(> head > meta[name="color-scheme"][content="dark"]) .theme-icon-dark {
  display: inline-flex;
}

/* =========================
   Hero & Signature Vibe Deck 01
   ========================= */
.hero {
  padding-block: clamp(1.5rem, 3.8vw, 2.75rem) clamp(2.5rem, 6vw, 4.5rem);
  text-align: center;
}

.hero-wordmark {
  margin: 0 auto 0.4rem;
  width: clamp(9rem, 19vw, 13.5rem);
  height: auto;
  display: block;
}

.hero-title {
  margin: 0;
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 300;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.hero-lead {
  margin: 0.85rem auto clamp(1.5rem, 3.2vw, 2.25rem);
  max-width: 42ch;
  font-size: var(--text-body);
  color: var(--ink-muted);
  text-wrap: balance;
}

/* Two-module industrial hardware deck (modeled on oyn's Field Recorder) */
.vibe-deck {
  width: min(86vw, 100%, 54rem);
  margin-inline: auto;
  display: grid;
  grid-template-columns: 408fr 496fr;
  gap: clamp(0.6rem, 1.4vw, 1rem);
  container-type: inline-size;
  text-align: left;
  position: relative;
}

.deck-module {
  position: relative;
  border-radius: clamp(16px, 2.6cqi, 26px);
  padding: clamp(12px, 2.2cqi, 22px);
  background:
    radial-gradient(circle at 18% 12%, rgb(255 255 255 / 0.55), transparent 52%),
    linear-gradient(148deg, #e1e0de 0%, #c6c5c2 55%, #b1b0ad 100%);
  color: #1c1b1a;
  box-shadow:
    inset 1.5px 1.5px 0 rgb(255 255 255 / 0.78),
    inset -1.5px -1.5px 0 rgb(40 37 33 / 0.16),
    0 24px 52px rgb(34 31 28 / 0.22),
    0 6px 14px rgb(34 31 28 / 0.14);
}

/* Subtle metallic grain overlay */
.deck-module::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0.22;
  pointer-events: none;
  background-image: radial-gradient(rgb(0 0 0 / 0.18) 0.55px, transparent 0.55px);
  background-size: 3px 3px;
}

/* Left module: Ceramic Rotary Jog Wheel */
.deck-rotor-module {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}

.rotor-well {
  width: 92%;
  height: 92%;
  border-radius: 50%;
  padding: 2.5%;
  background: linear-gradient(145deg, #989692, #d4d3d0);
  box-shadow: inset 0 3px 8px rgb(34 31 28 / 0.34);
  display: grid;
  place-items: center;
}

.rotor-wheel {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 0;
  padding: 0;
  cursor: grab;
  background: radial-gradient(circle at 32% 28%, #ffffff 0%, #f1f0ee 58%, #d9d8d5 100%);
  box-shadow:
    inset 2px 2px 3px rgb(255 255 255 / 0.95),
    inset -2px -3px 6px rgb(40 37 33 / 0.14),
    0 10px 22px rgb(34 31 28 / 0.24);
  transition-property: transform;
  transition-duration: 380ms;
  transition-timing-function: var(--ease-tactile);
}

.rotor-wheel:active {
  cursor: grabbing;
}

.rotor-ridge {
  position: absolute;
  background: linear-gradient(145deg, #fcfcfb, #e4e3e0);
  border-radius: 999px;
  box-shadow:
    inset 1px 1px 0 #ffffff,
    0 2px 5px rgb(34 31 28 / 0.18);
  pointer-events: none;
}

.rotor-ridge--top {
  width: 7%;
  height: 31%;
  top: 7%;
  left: 46.5%;
}

.rotor-ridge--bottom {
  width: 7%;
  height: 31%;
  bottom: 7%;
  left: 46.5%;
}

.rotor-ridge--left {
  height: 7%;
  width: 31%;
  left: 7%;
  top: 46.5%;
}

.rotor-ridge--right {
  height: 7%;
  width: 31%;
  right: 7%;
  top: 46.5%;
}

.rotor-indicator {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  top: 11.5%;
  left: calc(50% - 3px);
  box-shadow: 0 0 6px rgb(255 110 0 / 0.5);
  pointer-events: none;
}

/* Right module: OLED Display + Ceramic Keys + Hardware Switch */
.deck-panel-module {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: clamp(8px, 1.5cqi, 14px);
}

.oled-bay {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: clamp(8px, 1.4cqi, 14px);
  align-items: stretch;
}

.oled-screen {
  border-radius: clamp(8px, 1.2cqi, 12px);
  background: linear-gradient(180deg, #313634 0%, #242827 100%);
  color: #dee7e7;
  padding: clamp(8px, 1.4cqi, 13px) clamp(10px, 1.6cqi, 16px);
  box-shadow:
    inset 0 2px 7px rgb(0 0 0 / 0.65),
    0 1px 0 rgb(255 255 255 / 0.55);
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 12px;
  align-items: center;
  min-height: clamp(66px, 9.8cqi, 92px);
  overflow: hidden;
}

.oled-meta {
  display: grid;
  gap: 3px;
  border-right: 1px solid rgb(255 110 0 / 0.55);
  padding-right: 10px;
}

.oled-slot {
  font-family: var(--font-mono);
  font-size: clamp(12px, 1.35cqi, 13px);
  letter-spacing: 0.04em;
  color: #dee7e7;
}

.oled-sub {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #93a09e;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.oled-visual {
  position: relative;
  width: 100%;
  height: clamp(50px, 7.6cqi, 72px);
  border-radius: 6px;
  overflow: hidden;
  background: #1b1f1e;
}

.oled-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: contrast(1.06) saturate(0.92);
}

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

.deck-controls-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: clamp(8px, 1.4cqi, 14px);
}

.key-bed {
  background: #3d3b38;
  border-radius: clamp(10px, 1.4cqi, 14px);
  padding: 5px;
  box-shadow:
    inset 0 2px 5px rgb(0 0 0 / 0.55),
    0 1px 0 rgb(255 255 255 / 0.5);
  display: grid;
  gap: 5px;
}

.key-row-top {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 5px;
}

.key-row-bottom {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 5px;
}

.deck-key {
  position: relative;
  border: 0;
  border-radius: clamp(7px, 1cqi, 10px);
  background: linear-gradient(155deg, #ecebe9 0%, #d2d1ce 100%);
  color: #54524f;
  font-family: var(--font-mono);
  font-size: clamp(12px, 1.35cqi, 13px);
  cursor: pointer;
  display: grid;
  place-items: center;
  min-height: clamp(44px, 7cqi, 64px);
  box-shadow:
    inset 1px 1px 0 rgb(255 255 255 / 0.92),
    inset -1px -1px 0 rgb(0 0 0 / 0.12),
    0 3px 6px rgb(0 0 0 / 0.28);
  transition-property: transform, box-shadow, color;
  transition-duration: 85ms;
  transition-timing-function: var(--ease-tactile);
}

.deck-key::after {
  content: "";
  position: absolute;
  width: 58%;
  height: 58%;
  border-radius: 50%;
  background: radial-gradient(circle at 65% 65%, rgb(255 255 255 / 0.45), rgb(0 0 0 / 0.06));
  pointer-events: none;
}

.deck-key:hover {
  color: #171717;
}

.deck-key:active {
  transform: translateY(1.5px) scale(0.98);
  box-shadow:
    inset 0 2px 4px rgb(0 0 0 / 0.16),
    0 1px 2px rgb(0 0 0 / 0.25);
}

.deck-key[aria-pressed="true"] {
  color: #171717;
  font-weight: 500;
  background: linear-gradient(155deg, #ffffff 0%, #dfdedb 100%);
}

.deck-key--tall {
  min-height: clamp(82px, 14cqi, 128px);
}

.deck-key--launch .led-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--led-red);
  box-shadow: 0 0 10px rgb(255 53 41 / 0.55);
  z-index: 1;
}

.deck-key--launch .key-caption {
  position: absolute;
  bottom: 10px;
  font-size: 11px;
  letter-spacing: 0.05em;
  color: #54524f;
  z-index: 1;
}

.deck-side-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding-block: 6px 4px;
  min-width: clamp(44px, 6.2cqi, 58px);
}

.hw-switch-wrap {
  display: grid;
  justify-items: center;
  gap: 5px;
}

.hw-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: #555350;
}

.hw-switch {
  width: 44px;
  height: 24px;
  border-radius: 999px;
  border: 0;
  padding: 2px;
  cursor: pointer;
  background: #8f8e8b;
  box-shadow: inset 0 2px 4px rgb(0 0 0 / 0.38);
  display: flex;
  align-items: center;
  transition-property: background-color;
  transition-duration: 160ms;
  transition-timing-function: var(--ease-tactile);
}

.hw-switch[aria-checked="true"] {
  background: var(--accent-track);
}

.hw-switch-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(145deg, #f6f5f3, #d2d1ce);
  box-shadow: inset 1px 1px 0 #ffffff, 0 2px 4px rgb(0 0 0 / 0.3);
  transform: translateX(0);
  transition-property: transform;
  transition-duration: 160ms;
  transition-timing-function: var(--ease-tactile);
}

.hw-switch[aria-checked="true"] .hw-switch-thumb {
  transform: translateX(20px);
}

.etched-logo {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: clamp(14px, 2cqi, 18px);
  letter-spacing: -0.04em;
  color: rgb(62 60 57 / 0.42);
  writing-mode: vertical-rl;
  user-select: none;
}

/* =========================
   Editorial Interstitial (oyn signature)
   ========================= */
.interstitial {
  padding-block: clamp(2rem, 5vw, 4rem);
  text-align: center;
}

.interstitial-copy {
  margin: 0 auto;
  max-width: 44ch;
  font-size: clamp(1.05rem, 1.8vw, 1.35rem);
  line-height: 1.65;
  color: var(--ink);
  text-wrap: balance;
}

.interstitial-copy + .interstitial-copy {
  margin-top: 1.25rem;
  color: var(--ink-muted);
  font-size: var(--text-body);
}

.inline-switch {
  display: inline-flex;
  vertical-align: middle;
  margin-inline: 0.35rem;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  border: 0;
  padding: 3px;
  cursor: pointer;
  background: var(--accent);
  box-shadow: inset 0 2px 4px rgb(0 0 0 / 0.25);
  transition-property: background-color;
  transition-duration: 160ms;
  transition-timing-function: var(--ease-tactile);
}

.inline-switch[aria-checked="false"] {
  background: var(--ink-muted);
}

.inline-switch-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.3);
  transform: translateX(18px);
  transition-property: transform;
  transition-duration: 160ms;
  transition-timing-function: var(--ease-tactile);
}

.inline-switch[aria-checked="false"] .inline-switch-thumb {
  transform: translateX(0);
}

.code-strike {
  font-family: var(--font-mono);
  font-size: 0.92em;
  color: var(--code-accent);
  padding-inline: 0.15em;
  background: linear-gradient(currentColor, currentColor) 0 54% / 100% 1px no-repeat;
}

/* =========================
   Store Catalog Gallery
   ========================= */
.store-section {
  padding-block: clamp(2.5rem, 6vw, 5rem);
}

.store-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: clamp(2rem, 4vw, 3rem);
}

.section-heading {
  margin: 0;
  font-size: var(--text-heading);
  font-weight: 400;
  letter-spacing: -0.025em;
}

.toolbar-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.search-recess {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.42rem 0.95rem;
  border-radius: var(--radius-pill);
  min-width: 14rem;
}

.search-recess input {
  border: 0;
  background: transparent;
  font-size: var(--text-sm);
  width: 100%;
  outline: none;
}

.search-recess input::placeholder {
  color: var(--ink-muted);
}

.app-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.25rem, 2.5vw, 2rem);
}

.app-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-card);
  padding: 1.15rem;
  cursor: pointer;
  border: 0;
  text-align: left;
  transition-property: transform, box-shadow;
  transition-duration: 180ms;
  transition-timing-function: var(--ease-tactile);
}

.app-card:hover {
  transform: translateY(-3px);
}

.app-card:active {
  transform: translateY(0) scale(0.99);
}

.app-stage {
  position: relative;
  aspect-ratio: 16 / 10;
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(180deg, #2b2f2e 0%, #1f2322 100%);
  box-shadow: inset 0 2px 8px rgb(0 0 0 / 0.55);
  margin-bottom: 1rem;
}

.app-stage canvas,
.app-stage img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition-property: transform;
  transition-duration: 240ms;
  transition-timing-function: var(--ease-tactile);
}

.app-card:hover .app-stage img {
  transform: scale(1.03);
}

.app-slot-num {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgb(16 18 18 / 0.62);
  backdrop-filter: blur(6px);
  font-family: var(--font-mono);
  font-size: 12px;
  color: #f0f4f4;
  pointer-events: none;
}

.app-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.app-card-title {
  margin: 0;
  font-size: var(--text-body);
  font-weight: 500;
  letter-spacing: -0.015em;
  color: var(--ink);
}

.app-card-cat {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--ink-muted);
  white-space: nowrap;
}

.app-card-desc {
  margin: 0 0 0.85rem;
  font-size: var(--text-sm);
  color: var(--ink-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.app-card-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--text-sm);
  color: var(--ink-muted);
  padding-top: 0.75rem;
  border-top: 1px solid var(--rule);
}

.app-card-cta {
  color: var(--accent);
  font-weight: 500;
}

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem 1rem;
  color: var(--ink-muted);
  font-size: var(--text-body);
}

/* =========================
   Submit & GitHub Pages Guide
   ========================= */
.docs-section {
  padding-block: clamp(3rem, 7vw, 5.5rem);
  border-top: 1px solid var(--rule);
}

.docs-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

.docs-copy p {
  margin: 0.85rem 0 0;
  max-width: 52ch;
  font-size: var(--text-body);
  color: var(--ink-muted);
}

.steps-list {
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.9rem;
}

.steps-list li {
  font-size: var(--text-body);
  color: var(--ink);
  display: flex;
  gap: 0.75rem;
  align-items: baseline;
}

.step-num {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--accent);
}

.code-well {
  border-radius: var(--radius-card);
  padding: 1.35rem 1.5rem;
  overflow-x: auto;
}

.code-well-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--ink-muted);
}

.code-well pre {
  margin: 0;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  line-height: 1.65;
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
}

/* =========================
   Footer (oyn gradient fade ending)
   ========================= */
.site-footer {
  padding-block: clamp(3.5rem, 8vw, 6rem) clamp(2.5rem, 5vw, 4rem);
  text-align: center;
  border-top: 1px solid var(--rule);
}

.footer-creator {
  display: grid;
  justify-items: center;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.footer-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  padding: 3px;
}

.footer-statement {
  margin: 0 0 0.5rem;
  font-size: clamp(1.75rem, 4vw, 3rem);
  font-weight: 300;
  letter-spacing: -0.03em;
  background: linear-gradient(180deg, var(--ink) 18%, color-mix(in srgb, var(--ink) 42%, transparent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.footer-note {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--ink-muted);
}

/* =========================
   Playable App Modal (<dialog>)
   Modern Web Guidance compliant
   ========================= */
dialog.app-dialog {
  width: min(64rem, calc(100vw - 2rem));
  max-width: none;
  max-height: calc(100dvh - 2rem);
  padding: 0;
  border: 0;
  border-radius: var(--radius-card);
  background: var(--bg);
  color: var(--ink);
  box-shadow: 0 32px 80px rgb(0 0 0 / 0.42);
  overflow: auto;
  opacity: 0;
  transition-property: opacity, transform, display, overlay;
  transition-duration: 220ms;
  transition-timing-function: var(--ease-tactile);
  transition-behavior: allow-discrete;
}

@media (prefers-reduced-motion: no-preference) {
  dialog.app-dialog {
    transform: translateY(10px) scale(0.97);
  }
}

dialog.app-dialog:modal {
  overscroll-behavior: contain;
}

dialog.app-dialog::backdrop {
  background-color: rgb(10 10 10 / 0);
  backdrop-filter: blur(0px);
  overflow: hidden;
  overscroll-behavior: contain;
  transition-property: background-color, backdrop-filter, display, overlay;
  transition-duration: 220ms;
  transition-timing-function: var(--ease-tactile);
  transition-behavior: allow-discrete;
}

dialog.app-dialog[open]:where(:not([data-closing])) {
  opacity: 1;

  @starting-style {
    opacity: 0;
  }

  @media (prefers-reduced-motion: no-preference) {
    transform: translateY(0) scale(1);

    @starting-style {
      transform: translateY(10px) scale(0.97);
    }
  }

  &::backdrop {
    background-color: rgb(10 10 10 / 0.56);
    backdrop-filter: blur(6px);

    @starting-style {
      background-color: rgb(10 10 10 / 0);
      backdrop-filter: blur(0px);
    }
  }
}

.dialog-shell {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: min(78dvh, 44rem);
}

.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.35rem;
  border-bottom: 1px solid var(--rule);
}

.dialog-title-group {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.dialog-title {
  margin: 0;
  font-size: var(--text-heading);
  font-weight: 400;
  letter-spacing: -0.02em;
}

.dialog-meta {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--ink-muted);
}

.dialog-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.dialog-stage {
  padding: 1rem 1.35rem;
  display: grid;
}

.dialog-frame-wrap {
  border-radius: 14px;
  overflow: hidden;
  min-height: min(56dvh, 32rem);
  background: #1e2120;
  box-shadow: var(--recess-shadow);
}

.dialog-frame {
  width: 100%;
  height: 100%;
  min-height: min(56dvh, 32rem);
  border: 0;
  display: block;
}

.dialog-footer {
  padding: 1rem 1.35rem 1.25rem;
  border-top: 1px solid var(--rule);
  display: grid;
  gap: 0.4rem;
}

.dialog-prompt-label {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--accent);
}

.dialog-prompt-text {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--ink-muted);
  max-width: 72ch;
}

/* =========================
   Wireframe / Material-Off Mode (oyn homage)
   ========================= */
html[data-material="off"] .ceramic-surface,
html[data-material="off"] .ceramic-btn,
html[data-material="off"] .recess-track,
html[data-material="off"] .deck-module,
html[data-material="off"] .rotor-well,
html[data-material="off"] .rotor-wheel,
html[data-material="off"] .deck-key,
html[data-material="off"] .key-bed,
html[data-material="off"] .oled-screen,
html[data-material="off"] .app-stage,
html[data-material="off"] .theme-toggle {
  background: transparent !important;
  box-shadow: none !important;
  color: var(--ink) !important;
  outline: 1px dashed var(--ink-muted);
  outline-offset: -1px;
}

html[data-material="off"] .deck-module::before,
html[data-material="off"] .deck-key::after {
  display: none;
}

/* =========================
   Responsive & Reduced Motion
   ========================= */
@media (max-width: 60rem) {
  .app-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 46rem) {
  .vibe-deck {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .deck-rotor-module {
    max-width: 18rem;
    width: 100%;
    margin-inline: auto;
  }

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

  .nav-left .nav-link:nth-child(n + 3) {
    display: none;
  }

  .search-recess {
    width: 100%;
  }

  .dialog-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

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

  dialog.app-dialog,
  dialog.app-dialog::backdrop {
    transition-duration: 0.1s;
  }

  .rotor-wheel,
  .app-card,
  .ceramic-btn {
    transition-duration: 0.01ms;
  }
}
