/* ============================================================
   Octet OIS — Styles
   Safety color accents, asphalt/concrete greys, skeuomorphic depth
   ============================================================ */

/* --- CSS Reset --- */

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

html {
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  hanging-punctuation: first last;
}

body {
  min-height: 100dvh;
  line-height: 1.6;
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    Roboto,
    Oxygen,
    Ubuntu,
    Cantarell,
    sans-serif;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

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

p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

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

ul,
ol {
  list-style: none;
}

/* --- Design Tokens --- */

:root {
  /* Concrete greys (light mode palette — cool undertone) */
  --concrete-50: #f7f6f4;
  --concrete-100: #efeeeb;
  --concrete-200: #dddbd6;
  --concrete-300: #c8c5be;
  --concrete-400: #a19d95;
  --concrete-500: #7a766e;
  --concrete-600: #5c5850;

  /* Asphalt greys (dark mode palette — warm undertone) */
  --asphalt-600: #504e4a;
  --asphalt-700: #3d3b38;
  --asphalt-800: #2a2927;
  --asphalt-850: #222120;
  --asphalt-900: #1a1918;
  --asphalt-950: #0f0e0e;

  /* Safety accent colors — harmonized warm undertone, hex fallbacks */
  --accent-orange: #e07400;
  --accent-green: #5ea31e;
  --accent-yellow: #e0ad00;

  /* Semantic accent mapping */
  --accent-1: var(--accent-orange);
  --accent-2: var(--accent-green);
  --accent-3: var(--accent-yellow);

  /* Hex cluster face shading (cube-in-hex) */
  --hex-top: #ffb347;
  --hex-mid: #e07400;
  --hex-dark: #a85600;
  --hex-green-top: #72c024;
  --hex-green-mid: #5ea31e;
  --hex-green-dark: #4a8218;
  --hex-line: #7a4000;
  --hex-green-line: #2d5a0a;

  /* Spacing scale */
  --space-xs: clamp(0.25rem, 0.2rem + 0.25vw, 0.5rem);
  --space-sm: clamp(0.5rem, 0.4rem + 0.5vw, 1rem);
  --space-md: clamp(1rem, 0.8rem + 1vw, 2rem);
  --space-lg: clamp(1.5rem, 1rem + 2.5vw, 4rem);
  --space-xl: clamp(2rem, 1.2rem + 4vw, 6rem);
  --space-2xl: clamp(3rem, 2rem + 5vw, 8rem);

  /* Typography scale — continuous fluid scaling */
  --text-xs: clamp(0.7rem, 0.65rem + 0.25vw, 0.8rem);
  --text-sm: clamp(0.8rem, 0.75rem + 0.25vw, 0.95rem);
  --text-base: clamp(0.95rem, 0.88rem + 0.35vw, 1.125rem);
  --text-lg: clamp(1.1rem, 1rem + 0.5vw, 1.35rem);
  --text-xl: clamp(1.3rem, 1.15rem + 0.75vw, 1.75rem);
  --text-2xl: clamp(1.6rem, 1.3rem + 1.5vw, 2.5rem);
  --text-3xl: clamp(2rem, 1.6rem + 2vw, 3.5rem);
  --text-4xl: clamp(2.5rem, 2rem + 2.5vw, 5rem);

  /* Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;

  /* Transitions */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --transition-fast: 150ms var(--ease-out);
  --transition-base: 300ms var(--ease-out);
  --transition-slow: 500ms var(--ease-out);
}

/* HDR accent colors for wide-gamut displays */
@supports (color: oklch(0.7 0.15 250)) {
  :root {
    --accent-orange: oklch(0.65 0.17 58);
    --accent-green: oklch(0.64 0.17 132);
    --accent-yellow: oklch(0.77 0.15 88);
  }

  [data-theme='light'] {
    --accent-orange: oklch(0.55 0.17 55);
    --accent-green: oklch(0.5 0.16 135);
    --accent-yellow: oklch(0.58 0.14 85);
  }
}

/* --- Light Theme (concrete) --- */

[data-theme='light'] {
  --bg-primary: var(--concrete-50);
  --bg-secondary: var(--concrete-100);
  --bg-elevated: #ffffff;
  --bg-overlay: rgba(247, 246, 244, 0.88);
  --text-primary: var(--asphalt-900);
  --text-secondary: var(--asphalt-600);
  --text-tertiary: var(--concrete-500);
  --border-color: var(--concrete-300);
  --border-highlight: var(--concrete-200);

  /* Darkened accents for light-mode contrast */
  --accent-orange: #c06000;
  --accent-green: #3d7a0e;
  --accent-yellow: #9e7500;

  /* Hex cluster face shading (light mode) */
  --hex-top: #ffb347;
  --hex-mid: #e07400;
  --hex-dark: #a85600;
  --hex-green-top: #72c024;
  --hex-green-mid: #5ea31e;
  --hex-green-dark: #4a8218;

  /* Skeuomorphic depth tokens */
  --btn-bg: linear-gradient(180deg, #ffffff 0%, #eeedea 100%);
  --btn-shadow:
    0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 0 rgba(255, 255, 255, 0.8) inset,
    0 -1px 0 rgba(0, 0, 0, 0.06) inset;
  --btn-shadow-hover:
    0 2px 6px rgba(0, 0, 0, 0.15), 0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 -1px 0 rgba(0, 0, 0, 0.08) inset;
  --btn-shadow-active: 0 0 1px rgba(0, 0, 0, 0.2), 0 2px 3px rgba(0, 0, 0, 0.1) inset;
  --card-shadow:
    0 1px 3px rgba(0, 0, 0, 0.1), 0 4px 16px rgba(0, 0, 0, 0.06),
    0 1px 0 rgba(255, 255, 255, 0.6) inset;
  --card-shadow-hover:
    0 4px 12px rgba(0, 0, 0, 0.14), 0 8px 32px rgba(0, 0, 0, 0.08),
    0 1px 0 rgba(255, 255, 255, 0.6) inset;
  --badge-bg: linear-gradient(180deg, #ffffff 0%, #f2f1ee 100%);
  --badge-shadow: 0 1px 4px rgba(0, 0, 0, 0.12), 0 1px 0 rgba(255, 255, 255, 0.7) inset;
  --tape-color-1: #d4a000;
  --tape-color-2: var(--asphalt-900);
  --tape-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  --dot-color: var(--concrete-300);
  --marquee-bg: var(--concrete-200);
  --marquee-text: var(--concrete-600);
  color-scheme: light;
}

/* --- Dark Theme (asphalt) --- */

[data-theme='dark'] {
  --bg-primary: var(--asphalt-950);
  --bg-secondary: var(--asphalt-900);
  --bg-elevated: var(--asphalt-850);
  --bg-overlay: rgba(15, 14, 14, 0.85);
  --text-primary: var(--concrete-100);
  --text-secondary: var(--concrete-400);
  --text-tertiary: var(--asphalt-600);
  --border-color: var(--asphalt-700);
  --border-highlight: var(--asphalt-600);

  /* Skeuomorphic depth tokens */
  --btn-bg: linear-gradient(180deg, #2e2d2b 0%, #222120 100%);
  --btn-shadow:
    0 1px 2px rgba(0, 0, 0, 0.4), 0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 -1px 0 rgba(0, 0, 0, 0.2) inset;
  --btn-shadow-hover:
    0 2px 4px rgba(0, 0, 0, 0.5), 0 1px 0 rgba(255, 255, 255, 0.08) inset,
    0 -1px 0 rgba(0, 0, 0, 0.25) inset;
  --btn-shadow-active: 0 0 1px rgba(0, 0, 0, 0.6), 0 2px 4px rgba(0, 0, 0, 0.3) inset;
  --card-shadow:
    0 1px 3px rgba(0, 0, 0, 0.4), 0 4px 16px rgba(0, 0, 0, 0.25),
    0 1px 0 rgba(255, 255, 255, 0.04) inset;
  --card-shadow-hover:
    0 4px 12px rgba(0, 0, 0, 0.5), 0 8px 32px rgba(0, 0, 0, 0.3),
    0 1px 0 rgba(255, 255, 255, 0.06) inset;
  --badge-bg: linear-gradient(180deg, #2e2d2b 0%, #1a1918 100%);
  --badge-shadow: 0 1px 3px rgba(0, 0, 0, 0.5), 0 1px 0 rgba(255, 255, 255, 0.04) inset;
  --tape-color-1: #b8930a;
  --tape-color-2: var(--asphalt-950);
  --tape-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  --dot-color: var(--asphalt-800);
  --marquee-bg: var(--asphalt-900);
  --marquee-text: var(--asphalt-600);
  color-scheme: dark;
}

/* --- Theme Transition --- */

html[data-theme] {
  transition:
    background-color var(--transition-base),
    color var(--transition-base);
}

html[data-theme] *,
html[data-theme] *::before,
html[data-theme] *::after {
  transition:
    background-color var(--transition-base),
    color var(--transition-base),
    border-color var(--transition-base),
    box-shadow var(--transition-base),
    opacity var(--transition-base);
}

/* --- Body Styling --- */

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  position: relative;
  overflow-x: hidden;
}

/* Dot grid background */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image: radial-gradient(circle, var(--dot-color) 1px, transparent 1px);
  background-size: clamp(18px, 1.2vw + 14px, 56px) clamp(18px, 1.2vw + 14px, 56px);
  opacity: 0.5;
  pointer-events: none;
}

@media (max-width: 768px) {
  body::before {
    opacity: 0.2;
  }
}

/* --- Background Canvas --- */

#bg-canvas {
  position: fixed;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* --- Floating Hex Cluster Background --- */

.floating-hex-cluster {
  position: fixed;
  z-index: 0;
  pointer-events: none;
  top: 50%;
  left: 50%;
  width: clamp(60vw, 50vw + 20vh, 90vw);
  height: clamp(60vw, 50vw + 20vh, 90vw);
  max-width: 900px;
  max-height: 900px;
  transform: translate(-50%, -50%);
  animation: cluster-drift 40s cubic-bezier(0.37, 0, 0.63, 1) infinite;
  opacity: 0.06;
}

[data-theme='light'] .floating-hex-cluster {
  opacity: 0.07;
}

.floating-hex-cluster-svg {
  width: 100%;
  height: 100%;
  animation: cluster-spin 120s linear infinite;
}

@keyframes cluster-drift {
  0% {
    transform: translate(-50%, -50%) scale(1) perspective(800px) rotateX(0deg) rotateY(0deg);
  }
  25% {
    transform: translate(-45%, -55%) scale(1.06) perspective(800px) rotateX(6deg) rotateY(-5deg);
  }
  50% {
    transform: translate(-55%, -48%) scale(0.96) perspective(800px) rotateX(-5deg) rotateY(8deg);
  }
  75% {
    transform: translate(-48%, -52%) scale(1.04) perspective(800px) rotateX(4deg) rotateY(-7deg);
  }
  100% {
    transform: translate(-50%, -50%) scale(1) perspective(800px) rotateX(0deg) rotateY(0deg);
  }
}

@keyframes cluster-spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* --- Construction Tape --- */

.construction-tape {
  width: 100%;
  height: clamp(8px, 0.6vw + 4px, 14px);
  background: repeating-linear-gradient(
    -45deg,
    var(--tape-color-1),
    var(--tape-color-1) 10px,
    var(--tape-color-2) 10px,
    var(--tape-color-2) 20px
  );
  box-shadow: var(--tape-shadow);
  flex-shrink: 0;
  position: relative;
  z-index: 10;
}

/* --- Header --- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--border-color);
}

@supports (backdrop-filter: blur(12px)) {
  .site-header {
    background: var(--bg-overlay);
    backdrop-filter: blur(16px) saturate(1.3);
  }
}

@supports not (backdrop-filter: blur(12px)) {
  .site-header {
    background: var(--bg-primary);
  }
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
}

/* --- Logo --- */

.logo {
  display: inline-flex;
  align-items: center;
  gap: clamp(0.25rem, 0.2rem + 0.3vw, 0.5rem);
}

.logo-mark {
  width: clamp(3.5rem, 3rem + 3vw, 6rem);
  height: auto;
  flex-shrink: 0;
}

.logo-wordmark {
  font-size: clamp(1.4rem, 1.1rem + 1.5vw, 2.2rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--text-primary);
  display: inline-flex;
  align-items: baseline;
}

.logo-colon {
  color: var(--accent-1);
  font-weight: 300;
  margin: 0 0.01em;
  opacity: 0.7;
}

.logo-suffix {
  color: var(--accent-3);
  font-weight: 800;
  letter-spacing: -0.02em;
}

/* --- Header Controls --- */

.header-controls {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

/* --- Shared Button Base (skeuomorphic) --- */

.btn-icon {
  position: relative;
  width: clamp(2.25rem, 2rem + 0.5vw, 2.75rem);
  height: clamp(2.25rem, 2rem + 0.5vw, 2.75rem);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--btn-bg);
  box-shadow: var(--btn-shadow);
  cursor: pointer;
  display: grid;
  place-items: center;
  color: var(--text-secondary);
}

.btn-icon:hover {
  border-color: var(--border-highlight);
  box-shadow: var(--btn-shadow-hover);
  color: var(--text-primary);
}

.btn-icon:active {
  box-shadow: var(--btn-shadow-active);
  transform: translateY(0.5px);
}

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

/* --- Theme Toggle --- */

.theme-toggle svg {
  width: 1.15rem;
  height: 1.15rem;
  position: absolute;
  transition:
    opacity var(--transition-fast),
    transform var(--transition-fast);
}

[data-theme='light'] .icon-sun {
  opacity: 1;
  transform: rotate(0deg);
}

[data-theme='light'] .icon-moon {
  opacity: 0;
  transform: rotate(-90deg);
}

[data-theme='dark'] .icon-sun {
  opacity: 0;
  transform: rotate(90deg);
}

[data-theme='dark'] .icon-moon {
  opacity: 1;
  transform: rotate(0deg);
}

/* --- Share Button --- */

.share-btn svg {
  width: 1.1rem;
  height: 1.1rem;
}

.share-btn .icon-check {
  opacity: 0;
  position: absolute;
  color: var(--accent-green);
  transition: opacity var(--transition-fast);
}

.share-btn .icon-share {
  opacity: 1;
  transition: opacity var(--transition-fast);
}

.share-btn.copied .icon-check {
  opacity: 1;
}

.share-btn.copied .icon-share {
  opacity: 0;
}

/* Tooltip */
.share-btn::after {
  content: 'Shared!';
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: var(--asphalt-900);
  color: var(--concrete-100);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity var(--transition-fast),
    transform var(--transition-fast);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

[data-theme='light'] .share-btn::after {
  background: var(--asphalt-800);
}

.share-btn.copied::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* --- Hero Section --- */

.hero {
  position: relative;
  z-index: 1;
  min-height: clamp(50dvh, 40dvh + 15vw, 80dvh);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl) var(--space-md);
}

.hero-content {
  max-width: min(800px, 90vw);
  text-align: center;
  position: relative;
}

/* Circuit decoration */
.circuit-decoration {
  position: absolute;
  top: clamp(-40px, -3vw - 20px, -80px);
  left: 50%;
  transform: translateX(-50%);
  width: min(100%, clamp(300px, 30vw + 100px, 500px));
  height: auto;
  opacity: 0.6;
  pointer-events: none;
}

.hero-label {
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent-1);
  margin-bottom: var(--space-sm);
  position: relative;
  z-index: 1;
}

.hero-title {
  font-size: var(--text-4xl);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: var(--space-md);
  position: relative;
  z-index: 1;
}

.typing-text {
  display: inline;
  color: var(--accent-2);
}

/* Blinking cursor */
.cursor {
  display: inline-block;
  animation: blink 1s step-end infinite;
  color: var(--accent-3);
  font-weight: 400;
}

@keyframes blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

.hero-description {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  max-width: min(560px, 85vw);
  margin: 0 auto var(--space-lg);
  line-height: 1.7;
  position: relative;
  z-index: 1;
}

/* --- Construction Badge (skeuomorphic) --- */

.construction-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  background: var(--badge-bg);
  box-shadow: var(--badge-shadow);
  position: relative;
  z-index: 1;
}

.gear-icon {
  width: clamp(1.25rem, 1rem + 0.5vw, 1.5rem);
  height: clamp(1.25rem, 1rem + 0.5vw, 1.5rem);
  animation: spin 6s linear infinite;
  flex-shrink: 0;
}

.gear-reverse {
  animation: spin-reverse 4s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes spin-reverse {
  to {
    transform: rotate(-360deg);
  }
}

.badge-text {
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

/* --- Marquee --- */

.marquee {
  background: var(--marquee-bg);
  padding: var(--space-sm) 0;
  overflow: hidden;
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 30s linear infinite;
}

.marquee-content {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--marquee-text);
  white-space: nowrap;
  padding: 0 var(--space-md);
}

@keyframes marquee {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

/* --- Preview Cards (skeuomorphic) --- */

.preview-section {
  position: relative;
  z-index: 1;
  padding: var(--space-2xl) var(--space-md);
  max-width: 1200px;
  margin: 0 auto;
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  gap: var(--space-md);
}

.preview-card {
  background: var(--btn-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--card-shadow);
  transition:
    transform var(--transition-fast),
    box-shadow var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.preview-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-1), var(--accent-3), var(--accent-2));
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.preview-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--card-shadow-hover);
}

