/* =========================================================================
   DIARIO — styles.css
   Ordine: 1 token · 2 base · 3 accessibilità · 4 layout · 5 componenti
           · 6 movimento ridotto
   z-index usati: 80 = barra in basso · 200 = skip link
   ========================================================================= */

/* ---- 1) Token ---- */
:root {
  --bg: #000000;
  --text: #F2F2F2;
  --muted: #9A9A9A;
  --line: #2A2A2A;
  --accent: #FFB020;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
  --space: 16px;
  --tap: 48px;
  --tabbar-h: 64px;
  --maxw: 640px;
}

/* ---- 2) Base ---- */
*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.5;
  min-height: 100vh;
  min-height: 100dvh;
  padding-top: env(safe-area-inset-top);
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
}

[hidden] { display: none !important; }

h1 { font-size: 28px; line-height: 1.2; margin: 0 0 var(--space); }
p  { margin: 0 0 var(--space); }

/* ---- 3) Accessibilità ---- */
.skip-link {
  position: absolute;
  left: var(--space);
  top: -100px;
  z-index: 200;
  background: var(--accent);
  color: var(--bg);
  padding: 12px 16px;
  border-radius: 8px;
}
.skip-link:focus { top: var(--space); }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
[tabindex="-1"]:focus { outline: none; }

/* ---- 4) Layout ---- */
.screen {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: var(--space);
  padding-left: max(var(--space), env(safe-area-inset-left));
  padding-right: max(var(--space), env(safe-area-inset-right));
}

/* ---- 5) Componenti ---- */
.logo { display: block; color: var(--accent); margin-bottom: var(--space); }
.logo .pencil { fill: var(--bg); }

.muted { color: var(--muted); }
.big { font-size: 24px; font-weight: 600; text-transform: capitalize; }

.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 80;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--bg);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}
.tab {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tabbar-h);
  color: var(--muted);
  text-decoration: none;
  font-size: 16px;
}
.tab[aria-current="page"] { color: var(--accent); font-weight: 600; }

/* ---- 6) Movimento ridotto ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}