/* ============================================================
   AMEWIX DESIGN SYSTEM
   v1.0 — 20/05/2026
   ============================================================ */

/* ========== RESET ========== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
html.lenis { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: clip; }
img, svg { display: block; max-width: 100%; }
button { border: none; background: none; cursor: pointer; font: inherit; color: inherit; }

/* ========== TOKENS ========== */
:root {
  --bg-0: #0a0612;
  --bg-1: #110a1f;
  --bg-2: #1a1030;
  --ink-100: #f5f0ff;
  --ink-80: rgba(245, 240, 255, 0.78);
  --ink-60: rgba(245, 240, 255, 0.58);
  --ink-40: rgba(245, 240, 255, 0.38);
  --ink-20: rgba(245, 240, 255, 0.16);
  --ink-10: rgba(245, 240, 255, 0.08);
  --accent-purple: #a78bfa;
  --accent-cyan: #06b6d4;
  --accent-magenta: #e879f9;
  --accent-green: #34d399;
  --grad-primary: linear-gradient(135deg, #a78bfa 0%, #06b6d4 100%);
  --grad-italic: linear-gradient(120deg, #f5f0ff 0%, #c4b5fd 35%, #67e8f9 75%, #f5f0ff 100%);
  --ff-display: 'Instrument Serif', 'Times New Roman', serif;
  --ff-body: 'Geist', -apple-system, BlinkMacSystemFont, sans-serif;
  --ff-mono: 'Geist Mono', 'SF Mono', Menlo, monospace;
  --container: 1280px;
  --container-narrow: 880px;
  --gutter-lg: 96px;
  --gutter-md: 48px;
  --gutter-sm: 24px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.83, 0, 0.17, 1);
}

/* ========== BASE ========== */
body {
  font-family: var(--ff-body);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink-100);
  background: var(--bg-0);
  overflow-x: clip;
  letter-spacing: -0.005em;
  cursor: none;
}

@media (max-width: 768px) {
  body { cursor: auto; }
}

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

/* ========== TYPOGRAPHY ========== */
.ff-display { font-family: var(--ff-display); font-weight: 400; }
.ff-mono { font-family: var(--ff-mono); }
.italic { font-style: italic; }

.display-xl {
  font-family: var(--ff-display);
  font-size: clamp(3.4rem, 9vw, 8.4rem);
  line-height: 0.92;
  letter-spacing: -0.035em;
  font-weight: 400;
}
.display-lg {
  font-family: var(--ff-display);
  font-size: clamp(2.6rem, 6vw, 5.2rem);
  line-height: 0.96;
  letter-spacing: -0.03em;
  font-weight: 400;
}
.display-md {
  font-family: var(--ff-display);
  font-size: clamp(1.8rem, 3.2vw, 2.8rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-weight: 400;
}
.eyebrow {
  font-family: var(--ff-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-60);
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
}
.eyebrow::before {
  content: '';
  width: 1.5rem;
  height: 1px;
  background: var(--accent-purple);
  opacity: 0.7;
}
.lead {
  font-size: clamp(1.05rem, 1.5vw, 1.2rem);
  line-height: 1.55;
  color: var(--ink-80);
  font-weight: 400;
  max-width: 56ch;
  letter-spacing: -0.005em;
}
.gradient-text {
  background: var(--grad-italic);
  background-size: 200% 100%;
  background-position: 0% 50%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer 12s ease-in-out infinite;
}
@keyframes shimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* ========== LAYOUT ========== */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter-sm);
}
.container-narrow {
  max-width: var(--container-narrow);
  margin: 0 auto;
  padding: 0 var(--gutter-sm);
}
@media (min-width: 768px) {
  .container, .container-narrow { padding: 0 var(--gutter-md); }
}
section { position: relative; padding: clamp(80px, 12vw, 160px) 0; }

/* ========== CUSTOM CURSOR ========== */
.cursor-dot, .cursor-ring {
  position: fixed;
  top: 0; left: 0;
  pointer-events: none;
  z-index: 9999;
  mix-blend-mode: difference;
  will-change: transform;
}
.cursor-dot {
  width: 6px; height: 6px;
  background: var(--ink-100);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}
