/* Coworlds hub: cozy, phone-first, light + dark. No frameworks. */
@font-face {
  font-family: "Fredoka";
  src: local("Fredoka"), url("/fonts/Fredoka.ttf") format("truetype");
  font-weight: 300 700;
  font-display: swap;
}

:root {
  --ink: #3b2347;
  --ink-soft: #6b4f74;
  --card: #fffdfb;
  --card-edge: rgba(255, 255, 255, .9);
  --shadow: 0 10px 30px rgba(110, 50, 90, .16), 0 2px 6px rgba(110, 50, 90, .08);
  --sky-a: #ffe0b5;
  --sky-b: #ffc1ad;
  --sky-c: #e2b8f5;
  --chip-bg: rgba(255, 255, 255, .92);
  --live: #2fb36b;
  --idle: #c9a3d6;
  --link: #8a3fae;
  --r: 26px;
  --font: ui-rounded, "SF Pro Rounded", "Fredoka", "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #fbefff;
    --ink-soft: #cdb9dc;
    --card: #2a2046;
    --card-edge: rgba(255, 255, 255, .08);
    --shadow: 0 12px 34px rgba(0, 0, 0, .45), 0 2px 6px rgba(0, 0, 0, .3);
    --sky-a: #1a1431;
    --sky-b: #251a47;
    --sky-c: #3a2160;
    --chip-bg: rgba(28, 21, 53, .88);
    --live: #5ee39a;
    --idle: #8c76a8;
    --link: #e2b6ff;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ink: #fbefff; --ink-soft: #cdb9dc; --card: #2a2046; --card-edge: rgba(255, 255, 255, .08);
  --shadow: 0 12px 34px rgba(0, 0, 0, .45), 0 2px 6px rgba(0, 0, 0, .3);
  --sky-a: #1a1431; --sky-b: #251a47; --sky-c: #3a2160; --chip-bg: rgba(28, 21, 53, .88);
  --live: #5ee39a; --idle: #8c76a8; --link: #e2b6ff; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--ink);
  background: var(--sky-b);
  line-height: 1.4;
  padding: env(safe-area-inset-top) max(16px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(16px, env(safe-area-inset-left));
  overflow-x: hidden;
}
.sky {
  position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(circle at 15% 8%, rgba(255, 248, 225, .9) 0, transparent 38%),
    linear-gradient(170deg, var(--sky-a) 0%, var(--sky-b) 48%, var(--sky-c) 100%);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .sky {
    background:
      radial-gradient(1.5px 1.5px at 12% 14%, #fff 50%, transparent 51%),
      radial-gradient(1px 1px at 32% 6%, #fff 50%, transparent 51%),
      radial-gradient(2px 2px at 72% 11%, #ffe9b8 50%, transparent 51%),
      radial-gradient(1px 1px at 88% 24%, #fff 50%, transparent 51%),
      radial-gradient(1.5px 1.5px at 55% 20%, #fff 50%, transparent 51%),
      radial-gradient(1px 1px at 22% 38%, #fff 50%, transparent 51%),
      radial-gradient(circle at 85% 6%, rgba(255, 220, 150, .18) 0, transparent 30%),
      linear-gradient(175deg, var(--sky-a) 0%, var(--sky-b) 55%, var(--sky-c) 100%);
  }
}

.top, .pulse, .cards, .soon, .foot { max-width: 1040px; margin-left: auto; margin-right: auto; }

.top { display: flex; align-items: center; gap: 14px; padding: 22px 2px 6px; }
.logo { width: 64px; height: 64px; border-radius: 18px; box-shadow: var(--shadow); flex: none; }
h1 { margin: 0; font-size: 34px; line-height: 1.05; font-weight: 700; letter-spacing: -.3px; }
.tag { margin: 4px 0 0; color: var(--ink-soft); font-size: 16px; }

.pulse {
  display: flex; align-items: center; gap: 10px; margin-top: 12px; margin-bottom: 16px;
  padding: 10px 16px; border-radius: 999px; background: var(--chip-bg); box-shadow: var(--shadow);
  font-size: 15px; font-weight: 600; width: fit-content; max-width: 100%;
  margin-left: max(0px, (100% - 1040px) / 2);
}

.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--idle); flex: none; }
.is-live .dot, .pulse.is-live .dot { background: var(--live); box-shadow: 0 0 0 0 var(--live); animation: beat 2s infinite; }
@keyframes beat { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--live) 60%, transparent); } 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
@media (prefers-reduced-motion: reduce) { .dot { animation: none !important; } .card { transition: none !important; } }

.cards { display: grid; grid-template-columns: 1fr; gap: 18px; }
@media (min-width: 720px) { .cards { grid-template-columns: 1fr 1fr; gap: 22px; } }

.card {
  position: relative; display: flex; flex-direction: column;
  background: var(--card); color: inherit; text-decoration: none;
  border-radius: var(--r); overflow: hidden;
  box-shadow: var(--shadow); border: 3px solid var(--card-edge);
  transition: transform .18s ease, box-shadow .18s ease;
  -webkit-tap-highlight-color: transparent;
}
.card:hover { transform: translateY(-3px); }
.card:active { transform: scale(.985); }
.card:focus-visible { outline: 4px solid var(--accent); outline-offset: 3px; }

.art { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: color-mix(in srgb, var(--accent) 25%, #f6e7d8); }
.art img { width: 100%; height: 100%; object-fit: cover; display: block; }
#first-words .art img { object-position: center 62%; }
.art-teach { background: #2a2350 url("/art/teach-off-bg.webp") center / cover; }
.art-teach img { position: absolute; inset: 4%; width: 92%; height: 92%; object-fit: contain; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .35)); }
.preview .art img { filter: saturate(.85); }

.chip {
  position: absolute; top: 12px; left: 12px; display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 13px; border-radius: 999px; background: var(--chip-bg); color: var(--ink);
  font-size: 14px; font-weight: 650; box-shadow: 0 3px 10px rgba(0, 0, 0, .15); max-width: calc(100% - 24px);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.chip span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip.peek { background: var(--accent); color: #fff; }

.body { display: flex; flex-direction: column; gap: 8px; padding: 14px 18px 18px; flex: 1; }
.body h2 { margin: 0; font-size: 26px; font-weight: 700; line-height: 1.1; color: var(--ink); }
.line { margin: 0; font-size: 17px; color: var(--ink); }
.latest {
  display: flex; align-items: flex-start; gap: 8px; margin: 2px 0 0; padding: 9px 12px; border-radius: 14px;
  font-size: 15px; color: var(--ink-soft); background: color-mix(in srgb, var(--accent) 13%, transparent);
}
.latest b { color: var(--ink); font-weight: 650; }
.ico { width: 18px; height: 18px; flex: none; margin-top: 1px; fill: var(--accent); }

.play {
  margin-top: auto; align-self: stretch; display: flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 52px; border-radius: 16px; background: var(--accent); color: #fff;
  font-size: 19px; font-weight: 700; letter-spacing: .2px; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .14);
}
.play svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.body .latest + .play, .body .line + .play { margin-top: 8px; }

.soon {
  align-self: start; padding: 16px 20px; border-radius: var(--r);
  background: color-mix(in srgb, var(--card) 70%, transparent); border: 2px dashed color-mix(in srgb, var(--ink) 18%, transparent);
}
.soon h2 { margin: 0 0 6px; font-size: 19px; }
.soon ul { margin: 0; padding-left: 20px; }
.soon li { margin: 4px 0; font-size: 16px; }

.foot { padding: 20px 2px 40px; text-align: center; color: var(--ink-soft); }
.foot a { color: var(--link); text-underline-offset: 3px; display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px; }
.small { font-size: 14px; margin: 8px 0; }
.install {
  font: inherit; font-size: 17px; font-weight: 700; color: #fff; background: var(--ink); border: 0; cursor: pointer;
  min-height: 52px; padding: 0 22px; border-radius: 16px; display: inline-flex; align-items: center; gap: 10px; box-shadow: var(--shadow);
}
:root:not([data-theme="light"]) .install { color: var(--card); }
.install svg, .share { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; vertical-align: -5px; }
.ios-tip { font-size: 16px; color: var(--ink); background: var(--chip-bg); padding: 12px 16px; border-radius: 16px; display: inline-block; }
[hidden] { display: none !important; }
