/* =========================================================================
   FIRTERA — Landing Page v3.1 (scroll-snap + explicit container)
   2026-04-10T22:00+07:00 — Opus+max — force deploy
   Palette: yellow-on-black + green-blue aurora + hex scale hero texture
   ========================================================================= */

/* -------- Variables -------- */
:root {
  --color-base: #050505;
  --color-text: #f5f5f4;
  --color-muted: #a1a1aa;
  --color-yellow: #FBBF24;
  --color-yellow-dim: #A16207;
  --color-teal: #14B8A6;
  --color-green: #22C55E;
  --color-cyan: #06B6D4;
  --color-purple: #A78BFA;
  --color-ring: #141414;
  --color-card: #0a0a0a;

  --font-display: "Outfit", system-ui, -apple-system, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;

  --pad-y: clamp(3rem, 6vw, 5rem);
  --pad-x: clamp(1.5rem, 5vw, 3rem);
  --max-w: min(64ch, 90vw);
  --grid-w: min(1100px, 92vw);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* -------- Reset -------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body {
  background: var(--color-base);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.7;
  letter-spacing: 0.005em;
  margin: 0;
  overflow: hidden; /* body doesn't scroll — snap-wrap does */
  height: 100vh;
  height: 100dvh;
}

/* -------- Snap container -------- */
.snap-wrap {
  height: 100vh;
  height: 100dvh;
  overflow-x: hidden;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
}

/* All direct children: snap targets + EXACT viewport height */
.snap-wrap > * {
  position: relative;
  height: 100vh;
  height: 100dvh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

/* Footer: short, not full-screen */
.snap-wrap > .footer {
  height: auto;
  min-height: 0;
}

/* Vertical centering for content sections (not hero — it has its own flex) */
.snap-wrap > *:not(.hero) {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Gradient divider at bottom of each section (except last) */
.snap-wrap > *:not(:last-child)::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: var(--grid-w);
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    var(--color-teal) 30%,
    var(--color-green) 50%,
    var(--color-teal) 70%,
    transparent 100%
  );
  opacity: 0.25;
  pointer-events: none;
  z-index: 2;
}

/* -------- Wordmark -------- */
.wm-fir  { color: var(--color-yellow); font-weight: 600; }
.wm-tera { color: var(--color-text);   font-weight: 600; }
.punct   { color: var(--color-yellow); }

/* -------- Hero -------- */
.hero {
  position: relative;
  height: 100vh;
  height: 100dvh;
  display: flex;
  align-items: center;
  overflow: hidden;
}
.hero__scales {
  position: absolute;
  inset: 0;
  background:
    url('scales.svg') repeat,
    radial-gradient(ellipse 30% 50% at 15% 40%, rgba(13,148,136,0.14) 0%, transparent 100%),
    radial-gradient(ellipse 25% 45% at 50% 45%, rgba(16,185,129,0.12) 0%, transparent 100%),
    radial-gradient(ellipse 30% 50% at 85% 38%, rgba(6,182,212,0.13) 0%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 90% 85% at 50% 45%, black 25%, transparent 75%);
  mask-image: radial-gradient(ellipse 90% 85% at 50% 45%, black 25%, transparent 75%);
  pointer-events: none;
  z-index: 0;
  animation: scaleDrift 60s linear infinite;
}
@keyframes scaleDrift {
  from { background-position: 0 0, 0 0, 0 0, 0 0; }
  to   { background-position: 70px 120px, 0 0, 0 0, 0 0; }
}
.hero__content {
  position: relative;
  z-index: 1;
  padding: var(--pad-y) var(--pad-x);
  max-width: var(--max-w);
  margin: 0 auto;
}
.hero .wordmark {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
  letter-spacing: 0.01em;
  margin-bottom: clamp(3rem, 8vw, 5rem);
  opacity: 0;
  transform: translateY(-8px);
  animation: fadeIn 1.2s var(--ease) forwards;
}
.hero__headline {
  font-family: var(--font-display);
  font-size: clamp(3rem, 9vw, 6.5rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.05;
  margin-bottom: 2rem;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 1s var(--ease) 0.3s forwards;

  /* Aurora gradient text */
  background: linear-gradient(
    90deg,
    var(--color-teal) 0%,
    var(--color-green) 35%,
    var(--color-text) 55%,
    var(--color-text) 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero__headline .punct {
  -webkit-text-fill-color: var(--color-yellow);
}
.hero__sub {
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  color: color-mix(in srgb, var(--color-text) 80%, transparent);
  max-width: 48ch;
  line-height: 1.75;
  letter-spacing: 0.01em;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 1s var(--ease) 0.7s forwards;
}

/* -------- Shared section styles -------- */
.sh {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 5vw, 3.25rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 2rem;
}
.prose p {
  font-size: clamp(1.05rem, 1.4vw, 1.2rem);
  margin-bottom: 1.25rem;
  max-width: 56ch;
  color: color-mix(in srgb, var(--color-text) 85%, transparent);
  letter-spacing: 0.01em;
}
.aside {
  font-weight: 500;
  color: var(--color-text) !important;
  font-style: italic;
}

/* -------- Problem -------- */
.problem {
  padding: var(--pad-y) var(--pad-x);
  max-width: var(--max-w);
  margin: 0 auto;
}

/* -------- Services -------- */
.services {
  padding: var(--pad-y) var(--pad-x);
  max-width: var(--grid-w);
  margin: 0 auto;
}
.services__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-top: 2.5rem;
}
.svc {
  padding: 2rem 1.75rem;
  border: 1px solid var(--color-ring);
  border-radius: 10px;
  background: var(--color-card);
  position: relative;
  overflow: hidden;
  transition:
    border-color 0.5s var(--ease),
    transform 0.5s var(--ease),
    box-shadow 0.5s var(--ease);
}
/* Colored top accent per card */
.svc::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  opacity: 0.6;
  transition: opacity 0.5s var(--ease);
}
.svc:nth-child(1)::before { background: var(--color-teal); }
.svc:nth-child(2)::before { background: var(--color-green); }
.svc:nth-child(3)::before { background: var(--color-cyan); }
.svc:nth-child(4)::before { background: var(--color-purple); }
.svc:hover {
  border-color: color-mix(in srgb, var(--color-teal) 40%, var(--color-ring));
  transform: translateY(-3px);
  box-shadow:
    0 20px 50px -20px color-mix(in srgb, var(--color-teal) 15%, transparent);
}
.svc:hover::before { opacity: 1; }
.svc__title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--color-yellow);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.75rem;
}
.svc p {
  font-size: 0.95rem;
  color: color-mix(in srgb, var(--color-text) 68%, transparent);
  line-height: 1.65;
}

