/* Focus with Wobu: one screen. Colours and type match withwobu.com:
   dark ground, soft green accent, orange cat, serif headline. */
:root {
  --ground: #0B0D0C;
  --panel: #141716;
  --line: #232826;
  --text: #F2F0EA;
  --muted: #A3ABA6;
  --accent: #B9D4B0;
  --cat: #E8A161;
  --serif: ui-serif, "New York", "Iowan Old Style", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --spring: cubic-bezier(0.2, 1.4, 0.4, 1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--ground);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

.view {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 460px;
  margin: 0 auto;
  padding: env(safe-area-inset-top) 20px calc(16px + env(safe-area-inset-bottom));
}
.top { display: flex; align-items: center; justify-content: center; min-height: 56px; }
.mark { font-family: var(--serif); font-size: 19px; white-space: nowrap; }
.mark i { font-style: normal; color: var(--muted); }

h1 {
  margin: clamp(4px, 3vh, 28px) 0 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(27px, 7.4vw, 38px);
  line-height: 1.08;
  letter-spacing: -0.015em;
  text-align: center;
  text-wrap: balance;
}
h1 em { display: block; font-style: normal; color: var(--accent); }

/* ---------- Wobu, sitting on the card ---------- */
.desk { width: 100%; margin-top: clamp(40px, 9vh, 84px); }
.cat { position: relative; width: 132px; margin: 0 auto -1px; }
#wobu { display: block; width: 132px; height: auto; overflow: visible; transform-origin: 50% 100%; }
.ear { transform-box: fill-box; transform-origin: 50% 100%; }
.ear.right { animation: twitch 11s 3s infinite; }
@keyframes twitch { 0%, 96%, 100% { transform: rotate(0); } 98% { transform: rotate(9deg); } }
.eyes { transform-box: fill-box; transform-origin: 50% 50%; animation: blink 7s infinite; transition: opacity 0.6s; }
@keyframes blink { 0%, 95%, 100% { transform: scaleY(1); } 97.5% { transform: scaleY(0.08); } }
.lids { opacity: 0; transition: opacity 0.6s; }
/* He keeps watch when the sound starts. After a few minutes he dozes: eyes closed,
   breathing slowly. */
.is-dozing .eyes { opacity: 0; }
.is-dozing .lids { opacity: 1; }
.is-dozing #wobu { animation: breathe 6s ease-in-out infinite; }
/* For screenshots: no fades in progress. */
.still * { transition: none !important; }
@keyframes breathe { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(1.035); } }

.bubble {
  position: absolute;
  left: calc(100% - 6px);
  bottom: 62px;
  margin: 0;
  padding: 7px 13px;
  border-radius: 16px 16px 16px 4px;
  background: var(--text);
  color: var(--ground);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
  transform-origin: 0 100%;
  transition: opacity 0.4s, transform 0.4s var(--spring);
}
.bubble.gone { opacity: 0; transform: scale(0.7); }

/* ---------- The card ---------- */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 30px 18px 18px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--panel);
}

.play {
  display: grid;
  place-items: center;
  width: 104px;
  height: 104px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  transition: transform 0.25s var(--spring), background 0.3s, box-shadow 0.6s;
}
.play:active { transform: scale(0.94); }
.play svg { width: 48px; height: 48px; fill: var(--ground); }
.icon-pause { display: none; }
.is-playing .icon-pause { display: block; }
.is-playing .icon-play { display: none; }
.is-playing .play { box-shadow: 0 0 0 10px rgba(185, 212, 176, 0.09), 0 0 0 22px rgba(185, 212, 176, 0.045); }

/* The one dial: the tone of the noise, deep on the left, bright on the right. */
.tone { width: 100%; margin-top: 26px; --thumb: 26px; }
.tone input, .volume input {
  width: 100%;
  margin: 0;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
}
.tone input { display: block; height: 44px; }
.tone input::-webkit-slider-runnable-track { height: 8px; border-radius: 4px; background: linear-gradient(90deg, #6B4A33, #B98A5E 25%, #D9A9A0 62.5%, #F2F0EA); }
.tone input::-moz-range-track { height: 8px; border-radius: 4px; background: linear-gradient(90deg, #6B4A33, #B98A5E 25%, #D9A9A0 62.5%, #F2F0EA); }
.tone input::-webkit-slider-thumb { -webkit-appearance: none; width: var(--thumb); height: var(--thumb); margin-top: -9px; border: 3px solid var(--panel); border-radius: 50%; background: var(--text); box-shadow: 0 0 0 1px var(--line); }
.tone input::-moz-range-thumb { width: 20px; height: 20px; border: 3px solid var(--panel); border-radius: 50%; background: var(--text); }
.stops { position: relative; height: 40px; }
.stop {
  position: absolute;
  top: 0;
  left: calc(var(--thumb) / 2 + (100% - var(--thumb)) * var(--at));
  transform: translateX(-50%);
  height: 40px;
  padding: 0 8px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  transition: color 0.2s;
}
.stop:first-child { left: 0; padding-left: 2px; transform: none; }
.stop:last-child { left: auto; right: 0; padding-right: 2px; transform: none; }
.stop.on { color: var(--text); }

.about { margin: 8px 0 0; min-height: 1.5em; font-size: 14px; color: var(--muted); text-align: center; }

.row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.timer {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: none;
  min-width: 112px;
  height: 44px;
  padding: 0 14px 0 11px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: transparent;
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.timer.on { border-color: var(--accent); color: var(--accent); }
.timer svg, .volume svg { flex: none; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.volume { display: flex; align-items: center; gap: 9px; flex: 1; min-width: 0; color: var(--muted); }
.volume input { flex: 1; min-width: 0; height: 40px; }
.volume input::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: var(--line); }
.volume input::-moz-range-track { height: 4px; border-radius: 2px; background: var(--line); }
.volume input::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; margin-top: -7px; border-radius: 50%; background: var(--text); }
.volume input::-moz-range-thumb { width: 18px; height: 18px; border: 0; border-radius: 50%; background: var(--text); }

.hint { margin: 14px 0 0; text-align: center; font-size: 13px; color: var(--muted); }
.problem { margin: 8px 0 0; text-align: center; font-size: 13px; color: #E0705A; }

/* ---------- Below the first screen: what this is, in plain words ---------- */
.why { width: 100%; margin-top: clamp(56px, 12vh, 110px); padding-top: 28px; border-top: 1px solid var(--line); color: var(--muted); font-size: 15px; }
.why h2 { margin: 22px 0 6px; font-family: var(--serif); font-weight: 400; font-size: 21px; color: var(--text); }
.why h2:first-child { margin-top: 0; }
.why p { margin: 0 0 10px; }
.door { margin-top: 28px !important; text-align: center; }
.door a { color: var(--accent); text-decoration: none; border-bottom: 1px solid rgba(185, 212, 176, 0.35); }

/* Narrow phones: the bubble moves above his head so it never runs off screen. */
@media (max-width: 430px) {
  .bubble { left: 50%; bottom: calc(100% + 8px); border-radius: 16px 16px 16px 16px; transform: translateX(-50%); transform-origin: 50% 100%; }
  .bubble.gone { transform: translateX(-50%) scale(0.7); }
  .desk { margin-top: clamp(60px, 10vh, 92px); }
}

/* Reduce Motion: he still closes his eyes, but nothing keeps moving. */
@media (prefers-reduced-motion: reduce) {
  .ear.right, .eyes, .is-dozing #wobu { animation: none; }
}
