/* ============ TIWAIWAKA immersive redesign ============ */
:root {
  --bg-deep: #060f08;
  --bg-mid: #0b1a0e;
  --bg-card: rgba(18, 43, 21, 0.55);
  --green-line: #1e4a24;
  --green: #2d6335;
  --green-bright: #4a9e5c;
  --sage: #8a9e8d;
  --gold: #c9a84c;
  --gold-bright: #e8c96a;
  --cream: #f0ead8;
  --serif: 'Playfair Display', serif;
  --sans: 'Inter', sans-serif;
  --mono: 'Courier New', monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg-deep);
  color: var(--cream);
  font-family: var(--sans);
  font-weight: 300;
  line-height: 1.7;
  overflow-x: hidden;
}

/* WebGL canvas behind everything */
#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: block;
}

/* Loader */
.loader {
  position: fixed; inset: 0; z-index: 100;
  background: var(--bg-deep);
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.9s ease, visibility 0.9s;
}
.loader.done { opacity: 0; visibility: hidden; }
.loader-inner { text-align: center; }
.loader-bird { font-size: 2.4rem; animation: flit 1.6s ease-in-out infinite; }
@keyframes flit {
  0%, 100% { transform: translate(0, 0) rotate(-6deg); }
  50% { transform: translate(10px, -12px) rotate(8deg); }
}
.loader-text {
  font-family: var(--serif); font-style: italic;
  color: var(--sage); margin: 1.2rem 0; letter-spacing: 0.04em;
}
.loader-bar {
  width: 180px; height: 2px; margin: 0 auto;
  background: var(--green-line); border-radius: 2px; overflow: hidden;
}
.loader-bar span {
  display: block; height: 100%; width: 0%;
  background: var(--gold-bright); transition: width 0.3s ease;
}

/* Ribbon */
.ribbon {
  position: relative; z-index: 5;
  font-size: 0.68rem; line-height: 1.5;
  color: var(--sage);
  background: rgba(6, 15, 8, 0.85);
  border-bottom: 1px solid var(--green-line);
  padding: 0.5rem 1.5rem;
  text-align: center;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.ribbon a { color: var(--gold); text-decoration: none; }

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 2.5rem;
  background: linear-gradient(rgba(6, 15, 8, 0.9), rgba(6, 15, 8, 0.65) 70%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(30, 74, 36, 0.4);
}
.nav-logo {
  font-family: var(--serif); font-weight: 700;
  color: var(--gold-bright); text-decoration: none;
  font-size: 1.1rem; letter-spacing: 0.06em;
}
.nav-links { display: flex; align-items: center; gap: 1.8rem; }
.nav-links a {
  color: var(--cream); text-decoration: none;
  font-size: 0.82rem; letter-spacing: 0.08em; text-transform: uppercase;
  opacity: 0.8; transition: opacity 0.25s, color 0.25s;
}
.nav-links a:hover { opacity: 1; color: var(--gold-bright); }
.nav-cta {
  border: 1px solid var(--gold); border-radius: 999px;
  padding: 0.45rem 1.2rem; color: var(--gold-bright) !important;
  opacity: 1 !important;
}
.nav-cta:hover { background: var(--gold); color: var(--bg-deep) !important; }

/* Layout */
main { position: relative; z-index: 10; }
.section {
  position: relative;
  min-height: 100vh;
  display: flex; flex-direction: column; justify-content: center;
  padding: 16vh 2.5rem;
}
.section-inner { width: 100%; max-width: 1100px; margin: 0 auto; }
.section-inner.narrow { max-width: 760px; }
.section-inner.center { text-align: center; }
.section-inner.narrow, #principles .section-inner {
  background: rgba(5, 13, 8, 0.5);
  border: 1px solid rgba(232, 201, 106, 0.08);
  border-radius: 28px;
  padding: 3.2rem 3.4rem;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.4);
}

.eyebrow {
  font-size: 0.75rem; letter-spacing: 0.35em; text-transform: uppercase;
  color: var(--gold-bright); margin-bottom: 1.2rem;
  text-shadow: 0 1px 4px rgba(3, 9, 5, 0.95), 0 2px 20px rgba(3, 9, 5, 0.85);
}
h1, h2, h3 { font-family: var(--serif); font-weight: 700; line-height: 1.15; }
h2, .lede, .section p, blockquote, .eyebrow { text-shadow: 0 1px 14px rgba(3, 9, 5, 0.75); }
h2 { font-size: clamp(2.2rem, 5vw, 3.6rem); margin-bottom: 1.6rem; }
h2 em { color: var(--gold-bright); font-style: italic; }
.lede { font-size: 1.15rem; color: var(--cream); margin-bottom: 1.4rem; }
.section p { color: var(--sage); margin-bottom: 1.2rem; }
.section .lede { color: var(--cream); }
blockquote {
  font-family: var(--serif); font-style: italic; font-size: 1.25rem;
  color: var(--gold-bright); line-height: 1.6;
  border-left: 2px solid var(--gold);
  padding-left: 1.4rem; margin: 2rem 0;
}