.cursor-ring {
  width: 36px; height: 36px;
  border: 1px solid var(--ink-100);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.3s var(--ease-out), height 0.3s var(--ease-out), border-color 0.3s;
}
.cursor-ring.hover {
  width: 64px; height: 64px;
  border-color: var(--accent-purple);
}
@media (max-width: 768px) {
  .cursor-dot, .cursor-ring { display: none; }
}

/* ========== GRAIN ========== */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: 0.04;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ========== 3D BG ========== */
#three-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* ========== LOADER ========== */
.loader {
  position: fixed;
  inset: 0;
  background: var(--bg-0);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 28px;
}
.loader.done { pointer-events: none; }
.loader-logo {
  width: 72px;
  height: 72px;
  opacity: 0;
  transform: scale(0.6) rotate(-90deg);
}
.loader-text {
  font-family: var(--ff-mono);
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-40);
  opacity: 0;
}
.loader-progress {
  position: absolute;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  width: 180px;
  height: 1px;
  background: var(--ink-10);
  overflow: hidden;
}
.loader-progress-bar {
  height: 100%;
  width: 0%;
  background: var(--grad-primary);
}

/* ========== NAV ========== */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  padding: 24px var(--gutter-sm);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: backdrop-filter 0.3s, background 0.3s, padding 0.3s;
}
.nav.scrolled {
  background: rgba(10, 6, 18, 0.6);
  backdrop-filter: blur(20px) saturate(120%);
  -webkit-backdrop-filter: blur(20px) saturate(120%);
  border-bottom: 1px solid var(--ink-10);
  padding: 16px var(--gutter-sm);
}
@media (min-width: 768px) {
  .nav { padding: 32px var(--gutter-md); }
  .nav.scrolled { padding: 18px var(--gutter-md); }
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink-100);
  z-index: 60;
}
.brand-mark { width: 28px; height: 28px; }
.brand-name {
  font-family: var(--ff-mono);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.12em;
}
.nav-links {
  display: none;
  gap: 36px;
  list-style: none;
  align-items: center;
}
@media (min-width: 900px) { .nav-links { display: flex; } }
.nav-links a {
  font-family: var(--ff-mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--ink-60);
  transition: color 0.3s;
  position: relative;
}
.nav-links a::after {
  content: '';
  position: absolute;
  left: 0; bottom: -6px;
  width: 0;
  height: 1px;
  background: var(--accent-purple);
  transition: width 0.3s var(--ease-out);
}
.nav-links a:hover, .nav-links a.active { color: var(--ink-100); }
.nav-links a.active::after { width: 100%; }
.nav-links a:hover::after { width: 100%; }

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border: 1px solid var(--ink-20);
  border-radius: 100px;
  background: rgba(245, 240, 255, 0.03);
  color: var(--ink-100);
  font-family: var(--ff-mono);
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  transition: border-color 0.3s, background 0.3s;
}
.nav-cta:hover {
  border-color: var(--accent-purple);
  background: rgba(167, 139, 250, 0.08);
}
.nav-cta-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-green);
  box-shadow: 0 0 8px rgba(52, 211, 153, 0.6);
}

/* ========== MOBILE NAV TOGGLE ========== */
.nav-toggle {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 12px;
  background: rgba(245, 240, 255, 0.05);
  border-radius: 8px;
  border: 1px solid var(--ink-10);
  z-index: 60;
}
.nav-toggle span {
  display: block;
  width: 18px;
  height: 1.5px;
  background: var(--ink-100);
  transition: transform 0.3s, opacity 0.3s;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }
@media (min-width: 900px) { .nav-toggle { display: none; } }

