/* MacAutomate v3 Design System Tokens
   - ui-ux-pro-max verified WCAG AA+/AAA neutral palette (#FAFAFA / #FFFFFF / #09090B)
   - ONE exclusive high-contrast action color (#2563EB) strictly on Hero & Closing .btn-cta Download buttons
   - Zero violet/lavender anywhere; Fantasy Cursor palette uses obsidian, pearl, emerald, aqua & champagne
   - Self-hosted variable Space Grotesk + DM Sans + zero-byte native SF Mono */

@font-face {
  font-family: 'Space Grotesk';
  src: url('../public/fonts/space-grotesk-latin-var.woff2') format('woff2');
  font-weight: 500 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'DM Sans';
  src: url('../public/fonts/dm-sans-latin-var.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;

  /* Neutral macOS Light Surfaces & AAA Ink */
  --color-background: #FAFAFA;
  --color-surface-subtle: #F4F4F6;
  --color-card: #FFFFFF;
  --color-muted: #E8ECF0;
  --color-foreground: #09090B;
  --color-primary: #18181B;
  --color-on-primary: #FFFFFF;
  --color-secondary: #3F3F46;
  --color-muted-foreground: #475569; /* 7.26:1 on #FAFAFA (AAA) */
  --color-border: #E4E4E7;
  --color-border-strong: #D4D4D8;
  --color-border-control: #71717A; /* 4.83:1 on #FFFFFF (AA+ Non-Text) */
  --color-ring: #18181B;

  /* EXCLUSIVE Primary & Closing Conversion CTA Color */
  --color-accent: #2563EB;
  --color-accent-hover: #1D4ED8;
  --color-accent-active: #1E40AF;
  --color-on-accent: #FFFFFF;

  /* Native macOS Semantic Window & Telemetry Tokens */
  --mac-red: #FF5F56;
  --mac-yellow: #FFBD2E;
  --mac-green: #27C93F;
  --rec-red: #DC2626;
  --rec-red-bg: #FEE2E2;
  --status-ok: #15803D;
  --status-ok-bg: #DCFCE7;
  --status-warn: #B45309;
  --status-warn-bg: #FEF3C7;

  /* Fantasy Cursor Palette (strictly inside .gesture-layer — zero #2563EB, zero violet) */
  --cursor-pearl: #F8FAFC;
  --cursor-emerald: #10B981;
  --cursor-aqua: #06B6D4;
  --cursor-champagne: #FCD34D;

  /* Typography */
  --font-heading: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
  --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
  --font-mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  /* Spacing & Radii */
  --container-max: 1280px;
  --gutter: clamp(16px, 3.6vw, 44px);
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 22px;

  /* Elevation */
  --shadow-sm: 0 1px 2px rgba(9, 9, 11, 0.05);
  --shadow-md: 0 8px 24px -4px rgba(9, 9, 11, 0.07), 0 2px 6px rgba(9, 9, 11, 0.04);
  --shadow-mac:
    0 0 0 1px rgba(9, 9, 11, 0.08),
    0 4px 10px rgba(9, 9, 11, 0.05),
    0 18px 42px -8px rgba(9, 9, 11, 0.12),
    0 34px 72px -16px rgba(9, 9, 11, 0.14);

  /* Motion Curves (snappy macOS exponential deceleration — zero artificial overshoot) */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-ui: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
}

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

[hidden] {
  display: none !important;
}

::selection {
  background: rgba(24, 24, 27, 0.14);
  color: var(--color-foreground);
}

html {
  margin: 0;
  background-color: var(--color-background);
  color: var(--color-foreground);
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 76px;
  scroll-behavior: auto;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.56;
  color: var(--color-foreground);
  background-color: var(--color-background);
  caret-color: var(--color-foreground);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

h1, h2, h3, h4, p, ul, ol, dl, dd, figure {
  margin: 0;
}

ul, ol {
  padding: 0;
  list-style: none;
}

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

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

:focus-visible {
  outline: 3px solid var(--color-ring);
  outline-offset: 2px;
  border-radius: 6px;
}

.skip-link {
  position: fixed;
  top: -120px;
  left: 16px;
  z-index: 300;
  min-height: 44px;
  padding: 10px 18px;
  background: var(--color-primary);
  color: var(--color-on-primary);
  border-radius: var(--r-sm);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
}

.skip-link:focus {
  top: 12px;
}

.wrap {
  width: min(100% - 2 * var(--gutter), var(--container-max));
  margin-inline: auto;
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.kbd-chip {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 5px;
  background: var(--color-muted);
  color: var(--color-foreground);
  border: 1px solid var(--color-border-strong);
  box-shadow: 0 1px 0 rgba(9, 9, 11, 0.08);
  line-height: 1.3;
  white-space: nowrap;
}

.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;
}

/* Top Scroll Progress Hairline */
.scroll-spine-top {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 120;
  pointer-events: none;
}

.scroll-spine-top__fill {
  height: 100%;
  width: 100%;
  transform-origin: left center;
  transform: scaleX(var(--page-progress, 0));
  background: linear-gradient(90deg, #475569 0%, #09090B 100%);
  will-change: transform;
}

/* Minimal Brand Strip — 1:1 Conversion Focus (ZERO competing nav links) */
.brand-bar {
  position: sticky;
  top: 0;
  z-index: 80;
  height: 58px;
  background: rgba(250, 250, 250, 0.88);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--color-border);
}

.brand-bar__inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-size: 18.5px;
  font-weight: 600;
  letter-spacing: -0.025em;
}

.brand-lockup__icon {
  width: 24px;
  height: 24px;
  flex: none;
  display: block;
}

.brand-bar__right {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.release-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  background: #FFFFFF;
  border: 1px solid var(--color-border);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--color-secondary);
}

