/* ===================================================================
   AZIN's Universe — Core stylesheet (tokens, base, chrome, hero)
   Section styles live in sections.css, solar observatory in solar.css
   =================================================================== */
:root {
  --color-bg: #04030d;
  --color-bg-2: #0a0820;
  --color-text: #f3f1ff;
  --color-text-muted: #a29ec8;
  --color-primary: #8b74ff;
  --color-secondary: #ff7ab8;
  --color-accent: #5ce1ff;
  --color-gold: #ffd66b;
  --color-gradient-1: linear-gradient(120deg, #8b74ff 0%, #ff7ab8 50%, #5ce1ff 100%);
  --glass-bg: rgba(16, 13, 40, 0.68);
  --glass-border: rgba(160, 140, 255, 0.2);
  --glass-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
  --radius-xl: 32px;
  --radius: 22px;
  --radius-sm: 14px;
  --transition: 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --font-display: 'Unbounded', 'Syne', sans-serif;
  --font-kr: 'Noto Sans KR', system-ui, sans-serif;
  --font-main: 'Noto Sans KR', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  --pad: clamp(20px, 4vw, 60px);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
body {
  font-family: var(--font-main);
  background: var(--color-bg);
  color: var(--color-text);
  overflow-x: hidden;
  line-height: 1.6;
  word-break: keep-all;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}
body.is-loading { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; touch-action: manipulation; }
img, canvas { display: block; }
::selection { background: var(--color-primary); color: #fff; }
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 4px; border-radius: 6px; }
.gradient-text { background: var(--color-gradient-1); -webkit-background-clip: text; background-clip: text; color: transparent; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Split-text helpers */
.split-line { display: block; overflow: hidden; padding-bottom: 0.08em; }
.split-word { display: inline-block; white-space: nowrap; }
.split-char { display: inline-block; will-change: transform; }

/* ---------- Ambient layers ---------- */
.grain {
  position: fixed; inset: -50%; z-index: 9000; pointer-events: none; opacity: 0.06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1.2s steps(6) infinite;
}
@keyframes grain { 0%,100% { transform: translate(0,0); } 20% { transform: translate(-3%,2%); } 40% { transform: translate(2%,-4%); } 60% { transform: translate(-4%,-1%); } 80% { transform: translate(3%,3%); } }

.bg-stars { position: fixed; inset: 0; z-index: -1; pointer-events: none; }
.bg-glow {
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(60vw 50vh at 15% 20%, rgba(139,116,255,0.10), transparent 70%),
    radial-gradient(50vw 50vh at 85% 75%, rgba(92,225,255,0.07), transparent 70%),
    var(--color-bg);
}

/* ---------- Custom cursor (Half-size yellow label ring) ---------- */
.cursor, .cursor-ring { position: fixed; top: 0; left: 0; pointer-events: none; z-index: 9999; border-radius: 50%; transform: translate(-50%, -50%); }
.cursor { width: 7px; height: 7px; background: #fff; mix-blend-mode: difference; }
.cursor-ring {
  width: 32px; height: 32px; border: 1px solid rgba(255,255,255,0.45);
  display: grid; place-items: center;
  transition: width .35s var(--ease-out), height .35s var(--ease-out), background-color .25s, border-color .25s;
}
.cursor-ring span { font: 700 8.5px/1 var(--font-mono); letter-spacing: .08em; opacity: 0; transition: opacity .2s; color: #0b0920; }
.cursor-ring.is-hover { width: 46px; height: 46px; background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.9); }
.cursor-ring.is-label { width: 44px; height: 44px; background: var(--color-gold); border-color: transparent; box-shadow: 0 0 14px rgba(255,214,107,0.45); }
.cursor-ring.is-label span { opacity: 1; }
@media (hover: none), (pointer: coarse) { .cursor, .cursor-ring { display: none; } }
@media (hover: hover) and (pointer: fine) { body.has-cursor, body.has-cursor a, body.has-cursor button { cursor: none; } }

/* ---------- Preloader ---------- */
.preloader {
  position: fixed; inset: 0; z-index: 10000; background: #030209;
  display: grid; place-items: center; overflow: hidden;
}
.preloader-orbit { position: relative; width: 140px; height: 140px; }
.preloader-orbit::before { content: ''; position: absolute; inset: 0; border: 1px dashed rgba(255,255,255,0.18); border-radius: 50%; }
.preloader-sun { position: absolute; inset: 50px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff4c2, #ffb347 55%, #ff6a3d); box-shadow: 0 0 40px rgba(255,170,70,0.7); }
.preloader-planet { position: absolute; top: -7px; left: 63px; width: 14px; height: 14px; border-radius: 50%; background: var(--color-accent); box-shadow: 0 0 14px var(--color-accent); transform-origin: 7px 77px; animation: orbit 1.6s linear infinite; }
@keyframes orbit { to { transform: rotate(360deg); } }
.preloader-count { position: absolute; bottom: var(--pad); right: var(--pad); font: 800 clamp(64px, 14vw, 200px)/0.8 var(--font-display); letter-spacing: -0.04em; color: transparent; -webkit-text-stroke: 1px rgba(255,255,255,0.6); }
.preloader-label { position: absolute; bottom: var(--pad); left: var(--pad); font: 500 12px/1.6 var(--font-mono); letter-spacing: .2em; color: var(--color-text-muted); text-transform: uppercase; }
.preloader-curtain { position: absolute; inset: 0; background: var(--color-primary); transform: scaleY(0); transform-origin: bottom; }

/* ---------- Scroll progress ---------- */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 1001; transform-origin: left; transform: scaleX(0); background: var(--color-gradient-1); }

/* ---------- Navigation ---------- */
.nav { position: fixed; top: 0; left: 0; right: 0; z-index: 1000; padding: 18px var(--pad); display: flex; align-items: center; justify-content: space-between; transition: transform .5s var(--ease-out), background-color .4s, padding .4s; }
.nav.is-scrolled { background: rgba(6, 5, 18, 0.65); backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4); padding-block: 12px; border-bottom: 1px solid rgba(255,255,255,0.06); }
.nav.is-hidden { transform: translateY(-110%); }
.nav-logo { font: 800 20px/1 var(--font-display); letter-spacing: .08em; display: flex; align-items: center; gap: 10px; }
.nav-logo-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--color-gold); box-shadow: 0 0 12px var(--color-gold); }
.nav-links { display: flex; gap: 6px; list-style: none; padding: 5px; border-radius: 999px; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); }
.nav-links a { display: block; padding: 8px 15px; border-radius: 999px; font: 600 11.5px/1 var(--font-mono); letter-spacing: 0.08em; color: var(--color-text-muted); transition: color .3s, background-color .3s; }
.nav-links a:hover, .nav-links a.active { color: #fff; background: rgba(255,255,255,0.1); }
.nav-toggle { display: none; width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.15); place-items: center; }
.nav-toggle span { display: block; width: 16px; height: 1.5px; background: #fff; box-shadow: 0 5px 0 #fff; transform: translateY(-2.5px); }

/* ---------- Hero (Clean separated layout — no text overlapping photo) ---------- */
.hero {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 680px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 68px var(--pad) 24px;
}
.hero-character-wrapper {
  position: relative;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  min-height: 0;
  padding-block: 6px;
}
#azin-canvas {
  width: auto;
  max-width: min(920px, 88vw);
  height: 100%;
  max-height: 64vh;
  aspect-ratio: 16 / 9;
  display: block;
  object-fit: contain;
  border-radius: 26px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.85), 0 0 60px rgba(139, 116, 255, 0.12);
  cursor: pointer;
  transition: transform 0.25s ease-out;
}
#azin-canvas:hover {
  transform: scale(1.008);
}
.hero-vignette {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(120% 90% at 50% 42%, transparent 55%, rgba(4,3,13,0.85) 100%);
}

