/* ========================================
   FLAVOR GENOME PROJECT
   Aesthetic: Dark Scientific Editorial
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;1,300;1,400;1,500&family=JetBrains+Mono:wght@300;400&family=DM+Sans:wght@300;400;500&display=swap');

:root {
  --black: #0a0a08;
  --deep: #111110;
  --surface: #1a1a17;
  --surface-raised: #222220;
  --border: #2a2a26;
  --border-light: #3a3a34;
  --text-muted: #7a7a6e;
  --text-secondary: #a8a89a;
  --text-primary: #d4d4c8;
  --text-bright: #eae8dc;
  --amber: #c8a44e;
  --amber-dim: #a8883a;
  --amber-glow: #d4b85c;
  --wine: #8b3a4a;
  --wine-light: #a84e60;
  --sage: #6a7a5a;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--border-light) var(--black);
}

body {
  font-family: 'DM Sans', sans-serif;
  font-weight: 300;
  background: var(--black);
  color: var(--text-primary);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection {
  background: var(--amber);
  color: var(--black);
}

/* ---- LAYOUT ---- */

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
}

.container--narrow {
  max-width: 780px;
}

section {
  padding: 6rem 0;
  position: relative;
}

section[id] {
  scroll-margin-top: 70px;
}

/* ---- NOISE OVERLAY ---- */

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
}

/* ---- NAVIGATION ---- */

nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 1.25rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.4s, backdrop-filter 0.4s;
}

nav.scrolled {
  background: rgba(10, 10, 8, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.nav-mark {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 500;
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  color: var(--text-bright);
  text-decoration: none;
  text-transform: uppercase;
}

.nav-mark span {
  color: var(--amber);
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.3s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--amber);
}

/* Mobile menu toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 1px;
  background: var(--text-bright);
  transition: transform 0.3s, opacity 0.3s;
}

.nav-toggle.open span:first-child {
  transform: translateY(3px) rotate(45deg);
}

.nav-toggle.open span:last-child {
  transform: translateY(-3px) rotate(-45deg);
}

/* ---- HERO ---- */

.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  padding-top: 6rem;
  overflow: hidden;
}

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

.hero .container {
  position: relative;
  z-index: 1;
}

.hero::before {
  content: '';
  position: absolute;
  top: -20%;
  right: -10%;
  width: 60vw;
  height: 60vw;
  background: radial-gradient(ellipse, rgba(200, 164, 78, 0.04) 0%, transparent 70%);
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
}

.hero-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  font-weight: 300;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--amber-dim);
  margin-bottom: 2rem;
  opacity: 0;
  animation: fadeUp 0.8s 0.3s forwards;
}

.hero h1 {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 300;
  font-size: clamp(3rem, 7vw, 5.5rem);
  line-height: 1.05;
  color: var(--text-bright);
  letter-spacing: -0.02em;
  margin-bottom: 2rem;
  opacity: 0;
  animation: fadeUp 0.8s 0.5s forwards;
}

.hero h1 em {
  font-style: italic;
  color: var(--amber);
}

.hero-sub {
  font-size: 1.15rem;
  font-weight: 300;
  line-height: 1.8;
  color: var(--text-secondary);
  max-width: 540px;
  opacity: 0;
  animation: fadeUp 0.8s 0.7s forwards;
}

.hero-meta {
  margin-top: 4rem;
  display: flex;
  gap: 3rem;
  opacity: 0;
  animation: fadeUp 0.8s 0.9s forwards;
}

.hero-meta-item {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.hero-meta-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  font-weight: 300;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.hero-meta-value {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--text-bright);
}

/* ---- SECTION HEADERS ---- */

.section-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  font-weight: 300;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--amber-dim);
  margin-bottom: 1.5rem;
}

.section-label::before {
  content: '— ';
  color: var(--border-light);
}

h2 {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 300;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.15;
  color: var(--text-bright);
  letter-spacing: -0.01em;
  margin-bottom: 2rem;
}

h2 em {
  font-style: italic;
  color: var(--amber);
}

h3 {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 500;
  font-size: 1.3rem;
  color: var(--text-bright);
  margin-bottom: 0.75rem;
}

/* ---- ABOUT ---- */

.about {
  background: var(--deep);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
}

.about p {
  margin-bottom: 1.25rem;
  color: var(--text-secondary);
}

.about p:last-child {
  margin-bottom: 0;
}

.about a {
  color: var(--amber);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
}

.about a:hover {
  border-bottom-color: var(--amber);
}

.stat-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 2.5rem;
}

.stat {
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: 2px;
}

.stat-number {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2rem;
  font-weight: 300;
  color: var(--amber);
  line-height: 1;
  margin-bottom: 0.4rem;
}

.stat-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ---- WHAT WE DO ---- */

.capabilities {
  padding: 6rem 0;
}

.cap-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  margin-top: 3rem;
}

.cap-card {
  background: var(--black);
  padding: 2.5rem 2rem;
  transition: background 0.3s;
}

.cap-card:hover {
  background: var(--surface);
}

