@tailwind base;
@tailwind components;
@tailwind utilities;

:root {
  /* Updated color scheme based on the logo */
  --theme-dark: #08160C; /* Deepest green/black */
  --theme-light: #F8F7F2; /* Warm off-white */
  --theme-brand: #186E38; /* Main Logo Green */
  
  --color-brand: #186E38; /* Green */
  --color-accent: #F8B226; /* Yellow/Leaf */
  --color-accent-dark: #D49315;
}

body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  background-color: var(--theme-dark);
  color: #fff;
  font-family: 'Inter', sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6, .font-fraunces {
  font-family: 'Fraunces', serif;
}

/* ░░░ GRAIN ░░░ */
.grain {
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.05;
  background-image: url('data:image/svg+xml,%3Csvg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"%3E%3Cfilter id="noiseFilter"%3E%3CfeTurbulence type="fractalNoise" baseFrequency="0.8" numOctaves="3" stitchTiles="stitch"/%3E%3C/filter%3E%3Crect width="100%25" height="100%25" filter="url(%23noiseFilter)"/%3E%3C/svg%3E');
}

/* ░░░ LOADER ░░░ */
.loader {
  position: fixed;
  inset: 0;
  background: var(--theme-dark);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}
.loader__word {
  font-family: 'Fraunces', serif;
  font-size: clamp(3rem, 10vw, 6rem);
  font-weight: 300;
  letter-spacing: -0.02em;
  color: #fff;
}
.loader__sub {
  font-size: 1rem;
  color: var(--color-brand);
  margin-top: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-weight: 700;
}

/* ░░░ PROGRESS SCRUB ░░░ */
.scrub {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 4px;
  background: rgba(255,255,255,0.05);
  z-index: 9000;
}
.scrub__bar {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--color-accent);
}

/* ░░░ FLOATING NAV ░░░ */
.nav {
  position: fixed;
  top: 2.5rem;
  left: 2.5rem;
  right: 2.5rem;
  display: flex;
  justify-content: space-between;
  z-index: 8000;
  mix-blend-mode: difference;
}
.nav__logo {
  font-family: 'Fraunces', serif;
  font-weight: 700;
  letter-spacing: 0.1em;
  font-size: 1.5rem;
  color: #fff;
}

/* ░░░ DOT RAIL ░░░ */
.rail {
  position: fixed;
  right: 2.5rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  z-index: 8000;
  mix-blend-mode: difference;
}
.rail-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.4);
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.rail-dot.is-active {
  background: #fff;
  transform: scale(2);
}

/* ░░░ CHAPTERS ░░░ */
.chapter {
  min-height: 100vh;
  padding: 8rem 2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
}

/* THEMES */
.theme-dark { background-color: var(--theme-dark); color: #fff; }
.theme-light { background-color: var(--theme-light); color: var(--theme-dark); }
.theme-brand { background-color: var(--theme-brand); color: #fff; }

.eyebrow {
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--color-accent);
  display: block;
  margin-bottom: 2rem;
  font-weight: 600;
}
.theme-light .eyebrow { color: var(--color-brand); }
.theme-brand .eyebrow { color: var(--color-accent); opacity: 0.9; }

.h1 {
  font-size: clamp(3rem, 6vw, 6rem);
  line-height: 1.1;
  font-family: 'Fraunces', serif;
  font-weight: 400;
  margin-bottom: 3rem;
  letter-spacing: -0.02em;
}

/* SPLIT TEXT UTILS */
.line { overflow: hidden; display: block; }
.word { display: inline-block; transform: translateY(110%); }
.line-wrapper { overflow: hidden; display: block; }

/* HERO */
.hero__wash {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(24, 110, 56, 0.15) 0%, var(--theme-dark) 70%);
  z-index: 0;
}
.hero__layout { position: relative; z-index: 1; }
.hero__bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.25;
  z-index: 0;
}

/* SOLUTION GRID */
.step-card {
  border-top: 1px solid rgba(255,255,255,0.2);
  padding-top: 2rem;
}
.theme-light .step-card { border-top-color: rgba(0,0,0,0.1); }

/* HORIZONTAL SCROLL DEMO */
.demo-wrap {
  overflow: hidden;
  width: 100%;
}
.demo-track {
  display: flex;
  width: max-content;
  padding-left: 20vw; /* Right padding handled by explicit spacer in HTML */
  align-items: center;
}
.device {
  width: 60vw;
  /* max-width removed to allow perfect vw math */
  flex-shrink: 0;
  margin-right: 10vw;
}
.device:last-of-type {
  margin-right: 0;
}

/* SCATTER PLOT */
.scatter-plot {
  width: 100%;
  height: 500px;
  position: relative;
  border-left: 2px solid rgba(0,0,0,0.1);
  border-bottom: 2px solid rgba(0,0,0,0.1);
}
.point {
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(0,0,0,0.2);
  transform: translate(-50%, 50%);
}
.point-label {
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  font-weight: 600;
  color: #4B5563;
  white-space: nowrap;
  font-size: 0.875rem;
}
.point.chorsu {
  background: var(--color-brand);
  width: 32px;
  height: 32px;
}
.chorsu-label {
  color: var(--color-brand);
  font-size: 1.25rem;
  top: -40px;
  font-weight: 800;
}
.chorsu-glow {
  position: absolute;
  inset: -10px;
  background: var(--color-brand);
  border-radius: 50%;
  opacity: 0.3;
  filter: blur(10px);
  z-index: -1;
}

/* MARKET TAM/SAM/SOM */
.market-showcase {
  display: flex;
  flex-direction: column;
  gap: 3rem;
}
.mkt-tier {
  display: grid;
  grid-template-columns: 300px 1fr 300px;
  gap: 2rem;
  align-items: center;
}
.mkt-tier-left {
  text-align: right;
}
.mkt-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 999px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
  color: #9CA3AF;
}
.mkt-label {
  font-size: 1.125rem;
  font-weight: 600;
  color: #D1D5DB;
}
.mkt-bar-track {
  width: 100%;
  height: 8px;
  background: rgba(255,255,255,0.05);
  border-radius: 4px;
  overflow: hidden;
}
.mkt-bar-fill {
  height: 100%;
  width: 0%; /* Animated via JS */
  border-radius: 4px;
}
.mkt-tier-right {
  text-align: left;
}
.mkt-number {
  display: block;
  font-size: 3rem;
  font-family: 'Fraunces', serif;
  font-weight: 400;
  line-height: 1;
  color: #fff;
  margin-bottom: 0.25rem;
}
.mkt-desc {
  font-size: 0.875rem;
  color: #6B7280;
  line-height: 1.4;
}

@media (max-width: 1024px) {
  .mkt-tier {
    grid-template-columns: 1fr;
    gap: 1rem;
    text-align: left;
  }
  .mkt-tier-left, .mkt-tier-right { text-align: left; }
  .mkt-bar-track { margin: 1rem 0; }
}

/* BIZ CARDS */
.biz-card {
  padding: 2.5rem;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(0,0,0,0.2);
  border-radius: 1.5rem;
  transition: border-color 0.3s ease;
}
.biz-card:hover { border-color: var(--color-accent); }
.biz-metric {
  color: var(--color-accent);
  font-size: 4rem;
  font-family: 'Fraunces', serif;
  margin-bottom: 1rem;
  line-height: 1;
}
.biz-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: #fff;
}
.biz-desc {
  color: rgba(255,255,255,0.8);
  line-height: 1.6;
}

/* UTILS */
.reveal-item { opacity: 0; transform: translateY(40px); }
