/**
 * Steve Jobs Archive - Apple-Inspired Dark Theme
 * A premium, minimalist design inspired by Apple's aesthetic
 */

/* ============================================
   CSS Custom Properties (Design Tokens)
   ============================================ */
:root {
  /* Colours - Apple Dark Mode Palette */
  --color-background: #000000;
  --color-surface: #1d1d1f;
  --color-surface-elevated: #2d2d2f;
  --color-border: rgba(255, 255, 255, 0.1);
  --color-border-subtle: rgba(255, 255, 255, 0.06);

  /* Text Colours */
  --color-text-primary: #f5f5f7;
  --color-text-secondary: #a1a1a6;
  --color-text-tertiary: #6e6e73;

  /* Accent Colours */
  --color-accent: #0071e3;
  --color-accent-hover: #0077ed;
  --color-accent-active: #006edb;

  /* Gradient Colours */
  --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-quote: linear-gradient(90deg, #ffb6ff, #b344ff);
  --gradient-hero: radial-gradient(
    ellipse at top center,
    rgba(102, 126, 234, 0.15) 0%,
    transparent 60%
  );

  /* Typography */
  --font-family:
    -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;

  /* Spacing Scale */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 6rem;

  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.6);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;

  /* Layout */
  --max-width: 1200px;
  --header-height: 52px;
}

/* ============================================
   Reset & Base Styles
   ============================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-family);
  font-size: 17px;
  line-height: 1.47059;
  font-weight: var(--font-weight-regular);
  letter-spacing: -0.022em;
  background-color: var(--color-background);
  color: var(--color-text-primary);
  min-height: 100vh;
}

/* ============================================
   Typography
   ============================================ */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: var(--font-weight-semibold);
  letter-spacing: -0.025em;
  line-height: 1.1;
  margin-bottom: 0.5em;
}

h1 {
  font-size: clamp(3rem, 10vw, 5rem);
  font-weight: var(--font-weight-bold);
  letter-spacing: -0.03em;
}

h2 {
  font-size: clamp(2rem, 6vw, 3rem);
}

h3 {
  font-size: clamp(1.25rem, 3vw, 1.5rem);
}

p {
  color: var(--color-text-secondary);
  max-width: 65ch;
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-accent-hover);
}

/* ============================================
   Layout Components
   ============================================ */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-xl);
}

.section {
  padding: var(--space-4xl) var(--space-xl);
}

.section-header {
  text-align: center;
  margin-bottom: var(--space-3xl);
}

.section-header p {
  margin: var(--space-md) auto 0;
}

/* ============================================
   Header / Navigation
   ============================================ */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--color-border-subtle);
  z-index: 1000;
}

.nav {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
  gap: var(--space-xl);
}

.nav-link {
  color: var(--color-text-secondary);
  font-size: 14px;
  font-weight: var(--font-weight-regular);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  transition:
    color var(--transition-fast),
    background-color var(--transition-fast);
}

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

.nav-link.active {
  color: var(--color-text-primary);
}

/* ============================================
   Hero Section
   ============================================ */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding-top: var(--header-height);
  background: var(--gradient-hero), var(--color-background);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 200%;
  height: 100%;
  background: radial-gradient(
    ellipse at center top,
    rgba(102, 126, 234, 0.1) 0%,
    transparent 50%
  );
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 900px;
  padding: var(--space-xl);
}

.hero h1 {
  margin-bottom: var(--space-lg);
  background: linear-gradient(180deg, #ffffff 0%, #a1a1a6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: clamp(1.125rem, 2.5vw, 1.5rem);
  color: var(--color-text-secondary);
  max-width: 50ch;
  margin: 0 auto var(--space-2xl);
}

.scroll-indicator {
  position: absolute;
  bottom: var(--space-2xl);
  left: 50%;
  transform: translateX(-50%);
  color: var(--color-text-tertiary);
  font-size: 1.5rem;
  animation: bounce 2s ease infinite;
}

@keyframes bounce {
  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateX(-50%) translateY(0);
  }
  40% {
    transform: translateX(-50%) translateY(-10px);
  }
  60% {
    transform: translateX(-50%) translateY(-5px);
  }
}

