/**
 * Odak modu simülasyonu (focus.js). Uygulamadaki "Odaklanma Modu"nun web karşılığı:
 * 6 ortam, süre seçimi, ışık çizgisi (wick), kilometre taşları, ortam sesi, bitiş ekranı.
 * Renkler uygulamanın FocusThemePalette değerleri.
 */

.ff {
  --bg: #1a140e;
  --ac: #e2c08d;
  position: relative;
  padding-block: clamp(64px, 10vw, 120px);
  background: var(--bg);
  color: #f4ece0;
  transition: background 0.9s ease;
  overflow: hidden;
}
.ff .od-kicker { color: var(--ac); transition: color 0.9s; }
.ff h2 { color: #fbf5ea; }
.ff .od-measure p { color: color-mix(in srgb, #f4ece0 74%, transparent); }

.ff-stage {
  position: relative;
  margin-top: 40px;
  min-height: clamp(560px, 78vh, 700px);
  border-radius: 40px;
  overflow: hidden;
  background: color-mix(in srgb, var(--bg) 70%, #000);
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.07);
  touch-action: pan-y;
  isolation: isolate;
}
.ff-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; transition: opacity 0.5s; }
.ff-stage.is-switching .ff-canvas { opacity: 0; }
.ff-shade { position: absolute; inset: 0; z-index: 1; pointer-events: none; background: radial-gradient(ellipse at 50% 45%, transparent 30%, rgba(0, 0, 0, 0.55) 100%); }

/* görünümler */
.ff-view {
  position: absolute;
  inset: 0 0 92px 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 24px 8px;
  text-align: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px) scale(0.985);
  transition: opacity 0.6s, transform 0.7s cubic-bezier(0.2, 0.9, 0.3, 1), visibility 0s 0.6s;
}
.ff-stage[data-view="setup"] .ff-setup,
.ff-stage[data-view="run"] .ff-run,
.ff-stage[data-view="done"] .ff-done { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }

.ff-title { font: 700 clamp(26px, 4vw, 38px)/1.1 var(--font-heading); margin: 0 0 6px; color: #fff8ec; }
.ff-sub { margin: 0 0 22px; font-size: 15px; color: color-mix(in srgb, #f4ece0 68%, transparent); }

.ff-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-bottom: 18px; }
.ff-chip {
  border: 1.5px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(8px);
  color: #f4ece0;
  border-radius: 999px;
  padding: 11px 20px;
  font: 700 16px/1 var(--font-body);
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.3, 1.6, 0.5, 1), background 0.25s, border-color 0.25s, color 0.25s;
}
.ff-chip:hover { transform: translateY(-2px); background: rgba(255, 255, 255, 0.13); }
.ff-chip[aria-checked="true"] { background: var(--ac); border-color: var(--ac); color: #1b130c; transform: scale(1.07); }

.ff-themes { display: flex; gap: 10px; margin-bottom: 20px; }
.ff-theme {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: #f4ece0;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.3, 1.6, 0.5, 1), background 0.25s, border-color 0.25s, color 0.25s;
}
.ff-theme svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ff-theme:hover { transform: translateY(-3px); }
.ff-theme[aria-checked="true"] { color: var(--ac); border-color: var(--ac); background: color-mix(in srgb, var(--ac) 16%, transparent); transform: scale(1.1); }

.ff-intent {
  width: min(360px, 100%);
  background: rgba(255, 255, 255, 0.07);
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  color: #fff8ec;
  border-radius: 16px;
  padding: 14px 18px;
  font: 500 16px/1.2 var(--font-body);
  text-align: center;
  margin-bottom: 20px;
}
.ff-intent::placeholder { color: rgba(244, 236, 224, 0.45); }
.ff-intent:focus { outline: 2px solid var(--ac); outline-offset: 2px; }

.ff-go {
  border: 0;
  cursor: pointer;
  background: var(--ac);
  color: #1b130c;
  font: 700 18px/1 var(--font-body);
  border-radius: 999px;
  padding: 17px 44px;
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--ac) 60%, transparent);
  animation: ff-pulse 2.6s infinite;
  transition: transform 0.25s cubic-bezier(0.3, 1.6, 0.5, 1);
}
.ff-go:hover { transform: scale(1.06); }
@keyframes ff-pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ac) 55%, transparent); } 70%, 100% { box-shadow: 0 0 0 22px transparent; } }
.ff-demo { margin-top: 14px; font-size: 12.5px; color: rgba(244, 236, 224, 0.5); }

