:root {
  --bg: #0B0F0C;
  --bg-panel: #12160F;
  --bg-panel-alt: #1A2016;
  --ink: #F3F7F0;
  --text-soft: #A9B3A1;
  --lime: #C6FF3D;
  --lime-deep: #8FE000;
  --line: #262E22;
  --gradient: linear-gradient(115deg, var(--lime) 0%, var(--lime-deep) 100%);
  --accent-gradient: linear-gradient(135deg, var(--lime) 0%, var(--lime-deep) 100%);
  --radius: 20px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

img { max-width: 100%; display: block; }

h1, h2, h3 { margin: 0; letter-spacing: -0.01em; }

.eyebrow {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--lime);
  margin: 0 0 14px;
}

.eyebrow-light { color: var(--lime); }
.eyebrow-on-dark { color: var(--lime); }

.body-lg {
  font-size: 18px;
  line-height: 1.7;
  color: var(--text-soft);
  margin: 0;
}

.body-lg.on-dark { color: var(--text-soft); }

.centered { text-align: center; margin-inline: auto; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 15px 30px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 15px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease, color 0.2s ease;
}

.btn-primary {
  background: var(--accent-gradient);
  color: #0B0F0C;
  box-shadow: 0 10px 28px rgba(198, 255, 61, 0.25);
}

.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 32px rgba(198, 255, 61, 0.35); }

.btn-primary-inverse {
  background: var(--lime);
  color: #0B0F0C;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

.btn-primary-inverse:hover { transform: translateY(-2px); }

.btn-outline {
  border: 1.5px solid rgba(243, 247, 240, 0.35);
  color: var(--ink);
}

.btn-outline:hover { border-color: var(--lime); color: var(--lime); }

.btn-sm { padding: 11px 24px; font-size: 14px; margin-top: auto; align-self: flex-start; }

/* Decorative 3D-style shapes */
.shape {
  position: absolute;
  border-radius: 28%;
  z-index: 0;
  pointer-events: none;
}

.shape-hero-1 {
  width: 260px;
  height: 260px;
  top: -60px;
  right: -60px;
  background: var(--accent-gradient);
  transform: rotate(24deg);
  opacity: 0.9;
  box-shadow: inset -20px -20px 40px rgba(0,0,0,0.25), 0 30px 60px rgba(198,255,61,0.2);
}

.shape-hero-2 {
  width: 140px;
  height: 140px;
  bottom: 20px;
  right: 220px;
  background: var(--lime);
  border-radius: 50%;
  opacity: 0.08;
}

.shape-blob {
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  z-index: 0;
}

.shape-blob-a { background: var(--accent-gradient); transform: rotate(-4deg) scale(1.04); opacity: 0.16; }
.shape-blob-b { background: var(--accent-gradient); transform: rotate(4deg) scale(1.04); opacity: 0.16; }

.shape-philo {
  width: 220px;
  height: 220px;
  top: -80px;
  left: -60px;
  background: var(--accent-gradient);
  transform: rotate(-18deg);
  opacity: 0.16;
}

.shape-cta {
  width: 300px;
  height: 300px;
  bottom: -100px;
  right: -80px;
  background: var(--accent-gradient);
  transform: rotate(20deg);
  opacity: 0.18;
}

/* Nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 15, 12, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-logo-crop {
  display: flex;
  align-items: center;
}

.brand-logo {
  width: 260px;
  height: auto;
  transition: transform 0.2s ease;
}

.brand:hover .brand-logo { transform: scale(1.04); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
}

/* Hero */
.hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: min(88vh, 820px);
  padding: 110px max(32px, calc((100% - 1136px) / 2)) 100px;
  overflow: hidden;
  perspective: 1200px;
}

.hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: 0;
  transition: opacity 1.2s ease;
  pointer-events: none;
}

.hero-canvas.is-ready { opacity: 1; }

.has-webgl .shape-hero-1 { display: none; }

.hero-inner { position: relative; z-index: 1; max-width: 780px; }

.hero h1 {
  font-size: 62px;
  line-height: 1.06;
  color: var(--ink);
  margin: 10px 0 26px;
}

.hero .lead {
  font-size: 19px;
  line-height: 1.65;
  color: var(--text-soft);
  max-width: 600px;
  margin: 0 0 36px;
}

.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; }

/* Why LiVi */
.why {
  background: var(--bg-panel);
  padding: 96px 32px;
}

.why-head {
  max-width: 1200px;
  margin: 0 auto 48px;
}

.why-head h2 {
  font-size: 36px;
  line-height: 1.25;
  color: var(--ink);
  max-width: 620px;
}

