/* ============================================
   VisiGrab — Single Page Brand Site
   Light, warm, bold. Gumroad-inspired indie feel.
   ============================================ */

:root {
  --cream: #faf7f2;
  --cream-dark: #f0ece4;
  --ink: #1a1a1a;
  --ink-soft: #3d3d3d;
  --ink-muted: #777;
  --gold: #e8a012;
  --gold-bright: #f0b42a;
  --gold-bg: #fef6e6;
  --coral: #e14b3b;
  --coral-bg: #fdeeed;
  --cyan: #1ca5c2;
  --cyan-bg: #e6f6fa;
  --border: #e2ddd5;
  --border-thick: #1a1a1a;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-pill: 100px;
}

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

/* Smooth only once the page has loaded (js/site.js adds the class): arriving from another page
   at /#topics then lands on the section at once instead of gliding down from the top. */
html.smooth-scroll { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--cream);
  color: var(--ink);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

.serif { font-family: 'Libre Baskerville', Georgia, serif; }
.mono { font-family: 'JetBrains Mono', monospace; }

/* ---- Container ---- */
.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 32px;
}

/* ---- Navigation ---- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  /* Opaque, no backdrop blur: with backdrop-filter, Chrome on macOS now and then drew the content
     scrolling underneath (a topic page's figure cards) above the panel for a frame. */
  background: var(--cream);
  border-bottom: 2px solid var(--border-thick);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav-logo {
  font-family: 'Libre Baskerville', serif;
  font-size: 1.25rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-logo svg { flex-shrink: 0; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
}

.nav-links a {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink-soft);
  transition: color 0.2s;
}

.nav-links a:hover { color: var(--ink); }

.nav-links a.btn-cta { color: #faf7f2; }
.nav-links a.btn-cta:hover { color: var(--ink); }

.btn-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.92rem;
  font-weight: 600;
  padding: 10px 24px;
  border-radius: var(--radius-pill);
  background: var(--ink);
  color: #faf7f2;
  border: 2px solid var(--ink);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-cta:hover {
  background: var(--gold);
  border-color: var(--ink);
  color: var(--ink);
  transform: translateY(-2px);
  box-shadow: 4px 4px 0 var(--ink);
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.92rem;
  font-weight: 600;
  padding: 10px 24px;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--ink);
  border: 2px solid var(--ink);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-outline:hover {
  background: var(--ink);
  color: var(--cream);
  transform: translateY(-2px);
  box-shadow: 4px 4px 0 var(--gold);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2.5px;
  background: var(--ink);
  border-radius: 2px;
  transition: all 0.3s ease;
}

/* ---- HERO ---- */
.hero {
  padding: 140px 0 100px;
  position: relative;
  overflow: hidden;
  border-bottom: 2px solid var(--border-thick);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.hero h1 {
  font-family: 'Libre Baskerville', serif;
  font-size: clamp(2.8rem, 5.5vw, 4rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
}

.hero h1 .highlight {
  color: var(--coral);
  font-style: italic;
}

.hero p {
  font-size: 1.15rem;
  color: var(--ink-soft);
  max-width: 480px;
  margin-bottom: 36px;
  line-height: 1.7;
}

.hero-buttons {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

/* Hero illustration — animated SVG tree */
.hero-illustration {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-illustration svg {
  width: 100%;
  max-width: 460px;
}

/* ---- Ticker ---- */
.ticker {
  padding: 20px 0;
  border-bottom: 2px solid var(--border-thick);
  overflow: hidden;
  background: var(--ink);
  color: var(--cream);
}

.ticker-track {
  display: flex;
  gap: 48px;
  animation: tickerScroll 30s linear infinite;
  width: max-content;
}

.ticker-item {
  font-size: 0.88rem;
  font-weight: 500;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: 0.02em;
}

.ticker-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold-bright);
  flex-shrink: 0;
}

@keyframes tickerScroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ---- Sections ---- */
section { padding: 100px 0; }

.section-border { border-bottom: 2px solid var(--border-thick); }

.section-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--ink-muted);
  margin-bottom: 16px;
}

.section-title {
  font-family: 'Libre Baskerville', serif;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}

.section-desc {
  font-size: 1.1rem;
  color: var(--ink-soft);
  max-width: 560px;
  line-height: 1.7;
}

/* ---- THE IDEA ---- */
.idea-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  margin-top: 56px;
}

