/* Vacaydiary website UI animations: tokens, stage, app UI components.
   Scenes are authored at a fixed design size (px) and scaled to fit their box.
   House rules baked in: flat surfaces (fill + 1px border, never a drop shadow),
   12px radius (8px small), Geist, sentence case, no letter-spacing on labels. */

:root {
  --vd-font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;

  /* brand */
  --vd-ink: #041717;
  --vd-deep: #072929;
  --vd-forest: #103E33;
  --vd-green: #0B4939;
  --vd-mint: #B1FFA9;
  --vd-lime: #D7F5A5;
  --vd-paper: #FAFBF7;
  --vd-frame: #F1F0EE;
  --vd-rule: #DCE4DC;
  --vd-muted: #64786D;

  /* app UI (from the Figma app screens) */
  --ui-bg: #F7F8F7;
  --ui-card: #FFFFFF;
  --ui-text: #0B1F1E;
  --ui-sub: #5F6F68;
  --ui-faint: #8A9893;
  --ui-line: rgba(7, 41, 41, .10);
  --ui-line-strong: rgba(7, 41, 41, .18);
  --ui-soft: #F3F6F4;
  --ui-track: #E6ECE9;
  --ui-btn: #072929;
  --ui-btn-text: #B1FFA9;

  --ui-vac-bg: #E0EFFB;   --ui-vac: #1769AA;   --ui-vac-bar: #4A9AD6;
  --ui-sick-bg: #FDEBD2;  --ui-sick: #9A5B0B;  --ui-sick-bar: #D08A2E;
  --ui-other-bg: #E9F0ED; --ui-other: #476060;
  --ui-ok-bg: #E4F4E8;    --ui-ok: #24704A;    --ui-ok-line: #BFE3CB;
  --ui-warn-bg: #FBF1DC;  --ui-warn: #8A5A06;  --ui-warn-line: #EBD5A3;
  --ui-bad-bg: #FFEBEA;   --ui-bad: #AB0130;   --ui-bad-line: #F4C4C9;
  --ui-heat-0: #EEF2F0; --ui-heat-1: #A9C9BB; --ui-heat-2: #5E9A82; --ui-heat-3: #1E6B54; --ui-heat-4: #0B3B31;

  --ui-r: 12px;
  --ui-r-sm: 8px;

  /* motion */
  --vd-ease: cubic-bezier(.42, 0, 0, 1);       /* Tabs' move curve */
  --vd-ease-out: cubic-bezier(.22, 1, .36, 1);
  --vd-ease-io: cubic-bezier(.62, 0, .32, 1);
}

