/* ============================================================
   Focus (v207): a grid of glass tiles. Pomodoro, current task, breaks, sounds,
   app blocker, tasks, quick notes, today and the daily goal.
   ============================================================ */

/* ---------- tokens ---------- */
.focus-page {
  --ft-rgb: 175, 195, 255;                 /* glass tint, "r, g, b" */
  --ft-fill-a: rgba(var(--ft-rgb), .17);
  --ft-fill-b: rgba(var(--ft-rgb), .05);
  --ft-scrim: rgba(4, 7, 18, .26);         /* keeps text readable over a bright blob */
  --ft-edge-a: rgba(255, 255, 255, .62);
  --ft-edge-b: rgba(255, 255, 255, .06);
  --ft-edge-c: rgba(255, 255, 255, .4);
  --ft-shadow: rgba(0, 0, 0, .34);
  --ft-ctl: rgba(0, 0, 0, .34);            /* round buttons and the checkbox sit a little darker than the glass */
  --ft-ctl-line: rgba(var(--ft-rgb), .42);
  --ft-on: var(--p-on-action, #fff);       /* text on a filled action */
  --ft-prog: var(--accent);
  --ft-b1: color-mix(in srgb, var(--blue, #4f6df5) 72%, transparent);
  --ft-b2: color-mix(in srgb, var(--accent, #ff7a2f) 62%, transparent);
  --ft-b3: color-mix(in srgb, var(--blue-2, #8aa4ff) 58%, transparent);
}
:root[data-palette] .focus-page { --ft-rgb: var(--p-glass); }
:root[data-palette="greyblack"] .focus-page {
  --ft-b1: rgba(255, 255, 255, .15); --ft-b2: rgba(255, 255, 255, .1); --ft-b3: rgba(255, 255, 255, .08);
  --ft-scrim: rgba(0, 0, 0, .3);
}
[data-theme="light"] .focus-page {
  --ft-rgb: 255, 255, 255;
  --ft-fill-a: rgba(255, 255, 255, .8);
  --ft-fill-b: rgba(255, 255, 255, .42);
  --ft-scrim: transparent;
  --ft-edge-a: rgba(255, 255, 255, 1);
  --ft-edge-b: rgba(255, 255, 255, .5);
  --ft-edge-c: rgba(255, 255, 255, .9);
  --ft-shadow: rgba(40, 60, 120, .14);
  --ft-ctl: rgba(255, 255, 255, .7);
  --ft-ctl-line: rgba(17, 17, 17, .22);
  --ft-on: var(--on-accent, #fff);
  --ft-b1: rgba(120, 150, 255, .5); --ft-b2: rgba(255, 170, 120, .5); --ft-b3: rgba(190, 160, 255, .45);
}

/* ---------- header ---------- */
:root .focus-page .topbar.focus-header { align-items: center; margin-bottom: 14px; }
:root .focus-page .topbar.focus-header h1 { font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif; font-size: 38px; font-weight: 800; letter-spacing: -.045em; line-height: 1; text-transform: none; color: var(--tx); }

/* ---------- grid, with colored blobs behind the glass ---------- */
.focus-grid {
  position: relative; isolation: isolate;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: minmax(96px, auto);
  gap: 12px;
}
.focus-grid::before {
  content: ''; position: absolute; z-index: -1; inset: -40px -16px -30px; pointer-events: none;
  -webkit-mask: linear-gradient(90deg, transparent, #000 16%, #000 84%, transparent), linear-gradient(180deg, transparent, #000 5%, #000 95%, transparent);
  -webkit-mask-composite: source-in;
  mask: linear-gradient(90deg, transparent, #000 16%, #000 84%, transparent), linear-gradient(180deg, transparent, #000 5%, #000 95%, transparent);
  mask-composite: intersect;
  background:
    radial-gradient(160px 140px at 88% 4%, var(--ft-b2), transparent 70%),
    radial-gradient(230px 200px at 12% 12%, var(--ft-b1), transparent 72%),
    radial-gradient(190px 170px at 90% 33%, var(--ft-b3), transparent 70%),
    radial-gradient(240px 220px at 10% 56%, var(--ft-b2), transparent 72%),
    radial-gradient(260px 240px at 92% 76%, var(--ft-b1), transparent 72%),
    radial-gradient(230px 200px at 18% 90%, var(--ft-b3), transparent 72%);
}
.ft-pomo, .ft-wide { grid-column: 1 / -1; }
.ft-task { grid-row: span 2; }

/* ---------- a glass tile ---------- */
.ft {
  position: relative; display: flex; flex-direction: column; gap: 6px; min-width: 0;
  margin: 0; padding: 16px; border: 0; border-radius: 24px;
  color: var(--tx); font: inherit; text-align: left;
  background: linear-gradient(160deg, var(--ft-fill-a), var(--ft-fill-b)), var(--ft-scrim);
  -webkit-backdrop-filter: blur(20px) saturate(1.5); backdrop-filter: blur(20px) saturate(1.5);
  box-shadow: 0 12px 30px var(--ft-shadow), inset 0 0 28px rgba(var(--ft-rgb), .09);
  transition: scale .18s ease, box-shadow .3s ease;
  -webkit-tap-highlight-color: transparent;
}
/* the soft luminous edge */
.ft::before {
  content: ''; position: absolute; inset: 0; padding: 1px; border-radius: inherit; pointer-events: none;
  background: linear-gradient(145deg, var(--ft-edge-a), var(--ft-edge-b) 34%, var(--ft-edge-b) 64%, var(--ft-edge-c));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
button.ft { cursor: pointer; }
button.ft:active:not(:disabled) { scale: .975; }
button.ft:disabled { opacity: .45; cursor: default; }
.ft:focus-visible, .ft-hit:focus-visible, .ft-gear:focus-visible, .ft-name:focus-visible, .ft-round:focus-visible,
.ft-check:focus-visible, .ft-switch:focus-visible, .ft-pill:focus-visible, .ft-ghost:focus-visible, .ft-sit:focus-visible {
  outline: 2px solid var(--blue-2, var(--accent)); outline-offset: 2px;
}

.ft-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; min-height: 26px; }
.ft-label { padding-top: 3px; font-size: 13.5px; font-weight: 550; letter-spacing: -.005em; line-height: 1.2; color: var(--tx-2); }
.ft-ico { flex: none; display: inline-grid; place-items: center; width: 26px; height: 26px; color: var(--tx-2); }
.ft-ico svg { width: 24px; height: 24px; stroke-width: 1.6; }
.ft-value { display: block; font-size: 26px; font-weight: 700; letter-spacing: -.025em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.ft-value-sm { font-size: 19px; letter-spacing: -.015em; }
.ft-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; margin-top: auto; }
.ft-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* a tile with its own controls keeps one stretched button for the tile itself */
.ft-hit { position: absolute; inset: 0; z-index: 1; padding: 0; border: 0; border-radius: inherit; background: none; cursor: pointer; }
.ft-check, .ft-switch, .ft-name, .ft-round, .ft-x { position: relative; z-index: 2; }

/* ---------- the dial (v278, his ask: no dot numbers): clean figures in a ring that empties as the block runs ---------- */
.focus-page { --ft-d0: color-mix(in srgb, var(--accent) 38%, #fff); --ft-d1: var(--accent); --ft-d2: color-mix(in srgb, var(--accent) 72%, #b4232f); --ft-glow: color-mix(in srgb, var(--accent) 55%, transparent); }
.ft-dial { position: relative; display: grid; place-items: center; width: min(60vw, 228px); max-width: 100%; aspect-ratio: 1; margin: 0 auto; }
.ft-dial-ring { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; rotate: -90deg; filter: drop-shadow(0 0 9px var(--ft-glow)); }
.ft-dial-track { fill: none; stroke: rgba(var(--ft-rgb), .16); stroke-width: 8; }
.ft-dial-fill { fill: none; stroke: url(#ftDialGrad); stroke-width: 8; stroke-linecap: round; stroke-dashoffset: calc(628.32px * (1 - var(--left, 1))); transition: stroke-dashoffset 1s linear; }
.ft-g0 { stop-color: var(--ft-d0); }
.ft-g1 { stop-color: var(--ft-d1); }
.ft-g2 { stop-color: var(--ft-d2); }
.ft-dial-in { position: relative; display: grid; justify-items: center; gap: 8px; }
.ft-time { font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif; font-size: clamp(46px, 14.5vw, 58px); font-weight: 250; letter-spacing: -.035em; line-height: 1; font-variant-numeric: tabular-nums; color: var(--tx); }
[data-theme="light"] .ft-dial-ring { filter: none; }
[data-theme="light"] .ft { box-shadow: 0 10px 28px var(--ft-shadow), 0 0 0 1px rgba(17, 17, 17, .05); }
[data-theme="light"] .focus-page .focus-more { border-color: rgba(17, 17, 17, .08); }

/* ---------- pomodoro ---------- */
.ft-pomo { gap: 0; padding: 18px 18px 22px; }
.ft-pomo .ft-head { margin-bottom: 2px; }
.ft-digits { display: block; width: 100%; padding: 0; margin: 0 0 18px; background: none; border: 0; color: inherit; cursor: pointer; }
.ft-pomo > .ft-dial { margin-bottom: 16px; }
.ft-pomo .ft-actions { justify-content: center; }
.ft-pomo .ft-state { justify-content: center; }
.ft-gear { display: grid; place-items: center; width: 36px; height: 36px; margin: -5px -6px 0 0; padding: 0; border-radius: 50%; color: var(--tx-2); background: none; }
.ft-gear svg { width: 22px; height: 22px; stroke-width: 1.7; }
.ft-gear[aria-expanded="true"] { color: var(--tx); background: rgba(var(--ft-rgb), .14); }
.ft-pomo .focus-duration-grid { display: flex; flex-wrap: wrap; justify-content: center; max-width: none; margin: -6px 0 18px; padding: 0; border: 0; gap: 8px; }
.ft-pomo .focus-preset { min-width: 64px; font-variant-numeric: tabular-nums; }
.ft-state { display: flex; align-items: center; gap: 8px; margin: 0 0 16px; font-size: 12.5px; font-weight: 500; color: var(--tx-2); }
.ft-state i { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.ft-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.ft-pill {
  display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 6px 24px 6px 6px;
  border: 0; border-radius: 999px; cursor: pointer;
  background: var(--blue-grad, var(--accent)); color: var(--ft-on);
  font: inherit; font-size: 16px; font-weight: 650; letter-spacing: -.005em;
  box-shadow: 0 8px 22px rgba(var(--p-act, 47, 93, 242), .34), inset 0 1px 0 rgba(255, 255, 255, .3);
  transition: scale .15s ease;
}
.ft-pill:not(:has(.ft-pill-ico)) { padding-inline: 26px; }
.ft-pill:active { scale: .96; }
.ft-pill-ico { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: color-mix(in srgb, var(--ft-on) 18%, transparent); }
.ft-pill-ico svg { width: 17px; height: 17px; }
.ft-ghost {
  min-height: 44px; padding: 0 18px; border-radius: 999px; cursor: pointer;
  border: 1px solid rgba(var(--ft-rgb), .3); background: rgba(var(--ft-rgb), .08);
  color: var(--tx-2); font: inherit; font-size: 14px; font-weight: 600;
}
[data-theme="light"] .ft-ghost { border-color: rgba(17, 17, 17, .16); background: rgba(255, 255, 255, .5); }
.ft-done-word { font-size: 24px; font-weight: 600; letter-spacing: -.02em; }
.ft-done-ico { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--accent); color: var(--on-accent, #1d0e05); }
.ft-done-ico svg { width: 22px; height: 22px; }

/* ---------- current task ---------- */
.ft-title {
  margin: 12px 0 14px; font-size: 22px; font-weight: 700; letter-spacing: -.02em; line-height: 1.14; text-wrap: balance;
  overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; line-clamp: 4; overflow: hidden;
}
.ft-check {
  display: grid; place-items: center; width: 44px; height: 44px; margin-top: auto; padding: 0; border-radius: 50%; cursor: pointer;
  border: 1.5px solid var(--ft-ctl-line); background: var(--ft-ctl); color: var(--on-accent, #1d0e05);
  transition: background .2s ease, border-color .2s ease;
}
.ft-check svg { width: 20px; height: 20px; opacity: 0; scale: .5; transition: opacity .15s ease, scale .25s cubic-bezier(.3, 1.5, .5, 1); }
.ft-check.on { background: var(--accent); border-color: transparent; }
.ft-check.on svg { opacity: 1; scale: 1; }

/* ---------- breaks ---------- */
.ft-break { justify-content: space-between; overflow: hidden; }
.ft-break .ft-ico svg { width: 28px; height: 28px; }
.ft-break.is-running {
  box-shadow: 0 12px 30px var(--ft-shadow), 0 0 0 1px color-mix(in srgb, var(--accent) 60%, transparent), 0 0 28px color-mix(in srgb, var(--accent) 26%, transparent), inset 0 0 28px rgba(var(--ft-rgb), .09);
}
.ft-break.is-running .ft-ico { color: var(--accent); }
.ft-break.is-running .ft-ico svg { width: 22px; height: 22px; }
.ft-meter { position: absolute; left: 16px; right: 16px; bottom: 9px; height: 3px; border-radius: 3px; background: rgba(var(--ft-rgb), .2); overflow: hidden; }
.ft-meter i { display: block; width: var(--p, 0%); height: 100%; border-radius: inherit; background: var(--accent); transition: width 1s linear; }

/* ---------- focus sounds ---------- */
.ft-name { align-self: flex-start; max-width: 100%; margin-top: 4px; padding: 2px 0; background: none; border: 0; font-size: 24px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; text-align: left; text-wrap: balance; cursor: pointer; }
.ft-sound-row { display: flex; align-items: center; gap: 10px; margin-top: auto; padding-top: 8px; }
.ft-round {
  flex: none; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border-radius: 50%; cursor: pointer;
  border: 1px solid var(--ft-ctl-line); background: var(--ft-ctl); color: var(--tx);
  transition: box-shadow .25s ease, scale .15s ease;
}
.ft-round:active { scale: .92; }
.ft-round svg { width: 19px; height: 19px; }
.ft-sound.is-playing .ft-round { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); }
.ft-wave { flex: 1; min-width: 0; height: 36px; display: flex; align-items: center; justify-content: space-between; overflow: hidden; }
.ft-wave i { flex: none; width: 3px; height: 100%; border-radius: 3px; background: var(--tx); opacity: .4; scale: 1 var(--h); }
.ft-sound.is-playing .ft-wave i { opacity: .9; animation: ftWave .9s ease-in-out infinite alternate; animation-delay: calc(var(--i) * -.11s); }
@keyframes ftWave { from { scale: 1 calc(var(--h) * .3); } to { scale: 1 min(1, calc(var(--h) + .3)); } }

/* ---------- app blocker ---------- */
.ft-block .ft-value { margin-top: 2px; font-size: 28px; }
.ft-switch {
  position: relative; flex: none; align-self: flex-end; width: 54px; height: 30px; margin-top: auto; padding: 0; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--ft-ctl-line); background: var(--ft-ctl);
  transition: background .25s ease, border-color .25s ease;
}
.ft-switch i { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .35); translate: 0 0; transition: translate .25s cubic-bezier(.3, 1.3, .5, 1); }
.ft-switch.on { background: var(--blue-grad, var(--accent)); border-color: transparent; }
.ft-switch.on i { translate: 24px 0; background: var(--ft-on); }
.ft-switch:disabled { opacity: .55; cursor: default; }
.ft-block.is-on .ft-ico { color: var(--accent); }

/* ---------- tasks and notes ---------- */
.ft-tasks .ft-row .ft-ico:first-child svg { width: 26px; height: 26px; }
.ft-note .ft-value { margin-top: 2px; }
.ft-plus { display: grid; place-items: center; width: 40px; height: 40px; margin-top: auto; border-radius: 50%; border: 1px solid var(--ft-ctl-line); background: var(--ft-ctl); color: var(--tx); }
.ft-plus svg { width: 20px; height: 20px; }

/* ---------- today and goal ---------- */
.ft-today-min { margin-top: auto; font-size: 30px; font-weight: 600; }
.ft-goal .ft-value { margin-top: 2px; }
.ft-squares { display: flex; gap: 8px; margin-top: auto; }
.ft-squares i { flex: 1 1 0; max-width: 26px; aspect-ratio: 1; border-radius: 7px; border: 1.5px solid var(--ft-ctl-line); }
.ft-squares i.on { background: var(--accent); border-color: transparent; box-shadow: 0 0 14px color-mix(in srgb, var(--accent) 45%, transparent); }

/* ---------- meditation ---------- */
.ft-med { gap: 12px; }
.ft-sits { display: flex; flex-wrap: wrap; gap: 8px; }
.ft-sit {
  display: inline-flex; align-items: center; justify-content: center; gap: 3px; min-height: 44px; padding: 0 20px; border-radius: 999px; cursor: pointer;
  border: 1px solid rgba(var(--ft-rgb), .3); background: rgba(var(--ft-rgb), .08); color: var(--tx); font: inherit;
}
[data-theme="light"] .ft-sit { border-color: rgba(17, 17, 17, .16); background: rgba(255, 255, 255, .5); }
.ft-sit b { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ft-sit em { font-size: 12.5px; font-style: normal; color: var(--tx-2); }
.ft-sit-guide { font-size: 14px; font-weight: 600; color: var(--tx-2); }

/* ---------- blocked apps and sites ---------- */
.focus-page .ft-shield.focus-protection-details { gap: 12px; padding: 16px; animation: none; }
.ft-x { display: grid; place-items: center; width: 32px; height: 32px; margin: -3px -4px 0 0; padding: 0; border-radius: 50%; color: var(--tx-2); background: none; cursor: pointer; }
.ft-x svg { width: 16px; height: 16px; }
.ft-shield .focus-native-line { padding-bottom: 0; }
.ft-shield .focus-native-line + .focus-native-line { padding-top: 12px; }
.ft-shield .focus-detail-head { margin: 4px 0 0; padding-top: 14px; border-top-color: rgba(var(--ft-rgb), .2); }
.ft-shield .focus-allday-control { margin-top: 4px; border-top-color: rgba(var(--ft-rgb), .2); }

/* ---------- this week ---------- */
.focus-page .focus-more {
  margin-top: 14px; border: 1px solid rgba(var(--ft-rgb), .18); border-radius: 24px; overflow: hidden;
  background: linear-gradient(160deg, var(--ft-fill-a), var(--ft-fill-b));
}
.focus-page .focus-more > summary { min-height: 56px; padding: 10px 18px; font-size: 14px; font-weight: 650; letter-spacing: .02em; color: var(--tx-2); }
.focus-page .focus-more > .focus-week-section { margin: 0; padding: 0 18px 18px; border: 0; background: none; }

/* ---------- small phones ---------- */
@media (max-width: 350px) {
  .focus-grid { gap: 10px; }
  .ft { padding: 14px; border-radius: 22px; }
  .ft-value { font-size: 22px; }
  .ft-value-sm { font-size: 17px; }
  .ft-block .ft-value { font-size: 24px; }
  .ft-title { font-size: 19px; }
  .ft-name { font-size: 21px; }
  .ft-meter { left: 14px; right: 14px; }
  .ft-pomo { padding: 16px 16px 18px; }
}

/* ---------- motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .focus-page .ft, .focus-page .ft *, .focus-page .ft::before { animation: none !important; transition: none !important; }
}
[data-motion="reduced"] .focus-page .ft, [data-motion="reduced"] .focus-page .ft *, [data-motion="reduced"] .focus-page .ft::before { animation: none !important; transition: none !important; }

/* Device matrix 2026-10-19, touch targets: the gear (36px), the sound name (30px tall) and the blocker switch (30px tall) get an invisible halo; nothing moves. */
.ft-gear { position: relative; }
.ft-gear::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; }
.ft-name::after { content: ''; position: absolute; inset: -8px -4px; }
.ft-switch::after { content: ''; position: absolute; inset: -8px -4px; border-radius: 999px; }

/* ---------- on Ember's warm ground (v278): warm glass, warm light behind it, warm actions ---------- */
:root[data-skin="ember"]:not([data-palette]) .focus-page {
  --ft-rgb: 255, 214, 196;
  --ft-b1: rgba(124, 62, 214, .4); --ft-b2: color-mix(in srgb, var(--accent) 50%, transparent); --ft-b3: rgba(255, 178, 122, .3);
  --ft-d0: #ffd2b0; --ft-d1: #ff8a3d; --ft-d2: #e2452b; --ft-glow: rgba(255, 106, 26, .5);
}
:root[data-skin="ember"]:not([data-palette]) .focus-page .ft-pill { background: radial-gradient(120% 120% at 30% 20%, #ffb27a, var(--accent) 58%); color: #1d0e05; box-shadow: 0 10px 24px -8px color-mix(in srgb, var(--accent) 75%, transparent), inset 0 1px 0 rgba(255, 255, 255, .35); }
:root[data-skin="ember"]:not([data-palette]) .focus-page .ft-pill-ico { background: rgba(29, 14, 5, .14); }
:root[data-skin="ember"]:not([data-palette]) .focus-page .ft-switch.on { background: radial-gradient(120% 120% at 30% 20%, #ffb27a, var(--accent) 58%); }