.release-chip__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--status-ok);
}

@media (max-width: 720px) {
  .release-chip { display: none; }
}

.sound-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--color-border-strong);
  background: #FFFFFF;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-secondary);
  cursor: pointer;
  touch-action: manipulation;
  transition: border-color 150ms ease, background-color 150ms ease, color 150ms ease;
}

.sound-pill:hover {
  border-color: var(--color-border-control);
  background: #F4F4F5;
  color: var(--color-foreground);
}

.sound-pill[aria-pressed="true"] {
  background: var(--color-primary);
  color: #FFFFFF;
  border-color: var(--color-primary);
}

.sound-pill__bars {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 11px;
}

.sound-pill__bars i {
  width: 2px;
  height: 4px;
  border-radius: 1px;
  background: currentColor;
}

.sound-pill[aria-pressed="true"] .sound-pill__bars i:nth-child(1) { height: 6px; animation: eq-bar 640ms ease-in-out infinite alternate; }
.sound-pill[aria-pressed="true"] .sound-pill__bars i:nth-child(2) { height: 11px; animation: eq-bar 500ms 100ms ease-in-out infinite alternate; }
.sound-pill[aria-pressed="true"] .sound-pill__bars i:nth-child(3) { height: 8px; animation: eq-bar 580ms 200ms ease-in-out infinite alternate; }

@keyframes eq-bar {
  from { transform: scaleY(0.45); }
  to { transform: scaleY(1); }
}

/* EXCLUSIVE Primary & Closing CTA Button (#2563EB) */
.btn-cta {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  min-width: 44px;
  padding: 13px 26px;
  background-color: var(--color-accent);
  color: var(--color-on-accent);
  border: 1px solid transparent;
  border-radius: 11px;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.005em;
  cursor: pointer;
  overflow: hidden;
  touch-action: manipulation;
  box-shadow: 0 2px 6px rgba(9, 9, 11, 0.14), 0 10px 24px -6px rgba(9, 9, 11, 0.22);
  transform: translate3d(var(--mag-x, 0px), var(--mag-y, 0px), 0);
  transition: background-color 150ms ease, box-shadow 180ms ease, transform 220ms var(--ease-out);
}

.btn-cta::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    110deg,
    transparent 22%,
    rgba(255, 255, 255, 0.24) 48%,
    rgba(255, 255, 255, 0.04) 60%,
    transparent 76%
  );
  transform: translateX(-130%);
  transition: transform 600ms var(--ease-out);
  pointer-events: none;
}

.btn-cta:hover {
  background-color: var(--color-accent-hover);
  box-shadow: 0 4px 12px rgba(9, 9, 11, 0.18), 0 16px 30px -8px rgba(9, 9, 11, 0.26);
}

.btn-cta:hover::before {
  transform: translateX(130%);
}

.btn-cta:active {
  background-color: var(--color-accent-active);
  transform: translate3d(var(--mag-x, 0px), calc(var(--mag-y, 0px) + 1px), 0) scale(0.985);
}

.btn-cta__icon {
  width: 17px;
  height: 17px;
  flex: none;
  transition: transform 180ms var(--ease-out);
}

.btn-cta:hover .btn-cta__icon {
  transform: translateY(2px);
}

/* Intentional Reduced Motion: disable spatial sweeps, particles, & loops while keeping state feedback clear */
@media (prefers-reduced-motion: reduce) {
  .btn-cta { transform: none !important; }
  .btn-cta::before { display: none; }
  .btn-cta:hover .btn-cta__icon { transform: none; }
  .sound-pill__bars i { animation: none !important; }
  .scroll-spine-top__fill { transition: none; }
}
