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

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* --- Design tokens --- */
:root {
  --bg: #0c0f14;
  --bg-elevated: #121722;
  --surface: #161c28;
  --tint: #0f1824;
  --text: #e8ecf4;
  --text-muted: #9aa3b2;
  --accent: #5eb8ff;
  --accent-soft: rgba(94, 184, 255, 0.12);
  --border: rgba(255, 255, 255, 0.08);
  --radius: 12px;
  --radius-lg: 20px;
  --max: 72ch;
  --header-h: 4rem;
  --font-display: "Fraunces", Georgia, serif;
}

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

code {
  font-size: 0.9em;
  padding: 0.15em 0.4em;
  background: var(--bg-elevated);
  border-radius: 4px;
  border: 1px solid var(--border);
}

/* --- Skip link --- */
.skip-link {
  position: absolute;
  top: -100px;
  left: 0.75rem;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: var(--bg);
  font-weight: 600;
  z-index: 200;
  border-radius: 6px;
  text-decoration: none;
}

.skip-link:focus {
  top: 0.75rem;
}

/* --- YouTube + file:// (Safari) --- */
.file-protocol-banner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  background: rgba(255, 196, 90, 0.18);
  border-bottom: 1px solid rgba(255, 196, 90, 0.35);
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.5;
}

.file-protocol-banner p {
  margin: 0;
}

.file-protocol-banner code {
  font-size: 0.85em;
}

/* --- Header --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(12, 15, 20, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.logo:hover,
.logo:focus-visible {
  color: var(--accent);
}

.site-nav {
  display: block;
}

.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 0.5rem 1.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.site-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--text);
  border-bottom-color: var(--accent);
}

/* Mobile nav */
.nav-toggle {
  display: none;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-elevated);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 6px;
}

.nav-toggle-bar {
  display: block;
  width: 1.1rem;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
  transition: transform 0.2s, opacity 0.2s;
}

@media (max-width: 700px) {
  .nav-toggle {
    display: flex;
  }

  .site-nav {
    position: fixed;
    inset: var(--header-h) 0 0 0;
    background: var(--bg);
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.25s ease, opacity 0.25s ease, visibility 0.25s;
  }

  .site-nav.is-open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .nav-list {
    flex-direction: column;
    gap: 0.25rem;
  }

  .site-nav a {
    display: block;
    padding: 0.75rem 0;
    font-size: 1.1rem;
  }
}

/* --- Hero --- */
.hero {
  position: relative;
  min-height: min(88vh, 720px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem 1.5rem 5rem;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(94, 184, 255, 0.15), transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 60%, rgba(80, 120, 200, 0.12), transparent 50%),
    linear-gradient(180deg, #0a0c10 0%, var(--bg) 100%);
  pointer-events: none;
}

.hero-bg::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40%;
  background: linear-gradient(to top, var(--bg), transparent);
}

.hero-layout {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 0.5rem;
}

@media (min-width: 768px) {
  .hero-layout {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 3rem;
    text-align: left;
  }
}

.hero-profile-wrap {
  flex-shrink: 0;
}

.hero-profile {
  display: block;
  width: min(52vw, 240px);
  height: min(52vw, 240px);
  max-width: 280px;
  max-height: 280px;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid var(--border);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.06),
    0 20px 50px rgba(0, 0, 0, 0.45);
}

@media (min-width: 768px) {
  .hero-profile {
    width: 220px;
    height: 220px;
  }
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 640px;
  text-align: center;
}

@media (min-width: 768px) {
  .hero-content {
    text-align: left;
    align-self: center;
  }
}

.hero-eyebrow {
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--accent);
  margin: 0 0 0.75rem;
  font-weight: 600;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 3.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin: 0 0 1rem;
  color: var(--text);
}

.hero-lead {
  font-size: 1.2rem;
  color: var(--text-muted);
  margin: 0 0 2rem;
  line-height: 1.55;
}

