/* ═══════════════════════════════════════
   style.css — HeyLakira Intro / Loading Screen
═══════════════════════════════════════ */

/* ─────────────────────────────────────
   THEME TOKENS
───────────────────────────────────── */
:root[data-theme="dark"] {
  --bg:      #0c0c0c;
  --surface: #141414;
  --border:  #242424;
  --text:    #f0f0f0;
  --muted:   #6a6a6a;
  --dim:     #333;
  --accent:  #f0f0f0;
  --on-acc:  #0c0c0c;
  --barbg:   rgba(240,240,240,.08);
  --log:     #4a4a4a;
  --done-c:  #888;
}
:root[data-theme="light"] {
  --bg:      #f6f6f6;
  --surface: #ffffff;
  --border:  #e2e2e2;
  --text:    #141414;
  --muted:   #888;
  --dim:     #ccc;
  --accent:  #141414;
  --on-acc:  #ffffff;
  --barbg:   rgba(20,20,20,.07);
  --log:     #b0b0b0;
  --done-c:  #666;
}

/* ─────────────────────────────────────
   RESET
───────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0 }
html { -webkit-text-size-adjust: 100%; height: 100% }
body {
  font-family: 'Poppins', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  height: 100%;
  overflow: hidden;
  transition: background .3s, color .3s;
  -webkit-font-smoothing: antialiased;
}

/* ─────────────────────────────────────
   SCENE
───────────────────────────────────── */
#scene {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding:
    max(64px, env(safe-area-inset-top, 64px))
    clamp(20px, 5vw, 52px)
    max(24px, env(safe-area-inset-bottom, 24px))
    clamp(20px, 5vw, 52px);
  overflow: hidden;
}

/* ─────────────────────────────────────
   STARS CANVAS
───────────────────────────────────── */
#cv {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ─────────────────────────────────────
   THEME BUTTON
   dark  → show moon (🌙)
   light → show sun  (☀️)
───────────────────────────────────── */
.nav-icon-btn {
  position: fixed;
  top: max(12px, env(safe-area-inset-top, 12px));
  right: clamp(16px, 5vw, 52px);
  z-index: 400;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  transition: .2s;
  -webkit-tap-highlight-color: transparent;
}
.nav-icon-btn:hover {
  background: var(--surface);
  color: var(--text);
  border-color: var(--muted);
  transform: rotate(20deg);
}
.nav-icon-btn svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

/* FIX: dark mode shows moon, light mode shows sun */
[data-theme="dark"]  .i-sun  { display: none  }
[data-theme="dark"]  .i-moon { display: block }
[data-theme="light"] .i-sun  { display: block }
[data-theme="light"] .i-moon { display: none  }

/* ─────────────────────────────────────
   CARD
───────────────────────────────────── */
#card {
  position: relative;
  z-index: 10;
  width: min(520px, calc(100vw - 48px));
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* ─────────────────────────────────────
   BRAND
───────────────────────────────────── */
.brand-wrap {
  margin-bottom: clamp(28px, 5vh, 52px);
  opacity: 0;
  transform: translateY(12px);
  animation: up .9s cubic-bezier(.16,1,.3,1) .15s forwards;
}
.brand-name {
  font-size: clamp(44px, 6.5vw, 62px);
  font-weight: 800;
  line-height: .93;
  letter-spacing: -.035em;
  color: var(--text);
}

/* ─────────────────────────────────────
   STATUS ROW
───────────────────────────────────── */
.s-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-bottom: clamp(8px, 1.5vh, 13px);
  opacity: 0;
  animation: up .7s ease .65s forwards;
}
.s-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  animation: blink 1.5s ease-in-out infinite;
}
@keyframes blink { 0%, 100% { opacity: .2 } 50% { opacity: 1 } }
.s-txt {
  font-size: clamp(9px, 1.4vw, 11px);
  font-weight: 500;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ─────────────────────────────────────
   MAIN PROGRESS BAR
───────────────────────────────────── */
.bar-outer {
  width: 100%;
  height: 1px;
  background: var(--barbg);
  margin-bottom: clamp(18px, 3.2vh, 30px);
  overflow: hidden;
  opacity: 0;
  animation: up .7s ease .75s forwards;
}
#mainFill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width .35s ease;
}