.hero-hud { position: absolute; z-index: 3; inset: 0; pointer-events: none; font: 500 10.5px/1.7 var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: rgba(220,215,255,0.5); }
.hud-tl, .hud-tr { position: absolute; top: 82px; }
.hud-tl { left: var(--pad); }
.hud-tr { right: var(--pad); text-align: right; }
.hud-tl b, .hud-tr b { color: #fff; font-weight: 600; }
.hud-side { position: absolute; top: 46%; right: calc(var(--pad) * 0.45); writing-mode: vertical-rl; transform: translateY(-50%); letter-spacing: .36em; opacity: .45; }

.hero-bottom {
  position: relative;
  z-index: 4;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding-top: 10px;
}
.hero-copy-block {
  max-width: 780px;
}
.hero-kicker {
  display: inline-block;
  font: 600 11px/1 var(--font-mono);
  letter-spacing: 0.24em;
  color: var(--color-accent);
  margin-bottom: 8px;
}
.hero-title {
  font: 800 clamp(22px, 2.7vw, 40px)/1.12 var(--font-display);
  letter-spacing: -0.02em;
  text-transform: uppercase;
  white-space: nowrap;
}
.hero-title em {
  font-style: normal;
  background: linear-gradient(120deg, #ffd66b 0%, #ff7ab8 55%, #5ce1ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-sub {
  margin-top: 6px;
  font: 500 14.5px/1.45 var(--font-kr);
  color: var(--color-text-muted);
  word-break: keep-all;
}
.hero-actions { display: flex; gap: 12px; flex-wrap: nowrap; justify-content: flex-end; flex-shrink: 0; }
.hero-hint {
  position: absolute; z-index: 4; left: 50%; bottom: 18px; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  font: 500 9.5px/1 var(--font-mono); letter-spacing: .28em; color: var(--color-text-muted);
}
.hero-hint i { width: 1px; height: 28px; background: linear-gradient(to bottom, transparent, #fff); position: relative; overflow: hidden; }
.hero-hint i::after { content: ''; position: absolute; left: 0; top: -100%; width: 1px; height: 100%; background: var(--color-accent); animation: drip 1.8s var(--ease-out) infinite; }
@keyframes drip { to { top: 100%; } }
.hero-tip {
  position: absolute; z-index: 4; top: 76px; left: 50%; transform: translateX(-50%);
  font: 600 10.5px/1 var(--font-mono); letter-spacing: 0.14em; color: rgba(255,255,255,0.85);
  padding: 7px 14px; border-radius: 999px; background: rgba(10,8,30,0.65);
  border: 1px solid rgba(255,255,255,0.14); backdrop-filter: blur(8px);
  pointer-events: none; opacity: 0; white-space: nowrap;
}

/* ---------- Buttons ---------- */
.btn { position: relative; display: inline-flex; align-items: center; gap: 10px; padding: 14px 24px; border-radius: 999px; font: 700 12.5px/1 var(--font-display); letter-spacing: 0.04em; overflow: hidden; isolation: isolate; white-space: nowrap; transition: color .4s var(--ease-out), border-color .4s; }
.btn::before { content: ''; position: absolute; inset: 0; z-index: -1; border-radius: inherit; transform: translateY(101%); transition: transform .5s var(--ease-out); }
.btn:hover::before { transform: translateY(0); }
.btn-primary { background: #fff; color: #0b0920; }
.btn-primary::before { background: var(--color-gold); }
.btn-ghost { border: 1px solid rgba(255,255,255,0.25); color: #fff; }
.btn-ghost::before { background: #fff; }
.btn-ghost:hover { color: #0b0920; }
.btn .arrow { display: inline-block; transition: transform .4s var(--ease-out); }
.btn:hover .arrow { transform: translateX(4px) rotate(-45deg); }

@media (max-width: 960px) {
  .hero-title { white-space: normal; }
  .hero-hint { display: none; }
}
@media (max-width: 860px) {
  .nav-links { display: none; position: fixed; inset: 0; flex-direction: column; justify-content: center; align-items: center; border-radius: 0; background: rgba(4,3,13,0.96); gap: 18px; }
  .nav-links a { font-size: 22px; }
  .nav.is-open .nav-links { display: flex; }
  .nav-toggle { display: grid; z-index: 2; }
  .hud-tr, .hud-side { display: none; }
  .hero-bottom { flex-direction: column; align-items: flex-start; gap: 14px; }
  .hero-actions { justify-content: flex-start; }
}
