/* ─── SHARED CINEMA CSS ────────────────────────────────────────────────────
   Theme color is set per-page by overriding:
     --accent        (main theme color)
     --accent-dark   (gradient second stop)
     --glow-accent   (rgba version of accent for glow effects)
   ─────────────────────────────────────────────────────────────────────── */

:root {
  --void: #050508;
  --surface: #0a0a0f;
  --surface-light: #12121e;
  /* Default theme: Purple (Signature). Overridden per-page. */
  --accent: #8b5cf6;
  --accent-dark: #7c3aed;
  --purple: #a78bfa;
  --glow-accent: rgba(139, 92, 246, 0.4);
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --border: rgba(255, 255, 255, 0.08);
  --glass: rgba(13, 13, 20, 0.85);
  --font-head: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
}

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

body {
  background: var(--void);
  color: var(--text);
  font-family: var(--font-body);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Grain Overlay */
.grain {
  position: fixed; inset: 0; z-index: 999;
  pointer-events: none; opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
  background-size: 200px 200px;
}

.page-progress {
  position: fixed; top: 0; left: 0; width: 0%; height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-dark));
  z-index: 1000;
}

/* Nav */
.nav-minimal {
  position: fixed; top: 0; left: 0; width: 100%;
  padding: 1.5rem 3rem; display: flex;
  justify-content: space-between; align-items: center;
  z-index: 100; mix-blend-mode: difference;
}

.back-link {
  text-decoration: none; color: #fff;
  font-size: 0.75rem; letter-spacing: 0.15em;
  display: flex; align-items: center; gap: 0.5rem;
}

.nav-title {
  font-family: var(--font-head); font-weight: 700;
  font-size: 0.85rem; letter-spacing: 0.3em; color: #fff;
}

/* Main Container */
.container {
  max-width: 1400px; margin: 0 auto;
  padding: 8rem 2rem 4rem;
}

.header {
  text-align: center; margin-bottom: 6rem;
}

.badge {
  font-size: 0.65rem; color: var(--accent);
  letter-spacing: 0.4em; text-transform: uppercase;
  margin-bottom: 1.5rem; display: block;
}

h1 {
  font-family: var(--font-head);
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 700; margin-bottom: 1.5rem;
  letter-spacing: -0.02em; line-height: 1.1;
  text-align: center;
}

h1 .accent {
  color: var(--accent); font-weight: 300;
}

.subtitle {
  color: var(--text-muted); font-size: 1.1rem;
  max-width: 600px; margin: 0 auto; line-height: 1.6;
}

/* Grid */
.project-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2rem;
}

/* Cards */
.project-card {
  position: relative; height: 450px;
  flex: 1 1 400px;
  max-width: 450px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px; overflow: hidden;
  cursor: pointer;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.4s;
  animation: fadeIn 0.8s ease backwards;
}

.card-glow {
  position: absolute; inset: 0;
  background: radial-gradient(circle at var(--x, 50%) var(--y, 50%), rgba(var(--accent-rgb, 139,92,246), 0.12), transparent 50%);
  opacity: 0; transition: opacity 0.4s;
}

.project-card:hover {
  transform: translateY(-10px) scale(1.02);
  border-color: color-mix(in srgb, var(--accent) 50%, transparent);
}

.project-card:hover .card-glow { opacity: 1; }

.card-content {
  position: relative; height: 100%;
  padding: 3rem; display: flex; flex-direction: column;
}

.project-num {
  font-family: var(--font-head);
  font-size: 0.8rem; color: var(--text-muted);
  letter-spacing: 0.2em; margin-bottom: 2rem;
}

.project-title {
  font-family: var(--font-head);
  font-size: 2.2rem; font-weight: 700;
  margin-bottom: 0.5rem; letter-spacing: -0.01em;
}

.project-tagline {
  color: var(--text-muted); font-size: 0.95rem;
  line-height: 1.6; max-width: 80%;
}

.card-footer {
  margin-top: auto;
}

.view-details {
  font-size: 0.72rem; letter-spacing: 0.2em;
  color: var(--accent); font-weight: 600;
  position: relative; padding-bottom: 5px;
}

.view-details::after {
  content: ''; position: absolute; bottom: 0; left: 0;
  width: 20px; height: 1px; background: var(--accent);
  transition: width 0.3s;
}

