/* Beautiful Timer */

:root {
  --bg: #0b0b0d;
  --text: #eceae4;
  --muted: #8e8b85;
  --faint: #7f7c76;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.15);
  --line-3: rgba(255, 255, 255, 0.3);
  --glass: rgba(14, 14, 17, 0.5);
  --accent: #f2b84b;

  --serif: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  --sans: Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;

  --panel-w: 460px;
  --gap: 18px;
  --ease: cubic-bezier(0.65, 0, 0.15, 1);
  --morph: 0.95s;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.run { overflow: hidden; }
a { color: inherit; }
button, input { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
svg { display: block; }
:focus { outline: none; }
:focus-visible { outline: 2px solid rgba(255, 255, 255, 0.7); outline-offset: 3px; }
.no-anim, .no-anim * { transition: none !important; }

/* The app fills the first screen; the About section scrolls below it. */
.app { position: relative; height: 100vh; height: 100dvh; min-height: 620px; }

/* ------------------------------------------------------------------ stage */

.stage {
  position: absolute;
  z-index: 1;
  top: var(--gap);
  right: var(--gap);
  bottom: var(--gap);
  left: var(--panel-w);
  border-radius: 22px;
  overflow: hidden;
  background: #141417;
  box-shadow: 0 0 0 1px var(--line);
  transition:
    top var(--morph) var(--ease),
    right var(--morph) var(--ease),
    bottom var(--morph) var(--ease),
    left var(--morph) var(--ease),
    height var(--morph) var(--ease),
    border-radius var(--morph) var(--ease);
}
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.run .stage { position: fixed; top: 0; right: 0; bottom: 0; left: 0; border-radius: 0; }

.stage-top { position: absolute; top: 16px; left: 16px; }
.stage-cap {
  position: absolute;
  left: 16px;
  bottom: 16px;
  max-width: min(420px, calc(100% - 32px));
  padding: 16px 18px 15px;
  border-radius: 16px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  backdrop-filter: blur(16px) saturate(150%);
  color: #fff;
}
.stage-cap h2 { font: 400 28px/1 var(--serif); letter-spacing: -0.01em; }
.stage-cap p { margin-top: 7px; font-size: 13.5px; line-height: 1.45; color: rgba(255, 255, 255, 0.74); }
.stage-top, .stage-cap { transition: opacity 0.4s, transform 0.6s var(--ease); }
.run .stage-top, .run .stage-cap { opacity: 0; transform: translateY(8px); pointer-events: none; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 10px;
  border-radius: 999px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  backdrop-filter: blur(14px) saturate(150%);
  color: #fff;
  font-size: 12px;
  letter-spacing: 0.02em;
}
.live { width: 6px; height: 6px; border-radius: 50%; background: #7bd389; animation: breathe 2.4s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: 0.35; } }

/* ------------------------------------------------------------------ panel */

.panel {
  position: absolute;
  z-index: 2;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--panel-w);
  padding: 34px 38px 0 40px;
  overflow-y: auto;
  scrollbar-width: none;
  display: flex;
  flex-direction: column;
  gap: 30px;
  transition: transform var(--morph) var(--ease), opacity 0.5s, visibility 0s;
}
.panel::-webkit-scrollbar { display: none; }
.run .panel {
  transform: translateX(-48px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: transform var(--morph) var(--ease), opacity 0.45s, visibility 0s var(--morph);
}

.brand-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 500; letter-spacing: 0.01em; color: var(--muted); text-decoration: none; }
.mark { width: 22px; height: 22px; color: var(--text); }
.about-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px 5px 12px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s, border-color 0.2s;
}
.about-link:hover { color: var(--text); border-color: var(--line-3); }
.about-link svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.kicker { margin-bottom: 10px; font-size: 11.5px; font-weight: 500; line-height: 1.4; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.title { font: 400 44px/1 var(--serif); letter-spacing: -0.015em; }

.dur {
  display: flex;
  align-items: flex-start;
  margin-top: 20px;
  padding: 16px 12px 12px;
  border: 1px solid var(--line-2);
  border-radius: 20px;
  transition: border-color 0.2s, background 0.2s;
}
.dur:focus-within { border-color: var(--line-3); background: rgba(255, 255, 255, 0.02); }
.unit { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: text; }
.unit input {
  width: 100%;
  padding: 2px 0 4px;
  background: none;
  border: 0;
  border-radius: 12px;
  outline: none;
  text-align: center;
  font: 400 60px/1 var(--serif);
  font-variant-numeric: tabular-nums;
  color: var(--text);
  caret-color: transparent;
  transition: background 0.2s, color 0.2s;
}
.unit input:focus { background: rgba(255, 255, 255, 0.07); color: #fff; }
.unit input::selection { background: rgba(255, 255, 255, 0.18); }
.unit span { font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--faint); }
.colon { font: 400 46px/1 var(--serif); color: var(--faint); padding-top: 8px; user-select: none; }

.presets { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin-top: 14px; }
.presets button {
  padding: 6px 0;
  white-space: nowrap;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  font-size: 12.5px;
  color: var(--muted);
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.presets button:hover { color: var(--text); border-color: var(--line-3); }
.presets button.on { background: var(--text); border-color: var(--text); color: var(--bg); }

.block-head { display: flex; align-items: baseline; justify-content: space-between; }
.label { font-size: 11.5px; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.label-val { font-size: 11.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--faint); }

.scenes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px 10px; margin-top: 14px; }
.tile { display: flex; flex-direction: column; gap: 7px; text-align: left; min-width: 0; }
.thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 10px;
  overflow: hidden;
  background: #17171a;
  box-shadow: 0 0 0 1px var(--line);
  transition: box-shadow 0.25s, transform 0.3s var(--ease);
}
.thumb canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.tile:hover .thumb { transform: translateY(-2px); box-shadow: 0 0 0 1px var(--line-3); }
.tile[aria-checked='true'] .thumb { box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px var(--text); }
.tile:focus-visible { outline: none; }
.tile:focus-visible .thumb { box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px var(--text), 0 0 0 7px rgba(255, 255, 255, 0.18); }
.tname { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color 0.2s; }
.tile:hover .tname, .tile[aria-checked='true'] .tname { color: var(--text); }

.foot {
  position: sticky;
  bottom: 0;
  margin-top: auto;
  padding: 4px 0 26px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--bg);
}
.foot::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  height: 28px;
  background: linear-gradient(to bottom, rgba(11, 11, 13, 0), var(--bg));
  pointer-events: none;
}

