/* ============================================================
   CEBYKO Mobile — Base styles
   Resets + root layout. Mobile-first, dark-first.
   ============================================================ */

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

html {
  background: var(--color-bg);
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  background:
    radial-gradient(900px 500px at 20% -10%, #11162580, transparent 60%),
    radial-gradient(700px 400px at 110% 20%, #1a1b3a55, transparent 60%),
    var(--color-bg);
  color: var(--color-text-1);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh-base);
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior-y: contain;
  text-rendering: optimizeLegibility;
}

img, svg, video, canvas { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; background: none; border: none; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: var(--fw-semi);
  letter-spacing: var(--ls-tight);
  line-height: var(--lh-tight);
}

.app {
  display: grid;
  grid-template-rows: 1fr var(--bottom-nav-h);
  min-height: 100dvh;
  padding-top: var(--safe-top);
}

.app__main {
  overflow-y: auto;
  overflow-x: hidden;
  padding:
    var(--sp-3)
    calc(var(--sp-4) + var(--safe-right))
    calc(var(--bottom-nav-h) + var(--sp-4) + var(--safe-bottom))
    calc(var(--sp-4) + var(--safe-left));
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

.view { display: none; }
.view.is-active { display: block; }

/* Sticky top bar (per view) */
.topbar {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-2) 0 var(--sp-3);
  background: linear-gradient(to bottom, var(--color-bg) 70%, transparent);
}
.topbar h1 { font-size: var(--fs-xl); }
.topbar__actions { display: flex; gap: var(--sp-3); color: var(--color-text-2); }
.topbar__actions button {
  width: var(--tap-min); height: var(--tap-min);
  display: grid; place-items: center;
  border-radius: var(--r-pill);
  font-size: var(--fs-md);
}
.topbar__actions button:hover { background: var(--color-surface-1); }

/* Utility */
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.pos { color: var(--color-green); }
.neg { color: var(--color-red); }
.warn { color: var(--color-gold); }
.muted { color: var(--color-text-2); }
.faded { color: var(--color-text-3); }

/* Skip link — WCAG 2.4.1 */
.skip-link {
  position: absolute;
  top: var(--safe-top);
  left: 50%;
  transform: translate(-50%, -110%);
  z-index: calc(var(--z-toast) + 1);
  padding: var(--sp-2) var(--sp-4);
  background: var(--color-blue);
  color: var(--color-bg);
  border-radius: var(--r-pill);
  font-weight: var(--fw-semi);
  font-size: var(--fs-sm);
  white-space: nowrap;
  transition: transform var(--dur-2) var(--ease-out);
  text-decoration: none;
}
.skip-link:focus-visible { transform: translate(-50%, 0); }

/* Focus ring */
:focus-visible {
  outline: 2px solid var(--color-blue);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}
