/* Neverloop on the web: the app's look (its tokens, serif titles, amber for
   the one action), a player on top and plain reading below. */
:root {
  --bg: #121018;
  --bg-2: #1c1726;
  --text: #ece6f2;
  --muted: #9a90a8;
  --faint: #6f6780;
  --accent: #f2b36b;
  --line: #2c2538;
  --card: rgba(255, 255, 255, 0.035);
  --glow-a: rgba(120, 104, 220, 0.28);
  --glow-b: rgba(242, 179, 107, 0.16);
  color-scheme: dark;
}
body[data-scene="lofi-desk"] { --glow-a: rgba(242, 165, 94, 0.26); --glow-b: rgba(196, 111, 85, 0.18); }

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  color: var(--text);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, sans-serif;
  -webkit-font-smoothing: antialiased;
  background: linear-gradient(160deg, var(--bg), var(--bg-2)) fixed;
}

/* Living light: two slow glows behind the player, brighter while music plays. */
.light { position: fixed; inset: -20%; z-index: 0; pointer-events: none; opacity: 0.6; transition: opacity 2s; }
.playing .light { opacity: 1; }
.light::before, .light::after {
  content: "";
  position: absolute;
  width: 60vmax;
  height: 60vmax;
  border-radius: 50%;
  filter: blur(40px);
  transition: background 3s;
}
.light::before { left: 10%; top: 5%; background: radial-gradient(circle, var(--glow-a), transparent 65%); animation: drift-a 38s ease-in-out infinite alternate; }
.light::after { right: 5%; top: 25%; background: radial-gradient(circle, var(--glow-b), transparent 65%); animation: drift-b 46s ease-in-out infinite alternate; }
@keyframes drift-a { to { transform: translate(12vw, 8vh) scale(1.1); } }
@keyframes drift-b { to { transform: translate(-10vw, -6vh) scale(0.95); } }
@media (prefers-reduced-motion: reduce) { .light::before, .light::after { animation: none; } }

.wrap { position: relative; z-index: 1; max-width: 760px; margin: 0 auto; padding: 0 20px; }
a { color: var(--accent); }

/* Top: the name and the other pages. */
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 0 8px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font: 600 20px/1 ui-serif, Georgia, serif; }
.brand img { width: 28px; height: 28px; border-radius: 7px; }
.nav { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 14px; }
.nav a { color: var(--muted); text-decoration: none; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); }

/* The player. */
.player { padding: 44px 0 28px; }
.kicker { margin: 0; color: var(--muted); letter-spacing: 0.12em; text-transform: uppercase; font-size: 12px; }
.kicker .next { margin-left: 8px; color: var(--accent); }
h1, .title { margin: 10px 0 4px; font: 600 clamp(34px, 6vw, 52px)/1.1 ui-serif, Georgia, "Times New Roman", serif; letter-spacing: -0.015em; }
h1.kicker { margin: 0; font: 400 12px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; letter-spacing: 0.12em; }
#title { display: inline-block; }
.unsupported { margin: 14px 0 0; padding: 10px 14px; border: 1px solid rgba(242, 179, 107, 0.45); border-radius: 12px; color: var(--text); font-size: 14px; }
.meta { margin: 0; color: var(--muted); font-variant-numeric: tabular-nums; min-height: 1.6em; }
.lead { margin: 18px 0 0; color: var(--muted); max-width: 560px; }

.controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 26px 0 0; }
button {
  font: inherit;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 18px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.15s, box-shadow 0.2s, color 0.2s;
  touch-action: manipulation;
}
button:hover { border-color: var(--muted); }
button:active { transform: scale(0.97); }
button:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#play { min-width: 150px; padding: 14px 28px; font-size: 18px; font-weight: 600; background: var(--accent); border-color: var(--accent); color: #1b1410; }
#play:active { transform: scale(0.95); }
#play-label { display: inline-block; }
#play.loading { opacity: 0.7; }
.volume { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; margin-left: auto; }
input[type="range"] { accent-color: var(--accent); width: 140px; }

.row { margin: 22px 0 0; }
.row-label { display: block; margin-bottom: 8px; color: var(--muted); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pills button { padding: 8px 16px; font-size: 14px; color: var(--muted); }
.pills button[aria-pressed="true"] {
  color: var(--text);
  background: linear-gradient(180deg, rgba(242, 179, 107, 0.24), rgba(242, 179, 107, 0.1));
  border-color: rgba(242, 179, 107, 0.55);
}
.slider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 14px; }
.slider input { flex: 1; max-width: 320px; }
.check { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; cursor: pointer; }
.check input { accent-color: var(--accent); width: 18px; height: 18px; }

/* The timer ring (pomodoro page). */
.timer { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.ring { position: relative; width: 112px; height: 112px; display: grid; place-items: center; }
.ring svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 5; }
.ring .track { stroke: var(--line); }
.ring .fill { stroke: var(--accent); stroke-linecap: round; stroke-dasharray: 276.46; stroke-dashoffset: 276.46; transition: stroke-dashoffset 0.5s linear; }
.ring .time { font: 600 20px/1 ui-monospace, "SF Mono", Menlo, monospace; }
.ring .what { display: block; color: var(--muted); font-size: 10.5px; text-align: center; margin-top: 4px; max-width: 84px; }
.ring.settling .fill { animation: settle 2.4s ease-in-out infinite; }
@keyframes settle { 50% { opacity: 0.3; } }

/* The free limit and the app. */
.card { margin: 26px 0 0; padding: 18px 20px; border: 1px solid rgba(242, 179, 107, 0.45); border-radius: 16px; background: rgba(242, 179, 107, 0.07); }
.card p { margin: 0 0 12px; }
.stores { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.store { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 12px; border: 1px solid var(--line); color: var(--text); text-decoration: none; font-weight: 600; font-size: 15px; background: rgba(0, 0, 0, 0.25); }
.store small { display: block; font-weight: 400; color: var(--muted); font-size: 11px; }
.soon { color: var(--muted); font-size: 14px; }

/* Reading. */
.text { padding: 12px 0 40px; border-top: 1px solid var(--line); margin-top: 20px; }
.text h2 { margin: 36px 0 10px; font: 600 26px/1.2 ui-serif, Georgia, serif; }
.text h3 { margin: 24px 0 6px; font-size: 17px; }
.text p, .text li { color: #cfc7da; }
.text ul { padding-left: 20px; }
.faq dt { margin-top: 18px; font-weight: 600; }
.faq dd { margin: 6px 0 0; color: #cfc7da; }
.more { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.more a { padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; color: var(--text); text-decoration: none; font-size: 14px; }
footer { padding: 28px 0 48px; color: var(--faint); font-size: 13px; border-top: 1px solid var(--line); }
footer a { color: var(--muted); }
footer .langs { margin: 0 0 10px; }
footer .langs a { text-decoration: none; }
footer .langs a[aria-current="page"] { color: var(--text); }

[hidden] { display: none !important; }

@media (max-width: 600px) {
  .player { padding-top: 28px; }
  /* One line of pages that scrolls sideways, not half a screen of links. */
  .nav { flex-wrap: nowrap; overflow-x: auto; white-space: nowrap; width: 100%; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .nav::-webkit-scrollbar { display: none; }
  .volume { margin-left: 0; width: 100%; }
  .volume input { flex: 1; }
  #play { flex: 1 1 100%; }
  #variation { flex: 1; }
}
