/* ============================================
   Luminar — Article-focused Stylesheet
   ============================================ */

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

:root {
  --bg-primary: #0a0a0a;
  --bg-secondary: #111111;
  --bg-card: #161616;
  --bg-card-hover: #1e1e1e;
  --bg-overlay: rgba(0, 0, 0, 0.55);
  --bg-controls: rgba(20, 20, 20, 0.75);

  --text-primary: #f0f0f0;
  --text-secondary: #a0a0a0;
  --text-tertiary: #666666;

  --accent: #3b82f6;
  --accent-hover: #60a5fa;
  --accent-warm: #f59e0b;
  --accent-red: #ef4444;
  --accent-green: #22c55e;

  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.15);

  --font-serif: 'New York', 'Iowan Old Style', 'Palatino Linotype', 'Georgia', serif;
  --font-sans: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;

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

  --max-width: 1400px;
  --content-width: 720px;
  --wide-width: 1000px;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --duration-fast: 150ms;
  --duration-normal: 300ms;
  --duration-slow: 600ms;
}

@media (color-gamut: p3) {
  :root {
    --accent: color(display-p3 0.22 0.50 0.97);
    --accent-hover: color(display-p3 0.35 0.63 0.98);
    --accent-warm: color(display-p3 0.96 0.65 0.04);
    --accent-red: color(display-p3 0.94 0.27 0.27);
    --accent-green: color(display-p3 0.13 0.77 0.37);
  }
}

@media (dynamic-range: high) {
  :root {
    --bg-primary: #050505;
    --text-primary: #f8f8f8;
  }

  .hdr-badge {
    display: inline-flex !important;
  }
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color-scheme: dark;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

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

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

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

/* --- HDR Badge --- */
.hdr-badge {
  display: none;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(168, 85, 247, 0.2));
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: var(--accent-hover);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.hdr-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* --- Navigation --- */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 0 var(--space-lg);
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(10, 10, 10, 0.7);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
  transition: background var(--duration-normal) var(--ease-out);
}

.site-nav.scrolled {
  background: rgba(10, 10, 10, 0.92);
}

.nav-brand {
  font-family: var(--font-sans);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  list-style: none;
}

.nav-links a {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color var(--duration-fast);
}

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

/* --- Hero Background (shared) --- */
.has-hero-bg {
  position: relative;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  transition: opacity 0.1s linear;
}

.hero-bg .placeholder-media {
  width: 100%;
  height: 100%;
}

.hero-bg-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(to bottom, rgba(10, 10, 10, 0.3) 0%, rgba(10, 10, 10, 0.95) 100%);
  pointer-events: none;
}

/* --- Site Header (home page masthead) --- */
.site-header {
  padding: calc(56px + var(--space-xl)) var(--space-lg) var(--space-xl);
  border-bottom: 1px solid var(--border);
}

.site-header-inner {
  position: relative;
  z-index: 2;
  max-width: var(--content-width);
  margin: 0 auto;
}

.site-header-title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: var(--space-sm);
}

.site-header-desc {
  font-size: 1.1rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* --- Section Layout --- */
.section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-xl) var(--space-lg);
}

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
  border-bottom: 1px solid var(--border);
  padding-bottom: var(--space-md);
}

.section-title {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

/* --- Article List (home page) --- */
.article-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.article-card {
  display: flex;
  gap: var(--space-lg);
  padding: var(--space-lg);
  background: var(--bg-card);
  cursor: pointer;
  transition: background var(--duration-fast);
}

.article-card:hover {
  background: var(--bg-card-hover);
}

.article-card-thumb {
  flex-shrink: 0;
  width: 200px;
  aspect-ratio: 16 / 10;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-secondary);
}

.article-card-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.card-category {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--space-xs);
}

.card-title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin-bottom: var(--space-sm);
}

.card-excerpt {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-top: var(--space-sm);
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

.card-meta .dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--text-tertiary);
}

/* --- Article Header (story page) --- */
.article-header {
  padding: calc(60px + var(--space-xl)) var(--space-lg) var(--space-xl);
}

.article-header-inner {
  position: relative;
  z-index: 2;
  max-width: var(--content-width);
  margin: 0 auto;
}

.article-header .card-category {
  margin-bottom: var(--space-md);
}

.story-page-title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.025em;
  margin-bottom: var(--space-md);
}