/* --- Buttons --- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.5rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: background 0.2s, color 0.2s, transform 0.15s;
}

.button-primary {
  background: var(--accent);
  color: #041018;
  border: none;
  cursor: pointer;
}

.button-primary:hover,
.button-primary:focus-visible {
  background: #7ec8ff;
  transform: translateY(-1px);
}

/* --- Sections --- */
.section {
  padding: 4.5rem 1.5rem;
}

.section-surface {
  background: var(--surface);
}

.section-tint {
  background: var(--tint);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-inner {
  max-width: 720px;
  margin: 0 auto;
}

.section-inner--wide {
  max-width: 46rem;
}

.section-narrow {
  max-width: 520px;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3.5vw, 2.25rem);
  font-weight: 700;
  margin: 0 0 0.75rem;
  letter-spacing: -0.02em;
  color: var(--text);
}

.section-intro {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin: 0 0 1.75rem;
  line-height: 1.65;
}

.prose p {
  margin: 0 0 1.1rem;
  color: var(--text);
}

.prose p:last-child {
  margin-bottom: 0;
}

/* --- Inline photos (AFF, etc.) --- */
.content-photo {
  margin: 0 0 2rem;
}

.content-photo img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
}

.content-photo figcaption {
  margin: 0.75rem 0 0;
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.45;
  text-align: center;
}

.content-photo--aff {
  margin-bottom: 2.25rem;
}

#historia .content-photo--aff {
  margin-top: 1rem;
}

/* --- Story / long read --- */
.story-body .story-heading {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 2.5vw, 1.45rem);
  font-weight: 700;
  margin: 2.25rem 0 0.75rem;
  letter-spacing: -0.02em;
  color: var(--text);
}

.story-body .story-heading:first-of-type {
  margin-top: 1.5rem;
}

.story-lead {
  font-weight: 600;
  color: var(--text);
  margin: 2rem 0 0.75rem;
}

.video-embed--inline {
  position: relative;
  width: 100%;
  max-width: 720px;
  margin: 0 auto 0.5rem;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  background: #000;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
}

.video-embed--inline iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-caption-inline {
  text-align: center;
  font-size: 0.9rem;
  margin: 0 0 1.5rem;
}

.highlight-list--story {
  margin: 2.5rem 0;
}

.story-quote {
  margin: 1.5rem 0 0;
  padding: 1.25rem 0 1.25rem 1.25rem;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.story-quote p {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.65;
}

/* Highlight list */
.highlight-list {
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-elevated);
}

.highlight-list li {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  align-items: baseline;
}

.highlight-list li:last-child {
  border-bottom: 0;
}

@media (max-width: 500px) {
  .highlight-list li {
    grid-template-columns: 1fr;
  }
}

.highlight-list-label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 600;
}

.highlight-list-value {
  color: var(--text);
  text-align: right;
}

@media (max-width: 500px) {
  .highlight-list-value {
    text-align: left;
  }
}

/* --- Video grid --- */
.video-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 800px) {
  .video-grid:not(.video-grid--shorts) {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 640px) and (max-width: 999px) {
  .video-grid--shorts {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1000px) {
  .video-grid--shorts {
    grid-template-columns: repeat(3, 1fr);
  }
}

.video-embed--short {
  aspect-ratio: 9 / 16;
}

.text-link {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  margin-left: 0.25ch;
  transition: border-color 0.2s;
}

.text-link:hover,
.text-link:focus-visible {
  border-bottom-color: var(--accent);
}

.video-card {
  margin: 0;
}

.video-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: #000;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-caption {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  margin: 1rem 0 0.25rem;
  color: var(--text);
}

.video-meta {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-muted);
}

#filmy .section-inner {
  max-width: 960px;
}

#filmy .section-intro {
  max-width: 60ch;
}

/* --- Contact --- */
.contact-line {
  margin: 0 0 0.5rem;
}

.contact-link {
  color: var(--accent);
  font-size: 1.15rem;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

.contact-link:hover,
.contact-link:focus-visible {
  border-bottom-color: var(--accent);
}

.contact-note {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 1.5rem 0 0;
}

/* --- Footer --- */
.site-footer {
  padding: 2rem 1.5rem 2.5rem;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  text-align: center;
}

.site-footer p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}
