/* ============================================================
   home.css: HOMEPAGE-ONLY styles. Loaded by index.html after
   base.css. Post page never loads this.

   Contents:
     .hero + orbs/grid/corners/title/sub/cta/stats/scroll
     .section + labels: generic section chrome
     .featured-card (LATEST DROP): full-bleed thumb + glass
     .grid + .post-card collage: GTA mosaic tiles sz-a..f
     .archive-hint: DRAG/RIGHT-CLICK onboarding
     drag engine states: .drag-ghost / .drag-placeholder
                                        (engine = lib/collage.js)
   ============================================================ */

/* ==================== HERO ==================== */
.hero {
  position: relative; z-index: 1;
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
  padding: 120px 24px 60px;
  overflow: hidden;
}
.hero-orb {
  position: absolute; border-radius: 50%; pointer-events: none;
  filter: blur(2px); will-change: transform;
}
.hero-orb-1 { width: 220px; height: 220px; background: radial-gradient(circle, rgba(0,229,255,0.22), transparent 70%); top: 12%; left: 14%; animation: float 9s ease-in-out infinite; }
.hero-orb-2 { width: 160px; height: 160px; background: radial-gradient(circle, rgba(255,46,154,0.2), transparent 70%); top: 28%; right: 16%; animation: float 11s ease-in-out infinite reverse; }
.hero-orb-3 { width: 120px; height: 120px; background: radial-gradient(circle, rgba(124,58,237,0.24), transparent 70%); bottom: 22%; left: 26%; animation: float 8s ease-in-out infinite 1.5s; }
@keyframes float {
  0%,100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-28px) scale(1.08); }
}

/* hero content sits above the decorative layers.
   NOTE: everything is visible by default, lib/hero.js uses
   gsap.from() for the entrance; a CSS opacity:0 here previously
   left elements permanently invisible. */
.hero-inner {
  position: relative; z-index: 3;
  display: flex; flex-direction: column; align-items: center;
}
.hero-title {
  font-size: clamp(48px, 10vw, 128px); font-weight: 700; line-height: 0.95;
  letter-spacing: -3px; max-width: 1000px;
  display: flex; flex-direction: column; align-items: center;
  will-change: transform;
  text-shadow: 0 0 80px rgba(124,58,237,0.35);
}
.hero-line { display: block; }
.hero-title .grad {
  background: linear-gradient(100deg, var(--cyan), var(--magenta), var(--violet));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  background-size: 200% 200%;
  filter: drop-shadow(0 0 26px rgba(255,46,154,0.28));
}
.hero-title .cursor {
  color: var(--cyan); font-weight: 400; margin-left: 6px;
  animation: blink 1s step-end infinite;
}
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: 0; } }
/* Reduced motion: the JS typewriter never starts (gated in lib/hero.js),
   so park the caret in its steady "on" state instead of blinking. */
@media (prefers-reduced-motion: reduce) {
  .hero-title .cursor { animation: none; opacity: 1; }
}