.story-page-subtitle {
  font-size: 1.15rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.byline {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.byline-name {
  color: var(--text-primary);
  font-weight: 600;
}

/* --- Article Body --- */
.article-body {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: var(--space-xl) var(--space-lg);
}

.article-body p {
  font-family: var(--font-serif);
  font-size: 1.125rem;
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: var(--space-lg);
}

.article-body p:first-of-type::first-letter {
  font-size: 3.5em;
  float: left;
  line-height: 0.8;
  margin-right: 0.08em;
  margin-top: 0.06em;
  font-weight: 700;
  color: var(--text-primary);
}

.article-body h2 {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: var(--space-xl) 0 var(--space-md);
  color: var(--text-primary);
}

.article-body blockquote {
  border-left: 3px solid var(--accent);
  padding-left: var(--space-lg);
  margin: var(--space-xl) 0;
  font-style: italic;
  color: var(--text-secondary);
}

.article-body blockquote.featured-quote {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  line-height: 1.5;
  color: var(--text-primary);
  border-left-width: 4px;
  padding: var(--space-lg);
  background: var(--bg-secondary);
  border-radius: 0 8px 8px 0;
}

.article-body blockquote.featured-quote cite {
  display: block;
  margin-top: var(--space-md);
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-style: normal;
}

/* --- Inline Video Wrap (full-bleed) --- */
.inline-video-wrap {
  width: 100%;
  margin: var(--space-lg) 0 var(--space-xl);
}

/* --- Custom Video Player --- */
.video-player {
  position: relative;
  overflow: hidden;
  background: #000;
}

.video-player video {
  width: 100%;
  display: block;
  cursor: pointer;
}

.video-player .player-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--space-xl) var(--space-md) var(--space-md);
  background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, transparent 100%);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  opacity: 0;
  transition: opacity 150ms var(--ease-out);
}

.video-player:hover .player-controls,
.video-player.show-controls .player-controls {
  opacity: 1;
}

/* Progress bar */
.progress-bar {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  cursor: pointer;
  position: relative;
  transition: height var(--duration-fast);
}

.progress-bar:hover {
  height: 6px;
}

.progress-bar-filled {
  height: 100%;
  width: 0%;
  background: var(--text-primary);
  border-radius: 2px;
}

/* Control buttons */
.controls-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.ctrl-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.85);
  transition: color var(--duration-fast), background var(--duration-fast);
}

.ctrl-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.ctrl-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.time-display {
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, 0.7);
  margin-left: var(--space-xs);
  user-select: none;
}

.controls-spacer {
  flex: 1;
}

.player-hdr-badge {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 3px;
  background: rgba(59, 130, 246, 0.2);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: var(--accent-hover);
}

/* Volume slider */
.volume-wrap {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.volume-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 0;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  outline: none;
  opacity: 0;
  transition: width var(--duration-normal) var(--ease-out),
              opacity var(--duration-normal) var(--ease-out);
}

.volume-wrap:hover .volume-slider {
  width: 70px;
  opacity: 1;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: white;
  cursor: pointer;
}

/* --- Footer --- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: var(--space-xl) var(--space-lg);
  text-align: center;
  color: var(--text-tertiary);
  font-size: 0.8rem;
}

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

.footer-links {
  display: flex;
  gap: var(--space-md);
  list-style: none;
}

.footer-links a {
  color: var(--text-tertiary);
  transition: color var(--duration-fast);
}

.footer-links a:hover {
  color: var(--text-secondary);
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .article-card {
    flex-direction: column;
    gap: var(--space-md);
  }

  .article-card-thumb {
    width: 100%;
  }
}

@media (max-width: 640px) {
  :root {
    --space-lg: 1.25rem;
    --space-xl: 2.5rem;
  }

  .nav-links {
    display: none;
  }

  .footer-inner {
    flex-direction: column;
    gap: var(--space-md);
  }
}

/* --- Placeholder patterns for prototype assets --- */
.placeholder-media {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.placeholder-media::after {
  content: attr(data-label);
  font-size: 0.75rem;
  color: var(--text-tertiary);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* --- Scroll-reveal --- */
.scroll-video-section {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity var(--duration-slow) var(--ease-out),
              transform var(--duration-slow) var(--ease-out);
}

.scroll-video-section.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- View transitions --- */
@view-transition {
  navigation: auto;
}