/* -------- Method -------- */
.method {
  padding: var(--pad-y) var(--pad-x);
  max-width: var(--max-w);
  margin: 0 auto;
}

/* -------- Surprise -------- */
.surprise {
  padding: var(--pad-y) var(--pad-x);
  max-width: var(--max-w);
  margin: 0 auto;
  text-align: center;
  align-items: center;
}
.surprise .prose { display: inline-block; text-align: left; }
.pixel-agent {
  margin-top: 3rem;
  display: flex;
  justify-content: center;
}
.pixel-agent__art {
  width: 96px;
  height: 96px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  filter: drop-shadow(0 0 24px color-mix(in srgb, var(--color-teal) 30%, transparent));
}

/* -------- Footer -------- */
.footer {
  position: relative;
  padding: 5rem var(--pad-x) 6rem;
  text-align: center;
  align-items: center;
  overflow: hidden;
}
/* Aurora glow behind footer wordmark */
.footer::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 400px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(20,184,166,0.08) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}
.footer__wm {
  position: relative;
  z-index: 1;
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}
.footer__origin {
  position: relative;
  z-index: 1;
  color: var(--color-muted);
  font-size: 0.875rem;
  font-style: italic;
  letter-spacing: 0.04em;
}

/* -------- Scroll reveal -------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}
.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* -------- Keyframes -------- */
@keyframes fadeIn  { to { opacity: 1; transform: translateY(0); } }
@keyframes fadeUp  { to { opacity: 1; transform: translateY(0); } }

/* -------- Responsive (mobile) -------- */
@media (max-width: 640px) {
  body { font-size: 1rem; }
  .services__grid { gap: 0.75rem; }
  .svc { padding: 1.25rem 1rem; }
  .svc__title { font-size: 1rem; margin-bottom: 0.5rem; }
  .svc p { font-size: 0.85rem; line-height: 1.5; }
  .pixel-agent__art { width: 72px; height: 72px; }
}

/* -------- Reduced motion -------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .snap-wrap { scroll-snap-type: none; }
  .hero .wordmark, .hero__headline, .hero__sub { opacity: 1; transform: none; }
  .hero__headline {
    -webkit-text-fill-color: var(--color-text);
    background: none;
  }
  .reveal { opacity: 1; transform: none; }
}