.switch { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--muted); cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track { position: relative; flex: none; width: 36px; height: 22px; border-radius: 999px; background: rgba(255, 255, 255, 0.13); transition: background 0.25s; }
.switch .track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--text);
  transition: transform 0.3s var(--ease), background 0.25s;
}
.switch input:checked + .track { background: var(--text); }
.switch input:checked + .track::after { transform: translateX(14px); background: var(--bg); }
.switch input:focus-visible + .track { outline: 2px solid rgba(255, 255, 255, 0.7); outline-offset: 3px; }

.begin {
  height: 56px;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font-size: 15.5px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background 0.2s, transform 0.25s var(--ease), opacity 0.2s;
}
.begin svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.3s var(--ease); }
.begin:hover { background: #fff; }
.begin:hover svg { transform: translateX(3px); }
.begin:active { transform: scale(0.99); }
.begin:disabled { opacity: 0.3; cursor: not-allowed; }
.begin:disabled svg { transform: none; }

.keys { font-size: 12px; color: var(--faint); text-align: center; }
kbd { font: 500 11px var(--sans); padding: 1px 6px; border: 1px solid var(--line-2); border-radius: 5px; color: var(--muted); }

/* -------------------------------------------------------------- run HUD */

.hud {
  position: fixed;
  z-index: 5;
  left: 50%;
  bottom: 28px;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 6px;
  border-radius: 999px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1), 0 24px 48px -24px rgba(0, 0, 0, 0.7);
  color: #fff;
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 14px);
  transition: opacity 0.45s, transform 0.5s var(--ease), visibility 0s 0.5s;
}
.run.hud-on:not(.show-done) .hud {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
  transition: opacity 0.35s, transform 0.5s var(--ease), visibility 0s;
}
.run.idle { cursor: none; }