/* ─────────────────────────────────────
   MODULE LIST
───────────────────────────────────── */
#modList {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 1.6vh, 16px);
  margin-bottom: clamp(18px, 3vh, 28px);
  opacity: 0;
  animation: up .7s ease .85s forwards;
}
.mrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
}
.mleft  { display: flex; align-items: center; gap: 9px; flex: 1; min-width: 0 }
.mico   { width: 14px; height: 14px; flex-shrink: 0; display: flex; align-items: center; justify-content: center }
.mico svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.mname {
  font-size: clamp(10px, 1.4vw, 12px);
  font-weight: 500;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mright { display: flex; align-items: center; gap: 9px; flex-shrink: 0 }
.mbar {
  width: clamp(56px, 8vw, 96px);
  height: 1px;
  background: var(--barbg);
  overflow: hidden;
}
.mfill { height: 100%; width: 0%; background: var(--accent); transition: width .4s ease }
.mstat {
  font-size: clamp(9px, 1.2vw, 10.5px);
  font-weight: 400;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--dim);
  min-width: clamp(40px, 6vw, 52px);
  text-align: right;
  transition: color .4s;
}
.mstat.ok { color: var(--done-c) }

/* ─────────────────────────────────────
   LOG LINE
───────────────────────────────────── */
#logLine {
  width: 100%;
  font-size: clamp(9px, 1.2vw, 10.5px);
  font-weight: 300;
  letter-spacing: .09em;
  color: var(--log);
  line-height: 1.8;
  min-height: clamp(16px, 2.5vh, 22px);
  margin-bottom: clamp(14px, 2.5vh, 22px);
  opacity: 0;
  animation: up .6s ease .9s forwards;
}

/* ─────────────────────────────────────
   RULE
───────────────────────────────────── */
.rule {
  width: 100%;
  height: 1px;
  background: var(--border);
  margin-bottom: clamp(14px, 2.5vh, 22px);
  opacity: 0;
  animation: up .5s ease .95s forwards;
}

/* ─────────────────────────────────────
   PERCENT
───────────────────────────────────── */
#pctRow {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 3px;
  opacity: 0;
  animation: up .6s ease 1s forwards;
}
#pctNum {
  font-size: clamp(42px, 5.5vw, 58px);
  font-weight: 800;
  letter-spacing: -.04em;
  line-height: 1;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.pct-sym {
  font-size: clamp(16px, 2.2vw, 24px);
  font-weight: 300;
  color: var(--muted);
  letter-spacing: 0;
}

/* ─────────────────────────────────────
   KEYFRAMES
───────────────────────────────────── */
@keyframes up {
  from { opacity: 0; transform: translateY(12px) }
  to   { opacity: 1; transform: translateY(0) }
}

/* ─────────────────────────────────────
   COVER (page transition overlay)
───────────────────────────────────── */
#cover {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: var(--bg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 1.1s ease;
}
#cover.on { opacity: 1; pointer-events: all }

/* ─────────────────────────────────────
   RESPONSIVE
───────────────────────────────────── */
@media (max-width: 360px) {
  #card       { width: calc(100vw - 32px) }
  .brand-name { font-size: 38px }
  #pctNum     { font-size: 36px }
  .mbar       { width: 40px }
  .mstat      { min-width: 36px }
}

@media (max-height: 500px) {
  .brand-wrap { margin-bottom: 10px }
  #modList    { gap: 5px; margin-bottom: 10px }
  #logLine    { min-height: 14px; margin-bottom: 8px }
  .rule       { margin-bottom: 8px }
  #scene      { justify-content: flex-start; padding-top: max(54px, 9vh) }
  .brand-name { font-size: clamp(28px, 4.5vh, 40px) }
  #pctNum     { font-size: clamp(28px, 5vh, 40px) }
}
