/* NOVA AI · base.css
   Reset, element defaults, focus styles and small utilities. No components here. */

*,
*::before,
*::after { box-sizing: border-box; }

* {
  margin: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

html {
  height: 100%;
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overscroll-behavior: none; /* stops pull-to-refresh from reloading the app mid-chat */
}

body {
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: var(--fs-base);
  line-height: 1.5;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

a { color: inherit; text-decoration: none; }

ul,
ol { padding: 0; list-style: none; }

/* The reset above removes margin everywhere, but modal dialogs rely on margin:auto to sit in the centre */
dialog { margin: auto; }

h1, h2, h3, h4, h5, h6 { font-size: inherit; font-weight: inherit; }

button,
input,
textarea,
select { font: inherit; color: inherit; }

button {
  padding: 0;
  background: none;
  border: 0;
  cursor: pointer;
  touch-action: manipulation; /* removes the 300ms tap delay and double-tap zoom */
}

button:disabled { cursor: default; }

textarea { resize: none; }

fieldset { border: 0; padding: 0; min-width: 0; }
legend { padding: 0; }

[hidden] { display: none !important; }

::selection { background: var(--spark-soft); }

/* Keyboard focus: always visible, never shown for mouse or touch */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

/* Icons: one rule for the whole sprite */
.icon {
  width: 1.25rem;
  height: 1.25rem;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* The NOVA mark: a ring with one spark sitting on it */
.mark-ring { fill: none; stroke: currentColor; stroke-width: 3.2; }
.mark-spark { fill: var(--spark); }

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

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--on-ink);
  border-radius: var(--r-md);
  font-weight: 600;
  transform: translateY(-200%);
}
.skip-link:focus-visible { transform: none; }

.noscript {
  padding: 16px;
  text-align: center;
  background: var(--danger-soft);
  color: var(--danger);
}

/* Respect "reduce motion": no movement, no looping animation */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
    scroll-behavior: auto !important;
  }
}