.idea-card {
  padding: 40px;
  border-radius: var(--radius);
  border: 2px solid var(--border-thick);
  position: relative;
  overflow: hidden;
}

.idea-card--problem {
  background: var(--coral-bg);
}

.idea-card--solution {
  background: var(--gold-bg);
}

.idea-card h3 {
  font-family: 'Libre Baskerville', serif;
  font-size: 1.35rem;
  margin-bottom: 20px;
}

.idea-card ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.idea-card li {
  font-size: 1rem;
  color: var(--ink-soft);
  padding-left: 28px;
  position: relative;
  line-height: 1.55;
}

.idea-card--problem li::before {
  content: '×';
  position: absolute;
  left: 0;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--coral);
}

.idea-card--solution li::before {
  content: '→';
  position: absolute;
  left: 0;
  font-weight: 700;
  color: var(--gold);
}

/* ---- THE APPROACH (Triptych) ---- */
.approach-bg {
  background: var(--ink);
  color: var(--cream);
  border-top: 2px solid var(--border-thick);
  border-bottom: 2px solid var(--border-thick);
}

.approach-bg .section-label { color: var(--gold-bright); }
.approach-bg .section-desc { color: rgba(255,255,255,0.6); }

.triptych {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 56px;
}

.tri-card {
  border: 2px solid rgba(255,255,255,0.12);
  border-radius: var(--radius);
  padding: 36px 28px;
  text-align: center;
  transition: all 0.35s cubic-bezier(0.16,1,0.3,1);
  position: relative;
}

.tri-num {
  font-family: 'Libre Baskerville', serif;
  font-size: 3.5rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 16px;
  opacity: 0.15;
}

.tri-card:nth-child(1) .tri-num { color: var(--coral); opacity: 0.6; }
.tri-card:nth-child(2) .tri-num { color: var(--gold-bright); opacity: 0.6; }
.tri-card:nth-child(3) .tri-num { color: var(--cyan); opacity: 0.7; }

.tri-card h3 {
  font-family: 'Libre Baskerville', serif;
  font-size: 1.25rem;
  margin-bottom: 12px;
}

.tri-card p {
  font-size: 0.95rem;
  color: rgba(255,255,255,0.55);
  line-height: 1.6;
}

/* ---- TOPICS ---- */
.topics-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.topic-group {
  margin-top: 40px;
}

.topic-group-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 14px;
}

/* The groups follow the section's heading block, so the first group is the 2nd child. */
.topic-group:nth-child(2) .topic-group-label { color: var(--gold); }
.topic-group:nth-child(3) .topic-group-label { color: var(--coral); }
.topic-group:nth-child(4) .topic-group-label { color: var(--cyan); }
.topic-group:nth-child(5) .topic-group-label { color: var(--ink-muted); }

.chip {
  display: inline-block;
  padding: 9px 20px;
  border-radius: var(--radius-pill);
  font-size: 0.9rem;
  font-weight: 500;
  border: 2px solid var(--border-thick);
  background: white;
  transition: all 0.25s cubic-bezier(0.16,1,0.3,1);
  cursor: default;
}

/* A chip that opens the topic's page on the site: filled with its group's colour, with an arrow —
   the only chips that react to the pointer. */
a.chip { cursor: pointer; }
a.chip::after { content: ' →'; }
a.chip--gold { background: var(--gold-bg); border-color: var(--gold); }
a.chip--coral { background: var(--coral-bg); border-color: var(--coral); }
a.chip--cyan { background: var(--cyan-bg); border-color: var(--cyan); }