/* ============================================
   Buttons
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-xl);
  font-size: 17px;
  font-weight: var(--font-weight-regular);
  line-height: 1.17648;
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}

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

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

.btn-secondary {
  background-color: transparent;
  color: var(--color-accent);
  border: 1px solid var(--color-accent);
}

.btn-secondary:hover {
  background-color: rgba(0, 113, 227, 0.1);
}

.btn-ghost {
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--color-text-primary);
}

.btn-ghost:hover {
  background-color: rgba(255, 255, 255, 0.15);
}

.btn-sm {
  padding: var(--space-sm) var(--space-lg);
  font-size: 14px;
}

/* ============================================
   Cards & Grid
   ============================================ */
.grid {
  display: grid;
  gap: var(--space-xl);
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.card {
  background-color: var(--color-surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition:
    transform var(--transition-base),
    box-shadow var(--transition-base);
}

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

.card-media {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background-color: var(--color-surface-elevated);
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.card:hover .card-media img {
  transform: scale(1.05);
}

.play-button {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 64px;
  height: 64px;
  background: rgba(0, 0, 0, 0.6);
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  backdrop-filter: blur(10px);
}

.play-button::after {
  content: "";
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 10px 0 10px 16px;
  border-color: transparent transparent transparent #ffffff;
  margin-left: 4px;
}

.card:hover .play-button {
  background: rgba(0, 0, 0, 0.8);
  transform: translate(-50%, -50%) scale(1.1);
}

.card-content {
  padding: var(--space-lg);
}

.card-content h3 {
  font-size: 1.125rem;
  margin-bottom: var(--space-sm);
  color: var(--color-text-primary);
}

.card-content p {
  font-size: 14px;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-md);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  font-size: 12px;
  color: var(--color-text-tertiary);
}

/* ============================================
   Filter Controls
   ============================================ */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-2xl);
}

.filter-btn {
  padding: var(--space-sm) var(--space-lg);
  font-size: 14px;
  font-weight: var(--font-weight-regular);
  color: var(--color-text-secondary);
  background-color: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.filter-btn:hover {
  color: var(--color-text-primary);
  border-color: var(--color-text-tertiary);
}

.filter-btn.active {
  color: #ffffff;
  background-color: var(--color-accent);
  border-color: var(--color-accent);
}

.sort-select {
  padding: var(--space-sm) var(--space-lg);
  padding-right: var(--space-2xl);
  font-size: 14px;
  color: var(--color-text-secondary);
  background-color: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23a1a1a6' d='M6 8L0 2l1.4-1.4L6 5.2 10.6.6 12 2z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-md) center;
}

/* ============================================
   Quotes Section
   ============================================ */
.quotes-section {
  background: linear-gradient(180deg, #0a0a0a 0%, #000000 100%);
  padding: var(--space-4xl) var(--space-xl);
}

.quote-card {
  max-width: 900px;
  margin: 0 auto var(--space-4xl);
  text-align: center;
}

.quote-text {
  font-size: clamp(1.75rem, 5vw, 3rem);
  font-weight: var(--font-weight-bold);
  line-height: 1.2;
  background: var(--gradient-quote);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: var(--space-lg);
}

.quote-attribution {
  font-size: 1rem;
  color: var(--color-text-tertiary);
}

/* ============================================
   Timeline Section
   ============================================ */
.timeline {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 100%;
  background: linear-gradient(
    180deg,
    transparent 0%,
    var(--color-border) 5%,
    var(--color-border) 95%,
    transparent 100%
  );
}

.timeline-item {
  position: relative;
  padding: var(--space-xl) 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2xl);
  align-items: center;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 12px;
  height: 12px;
  background-color: var(--color-accent);
  border-radius: 50%;
  box-shadow:
    0 0 0 4px var(--color-background),
    0 0 0 6px var(--color-accent);
}