/* faint engineering grid + HUD corner brackets */
.hero-grid-overlay {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background-image:
    linear-gradient(rgba(0,229,255,0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,229,255,0.045) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 75% 65% at 50% 45%, #000 30%, transparent 75%);
  mask-image: radial-gradient(ellipse 75% 65% at 50% 45%, #000 30%, transparent 75%);
}
.hero-corner {
  position: absolute; width: 54px; height: 54px; z-index: 2; pointer-events: none;
  border: 0 solid rgba(0,229,255,0.35);
}
.hc-tl { top: 96px; left: 26px; border-top-width: 1px; border-left-width: 1px; }
.hc-br { bottom: 40px; right: 26px; border-bottom-width: 1px; border-right-width: 1px; }

.hero-sub {
  margin-top: 26px; max-width: 560px; color: var(--text-2);
  font-size: 17px; line-height: 1.65;
}

/* CTA buttons */
.hero-cta { display: flex; gap: 16px; margin-top: 34px; }
.btn-primary, .btn-ghost {
  font-family: var(--font-mono); font-size: 13px; letter-spacing: 1.5px; font-weight: 600;
  padding: 14px 28px; border-radius: 999px; text-decoration: none; transition: transform 0.25s, box-shadow 0.25s, background 0.25s;
}
.btn-primary { color: #05060c; background: linear-gradient(100deg, var(--cyan), var(--magenta)); box-shadow: 0 8px 30px rgba(0,229,255,0.3); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 40px rgba(255,46,154,0.35); }
.btn-ghost { color: var(--text-1); border: 1px solid var(--glass-border); background: var(--glass); }
.btn-ghost:hover { transform: translateY(-2px); border-color: rgba(0,229,255,0.4); }

/* live stats strip (lib/hero.js renderHeroStats fills it) */
.hero-stats {
  margin-top: 36px; margin-bottom: 70px; display: flex; gap: 0;
  border: 1px solid var(--glass-border); border-radius: 16px;
  background: rgba(255,255,255,0.03); backdrop-filter: blur(8px);
  overflow: hidden;
}
.hs-item { display: flex; flex-direction: column; gap: 4px; padding: 14px 26px; min-width: 110px; }
.hs-item + .hs-item { border-left: 1px solid var(--glass-border); }
.hs-num { font-family: var(--font-mono); font-size: 22px; font-weight: 700; color: var(--cyan); }
.hs-item:nth-child(2) .hs-num { color: var(--magenta); }
.hs-item:nth-child(3) .hs-num { color: var(--gold); }
.hs-label { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 1.5px; color: var(--text-3); text-transform: uppercase; }

.hero-scroll {
  position: absolute; bottom: 34px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  color: var(--text-3); font-family: var(--font-mono); font-size: 10px; letter-spacing: 2px;
  z-index: 3;
}
.hero-scroll .line { width: 1px; height: 44px; background: linear-gradient(var(--cyan), transparent); animation: scrollPulse 1.8s ease-in-out infinite; }
@keyframes scrollPulse { 0%,100% { transform: scaleY(0.4); opacity: 0.4; } 50% { transform: scaleY(1); opacity: 1; } }

/* ==================== SECTIONS ==================== */
.section { position: relative; z-index: 1; padding: 90px 40px; max-width: 1200px; margin: 0 auto; }
.section-label {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 3px;
  color: var(--magenta); text-transform: uppercase; margin-bottom: 18px;
}
.section-title { font-size: clamp(28px, 4.5vw, 48px); font-weight: 700; letter-spacing: -1px; line-height: 1.1; }

/* ==================== LATEST DROP (featured) ==================== */
.featured {
  position: relative; z-index: 1; padding: 40px 40px 90px; max-width: 1200px; margin: 0 auto;
}
.featured-card {
  position: relative; overflow: hidden; border-radius: 22px;
  border: 1px solid var(--glass-border);
  background: linear-gradient(145deg, rgba(16,19,42,0.85), rgba(10,12,24,0.9));
  padding: 0; cursor: pointer; text-decoration: none; display: block;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  transition: transform 0.4s cubic-bezier(0.2,0.8,0.2,1), box-shadow 0.4s;
}
.featured-card:hover { transform: translateY(-6px); box-shadow: 0 30px 80px rgba(0,229,255,0.12); }
/* mouse-follow spotlight (app.js initFeaturedSpotlight sets --mx/--my) */
.featured-card::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(600px circle at var(--mx,50%) var(--my,50%), rgba(0,229,255,0.12), transparent 45%);
  opacity: 0; transition: opacity 0.4s;
}
.featured-card:hover::before { opacity: 1; }
.fc-bg {
  position: absolute; inset: 0; z-index: 0;
  background-size: cover; background-position: center;
  filter: brightness(0.35);
}
.fc-bg::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(5,6,12,0.6) 0%, rgba(10,12,24,0.95) 60%, rgba(5,6,12,1) 100%);
  z-index: 1;
}
.fc-content { position: relative; z-index: 2; padding: 48px; }
.fc-badge {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 2px;
  color: var(--magenta); background: rgba(255,46,154,0.1);
  border: 1px solid rgba(255,46,154,0.3); border-radius: 999px; padding: 6px 14px; margin-bottom: 18px;
}
.fc-badge .read-pill { margin-left: 0; }
.fc-title { font-size: clamp(28px, 4.5vw, 48px); font-weight: 700; letter-spacing: -1px; line-height: 1.15; color: var(--text-1); margin-bottom: 10px; }
.fc-excerpt { color: var(--text-2); font-size: 16px; line-height: 1.6; max-width: 500px; }
.fc-meta { margin-top: 22px; display: flex; gap: 18px; align-items: center; color: var(--text-3); font-family: var(--font-mono); font-size: 12px; letter-spacing: 1px; }

/* ==================== ARCHIVE COLLAGE ==================== */
/* 4-col dense grid; tiles span via sz-a..f (see below). Phone
   layouts collapse to 1 col in mobile.css. */
