/* ==========================================================================
   EDUARDO ROA - PERSONAL WEBSITE  |  MAIN STYLESHEET
   --------------------------------------------------------------------------
   HOW TO CUSTOMIZE COLORS & FONTS:
   1. FONTS: Replace the Google Fonts @import URL right below, then update
      --font-body and --font-heading inside :root.
   2. COLORS & SIZING: Edit any CSS variable inside :root and the entire
      website updates automatically.
   ========================================================================== */

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Space+Grotesk:wght@500;600;700&display=swap");

:root {
  /* ---- Color Palette (Darkroom / Key-Light & Rim-Light Theme) ---- */
  --bg:          #090a0e;   /* Main page background (neutral darkroom black) */
  --bg-alt:      #0d0f15;   /* Alternating section background */
  --surface:     #131620;   /* Card & panel background */
  --surface-2:   #1a1e2b;   /* Card hover background */
  --line:        #252a38;   /* Subtle borders & dividers */
  --line-glow:   rgba(255, 180, 84, 0.38); /* Warm rim-light hover border */
  --text:        #eceae4;   /* Primary text */
  --muted:       #9ba0ae;   /* Secondary / metadata text */
  --accent:      #ffb454;   /* Warm key-light amber accent */
  --accent-2:    #ff7e47;   /* Warm sunset secondary accent */
  --accent-ink:  #171005;   /* Dark text on top of accent buttons */
  --free:        #5fd6a4;   /* "FREE" product badge color */

  /* ---- Typography ---- */
  --font-body:    "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-heading: "Space Grotesk", "Inter", system-ui, sans-serif;

  /* ---- Layout & Motion ---- */
  --max:         1280px;    /* Maximum container width */
  --gap:         clamp(14px, 2vw, 24px);
  --radius:      14px;
  --header-h:    72px;
  --gallery-row: 235px;     /* Target row height for portfolio galleries */
  --ease:        cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* ---------- Base & Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.65 var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, video, iframe, object { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  line-height: 1.15;
  margin: 0 0 0.5em;
  letter-spacing: -0.015em;
}
h1 { font-size: clamp(2.2rem, 5vw, 3.9rem); }
h2 { font-size: clamp(1.55rem, 3vw, 2.35rem); }
h3 { font-size: 1.22rem; }
p { margin: 0 0 1em; }
ul { padding-left: 1.2em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.skip-link {
  position: absolute;
  left: -999px;
  top: 10px;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 8px 14px;
  z-index: 400;
  border-radius: 8px;
  font-weight: 600;
}
.skip-link:focus { left: 10px; }

.container { width: min(100% - 2 * var(--gap), var(--max)); margin-inline: auto; }
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ==========================================================================
   HEADER & NAVIGATION
   Note: backdrop-filter is placed on ::before so position:fixed on the mobile
   drawer stays anchored to the viewport instead of the header box.
   ========================================================================== */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--header-h);
  z-index: 200;
  display: flex;
  align-items: center;
}
.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(7, 8, 12, 0.82), rgba(7, 8, 12, 0));
  transition: background 0.35s var(--ease), box-shadow 0.35s var(--ease), backdrop-filter 0.35s var(--ease);
}
.site-header.solid::before,
.site-header.scrolled::before,
.nav-open .site-header::before {
  background: rgba(9, 10, 14, 0.93);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 var(--line);
}

.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand {
  font: 700 1.2rem var(--font-heading);
  color: var(--text);
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  gap: 11px;
  flex-shrink: 0;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff, var(--accent) 45%, var(--accent-2));
  box-shadow: 0 0 16px var(--accent);
}
.brand small {
  font: 500 0.68rem var(--font-body);
  color: var(--muted);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  display: block;
  margin-top: -1px;
}

.nav ul { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 4px; }
.nav a {
  color: var(--text);
  display: block;
  padding: 9px 13px;
  border-radius: 10px;
  font-weight: 500;
  font-size: 0.94rem;
  transition: color 0.2s, background 0.2s;
}
.nav a:hover,
.nav a[aria-current="page"] { text-decoration: none; color: var(--accent); }

