/* ==========================================================================
   BASE / RESET
   ========================================================================== */
*, *::before, *::after{ box-sizing: border-box; }
html, body{ height: 100%; }
html{
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
body{
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh-normal);
  color: var(--text-primary);
  background: var(--bg-canvas);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
  letter-spacing: var(--tracking-normal);
  transition: background var(--dur-base) var(--ease-out), color var(--dur-base) var(--ease-out);
}
h1,h2,h3,h4,h5,h6{ margin: 0; font-family: var(--font-display); font-weight: 600; letter-spacing: var(--tracking-tight); color: var(--text-primary); }
p{ margin: 0; }
ul, ol{ margin: 0; padding: 0; list-style: none; }
a{ color: inherit; text-decoration: none; }
button{ font-family: inherit; color: inherit; }
input, textarea, select, button{ font-family: inherit; font-size: inherit; }
svg{ display: block; flex-shrink: 0; }
img{ max-width: 100%; display: block; }
strong{ font-weight: 600; }

::selection{ background: var(--accent); color: var(--text-on-accent); }

/* ---- Scrollbars ---- */
* { scrollbar-width: thin; scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track); }
*::-webkit-scrollbar{ width: 9px; height: 9px; }
*::-webkit-scrollbar-track{ background: transparent; }
*::-webkit-scrollbar-thumb{ background: var(--scrollbar-thumb); border-radius: var(--radius-full); border: 2px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover{ background: var(--border-strong); background-clip: padding-box; }

/* ---- Focus states (accessibility) ---- */
:focus{ outline: none; }
:focus-visible{
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}
.no-focus-ring:focus-visible{ outline: none; }

/* ---- Selection helpers ---- */
.sr-only{
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ---- Root app shell ---- */
#app{
  height: 100vh;
  width: 100%;
  display: flex;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(1200px 600px at 15% -10%, hsl(var(--hue-violet) / 0.10), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, hsl(var(--hue-ember) / 0.06), transparent 55%),
    var(--bg-canvas);
}

/* Prefer the dynamic viewport unit: with plain 100vh, mobile browser chrome
   hides the bottom of the shell and forces the page to be scrolled. */
@supports (height: 100dvh){ #app{ height: 100dvh; } }

/* ---- Typography utility classes ---- */
.text-2xs{ font-size: var(--fs-2xs); }
.text-xs{ font-size: var(--fs-xs); }
.text-sm{ font-size: var(--fs-sm); }
.text-base{ font-size: var(--fs-base); }
.text-md{ font-size: var(--fs-md); }
.text-lg{ font-size: var(--fs-lg); }
.text-xl{ font-size: var(--fs-xl); }
.text-secondary{ color: var(--text-secondary); }
.text-tertiary{ color: var(--text-tertiary); }
.font-mono{ font-family: var(--font-mono); }
.font-display{ font-family: var(--font-display); }
.truncate{ overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
