/* ==========================================================================
   Konjo landing — base layer: tokens, type, nav, buttons, hero, phone,
   marquee, grain. Section layouts live in sections.css.
   Design language mirrors the app's 2026-06 refresh: Cuong Nhu red on
   near-black, -2° diagonal bands, 900-weight uppercase display, hard offset
   shadows instead of soft glow.
   ========================================================================== */

@font-face {
  font-family: 'Anton';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/site-fonts/anton-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('/site-fonts/space-grotesk-latin.woff2') format('woff2');
}

:root {
  --ink: #0E0E10;
  --ink-2: #16161A;
  --ink-3: #1E1E23;
  --paper: #FBFAF7;
  --white: #FFFFFF;
  --red: #D62828;
  --red-bright: #FF5252;
  --red-dark: #AD1F1F;
  --yellow: #FFD60A;
  --steel: #ECECEC;
  --t-on-dark: #F2F2F2;
  --t2-on-dark: #A8A8AE;
  --t-on-light: #1F1F1F;
  --t2-on-light: #6B6B6B;
  --line-dark: rgba(255, 255, 255, 0.14);
  --line-light: rgba(17, 17, 17, 0.14);

  --font-display: 'Anton', 'Arial Narrow', 'Helvetica Neue', sans-serif;
  --font-body: 'Space Grotesk', -apple-system, system-ui, sans-serif;

  --skew: -2deg;
  --pad: clamp(20px, 5vw, 72px);
  --section-gap: clamp(96px, 14vh, 170px);

  --text-hero: clamp(4.2rem, 13.5vw, 12.5rem);
  --text-h2: clamp(2.6rem, 6.4vw, 5.6rem);
  --text-h3: clamp(1.25rem, 1.05rem + 0.8vw, 1.7rem);
  --text-body: clamp(1rem, 0.95rem + 0.3vw, 1.125rem);

  --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --dur: 280ms;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  color-scheme: dark;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  background: var(--ink);
  color: var(--t-on-dark);
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: 1.6;
  overflow-x: clip;
}

::selection { background: var(--red); color: var(--white); }

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}

.skip-link {
  position: fixed; top: -100%; left: 16px; z-index: 200;
  padding: 10px 16px; background: var(--yellow); color: #111;
  font-weight: 700; text-decoration: none; transition: top 150ms;
}
.skip-link:focus-visible { top: 12px; }

/* Display type */
h1, h2, .display {
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  line-height: 0.92;
  letter-spacing: 0.01em;
}
h2 { font-size: var(--text-h2); }

.eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  margin-bottom: 1.1rem;
}
.eyebrow-red { color: var(--red); }
.eyebrow-yellow { color: var(--yellow); }
.hl-red { color: var(--red-bright); }

/* ============================== Buttons ============================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.7em;
  padding: 0.95em 1.5em;
  border: 0;
  text-decoration: none;
  cursor: pointer;
  transform: skew(var(--skew));
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--white);
  transition: background var(--dur), color var(--dur), translate var(--dur) var(--ease-expo), box-shadow var(--dur) var(--ease-expo);
}
.btn-big { font-size: clamp(1.05rem, 1.6vw, 1.3rem); padding: 1em 1.6em; }
.btn .btn-arrow {
  font-style: normal;
  transition: transform var(--dur) var(--ease-expo);
}
.btn:hover .btn-arrow, .btn:focus-visible .btn-arrow { transform: translateX(0.3em); }
.btn:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }
.btn:active { translate: 0 2px; }

.btn-red {
  background: var(--red);
  box-shadow: 0 0 0 0 rgba(255, 214, 10, 0);
}
.btn-red:hover, .btn-red:focus-visible {
  background: var(--red-dark);
  box-shadow: 8px 8px 0 0 rgba(255, 214, 10, 0.92);
  translate: -2px -2px;
}
.btn-ghost {
  background: transparent;
  box-shadow: inset 0 0 0 2px var(--line-dark);
  color: var(--t-on-dark);
}
.btn-ghost:hover, .btn-ghost:focus-visible {
  box-shadow: inset 0 0 0 2px var(--t-on-dark);
  background: rgba(255, 255, 255, 0.06);
}
.btn-ink {
  background: #131313;
  color: var(--white);
}
.btn-ink:hover, .btn-ink:focus-visible {
  background: var(--red);
  box-shadow: 8px 8px 0 0 #131313;
  translate: -2px -2px;
}
.btn-yellow {
  background: var(--yellow);
  color: #131313;
}
.btn-yellow:hover, .btn-yellow:focus-visible {
  background: #FFE04D;
  box-shadow: 8px 8px 0 0 #131313;
  translate: -2px -2px;
}

/* ================================ Nav ================================ */
.site-nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 14px var(--pad);
  transition: background var(--dur), border-color var(--dur), padding var(--dur);
  border-bottom: 1px solid transparent;
}
.site-nav.is-solid {
  background: rgba(14, 14, 16, 0.92);
  border-bottom-color: var(--line-dark);
  padding-block: 10px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
}
.brand img { width: 34px; height: 34px; border-radius: 8px; }
.brand-word {
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: 0.04em;
}
.nav-links {
  display: flex;
  gap: 1.8rem;
  margin-left: auto;
  font-size: 0.92rem;
  font-weight: 500;
}
.nav-links a {
  text-decoration: none;
  color: var(--t2-on-dark);
  transition: color var(--dur);
  position: relative;
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; right: 100%; bottom: -5px;
  height: 2px;
  background: var(--red-bright);
  transition: right var(--dur) var(--ease-expo);
}
.nav-links a:hover, .nav-links a:focus-visible { color: var(--white); }
.nav-links a:hover::after, .nav-links a:focus-visible::after { right: 0; }
.btn-nav { font-size: 0.85rem; padding: 0.7em 1.2em; }