.nav .has-sub { position: relative; }
.nav .has-sub > a::after { content: "\25BE"; margin-left: 5px; font-size: 0.75em; opacity: 0.7; }
.nav .submenu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 245px;
  padding: 8px;
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.6);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: 0.2s var(--ease);
}
.nav .has-sub:hover .submenu,
.nav .has-sub:focus-within .submenu { opacity: 1; visibility: visible; transform: none; }
.nav .submenu li { display: block; }
.nav .submenu a { padding: 9px 12px; font-size: 0.9rem; border-radius: 8px; }
.nav .submenu a:hover { background: var(--surface-2); }

.nav .nav-cta a {
  margin-left: 6px;
  padding: 9px 16px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--accent-ink);
  font-weight: 600;
}
.nav .nav-cta a:hover { color: var(--accent-ink); filter: brightness(1.08); }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  width: 44px;
  height: 44px;
  cursor: pointer;
  position: relative;
}
.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: 0.25s var(--ease);
}
.nav-toggle span { top: 20px; }
.nav-toggle span::before { left: 0; right: 0; top: -7px; }
.nav-toggle span::after  { left: 0; right: 0; top: 7px; }
.nav-open .nav-toggle span { background: transparent; }
.nav-open .nav-toggle span::before { top: 0; transform: rotate(45deg); }
.nav-open .nav-toggle span::after  { top: 0; transform: rotate(-45deg); }

@media (max-width: 1020px) {
  .nav-toggle { display: block; }
  .nav {
    display: none;
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(9, 10, 14, 0.98);
    padding: 12px var(--gap) 48px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    border-top: 1px solid var(--line);
  }
  body.nav-open { overflow: hidden; }
  body.nav-open .nav { display: block; }
  .nav ul { flex-direction: column; align-items: stretch; gap: 0; }
  .nav a { padding: 13px 8px; font-size: 1.06rem; border-bottom: 1px solid var(--line); border-radius: 0; }
  .nav .submenu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: 0;
    background: none;
    padding: 4px 0 8px 16px;
    min-width: 0;
  }
  .nav .submenu a { font-size: 0.95rem; border: 0; padding: 8px 8px; color: var(--muted); }
  .nav .has-sub > a::after { display: none; }
  .nav .nav-cta a { margin: 18px 0 0; text-align: center; border: 0; border-radius: 999px; padding: 13px 20px; }
}

/* ==========================================================================
   FULLSCREEN HERO SLIDER (Home Page)
   ========================================================================== */
.hero {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 540px;
  overflow: hidden;
  background: #000;
}
.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1.35s ease;
  pointer-events: none;
}
.hero-slide.active { opacity: 1; z-index: 1; pointer-events: auto; }
.hero-slide img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.03); }
.hero-slide.active img { animation: kenburns 9s ease-out forwards; }
@keyframes kenburns {
  from { transform: scale(1.03); }
  to   { transform: scale(1.10) translate(-0.8%, -0.4%); }
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(6, 7, 10, 0.50) 0%, rgba(6, 7, 10, 0) 28%, rgba(6, 7, 10, 0.16) 55%, rgba(9, 10, 14, 0.95) 100%),
    linear-gradient(90deg, rgba(6, 7, 10, 0.62) 0%, rgba(6, 7, 10, 0) 62%);
}
.hero-content {
  position: absolute;
  z-index: 3;
  left: 0;
  right: 0;
  bottom: clamp(76px, 14vh, 148px);
}
.hero-eyebrow {
  color: var(--accent);
  font: 600 0.82rem var(--font-body);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.hero h1 { margin-bottom: 16px; text-shadow: 0 4px 40px rgba(0, 0, 0, 0.65); max-width: 15ch; }
.hero p.lead {
  font-size: clamp(1rem, 1.55vw, 1.22rem);
  color: #dcdad3;
  max-width: 52ch;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.75);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }

