/* Design tokens — single source of truth for color, type, radius, shadow, spacing.
   Every component file should reference these variables, never hardcode values. */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/inter-var-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
    U+FEFF, U+FFFD;
}

/* Display face for hero numbers/headings — self-hosted, latin subset only. */
@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 400 800;
  font-stretch: 85% 125%;
  font-display: swap;
  src: url('/fonts/archivo-var-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
    U+FEFF, U+FFFD;
}

/* Tabular-figures face for money/metrics — self-hosted, latin subset only. */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/jetbrains-mono-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
    U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/jetbrains-mono-500-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
    U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/jetbrains-mono-700-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
    U+FEFF, U+FFFD;
}

:root {
  /* Colors */
  --blue: #1747ff;
  --blue-light: #5470ff;
  --blue-dark: #0b2fcb;
  --blue-soft: #edf1ff;
  --ink: #0a1330;
  --muted: #5a6684;
  /* Escurecido de #8b96af (2,97:1) p/ ~4,8:1 em branco — passa 4,5:1 do WCAG
     para texto pequeno (usado em captions, hints, rótulos da bottom-nav). */
  --muted-2: #67728d;
  --gray: #f6f8fc;
  --line: #e6eaf2;
  --line-2: #f0f3f8;
  --green: #00a76b;
  --green-bg: #e6f7f0;
  --red: #ff4d3d;
  --red-bg: #ffeeec;
  --orange: #f5a524;
  --orange-bg: #fef5e7;
  --white: #ffffff;

  --gradient-blue: linear-gradient(150deg, var(--blue-light), var(--blue) 45%, var(--blue-dark));

  /* Radii */
  --radius-card: 16px;
  --radius-frame: 24px;
  --radius-btn: 13px;
  --radius-chip: 7px;
  --radius-icon: 9px;
  --radius-avatar: 9px;

  /* Shadows */
  --shadow-card: 0 1px 2px rgba(17, 17, 17, 0.03), 0 10px 26px -18px rgba(17, 17, 17, 0.16);
  --shadow-btn-blue: 0 10px 22px -8px rgba(37, 99, 255, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.28);

  /* Spacing (4px grid) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;

  /* Motion */
  --transition-fast: 160ms ease;

  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  font-variant-numeric: tabular-nums;
}

html,
body {
  /* clip (não "hidden") esconde o overflow horizontal SEM transformar o
     elemento num container de rolagem — com "hidden" no body, em algumas
     situações o scroll vertical da página inteira travava. */
  overflow-x: clip;
  /* Trava o "quicar" (rubber-band/bounce) ao arrastar além do topo/fim da
     página no iOS/Android — sem isso, dá a sensação de que "o site vai
     indo" mesmo depois do conteúdo acabar. */
  overscroll-behavior-y: contain;
}

body {
  margin: 0;
  background: var(--gray);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Display/mono faces — used sparingly for hero numbers and metric figures. */
.text-display {
  font-family: 'Archivo', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-variation-settings: 'wdth' 108;
  letter-spacing: -0.025em;
  font-weight: 700;
}

.text-mono {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-variant-numeric: tabular-nums;
}

/* Typography scale */
.text-page-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--ink);
}

.text-value-lg {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -1px;
  color: var(--ink);
}

.text-timer {
  font-size: 38px;
  font-weight: 700;
  letter-spacing: -1.6px;
  color: var(--ink);
}

.text-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.text-body {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
}

.text-label {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
}

.text-caption {
  font-size: 12px;
  color: var(--muted-2);
}

/* Shared surfaces */
.surface-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}

.icon-container {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-icon);
  background: var(--blue-soft);
  color: var(--blue);
}

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-avatar);
  font-weight: 600;
  color: var(--white);
  background: var(--gradient-blue);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--radius-chip);
  font-size: 11px;
  font-weight: 600;
}

.chip[hidden] {
  display: none;
}

.chip-green {
  background: var(--green-bg);
  color: var(--green);
}

.chip-red {
  background: var(--red-bg);
  color: var(--red);
}

.chip-orange {
  background: var(--orange-bg);
  color: var(--orange);
}

.chip-blue {
  background: var(--blue-soft);
  color: var(--blue);
}

.chip-gray {
  background: var(--gray);
  color: var(--muted);
}

/* Empty states */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-6) var(--space-4);
  text-align: center;
  color: var(--muted);
}

/* Focus visibility */
:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