a.chip:hover {
  transform: translateY(-3px);
  box-shadow: 3px 3px 0 var(--border-thick);
}

/* A topic without a page on the site yet: an outline only, no fill and no arrow. */
span.chip { background: transparent; }

/* ---- SOCIAL PROOF ---- */
.proof-bg {
  background: var(--gold-bg);
  border-top: 2px solid var(--border-thick);
  border-bottom: 2px solid var(--border-thick);
}

.proof-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  margin-bottom: 64px;
  text-align: center;
}

.proof-stat h2 {
  font-family: 'Libre Baskerville', serif;
  font-size: clamp(2.8rem, 6vw, 4rem);
  font-weight: 700;
  color: var(--ink);
  line-height: 1;
}

.proof-stat p {
  font-size: 0.95rem;
  color: var(--ink-muted);
  margin-top: 8px;
}

.reviews-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.review-card {
  background: white;
  border: 2px solid var(--border-thick);
  border-radius: var(--radius);
  padding: 28px;
  transition: all 0.3s cubic-bezier(0.16,1,0.3,1);
}

.review-stars {
  color: var(--gold);
  font-size: 1rem;
  margin-bottom: 14px;
  letter-spacing: 2px;
}

.review-card blockquote {
  font-size: 0.98rem;
  color: var(--ink-soft);
  font-style: italic;
  line-height: 1.65;
}

/* ---- MISSION / ABOUT ---- */
.mission-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  margin-top: 48px;
  align-items: start;
}

.mission-text p {
  font-size: 1.05rem;
  color: var(--ink-soft);
  line-height: 1.75;
  margin-bottom: 20px;
}

.mission-values {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.value-card {
  padding: 28px;
  border: 2px solid var(--border-thick);
  border-radius: var(--radius);
  background: white;
  transition: all 0.3s cubic-bezier(0.16,1,0.3,1);
}

.value-card h4 {
  font-family: 'Libre Baskerville', serif;
  font-size: 1.05rem;
  margin-bottom: 8px;
}

.value-card p {
  font-size: 0.92rem;
  color: var(--ink-muted);
  line-height: 1.6;
}

/* ---- CTA FOOTER ---- */
.cta-final {
  text-align: center;
  padding: 100px 0;
  border-bottom: 2px solid var(--border-thick);
  position: relative;
}

.cta-final .section-title { margin-bottom: 16px; }
.cta-final .section-desc { margin: 0 auto 40px; text-align: center; }

.cta-buttons {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

.store-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 28px;
  border-radius: var(--radius);
  border: 2px solid var(--border-thick);
  background: white;
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.25s cubic-bezier(0.16,1,0.3,1);
}

.store-btn:hover {
  transform: translateY(-3px);
  box-shadow: 4px 4px 0 var(--border-thick);
}

.store-btn svg { width: 24px; height: 24px; flex-shrink: 0; }
.store-label { font-size: 0.72rem; color: var(--ink-muted); line-height: 1; }
.store-name { font-size: 1.05rem; font-weight: 700; line-height: 1.2; }

/* ---- FOOTER ---- */
.footer {
  padding: 48px 0 36px;
  background: var(--cream);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 40px;
  flex-wrap: wrap;
}

.footer-brand p {
  font-size: 0.88rem;
  color: var(--ink-muted);
  margin-top: 10px;
  max-width: 280px;
}

.footer-col h4 {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-muted);
  margin-bottom: 14px;
}

.footer-col a {
  display: block;
  font-size: 0.92rem;
  color: var(--ink-soft);
  padding: 3px 0;
  transition: color 0.2s;
}

.footer-col a:hover { color: var(--ink); }