.hero-meta-bar {
  position: absolute;
  z-index: 4;
  left: var(--gap);
  right: var(--gap);
  bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  pointer-events: none;
}
.hero-counter {
  font: 600 0.78rem var(--font-heading);
  letter-spacing: 0.18em;
  color: rgba(255, 255, 255, 0.72);
}
.hero-dots { display: flex; gap: 10px; pointer-events: auto; }
.hero-dots button {
  width: 36px;
  height: 4px;
  border: 0;
  padding: 0;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.28);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.hero-dots button.active::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--accent);
  transform-origin: left;
  animation: dotfill var(--slide-ms, 6500ms) linear forwards;
}
.hero.paused .hero-dots button.active::after { animation-play-state: paused; }
@keyframes dotfill { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.hero-caption {
  font-size: 0.85rem;
  color: #dad8d1;
  text-align: right;
  pointer-events: auto;
}
.hero-caption a {
  color: #eceae4;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(15, 17, 24, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(6px);
  transition: border-color 0.2s, color 0.2s;
}
.hero-caption a:hover { color: var(--accent); border-color: var(--line-glow); text-decoration: none; }

.hero-arrow {
  position: absolute;
  z-index: 4;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(9, 10, 14, 0.38);
  color: #fff;
  font-size: 1.4rem;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: 0.2s;
}
.hero-arrow:hover { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.hero-arrow.prev { left: 20px; }
.hero-arrow.next { right: 20px; }

@media (max-width: 760px) {
  .hero-arrow, .hero-caption, .hero-counter { display: none; }
  .hero-meta-bar { justify-content: center; }
  .hero-content { bottom: 84px; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-slide.active img { animation: none; }
  html { scroll-behavior: auto; }
}

/* ==========================================================================
   BUTTONS, PILLS & BADGES
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.94rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.2s var(--ease), filter 0.2s, background 0.2s, border-color 0.2s;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(6px);
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.13); border-color: var(--line-glow); }

.badge {
  display: inline-block;
  padding: 4px 11px;
  border-radius: 999px;
  font: 700 0.69rem var(--font-body);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: rgba(255, 180, 84, 0.15);
  color: var(--accent);
}
.badge.free { background: rgba(95, 214, 164, 0.15); color: var(--free); }

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
}
.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  transition: 0.2s var(--ease);
}
.filter-pill small { opacity: 0.65; font-size: 0.78rem; }
.filter-pill:hover { color: var(--text); border-color: var(--line-glow); text-decoration: none; }
.filter-pill.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--accent-ink);
  border-color: transparent;
  font-weight: 600;
}
.filter-pill.active small { opacity: 0.8; }

/* ==========================================================================
   SECTIONS & PAGE HEADERS
   ========================================================================== */
main { display: block; }
.section { padding: clamp(52px, 8vw, 104px) 0; }
.section.alt { background: linear-gradient(180deg, var(--bg), var(--bg-alt) 50%, var(--bg)); }
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: clamp(24px, 4vw, 42px);
}
.eyebrow {
  color: var(--accent);
  font: 600 0.77rem var(--font-body);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  margin-bottom: 10px;
  display: block;
}
.section-head p { color: var(--muted); max-width: 62ch; margin: 0; }

.page-hero {
  padding: calc(var(--header-h) + clamp(38px, 6vw, 82px)) 0 clamp(22px, 3.5vw, 40px);
  background: radial-gradient(1000px 380px at 18% -10%, rgba(255, 180, 84, 0.13), transparent 72%);
}
.page-hero p { color: var(--muted); font-size: 1.08rem; max-width: none; margin: 0; }

.breadcrumb { font-size: 0.85rem; color: var(--muted); margin-bottom: 16px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .sep { opacity: 0.45; }

.prose { max-width: 74ch; }
.prose h2 { margin-top: 1.7em; }
.prose h3 { margin-top: 1.3em; }
.prose p, .prose li { color: #d3d1cb; }

/* ---------- Intro Pillars (Home) ---------- */
.pillars { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--gap); }
.pillar {
  padding: 26px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color 0.25s;
}
.pillar:hover { border-color: var(--line-glow); }
.pillar b { font: 600 1.15rem var(--font-heading); display: block; margin-bottom: 6px; color: var(--text); }
.pillar span { color: var(--muted); font-size: 0.95rem; }

/* ---------- Portfolio Category Tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 350px), 1fr)); gap: var(--gap); }
.tile {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  isolation: isolate;
  transition: border-color 0.3s, transform 0.3s var(--ease);
}
.tile img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.8s var(--ease); }
.tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 42%, rgba(5, 6, 9, 0.86));
}
.tile:hover { text-decoration: none; border-color: var(--line-glow); transform: translateY(-3px); }
.tile:hover img { transform: scale(1.06); }
.tile-label {
  position: absolute;
  z-index: 2;
  left: 20px;
  right: 20px;
  bottom: 16px;
  color: #fff;
  font: 600 1.22rem var(--font-heading);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.tile-label small { font: 500 0.8rem var(--font-body); color: #d2d0ca; opacity: 0.9; }
.tile.wide { grid-column: span 2; }
@media (max-width: 760px) { .tile.wide { grid-column: auto; } }

/* ---------- Store & Blog Cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: var(--gap); }
.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.3s var(--ease), border-color 0.3s, background 0.3s;
  color: var(--text);
}
.card:hover { transform: translateY(-5px); border-color: var(--line-glow); background: var(--surface-2); text-decoration: none; }
.card-media { aspect-ratio: 16 / 10; overflow: hidden; background: #000; position: relative; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.8s var(--ease); }
.card:hover .card-media img { transform: scale(1.06); }
.card-media .badge { position: absolute; top: 12px; left: 12px; backdrop-filter: blur(8px); background: rgba(9, 10, 14, 0.76); }
.card-body { padding: 20px 22px 24px; display: flex; flex-direction: column; gap: 7px; flex: 1; }
.card-body h3 { margin: 0; }
.card-body p { color: var(--muted); font-size: 0.94rem; margin: 0; }
.card-meta { font-size: 0.8rem; color: var(--muted); letter-spacing: 0.04em; }
.card-more { margin-top: auto; padding-top: 12px; color: var(--accent); font-weight: 600; font-size: 0.92rem; }

.feature {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  overflow: hidden;
  color: var(--text);
  transition: border-color 0.3s;
}
.feature:hover { border-color: var(--line-glow); }
.feature-media { min-height: 330px; position: relative; display: block; overflow: hidden; }
.feature-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.8s var(--ease); }
.feature:hover .feature-media img { transform: scale(1.04); }
.feature-body { padding: clamp(24px, 4vw, 48px); display: flex; flex-direction: column; justify-content: center; gap: 12px; }
.feature-body p { color: var(--muted); margin: 0; }
.feature-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
@media (max-width: 860px) {
  .feature { grid-template-columns: 1fr; }
  .feature-media { min-height: 220px; aspect-ratio: 16 / 9; }
}

/* ---------- Course Banner ---------- */
.promo {
  position: relative;
  overflow: hidden;
  border-radius: calc(var(--radius) + 6px);
  padding: clamp(32px, 6vw, 76px);
  border: 1px solid var(--line);
  isolation: isolate;
}
.promo > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.promo::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, rgba(9, 10, 14, 0.94) 26%, rgba(9, 10, 14, 0.38));
}
.promo p { color: #d6d4ce; max-width: 54ch; }

/* ==========================================================================
   GALLERY (Uncropped Justified Rows) + LIGHTBOX
   ========================================================================== */
.gallery { display: flex; flex-wrap: wrap; gap: 10px; }
.gallery::after { content: ""; flex: 10 1 360px; }
.gallery a {
  --ar: 1.778;
  flex-grow: calc(var(--ar) * 10);
  flex-basis: calc(var(--ar) * var(--gallery-row));
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  cursor: zoom-in;
  transition: border-color 0.25s;
}
.gallery a img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s var(--ease), filter 0.3s; }
.gallery a:hover { border-color: var(--line-glow); }
.gallery a:hover img { transform: scale(1.04); filter: brightness(1.08); }

/* Special layout when a section only has 2-3 images (e.g. Compositing) */
.gallery.gallery-few {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 560px));
  gap: 18px;
}
.gallery.gallery-few::after { display: none; }
.gallery.gallery-few a { width: 100%; height: auto; }
.gallery.gallery-few a img { height: auto; object-fit: contain; }