.project-card:hover .view-details::after { width: 100%; }

/* Staggered card animations (supports up to 7 cards) */
.project-card:nth-child(1) { animation-delay: 0.1s; }
.project-card:nth-child(2) { animation-delay: 0.2s; }
.project-card:nth-child(3) { animation-delay: 0.3s; }
.project-card:nth-child(4) { animation-delay: 0.4s; }
.project-card:nth-child(5) { animation-delay: 0.5s; }
.project-card:nth-child(6) { animation-delay: 0.6s; }
.project-card:nth-child(7) { animation-delay: 0.7s; }

/* Cinematic Modal Overhaul — Terminal Briefing Panel */
.cinema-overlay {
  position: fixed; inset: 0; z-index: 10000;
  visibility: hidden; opacity: 0;
  display: flex; align-items: center; justify-content: center;
  perspective: 1000px;
  overflow: hidden;
  transition: visibility 0.4s, opacity 0.4s;
}

.cinema-bg {
  position: absolute; inset: 0;
  background: rgba(2, 2, 10, 0.78);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  opacity: 0;
  transition: opacity 0.4s;
}

.cinema-container {
  position: relative; z-index: 2;
  background: linear-gradient(145deg, rgba(8,8,20,0.97) 0%, rgba(12,12,28,0.95) 100%);
  border: 1px solid color-mix(in srgb, var(--accent) 12%, transparent);
  border-top: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
  border-radius: 20px;
  max-width: 820px; width: 94%;
  max-height: 90vh;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.03),
    0 80px 160px rgba(0,0,0,0.8),
    0 0 60px color-mix(in srgb, var(--accent) 6%, transparent),
    inset 0 1px 0 rgba(255,255,255,0.05);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  overflow-y: auto;
  opacity: 0;
  transform: scale(0.93) translateY(40px);
}
.cinema-container::-webkit-scrollbar { width: 3px; }
.cinema-container::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--accent) 25%, transparent); border-radius: 10px;
}

/* Scanline overlay on the panel */
.cinema-container::before {
  content: '';
  position: absolute; inset: 0; z-index: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,0.03) 2px,
    rgba(0,0,0,0.03) 4px
  );
  pointer-events: none;
  border-radius: 20px;
}

.cinema-content {
  position: relative; z-index: 1;
  padding: 0;
}

/* Close button */
.cinema-close {
  position: absolute; top: 0.85rem; right: 1.1rem; z-index: 10;
  width: 36px; height: 36px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 50%;
  color: rgba(255,255,255,0.3); font-size: 1.1rem;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all 0.3s;
  opacity: 0; transform: translateY(-10px);
}
.cinema-close:hover {
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 0 18px var(--glow-accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  transform: rotate(90deg);
}
.close-icon { line-height: 1; margin-top: -2px; }

/* ── STORY/TERMINAL COMPONENTS ── */
.story-content {
  padding: 3rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.story-status-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: monospace;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}
.story-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  box-shadow: 0 0 8px currentColor;
}
.story-status-dot.live {
  background-color: var(--accent);
  color: var(--accent);
}
.story-status-dot.soon {
  background-color: #f59e0b;
  color: #f59e0b;
}
.story-title {
  font-family: var(--font-head);
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 700;
  line-height: 1.1;
  color: #fff;
  margin: 0;
  background: none;
  -webkit-text-fill-color: initial;
}
.story-subtitle {
  font-family: monospace;
  font-size: 0.85rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  margin-top: -0.5rem;
}
.story-description {
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.6;
  color: #d1d5db;
  margin: 0;
}
.story-divider {
  border-top: 1px dashed rgba(255, 255, 255, 0.15);
  margin: 0.5rem 0;
}
.story-bullets {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.story-bullet {
  display: flex;
  gap: 0.75rem;
  font-family: monospace;
  font-size: 0.9rem;
  line-height: 1.6;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.story-bullet.revealed {
  opacity: 1;
  transform: translateY(0);
}
.bullet-arrow {
  color: var(--accent);
  font-weight: bold;
  flex-shrink: 0;
}
.bullet-text {
  color: #9ca3af;
  flex: 1;
}
.bullet-text strong {
  color: #f3f4f6;
  font-family: var(--font-head);
  letter-spacing: 0.05em;
}
.story-tech-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.story-tech-box {
  padding: 0.35rem 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  font-size: 0.7rem;
  font-family: monospace;
  color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.02);
}
.story-action-row {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}
.story-btn-main {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 2rem;
  border-radius: 8px;
  background-color: var(--accent);
  color: #000 !important;
  font-weight: 700;
  font-size: 0.85rem;
  text-decoration: none;
  font-family: monospace;
  box-shadow: 0 4px 14px var(--glow-accent);
  transition: all 0.25s ease;
  border: none;
}
.story-btn-main:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px var(--glow-accent);
  filter: brightness(1.1);
}
.story-btn-main.disabled {
  cursor: not-allowed;
  pointer-events: none;
  background-color: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.25);
  color: rgba(245, 158, 11, 0.85) !important;
  box-shadow: none;
}
.story-btn-alt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 2rem;
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  background-color: color-mix(in srgb, var(--accent) 8%, transparent);
  color: var(--accent) !important;
  font-weight: 600;
  font-size: 0.85rem;
  text-decoration: none;
  font-family: monospace;
  transition: all 0.25s ease;
}
.story-btn-alt:hover {
  border-color: var(--accent);
  background-color: color-mix(in srgb, var(--accent) 18%, transparent);
  color: #fff !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--glow-accent);
}

