/* ==========================================================================
   LEGIBLE TYPE — Geometric Modernist Design System
   Honoring Futura's Bauhaus heritage with precision and bold geometry
   ========================================================================== */

:root {
  /* Core palette - high contrast with electric accent */
  --color-ink: #0a0a0a;
  --color-paper: #fafaf8;
  --color-accent: #ff4f00;
  --color-muted: #71706e;
  --color-border: #d4d3d0;

  /* Typography scale */
  --font-display: 'Futura', 'Century Gothic', 'Avant Garde', sans-serif;
  --font-body: 'Futura', 'Century Gothic', sans-serif;

  /* Spacing units */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 2rem;
  --space-xl: 4rem;
  --space-2xl: 8rem;

  /* Geometric constants */
  --border-weight: 2px;
  --letter-tight: -0.02em;
  --letter-wide: 0.15em;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-ink: #f0efed;
    --color-paper: #0f0f0f;
    --color-accent: #ff6a1a;
    --color-muted: #8a8987;
    --color-border: #2a2a28;
  }
}

/* ==========================================================================
   Base Reset & Typography
   ========================================================================== */

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

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-ink);
  background: var(--color-paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: var(--color-accent);
  color: var(--color-paper);
}

/* ==========================================================================
   Homepage — Cinematic Hero
   ========================================================================== */

body.home {
  background: #000;
  color: #fff;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

#bg-video {
  position: fixed;
  top: 50%;
  left: 50%;
  min-width: 100%;
  min-height: 100%;
  transform: translate(-50%, -50%);
  z-index: 0;
  object-fit: cover;
  filter: grayscale(100%) contrast(1.1);
}

#overlay {
  position: fixed;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.3) 0%,
    rgba(0, 0, 0, 0.5) 50%,
    rgba(0, 0, 0, 0.7) 100%
  );
  z-index: 1;
}

/* Masthead frame — Nat Geo style */
.masthead {
  position: relative;
  z-index: 2;
  border: 10px solid var(--color-accent);
  padding: clamp(4rem, 12vw, 8rem) clamp(2rem, 6vw, 4rem);
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(2px);

  /* Entrance animation */
  animation: frame-reveal 1s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  opacity: 0;
  transform: scale(0.95);
}

@keyframes frame-reveal {
  to {
    opacity: 1;
    transform: scale(1);
  }
}

body.home h1 {
  font-family: var(--font-display);
  text-align: center;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  line-height: 1;
}

/* Stacked title typography */
.title-the,
.title-main,
.title-co {
  display: block;
  text-shadow:
    0 0 60px rgba(0, 0, 0, 0.9),
    0 0 30px rgba(0, 0, 0, 0.6);
}

.title-the {
  font-size: clamp(0.75rem, 1.8vw, 1.1rem);
  font-weight: 400;
  text-transform: lowercase;
  letter-spacing: var(--letter-wide);
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 1em;
}

.title-main {
  font-size: clamp(2.25rem, 11vw, 7rem);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1;
}

.title-co {
  font-size: clamp(0.7rem, 1.4vw, 0.95rem);
  font-weight: 400;
  text-transform: lowercase;
  letter-spacing: calc(var(--letter-wide) * 2);
  color: rgba(255, 255, 255, 0.6);
  margin-top: 1.5em;
}

@keyframes title-reveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes line-expand {
  to {
    transform: scaleX(1);
  }
}

/* Tagline — outside the frame */
.tagline {
  position: relative;
  z-index: 2;
  font-family: var(--font-display);
  font-size: clamp(0.7rem, 1.5vw, 0.9rem);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: calc(var(--letter-wide) * 1.5);
  color: rgba(255, 255, 255, 0.85);
  margin: var(--space-lg) 0 0;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.9);

  /* Staggered entrance */
  animation: title-reveal 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.5s forwards;
  opacity: 0;
  transform: translateY(12px);
}