@media (max-width: 640px) {
  .gallery { gap: 8px; }
  .gallery a { flex-basis: calc(var(--ar) * 145px); }
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(4, 5, 8, 0.96);
  display: none;
  align-items: center;
  justify-content: center;
  touch-action: pan-y;
}
.lightbox.open { display: flex; animation: fadein 0.22s ease; }
@keyframes fadein { from { opacity: 0; } }
.lightbox img {
  max-width: 94vw;
  max-height: 88vh;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.7);
}
.lb-btn {
  position: absolute;
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.16);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  font-size: 1.45rem;
  cursor: pointer;
  transition: 0.2s;
}
.lb-btn:hover { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.lb-close { top: 18px; right: 18px; }
.lb-prev  { left: 18px; top: 50%; margin-top: -25px; }
.lb-next  { right: 18px; top: 50%; margin-top: -25px; }
.lb-count {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  color: #b5b8c4;
  font-size: 0.85rem;
  letter-spacing: 0.12em;
}
@media (max-width: 640px) {
  .lb-prev, .lb-next { top: auto; bottom: 14px; margin: 0; }
  .lb-prev { left: 14px; }
  .lb-next { right: 14px; }
}
body.lb-lock { overflow: hidden; }

/* ==========================================================================
   LECTURES & PUBLICATIONS
   ========================================================================== */
.lecture-list { display: grid; gap: var(--gap); }
.lecture {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.25s;
}
.lecture:hover { border-color: var(--line-glow); }
.lecture.no-media { grid-template-columns: 1fr; }
.lecture-media { background: #000; }
.lecture-media img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 4 / 3; }
.lecture-body { padding: 22px 26px; display: flex; flex-direction: column; gap: 8px; }
.lecture-body h3 { margin: 0; }
.lecture-body p { margin: 0; color: #c7c5bf; }
.facts { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 0.85rem; color: var(--muted); }
.facts b { color: var(--text); font-weight: 600; }
.lecture-body .btn { align-self: flex-start; margin-top: 8px; padding: 9px 18px; font-size: 0.88rem; }
@media (max-width: 720px) {
  .lecture { grid-template-columns: 1fr; }
  .lecture-media img { aspect-ratio: 16 / 9; }
}

/* ==========================================================================
   RESUME (High-DPI Visual PDF Pages + Download)
   ========================================================================== */
.resume-sheets {
  display: grid;
  gap: 28px;
  max-width: 920px;
  margin-inline: auto;
}
.resume-sheet {
  display: block;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  cursor: zoom-in;
  transition: transform 0.25s var(--ease), border-color 0.25s;
}
.resume-sheet:hover { transform: translateY(-2px); border-color: var(--line-glow); }
.resume-sheet img { width: 100%; height: auto; }

/* ==========================================================================
   STORE PRODUCT PAGES
   ========================================================================== */
.product-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 52px);
  align-items: start;
}
.product-side {
  position: sticky;
  top: calc(var(--header-h) + 20px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  display: grid;
  gap: 14px;
}
.product-side .btn { justify-content: center; width: 100%; }
.product-side small { color: var(--muted); line-height: 1.45; }

.video-grid { display: grid; gap: 16px; }
.video-embed {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000 center / cover no-repeat;
  border: 1px solid var(--line);
  width: 100%;
  cursor: pointer;
  padding: 0;
}
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-embed .play {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 72px;
  height: 72px;
  margin: -36px 0 0 -36px;
  border-radius: 50%;
  background: rgba(9, 10, 14, 0.72);
  border: 2px solid #fff;
  transition: 0.2s;
}
.video-embed .play::after {
  content: "";
  position: absolute;
  left: 28px;
  top: 20px;
  border-left: 22px solid #fff;
  border-top: 14px solid transparent;
  border-bottom: 14px solid transparent;
}
.video-embed:hover .play { background: var(--accent); border-color: var(--accent); }
.video-embed:hover .play::after { border-left-color: var(--accent-ink); }

.spec-block { margin-top: 34px; }
.spec-block h2 { font-size: 1.38rem; }
.spec-block li { color: #d3d1cb; margin-bottom: 0.35em; }
@media (max-width: 900px) {
  .product-layout { grid-template-columns: 1fr; }
  .product-side { position: static; order: -1; }
}

/* ==========================================================================
   DOCUMENTATION PAGE
   ========================================================================== */
.doc-layout {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: clamp(24px, 4vw, 52px);
  align-items: start;
}
.doc-layout > * { min-width: 0; }
.doc-toc {
  position: sticky;
  top: calc(var(--header-h) + 20px);
  max-height: calc(100vh - var(--header-h) - 40px);
  overflow-y: auto;
  font-size: 0.87rem;
  border-left: 1px solid var(--line);
  padding-left: 16px;
}
.doc-toc a { display: block; color: var(--muted); padding: 5px 0; line-height: 1.35; overflow-wrap: anywhere; }
.doc-toc a:hover { color: var(--accent); text-decoration: none; }
.doc-toc strong {
  display: block;
  margin-bottom: 8px;
  font: 600 0.78rem var(--font-body);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text);
}
.doc-body { max-width: 860px; overflow-wrap: anywhere; }
.doc-body h2 {
  margin-top: 2.2em;
  padding-top: 0.7em;
  border-top: 1px solid var(--line);
  scroll-margin-top: calc(var(--header-h) + 18px);
  font-size: 1.55rem;
}
.doc-body h2:first-child { margin-top: 0; border: 0; padding-top: 0; }
.doc-body p, .doc-body li { color: #d3d1cb; }
.doc-figs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr));
  gap: 12px;
  margin: 18px 0;
}
.doc-figs a { display: block; cursor: zoom-in; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); background: #000; }
.doc-figs a:hover { border-color: var(--line-glow); }
.doc-figs img { width: 100%; height: auto; }
@media (max-width: 960px) {
  .doc-layout { grid-template-columns: 1fr; }
  .doc-toc {
    position: static;
    max-height: none;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px;
    background: var(--surface);
  }
}

