/* RITUAL — design system after monopo saigon: monochrome, Roobert, pill controls, sharp frames */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&display=swap');

:root {
  --paper: #ffffff;
  --ink: #000000;
  --carbon: #181818;
  --ash: #6d6d6d;
  --smoke: #9a9a9a;
  --pewter: #808080;
  --graphite: #636363;
  --line: #e7e7e7;
  --line-strong: #cfcfcf;

  --font: 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --w-light: 300;
  --w-reg: 400;
  --w-mid: 500;
  --w-semi: 600;

  --radius-pill: 75px;
  --radius-card: 0px;

  --s4: 4px; --s8: 8px; --s12: 12px; --s16: 16px; --s20: 20px;
  --s24: 24px; --s28: 28px; --s40: 40px; --s48: 48px; --s64: 64px;

  --maxw: 720px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bot: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  font-weight: var(--w-reg);
  background: var(--paper);
  color: var(--carbon);
  font-size: 16px;
  line-height: 1.39;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overscroll-behavior-y: none;
}
img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; font-size: 16px; color: var(--carbon); }
a { color: inherit; text-decoration: none; }

/* ---------- App frame ---------- */
#app {
  max-width: var(--maxw);
  margin: 0 auto;
  min-height: 100%;
  padding-bottom: calc(96px + var(--safe-bot));
  position: relative;
}

.screen { display: none; padding: 0 var(--s24); animation: fade .35s ease; }
.screen.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Type scale ---------- */
.hero {
  font-weight: var(--w-light);
  font-size: clamp(56px, 18vw, 120px);
  line-height: 0.82;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.display { font-weight: var(--w-light); font-size: clamp(34px, 9vw, 64px); line-height: 1.02; letter-spacing: -0.02em; color: var(--ink); }
.h1 { font-weight: var(--w-light); font-size: 30px; line-height: 1.1; letter-spacing: -0.01em; }
.h2 { font-weight: var(--w-reg); font-size: 20px; line-height: 1.2; }
.eyebrow { font-size: 11px; font-weight: var(--w-mid); letter-spacing: 0.18em; text-transform: uppercase; color: var(--ash); }
.meta { font-size: 12px; color: var(--ash); letter-spacing: 0.02em; }
.body-lg { font-size: 18px; line-height: 1.5; }
.muted { color: var(--ash); }
.mono-num { font-variant-numeric: tabular-nums; }

/* ---------- Header ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(18px + var(--safe-top)) var(--s24) 14px;
  background: linear-gradient(var(--paper) 70%, rgba(255,255,255,0));
}
.topbar .logo { font-size: 13px; font-weight: var(--w-semi); letter-spacing: 0.32em; text-transform: uppercase; }
.topbar .date { font-size: 11px; color: var(--ash); letter-spacing: 0.12em; text-transform: uppercase; }

/* ---------- Pills / buttons ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  border-radius: var(--radius-pill);
  padding: 11px 20px;
  font-size: 13px; font-weight: var(--w-mid); letter-spacing: 0.04em;
  background: var(--ink); color: var(--paper);
  transition: transform .12s ease, opacity .2s ease;
}
.pill:active { transform: scale(0.97); }
.pill.ghost { background: transparent; color: var(--carbon); box-shadow: inset 0 0 0 1px var(--line-strong); }
.pill.sm { padding: 7px 14px; font-size: 12px; }
.pill.block { display: flex; width: 100%; justify-content: center; padding: 16px; font-size: 14px; }
.pill[disabled] { opacity: 0.35; pointer-events: none; }

.iconbtn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: var(--radius-pill); box-shadow: inset 0 0 0 1px var(--line-strong); }

/* ---------- Cards / frames ---------- */
.card { border-radius: var(--radius-card); box-shadow: inset 0 0 0 1px var(--line); padding: var(--s24); background: var(--paper); }
.frame-dark { background: var(--ink); color: var(--paper); border-radius: var(--radius-card); padding: var(--s28); }
.frame-dark .eyebrow, .frame-dark .meta, .frame-dark .muted { color: var(--smoke); }
.divider { height: 1px; background: var(--line); margin: var(--s24) 0; }
.row { display: flex; align-items: center; gap: var(--s12); }
.row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s12); }
.section-gap { height: var(--s40); }