/* ---------- stage: the box a scene lives in ---------- */
.vd-stage {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: var(--ui-r);
  isolation: isolate;
  background: var(--vd-stage, #F5F5F2);
  font-family: var(--vd-font);
  color: var(--ui-text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  contain: layout paint;
}
.vd-stage[data-radius="0"] { border-radius: 0; }
.vd-canvas {
  position: absolute;
  left: 0; top: 0;
  transform-origin: 0 0;
  transform: scale(var(--k, 1));
  overflow: hidden;
}
.vd-canvas * { box-sizing: border-box; }
.vd-canvas p, .vd-canvas h3, .vd-canvas h4 { margin: 0; }

/* stage backgrounds (set by the scene's `bg`) */
.vd-bg { position: absolute; inset: 0; z-index: 0; }
.vd-bg img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vd-bg--frame { background: var(--vd-stage, #F5F5F2); }   /* lighter, cooler than the brand Frame: Tabs' stage reads near-white */
.vd-bg--paper { background: var(--vd-paper); }
.vd-bg--soft { background: #EEF1EF; }
.vd-bg--ink { background: var(--vd-ink); }
.vd-bg--deep { background: var(--vd-deep); }
.vd-bg--sun { background: #F4EADC; }
.vd-bg--morning { background: #F3F8EC; }
/* Tabs-style non-image grounds, in our colours */
.vd-bg--glow {
  background:
    radial-gradient(ellipse 46% 40% at 50% -4%, rgba(205, 245, 150, .95), rgba(205, 245, 150, 0) 72%),
    radial-gradient(ellipse 78% 60% at 50% -12%, rgba(160, 245, 170, .62), rgba(160, 245, 170, 0) 74%),
    var(--vd-paper);
}
.vd-bg--glow-deep {
  background:
    radial-gradient(ellipse 62% 48% at 50% 112%, rgba(120, 230, 165, .42), rgba(120, 230, 165, 0) 70%),
    radial-gradient(ellipse 30% 26% at 50% 104%, rgba(215, 245, 165, .35), rgba(215, 245, 165, 0) 70%),
    linear-gradient(180deg, #0B302C 0%, #041717 100%);
}
.vd-bg--dots { background: var(--vd-paper); }
.vd-bg--dots::before {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(circle, rgba(7, 41, 41, .22) 1.1px, transparent 1.6px);
  background-size: 10px 10px;
  -webkit-mask-image: radial-gradient(ellipse 75% 70% at 50% 50%, transparent 25%, #000 85%);
  mask-image: radial-gradient(ellipse 75% 70% at 50% 50%, transparent 25%, #000 85%);
}
.vd-bg--placeholder {
  background: repeating-linear-gradient(135deg, #DCE1DE 0 14px, #D5DBD8 14px 28px);
  outline: 1px dashed #9AA9A2; outline-offset: -10px;
}
.vd-ph-note {
  position: absolute; max-width: 46%;
  font: 500 12px/1.4 var(--vd-font); color: #3E504A; background: rgba(255, 255, 255, .78);
  border: 1px solid #C3CEC8; border-radius: 8px; padding: 6px 9px;
}
.vd-ph-tl { left: 18px; top: 16px; } .vd-ph-tr { right: 18px; top: 16px; }
.vd-ph-bl { left: 18px; bottom: 16px; } .vd-ph-br { right: 18px; bottom: 16px; }
.vd-bg > i {
  position: absolute; width: var(--s, 90%); aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(closest-side, var(--c) 0, var(--c) 22%, transparent 100%);
  left: var(--x); top: var(--y); transform: translate(-50%, -50%); opacity: var(--o, 1);
}
.vd-bg .vd-grain {
  position: absolute; inset: 0; pointer-events: none; mix-blend-mode: overlay; opacity: .5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .5 0 0 0 0 .5 0 0 0 .6 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.vd-layer { position: absolute; inset: 0; z-index: 1; }

/* ---------- type ---------- */
.t-xs { font-size: 11px; line-height: 1.35; }
.t-s  { font-size: 12px; line-height: 1.4; }
.t-m  { font-size: 13px; line-height: 1.4; }
.t-l  { font-size: 15px; line-height: 1.35; }
.t-xl { font-size: 18px; line-height: 1.25; letter-spacing: -.01em; }
.t-2xl { font-size: 26px; line-height: 1.1; letter-spacing: -.02em; }
.t-3xl { font-size: 36px; line-height: 1.05; letter-spacing: -.025em; }
.t-num { font-variant-numeric: tabular-nums; }
.w5 { font-weight: 500; }
.w6 { font-weight: 600; }
.sub { color: var(--ui-sub); }
.faint { color: var(--ui-faint); }

/* ---------- surfaces ---------- */
.ui-card {
  position: absolute;
  background: var(--ui-card);
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-r);
}
.ui-card.is-static { position: relative; }
.ui-pad { padding: 16px; }
.ui-panel { background: var(--ui-soft); border: 1px solid var(--ui-line); border-radius: var(--ui-r-sm); }
.ui-glass {
  position: absolute;
  background: rgba(250, 251, 247, .66);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, .75);
  border-radius: var(--ui-r);
}
.ui-dark { background: var(--vd-deep); color: #E9F0EC; border-color: rgba(220, 228, 220, .14); }
.ui-hr { height: 1px; background: var(--ui-line); border: 0; margin: 0; }
.row { display: flex; align-items: center; }
.col { display: flex; flex-direction: column; }
.gap4 { gap: 4px; } .gap6 { gap: 6px; } .gap8 { gap: 8px; } .gap10 { gap: 10px; } .gap12 { gap: 12px; } .gap14 { gap: 14px; } .gap16 { gap: 16px; } .gap20 { gap: 20px; } .gap24 { gap: 24px; }
.between { justify-content: space-between; }
.grow { flex: 1 1 auto; min-width: 0; }
.ellip { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- small parts ---------- */
.ui-avatar {
  width: 32px; height: 32px; border-radius: 50%; flex: none; object-fit: cover; display: block;
  background: var(--ui-soft); border: 1px solid var(--ui-line);
}
.ui-avatar.s20 { width: 20px; height: 20px; }
.ui-avatar.s24 { width: 24px; height: 24px; }
.ui-avatar.s28 { width: 28px; height: 28px; }
.ui-avatar.s40 { width: 40px; height: 40px; }
.ui-avatar.s48 { width: 48px; height: 48px; }
.ui-avatar.s64 { width: 64px; height: 64px; }
.ui-avatars { display: flex; }
.ui-avatars .ui-avatar { border: 2px solid #fff; margin-left: -8px; }
.ui-avatars .ui-avatar:first-child { margin-left: 0; }

.ui-icon { width: 16px; height: 16px; flex: none; display: block; }
.ui-iconbox {
  width: 32px; height: 32px; border-radius: 8px; flex: none; display: grid; place-items: center;
  background: var(--ui-soft); color: var(--vd-forest); border: 1px solid var(--ui-line);
}
.ui-iconbox.dark { background: var(--vd-deep); color: var(--vd-mint); border-color: var(--vd-deep); }
.ui-block-icon { width: 32px; height: 32px; object-fit: contain; flex: none; display: block; }

/* chips: rounded, text only (no leading dots) */
.ui-chip {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px;
  border-radius: 999px; font-size: 11.5px; font-weight: 500; line-height: 1; white-space: nowrap;
  background: var(--ui-other-bg); color: var(--ui-other); border: 1px solid transparent;
}
.ui-chip .ui-icon { width: 12px; height: 12px; }
.ui-chip.is-ok { background: var(--ui-ok-bg); color: var(--ui-ok); border-color: var(--ui-ok-line); }
.ui-chip.is-warn { background: var(--ui-warn-bg); color: var(--ui-warn); border-color: var(--ui-warn-line); }
.ui-chip.is-bad { background: var(--ui-bad-bg); color: var(--ui-bad); border-color: var(--ui-bad-line); }
.ui-chip.is-vac { background: var(--ui-vac-bg); color: var(--ui-vac); }
.ui-chip.is-sick { background: var(--ui-sick-bg); color: var(--ui-sick); }
.ui-chip.is-dark { background: var(--vd-deep); color: var(--vd-mint); }
.ui-chip.is-line { background: #fff; color: var(--ui-sub); border-color: var(--ui-line-strong); }
.ui-count {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: var(--ui-warn-bg); color: var(--ui-warn); font-size: 11px; font-weight: 600;
}

.ui-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 32px; padding: 0 14px; border-radius: 8px; font-size: 13px; font-weight: 500; white-space: nowrap;
  background: var(--ui-btn); color: var(--ui-btn-text); border: 1px solid var(--ui-btn);
}
.ui-btn.line { background: #fff; color: var(--ui-text); border-color: var(--ui-line-strong); }
.ui-btn.soft { background: var(--ui-soft); color: var(--ui-text); border-color: var(--ui-line); }
.ui-btn.danger { background: #fff; color: var(--ui-bad); border-color: var(--ui-bad-line); }
.ui-btn.sm { height: 26px; padding: 0 10px; font-size: 12px; border-radius: 7px; }
.ui-btn.lg { height: 38px; padding: 0 18px; font-size: 14px; }

.ui-input {
  display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px; border-radius: 8px;
  background: #fff; border: 1px solid var(--ui-line-strong); font-size: 13px; color: var(--ui-text);
}
.ui-input.is-focus { border-color: var(--vd-forest); outline: 3px solid rgba(16, 62, 51, .10); }
.ui-input .ph { color: var(--ui-faint); }
.ui-field-label { font-size: 12px; color: var(--ui-sub); margin-bottom: 5px; }
.ui-check {
  width: 16px; height: 16px; border-radius: 5px; border: 1.5px solid var(--ui-line-strong); background: #fff;
  display: grid; place-items: center; flex: none; color: #fff;
}
.ui-check.is-on { background: var(--vd-deep); border-color: var(--vd-deep); color: var(--vd-mint); }
.ui-toggle { width: 30px; height: 18px; border-radius: 999px; background: var(--ui-track); position: relative; flex: none; }
.ui-toggle::after { content: ""; position: absolute; left: 2px; top: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform .3s var(--vd-ease); }
.ui-toggle.is-on { background: var(--vd-forest); }
.ui-toggle.is-on::after { transform: translateX(12px); }

/* progress bars: drive --p (0..1) */
.ui-bar { position: relative; height: 6px; border-radius: 999px; background: var(--ui-track); overflow: hidden; }
.ui-bar > b { position: absolute; left: 0; top: 0; bottom: 0; width: calc(var(--p, 0) * 100%); border-radius: inherit; background: var(--vd-forest); }
.ui-bar.vac > b { background: var(--ui-vac-bar); }
.ui-bar.sick > b { background: var(--ui-sick-bar); }
.ui-bar.mint > b { background: #3FA27A; }

/* tabs (pill track allowed for tab buttons) */
.ui-tabs { display: inline-flex; padding: 3px; gap: 2px; border-radius: 999px; background: var(--ui-soft); border: 1px solid var(--ui-line); }
.ui-tab { height: 26px; padding: 0 12px; border-radius: 999px; font-size: 12px; font-weight: 500; color: var(--ui-sub); display: inline-flex; align-items: center; gap: 6px; }
.ui-tab.is-on { background: #fff; color: var(--ui-text); border: 1px solid var(--ui-line); }

/* table rows */
.ui-rows { display: flex; flex-direction: column; }
.ui-row { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 14px; border-top: 1px solid var(--ui-line); }
.ui-row:first-child { border-top: 0; }
.ui-row.is-hi { background: #F6FAF7; }
.ui-th { font-size: 11.5px; color: var(--ui-faint); font-weight: 500; }

/* app sidebar (deep green) */
.ui-side { position: absolute; background: var(--vd-deep); border-radius: var(--ui-r); color: #DCE8E3; padding: 16px 10px; }
.ui-side .nav { display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px; border-radius: 8px; font-size: 13px; color: #CFE0D9; }
.ui-side .nav.is-on { background: rgba(255, 255, 255, .08); color: #fff; border: 1px solid rgba(255, 255, 255, .10); }
.ui-side .nav .ui-icon { color: #9DB3AA; }
.ui-side .nav.is-on .ui-icon { color: var(--vd-mint); }

/* calendar */
.ui-cal { display: grid; border-top: 1px solid var(--ui-line); }
.ui-cal .h { font-size: 11.5px; color: var(--ui-faint); text-align: center; padding: 8px 0 6px; }
.ui-cal .d { position: relative; border-left: 1px solid var(--ui-line); }
.ui-cal .is-weekend { background: #F6F7F6; }
.ui-cal .is-bank { background: repeating-linear-gradient(135deg, #F2F5F3 0 6px, #EAEFEC 6px 12px); }
.ui-leave {
  position: absolute; height: 26px; border-radius: 7px; display: flex; align-items: center; padding: 0 8px; gap: 6px;
  font-size: 12px; font-weight: 500; white-space: nowrap; overflow: hidden;
  background: var(--ui-vac-bg); color: var(--ui-vac);
}
.ui-leave.sick { background: var(--ui-sick-bg); color: var(--ui-sick); }
.ui-leave.other { background: var(--ui-other-bg); color: var(--ui-other); }
.ui-leave.pending { background: #fff; border: 1.5px dashed #8DB8DB; color: var(--ui-vac); }
.ui-leave.half { background: linear-gradient(90deg, var(--ui-vac-bg) 50%, transparent 50%); }

/* coverage heat cells */
.ui-heat { display: grid; gap: 5px; }
.ui-heat > i { aspect-ratio: 1; border-radius: 6px; background: var(--ui-heat-0); display: block; }

/* toasts and notifications (flat: border only) */
.ui-toast {
  position: absolute; display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 10px;
  background: var(--vd-deep); color: #fff; font-size: 13px; white-space: nowrap;
}
.ui-note {
  position: absolute; display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 12px;
  background: rgba(255, 255, 255, .72); -webkit-backdrop-filter: blur(18px) saturate(140%); backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, .9); color: var(--vd-ink); font-size: 13.5px; line-height: 1.35;
}
.ui-note .ui-block-icon { width: 38px; height: 38px; background: var(--vd-paper); border-radius: 9px; padding: 4px; }

/* phone (minimal: a rounded body and screen, no fake status-bar chrome beyond the time) */
.ui-phone { position: absolute; width: 270px; height: 560px; border-radius: 40px; background: #0E1A19; padding: 9px; }
.ui-phone .screen { position: relative; width: 100%; height: 100%; border-radius: 32px; overflow: hidden; background: var(--ui-bg); }
.ui-phone .status { height: 34px; display: flex; align-items: center; justify-content: space-between; padding: 0 22px; font-size: 12px; font-weight: 600; color: var(--ui-text); }

/* browser window frame (only when the scene needs one: a plain bar, no fake app logos) */
.ui-window { position: absolute; background: #fff; border: 1px solid var(--ui-line); border-radius: var(--ui-r); overflow: hidden; }
.ui-window > .bar { height: 32px; display: flex; align-items: center; gap: 6px; padding: 0 12px; border-bottom: 1px solid var(--ui-line); background: #FBFBFA; }
.ui-window > .bar i { width: 9px; height: 9px; border-radius: 50%; background: #E3E6E4; display: block; }

/* skeleton boxes for irrelevant detail */
.ui-skel { background: var(--ui-soft); border-radius: 6px; height: 10px; }
.ui-skel.dark { background: #E7ECEA; }

/* cursor */
.vd-cursor { position: absolute; left: 0; top: 0; width: 22px; height: 22px; z-index: 50; pointer-events: none; transform: translate(-100px, -100px); }
.vd-cursor svg { display: block; width: 22px; height: 22px; overflow: visible; }
.vd-cursor .ring { position: absolute; left: -10px; top: -10px; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--vd-forest); opacity: 0; }

/* reduced motion and poster: nothing animates */
.vd-stage.is-poster * { transition: none !important; }

/* start-hidden helper for things that enter later (t.in / t.pop make them visible) */
.hide { opacity: 0; }
.abs { position: absolute; }
.c-ok { color: var(--ui-ok); } .c-warn { color: var(--ui-warn); } .c-bad { color: var(--ui-bad); } .c-vac { color: var(--ui-vac); } .c-forest { color: var(--vd-forest); } .c-sub { color: var(--ui-sub); }

/* ---------- generic site components ---------- */
.vd-counter { font-variant-numeric: tabular-nums; }

/* ---------- odometer (t.count): one reel per digit, soft top and bottom edges ---------- */
.vd-odo { display: inline-block; white-space: nowrap; --vd-odo-l: 1.3em; }
@supports (width: round(1.5px, 1px)) { .vd-odo { --vd-odo-l: round(1.3em, 1px); } }
.vd-odo__c { position: relative; display: inline-block; padding-block: .14em; margin-block: -.14em; -webkit-text-fill-color: transparent; -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 .18em, #000 calc(100% - .18em), transparent 100%); mask-image: linear-gradient(to bottom, transparent 0, #000 .18em, #000 calc(100% - .18em), transparent 100%); }
.vd-odo__c.is-new { animation: vd-odo-new .32s cubic-bezier(.42, 0, 0, 1) both; }
.vd-odo__c::before { content: "0\A 1\A 2\A 3\A 4\A 5\A 6\A 7\A 8\A 9\A 0"; position: absolute; left: 0; right: 0; top: 50%; margin-top: calc(var(--vd-odo-l) / -2); white-space: pre; text-align: center; line-height: var(--vd-odo-l); -webkit-text-fill-color: currentColor; transform: translate3d(0, calc(var(--vd-odo-d, 0) * -1 * var(--vd-odo-l)), 0); pointer-events: none; }
@keyframes vd-odo-new { from { opacity: 0; transform: translate3d(0, .35em, 0); } }