/* ==========================================================================
   BLOG ARTICLE BODY
   ========================================================================== */
.blog-body {
  max-width: 900px;
  margin-inline: auto;
  overflow-wrap: anywhere;
}
.blog-body h2 {
  margin-top: 2.2em;
  padding-top: 0.7em;
  border-top: 1px solid var(--line);
  font-size: clamp(1.45rem, 2.5vw, 1.9rem);
}
.blog-body h3 {
  margin-top: 1.8em;
  font-size: 1.25rem;
  color: var(--text);
}
.blog-body p, .blog-body li { color: #d5d3cd; font-size: 1.04rem; line-height: 1.72; }
.blog-body ol { padding-left: 1.35em; }
.blog-body ol > li { margin-bottom: 1.15em; }
.blog-figure { margin: 22px 0 28px; }
.blog-figure a {
  display: inline-block;
  max-width: 100%;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #000;
  cursor: zoom-in;
  transition: border-color 0.25s;
}
.blog-figure a:hover { border-color: var(--line-glow); }
.blog-figure img { width: auto; max-width: 100%; height: auto; display: block; }
.blog-body .video-embed { margin: 24px 0 28px; }

/* ==========================================================================
   GOOGLE ADSENSE CONTAINER (Controlled by assets/js/site-config.js)
   ========================================================================== */
.ad-container { display: none; }
.ad-container.ad-active {
  display: block;
  margin: 44px auto;
  text-align: center;
  min-height: 100px;
}
.ad-container small {
  display: block;
  color: var(--muted);
  font-size: 0.68rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer { border-top: 1px solid var(--line); padding: 56px 0 32px; margin-top: 40px; background: #07080b; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; }
.footer-grid h4 {
  font: 600 0.78rem var(--font-body);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
}
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.footer-grid a { color: var(--text); font-size: 0.94rem; }
.footer-grid a:hover { color: var(--accent); }
.footer-grid p { color: var(--muted); font-size: 0.92rem; max-width: 34ch; }
.copyright {
  margin-top: 40px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------- Scroll Reveal ---------- */
.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.75s var(--ease), transform 0.75s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .js .reveal { opacity: 1; transform: none; transition: none; } }

.notfound { min-height: 78vh; display: grid; place-items: center; text-align: center; padding: 120px 0 60px; }
.notfound h1 {
  font-size: clamp(5rem, 18vw, 10.5rem);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin: 0;
}