.ib { width: 40px; height: 40px; flex: none; border-radius: 50%; display: grid; place-items: center; color: rgba(255, 255, 255, 0.9); transition: background 0.2s; }
.ib:hover { background: rgba(255, 255, 255, 0.13); }
.ib.sm { width: 32px; }
.ib svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ib svg .fill { fill: currentColor; stroke: none; }
.sep { width: 1px; height: 20px; margin: 0 6px; background: rgba(255, 255, 255, 0.15); }
.hud-name { min-width: 94px; padding: 0 2px; text-align: center; font: 400 21px/1 var(--serif); white-space: nowrap; }

.i-play, .i-bell-off, .i-fs-exit { display: none !important; }
.is-paused .i-pause, .muted .i-bell, .is-fs .i-fs-enter { display: none !important; }
.is-paused .i-play, .muted .i-bell-off, .is-fs .i-fs-exit { display: block !important; }
.no-fs [data-act='fullscreen'] { display: none; }

.paused-chip {
  position: fixed;
  z-index: 5;
  top: 24px;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 15px 8px 12px;
  border-radius: 999px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  backdrop-filter: blur(16px) saturate(160%);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 13px;
  opacity: 0;
  transform: translate(-50%, -10px);
  pointer-events: none;
  transition: opacity 0.4s, transform 0.5s var(--ease);
}
.paused-chip svg { width: 14px; height: 14px; fill: currentColor; animation: breathe 2.4s ease-in-out infinite; }
.run.is-paused .paused-chip { opacity: 1; transform: translate(-50%, 0); }

/* --------------------------------------------------------------- time's up */

.done-card {
  position: fixed;
  z-index: 6;
  left: 50%;
  bottom: 44px;
  width: max-content;
  max-width: calc(100% - 32px);
  padding: 22px 26px 24px;
  border-radius: 26px;
  background: rgba(14, 14, 17, 0.56);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  backdrop-filter: blur(24px) saturate(160%);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1), 0 30px 60px -30px rgba(0, 0, 0, 0.8);
  color: #fff;
  text-align: center;
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 24px);
  transition: opacity 0.5s, transform 0.7s var(--ease), visibility 0s 0.7s;
}
.run.show-done .done-card {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
  transition: opacity 0.9s, transform 1s var(--ease), visibility 0s;
}
.done-meta { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(255, 255, 255, 0.62); }
.glow { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px rgba(242, 184, 75, 0.2); }
.done-card h2 { margin: 10px 0 20px; font: 400 56px/1 var(--serif); letter-spacing: -0.015em; }
.done-actions { display: flex; justify-content: center; gap: 10px; }
/* After a few seconds the card settles into a slim pill so the ending stays visible. */
.done-card.swap { opacity: 0 !important; transition: opacity 0.4s !important; }
.done-card.compact { display: flex; align-items: center; gap: 18px; padding: 7px 7px 7px 22px; border-radius: 999px; }
.done-card.compact .done-meta { display: none; }
.done-card.compact h2 { margin: 0; font-size: 26px; }
.done-card.compact .btn { height: 38px; padding: 0 16px; }

.btn { height: 44px; padding: 0 20px; border-radius: 999px; display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; transition: background 0.2s, border-color 0.2s; }
.btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.btn-solid { background: #fff; color: #111; }
.btn-solid:hover { background: var(--text); }
.btn-ghost { border: 1px solid rgba(255, 255, 255, 0.28); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.1); }

/* ------------------------------------------------------------------ about */

.info { position: relative; background: var(--bg); border-top: 1px solid var(--line); }
.run .info { visibility: hidden; }
.info-inner { max-width: 1120px; margin: 0 auto; padding: 112px 48px 48px; display: flex; flex-direction: column; gap: 96px; }
.info h2 { font: 400 34px/1.08 var(--serif); letter-spacing: -0.015em; }
.info p { color: var(--muted); font-size: 16px; line-height: 1.65; }