/* çalışma */
.ff-intent-line { font-size: 15px; letter-spacing: 0.04em; color: color-mix(in srgb, var(--ac) 88%, #fff); margin: 0 0 8px; min-height: 1.4em; }
.ff-clock {
  font: 700 clamp(84px, 17vw, 168px)/1 var(--font-heading);
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
  color: #fff8ec;
  text-shadow: 0 0 60px color-mix(in srgb, var(--ac) 45%, transparent);
  margin: 0;
}
.ff-clock-label { font-size: 12px; letter-spacing: 0.22em; text-transform: uppercase; color: color-mix(in srgb, var(--ac) 80%, #fff); margin-top: 4px; }

.ff-wick { position: relative; width: min(560px, 88%); height: 46px; margin-top: 34px; }
.ff-wick__line { position: absolute; left: 0; right: 0; top: 10px; height: 2px; border-radius: 2px; background: rgba(255, 255, 255, 0.16); }
.ff-wick__fill { position: absolute; left: 0; top: 10px; height: 2px; width: calc(var(--p, 0) * 100%); border-radius: 2px; background: var(--ac); box-shadow: 0 0 14px var(--ac), 0 0 34px color-mix(in srgb, var(--ac) 60%, transparent); }
.ff-wick__head { position: absolute; left: calc(var(--p, 0) * 100%); top: 10px; width: 12px; height: 12px; margin: -5px 0 0 -6px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 5px color-mix(in srgb, var(--ac) 40%, transparent), 0 0 22px var(--ac); animation: ff-flame 1.6s ease-in-out infinite alternate; }
@keyframes ff-flame { from { transform: scale(0.85); } to { transform: scale(1.25); } }
.ff-tick { position: absolute; top: 5px; width: 1.5px; height: 12px; background: rgba(255, 255, 255, 0.28); transition: background 0.4s, box-shadow 0.4s; }
.ff-tick.is-lit { background: var(--ac); box-shadow: 0 0 10px var(--ac); }
.ff-tick span { position: absolute; top: 20px; left: 50%; transform: translateX(-50%); font-size: 11px; white-space: nowrap; color: rgba(244, 236, 224, 0.45); }
.ff-tick.is-lit span { color: var(--ac); }

.ff-actions { display: flex; gap: 12px; margin-top: 30px; }
.ff-ghost {
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
  color: #f4ece0;
  border-radius: 999px;
  padding: 12px 24px;
  font: 700 15px/1 var(--font-body);
  cursor: pointer;
  transition: background 0.2s, transform 0.25s cubic-bezier(0.3, 1.6, 0.5, 1);
}
.ff-ghost:hover { background: rgba(255, 255, 255, 0.14); transform: translateY(-2px); }

.ff-toast {
  position: absolute;
  z-index: 4;
  left: 50%;
  top: 5%;
  transform: translate(-50%, -14px);
  padding: 13px 26px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ac) 20%, rgba(10, 10, 10, 0.55));
  border: 1px solid color-mix(in srgb, var(--ac) 55%, transparent);
  backdrop-filter: blur(14px);
  color: #fff8ec;
  font: 600 16px/1.2 var(--font-body);
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  max-width: 92%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ff-toast.is-on { animation: ff-toast 4.2s cubic-bezier(0.2, 0.9, 0.3, 1) forwards; }
@keyframes ff-toast { 0% { opacity: 0; transform: translate(-50%, -14px) scale(0.94); } 8%, 82% { opacity: 1; transform: translate(-50%, 0) scale(1); } 100% { opacity: 0; transform: translate(-50%, -8px) scale(0.98); } }

/* bitiş */
.ff-ring { position: relative; width: 132px; height: 132px; margin-bottom: 16px; }
.ff-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ff-ring circle { fill: none; stroke-width: 6; stroke-linecap: round; }
.ff-ring .bg { stroke: rgba(255, 255, 255, 0.14); }
.ff-ring .fg { stroke: var(--ac); stroke-dasharray: 327; stroke-dashoffset: 327; filter: drop-shadow(0 0 8px var(--ac)); }
.ff-stage[data-view="done"] .ff-ring .fg { animation: ff-ring 1.6s 0.3s cubic-bezier(0.2, 0.9, 0.3, 1) forwards; }
@keyframes ff-ring { to { stroke-dashoffset: 0; } }
.ff-ring__check { position: absolute; inset: 0; display: grid; place-items: center; color: var(--ac); }
.ff-ring__check svg { width: 54px; height: 54px; transform: none; fill: none; stroke: currentColor; stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; }
.ff-stage[data-view="done"] .ff-ring__check svg { animation: fx-draw 0.7s 1.3s ease forwards; }
.ff-facts { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 4px 0 22px; }
.ff-fact { padding: 8px 15px; border-radius: 999px; font-size: 14px; background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.12); }
.ff-fact strong { color: var(--ac); }

/* dock */
.ff-dock {
  position: absolute;
  z-index: 3;
  left: 18px;
  right: 18px;
  bottom: 16px;
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  padding: 10px 20px;
  border-radius: 24px;
  background: rgba(10, 10, 10, 0.34);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(16px);
}
.ff-dock__name { display: grid; gap: 2px; text-align: left; min-width: 0; }
.ff-dock__name strong { font: 700 17px/1.1 var(--font-heading); color: #fff8ec; }
.ff-dock__name span { font-size: 13px; color: rgba(244, 236, 224, 0.6); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* yan oklar */
.ff-arrow {
  position: absolute;
  z-index: 3;
  top: calc(50% - 46px);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(10, 10, 10, 0.28);
  backdrop-filter: blur(8px);
  color: #f4ece0;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.2s, transform 0.25s cubic-bezier(0.3, 1.6, 0.5, 1);
}
.ff-arrow:hover { background: rgba(255, 255, 255, 0.16); }
.ff-arrow svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.ff-arrow--l { left: 16px; }
.ff-arrow--r { right: 16px; }
.ff-arrow--l:hover { transform: translateX(-3px); }
.ff-arrow--r:hover { transform: translateX(3px); }

.ff :focus-visible { outline: 2px solid var(--ac); outline-offset: 3px; }

@media (max-width: 720px) {
  .ff-stage { border-radius: 28px; min-height: 640px; }
  .ff-arrow { top: 16px; width: 40px; height: 40px; }
  .ff-arrow--l { left: 12px; }
  .ff-arrow--r { right: 12px; }
  .ff-view { padding-top: 64px; }
  .ff-dock { left: 10px; right: 10px; bottom: 10px; padding: 8px 10px 8px 14px; }
  .ff-dock__name span { display: none; }
  .ff-theme { width: 46px; height: 46px; border-radius: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  .ff-go, .ff-wick__head { animation: none; }
  .ff-toast.is-on { animation: none; opacity: 1; transform: translate(-50%, 0); }
  .ff-stage[data-view="done"] .ff-ring .fg { animation: none; stroke-dashoffset: 0; }
  .ff-stage[data-view="done"] .ff-ring__check svg { animation: none; stroke-dashoffset: 0; }
  .ff-view { transition: none; }
}