.why-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.why-card {
  background: var(--bg-panel-alt);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px;
  position: relative;
}

.why-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}

.why-card h3 { font-size: 18px; color: var(--ink); margin: 0 0 8px; }
.why-card p { font-size: 14.5px; line-height: 1.6; color: var(--text-soft); margin: 0; }

/* Stats */
.stats {
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.stats-grid {
  max-width: 1200px;
  margin: 0 auto;
  padding: 56px 32px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
  text-align: center;
}

.stat-num {
  display: block;
  font-size: 44px;
  font-weight: 800;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.stat-label {
  display: block;
  margin-top: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-soft);
}

/* Featured products */
.featured {
  max-width: 1200px;
  margin: 0 auto;
  padding: 96px 32px;
}

.featured-head {
  margin-bottom: 56px;
  max-width: 640px;
}

.featured-head h2 {
  font-size: 36px;
  line-height: 1.25;
  color: var(--ink);
}

.feature-row {
  position: relative;
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 48px;
  align-items: center;
  padding: 44px 0;
  border-top: 1px solid var(--line);
}

.feature-row:last-child { border-bottom: 1px solid var(--line); }

.feature-row-reverse { direction: rtl; }
.feature-row-reverse > * { direction: ltr; }

.feature-visual {
  position: relative;
  aspect-ratio: 1 / 0.75;
  border-radius: var(--radius);
  background: var(--bg-panel);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
}

.feature-visual-muted { background: var(--bg-panel); }

.feature-visual svg rect,
.feature-visual svg circle,
.feature-visual svg line,
.feature-visual svg path { stroke: var(--lime) !important; }

.feature-visual svg path[fill] { fill: var(--lime) !important; }

.status-badge {
  display: inline-block;
  align-self: flex-start;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: 999px;
  margin-bottom: 14px;
}

.status-live { background: rgba(198, 255, 61, 0.18); color: var(--lime); }
.status-soon { background: rgba(169, 179, 161, 0.15); color: var(--text-soft); }

.feature-copy { display: flex; flex-direction: column; }
.feature-copy h3 { font-size: 26px; color: var(--ink); margin: 0 0 12px; }
.feature-copy p { font-size: 15.5px; line-height: 1.65; color: var(--text-soft); margin: 0 0 18px; }

.feature-list {
  margin: 0 0 24px;
  padding: 0 0 0 18px;
  color: var(--text-soft);
  font-size: 14.5px;
  line-height: 1.7;
}

.feature-list a {
  color: var(--lime);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.feature-list a:hover { color: var(--ink); }

/* What we build (portfolio) */
.portfolio {
  background: var(--bg-panel);
  padding: 96px 32px;
}

.portfolio-head {
  max-width: 1200px;
  margin: 0 auto 48px;
}

.portfolio-head h2 {
  font-size: 36px;
  line-height: 1.25;
  color: var(--ink);
  max-width: 680px;
}

.portfolio-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 22px;
}

.card {
  background: var(--bg-panel-alt);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  position: relative;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--accent-gradient);
}

.card-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--lime);
  margin-bottom: 14px;
}

.card h3 { font-size: 18px; line-height: 1.4; color: var(--ink); margin: 0 0 10px; }

.card p { font-size: 14.5px; line-height: 1.6; color: var(--text-soft); margin: 0; }

/* Books */
.books {
  max-width: 1200px;
  margin: 0 auto;
  padding: 96px 32px;
}

.books-head {
  margin-bottom: 48px;
  max-width: 680px;
}

.books-head h2 {
  font-size: 34px;
  line-height: 1.3;
  color: var(--ink);
}

.book-series { margin-bottom: 56px; }
.book-series:last-child { margin-bottom: 0; }

.book-series-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 22px;
}

.book-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.book-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-panel-alt);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  position: relative;
}

.book-card-muted { cursor: default; overflow: hidden; }

.book-cover {
  aspect-ratio: 3 / 4;
  background: var(--bg-panel);
  border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0;
  overflow: hidden;
}

.book-cover img { width: 100%; height: 100%; object-fit: cover; }

.book-cover img.book-cover-contain { object-fit: contain; }

.book-cover-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
}

.book-info { padding: 22px; display: flex; flex-direction: column; gap: 6px; }

.book-info h4 { font-size: 16.5px; line-height: 1.4; color: var(--ink); margin: 4px 0 0; }

.book-info p { font-size: 13.5px; line-height: 1.55; color: var(--text-soft); margin: 0 0 6px; }

.book-link { font-size: 13.5px; font-weight: 700; color: var(--lime); }