.footer-bottom {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--ink-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-bottom a {
  color: var(--ink-muted);
  transition: color 0.2s;
}
.footer-bottom a:hover { color: var(--ink); }

/* ---- 404 ---- */
.not-found {
  padding: 150px 0 110px;
  border-bottom: 2px solid var(--border-thick);
}

.not-found-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.not-found h1 {
  font-family: 'Libre Baskerville', serif;
  font-size: clamp(2.6rem, 5.5vw, 4rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
}

.not-found h1 .highlight { color: var(--coral); font-style: italic; }

.not-found p:not(.section-label) {
  font-size: 1.15rem;
  color: var(--ink-soft);
  max-width: 440px;
  margin-bottom: 36px;
  line-height: 1.7;
}

.not-found-tree svg { width: 100%; max-width: 360px; display: block; margin: 0 auto; }

.not-found-tree figcaption {
  margin-top: 16px;
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--ink-muted);
}

/* ---- Scroll reveal ---- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.16,1,0.3,1), transform 0.7s cubic-bezier(0.16,1,0.3,1);
}
.reveal.visible { opacity: 1; transform: none; }
.reveal-d1 { transition-delay: 0.1s; }
.reveal-d2 { transition-delay: 0.2s; }
.reveal-d3 { transition-delay: 0.3s; }

/* ---- Responsive ---- */
@media (max-width: 860px) {
  .hero { padding: 100px 0 60px; }
  .hero-grid { grid-template-columns: 1fr; text-align: center; gap: 24px; }
  .hero p { margin-left: auto; margin-right: auto; }
  .hero-buttons { justify-content: center; }
  .hero-illustration { order: -1; margin-bottom: 0; }
  .hero-illustration svg { max-width: 320px; }
  .idea-grid { grid-template-columns: 1fr; }
  .triptych { grid-template-columns: 1fr; }
  .proof-stats { grid-template-columns: 1fr; gap: 40px; }
  .reviews-grid { grid-template-columns: 1fr; }
  .mission-cols { grid-template-columns: 1fr; }
  .not-found { padding: 110px 0 72px; }
  .not-found-grid { grid-template-columns: 1fr; gap: 40px; }
  .not-found .hero-buttons { justify-content: flex-start; }   /* the text above stays left-aligned */
  .not-found-tree { order: -1; }
  .not-found-tree svg { max-width: 260px; }
}

@media (max-width: 640px) {
  section { padding: 72px 0; }
  .nav-links { display: none; }
  .nav-toggle { display: flex; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 64px;
    left: 0; right: 0;
    background: var(--cream);
    padding: 20px 32px;
    gap: 16px;
    border-bottom: 2px solid var(--border-thick);
  }
  .cta-buttons { flex-direction: column; align-items: center; }
  .store-btn { width: 100%; max-width: 300px; justify-content: center; }
}

/* ---- Hero node animation ---- */
.edge-line {
  stroke-dasharray: 200;
  stroke-dashoffset: 200;
  animation: edgeDraw 2s ease forwards;
}
.edge-line:nth-child(2) { animation-delay: 0.3s; }
.edge-line:nth-child(3) { animation-delay: 0.6s; }
.edge-line:nth-child(4) { animation-delay: 0.9s; }
.edge-line:nth-child(5) { animation-delay: 1.2s; }
.edge-line:nth-child(6) { animation-delay: 1.5s; }

@keyframes edgeDraw {
  to { stroke-dashoffset: 0; }
}

/* Floating node groups — entire g (circle + text) moves together */
.float-label {
  animation: floatY 6s ease-in-out infinite;
}
.float-label:nth-of-type(2) { animation-delay: 0.8s; animation-duration: 5.5s; }
.float-label:nth-of-type(3) { animation-delay: 1.6s; animation-duration: 7s; }
.float-label:nth-of-type(4) { animation-delay: 0.4s; animation-duration: 6.5s; }
.float-label:nth-of-type(5) { animation-delay: 2s; animation-duration: 5s; }
.float-label:nth-of-type(6) { animation-delay: 1.2s; animation-duration: 7.5s; }
.float-label:nth-of-type(7) { animation-delay: 0.6s; animation-duration: 6s; }

@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}
