/* ==========================================================================
   BIWADA (biwada.com) — "The Living Garden // Factory of Factories"
   Awwwards Editorial & Botanical Cybernetics Design System
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=JetBrains+Mono:ital,wght@0,300;0,400;0,500;0,600;1,400&family=Plus+Jakarta+Sans:wght@300;400;500;600;700&family=Syne:wght@600;700;800&display=swap');

:root {
  --bg-obsidian: #060806;
  --bg-soil: #0b0f0c;
  --bg-canopy: #101712;
  --bg-card: rgba(15, 22, 17, 0.72);
  --fg-parchment: #f4f1ea;
  --fg-sage: #a3b1a6;
  --fg-muted: #5e6e62;
  --accent-chlorophyll: #4ade80;
  --accent-fern: #86efac;
  --accent-pollen: #e09f3e;
  --accent-starling: #2ec4b6;
  --border-hairline: rgba(244, 241, 234, 0.09);
  --border-glow: rgba(74, 222, 128, 0.28);

  --font-serif: 'Instrument Serif', Georgia, serif;
  --font-display: 'Syne', sans-serif;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

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

html {
  background-color: var(--bg-obsidian);
  color: var(--fg-parchment);
  font-family: var(--font-sans);
  scroll-behavior: smooth;
  overflow-x: hidden;
  selection-background-color: var(--accent-chlorophyll);
}

::selection {
  background: rgba(74, 222, 128, 0.25);
  color: var(--fg-parchment);
}

body {
  background-color: var(--bg-obsidian);
  color: var(--fg-parchment);
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
}

/* Subtle Organic Film Grain Overlay */
.grain-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 90;
  opacity: 0.035;
  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.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* Architectural Grid Lines */
.grid-guide {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  max-width: 1440px;
  margin: 0 auto;
  border-left: 1px solid rgba(244, 241, 234, 0.04);
  border-right: 1px solid rgba(244, 241, 234, 0.04);
}

.grid-guide::before,
.grid-guide::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(244, 241, 234, 0.03);
}
.grid-guide::before { left: 33.333%; }
.grid-guide::after { left: 66.666%; }

/* Custom Magnetic Reticle Cursor */
.custom-cursor-dot,
.custom-cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: width 0.25s cubic-bezier(0.16, 1, 0.3, 1),
              height 0.25s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.25s ease,
              background-color 0.25s ease;
}

.custom-cursor-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-chlorophyll);
  box-shadow: 0 0 12px var(--accent-chlorophyll);
}

.custom-cursor-ring {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(134, 239, 172, 0.35);
}

body.cursor-hover .custom-cursor-ring {
  width: 64px;
  height: 64px;
  border-color: var(--accent-pollen);
  background: rgba(224, 159, 62, 0.06);
}

@media (max-width: 900px) {
  .custom-cursor-dot,
  .custom-cursor-ring {
    display: none;
  }
}

/* Typography Primitives */
.font-serif-editorial {
  font-family: var(--font-serif);
}
.font-display-syne {
  font-family: var(--font-display);
}
.font-mono-tech {
  font-family: var(--font-mono);
}

.hero-headline {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(3.4rem, 7.8vw, 7.6rem);
  line-height: 0.94;
  letter-spacing: -0.02em;
}

.sec-headline {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(2.5rem, 5vw, 4.75rem);
  line-height: 1.02;
  letter-spacing: -0.015em;
}

/* Glass & Botanical Cards */
.botanical-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-hairline);
  border-radius: 20px;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.botanical-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(600px circle at var(--mouse-x, 50%) var(--mouse-y, 0%), rgba(74, 222, 128, 0.07), transparent 40%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.botanical-card:hover {
  border-color: rgba(134, 239, 172, 0.28);
  transform: translateY(-3px);
  box-shadow: 0 24px 60px -15px rgba(0, 0, 0, 0.7), 0 0 30px -10px rgba(74, 222, 128, 0.12);
}

.botanical-card:hover::before {
  opacity: 1;
}

/* Mode Pills & Interactive Buttons */
.mode-pill {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 9px 16px;
  border-radius: 9999px;
  border: 1px solid var(--border-hairline);
  background: rgba(11, 15, 12, 0.75);
  color: var(--fg-sage);
  cursor: pointer;
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.mode-pill:hover {
  border-color: rgba(134, 239, 172, 0.4);
  color: var(--fg-parchment);
}

.mode-pill.active {
  background: rgba(74, 222, 128, 0.12);
  border-color: var(--accent-chlorophyll);
  color: var(--fg-parchment);
  box-shadow: 0 0 20px rgba(74, 222, 128, 0.18);
}

.btn-awwwards {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 14px 26px;
  border-radius: 9999px;
  border: 1px solid rgba(244, 241, 234, 0.2);
  background: var(--fg-parchment);
  color: var(--bg-obsidian);
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
}

.btn-awwwards:hover {
  background: var(--accent-chlorophyll);
  border-color: var(--accent-chlorophyll);
  color: var(--bg-obsidian);
  transform: scale(1.03);
  box-shadow: 0 0 30px rgba(74, 222, 128, 0.35);
}

.btn-awwwards-ghost {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 14px 24px;
  border-radius: 9999px;
  border: 1px solid var(--border-hairline);
  background: rgba(15, 22, 17, 0.6);
  color: var(--fg-parchment);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: all 0.3s ease;
  cursor: pointer;
}

.btn-awwwards-ghost:hover {
  border-color: var(--accent-chlorophyll);
  color: var(--accent-fern);
}

/* Scroll Reveal Animations */
.reveal-item {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.85s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.85s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-item.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stage Node Active Styling */
.stage-node {
  cursor: pointer;
  transition: all 0.3s ease;
}

.stage-node.active {
  border-color: var(--accent-chlorophyll);
  background: rgba(74, 222, 128, 0.09);
}

/* Infinite Marquee */
.marquee-track {
  display: flex;
  width: max-content;
  animation: marqueeScroll 38s linear infinite;
}

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

/* Preloader Curtain */
#preloader {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: #050705;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 2.5rem;
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.7s ease;
}

#preloader.loaded {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