.preview-card:hover::before {
  opacity: 1;
}

.card-icon-wrap {
  width: clamp(2.5rem, 2rem + 1vw, 3rem);
  height: clamp(2.5rem, 2rem + 1vw, 3rem);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.06),
    0 1px 0 rgba(255, 255, 255, 0.4) inset;
  display: grid;
  place-items: center;
  margin-bottom: var(--space-md);
}

[data-theme='dark'] .card-icon-wrap {
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.2),
    0 1px 0 rgba(255, 255, 255, 0.03) inset;
}

.card-icon {
  width: clamp(1.25rem, 1rem + 0.5vw, 1.5rem);
  height: clamp(1.25rem, 1rem + 0.5vw, 1.5rem);
  color: var(--accent-1);
}

.preview-card:nth-child(2) .card-icon {
  color: var(--accent-2);
}

.preview-card:nth-child(3) .card-icon {
  color: var(--accent-3);
}

.card-title {
  font-size: var(--text-xl);
  font-weight: 700;
  margin-bottom: var(--space-xs);
  color: var(--text-primary);
}

.card-text {
  font-size: var(--text-base);
  color: var(--text-secondary);
  line-height: 1.6;
}

/* --- Footer --- */

.site-footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: var(--space-lg) var(--space-md);
  border-top: 1px solid var(--border-color);
}