/* Hero */
.hero { text-align: center; align-items: center; min-height: 100vh; }
.hero::before {
  content: '';
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: min(980px, 97vw); height: 80%;
  background: radial-gradient(ellipse at center, rgba(4, 11, 6, 0.72), transparent 72%);
  pointer-events: none;
}
.hero > * { position: relative; z-index: 1; }
.hero .eyebrow {
  display: inline-block;
  background: rgba(4, 11, 6, 0.55);
  border: 1px solid rgba(232, 201, 106, 0.16);
  border-radius: 999px;
  padding: 0.55rem 1.4rem;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.hero-title {
  font-size: clamp(3rem, 10vw, 7.5rem);
  letter-spacing: 0.02em;
  background: linear-gradient(160deg, var(--cream) 30%, var(--gold-bright) 75%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 1.6rem;
  filter: drop-shadow(0 3px 22px rgba(3, 9, 5, 0.85));
}
.hero-whakatauki {
  font-family: var(--serif); font-style: italic;
  font-size: clamp(1.1rem, 2.4vw, 1.5rem); color: var(--cream) !important;
}
.hero-sub { color: var(--sage) !important; margin-bottom: 2.4rem; }
.hero-ctas { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; margin-bottom: 2.2rem; }

.btn {
  display: inline-block; text-decoration: none;
  font-family: var(--sans); font-size: 0.85rem; font-weight: 500;
  letter-spacing: 0.1em; text-transform: uppercase;
  padding: 0.9rem 2rem; border-radius: 999px;
  transition: all 0.3s ease;
}
.btn-gold {
  background: linear-gradient(135deg, var(--gold), var(--gold-bright));
  color: var(--bg-deep);
  box-shadow: 0 0 30px rgba(232, 201, 106, 0.25);
}
.btn-gold:hover { box-shadow: 0 0 50px rgba(232, 201, 106, 0.5); transform: translateY(-2px); }
.btn-ghost {
  border: 1px solid var(--green-bright); color: var(--cream);
  background: rgba(18, 43, 21, 0.3);
}
.btn-ghost:hover { border-color: var(--gold-bright); color: var(--gold-bright); }
.btn-sm { padding: 0.55rem 1.3rem; font-size: 0.75rem; }

.ca-pill {
  display: inline-flex; align-items: center; gap: 0.7rem;
  background: rgba(6, 15, 8, 0.7); border: 1px solid var(--green-line);
  border-radius: 999px; padding: 0.55rem 1.1rem;
  font-family: var(--mono); font-size: 0.72rem; color: var(--sage);
  cursor: pointer; transition: border-color 0.3s;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.ca-pill:hover { border-color: var(--gold); color: var(--cream); }
.ca-label {
  color: var(--gold-bright); font-weight: 700; font-family: var(--sans);
  font-size: 0.68rem; letter-spacing: 0.15em;
}
.ca-addr { max-width: 46vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ca-copied { display: none; color: var(--green-bright); font-family: var(--sans); }
.ca-pill.copied .ca-copied { display: inline; }

.scroll-hint {
  position: absolute; bottom: 2.2rem; left: 50%; transform: translateX(-50%);
  font-size: 0.7rem; letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--sage); display: flex; flex-direction: column; align-items: center; gap: 0.6rem;
}
.scroll-hint span {
  width: 1px; height: 44px;
  background: linear-gradient(var(--gold-bright), transparent);
  animation: drip 2s ease-in-out infinite;
}
@keyframes drip {
  0% { transform: scaleY(0); transform-origin: top; }
  50% { transform: scaleY(1); transform-origin: top; }
  51% { transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

/* Principles */
.principles-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1.4rem; margin-top: 3rem;
}
.principle {
  position: relative;
  background: var(--bg-card);
  border: 1px solid rgba(30, 74, 36, 0.6);
  border-radius: 18px;
  padding: 2rem 1.7rem;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
  overflow: hidden;
}
.principle::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 80% -10%, rgba(232, 201, 106, 0.12), transparent 55%);
  opacity: 0; transition: opacity 0.4s;
}
.principle:hover {
  transform: translateY(-6px);
  border-color: var(--gold);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45), 0 0 30px rgba(232, 201, 106, 0.08);
}
.principle:hover::before { opacity: 1; }
.principle-glyph { font-size: 1.7rem; margin-bottom: 1rem; }
.principle-num {
  font-size: 0.68rem; letter-spacing: 0.25em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 0.7rem;
}
.principle h3 { font-size: 1.25rem; color: var(--cream); margin-bottom: 0.2rem; }
.principle h4 {
  font-family: var(--sans); font-weight: 500; font-size: 0.85rem;
  color: var(--gold-bright); margin-bottom: 0.9rem; letter-spacing: 0.04em;
}
.principle p { font-size: 0.88rem; color: var(--sage); margin: 0; }

/* Stats */
.stats-grid, .token-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 1.2rem; margin-top: 2.6rem;
}
.stat, .token-stat {
  background: var(--bg-card);
  border: 1px solid rgba(30, 74, 36, 0.6);
  border-radius: 14px; padding: 1.5rem 1.2rem;
  text-align: center;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.stat-big, .token-big {
  font-family: var(--serif); font-size: 1.7rem; font-weight: 700;
  color: var(--gold-bright); margin-bottom: 0.4rem;
}
.stat-label, .token-label {
  font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--sage);
}
.live-note { font-size: 0.75rem; color: var(--sage); margin-top: 1.2rem; text-align: center; }

