/* Tock: shared tokens, base and components for the site and the web app. */

:root {
  --bg: #FBFAF7;
  --bg-2: #F3F1EC;
  --card: #FFFFFF;
  --ink: #111113;
  --ink-2: #3A3A3F;
  --mute: #86868B;
  --line: rgba(17, 17, 19, .07);
  --line-2: rgba(17, 17, 19, .13);
  --glass: rgba(251, 250, 247, .72);
  --accent: #FF6B2C;
  --accent-ink: #E2501A;
  --accent-soft: #FFEDE3;
  --good: #34C759;
  --shadow-1: 0 1px 2px rgba(17, 17, 19, .04), 0 4px 14px rgba(17, 17, 19, .05);
  --shadow-2: 0 1px 2px rgba(17, 17, 19, .05), 0 22px 60px -18px rgba(17, 17, 19, .22);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", system-ui, sans-serif;
  --display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", system-ui, sans-serif;
  --round: ui-rounded, "SF Pro Rounded", "Nunito", -apple-system, system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0A0A0B;
    --bg-2: #131315;
    --card: #161618;
    --ink: #F5F5F7;
    --ink-2: #C9C9CE;
    --mute: #8E8E93;
    --line: rgba(255, 255, 255, .07);
    --line-2: rgba(255, 255, 255, .14);
    --glass: rgba(10, 10, 11, .7);
    --accent-soft: rgba(255, 107, 44, .14);
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 14px rgba(0, 0, 0, .3);
    --shadow-2: 0 1px 2px rgba(0, 0, 0, .5), 0 22px 60px -18px rgba(0, 0, 0, .8);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0A0A0B; --bg-2: #131315; --card: #161618; --ink: #F5F5F7; --ink-2: #C9C9CE; --mute: #8E8E93;
  --line: rgba(255, 255, 255, .07); --line-2: rgba(255, 255, 255, .14); --glass: rgba(10, 10, 11, .7);
  --accent-soft: rgba(255, 107, 44, .14);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 14px rgba(0, 0, 0, .3);
  --shadow-2: 0 1px 2px rgba(0, 0, 0, .5), 0 22px 60px -18px rgba(0, 0, 0, .8);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.5 var(--font);
  letter-spacing: -.011em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, select { font: inherit; color: inherit; }
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 8px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  height: 44px; padding: 0 22px; border-radius: 999px;
  font-weight: 600; font-size: 15px; letter-spacing: -.01em; white-space: nowrap;
  transition: transform .2s var(--ease), background .2s, box-shadow .2s, opacity .2s;
}
.btn:active { transform: scale(.97); }
.btn-ink { background: var(--ink); color: var(--bg); }
.btn-ink:hover { opacity: .88; }
.btn-accent { background: var(--accent); color: #fff; box-shadow: 0 8px 24px -10px rgba(255, 107, 44, .8); }
.btn-accent:hover { background: var(--accent-ink); }
.btn-ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2); }
.btn-ghost:hover { background: var(--line); }
.btn-sm { height: 34px; padding: 0 14px; font-size: 13.5px; }
.btn svg { width: 1.05em; height: 1.05em; }

kbd {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 1.7em; height: 1.7em; padding: 0 .45em;
  font: 500 .82em/1 var(--font); color: var(--ink-2);
  background: var(--card); border-radius: 6px;
  box-shadow: inset 0 0 0 1px var(--line-2), 0 1px 0 var(--line-2);
  vertical-align: .08em;
}

/* ---------- speech bubble ---------- */
.bubble {
  position: relative; display: inline-block;
  padding: 10px 16px; border-radius: 18px;
  background: var(--card); color: var(--ink);
  font: 600 15px/1.35 var(--round); letter-spacing: 0;
  box-shadow: var(--shadow-1), inset 0 0 0 1px var(--line);
}

/* ---------- segmented control ---------- */
.seg {
  display: inline-flex; padding: 3px; gap: 2px; border-radius: 12px;
  background: var(--bg-2); box-shadow: inset 0 0 0 1px var(--line);
}
.seg button {
  min-width: 40px; height: 30px; padding: 0 11px; border-radius: 9px;
  font-size: 13.5px; font-weight: 500; color: var(--ink-2);
  transition: background .2s, color .2s, box-shadow .2s;
}
.seg button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: var(--shadow-1); font-weight: 600; }

/* ---------- switch ---------- */
.switch { position: relative; width: 42px; height: 26px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span {
  position: absolute; inset: 0; border-radius: 99px; background: var(--line-2);
  transition: background .25s var(--ease);
}
.switch span::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
  transition: transform .3s var(--spring);
}
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(16px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- the mascot (drawn and animated by core.js + mascot-core.js) ---------- */
.tock { display: block; width: 100%; height: auto; overflow: visible; }

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}

.tabnums { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
