/* ─────────────────────────────────────────────────────
   jayhern.com — homepage
   Editorial dark grid, project-forward. Uses design-system tokens.
   ───────────────────────────────────────────────────── */

:root {
  --bg-primary: #08080c;
  --bg-surface: #0e0e14;
  --bg-card: #12121a;
  --bg-card-hover: #18182a;
  --text-primary: #e8e6e3;
  --text-secondary: rgba(232, 230, 227, 0.6);
  --text-tertiary: rgba(232, 230, 227, 0.35);
  --text-faint: rgba(232, 230, 227, 0.18);
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(255, 255, 255, 0.14);
  --accent-indigo: #6366f1;
  --accent-violet: #8b5cf6;
  --accent-rose: #f43f5e;
  --accent-amber: #f59e0b;
  --accent-emerald: #10b981;
  --accent-cyan: #06b6d4;
  --accent-warm: #f5a96d;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Menlo, monospace;
  --font-serif: 'Playfair Display', Georgia, serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.55;
  letter-spacing: 0.005em;
  -webkit-font-smoothing: antialiased;
}
body {
  background:
    radial-gradient(ellipse 60% 50% at 12% 8%,  rgba(80, 40, 130, 0.28) 0%, transparent 55%),
    radial-gradient(ellipse 55% 45% at 88% 6%,  rgba(180, 80, 40, 0.18) 0%, transparent 55%),
    radial-gradient(ellipse 70% 50% at 60% 100%, rgba(40, 70, 140, 0.22) 0%, transparent 55%),
    radial-gradient(circle at 75% 55%, rgba(245, 169, 109, 0.10) 0%, transparent 35%),
    linear-gradient(180deg, #050510 0%, #08080e 30%, #0a0a14 55%, #07060c 80%, #050407 100%);
  background-attachment: fixed;
  position: relative;
  min-height: 100vh;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  opacity: 0.7;
  pointer-events: none;
  z-index: 0;
  mix-blend-mode: overlay;
}

a { color: inherit; text-decoration: none; }
::selection { background: var(--accent-warm); color: #1a0f06; }

/* ─── NAV ─── */
.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  padding: 18px 32px;
  background: rgba(8, 8, 12, 0.7);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-subtle);
}
.nav-inner {
  max-width: 1320px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--text-primary);
}
.nav-links {
  list-style: none;
  display: flex;
  gap: 28px;
}
.nav-link {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  transition: color 0.2s ease;
}
.nav-link:hover { color: var(--text-primary); }
.nav-toggle { display: none; background: none; border: 0; cursor: pointer; }
.nav-link--solo {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  transition: color 0.2s ease;
}
.nav-link--solo:hover { color: var(--accent-warm); }