/* Philosophy */
.philosophy {
  position: relative;
  max-width: 820px;
  margin: 0 auto;
  padding: 120px 32px;
  text-align: center;
  overflow: hidden;
}

.philosophy h2 {
  font-size: 42px;
  line-height: 1.25;
  color: var(--ink);
  margin: 0 0 20px;
}

/* Values */
.values {
  max-width: 1200px;
  margin: 0 auto;
  padding: 88px 32px;
  text-align: center;
}

.values-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.value-pill {
  padding: 12px 22px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: var(--bg-panel);
  font-weight: 600;
  color: var(--ink);
  font-size: 15px;
}

.value-dot { color: var(--lime); font-size: 20px; }

/* CTA */
.cta {
  position: relative;
  background: var(--bg-panel);
  overflow: hidden;
  max-width: none;
  padding: 110px 32px 130px;
  text-align: center;
}

.cta > *:not(.shape) { position: relative; z-index: 1; }

.cta h2 {
  font-size: 44px;
  line-height: 1.25;
  color: var(--ink);
  margin: 0 0 20px;
}

.cta-lead { max-width: 560px; margin: 0 auto 36px; }

.cta-actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin-bottom: 36px; }

.btn-outline-inverse {
  border: 1.5px solid rgba(243, 247, 240, 0.4);
  color: var(--ink);
}

.btn-outline-inverse:hover { border-color: var(--lime); color: var(--lime); background: rgba(198, 255, 61, 0.06); }

.contact-row {
  display: flex;
  gap: 28px;
  justify-content: center;
  flex-wrap: wrap;
}

.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-soft);
  font-size: 14.5px;
  font-weight: 600;
  transition: color 0.2s ease;
}

.contact-link:hover { color: var(--lime); }

/* Footer */
.footer {
  border-top: 1px solid var(--line);
  background: var(--bg);
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  color: var(--text-soft);
  font-size: 14px;
}

.footer-logo-crop {
  display: flex;
  align-items: center;
}

.footer-logo {
  width: 190px;
  height: auto;
}

.footer-inner p { margin: 0; flex: 1; }

.footer-links { display: flex; gap: 24px; font-weight: 600; color: var(--ink); }
.footer-links a:hover { color: var(--lime); }

/* Responsive */
@media (max-width: 900px) {
  .why-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .portfolio-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .book-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .feature-row, .feature-row-reverse { grid-template-columns: 1fr; direction: ltr; }
  .shape-hero-1 { width: 180px; height: 180px; }
  .shape-hero-2 { display: none; }
}

/* 3D scroll reveal: elements swing up out of depth */
.why, .why-grid, .stats-grid, .featured, .portfolio, .portfolio-grid,
.books, .book-series, .philosophy, .values, .cta { perspective: 1200px; }

[data-reveal],
.tilt {
  transition:
    opacity 0.8s ease,
    translate 0.9s cubic-bezier(0.16, 1, 0.3, 1),
    rotate 0.9s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.5s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.3s ease,
    border-color 0.3s ease;
}

[data-reveal] {
  opacity: 0;
  translate: 0 48px;
  rotate: x 14deg;
  transform-origin: 50% 100%;
}

[data-reveal].is-visible {
  opacity: 1;
  translate: 0 0;
  rotate: x 0deg;
}

.stat[data-reveal] { rotate: x 75deg; translate: 0 16px; transform-origin: 50% 50%; }
.stat[data-reveal].is-visible { rotate: x 0deg; translate: 0 0; }

.why-grid [data-reveal]:nth-child(2) { transition-delay: 0.08s; }
.why-grid [data-reveal]:nth-child(3) { transition-delay: 0.16s; }
.why-grid [data-reveal]:nth-child(4) { transition-delay: 0.24s; }
.why-grid [data-reveal]:nth-child(5) { transition-delay: 0.32s; }
.why-grid [data-reveal]:nth-child(6) { transition-delay: 0.4s; }

.portfolio-grid [data-reveal]:nth-child(2) { transition-delay: 0.08s; }
.portfolio-grid [data-reveal]:nth-child(3) { transition-delay: 0.16s; }
.portfolio-grid [data-reveal]:nth-child(4) { transition-delay: 0.24s; }

.stats-grid [data-reveal]:nth-child(2) { transition-delay: 0.08s; }
.stats-grid [data-reveal]:nth-child(3) { transition-delay: 0.16s; }
.stats-grid [data-reveal]:nth-child(4) { transition-delay: 0.24s; }

/* Once revealed, drop the stagger so hover/tilt responds instantly */
[data-reveal].reveal-done { transition-delay: 0s; }