/* Soon badge on card titles */
.btn-soon-badge {
  display: inline-block;
  font-size: 0.58em;
  padding: 0.15em 0.55em;
  margin-left: 0.45em;
  background: rgba(251,191,36,0.1);
  border: 1px solid rgba(251,191,36,0.22);
  color: rgba(251,191,36,0.85);
  border-radius: 100px;
  vertical-align: middle;
  letter-spacing: 0.05em;
  font-family: var(--font-body);
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Responsive — Tablet */
@media (max-width: 900px) {
  .project-card { flex: 1 1 100%; max-width: 100%; }
  .cinema-container { max-height: 95vh; }
  .story-content { padding: 2rem; gap: 1.5rem; }
  .story-title { font-size: 2.5rem; }
}

/* ================================================
   MOBILE — 768px and below
================================================ */
@media (max-width: 768px) {

  /* Nav */
  .nav-minimal { padding: 1rem 1.25rem; }
  .nav-title { font-size: 0.72rem; letter-spacing: 0.2em; }
  .back-link { font-size: 0.68rem; }

  /* Container */
  .container { padding: 6rem 1.25rem 3rem; }
  .header { margin-bottom: 3rem; }
  h1 { font-size: clamp(2rem, 8vw, 3rem); }
  .subtitle { font-size: 0.95rem; }

  /* Cards — single column, shorter height */
  .project-grid {
    flex-direction: column;
    align-items: stretch;
    gap: 1.2rem;
  }
  .project-card {
    height: auto;
    min-height: 260px;
    flex: none;
    max-width: 100%;
  }
  .card-content { padding: 2rem 1.5rem; }
  .project-title { font-size: 1.6rem; }
  .project-tagline { font-size: 0.88rem; max-width: 100%; }

  /* Cinema modal — full screen on mobile */
  .cinema-overlay { align-items: flex-end; }
  .cinema-container {
    width: 100%;
    max-width: 100%;
    max-height: 92dvh;
    border-radius: 20px 20px 0 0;
    margin: 0;
  }
  .cinema-close {
    top: 0.75rem;
    right: 0.75rem;
    width: 36px; height: 36px;
  }
  .close-icon { font-size: 1.1rem; }
  .story-content { padding: 1.5rem 1.25rem; gap: 1.25rem; }
  .story-title { font-size: clamp(1.6rem, 5vw, 2.2rem); }
  .story-action-row { flex-direction: column; gap: 0.75rem; width: 100%; }
  .story-btn-main, .story-btn-alt { width: 100%; text-align: center; justify-content: center; padding: 0.85rem 1.5rem; }
}

/* Ultra small */
@media (max-width: 480px) {
  .nav-title { display: none; }
  .nav-minimal { padding: 0.9rem 1rem; }
  h1 { font-size: clamp(1.8rem, 10vw, 2.5rem); }
  .project-card { min-height: 220px; }
  .card-content { padding: 1.5rem 1.2rem; }
  .project-title { font-size: 1.4rem; }
}