/* ─── HERO ─── */
.hero {
  max-width: 1320px;
  margin: 0 auto;
  padding: 140px 32px 60px;
  position: relative;
  z-index: 2;
}
.grid { position: relative; z-index: 2; }
.site-footer { position: relative; z-index: 2; }
.hero__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  color: var(--text-tertiary);
  text-transform: lowercase;
  margin-bottom: 36px;
}
.hero__dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent-warm);
  box-shadow: 0 0 10px var(--accent-warm);
  animation: pulse 2.2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 1; }
}
.hero__title {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(48px, 9vw, 128px);
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin-bottom: 28px;
}
.hero__title span { display: block; }
.hero__title--em {
  font-family: var(--font-sans);
  font-style: normal;
  font-weight: 900;
  letter-spacing: -0.045em;
  line-height: 1.15;
  padding-bottom: 0.12em;
  /* default fallback — overridden by a random .mk-* variant via JS */
  background: linear-gradient(135deg, #ff8a4a 0%, #ff4f8a 50%, #b85cff 100%);
  background-size: 220% 220%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* ───── "making" — 15 random variants. JS picks one on page load. ───── */
@keyframes mk-shift {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}
@keyframes mk-shift-fast {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 200% 50%; }
}
@keyframes mk-flicker {
  0%, 100% { opacity: 1; }
  10%      { opacity: 0.78; }
  12%      { opacity: 1; }
  35%      { opacity: 0.88; }
  37%      { opacity: 1; }
  60%      { opacity: 0.92; }
}
@keyframes mk-blob {
  0%, 100% { background-position: 0% 0%, 100% 100%, 50% 50%, 0 0; }
  25%      { background-position: 80% 30%, 20% 70%, 90% 20%, 0 0; }
  50%      { background-position: 30% 80%, 70% 20%, 10% 60%, 0 0; }
  75%      { background-position: 60% 40%, 40% 60%, 70% 90%, 0 0; }
}
@keyframes mk-pulse {
  0%, 100% { filter: brightness(1); }
  50%      { filter: brightness(1.25); }
}

/* 01 — sunset (warm golden sky) */
.mk-sunset {
  background-image: linear-gradient(135deg, #ffb88a 0%, #ff7a4a 30%, #ff4a88 60%, #ffd560 100%);
  animation: mk-shift 9s ease-in-out infinite;
  text-shadow: 0 0 80px rgba(255, 122, 74, 0.45);
}

/* 02 — aurora (northern lights flow) */
.mk-aurora {
  background-image: linear-gradient(120deg, #4ade80 0%, #06b6d4 35%, #8b5cf6 70%, #ec4899 100%);
  animation: mk-shift 11s ease-in-out infinite;
  text-shadow: 0 0 80px rgba(139, 92, 246, 0.4);
}

/* 03 — holographic (full rainbow shift) */
.mk-holographic {
  background-image: linear-gradient(90deg, #ff4a6a 0%, #ffaa4a 18%, #4adfff 36%, #b85cff 54%, #4ade80 72%, #ff4a6a 100%);
  background-size: 400% 100%;
  animation: mk-shift-fast 7s linear infinite;
  text-shadow: 0 0 70px rgba(184, 100, 255, 0.4);
}

/* 04 — neon (electric pink/cyan with flicker) */
.mk-neon {
  background-image: linear-gradient(135deg, #ff00d4 0%, #00ffff 50%, #ff00aa 100%);
  animation: mk-shift 4s ease-in-out infinite, mk-flicker 6s ease-in-out infinite;
  text-shadow:
    0 0 20px rgba(255, 0, 212, 0.55),
    0 0 70px rgba(0, 255, 255, 0.4);
}

/* 05 — magma (deep volcanic) */
.mk-magma {
  background-image: linear-gradient(135deg, #ff4500 0%, #ff8c00 35%, #ffd700 70%, #ff4500 100%);
  background-size: 250% 250%;
  animation: mk-shift 8s ease-in-out infinite;
  text-shadow: 0 0 70px rgba(255, 100, 0, 0.55);
}

/* 06 — mercury (liquid silver) */
.mk-mercury {
  background-image: linear-gradient(110deg, #e8e8e8 0%, #aaaaaa 20%, #ffffff 40%, #888888 60%, #d4d4d4 80%, #f0f0f0 100%);
  background-size: 300% 100%;
  animation: mk-shift-fast 6s ease-in-out infinite;
  text-shadow: 0 0 50px rgba(255, 255, 255, 0.35);
}

/* 07 — frost (icy crystal) */
.mk-frost {
  background-image: linear-gradient(135deg, #c8e8ff 0%, #6fa6ff 30%, #ffffff 50%, #a8c8ff 70%, #c8e8ff 100%);
  background-size: 220% 220%;
  animation: mk-shift 10s ease-in-out infinite;
  text-shadow: 0 0 60px rgba(180, 220, 255, 0.5);
}

/* 08 — iridescent (oil slick) */
.mk-iridescent {
  background-image: linear-gradient(135deg, #ff6ec7 0%, #a06fff 25%, #00d4ff 50%, #6effc8 75%, #ff6ec7 100%);
  background-size: 300% 300%;
  animation: mk-shift 12s ease-in-out infinite;
  text-shadow: 0 0 70px rgba(255, 110, 199, 0.4);
}

/* 09 — galaxy (cosmic nebula) */
.mk-galaxy {
  background-image:
    radial-gradient(circle at 25% 40%, #b85cff 0%, transparent 35%),
    radial-gradient(circle at 75% 60%, #4a6efc 0%, transparent 40%),
    linear-gradient(135deg, #1a1040 0%, #4a1a6a 40%, #2a2a8a 70%, #1a1040 100%);
  background-size: 250% 250%, 250% 250%, 220% 220%, 100% 100%;
  animation: mk-blob 16s ease-in-out infinite;
  text-shadow: 0 0 80px rgba(184, 92, 255, 0.45);
}

/* 10 — lavalamp (drifting blobs) */
.mk-lavalamp {
  background-image:
    radial-gradient(circle at 20% 30%, #ff4a78 0%, transparent 38%),
    radial-gradient(circle at 75% 70%, #b85cff 0%, transparent 42%),
    radial-gradient(circle at 50% 50%, #ff8a4a 0%, transparent 32%),
    linear-gradient(135deg, #2a1a3a 0%, #1a1a4a 50%, #3a1a4a 100%);
  background-size: 200% 200%, 220% 220%, 180% 180%, 100% 100%;
  animation: mk-blob 14s ease-in-out infinite;
  text-shadow: 0 0 70px rgba(255, 74, 120, 0.4);
}

/* 11 — plasma (vibrant swirl) */
.mk-plasma {
  background-image:
    radial-gradient(ellipse at 50% 50%, #ff00ff 0%, transparent 55%),
    linear-gradient(135deg, #00ffff 0%, #ff00cc 50%, #00ffff 100%);
  background-size: 300% 300%, 250% 100%;
  animation: mk-blob 10s ease-in-out infinite;
  text-shadow: 0 0 60px rgba(255, 0, 200, 0.5);
}

/* 12 — ember (warm coals, gentle pulse) */
.mk-ember {
  background-image: linear-gradient(180deg, #ff8a4a 0%, #ff4a4a 45%, #8a1a1a 100%);
  background-size: 100% 220%;
  animation: mk-shift 9s ease-in-out infinite, mk-pulse 4s ease-in-out infinite;
  text-shadow: 0 0 70px rgba(255, 74, 74, 0.55);
}

/* 13 — forest (deep greens) */
.mk-forest {
  background-image: linear-gradient(135deg, #4ade80 0%, #2a8a4a 30%, #6effc8 60%, #1a5a2a 100%);
  background-size: 230% 230%;
  animation: mk-shift 11s ease-in-out infinite;
  text-shadow: 0 0 60px rgba(74, 222, 128, 0.4);
}

/* 14 — electric (sharp blue current) */
.mk-electric {
  background-image: linear-gradient(135deg, #00d4ff 0%, #6fa6ff 40%, #b85cff 80%, #00d4ff 100%);
  background-size: 250% 250%;
  animation: mk-shift-fast 5s ease-in-out infinite;
  text-shadow:
    0 0 30px rgba(0, 212, 255, 0.55),
    0 0 80px rgba(184, 92, 255, 0.35);
}

/* 15 — peach (soft warm) */
.mk-peach {
  background-image: linear-gradient(135deg, #ffd5b8 0%, #ff8a6a 35%, #ffa890 65%, #ffe0c8 100%);
  background-size: 220% 220%;
  animation: mk-shift 10s ease-in-out infinite;
  text-shadow: 0 0 60px rgba(255, 138, 106, 0.4);
}

.hero__sub {
  font-size: 17px;
  color: var(--text-secondary);
  max-width: 560px;
  line-height: 1.55;
}

/* ─── GRID ─── */
.grid {
  max-width: 1320px;
  margin: 0 auto;
  padding: 30px 32px 100px;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
  grid-auto-flow: dense;
  grid-auto-rows: minmax(min-content, 1fr);
}

/* ─── TILE base ─── */
.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 26px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  overflow: hidden;
  transition: transform 0.45s cubic-bezier(0.2, 0.7, 0.2, 1),
              border-color 0.3s ease,
              background 0.3s ease;
  isolation: isolate;
}
.tile:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: translateY(-4px);
}
.tile::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}
.tile-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 14px;
}
.tile-title {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: clamp(20px, 2.4vw, 32px);
  line-height: 1.08;
  letter-spacing: -0.015em;
  margin-bottom: 12px;
  color: var(--text-primary);
}
.tile-title--serif {
  font-family: var(--font-serif);
  font-weight: 400;
  letter-spacing: -0.01em;
}
.tile-desc {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.55;
  max-width: 480px;
  margin-bottom: 22px;
}
.tile-cta {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.tile-cta__arrow {
  transition: transform 0.25s ease;
  display: inline-block;
}
.tile:hover .tile-cta__arrow { transform: translateX(4px); }
.tile-content {
  position: relative;
  z-index: 2;
}

/* ─── SIZES ─── */
.tile--lg   { grid-column: span 4; min-height: 460px; }
/* Two equal squares splitting the row down the middle — the two headline tiles */
.tile--half { grid-column: span 3; aspect-ratio: 1 / 1; min-height: 380px; }
.tile--md   { grid-column: span 2; min-height: 320px; }
.tile--wide { grid-column: span 4; min-height: 240px; }
.tile--sm   { grid-column: span 2; min-height: 240px; }
.tile--xs   { grid-column: span 1; min-height: 220px; padding: 18px; }

.tile-content--xs {
  padding: 14px 16px 16px;
}
.tile-title-xs {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 17px;
  color: var(--text-primary);
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.01em;
}
.tile-content--xs .tile-label {
  display: block;
  margin-bottom: 4px;
}
.tile--xs .tile-cta__arrow {
  font-size: 14px;
  transition: transform 0.25s ease;
  display: inline-block;
}
.tile--xs:hover .tile-cta__arrow { transform: translateX(4px); }

/* ───── tile: Cursor Field ───── */
.tile--cursor {
  background: linear-gradient(160deg, #0a0a14 0%, #0e0e1c 100%);
}
.tile--cursor .tile-content {
  position: relative;
  z-index: 2;
  max-width: 60%;
}
.tile-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  opacity: 0.85;
}
.tile--cursor:hover .tile-canvas { opacity: 1; }

/* ───── tile: Transmission 001 (editorial) ───── */
.tile--trs {
  background: linear-gradient(160deg, #15110a 0%, #1a140c 100%);
  border-color: rgba(245, 169, 109, 0.12);
}
.tile--trs .tile-title em {
  font-style: italic;
  color: var(--accent-warm);
}
.trs-hint {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  color: var(--accent-warm);
  opacity: 0.7;
  margin-left: 4px;
}

/* Shared overlay pattern for tiles where the canvas is full-tile background */
.tile-content--overlay {
  position: relative;
  z-index: 2;
  margin: -26px;
  margin-top: auto;
  padding: 26px;
  background: linear-gradient(180deg, transparent 0%, rgba(8, 8, 14, 0.92) 55%, rgba(8, 8, 14, 0.98) 100%);
  border-radius: 0 0 14px 14px;
}
.tile--trs .tile-content--overlay {
  background: linear-gradient(180deg, transparent 0%, rgba(21, 17, 10, 0.94) 55%, rgba(21, 17, 10, 0.99) 100%);
}
.tile--atlas .tile-content--overlay {
  background: linear-gradient(180deg, transparent 0%, rgba(10, 16, 24, 0.94) 55%, rgba(10, 16, 24, 0.99) 100%);
}
.tile--sphere .tile-content--overlay {
  background: linear-gradient(180deg, transparent 0%, rgba(6, 6, 10, 0.94) 55%, rgba(6, 6, 10, 0.99) 100%);
}
.tile-marks {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-warm);
  margin-bottom: 28px;
}
.trs-date { color: var(--text-tertiary); margin-left: 8px; }
.tile--trs .tile-title { color: var(--text-primary); }
.tile--trs:hover { border-color: rgba(245, 169, 109, 0.3); }
.tile--trs:hover .trs-marker--dim {
  border-color: rgba(245, 169, 109, 0.35);
  color: rgba(245, 169, 109, 0.6);
}

/* ───── tile: La Ventanita (snake fills the whole tile) ───── */
.tile--ventanita {
  background: linear-gradient(160deg, #1a0c08 0%, #1f1410 100%);
  border-color: rgba(244, 63, 94, 0.10);
}
.v-snake-fill {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: grid;
  grid-template-columns: repeat(14, 1fr);
  grid-template-rows: repeat(10, 1fr);
  gap: 3px;
  padding: 14px;
}
.v-snake-fill > span {
  border-radius: 2px;
  background: rgba(244, 63, 94, 0.04);
  transition: background 0.18s ease, box-shadow 0.18s ease;
}
.v-snake-fill > span.snake {
  background: var(--accent-warm);
  box-shadow: 0 0 6px rgba(245, 169, 109, 0.6);
}
.v-snake-fill > span.snake-head {
  background: #ffd5a8;
  box-shadow: 0 0 12px rgba(255, 213, 168, 0.95);
}
.v-snake-fill > span.food {
  background: var(--accent-rose);
  box-shadow: 0 0 10px rgba(244, 63, 94, 0.85);
  animation: food-pulse 1.4s ease-in-out infinite;
}
@keyframes food-pulse {
  0%, 100% { opacity: 0.85; }
  50% { opacity: 1; }
}
.tile--ventanita .tile-content {
  position: relative;
  z-index: 2;
  background: linear-gradient(180deg, transparent, rgba(26, 12, 8, 0.92) 55%, rgba(26, 12, 8, 0.96) 100%);
  margin: -26px;
  margin-top: auto;
  padding: 26px;
  border-radius: 0 0 14px 14px;
}
.tile--ventanita:hover { border-color: rgba(244, 63, 94, 0.4); }

/* ───── tile: AI Journey (mini particle sphere) ───── */
.tile--ai-os {
  background: linear-gradient(160deg, #0a0a0e 0%, #0e0e16 100%);
  border-color: rgba(245, 196, 122, 0.10);
}
.tile--ai-os .tile-content {
  position: relative;
  z-index: 2;
  max-width: 60%;
}
.tile--ai-os .tile-canvas {
  opacity: 0.9;
}
.tile--ai-os:hover { border-color: rgba(245, 196, 122, 0.28); }
.tile--ai-os:hover .tile-canvas { opacity: 1; }
.tile--ai-os .tile-title em {
  font-style: italic;
  color: var(--accent-warm);
}

/* ───── tile: Gallery (full-bleed slideshow with text overlay at bottom) ───── */
.tile--gallery {
  background: #0a0a10;
  border-color: rgba(6, 182, 212, 0.08);
  flex-direction: column;
  align-items: stretch;
  padding: 0;
  overflow: hidden;
}
.tile--gallery .tile-content--overlay {
  /* tile padding is 0 here so the slideshow fills edge-to-edge; reset the
     overlay's negative margin so its 26px padding properly insets the text. */
  margin: 0;
  margin-top: auto;
  padding: 28px 32px 26px;
  background: linear-gradient(180deg, transparent 0%, rgba(8, 8, 14, 0.85) 50%, rgba(8, 8, 14, 0.98) 100%);
}
.gallery-slideshow {
  position: absolute;
  inset: 0;
  overflow: hidden;
  isolation: isolate;
}
.slides {
  position: absolute;
  inset: 0;
}
.slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transform: scale(1);
  transition: opacity 1.6s ease, transform 10s linear;
  filter: brightness(0.85) contrast(1.05);
}
.slide.is-active {
  opacity: 1;
  transform: scale(1.10);     /* Ken Burns — slow zoom while visible */
}
/* subtle vignette so the slideshow doesn't bleed into the page edges */
.gallery-slideshow::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at center, transparent 50%, rgba(0,0,0,0.35) 100%),
    linear-gradient(180deg, rgba(0,0,0,0.15) 0%, transparent 25%, transparent 65%, rgba(0,0,0,0.45) 100%);
  z-index: 2;
}
/* subtle scanlines / tech grid */
.slide-grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(0deg,  rgba(255,255,255,0.025) 0px, rgba(255,255,255,0.025) 1px, transparent 1px, transparent 24px),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.025) 0px, rgba(255,255,255,0.025) 1px, transparent 1px, transparent 24px);
  pointer-events: none;
  z-index: 3;
  mix-blend-mode: overlay;
}
/* moving scanline */
.slide-scanline {
  position: absolute;
  left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(180, 220, 255, 0.45), transparent);
  box-shadow: 0 0 14px rgba(180, 220, 255, 0.35);
  z-index: 4;
  pointer-events: none;
  animation: scanline-sweep 5s linear infinite;
}
@keyframes scanline-sweep {
  0%   { top: -2px; opacity: 0; }
  10%  { opacity: 0.9; }
  90%  { opacity: 0.9; }
  100% { top: 100%; opacity: 0; }
}
/* counter + collection name */
.slide-meta {
  position: absolute;
  top: 16px; left: 18px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-family: var(--font-mono);
  pointer-events: none;
}
.slide-meta__counter {
  font-size: 10px;
  letter-spacing: 0.22em;
  color: rgba(180, 220, 255, 0.85);
  text-shadow: 0 0 12px rgba(0,0,0,0.6);
}
.slide-meta__name {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 16px;
  color: #fff;
  text-shadow: 0 2px 12px rgba(0,0,0,0.6);
  letter-spacing: 0.01em;
}
/* progress dots/bars */
.slide-progress {
  position: absolute;
  bottom: 16px; left: 18px;
  display: flex;
  gap: 6px;
  z-index: 5;
}
.slide-progress span {
  display: block;
  width: 18px;
  height: 2px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 1px;
  position: relative;
  overflow: hidden;
  transition: background 0.4s ease;
}
.slide-progress span.is-active {
  background: rgba(255, 255, 255, 0.25);
}
.slide-progress span.is-active::after {
  content: '';
  position: absolute;
  top: 0; left: 0;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #b4dcff, #ffffff);
  box-shadow: 0 0 8px rgba(180, 220, 255, 0.5);
  animation: slide-fill 6000ms linear forwards;
}
@keyframes slide-fill {
  to { width: 100%; }
}
.tile--gallery:hover { border-color: rgba(180, 220, 255, 0.25); }

/* ───── tile: Workshop / Claude Code (terminal) ───── */
.tile--workshop {
  background: linear-gradient(160deg, #060a18 0%, #0a0e1e 100%);
  border-color: rgba(99, 102, 241, 0.10);
}
.terminal {
  background: rgba(0,0,0,0.45);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 8px;
  padding: 10px 12px 14px;
  margin-bottom: 18px;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.7;
  color: var(--text-secondary);
}
.terminal-bar {
  display: flex;
  gap: 5px;
  margin-bottom: 8px;
}
.terminal-bar span {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
}
.terminal-bar span:nth-child(1) { background: rgba(244, 63, 94, 0.55); }
.terminal-bar span:nth-child(2) { background: rgba(245, 158, 11, 0.55); }
.terminal-bar span:nth-child(3) { background: rgba(16, 185, 129, 0.55); }
.terminal-body { white-space: pre-wrap; color: rgba(232,230,227,0.55); }
.t-ok { color: var(--accent-emerald); }
.t-cmd { color: var(--accent-indigo); }
.caret { animation: blink 1s steps(2) infinite; color: var(--accent-warm); }
@keyframes blink { 50% { opacity: 0; } }
.tile--workshop:hover { border-color: rgba(99, 102, 241, 0.3); }

/* ───── tile: Atlas (live iframe of /atlas/ — Three.js sphere) ───── */
.tile--atlas {
  background: linear-gradient(160deg, #0a1018 0%, #0c1422 100%);
  border-color: rgba(99, 102, 241, 0.10);
}
/* atlas xs tile — light grey #f0f2f5 (the actual /atlas/ light-theme bg) */
.tile--atlas {
  background: #f0f2f5;
  border-color: rgba(26, 26, 46, 0.10);
}
.tile--atlas:hover { border-color: rgba(26, 26, 46, 0.28); }
.tile--atlas .tile-content--overlay {
  background: linear-gradient(180deg, transparent 0%, rgba(240, 242, 245, 0.92) 55%, rgba(240, 242, 245, 0.99) 100%);
}
.tile--atlas .tile-label    { color: rgba(26, 26, 46, 0.55); }
.tile--atlas .tile-title-xs { color: #1a1a2e; }
.tile--atlas .tile-cta__arrow { color: rgba(26, 26, 46, 0.7); }

/* sphere xs tile — own small square */
.tile--sphere {
  background: radial-gradient(circle at 50% 50%, #0e0a1c 0%, #050309 80%);
  border-color: rgba(139, 92, 246, 0.14);
  overflow: hidden;
}
.tile--sphere:hover { border-color: rgba(139, 92, 246, 0.35); }

/* ───── tile: AWAKEN — pure B&W cosmic ───── */
.tile--awaken {
  background: #000;
  border-color: rgba(245, 241, 232, 0.10);
  overflow: hidden;
  position: relative;
}
.tile--awaken:hover { border-color: rgba(245, 241, 232, 0.32); }
.tile--awaken .awaken-scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.tile--awaken .ah-diamond { animation: awakenMoonPulse 4.2s ease-in-out infinite; }
.tile--awaken .ah-beads circle { animation: awakenBead 3.6s ease-in-out infinite; }
.tile--awaken .ah-beads circle:nth-child(2){ animation-delay: 0.6s; }
.tile--awaken .ah-beads circle:nth-child(3){ animation-delay: 1.2s; }
.tile--awaken .ah-beads circle:nth-child(4){ animation-delay: 1.8s; }
.tile--awaken .ah-beads circle:nth-child(5){ animation-delay: 2.4s; }
@keyframes awakenMoonPulse {
  0%, 100% { opacity: 0.7; }
  50%      { opacity: 1; }
}
@keyframes awakenBead {
  0%, 100% { opacity: 0.9; }
  50%      { opacity: 0.25; }
}
.tile--awaken .tile-content--overlay {
  background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.80) 55%, rgba(0, 0, 0, 0.96) 100%);
}
.tile--awaken .tile-label {
  color: rgba(245, 241, 232, 0.55);
  letter-spacing: 0.22em;
}
.tile--awaken .tile-title.awaken-mark {
  font-family: 'JetBrains Mono', 'SF Mono', Menlo, monospace;
  font-weight: 500;
  letter-spacing: 0.32em;
  text-indent: 0.32em;
  color: #f5f1e8;
  display: inline-flex;
  align-items: center;
  /* override the default tile-title font-size with monospace-friendly scale */
  font-size: clamp(22px, 3.4vw, 30px);
  line-height: 1;
}
.tile--awaken .awaken-cursor {
  display: inline-block;
  width: 0.55ch;
  margin-left: 0.05em;
  color: #f5f1e8;
  font-weight: 500;
  animation: awakenCursorBlink 0.7s steps(2) infinite;
}
@keyframes awakenCursorBlink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}
.tile--awaken .tile-desc { color: rgba(245, 241, 232, 0.55); }
.tile--awaken .awaken-chapter {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85em;
  letter-spacing: 0.12em;
  color: rgba(245, 241, 232, 0.75);
  padding: 0 0.15em;
}
.tile--awaken .tile-cta { color: rgba(245, 241, 232, 0.85); }
.tile--awaken:hover .tile-cta { color: #fff; }

@media (prefers-reduced-motion: reduce) {
  .tile--awaken .ah-diamond,
  .tile--awaken .ah-beads circle,
  .tile--awaken .awaken-cursor { animation: none !important; }
}

/* ───── tile: Biblestudy — cosmic canvas (starfield + golden orb + smoke) ───── */
.tile--biblestudy {
  background:
    radial-gradient(ellipse at 50% 100%, rgba(80, 50, 20, 0.35) 0%, transparent 60%),
    radial-gradient(ellipse at 50% 0%, rgba(40, 30, 70, 0.4) 0%, transparent 55%),
    linear-gradient(180deg, #02020a 0%, #050308 50%, #020203 100%);
  border-color: rgba(212, 165, 95, 0.14);
  overflow: hidden;
}
.tile--biblestudy:hover { border-color: rgba(212, 165, 95, 0.4); }
.tile--biblestudy .tile-content--overlay {
  background: linear-gradient(180deg, transparent 0%, rgba(2, 2, 8, 0.92) 55%, rgba(2, 2, 8, 0.99) 100%);
}
.tile--biblestudy .tile-label { color: rgba(212, 165, 95, 0.75); }
.tile--biblestudy .tile-title { color: #f0d8a8; }
.tile--biblestudy .tile-desc { color: rgba(232, 200, 150, 0.55); }
.tile--biblestudy .tile-cta { color: rgba(232, 200, 150, 0.85); }
.tile--biblestudy:hover .tile-cta { color: #f0d8a8; }

/* (sphere orbs removed — replaced with live iframe above) */

/* ─── FOOTER ─── */
.site-footer {
  border-top: 1px solid var(--border-subtle);
  padding: 36px 32px;
  margin-top: 60px;
}
.footer-inner {
  max-width: 1320px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--text-tertiary);
  gap: 24px;
  flex-wrap: wrap;
}
.footer-brand { color: var(--text-secondary); }
.footer-links a { color: var(--text-secondary); transition: color 0.2s ease; }
.footer-links a:hover { color: var(--accent-warm); }

/* ─── WINNER overlay (secret easter-egg celebration) ─── */
.winner-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(2, 2, 8, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  opacity: 0;
  animation: winner-in 0.5s cubic-bezier(.2,.7,.2,1) forwards;
  cursor: pointer;
  transition: opacity 0.6s ease;
}
.winner-overlay.is-leaving {
  opacity: 0 !important;
  animation: none !important;
  pointer-events: none;
}
.winner-confetti {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.winner-close {
  position: absolute;
  top: 28px;
  right: 32px;
  z-index: 100;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: rgba(255, 255, 255, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  pointer-events: auto;
  transition: all 0.3s cubic-bezier(.2,.7,.2,1);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.winner-close svg { pointer-events: none; }
.winner-text, .winner-sub { pointer-events: none; }
.winner-close:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.55);
  color: #fff;
  transform: rotate(90deg) scale(1.1);
}
.winner-text {
  font-family: var(--font-sans);
  font-weight: 900;
  font-size: clamp(80px, 22vw, 320px);
  letter-spacing: -0.05em;
  line-height: 1;
  background: linear-gradient(135deg, #ff8a4a 0%, #ff4f8a 40%, #b85cff 70%, #f5c47a 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  text-align: center;
  animation: winner-pop 0.9s cubic-bezier(.2,.7,.2,1), winner-shift 4s ease-in-out infinite;
  text-shadow: 0 0 120px rgba(255, 138, 74, 0.35);
  position: relative;
  z-index: 2;
}
.winner-sub {
  font-family: var(--font-mono);
  font-size: clamp(11px, 1.2vw, 14px);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
  opacity: 0;
  animation: winner-sub-in 0.6s 0.6s ease forwards;
  position: relative;
  z-index: 2;
}
@keyframes winner-in {
  to { opacity: 1; }
}
@keyframes winner-pop {
  0%   { transform: scale(0.3) rotate(-4deg); opacity: 0; }
  60%  { transform: scale(1.15) rotate(2deg);  opacity: 1; }
  100% { transform: scale(1)    rotate(0);    opacity: 1; }
}
@keyframes winner-shift {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}
@keyframes winner-sub-in {
  to { opacity: 1; }
}

/* ─── RESPONSIVE ─── */
@media (max-width: 900px) {
  .site-nav { padding: 14px 18px; }
  .nav-links { display: none; }
  .nav-toggle {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 6px;
  }
  .nav-toggle span {
    width: 22px; height: 1.5px;
    background: var(--text-primary);
    display: block;
  }
  .hero { padding: 100px 20px 40px; }
  .grid {
    padding: 20px 20px 60px;
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .tile--lg, .tile--md, .tile--wide, .tile--sm, .tile--half {
    grid-column: span 1;
    min-height: 280px;
  }
  /* squares relax to normal stacked tiles on narrow screens */
  .tile--half { aspect-ratio: auto; }
  .tile--cursor .tile-content { max-width: 100%; }
  .tile--gallery { flex-direction: column; }
  .gallery-strip {
    flex: 0 0 140px;
    grid-template-columns: repeat(4, 1fr);
  }
  .ventanita-frame {
    width: 64px; height: 64px;
    top: 18px; right: 18px;
  }
  .ventanita-grid {
    grid-template-columns: repeat(4, 9px);
    grid-template-rows: repeat(4, 9px);
  }
  .v-cell { width: 9px; height: 9px; }
}

/* ─── iPhone tightening (<= 480px) ─── */
@media (max-width: 480px) {
  .site-nav { padding: 12px 16px; }
  .nav-logo { font-size: 17px; }

  .hero {
    padding: calc(72px + env(safe-area-inset-top)) 18px 28px 18px;
  }
  .hero__title { font-size: clamp(40px, 13vw, 72px); line-height: 1.05; margin-bottom: 18px; }
  .hero__sub { font-size: 15px; line-height: 1.5; }

  .grid {
    padding: 14px 16px calc(40px + env(safe-area-inset-bottom)) 16px;
    gap: 10px;
  }
  .tile {
    padding: 22px 20px;
    border-radius: 12px;
  }
  .tile--xs { padding: 16px; min-height: 180px; }
  .tile--lg, .tile--md, .tile--wide, .tile--sm { min-height: 240px; }

  .tile-title { font-size: clamp(22px, 6.4vw, 28px); line-height: 1.15; }
  .tile-title--serif { font-size: clamp(22px, 6.4vw, 30px); }
  .tile-title-xs { font-size: 17px; }
  .tile-desc { font-size: 13px; line-height: 1.55; }
  .tile-label { font-size: 10px; letter-spacing: 0.22em; }
  .tile-cta { font-size: 11px; }

  .gallery-strip { flex: 0 0 110px; }

  .site-footer {
    padding: 22px 16px calc(22px + env(safe-area-inset-bottom)) 16px;
  }
  .footer-inner { flex-direction: column; gap: 8px; text-align: center; }
}
