/* home/screens.css — "Today" tab (the post-onboarding home base).
   Executes the locked redesign spec. Builds on health/screens.css for the
   --io-* token vocabulary and shared primitives (.pill, RingChart, etc.).   */

@import url("../health/screens.css");

/* ───────────────────────────────────────────────────────────────
   New token — the Today greeting gradient. Distinct from the bedtime
   gradient: cooler, deeper midnight. Spec: #0F0C29 → #302B63.
   Earned-midnight rule: this appears ONLY on the Today hero.
   ─────────────────────────────────────────────────────────────── */
.io {
  --io-grad-greeting:
    radial-gradient(120% 75% at 82% -8%, rgba(94,92,230,.45), transparent 58%),
    radial-gradient(90% 70% at 6% 108%, rgba(120,90,210,.34), transparent 60%),
    linear-gradient(157deg, #0F0C29 0%, #241F4E 52%, #302B63 100%);
}
.io[data-theme="dark"] {
  --io-grad-greeting:
    radial-gradient(120% 75% at 82% -8%, rgba(94,92,230,.5), transparent 58%),
    radial-gradient(90% 70% at 6% 108%, rgba(120,90,210,.4), transparent 60%),
    linear-gradient(157deg, #08061A 0%, #1A1640 52%, #241F52 100%);
}

/* ── Hero — fills the first viewport, full-bleed under the status bar ── */
.io .today-hero {
  position: relative; overflow: hidden;
  background: var(--io-grad-greeting);
  color: #fff;
  min-height: 498px;
  padding: 84px 22px 30px;
  display: flex; flex-direction: column;
  /* extend the gradient slightly past the rounded frame corners */
  margin-top: -1px;
}
.io .today-hero::after {
  content:""; position:absolute; inset:0; pointer-events:none; opacity:.55;
  background:
    radial-gradient(1.1px 1.1px at 9% 16%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 20% 58%, rgba(255,255,255,.7) 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 36% 24%, rgba(255,255,255,.6) 50%, transparent 51%),
    radial-gradient(1px 1px at 52% 12%, rgba(255,255,255,.5) 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 72% 20%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 86% 40%, rgba(255,255,255,.6) 50%, transparent 51%),
    radial-gradient(1px 1px at 30% 40%, rgba(255,255,255,.4) 50%, transparent 51%),
    radial-gradient(1.1px 1.1px at 64% 52%, rgba(255,255,255,.45) 50%, transparent 51%);
}
.io .today-hero > * { position: relative; z-index: 1; }

/* Top status line inside the hero — date + glass actions */
.io .today-hero .hero-top {
  display: flex; align-items: center; justify-content: space-between;
}
.io .today-hero .hero-date {
  font-size: 11px; font-weight: 600; letter-spacing: 0.8px;
  text-transform: uppercase; color: rgba(255,255,255,.55);
  font-variant-numeric: tabular-nums;
}
.io .today-hero .hero-actions { display: flex; gap: 8px; }
.io .today-hero .glass-btn {
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center; color: #fff;
  background: rgba(255,255,255,.12);
  border: 0.5px solid rgba(255,255,255,.18);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.io .today-hero .glass-btn.avatar {
  background: rgba(255,255,255,.16); font-size: 15px; font-weight: 600;
}

/* Eyebrow greeting */
.io .today-hero .hero-eyebrow {
  font-size: 11px; font-weight: 600; letter-spacing: 0.9px;
  text-transform: uppercase; color: rgba(255,255,255,.66);
  margin-top: 30px;
}

/* One narrative sentence */
.io .today-hero .hero-narrative {
  font-size: 21px; font-weight: 600; letter-spacing: -0.4px;
  line-height: 1.32; color: #fff; margin-top: 12px;
  max-width: 18em; text-wrap: balance;
}
.io .today-hero .hero-narrative .soft { color: rgba(255,255,255,.55); }

/* Signature metric — the hero gesture */
.io .today-hero .hero-spacer { flex: 1; min-height: 24px; }
.io .today-hero .hero-metric-lbl {
  font-size: 11px; font-weight: 600; letter-spacing: 0.8px;
  text-transform: uppercase; color: rgba(255,255,255,.6);
  display: inline-flex; align-items: center; gap: 8px;
}
.io .today-hero .hero-metric-lbl .moon {
  width: 13px; height: 13px; border-radius: 50%;
  background: radial-gradient(circle at 34% 34%, #fff, rgba(255,255,255,.7) 55%, rgba(255,255,255,.2));
  box-shadow: 0 0 11px rgba(255,255,255,.35);
}
.io .today-hero .hero-metric {
  font-size: 62px; font-weight: 200; letter-spacing: -2px;
  line-height: 1; color: #fff; margin-top: 12px;
  font-variant-numeric: tabular-nums;
  display: flex; align-items: baseline;
}
.io .today-hero .hero-metric .unit {
  font-size: 24px; font-weight: 300; letter-spacing: -0.4px;
  opacity: 0.62; margin-left: 8px;
}
.io .today-hero .hero-metric-sub {
  font-size: 13px; color: rgba(255,255,255,.62);
  margin-top: 10px; line-height: 1.4; max-width: 26em;
}

/* The single thin stat row — hairline dividers, three slots */
.io .today-hero .hero-stats {
  margin-top: 22px; padding-top: 18px;
  border-top: 1px solid rgba(255,255,255,.14);
  display: grid; grid-template-columns: 1fr 1fr 1fr;
}
.io .today-hero .hero-stats .st { padding-right: 14px; position: relative; }
.io .today-hero .hero-stats .st + .st {
  padding-left: 16px;
  border-left: 1px solid rgba(255,255,255,.12);
}
.io .today-hero .hero-stats .st .l {
  font-size: 10px; font-weight: 600; letter-spacing: 0.7px;
  text-transform: uppercase; color: rgba(255,255,255,.5);
}
.io .today-hero .hero-stats .st .v {
  font-size: 15px; font-weight: 600; letter-spacing: -0.2px;
  color: #fff; margin-top: 6px; font-variant-numeric: tabular-nums;
}
.io .today-hero .hero-stats .st .s {
  font-size: 11px; color: rgba(255,255,255,.45);
  margin-top: 3px; font-variant-numeric: tabular-nums;
}

/* ── Section header (Today canvas, editorial) ─────────────────── */
.io .t-secthd {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 26px 18px 12px;
}
.io .t-secthd .ttl {
  font-size: 17px; font-weight: 600; letter-spacing: -0.3px;
  color: var(--io-label);
}
.io .t-secthd .ttl .ct {
  font-size: 13px; font-weight: 500; color: var(--io-label-tertiary);
  margin-left: 7px; font-variant-numeric: tabular-nums;
}
.io .t-secthd .see {
  font-size: 15px; font-weight: 400; color: var(--io-blue);
  display: inline-flex; align-items: center; gap: 1px;
}

/* ── Today's arc — only calendar surface on Today ─────────────── */
.io .t-arc { padding: 0; }
.io .t-arc .arc-r {
  display: grid; grid-template-columns: 52px 4px 1fr 16px;
  gap: 12px; align-items: center;
  padding: 10px 18px 10px 16px;
}
.io .t-arc .arc-r .when { text-align: right; font-variant-numeric: tabular-nums; line-height: 1.15; }
.io .t-arc .arc-r .when .h { display: block; font-size: 14px; font-weight: 600; letter-spacing: -0.2px; color: var(--io-label); }
.io .t-arc .arc-r .when .s { font-size: 10px; font-weight: 600; letter-spacing: 0.4px; color: var(--io-label-tertiary); }
.io .t-arc .arc-r .sw { width: 4px; align-self: stretch; min-height: 26px; border-radius: 2px; }
.io .t-arc .arc-r .body { min-width: 0; }
.io .t-arc .arc-r .body .t { font-size: 15px; font-weight: 600; letter-spacing: -0.2px; color: var(--io-label); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.io .t-arc .arc-r .body .l { font-size: 12px; color: var(--io-label-secondary); margin-top: 2px; }
.io .t-arc .arc-r .right { color: var(--io-label-tertiary); }
.io .t-arc .arc-r.past .when .h,
.io .t-arc .arc-r.past .body .t { color: var(--io-label-tertiary); }
.io .t-arc .arc-r.past .body .l { color: var(--io-label-quaternary); }
.io .t-arc .arc-r.past .sw { opacity: 0.4; }

/* Now marker */
.io .t-arc .now-line {
  display: grid; grid-template-columns: 52px 1fr; gap: 12px;
  align-items: center; padding: 5px 18px 5px 16px;
}
.io .t-arc .now-line .lbl {
  text-align: right; font-size: 10px; font-weight: 700; letter-spacing: 0.7px;
  text-transform: uppercase; color: var(--io-red); font-variant-numeric: tabular-nums;
}
.io .t-arc .now-line .bar { height: 1.5px; background: var(--io-red); border-radius: 1px; position: relative; }
.io .t-arc .now-line .bar::before {
  content:""; position: absolute; left: -5px; top: 50%;
  width: 11px; height: 11px; border-radius: 50%; background: var(--io-red);
  transform: translateY(-50%);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--io-red) 16%, transparent);
}

/* ── Module shelf — the launcher. 2-col tile grid. ────────────── */
.io .shelf {
  padding: 0 16px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
}
.io .tile2 {
  background: var(--io-bg-elev);
  border: 0.5px solid var(--io-separator-opaque);
  border-radius: 22px;
  padding: 16px 16px 18px;
  display: flex; flex-direction: column;
  min-height: 116px;
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
}
.io[data-theme="dark"] .tile2 {
  border-color: var(--io-separator);
  box-shadow: none;
}
.io .tile2 .chip {
  width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center; color: #fff;
  flex-shrink: 0;
}
.io .tile2 .tl { margin-top: 14px; font-size: 15px; font-weight: 600; letter-spacing: -0.2px; color: var(--io-label); }
.io .tile2 .datum {
  margin-top: 3px; font-size: 13px; color: var(--io-label-secondary);
  font-variant-numeric: tabular-nums;
  display: flex; align-items: baseline; gap: 5px;
}
.io .tile2 .datum .v { color: var(--io-label); font-weight: 500; }
.io .tile2 .datum.empty .v { color: var(--io-label-tertiary); font-weight: 400; }
/* tile chevron, top-right */
.io .tile2 .head { display: flex; align-items: flex-start; justify-content: space-between; }
.io .tile2 .head .cv { color: var(--io-label-quaternary); margin-top: 3px; }

/* ── Pull-down spotlight affordance (hint at top of arc area) ─── */
.io .spotlight-hint {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  padding: 6px 16px 0; color: var(--io-label-tertiary);
  font-size: 12px; font-weight: 500;
}

/* ═══════════════════════════════════════════════════════════════
   5-item tab bar — Today · Calendar · ✛ · Health · You
   The single global navigator. Center ✛ is a primary action.
   ═══════════════════════════════════════════════════════════════ */
.io .tabbar5 {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 8px 6px 26px;
  background: rgba(255,255,255,.82);
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  border-top: 0.5px solid var(--io-separator);
  display: grid; grid-template-columns: repeat(5, 1fr);
  align-items: end;
  z-index: 30;
}
.io[data-theme="dark"] .tabbar5 {
  background: rgba(22,22,24,.82);
  border-top-color: var(--io-separator);
}
.io .tabbar5 .tab {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 4px 0 2px; color: var(--io-label-secondary);
}
.io .tabbar5 .tab .ic { width: 28px; height: 28px; display: grid; place-items: center; }
.io .tabbar5 .tab .lb { font-size: 10px; font-weight: 600; letter-spacing: 0.1px; }
.io .tabbar5 .tab.active { color: var(--io-blue); }
.io .tabbar5 .tab.tinted.active { color: var(--tab-tint); }

/* Center create — primary action, blue filled, gently raised */
.io .tabbar5 .create {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding-bottom: 2px;
}
.io .tabbar5 .create .fab {
  width: 46px; height: 46px; border-radius: 16px;
  background: var(--io-blue); color: #fff;
  display: grid; place-items: center;
  box-shadow: 0 4px 14px -2px rgba(0,122,255,.5);
  margin-top: -4px;
}
.io .tabbar5 .create .lb { font-size: 10px; font-weight: 600; letter-spacing: 0.1px; color: var(--io-label-secondary); }

/* ── Create bottom sheet ──────────────────────────────────────── */
.io .sheet-scrim { position: absolute; inset: 0; z-index: 40; background: rgba(0,0,0,.32); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); }
.io .sheet {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 41;
  background: var(--io-bg-grouped);
  border-radius: 28px 28px 0 0;
  padding: 0 0 30px;
  box-shadow: 0 -12px 40px rgba(0,0,0,.2);
}
.io[data-theme="dark"] .sheet { background: #1C1C1E; }
.io .sheet .grabber { width: 38px; height: 5px; border-radius: 3px; background: var(--io-label-quaternary); margin: 8px auto 4px; }
.io .sheet .sheet-hd { display: flex; align-items: center; justify-content: space-between; padding: 10px 20px 4px; }
.io .sheet .sheet-hd .ttl { font-size: 20px; font-weight: 700; letter-spacing: -0.4px; }
.io .sheet .sheet-hd .x { width: 30px; height: 30px; border-radius: 50%; background: var(--io-fill-tertiary); color: var(--io-label-secondary); display: grid; place-items: center; }
.io .sheet .sheet-seg { padding: 12px 16px 4px; }
.io .sheet .create-opt {
  display: flex; align-items: center; gap: 14px;
  padding: 16px; margin: 8px 16px 0;
  background: var(--io-bg-elev); border-radius: 16px;
}
.io .sheet .create-opt .ci { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; color: #fff; flex-shrink: 0; }
.io .sheet .create-opt .ct { flex: 1; }
.io .sheet .create-opt .ct .t { font-size: 16px; font-weight: 600; letter-spacing: -0.2px; color: var(--io-label); }
.io .sheet .create-opt .ct .s { font-size: 13px; color: var(--io-label-secondary); margin-top: 2px; }
.io .sheet .create-opt .cv { color: var(--io-label-tertiary); }

/* ── On-scroll collapsed header ────────────────────────────────── */
.io .t-cnav {
  position: sticky; top: 0; z-index: 20;
  padding: 56px 16px 12px;
  background: color-mix(in oklab, var(--io-bg) 82%, transparent);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 0.5px solid var(--io-separator);
}
.io .t-cnav .cn-row { display: flex; align-items: center; justify-content: space-between; }
.io .t-cnav .cn-title .t1l { font-size: 26px; font-weight: 700; letter-spacing: -0.5px; color: var(--io-label); line-height: 1.05; }
.io .t-cnav .cn-title .t1d { font-size: 12px; font-weight: 600; letter-spacing: 0.3px; color: var(--io-label-tertiary); margin-top: 2px; }
.io .t-cnav .cn-actions { display: flex; align-items: center; gap: 8px; }
.io .t-cnav .cn-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 11px 6px 9px; border-radius: 999px;
  background: var(--io-grad-greeting); color: #fff;
  font-size: 13px; font-weight: 600; letter-spacing: -0.2px;
  font-variant-numeric: tabular-nums;
}
.io .t-cnav .cn-pill .u { font-weight: 400; opacity: 0.7; }
.io .t-cnav .cn-pill .moon {
  width: 11px; height: 11px; border-radius: 50%;
  background: radial-gradient(circle at 34% 34%, #fff, rgba(255,255,255,.7) 55%, rgba(255,255,255,.2));
}
.io .t-cnav .cn-btn {
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; color: var(--io-label-secondary);
  background: var(--io-fill-tertiary);
}
.io .t-cnav .cn-btn.avatar { background: var(--io-grad-greeting); color: #fff; font-size: 14px; font-weight: 600; }

/* ── First-run / empty hero variant ───────────────────────────── */
.io .today-hero.empty .hero-metric { color: rgba(255,255,255,.4); font-weight: 200; }
.io .empty-tile-note { font-size: 13px; color: var(--io-label-secondary); line-height: 1.4; }