/* =============================== Canvas =============================== */
#gl {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100vh;
  height: 100svh;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  transition: opacity 700ms ease;
}
body.gl-on #gl { opacity: 1; }
body.gl-off #gl { display: none; }

.grain {
  position: fixed;
  inset: -50%;
  z-index: 90;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)' opacity='0.6'/%3E%3C/svg%3E");
}

/* ============================ Phone frame ============================= */
.phone {
  position: relative;
  width: min(300px, 72vw);
  aspect-ratio: 390 / 780;
  border-radius: clamp(30px, 4.5vw, 44px);
  background: #18181B;
  padding: 10px;
  box-shadow:
    inset 0 0 0 2px #2E2E33,
    16px 18px 0 0 rgba(214, 40, 40, 0.92);
}
.phone-screen {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: clamp(22px, 3.4vw, 34px);
  overflow: hidden;
  background: #fff;
}
.phone-screen img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}
.phone-island {
  position: absolute;
  top: 22px;
  left: 50%;
  transform: translateX(-50%);
  width: 28%;
  height: 13px;
  border-radius: 999px;
  background: #0A0A0C;
  z-index: 2;
}

/* ================================ Hero ================================ */
.hero {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  align-content: center;
  padding: clamp(110px, 16vh, 170px) var(--pad) clamp(120px, 16vh, 180px);
  overflow: clip;
}
.hero-inner {
  position: relative;
  z-index: 3;
  max-width: 880px;
}
.hero-eyebrow {
  color: var(--t2-on-dark);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  margin-bottom: 1.6rem;
}
.kanji-inline { color: var(--red-bright); letter-spacing: 0.1em; margin-right: 0.5em; }
.hero-title {
  font-size: var(--text-hero);
  line-height: 0.88;
}
.hero-line { display: block; overflow: hidden; padding-block: 0.02em; }
.hero-line-inner { display: inline-block; will-change: transform; }
.hl-band {
  position: relative;
  color: var(--white);
  padding: 0 0.12em;
  background: var(--red);
  transform: skew(var(--skew));
  box-shadow: 10px 10px 0 0 rgba(255, 214, 10, 0.9);
}
.hero-lede {
  max-width: 540px;
  margin-top: 2rem;
  color: var(--t2-on-dark);
  font-size: clamp(1.05rem, 1.4vw, 1.25rem);
}
.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2.4rem;
}
.hero-meta {
  margin-top: 1.4rem;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--t2-on-dark);
  opacity: 0.75;
}
.hero-kanji {
  position: absolute;
  top: 50%;
  right: max(8px, 1.5vw);
  translate: 0 -50%;
  z-index: 1;
  writing-mode: vertical-rl;
  font-family: var(--font-display);
  font-size: clamp(7rem, 22vh, 15rem);
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(255, 255, 255, 0.14);
  user-select: none;
}
.hero-phone-fallback {
  position: absolute;
  right: clamp(24px, 9vw, 150px);
  top: 50%;
  translate: 0 -46%;
  rotate: 6deg;
  z-index: 2;
}
/* When WebGL scene is live, the 3D phone replaces the DOM one. */
body.gl-on .hero-phone-fallback { visibility: hidden !important; opacity: 0 !important; }

.scroll-cue {
  position: absolute;
  left: var(--pad);
  bottom: 26px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.68rem;
  letter-spacing: 0.3em;
  color: var(--t2-on-dark);
}
.scroll-cue i {
  width: 54px;
  height: 2px;
  background: var(--red);
  transform-origin: left center;
}
body.js-anim .scroll-cue i { animation: cue 1.8s var(--ease-expo) infinite; }
@keyframes cue {
  0% { transform: scaleX(0); }
  55% { transform: scaleX(1); }
  100% { transform: scaleX(0); transform-origin: right center; }
}

/* ============================== Marquee =============================== */
.marquee-band {
  position: relative;
  z-index: 3;
  background: var(--red);
  transform: skewY(var(--skew));
  margin-block: -28px 0;
  overflow: clip;
  border-block: 3px solid #131313;
}
.marquee-track {
  display: flex;
  align-items: center;
  gap: 2.6rem;
  width: max-content;
  padding: 16px 0;
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 2.6vw, 2rem);
  letter-spacing: 0.08em;
  color: var(--white);
  white-space: nowrap;
}
.marquee-track b { color: var(--yellow); font-size: 0.7em; }
/* CSS fallback animation; GSAP takes over when active. */
body.js-anim .marquee-track { animation: marquee 26s linear infinite; }
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* Generic reveal initial states — applied only when JS + motion are on,
   so content is never hidden for no-JS / reduced-motion visitors. */
body.js-anim [data-reveal] {
  opacity: 0;
  transform: translateY(34px);
}
body.js-anim .word { 
  display: inline-block;
  opacity: 0;
  transform: translateY(0.55em) rotate(2deg);
}
