/* ====================================================================
   SlideViber — landing (Figma-clean, no nav, full-bleed install)
   ==================================================================== */

:root {
  /* Designer accent palette — Figma-inspired */
  --violet: #A259FF;
  --coral:  #FF7262;
  --mustard:#FFB000;
  --mint:   #0ACF83;
  --sky:    #1ABCFE;

  --brand-1: var(--violet);
  --brand-2: var(--coral);
  --brand-3: var(--mustard);

  /* Page palette — warm cream paper, ink-black text */
  --bg: #FAF7F0;
  --bg-deeper: #F2EBDB;       /* used by the install panel */
  --surface: #FFFFFF;
  --surface-2: #F5F1E6;
  --surface-alt: #F0ECDF;

  --border: rgba(15, 14, 19, 0.08);
  --border-strong: rgba(15, 14, 19, 0.16);

  --text: #0F0E13;
  --text-2: #4A4751;
  --text-3: #8B8896;

  --grad-brand: linear-gradient(115deg, #A259FF 0%, #FF7262 50%, #FFB000 100%);

  --radius: 12px;
  --radius-lg: 22px;

  --container: 1280px;
  --gutter: clamp(20px, 4vw, 48px);

  --shadow-card: 0 2px 8px -2px rgba(15,14,19,0.06), 0 1px 2px rgba(15,14,19,0.04);
  --shadow-card-hover: 0 18px 40px -16px rgba(162,89,255,0.30), 0 2px 8px rgba(15,14,19,0.06);
  --shadow-overlay: 0 30px 80px -20px rgba(15,14,19,0.20), 0 1px 0 rgba(255,255,255,0.7) inset;

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-serif: "Fraunces", "Instrument Serif", Georgia, serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

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

html { scroll-behavior: smooth; color-scheme: light; }

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "cv11";
  overflow-x: hidden;

  /* Whisper-soft polychrome aurora — designer studio mood */
  background-image:
    radial-gradient(50% 40% at 95% 0%, rgba(162,89,255,0.10), transparent 60%),
    radial-gradient(40% 35% at 0% 25%, rgba(255,114,98,0.08), transparent 60%),
    radial-gradient(45% 35% at 50% 100%, rgba(255,176,0,0.06), transparent 60%);
  background-attachment: fixed;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

/* ---------- hero (= the wall, with logo+text overlay) ---------- */

.hero {
  position: relative;
  padding: clamp(20px, 2.5vw, 36px) var(--gutter) clamp(60px, 8vw, 100px);
  isolation: isolate;
}

.masonry {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  max-width: var(--container);
  margin-inline: auto;
}
@media (max-width: 720px) {
  .masonry { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
}

.tile {
  position: relative;
  display: block; margin: 0; padding: 0;
  border-radius: var(--radius);
  background: white;     /* loaded slide art is white internally */
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border);
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 16 / 9;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.tile:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-card-hover);
  border-color: rgba(164,123,255,0.40);
  z-index: 2;
}
.tile:focus-visible { outline: 2px solid var(--brand-1); outline-offset: 4px; }

.tile svg,
.tile object,
.tile .slide-frame,
.tile .slide-frame > svg {
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.tile-empty {
  display: grid; place-items: center;
  background: rgba(15,14,19,0.025);
  border: 1px solid rgba(15,14,19,0.06);
  box-shadow: none;
  color: rgba(15,14,19,0.18);
  font-size: 14px; font-weight: 600;
  cursor: default;
}
.tile-empty:hover { transform: none; box-shadow: none; border-color: rgba(15,14,19,0.06); }

/* Hero overlay = the centered paper card. Holds the logo, title, CTAs. */
.hero-overlay {
  position: absolute;
  left: 50%;
  /* Center over the masonry, not the padded hero box (bottom padding > top padding). */
  top: calc(50% - (clamp(60px, 8vw, 100px) - clamp(20px, 2.5vw, 36px)) / 2);
  transform: translate(-50%, -50%);
  z-index: 5;
  width: min(680px, calc(100% - 2 * var(--gutter)));
  padding: clamp(36px, 5vw, 56px) clamp(28px, 4vw, 52px);
  background: rgba(255, 252, 245, 0.92);
  backdrop-filter: blur(28px) saturate(140%);
  -webkit-backdrop-filter: blur(28px) saturate(140%);
  border: 1px solid rgba(15, 14, 19, 0.06);
  border-radius: 24px;
  box-shadow: var(--shadow-overlay);
  text-align: center;
  pointer-events: none;
}
.hero-overlay > * { pointer-events: auto; }

.hero-brand {
  display: inline-flex; align-items: center; gap: 12px;
  margin-bottom: clamp(20px, 2.6vw, 32px);
  font-weight: 700;
  letter-spacing: -0.02em;
}
.hero-brand img { display: block; border-radius: 9px; }
.hero-brand span {
  font-size: clamp(18px, 1.6vw, 22px);
  color: var(--text);
}

.hero-title {
  font-size: clamp(34px, 5.4vw, 68px);
  line-height: 1.0;
  letter-spacing: -0.04em;
  font-weight: 800;
  margin: 0 0 18px;
  color: var(--text);
}
.grad-text {
  background: var(--grad-brand);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 600;
  font-variation-settings: "opsz" 96;
  letter-spacing: -0.022em;
}
.hero-sub {
  font-size: clamp(14px, 1.2vw, 16.5px);
  color: var(--text-2);
  margin: 0 auto 26px;
  max-width: 460px;
}
.hero-ctas { display: inline-flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 22px;
  border-radius: 999px;
  font-weight: 600; font-size: 14.5px;
  letter-spacing: -0.01em;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease, color .2s ease, border-color .2s ease;
  white-space: nowrap;
}
.btn-primary {
  background: var(--grad-brand);
  background-size: 200% 100%;
  color: white;
  box-shadow: 0 10px 26px -8px rgba(162,89,255,0.45), 0 0 0 1px rgba(255,255,255,0.20) inset;
}
.btn-primary:hover { transform: translateY(-1px); background-position: 100% 0; box-shadow: 0 16px 36px -10px rgba(255,114,98,0.55), 0 0 0 1px rgba(255,255,255,0.30) inset; }
.btn-quiet {
  color: var(--text);
  background: rgba(15,14,19,0.04);
  border: 1px solid rgba(15,14,19,0.10);
}
.btn-quiet:hover { background: rgba(15,14,19,0.08); border-color: rgba(15,14,19,0.20); }

@media (max-width: 720px) {
  .hero-overlay { padding: 28px 22px; border-radius: 18px; }
}

/* ---------- why ---------- */

.why {
  max-width: var(--container);
  margin: 0 auto;
  padding: clamp(80px, 11vw, 160px) var(--gutter);
}
.why-eyebrow {
  font-size: 12.5px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--text-3);
  font-weight: 600;
  margin-bottom: 22px;
}
.why-headline {
  font-size: clamp(40px, 5.6vw, 84px);
  line-height: 1.02;
  letter-spacing: -0.04em;
  font-weight: 800;
  margin: 0 0 clamp(56px, 7vw, 90px);
  max-width: 920px;
}
.why-headline em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 600;
  font-variation-settings: "opsz" 96;
  background: var(--grad-brand);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}