.footer-text {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
}

/* --- Circuit Animation Keyframes --- */

.circuit-nodes .node {
  animation: node-pulse 3s ease-in-out infinite;
}

.node-1 {
  animation-delay: 0s;
}
.node-2 {
  animation-delay: 0.4s;
}
.node-3 {
  animation-delay: 0.8s;
}
.node-4 {
  animation-delay: 1.2s;
}
.node-5 {
  animation-delay: 1.6s;
}
.node-6 {
  animation-delay: 2s;
}
.node-7 {
  animation-delay: 2.4s;
}

@keyframes node-pulse {
  0%,
  100% {
    r: 3;
    opacity: 0.6;
  }
  50% {
    r: 5;
    opacity: 1;
  }
}

/* --- Scan Line Effect (subtle 90s CRT vibe) --- */

body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.015) 2px,
    rgba(0, 0, 0, 0.015) 4px
  );
  opacity: 0.5;
}

/* --- Animated Gradient (for when WebGPU is not available) --- */

@supports (background: linear-gradient(in oklch, red, blue)) {
  .no-webgpu #bg-canvas {
    display: none;
  }

  .no-webgpu body::before {
    background-image:
      radial-gradient(circle, var(--dot-color) 1px, transparent 1px),
      linear-gradient(
        135deg in oklch,
        oklch(0.3 0.04 58 / 0.1),
        oklch(0.3 0.03 88 / 0.08),
        oklch(0.3 0.04 132 / 0.1)
      );
    background-size:
      clamp(18px, 1.2vw + 14px, 56px) clamp(18px, 1.2vw + 14px, 56px),
      100% 100%;
    animation: gradient-shift 20s ease infinite;
  }
}

@property --gradient-angle {
  syntax: '<angle>';
  initial-value: 135deg;
  inherits: false;
}

@supports (animation-name: gradient-rotate) {
  @keyframes gradient-rotate {
    0% {
      --gradient-angle: 0deg;
    }
    100% {
      --gradient-angle: 360deg;
    }
  }
}

@keyframes gradient-shift {
  0%,
  100% {
    filter: hue-rotate(0deg);
  }
  50% {
    filter: hue-rotate(30deg);
  }
}

/* --- Responsive Adjustments --- */

/* Narrow mobile (320px) */
@media (max-width: 359px) {
  .hero {
    padding: var(--space-lg) var(--space-xs);
  }

  .construction-badge {
    flex-wrap: wrap;
    justify-content: center;
  }

  .circuit-decoration {
    display: none;
  }

  .header-controls {
    gap: 0.25rem;
  }
}

/* Small mobile */
@media (max-width: 479px) {
  .preview-grid {
    gap: var(--space-sm);
  }
}

/* Tablet portrait */
@media (min-width: 768px) {
  .preview-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* --- Reduced Motion --- */

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

  .marquee-track {
    animation: none;
  }

  .pulse-dot {
    display: none;
  }
}
