/**
 * TimerDaddy - Apple Intelligence Aesthetic Design System
 * Deep cinematic dark theme, glowing iridescent ribbons, glassmorphism, SF typography, and bento layouts.
 */

:root {
  /* Apple Intelligence Color Tokens - Dark Mode (Default) */
  --bg-body: #000000;
  --bg-primary: #0a0a0e;
  --bg-surface: #12131a;
  --bg-surface-elevated: #1a1b24;
  --bg-surface-glass: rgba(22, 24, 34, 0.72);
  --bg-subtle: rgba(255, 255, 255, 0.05);
  --bg-input: rgba(255, 255, 255, 0.07);
  --border-color: rgba(255, 255, 255, 0.12);
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-focus: #a855f7;

  --text-primary: #f5f5f7;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --text-inverse: #000000;

  /* Signature Apple Intelligence Iridescent Gradients */
  --ai-pink: #ec4899;
  --ai-purple: #a855f7;
  --ai-indigo: #6366f1;
  --ai-blue: #3b82f6;
  --ai-cyan: #06b6d4;
  --ai-emerald: #10b981;

  --ai-gradient-text: linear-gradient(135deg, #ffffff 20%, #cbd5e1 50%, #94a3b8 100%);
  --ai-gradient-glow: linear-gradient(135deg, #ec4899 0%, #a855f7 25%, #6366f1 50%, #3b82f6 75%, #06b6d4 100%);
  --ai-gradient-subtle: linear-gradient(135deg, rgba(236,72,153,0.15) 0%, rgba(168,85,247,0.15) 30%, rgba(59,130,246,0.15) 70%, rgba(6,182,212,0.15) 100%);

  --primary: #a855f7;
  --primary-hover: #9333ea;
  --primary-subtle: rgba(168, 85, 247, 0.15);

  --accent: #06b6d4;
  --accent-hover: #0891b2;
  --accent-subtle: rgba(6, 182, 212, 0.15);

  --success: #10b981;
  --success-subtle: rgba(16, 185, 129, 0.15);
  --warning: #f59e0b;
  --warning-subtle: rgba(245, 158, 11, 0.15);
  --danger: #f43f5e;
  --danger-subtle: rgba(244, 63, 94, 0.15);

  /* Shadows & Luminous Auras */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 60px -10px rgba(168, 85, 247, 0.35);
  --shadow-cyan-glow: 0 0 60px -10px rgba(6, 182, 212, 0.3);

  /* Typography */
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Monaco, Consolas, "Liberation Mono", monospace;

  /* Layout */
  --container-max: 1200px;
  --container-narrow: 820px;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --radius-full: 9999px;

  --focus-ring: 0 0 0 3px rgba(168, 85, 247, 0.5);
  --transition-fast: 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-normal: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="light"] {
  --bg-body: #f5f5f7;
  --bg-primary: #ffffff;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #fbfbfd;
  --bg-surface-glass: rgba(255, 255, 255, 0.85);
  --bg-subtle: #f0f0f4;
  --bg-input: #ffffff;
  --border-color: rgba(0, 0, 0, 0.1);
  --border-subtle: rgba(0, 0, 0, 0.05);
  --border-focus: #9333ea;

  --text-primary: #1d1d1f;
  --text-secondary: #515154;
  --text-muted: #86868b;
  --text-inverse: #ffffff;

  --ai-gradient-text: linear-gradient(135deg, #1d1d1f 20%, #434346 60%, #1d1d1f 100%);
  --ai-gradient-subtle: linear-gradient(135deg, rgba(236,72,153,0.08) 0%, rgba(168,85,247,0.08) 30%, rgba(59,130,246,0.08) 70%, rgba(6,182,212,0.08) 100%);

  --primary: #9333ea;
  --primary-hover: #7e22ce;
  --primary-subtle: rgba(147, 51, 234, 0.1);

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.1);
  --shadow-glow: 0 0 50px -10px rgba(168, 85, 247, 0.2);
}

/* CSS Reset & Anti-aliasing */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-body);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-body);
  color: var(--text-primary);
  overflow-x: hidden;
  transition: background-color var(--transition-normal), color var(--transition-normal);
  position: relative;
}

/* Apple Intelligence Ambient Aura Glow */
.ai-ambient-canvas {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  max-width: 1400px;
  height: 600px;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  opacity: 0.65;
}

.ai-ambient-glow {
  position: absolute;
  top: -120px;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 480px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.25) 0%, rgba(236, 72, 153, 0.18) 35%, rgba(6, 182, 212, 0.12) 65%, transparent 75%);
  filter: blur(80px);
}

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

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

button {
  cursor: pointer;
  border: none;
  background: none;
  touch-action: manipulation;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition-fast), opacity var(--transition-fast);
}

a:hover {
  color: var(--ai-cyan);
}

:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-sm);
}

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

/* Layout Utilities */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
  position: relative;
  z-index: 1;
}

.container-narrow {
  max-width: var(--container-narrow);
}

.main-content {
  flex: 1 0 auto;
  padding-top: 2.5rem;
  padding-bottom: 5rem;
  position: relative;
  z-index: 1;
}

/* Apple Expressive Typography */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
}

h1 {
  font-size: clamp(2.4rem, 5.5vw, 4.2rem);
  letter-spacing: -0.035em;
  margin-bottom: 1.25rem;
  background: var(--ai-gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

h2 {
  font-size: clamp(1.8rem, 3.5vw, 2.5rem);
  margin-top: 3rem;
  margin-bottom: 1.25rem;
  letter-spacing: -0.025em;
}

h3 {
  font-size: 1.35rem;
  margin-top: 1.75rem;
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
}

p {
  margin-bottom: 1.35rem;
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 1.7;
}

ul, ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
  color: var(--text-secondary);
}

li {
  margin-bottom: 0.65rem;
  line-height: 1.6;
}

code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--bg-subtle);
  padding: 0.2em 0.45em;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}

kbd {
  font-family: var(--font-mono);
  font-size: 0.85em;
  padding: 0.2em 0.5em;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.4);
  color: var(--text-primary);
}

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