.why-lede {
  max-width: 720px;
  font-size: clamp(16px, 1.4vw, 19px);
  line-height: 1.55;
  color: var(--text-2);
  margin: 0 0 clamp(48px, 6vw, 72px);
}
.why-lede strong { color: var(--text); font-weight: 600; }
.why-lede code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  padding: 2px 8px;
  background: rgba(164,123,255,0.12);
  border: 1px solid rgba(164,123,255,0.24);
  border-radius: 6px;
  color: #c8b4ff;
}

/* Workflow strip — three nodes connected by gradient arrows */
.workflow {
  list-style: none; margin: 0 0 clamp(64px, 8vw, 96px); padding: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: stretch;
  gap: 16px;
}
.workflow-step {
  position: relative;
  padding: 24px 22px 22px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  display: flex; flex-direction: column; gap: 10px;
}
.workflow-step:nth-child(1) { --step-color: var(--violet); }
.workflow-step:nth-child(3) { --step-color: var(--coral); }
.workflow-step:nth-child(5) { --step-color: var(--mustard); }
.workflow-num {
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.16em;
  color: var(--step-color, var(--violet));
  font-weight: 600;
}
.workflow-tag {
  font-size: clamp(20px, 2vw, 26px);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}
.workflow-tag-mono {
  font-family: var(--font-mono);
  font-size: clamp(18px, 1.8vw, 22px);
  font-weight: 500;
  letter-spacing: 0;
  background: var(--grad-brand);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.workflow-desc {
  font-size: 13.5px;
  color: var(--text-2);
  line-height: 1.5;
  margin-top: auto;
}
.workflow-arrow {
  display: grid; place-items: center;
  padding: 0 4px;
  align-self: center;
}
@media (max-width: 880px) {
  .workflow {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .workflow-step { padding: 18px 18px 16px; }
  .workflow-arrow {
    transform: rotate(90deg);
    padding: 8px 0;
    justify-self: center;
  }
}

.why-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
@media (max-width: 880px) { .why-grid { grid-template-columns: 1fr; gap: 16px; } }

.why-card {
  position: relative;
  padding: clamp(28px, 3vw, 40px);
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.why-card::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(90% 70% at 0% 0%, var(--card-accent, rgba(162,89,255,0.10)), transparent 65%);
  opacity: 0; transition: opacity .3s ease;
  pointer-events: none;
}
.why-card:hover {
  transform: translateY(-4px);
  border-color: var(--card-border-hover, rgba(162,89,255,0.30));
  box-shadow: var(--shadow-card-hover);
}
.why-card:hover::before { opacity: 1; }

/* Each Why card gets its own accent color */
.why-card:nth-child(1) {
  --card-accent: rgba(162,89,255,0.12);
  --card-border-hover: rgba(162,89,255,0.36);
}
.why-card:nth-child(1) .why-num { color: var(--violet); }

.why-card:nth-child(2) {
  --card-accent: rgba(255,114,98,0.12);
  --card-border-hover: rgba(255,114,98,0.36);
}
.why-card:nth-child(2) .why-num { color: var(--coral); }

.why-card:nth-child(3) {
  --card-accent: rgba(255,176,0,0.14);
  --card-border-hover: rgba(255,176,0,0.40);
}
.why-card:nth-child(3) .why-num { color: var(--mustard); }

.why-num {
  font-size: clamp(56px, 7vw, 96px);
  line-height: 0.95;
  letter-spacing: -0.05em;
  font-weight: 800;
  color: var(--text);
  margin-bottom: clamp(20px, 2.4vw, 32px);
  font-feature-settings: "ss01", "cv11", "tnum";
}
.why-num.grad-text {
  font-family: var(--font);     /* override the serif used in hero gradient */
  font-style: normal;
  font-weight: 800;
  letter-spacing: -0.05em;
}

.why-card h3 {
  margin: 0 0 10px;
  font-size: clamp(20px, 1.8vw, 24px);
  font-weight: 700;
  letter-spacing: -0.02em;
}
.why-card p {
  margin: 0;
  font-size: 15px; line-height: 1.55;
  color: var(--text-2);
  max-width: 32ch;
}

/* ---------- install — full-bleed dark, prompt as a quote ---------- */

.install-section {
  position: relative;
  padding: clamp(100px, 14vw, 180px) var(--gutter);
  overflow: hidden;
  isolation: isolate;
  color: var(--text);
  text-align: center;
}
.install-bg {
  position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(50% 60% at 90% 0%, rgba(162,89,255,0.10), transparent 65%),
    radial-gradient(40% 50% at 10% 50%, rgba(255,114,98,0.10), transparent 65%),
    radial-gradient(50% 50% at 60% 100%, rgba(255,176,0,0.10), transparent 65%),
    linear-gradient(180deg, var(--bg-deeper) 0%, var(--bg) 100%);
}
.install-bg::after {
  /* subtle paper grain */
  content: "";
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/></svg>");
  mix-blend-mode: multiply;
  opacity: 0.06;
  pointer-events: none;
}

.install-inner {
  max-width: 940px;
  margin: 0 auto;
}
.install-eyebrow {
  display: inline-block;
  font-size: 12.5px; letter-spacing: 0.22em; text-transform: uppercase;
  font-weight: 600;
  color: var(--text-3);
  margin-bottom: 22px;
}
.install-title {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 600;
  font-variation-settings: "opsz" 144;
  font-size: clamp(48px, 7.8vw, 112px);
  line-height: 1.0;
  letter-spacing: -0.03em;
  margin: 0 0 clamp(36px, 5vw, 64px);
  background: var(--grad-brand);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}

.install-quote {
  position: relative;
  margin: 0 auto;
  max-width: 900px;
  padding: clamp(36px, 4vw, 56px) clamp(28px, 4vw, 56px) clamp(36px, 4vw, 56px);
}
.quote-mark {
  position: absolute;
  top: -32px; left: clamp(-12px, -1vw, 0px);
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 700;
  font-variation-settings: "opsz" 144;
  font-size: clamp(180px, 22vw, 320px);
  line-height: 0.7;
  color: var(--violet);
  opacity: 0.18;
  pointer-events: none;
  user-select: none;
}
.install-quote blockquote {
  margin: 0;
  font-family: var(--font-mono);
  font-size: clamp(18px, 2.2vw, 28px);
  line-height: 1.6;
  color: var(--text);
  letter-spacing: -0.005em;
  text-align: left;
  padding-left: clamp(0px, 4vw, 60px);
}
.install-quote .prompt-url {
  color: var(--coral);
  font-weight: 600;
}

.btn-copy {
  margin-top: clamp(36px, 5vw, 56px);
  padding: 14px 26px;
  background: var(--text);
  color: var(--bg);
  border: 1px solid var(--text);
}
.btn-copy:hover {
  background: var(--violet);
  border-color: var(--violet);
  color: white;
  transform: translateY(-1px);
}
.btn-copy.copied {
  background: var(--mint);
  border-color: var(--mint);
  color: white;
}

/* ---------- footer ---------- */

.footer {
  border-top: 1px solid var(--border);
  background: var(--bg);
}
.footer-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 28px var(--gutter);
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
  font-size: 13px; color: var(--text-3);
}
.footer .brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; }
.footer .brand-logo { display: block; border-radius: 6px; }
.footer .brand-name { font-size: 14px; color: var(--text); letter-spacing: -0.02em; }
.footer-meta { color: var(--text-3); }
.footer-github { margin-left: auto; color: var(--text-2); font-weight: 600; transition: color .15s ease; }
.footer-github:hover { color: var(--text); }
@media (max-width: 640px) {
  .footer-inner { justify-content: center; text-align: center; }
  .footer-github { margin: 0 auto; }
}

/* ---------- lightbox ---------- */

.lightbox {
  border: 0; padding: 0; margin: 0;
  width: 100vw; height: 100vh;
  max-width: 100vw; max-height: 100vh;
  background: rgba(14, 10, 38, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.lightbox::backdrop { background: rgba(14, 10, 38, 0.55); }
.lightbox[open] { display: grid; place-items: center; }
.lightbox-close {
  position: fixed; top: 18px; right: 18px;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.16);
  border: 1px solid rgba(255,255,255,0.20);
  display: grid; place-items: center;
  color: white;
  z-index: 10;
  transition: background .15s ease;
}
.lightbox-close:hover { background: rgba(255,255,255,0.26); }
.lightbox-stage {
  width: min(94vw, calc(94vh * 16/9));
  aspect-ratio: 16/9;
  background: white;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 60px 120px -20px rgba(0,0,0,0.6);
}
.lightbox-stage svg,
.lightbox-stage object,
.lightbox-stage .slide-frame,
.lightbox-stage .slide-frame > svg { width: 100%; height: 100%; display: block; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