.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 215px;
  grid-auto-flow: dense;
  gap: 14px;
}
.post-card {
  position: relative; overflow: hidden; border-radius: 18px;
  border: 1px solid var(--glass-border); background: var(--glass);
  display: block; text-decoration: none; cursor: grab;
  transition: transform 0.35s cubic-bezier(0.2,0.8,0.2,1), border-color 0.3s, box-shadow 0.35s;
  /* the card owns the pointer gesture: children must not eat events
     (the drag engine hit-tests with elementFromPoint) */
  touch-action: none;
}
.post-card:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--pc-accent, #00e5ff) 55%, transparent);
  box-shadow: 0 18px 44px rgba(0,0,0,0.5), 0 0 34px color-mix(in srgb, var(--pc-accent, #00e5ff) 16%, transparent);
  z-index: 2;
}
/* children are visual only, never drag targets/click targets */
.post-card img { -webkit-user-drag: none; user-drag: none; }
.post-card .pc-thumb,
.post-card .pc-shade,
.post-card .pc-body,
.post-card .pc-emoji { pointer-events: none; }

.pc-emoji { font-size: 46px; }
.pc-thumb { position: absolute; inset: 0; overflow: hidden; background: var(--bg-2); }
.pc-thumb img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform 0.6s cubic-bezier(0.2,0.8,0.2,1), filter 0.4s;
  filter: saturate(1.05);
}
.post-card:hover .pc-thumb img { transform: scale(1.08); filter: saturate(1.2); }
.pc-shade {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(5,6,12,0) 30%, rgba(5,6,12,0.55) 62%, rgba(5,6,12,0.94) 100%),
    linear-gradient(180deg, color-mix(in srgb, var(--pc-accent, #00e5ff) 10%, transparent), transparent 45%);
  transition: background 0.3s;
}
.pc-body {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 1;
  padding: 18px 20px; display: flex; flex-direction: column; gap: 8px;
}
.pc-cat { font-family: var(--font-mono); font-size: 10px; letter-spacing: 2.5px; color: var(--pc-accent, var(--cyan)); text-transform: uppercase; }
.pc-title { font-size: 16px; font-weight: 600; line-height: 1.28; color: var(--text-1); text-shadow: 0 2px 12px rgba(0,0,0,0.6); }
.pc-excerpt { display: none; color: var(--text-2); font-size: 13px; line-height: 1.55; text-shadow: 0 1px 8px rgba(0,0,0,0.6); }
.pc-meta { display: flex; gap: 12px; color: var(--text-3); font-family: var(--font-mono); font-size: 10px; letter-spacing: 1px; }

/* tile sizes: A=2x2 hero, B/E=2x1 wide, C=1x2 tall, D/F=1x1.
   Sizes are assigned per-post in lib/collage.js (stable per slug). */
.post-card.sz-a { grid-column: span 2; grid-row: span 2; }
.post-card.sz-b, .post-card.sz-e { grid-column: span 2; }
.post-card.sz-c { grid-row: span 2; }
.post-card.sz-a .pc-title { font-size: 24px; line-height: 1.2; }
.post-card.sz-a .pc-body { padding: 24px 26px; gap: 10px; }
.post-card.sz-a .pc-excerpt {
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.post-card.sz-b .pc-title, .post-card.sz-e .pc-title { font-size: 18px; }

/* ==================== ARCHIVE HINT ==================== */
.archive-hint {
  margin-top: 14px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 1px;
  color: var(--text-3);
}
.archive-hint .ah-key {
  display: inline-block; padding: 2px 8px; margin-right: 4px;
  border: 1px solid rgba(0,229,255,0.35); border-radius: 6px;
  color: var(--cyan); background: rgba(0,229,255,0.07);
  font-size: 10px; letter-spacing: 1.5px;
}
.archive-hint .ah-sep { opacity: 0.4; }
.archive-hint .ah-tail { opacity: 0.75; }

/* ==================== DRAG ENGINE STATES ==================== */
/* Engine = lib/collage.js enableDragReorder(). While dragging, the
   real card becomes .drag-ghost (fixed, follows the pointer) and a
   .drag-placeholder clone marks its slot. */
.post-card.drag-ghost {
  position: fixed !important;
  z-index: 80;
  margin: 0 !important;
  /* CRITICAL: invisible to hit-testing so elementFromPoint returns
     the card UNDER the ghost (otherwise the drag blocks itself) */
  pointer-events: none;
  box-shadow: 0 24px 64px rgba(0,0,0,0.65);
  transform: scale(1.03) rotate(1.1deg);
  cursor: grabbing !important;
  opacity: 0.95;
}
.post-card.drag-placeholder {
  opacity: 0.22;
  filter: saturate(0.25);
  outline: 1px dashed rgba(0,229,255,0.45);
  outline-offset: -6px;
}
body.arrange-cursor,
body.arrange-cursor .post-card { cursor: grabbing !important; }