/* Hero copy leans toward the pointer */
.hero-inner {
  transform: rotateY(calc(var(--hx, 0) * 5deg)) rotateX(calc(var(--hy, 0) * -4deg));
}

/* Pointer-driven 3D tilt with lifted, layered content */
.tilt {
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateZ(var(--lift, 0px));
  transform-style: preserve-3d;
}

.tilt::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(198, 255, 61, 0.14), transparent 55%);
  opacity: 0;
  transform: translateZ(1px);
  transition: opacity 0.3s ease;
}

.tilt:hover { --lift: 16px; }
.tilt:hover::after { opacity: 1; }

.why-card.tilt:hover,
.card.tilt:hover,
.book-card.tilt:hover {
  border-color: rgba(198, 255, 61, 0.3);
  box-shadow: 0 28px 50px rgba(0, 0, 0, 0.5), 0 0 40px rgba(198, 255, 61, 0.08);
}

.why-card .why-icon { transform: translateZ(40px); box-shadow: 0 14px 24px rgba(0, 0, 0, 0.35); }
.why-card h3, .card h3 { transform: translateZ(26px); }
.why-card p, .card p { transform: translateZ(14px); }
.card .card-tag { transform: translateZ(34px); }

.book-cover { transform: translateZ(18px); box-shadow: 0 18px 30px rgba(0, 0, 0, 0.45); transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1); }
.book-info { transform: translateZ(12px); }

/* Product visuals: stacked 3D layers with a floating icon */
.feature-visual > img,
.feature-visual > svg {
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 20px 22px rgba(0, 0, 0, 0.55));
  animation: float3d 6s ease-in-out infinite;
}

@keyframes float3d {
  0%, 100% { transform: translateZ(60px) translateY(0) rotateY(-10deg); }
  50% { transform: translateZ(70px) translateY(-10px) rotateY(12deg); }
}

.shape-blob { transition: opacity 0.4s ease, transform 0.6s cubic-bezier(0.16, 1, 0.3, 1); }
.feature-visual .shape-blob { inset: 12%; }
.shape-blob-a { transform: translateZ(20px) rotate(-6deg); }
.shape-blob-b { transform: translateZ(20px) rotate(6deg); }
.feature-row:hover .shape-blob { opacity: 0.24; transform: translateZ(36px) rotate(0deg); }

/* Value pills tip forward on hover */
.value-pill { transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s ease, box-shadow 0.3s ease; }
.value-pill:hover {
  transform: perspective(400px) rotateX(14deg) translateY(-4px);
  border-color: var(--lime);
  box-shadow: 0 14px 24px rgba(0, 0, 0, 0.4);
}

/* Decorative shapes: scroll parallax via `translate`, slow 3D spin via `transform` */
.shape[data-parallax] {
  --parallax-y: 0px;
  translate: 0 var(--parallax-y);
}

.shape-hero-1 { transform: rotate(24deg); }
.shape-hero-2 { transform: none; }
.shape-philo { animation: spin3d-a 26s linear infinite; }
.shape-cta { animation: spin3d-b 30s linear infinite; }

@keyframes spin3d-a {
  from { transform: rotateX(0deg) rotateY(0deg) rotate(-18deg); }
  to { transform: rotateX(360deg) rotateY(360deg) rotate(-18deg); }
}

@keyframes spin3d-b {
  from { transform: rotateY(0deg) rotateX(20deg) rotate(20deg); }
  to { transform: rotateY(-360deg) rotateX(20deg) rotate(20deg); }
}

@media (max-width: 1100px) {
  .hero-canvas.is-ready { opacity: 0.55; }
}

@media (max-width: 720px) {
  .hero-canvas.is-ready { opacity: 0.4; }
}

@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; translate: none; rotate: none; transition: none; }
  .shape, .feature-visual > img, .feature-visual > svg { animation: none !important; }
  .hero-inner { transform: none; }
}

@media (max-width: 720px) {
  .nav-links { position: fixed; inset: 64px 0 auto 0; background: var(--bg); flex-direction: column; padding: 24px 32px; gap: 20px; border-bottom: 1px solid var(--line); transform: translateY(-120%); transition: transform 0.25s ease; }
  .nav-links.open { transform: translateY(0); }
  .nav-toggle { display: flex; }
  .hero h1 { font-size: 38px; }
  .why-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 16px; }
  .portfolio-grid { grid-template-columns: 1fr; }
  .book-grid { grid-template-columns: 1fr; }
  .cta h2, .philosophy h2 { font-size: 28px; }
}
