/* =============================================================================
   Time Being Timer — embedded from the standalone timer-demo.html.
   All classes are namespaced `ft-*` and IDs `#ft-*` so they don't collide with
   site styles. Color tokens are scoped to the timer's elements only.
   ============================================================================= */

#ft-widget, #ft-overlay {
  --color-primary: #395D7F;
  --color-accent: #88BC86;
  --color-bg: #ffffff;
  --color-card: #ffffff;
  --color-border: #e2e8f0;
  --color-text: #1e293b;
  --color-text-muted: #64748b;
  --color-text-secondary: #475569;
  --color-surface: #f8fafc;
}

/* ── Timer Widget ─────────────────────────────────────────────────────────
   Nested inside .hero__floater (which is itself fixed in the viewport). The
   widget anchors to the bottom-right of the floater so the FAB sits exactly
   where the old pink placeholder used to live. */
#ft-widget {
  position: absolute;
  bottom: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.ft-fab {
  width: 60px;
  height: 75px;
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
  flex-shrink: 0;
}
.ft-fab svg { width: 100%; height: 100%; overflow: visible; }
.ft-fab:hover:not(.ft-fab-running) .ft-fab-glow { fill: #E9EDF1; }

.ft-fab-top {
  transition: transform .35s cubic-bezier(.34,1.56,.64,1);
  transform-origin: 25px 12px;
}
.ft-fab-face {
  fill: var(--color-primary);
  stroke: var(--color-primary);
  stroke-width: 6;
  transition: stroke-width .35s ease, r .35s ease;
}
.ft-fab-glow {
  fill: white;
  opacity: 1;
  transition: fill .2s ease, opacity .3s ease, r .35s ease;
  pointer-events: none;
}
.ft-fab-hands line {
  transition: opacity .3s ease, transform .35s ease;
  transform-origin: 25px 40px;
}
.ft-fab-text {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 500;
  fill: white;
  text-anchor: middle;
  dominant-baseline: central;
  font-size: 18px;
  letter-spacing: 0.5px;
  opacity: 0;
  transition: opacity .25s ease;
  pointer-events: none;
}
.ft-fab-text.size-medium { font-size: 14px; letter-spacing: 0.3px; }
.ft-fab-text.size-long   { font-size: 12px; letter-spacing: 0.2px; }

.ft-fab.ft-fab-running .ft-fab-top { transform: translateY(5px); }
.ft-fab.ft-fab-running .ft-fab-hand-hour { transform: rotate(210deg); }
.ft-fab.ft-fab-running .ft-fab-hand-minute { transform: rotate(150deg); }
.ft-fab.ft-fab-running .ft-fab-hands line { opacity: 0; transition-delay: .08s; }
.ft-fab.ft-fab-running .ft-fab-face { stroke-width: 2; r: 24; transition-delay: .08s; }
.ft-fab.ft-fab-running .ft-fab-glow { opacity: 0; r: 24; transition-delay: .1s; }
.ft-fab.ft-fab-running .ft-fab-text { opacity: 1; transition-delay: .22s; }

.ft-fab-ping {
  fill: none;
  stroke: var(--color-accent);
  stroke-width: 3;
  r: 22.5;
  opacity: 0;
  pointer-events: none;
}
@keyframes ft-ping-out {
  0%   { r: 24; stroke-width: 3; opacity: .6; }
  50%  { r: 34; stroke-width: 1.5; opacity: .3; }
  100% { r: 40; stroke-width: 0.5; opacity: 0; }
}
@keyframes ft-ping-out-2 {
  0%   { r: 24; stroke-width: 2; opacity: .35; }
  60%  { r: 32; stroke-width: 1; opacity: .15; }
  100% { r: 38; stroke-width: 0.5; opacity: 0; }
}
.ft-fab.ft-fab-running .ft-fab-ping-1 { animation: ft-ping-out .5s ease-out .35s forwards; }
.ft-fab.ft-fab-running .ft-fab-ping-2 { animation: ft-ping-out-2 .6s ease-out .43s forwards; }

.ft-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,.8);
  z-index: 999;
  opacity: 1;
  transition: opacity .2s ease;
}
.ft-overlay.ft-hidden {
  display: block !important;
  opacity: 0;
  pointer-events: none;
}

.ft-popup {
  position: absolute;
  bottom: calc(100% + 10px);
  right: 0;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 20px;
  width: max-content; min-width: 320px;
  box-shadow: 0 4px 16px rgba(0,0,0,.09);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* On phone widths the popup escapes the floater and spans the viewport
   (minus the site's 20px gutter) so the timer UI has real breathing room.
   `position: fixed` works here because the floater's scale transform was
   removed on phone — no transformed ancestor to capture the fixed anchor. */
@media (max-width: 720px) {
  .ft-popup {
    position: fixed;
    left: 20px;
    right: 20px;
    bottom: 140px;        /* clears the (now-larger) FAB with breathing room */
    width: auto;
    max-width: none;
    min-width: 0;
    max-height: calc(100svh - 160px);
    overflow-y: auto;
    padding: 24px;
    gap: 18px;
  }
}

/* FAB is 25% larger on phone — natural 60×75 → 75×94. */
@media (max-width: 720px) {
  .ft-fab {
    width: 75px;
    height: 94px;
  }
}
.ft-project-wrap { position: relative; }
.ft-proj-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,.1);
  max-height: 220px;
  overflow-y: auto;
  z-index: 1200;
}
.ft-proj-item {
  padding: 8px 12px;
  font-size: 13px;
  color: var(--color-text);
  cursor: pointer;
  border-bottom: 1px solid var(--color-border);
  outline: none;
  transition: background .1s;
}
.ft-proj-item:last-child { border-bottom: none; }
.ft-proj-item:hover,
.ft-proj-item:focus { background: color-mix(in srgb, var(--color-accent) 8%, var(--color-card)); }