.ca-block {
  margin-top: 2.4rem;
  background: rgba(6, 15, 8, 0.75);
  border: 1px solid var(--green-line); border-radius: 14px;
  padding: 1.4rem 1.6rem;
  display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.ca-block-label {
  font-size: 0.7rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold);
}
.ca-block code {
  font-family: var(--mono); font-size: 0.78rem; color: var(--cream);
  word-break: break-all; flex: 1; min-width: 200px;
}

/* Community */
.community-links {
  display: flex; gap: 1rem; flex-wrap: wrap; justify-content: center; margin-top: 2.4rem;
}

/* Footer */
.footer {
  position: relative; z-index: 10;
  border-top: 1px solid var(--green-line);
  background: rgba(6, 15, 8, 0.92);
  padding: 4rem 2.5rem 2.5rem;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.footer-inner { max-width: 1100px; margin: 0 auto; }
.footer-logo { font-family: var(--serif); font-weight: 700; font-size: 1.3rem; color: var(--gold-bright); }
.footer-whakatauki { font-family: var(--serif); font-style: italic; color: var(--cream); margin-top: 0.8rem; }
.footer-trans { color: var(--sage); font-size: 0.85rem; }
.footer-cols { display: flex; gap: 5rem; margin: 2.2rem 0; }
.footer-cols a {
  display: block; color: var(--sage); text-decoration: none;
  font-size: 0.85rem; margin-bottom: 0.55rem; transition: color 0.25s;
}
.footer-cols a:hover { color: var(--gold-bright); }
.footer-legal { font-size: 0.68rem; color: var(--sage); opacity: 0.75; line-height: 1.6; }

/* Reveal base state (GSAP animates these) */
.reveal { opacity: 0; transform: translateY(40px); }
.no-js .reveal, .reveal.shown { opacity: 1; transform: none; }

/* Responsive */
@media (max-width: 900px) {
  .principles-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-grid, .token-grid { grid-template-columns: repeat(2, 1fr); }
  .nav-links a:not(.nav-cta) { display: none; }
}
@media (max-width: 560px) {
  /* compact disclaimer so it stops eating the top of the screen */
  .ribbon { font-size: 0.58rem; padding: 0.4rem 1rem; line-height: 1.45; }
  .nav { padding: 0.8rem 1.4rem; }

  .section { padding: 8vh 1.3rem; }
  .principles-grid { grid-template-columns: 1fr; }
  .section-inner.narrow, #principles .section-inner { padding: 1.6rem 1.3rem; border-radius: 18px; }
  h2 { font-size: 2rem; margin-bottom: 1.1rem; }
  .lede { font-size: 1.02rem; }

  /* hero: tighter stack + a much stronger scrim so the title reads over the bright sky */
  .hero::before {
    width: 100%; height: 100%;
    background: radial-gradient(ellipse at center, rgba(4, 11, 6, 0.86), rgba(4, 11, 6, 0.3) 78%);
  }
  .hero-title { margin-bottom: 1rem; filter: drop-shadow(0 3px 16px rgba(3, 9, 5, 0.98)); }
  .hero-whakatauki { font-size: 1.1rem; }
  .hero-sub { margin-bottom: 1.5rem; }
  .hero-ctas { margin-bottom: 1.3rem; gap: 0.7rem; }
  .scroll-hint { display: none; }

  /* tokenomics / stat cards: tighter so the panel isn't so tall */
  .stat, .token-stat { padding: 1.1rem 0.8rem; }
  .stat-big, .token-big { font-size: 1.4rem; }
  .stats-grid, .token-grid { gap: 0.8rem; margin-top: 2rem; }

  .footer-cols { gap: 2.5rem; flex-wrap: wrap; }
  .ca-addr { max-width: 38vw; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}