/* ---------- Inputs ---------- */
.field { width: 100%; border: none; border-bottom: 1px solid var(--line-strong); background: transparent; padding: 14px 2px; border-radius: 0; }
.field:focus { outline: none; border-bottom-color: var(--ink); }
textarea.field { resize: none; line-height: 1.5; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border-radius: var(--radius-pill); padding: 8px 14px; font-size: 12px; box-shadow: inset 0 0 0 1px var(--line-strong); color: var(--ash); transition: .15s; }
.chip.on { background: var(--ink); color: var(--paper); box-shadow: none; }

/* ---------- Bottom nav ---------- */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  display: flex; justify-content: center; gap: 2px;
  padding: 10px 12px calc(10px + var(--safe-bot));
  background: rgba(255,255,255,0.86); backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
.nav-inner { display: flex; gap: 2px; max-width: var(--maxw); width: 100%; justify-content: space-between; }
.nav button { flex: 1; display: grid; place-items: center; gap: 4px; padding: 6px 2px; color: var(--smoke); border-radius: 12px; }
.nav button .ic { width: 22px; height: 22px; }
.nav button .lb { font-size: 9px; letter-spacing: 0.06em; text-transform: uppercase; }
.nav button.active { color: var(--ink); }

/* ---------- Outfit ---------- */
.outfit-strip { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; }
.garment { position: relative; background: #f1f1f1; border-radius: var(--radius-card); aspect-ratio: 3/4; overflow: hidden; }
.garment img { width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; }
.garment .tag { position: absolute; left: 8px; bottom: 8px; font-size: 9px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ash); background: rgba(255,255,255,0.85); padding: 2px 6px; }
.wardrobe-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }

/* ---------- Tasks ---------- */
.task { display: flex; align-items: flex-start; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.task .box { width: 22px; height: 22px; flex: none; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--line-strong); margin-top: 1px; display: grid; place-items: center; transition: .15s; }
.task.done .box { background: var(--ink); box-shadow: none; }
.task.done .box svg { stroke: #fff; }
.task.done .t-title { color: var(--smoke); text-decoration: line-through; }
.task .t-title { font-size: 16px; line-height: 1.3; }
.task .t-meta { font-size: 11px; color: var(--ash); margin-top: 4px; letter-spacing: 0.04em; }
.task .mit { font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); padding: 2px 7px; border-radius: var(--radius-pill); }

/* ---------- Progress / rings ---------- */
.bar { height: 4px; background: var(--line); border-radius: var(--radius-pill); overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--ink); width: 0; transition: width .5s ease; }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.stat { background: var(--paper); padding: 18px 14px; }
.stat .n { font-size: 30px; font-weight: var(--w-light); letter-spacing: -0.02em; line-height: 1; }
.stat .l { font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ash); margin-top: 8px; }

/* ---------- Module list ---------- */
.modlist { display: grid; gap: 1px; background: var(--line); border-block: 1px solid var(--line); }
.modrow { background: var(--paper); display: flex; align-items: center; justify-content: space-between; padding: 20px 4px; }
.modrow .ml { display: flex; flex-direction: column; gap: 3px; }
.modrow .ml .t { font-size: 16px; }
.modrow .ml .s { font-size: 12px; color: var(--ash); }
.modrow .badge { font-size: 11px; color: var(--ash); }

/* ---------- Timer ---------- */
.timer-wrap { display: grid; place-items: center; padding: var(--s24) 0; }
.timer-num { font-size: 72px; font-weight: var(--w-light); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1; }

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; bottom: calc(96px + var(--safe-bot)); transform: translateX(-50%) translateY(20px); background: var(--ink); color: #fff; padding: 12px 20px; border-radius: var(--radius-pill); font-size: 13px; opacity: 0; transition: .25s; z-index: 80; pointer-events: none; white-space: nowrap; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.empty { text-align: center; color: var(--ash); padding: var(--s40) var(--s16); font-size: 14px; }
.hidden { display: none !important; }
.center { text-align: center; }
.spin { animation: rot 1s linear infinite; } @keyframes rot { to { transform: rotate(360deg); } }