.nav-mobile {
  position: fixed;
  inset: 0;
  background: rgba(10, 6, 18, 0.97);
  backdrop-filter: blur(20px);
  z-index: 55;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s var(--ease-out);
}
.nav-mobile.open { opacity: 1; pointer-events: auto; }
.nav-mobile ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 24px;
  text-align: center;
}
.nav-mobile ul a {
  font-family: var(--ff-display);
  font-size: 2.4rem;
  letter-spacing: -0.02em;
  color: var(--ink-100);
}
.nav-mobile ul a.active { background: var(--grad-italic); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ========== BUTTONS ========== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 28px;
  border-radius: 100px;
  font-family: var(--ff-mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  transition: transform 0.3s var(--ease-out), background 0.3s, border-color 0.3s, color 0.3s;
  cursor: none;
  will-change: transform;
  position: relative;
  border: 1px solid transparent;
}
@media (max-width: 768px) { .btn { cursor: pointer; } }
.btn-primary {
  background: var(--ink-100);
  color: var(--bg-0);
  border-color: var(--ink-100);
}
.btn-primary:hover {
  background: transparent;
  color: var(--ink-100);
}
.btn-ghost {
  background: transparent;
  color: var(--ink-100);
  border-color: var(--ink-20);
}
.btn-ghost:hover {
  border-color: var(--ink-100);
  background: rgba(245, 240, 255, 0.04);
}
.btn-arrow {
  display: inline-block;
  transition: transform 0.3s var(--ease-out);
}
.btn:hover .btn-arrow { transform: translateX(4px); }

/* ========== HERO (shared) ========== */
.hero {
  min-height: 90vh;
  display: flex;
  align-items: center;
  padding: 140px 0 80px;
  position: relative;
  overflow: hidden;
}
.hero-mouse-light {
  position: absolute;
  width: 800px;
  height: 800px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(167, 139, 250, 0.18) 0%, rgba(6, 182, 212, 0.06) 35%, transparent 65%);
  pointer-events: none;
  filter: blur(40px);
  transform: translate(-50%, -50%);
  will-change: transform;
  z-index: 1;
}
.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(167, 139, 250, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(167, 139, 250, 0.04) 1px, transparent 1px);
  background-size: 80px 80px;
  mask-image: radial-gradient(circle at 50% 40%, black 0%, transparent 70%);
  -webkit-mask-image: radial-gradient(circle at 50% 40%, black 0%, transparent 70%);
  z-index: 1;
}
.hero-content { position: relative; z-index: 2; }
.hero-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}
.hero-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid var(--ink-10);
  border-radius: 100px;
  font-family: var(--ff-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-60);
  background: rgba(245, 240, 255, 0.02);
}
.hero-status-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 6px var(--accent-cyan);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.hero h1 .reveal {
  display: block;
  overflow: hidden;
}
.hero h1 .reveal-inner {
  display: block;
  transform: translateY(110%);
}

.scroll-cue {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--ff-mono);
  font-size: 0.65rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-40);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  z-index: 2;
}
.scroll-cue-line {
  width: 1px;
  height: 32px;
  background: linear-gradient(to bottom, var(--ink-40), transparent);
  animation: scrollLine 2s ease-in-out infinite;
}
@keyframes scrollLine {
  0% { transform: scaleY(0); transform-origin: top; }
  50% { transform: scaleY(1); transform-origin: top; }
  51% { transform: scaleY(1); transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

/* ========== SECTION HEAD ========== */
.section-head {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  margin-bottom: 80px;
  align-items: end;
}
@media (min-width: 900px) {
  .section-head { grid-template-columns: 1fr 1fr; gap: 96px; }
}
.section-num {
  font-family: var(--ff-mono);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  color: var(--ink-40);
  margin-bottom: 16px;
  display: block;
}

/* ========== PAGE HEADER (sub-pages) ========== */
.page-header {
  padding: 180px 0 80px;
  position: relative;
  overflow: hidden;
}
.page-header-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(167, 139, 250, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 50%, rgba(6, 182, 212, 0.1) 0%, transparent 50%);
  z-index: 1;
}
.page-header-content { position: relative; z-index: 2; }
.page-header h1 {
  margin-bottom: 24px;
  margin-top: 24px;
  max-width: 18ch;
}
.page-header .lead { max-width: 60ch; }

/* ========== PROSE (privacy/terms) ========== */
.prose { max-width: 70ch; color: var(--ink-80); font-size: 1rem; line-height: 1.75; }
.prose h2 {
  font-family: var(--ff-display);
  font-size: 1.8rem;
  letter-spacing: -0.015em;
  color: var(--ink-100);
  margin-top: 56px;
  margin-bottom: 16px;
  font-weight: 400;
}
.prose h3 {
  font-family: var(--ff-body);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink-100);
  margin-top: 32px;
  margin-bottom: 10px;
  letter-spacing: -0.005em;
}
.prose p { margin-bottom: 18px; }
.prose ul, .prose ol { margin: 12px 0 18px 24px; }
.prose li { margin-bottom: 8px; }
.prose strong { color: var(--ink-100); font-weight: 600; }
.prose a {
  color: var(--accent-purple);
  border-bottom: 1px solid rgba(167, 139, 250, 0.4);
  transition: border-color 0.3s;
}
.prose a:hover { border-color: var(--accent-purple); }
.prose hr { border: none; border-top: 1px solid var(--ink-10); margin: 48px 0; }
.prose code {
  font-family: var(--ff-mono);
  font-size: 0.85em;
  background: rgba(167, 139, 250, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--accent-purple);
}
.prose blockquote {
  border-left: 2px solid var(--accent-purple);
  padding-left: 20px;
  margin: 24px 0;
  font-style: italic;
  color: var(--ink-80);
}