.cap-icon {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--amber-dim);
  letter-spacing: 0.15em;
  margin-bottom: 1.5rem;
  text-transform: uppercase;
}

.cap-card h3 {
  font-size: 1.15rem;
  margin-bottom: 1rem;
}

.cap-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.65;
}

/* ---- BOOK ANNOUNCEMENT ---- */

.book {
  background: var(--deep);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  position: relative;
}

.book::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -20%;
  width: 50vw;
  height: 200%;
  background: radial-gradient(ellipse, rgba(139, 58, 74, 0.06) 0%, transparent 60%);
  pointer-events: none;
}

.book-inner {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4rem;
  align-items: center;
}

.book-year {
  font-family: 'Cormorant Garamond', serif;
  font-size: 7rem;
  font-weight: 300;
  color: var(--border-light);
  line-height: 1;
  writing-mode: vertical-lr;
  transform: rotate(180deg);
}

.book-content h2 {
  margin-bottom: 1.25rem;
}

.book-content p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
  max-width: 580px;
}

.book-publisher {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--amber-dim);
  margin-top: 1.5rem;
}

/* ---- TIMELINE ---- */

.timeline {
  padding: 6rem 0;
}

.timeline-list {
  margin-top: 3rem;
  position: relative;
}

.timeline-list::before {
  content: '';
  position: absolute;
  left: 5.5rem;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--border);
}

.tl-item {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: 2.5rem;
  padding-bottom: 3rem;
  position: relative;
}

.tl-item:last-child {
  padding-bottom: 0;
}

.tl-year {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  font-weight: 300;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-align: right;
  padding-top: 0.15rem;
  position: relative;
}

.tl-year::after {
  content: '';
  position: absolute;
  right: -1.3rem;
  top: 0.45rem;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--amber-dim);
}

.tl-content h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.tl-content p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.tl-content a {
  color: var(--amber);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
}

.tl-content a:hover {
  border-bottom-color: var(--amber);
}

.tl-tag {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--sage);
  background: rgba(106, 122, 90, 0.1);
  padding: 0.2rem 0.6rem;
  border-radius: 1px;
  margin-bottom: 0.6rem;
}

/* ---- CONTACT ---- */

.contact {
  background: var(--deep);
  border-top: 1px solid var(--border);
  padding: 6rem 0;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
}

.contact p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.subscribe-form {
  margin-top: 1.5rem;
  position: relative;
}

.form-row {
  display: flex;
  gap: 0;
  border: 1px solid var(--border-light);
  border-radius: 2px;
  overflow: hidden;
  transition: border-color 0.3s;
}

.form-row:focus-within {
  border-color: var(--amber-dim);
}

.subscribe-form input[type="email"] {
  flex: 1;
  background: var(--surface);
  border: none;
  padding: 0.85rem 1rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 300;
  color: var(--text-bright);
  outline: none;
}

.subscribe-form input[type="email"]::placeholder {
  color: var(--text-muted);
}

.subscribe-form button {
  background: var(--amber-dim);
  border: none;
  padding: 0.85rem 1.5rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--black);
  cursor: pointer;
  transition: background 0.3s;
  white-space: nowrap;
}

.subscribe-form button:hover {
  background: var(--amber);
}

.form-message {
  font-size: 0.85rem;
  margin-top: 0.75rem;
  min-height: 1.2em;
}

.form-success {
  color: var(--sage);
}

.form-error {
  color: var(--wine-light);
}

.contact-email {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.5rem;
  color: var(--amber);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
}

.contact-email:hover {
  border-bottom-color: var(--amber);
}

.contact-detail {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 2rem;
}

.contact-detail strong {
  color: var(--text-secondary);
  font-weight: 400;
}

/* ---- FOOTER ---- */

footer {
  padding: 2rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

footer p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

footer a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.3s;
}

footer a:hover {
  color: var(--amber);
}

/* ---- ANIMATIONS ---- */

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* ---- REDUCED MOTION ---- */

@media (prefers-reduced-motion: reduce) {
  .hero-label, .hero h1, .hero-sub, .hero-meta {
    animation: none;
    opacity: 1;
  }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ---- RESPONSIVE ---- */

@media (max-width: 900px) {
  .about-grid,
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .cap-grid {
    grid-template-columns: 1fr;
  }

  .book-inner {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .book-year {
    writing-mode: horizontal-tb;
    transform: none;
    font-size: 4rem;
  }

  .hero-meta {
    flex-direction: column;
    gap: 1.5rem;
  }

  .stat-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  section {
    padding: 4rem 0;
  }

  .container {
    padding: 0 1.25rem;
  }

  nav {
    padding: 1rem 1.25rem;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: rgba(10, 10, 8, 0.95);
    backdrop-filter: blur(20px);
    padding: 1.5rem 1.25rem;
    gap: 1rem;
    border-bottom: 1px solid var(--border);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-toggle {
    display: flex;
  }

  .timeline-list::before {
    display: none;
  }

  .tl-item {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }

  .tl-year {
    text-align: left;
  }

  .tl-year::after {
    display: none;
  }
}