.timeline-year {
  font-size: 3rem;
  font-weight: var(--font-weight-bold);
  color: var(--color-text-tertiary);
  text-align: right;
}

.timeline-content h3 {
  margin-bottom: var(--space-sm);
}

.timeline-content p {
  font-size: 15px;
}

.timeline-item:nth-child(even) {
  direction: rtl;
}

.timeline-item:nth-child(even) > * {
  direction: ltr;
}

.timeline-item:nth-child(even) .timeline-year {
  text-align: left;
}

/* ============================================
   Footer
   ============================================ */
.footer {
  background-color: #111111;
  padding: var(--space-2xl) var(--space-xl);
  text-align: center;
  border-top: 1px solid var(--color-border-subtle);
}

.footer p {
  font-size: 12px;
  color: var(--color-text-tertiary);
  max-width: none;
  margin-bottom: var(--space-sm);
}

/* ============================================
   Animations
   ============================================ */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition:
    opacity 0.8s ease-out,
    transform 0.8s ease-out;
}

.animate-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger animation for grid items */
.grid .animate-on-scroll:nth-child(1) {
  transition-delay: 0ms;
}
.grid .animate-on-scroll:nth-child(2) {
  transition-delay: 100ms;
}
.grid .animate-on-scroll:nth-child(3) {
  transition-delay: 200ms;
}
.grid .animate-on-scroll:nth-child(4) {
  transition-delay: 300ms;
}
.grid .animate-on-scroll:nth-child(5) {
  transition-delay: 400ms;
}
.grid .animate-on-scroll:nth-child(6) {
  transition-delay: 500ms;
}

/* ============================================
   Loading & Empty States
   ============================================ */
.loading,
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: var(--space-4xl) var(--space-xl);
  color: var(--color-text-tertiary);
}

.loading::before {
  content: "";
  display: block;
  width: 40px;
  height: 40px;
  margin: 0 auto var(--space-lg);
  border: 3px solid var(--color-border);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* ============================================
   Video Player Container
   ============================================ */
.video-player {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background-color: #000;
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.video-player iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 1024px) {
  .section {
    padding: var(--space-3xl) var(--space-lg);
  }

  .timeline::before {
    left: 20px;
  }

  .timeline-item {
    grid-template-columns: 1fr;
    padding-left: 50px;
  }

  .timeline-item::before {
    left: 20px;
  }

  .timeline-year {
    text-align: left;
    font-size: 2rem;
  }

  .timeline-item:nth-child(even) {
    direction: ltr;
  }

  .timeline-item:nth-child(even) .timeline-year {
    text-align: left;
  }
}

@media (max-width: 768px) {
  :root {
    --header-height: 48px;
  }

  body {
    font-size: 15px;
  }

  .nav {
    gap: var(--space-md);
  }

  .nav-link {
    font-size: 12px;
    padding: var(--space-xs) var(--space-sm);
  }

  .hero {
    min-height: 80vh;
  }

  .section {
    padding: var(--space-2xl) var(--space-md);
  }

  .filter-bar {
    gap: var(--space-xs);
  }

  .filter-btn {
    padding: var(--space-xs) var(--space-md);
    font-size: 12px;
  }

  .quote-text {
    font-size: clamp(1.5rem, 6vw, 2.5rem);
  }

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

@media (max-width: 480px) {
  .container {
    padding: 0 var(--space-md);
  }

  .nav {
    flex-wrap: wrap;
    gap: var(--space-sm);
  }

  .btn {
    width: 100%;
  }
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
  .header,
  .scroll-indicator,
  .filter-bar,
  .play-button,
  .btn {
    display: none !important;
  }

  body {
    background: white;
    color: black;
  }

  .card {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ddd;
  }
}
