/* The hestia home look, copied from web/src/styles.css: chunky outlined
   cards with a hard bottom shadow on a sky. Shared by every variant. */

/* The same two vendored faces the real app ships (OFL, Google Fonts' latin subsets). */
@font-face { font-family: 'Lilita One'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/lilita-one-latin.woff2') format('woff2'); }
@font-face { font-family: 'Nunito'; font-style: normal; font-weight: 600 900; font-display: swap; src: url('fonts/nunito-latin.woff2') format('woff2'); }

:root {
  --ink: #2b1a0e;
  --card: #fff8ea;
  --card-2: #fdf0d5;
  --text: #2b1a0e;
  --muted: #7a6a5a;
  --line: 3px;
  --drop: 5px;
  --radius: 22px;
  --accent: #ff8c42;
  --good: #22c55e;
  --mid: #f5b700;
  --bad: #ff5d5d;
  --quest: #ffd166;
  --agents: #b388ff;
  --news: #4cc9f0;
  --notes: #ff8fab;
  --leaf: #8ee39b;
  --weather: #fff;
  --chip: #fff;
  --sky-a: #8fe3ff;
  --sky-b: #4cb6f5;
  --sky-c: #bfeaff;
  --glass: rgba(255, 248, 234, 0.82);
  --glow: rgba(255, 244, 200, 0.7);
  --font-display: 'Lilita One', 'Arial Rounded MT Bold', system-ui, sans-serif;
  --font-body: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: light;
}

/* Dark follows the system; ?theme=dark or ?theme=light forces one. */
@media (prefers-color-scheme: dark) {
  :root:not(.light) {
    --ink: #0b0e1f; --card: #232a52; --card-2: #1b2145; --text: #f4f1ea; --muted: #a9b0d0;
    --chip: #2e3666; --weather: #2a3160; --glass: rgba(35, 42, 82, 0.82); --glow: rgba(190, 210, 255, 0.22);
    --sky-a: #1a2457; --sky-b: #0f1636; --sky-c: #2b3a7a;
    color-scheme: dark;
  }
}
:root.dark {
  --ink: #0b0e1f; --card: #232a52; --card-2: #1b2145; --text: #f4f1ea; --muted: #a9b0d0;
  --chip: #2e3666; --weather: #2a3160; --glass: rgba(35, 42, 82, 0.82); --glow: rgba(190, 210, 255, 0.22);
  --sky-a: #1a2457; --sky-b: #0f1636; --sky-c: #2b3a7a;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font-body);
  font-weight: 700;
  color: var(--text);
  background: linear-gradient(180deg, var(--sky-a) 0%, var(--sky-b) 55%, var(--sky-c) 100%) fixed var(--sky-b);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-wrap: anywhere;
}
/* Two soft clouds and a sun glow behind everything. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(circle at 84% 6%, var(--glow) 0, transparent 30%),
    radial-gradient(ellipse 160px 60px at 10% 4%, rgba(255, 255, 255, 0.55), transparent 70%),
    radial-gradient(ellipse 200px 70px at 96% 22%, rgba(255, 255, 255, 0.35), transparent 70%);
}
button { font: inherit; color: inherit; }
.display { font-family: var(--font-display); font-weight: 400; letter-spacing: 0.01em; margin: 0; }
.muted { color: var(--muted); }
b { font-weight: 900; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------------------------------------------------------------- greeting */
.greet { padding: 14px 18px 8px; color: #fff; text-shadow: 0 2px 0 rgba(43, 26, 14, 0.35); }
.greet h1 { font-size: 28px; line-height: 1.05; }
.greet .sub {
  display: inline-block; margin-top: 6px; padding: 3px 10px; border-radius: 999px;
  background: rgba(43, 26, 14, 0.18); font-size: 12px; text-shadow: none;
}

/* ---------------------------------------------------------------- cards */
.card {
  background: var(--card);
  border: var(--line) solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 0 var(--drop) 0 0 var(--ink);
  color: var(--text);
}
.widget { padding: 16px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.widget-head { display: flex; align-items: center; gap: 10px; }
.widget-head h2 { font-size: 26px; line-height: 1; }
.widget-body { display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.widget-icon, .ic {
  width: 36px; height: 36px; display: grid; place-items: center; flex: none;
  border: var(--line) solid var(--ink); border-radius: 12px;
  background: var(--tone, var(--quest)); color: var(--ink);
  font-size: 18px; box-shadow: 0 3px 0 0 var(--ink);
}
.widget-head .pill { margin-left: auto; }
.tone-quest { --tone: var(--quest); }
.tone-agents { --tone: var(--agents); }
.tone-news { --tone: var(--news); }
.tone-notes { --tone: var(--notes); }
.tone-leaf { --tone: var(--leaf); }
.tone-sky { --tone: #bfeaff; }
.tone-peach { --tone: #ffc6a5; }

.pill {
  display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px;
  border-radius: 999px; border: 2px solid var(--ink); background: var(--chip);
  font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.04em; white-space: nowrap;
}
.pill-hot { background: var(--bad); color: #fff; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px;
  border: 2px solid var(--ink); border-radius: 999px; background: var(--chip);
  font-size: 13px; font-weight: 900; box-shadow: 0 2px 0 0 var(--ink); white-space: nowrap;
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.btn {
  font-weight: 900; background: var(--card-2); border: var(--line) solid var(--ink);
  border-radius: 16px; box-shadow: 0 4px 0 0 var(--ink); padding: 10px 16px; min-height: 44px;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform 120ms var(--spring), box-shadow 120ms; user-select: none; -webkit-user-select: none;
  text-decoration: none; color: var(--text);
}
.btn:active { transform: translateY(3px) scale(0.98); box-shadow: 0 1px 0 0 var(--ink); }
.btn-primary { background: var(--accent); color: #2b1a0e; }
.label { font-size: 11px; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 4px 0 -4px; }
.label.hot { color: var(--bad); }

/* rows: a tappable line inside a card */
.row {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; min-height: 44px;
  border: 2px solid var(--ink); border-radius: 14px; background: var(--card-2);
  box-shadow: inset 5px 0 0 var(--quest); cursor: pointer; user-select: none; -webkit-user-select: none;
  transition: transform 140ms var(--spring), opacity 200ms;
}
.row:active { transform: scale(0.98); }
.row .t { flex: 1; min-width: 0; font-size: 15px; }
.row .when { font-size: 12px; font-weight: 900; color: var(--muted); white-space: nowrap; }
.box { width: 22px; height: 22px; flex: none; border: 3px solid var(--ink); border-radius: 7px; display: grid; place-items: center; font-size: 13px; }
.row.done { opacity: 0.55; }
.row.done .t { text-decoration: line-through; }
.row.done .box { background: var(--good); }
.row.done .box::after { content: '✓'; color: #fff; font-weight: 900; }

/* brief */
.brief { display: flex; gap: 10px; align-items: flex-end; }
.brief .star { font-size: 46px; line-height: 1; filter: drop-shadow(0 3px 0 var(--ink)); }
.bubble { flex: 1; border: var(--line) solid var(--ink); border-radius: 18px; padding: 12px 14px; background: var(--card-2); box-shadow: 0 4px 0 var(--ink); }
.bubble p { margin: 0 0 8px; font-size: 16px; font-weight: 800; line-height: 1.3; }
.bubble ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.bubble li { display: flex; gap: 8px; font-size: 14px; line-height: 1.3; }
.bubble li span:first-child { flex: none; }
.bubble small { display: block; margin-top: 8px; font-size: 11px; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; }

/* home todos */
.ringrow { display: flex; align-items: center; gap: 14px; }
.ring { width: 58px; height: 58px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: conic-gradient(var(--good) 0 14%, rgba(122, 106, 90, 0.25) 14% 100%); }
.ring span { width: 42px; height: 42px; border-radius: 50%; background: var(--card); display: grid; place-items: center; font-family: var(--font-display); font-size: 17px; }
.now { border: var(--line) solid var(--ink); border-radius: 18px; background: var(--quest); color: #2b1a0e; padding: 12px 14px; box-shadow: 0 4px 0 var(--ink); }
.now .k { font-size: 11px; letter-spacing: 0.08em; font-weight: 900; }
.now .display { font-size: 26px; line-height: 1.05; margin: 2px 0; }
.now .w { font-size: 13px; font-weight: 900; }

/* numbered reads (eng reads, news) */
.read { display: flex; gap: 12px; padding: 12px; border: var(--line) solid var(--ink); border-radius: 16px; background: var(--card-2); box-shadow: 0 3px 0 var(--ink); cursor: pointer; }
.read .n { flex: none; width: 30px; height: 30px; border: 3px solid var(--ink); border-radius: 9px; background: var(--news); color: #0b0e1f; display: grid; place-items: center; font-weight: 900; margin-top: 2px; }
.read h3 { margin: 0; font-size: 15px; line-height: 1.25; font-weight: 900; }
.read p { margin: 4px 0 0; font-size: 13px; line-height: 1.35; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.read.open p { -webkit-line-clamp: unset; }
.read .src { margin-top: 4px; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }

/* reading list */
.save { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 2px solid var(--ink); border-radius: 14px; background: var(--card-2); }
.save .kind { flex: none; width: 34px; height: 34px; border-radius: 10px; border: 2px solid var(--ink); display: grid; place-items: center; background: var(--chip); }
.save .t { font-size: 14px; line-height: 1.25; font-weight: 900; }
.save .s { font-size: 12px; color: var(--muted); }

/* weather */
.wx-now { display: flex; align-items: center; gap: 14px; }
.wx-now .temp { font-family: var(--font-display); font-size: 64px; line-height: 0.9; }
.wx-now .em { font-size: 54px; }
.wx-now .d { font-size: 14px; line-height: 1.35; }
.hours { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; overscroll-behavior-x: contain; }
.hours::-webkit-scrollbar { display: none; }
.hour { flex: none; width: 44px; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; font-weight: 900; }
.hour .bar { width: 18px; height: 60px; border: 2px solid var(--ink); border-radius: 8px; background: var(--chip); display: flex; align-items: flex-end; overflow: hidden; }
.hour .bar i { display: block; width: 100%; background: var(--news); }
.hour small { color: var(--muted); font-size: 11px; }

/* todos */
.due { font-size: 11px; font-weight: 900; padding: 3px 8px; border-radius: 999px; border: 2px solid var(--ink); background: var(--chip); white-space: nowrap; }
.due.over { background: var(--bad); color: #fff; }
.due.soon { background: var(--quest); color: #2b1a0e; }
.tag { font-size: 11px; color: var(--muted); }

/* groceries */
.groc { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.gi { display: flex; align-items: center; gap: 8px; padding: 10px; border: 2px solid var(--ink); border-radius: 14px; background: var(--card-2); cursor: pointer; font-size: 14px; user-select: none; -webkit-user-select: none; transition: transform 140ms var(--spring), opacity 200ms; }
.gi:active { transform: scale(0.96); }
.gi .e { font-size: 22px; }
.gi small { display: block; color: var(--muted); font-size: 11px; }
.gi.done { opacity: 0.45; text-decoration: line-through; }

/* agents */
.agent { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 2px solid var(--ink); border-radius: 14px; background: var(--card-2); }
.dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--ink); flex: none; }
.dot.working { background: var(--news); }
.dot.done { background: var(--good); }
.dot.need { background: var(--bad); }
@media (prefers-reduced-motion: no-preference) {
  .dot.working, .dot.need { animation: blink 1.4s ease-in-out infinite; }
  .pill-hot { animation: pulse 1.6s ease-in-out infinite; }
}
@keyframes blink { 50% { opacity: 0.35; } }
@keyframes pulse { 50% { transform: scale(1.07); } }
.agent .t { flex: 1; min-width: 0; font-size: 14px; line-height: 1.3; }
.agent .t small { display: block; color: var(--muted); font-size: 12px; }

/* notes */
.note { padding: 12px 14px; border: var(--line) solid var(--ink); border-radius: 14px; background: #ffe48a; color: #2b1a0e; box-shadow: 0 3px 0 var(--ink); font-size: 15px; rotate: -0.6deg; }
.note:nth-child(2) { background: #ffc2d3; rotate: 0.8deg; }
.note small { display: block; margin-top: 4px; font-size: 11px; opacity: 0.7; letter-spacing: 0.06em; text-transform: uppercase; }

/* ---------------------------------------------------------------- shared chrome */
.variants-link {
  position: fixed; z-index: 50; top: calc(var(--safe-top) + 10px); right: calc(var(--safe-right) + 12px);
  padding: 6px 10px; border-radius: 999px; border: 2px solid var(--ink); background: var(--glass);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  color: var(--text); font-size: 12px; font-weight: 900; text-decoration: none; box-shadow: 0 2px 0 var(--ink);
}
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

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