.ft-popup-actions { display: flex; flex-direction: column; gap: 8px; }
.ft-popup-actions-row { display: flex; gap: 8px; }
.ft-stop-btn {
  width: 100%;
  padding: 12px 0;
  border: none;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  background: #ef4444;
  color: #fff;
  transition: background .12s;
}
.ft-stop-btn:hover { background: #dc2626; }
.ft-stop-btn:disabled { opacity: 0.4; cursor: not-allowed; background: #ef4444; }
.ft-cancel-btn {
  flex: 1;
  padding: 12px 0;
  border: none;
  border-radius: 50px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  background: #1e293b;
  color: #fff;
  transition: background .12s;
}
.ft-cancel-btn:hover { background: #0f172a; }
.ft-split-btn {
  flex: 1;
  padding: 12px 0;
  border: 1.5px solid var(--color-border);
  border-radius: 50px;
  font-size: 13px;
  font-weight: 700;
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: color .12s, border-color .12s, opacity .12s;
}
.ft-split-btn:disabled { opacity: 0.35; cursor: default; pointer-events: none; }
.ft-split-btn:not(:disabled):hover { color: var(--color-text); border-color: var(--color-text-muted); }

.ft-hidden { display: none !important; }

.ft-divider { border: none; border-top: 1px solid var(--color-border); margin: 4px 0; }
.ft-popup-current { display: flex; flex-direction: column; gap: 8px; }
.ft-laps { display: flex; flex-direction: column; gap: 6px; padding-bottom: 4px; }
.ft-laps-list { display: flex; flex-direction: column; gap: 8px; }

.ft-lap-row {
  background: var(--color-bg); border: 1px solid var(--color-border);
  border-left-width: 3px;
  border-radius: 6px; padding: 8px 10px; font-size: 13px;
}
.ft-lap-view { display: flex; align-items: center; gap: 8px; }
.ft-lap-text { flex: 1; min-width: 0; overflow: hidden; }
.ft-lap-ticker { display: block; white-space: nowrap; }
.ft-lap-text:hover .ft-lap-ticker { animation: ft-ticker 4s linear infinite; }
@keyframes ft-ticker {
  0%   { transform: translateX(0); }
  40%  { transform: translateX(var(--ticker-dist, 0px)); }
  60%  { transform: translateX(var(--ticker-dist, 0px)); }
  100% { transform: translateX(0); }
}
.ft-lap-time {
  font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums;
  color: var(--color-text); flex-shrink: 0;
}
.ft-lap-edit-btn {
  background: none; border: none; cursor: pointer; padding: 2px 4px;
  color: var(--color-text-muted); font-size: 13px; flex-shrink: 0;
  transition: color .12s;
}
.ft-lap-edit-btn:hover { color: var(--color-text); }
.ft-lap-edit { display: flex; align-items: center; gap: 8px; }
.ft-lap-edit-fields { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ft-lap-done-btn {
  flex-shrink: 0; background: var(--color-accent); color: #fff;
  border: none; border-radius: 6px; padding: 5px 10px;
  font-size: 11px; font-weight: 600; cursor: pointer; transition: opacity .12s;
}
.ft-lap-done-btn:hover { opacity: .85; }
.ft-sel {
  width: 100%;
  min-width: 240px;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 13px;
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  color: var(--color-text);
  cursor: pointer;
}

.ft-success {
  text-align: center; padding: 10px 0 2px; font-size: 13px;
  font-weight: 600; color: #22a861;
}

.ft-section-label {
  font-size: 10px; font-weight: 700; letter-spacing: .08em;
  color: var(--color-text-muted); text-transform: uppercase;
}
.ft-current-heading { font-size: 13px; font-weight: 700; color: var(--color-text); }
.ft-session-header { display: flex; flex-direction: column; gap: 6px; }
.ft-session-meta { display: flex; flex-direction: column; gap: 4px; }
.ft-session-time {
  font-size: 32px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  color: var(--color-text);
  line-height: 1;
}
.ft-splits-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.ft-splits-total {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-secondary);
  font-variant-numeric: tabular-nums;
}

.ft-assignment-row {
  border: 1px solid var(--color-border);
  border-radius: 8px;
}
.ft-assignment-display {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.12s;
}
.ft-assignment-display:hover { background: var(--color-surface); }
.ft-assignment-icon { color: var(--color-text-muted); flex-shrink: 0; }
.ft-assignment-info { flex: 1; min-width: 0; display: flex; align-items: center; }
.ft-assignment-value {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ft-assignment-check { flex-shrink: 0; }
.ft-assignment-input {
  padding: 8px 10px;
  border-top: 1px solid var(--color-border);
  border-radius: 0 0 8px 8px;
  background: var(--color-surface);
}
.ft-assignment-field {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: 13px;
  background: var(--color-bg);
  color: var(--color-text);
}