.toc {
  position: sticky;
  top: 120px;
  padding: 24px;
  border: 1px solid var(--ink-10);
  border-radius: 16px;
  background: rgba(245, 240, 255, 0.02);
}
.toc-title {
  font-family: var(--ff-mono);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-60);
  margin-bottom: 16px;
}
.toc ul { list-style: none; }
.toc a {
  display: block;
  padding: 6px 0;
  font-family: var(--ff-mono);
  font-size: 0.8rem;
  color: var(--ink-60);
  transition: color 0.3s, padding-left 0.3s;
  border-left: 2px solid transparent;
  padding-left: 12px;
}
.toc a:hover {
  color: var(--ink-100);
  border-left-color: var(--accent-purple);
  padding-left: 16px;
}

.legal-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
}
@media (min-width: 900px) {
  .legal-grid { grid-template-columns: 220px 1fr; gap: 80px; }
}

/* ========== CARDS ========== */
.card {
  padding: 32px 28px 36px;
  border: 1px solid var(--ink-10);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(245, 240, 255, 0.025), rgba(245, 240, 255, 0));
  transition: border-color 0.3s, transform 0.3s;
  transform-style: preserve-3d;
  position: relative;
  overflow: hidden;
}
.card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(167, 139, 250, 0.12), transparent 40%);
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
}
.card:hover::before { opacity: 1; }
.card:hover { border-color: rgba(167, 139, 250, 0.3); }

/* ========== FOOTER ========== */
.footer {
  padding: 80px 0 40px;
  border-top: 1px solid var(--ink-10);
  background: var(--bg-0);
  position: relative;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
  margin-bottom: 60px;
}
@media (min-width: 800px) {
  .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; }
}
.footer-brand-block .footer-tagline {
  font-family: var(--ff-display);
  font-size: 1.3rem;
  line-height: 1.3;
  color: var(--ink-80);
  max-width: 30ch;
  margin-top: 24px;
  letter-spacing: -0.015em;
}
.footer-col-title {
  font-family: var(--ff-mono);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-40);
  margin-bottom: 20px;
}
.footer-col-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.footer-col-list a, .footer-col-list span {
  font-family: var(--ff-mono);
  font-size: 0.82rem;
  color: var(--ink-80);
  transition: color 0.3s;
}
.footer-col-list a:hover { color: var(--accent-purple); }
.footer-bottom {
  padding-top: 40px;
  border-top: 1px solid var(--ink-10);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.footer-bottom-text {
  font-family: var(--ff-mono);
  font-size: 0.74rem;
  color: var(--ink-60);
  letter-spacing: 0.02em;
}
.footer-bottom-text strong { color: var(--ink-80); font-weight: 500; }

/* ========== UTILITIES ========== */
.reduced-motion * {
  animation-duration: 0.01ms !important;
  transition-duration: 0.01ms !important;
}

/* ========== MOBILE ========== */
@media (max-width: 768px) {
  :root { --gutter-md: 24px; }
  .hero { padding: 120px 0 60px; min-height: 80vh; }
  .scroll-cue { display: none; }
  .page-header { padding: 140px 0 60px; }
}