/* ==========================================================================
   Product / Newsroom Pages
   ========================================================================== */

body.product {
  display: block;
  overflow: auto;
  min-height: 100vh;
}

/* Navigation */
.product-nav {
  max-width: 48rem;
  margin: 0 auto;
  padding: var(--space-xl) var(--space-lg) 0;
}

.product-nav a {
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: var(--letter-wide);
  color: var(--color-muted);
  text-decoration: none;
  transition: color 0.2s ease;
  position: relative;
}

.product-nav a::before {
  content: '←';
  margin-right: var(--space-sm);
  display: inline-block;
  transition: transform 0.2s ease;
}

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

.product-nav a:hover::before {
  transform: translateX(-4px);
}

/* Content container */
.product-content {
  max-width: 48rem;
  margin: 0 auto;
  padding: 0 var(--space-lg) var(--space-2xl);
}

/* Header */
.product-header {
  padding: var(--space-xl) 0 0;
  margin-bottom: var(--space-xl);
  border-bottom: var(--border-weight) solid var(--color-border);
  padding-bottom: var(--space-xl);
}

.product-header hgroup h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: var(--letter-tight);
  margin: 0 0 var(--space-sm);
}

.product-header hgroup .subtitle {
  font-size: 1.125rem;
  font-weight: 400;
  margin: 0;
  color: var(--color-muted);
  letter-spacing: 0.01em;
}

/* Body content */
.product-body {
  font-size: 1.0625rem;
  line-height: 1.75;
}

.product-body p {
  margin: 0 0 1.5em;
}

.product-body p:first-child::first-line {
  font-weight: 500;
}

.product-body h2 {
  font-family: var(--font-display);
  font-size: 0.8125rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: var(--letter-wide);
  margin: var(--space-xl) 0 var(--space-md);
  color: var(--color-accent);
}

.product-body em {
  font-style: italic;
}

.product-body strong {
  font-weight: 600;
}

.product-body a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--color-accent);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.2s ease;
}

.product-body a:hover {
  text-decoration-color: var(--color-ink);
}

/* ==========================================================================
   Feature Cards — Geometric List
   ========================================================================== */

.product-cards {
  margin: 0;
  display: flex;
  flex-direction: column;
}

.product-card {
  display: flex;
  flex-direction: column;
  padding: var(--space-lg) 0;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid var(--color-border);
  position: relative;
  transition: all 0.25s ease;
}

.product-card:first-child {
  border-top: 1px solid var(--color-border);
}

.product-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 0;
  height: calc(100% - var(--space-lg));
  transform: translateY(-50%);
  background: var(--color-accent);
  transition: width 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.product-card:hover {
  padding-left: var(--space-md);
}

.product-card:hover::before {
  width: 3px;
}

.product-card-name {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: var(--letter-tight);
  display: block;
  margin: 0 0 var(--space-xs);
  transition: color 0.2s ease;
}

.product-card:hover .product-card-name {
  color: var(--color-accent);
}

.product-card-subtitle {
  font-size: 0.9375rem;
  color: var(--color-muted);
  display: block;
  line-height: 1.5;
}

/* ==========================================================================
   Utility Animations
   ========================================================================== */

@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.product-content {
  animation: fade-in-up 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* Staggered card entrances */
.product-card {
  animation: fade-in-up 0.5s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

.product-card:nth-child(1) { animation-delay: 0.1s; }
.product-card:nth-child(2) { animation-delay: 0.15s; }
.product-card:nth-child(3) { animation-delay: 0.2s; }
.product-card:nth-child(4) { animation-delay: 0.25s; }
.product-card:nth-child(5) { animation-delay: 0.3s; }
.product-card:nth-child(6) { animation-delay: 0.35s; }

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
  body.product {
    background: #fff;
    color: #000;
  }

  .product-nav {
    display: none;
  }

  .product-card::before {
    display: none;
  }
}