.info-lead { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 72px; align-items: start; }
.eyebrow { grid-column: 1 / -1; font-size: 11.5px; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.info-lead h2 { font-size: clamp(40px, 5vw, 64px); line-height: 1; }
.lead-body { display: flex; flex-direction: column; gap: 18px; padding-top: 6px; }
.tips { list-style: none; display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.tips li { position: relative; padding-left: 22px; font-size: 15px; line-height: 1.55; color: var(--text); }
.tips li::before { content: ''; position: absolute; left: 2px; top: 0.55em; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.cta {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  padding: 11px 18px;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font-size: 14.5px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.2s;
}
.cta:hover { background: #fff; }
.cta svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

.info-block { display: grid; grid-template-columns: 300px 1fr; gap: 24px 72px; padding-top: 40px; border-top: 1px solid var(--line); }

.steps { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.steps li { font-size: 15px; line-height: 1.6; color: var(--muted); }
.steps strong { display: block; margin-bottom: 8px; font: 400 26px/1.1 var(--serif); color: var(--text); }

.scene-list { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px 32px; }
.scene-list h3 { display: flex; align-items: baseline; gap: 10px; font: 400 24px/1.1 var(--serif); }
.scene-list h3 span { font: 500 10px/1 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); }
.scene-list p { margin-top: 6px; font-size: 14.5px; line-height: 1.55; }

.why > div { display: flex; flex-direction: column; gap: 16px; max-width: 660px; }

.faq-list details { border-bottom: 1px solid var(--line); }
.faq-list details:first-child { border-top: 1px solid var(--line); }
.faq-list summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 0;
  list-style: none;
  cursor: pointer;
  font: 400 22px/1.25 var(--serif);
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { content: '+'; flex: none; font: 300 26px/1 var(--sans); color: var(--muted); transition: transform 0.3s var(--ease); }
.faq-list details[open] summary::after { transform: rotate(45deg); }
.faq-list details p { max-width: 660px; padding-bottom: 22px; font-size: 15.5px; }

.link-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 32px 48px; }
.link-cols h3 { margin-bottom: 14px; font-size: 11.5px; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.link-cols ul { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.link-cols a, .link-cols .here {
  display: inline-block;
  padding: 7px 13px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  font-size: 13.5px;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s, border-color 0.2s;
}
.link-cols a:hover { color: var(--text); border-color: var(--line-3); }
.link-cols .here { background: var(--text); border-color: var(--text); color: var(--bg); }

.site-foot {
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px 48px 56px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  font-size: 13px;
  color: var(--faint);
}
.site-foot a { color: var(--muted); }

/* ---------------------------------------------------------------- small */

@media (max-width: 960px) {
  .info-lead, .info-block { grid-template-columns: 1fr; }
  .scene-list { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
  :root { --gap: 12px; --panel-w: 100%; }
  .stage {
    left: var(--gap);
    bottom: auto;
    height: calc(38vh - var(--gap));
    height: calc(38dvh - var(--gap));
    border-radius: 18px;
  }
  .run .stage { height: 100vh; height: 100dvh; }
  .stage-cap { padding: 12px 14px; }
  .stage-cap h2 { font-size: 22px; }
  .stage-cap p { display: none; }
  .panel {
    top: 38vh;
    top: 38dvh;
    width: auto;
    right: 0;
    padding: 20px max(20px, calc((100% - 600px) / 2)) 0;
    gap: 24px;
  }
  .scenes { grid-template-columns: repeat(6, 1fr); }
  .run .panel { transform: translateY(40px); }
  .title { font-size: 34px; }
  .unit input { font-size: 46px; }
  .colon { font-size: 36px; padding-top: 6px; }
  .hud { bottom: max(16px, env(safe-area-inset-bottom)); }
  .done-card { bottom: max(24px, env(safe-area-inset-bottom)); }
  .done-card h2 { font-size: 44px; }
  .info-inner { padding: 72px 20px 32px; gap: 72px; }
  .steps { grid-template-columns: 1fr; gap: 22px; }
  .site-foot { padding: 24px 20px 48px; }
}

@media (max-width: 560px) {
  .scenes { grid-template-columns: repeat(4, 1fr); }
  .scene-list, .link-cols { grid-template-columns: 1fr; }
}

@media (hover: none) {
  .keys { display: none; }
}

@media (max-width: 420px) {
  .ib { width: 36px; height: 36px; }
  .ib.sm { width: 28px; }
  .sep { margin: 0 2px; }
  .hud-name { min-width: 72px; font-size: 18px; }
  .hud [data-act='sound'] { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  :root { --morph: 0.01s; }
  html { scroll-behavior: auto; }
}
