/* Tempo: a demo app for the apple-glass kit. Glass only on the floating
   controls (sidebar, toolbar, player, tab bar); the content layer is solid. */

:root {
  --background: #ffffff;
  --foreground: #000000;
  --popover: #ffffff;
  --card: #ffffff;
  --grouped: #f2f2f7;
  --cell: #ffffff;
  --label2: rgb(60 60 67 / 0.6);
  --label3: rgb(60 60 67 / 0.3);
  --separator: rgb(60 60 67 / 0.29);
  --fill: rgb(120 120 128 / 0.12);
  --accent: #ff2d55;
  --stage: #e8e8ed;
  --stage-glow: rgb(255 45 85 / 0.08);
  --frame-edge: rgb(0 0 0 / 0.12);
}
.dark {
  --background: #000000;
  --foreground: #ffffff;
  --popover: #1c1c1e;
  --card: #1c1c1e;
  --grouped: #000000;
  --cell: #1c1c1e;
  --label2: rgb(235 235 245 / 0.6);
  --label3: rgb(235 235 245 / 0.3);
  --separator: rgb(84 84 88 / 0.6);
  --fill: rgb(118 118 128 / 0.24);
  --accent: #ff375f;
  --stage: #0b0b0d;
  --stage-glow: rgb(255 55 95 / 0.07);
  --frame-edge: rgb(255 255 255 / 0.12);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: radial-gradient(60% 50% at 50% 0%, var(--stage-glow), transparent 70%), var(--stage);
  color: var(--foreground);
  font: 15px/1.33 -apple-system, BlinkMacSystemFont, "SF Pro Text", Inter, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
img { display: block; }
svg.lucide { width: 1em; height: 1em; stroke-width: 2; }
.filled svg { fill: currentColor; }

/* ---------- Showcase chrome (outside the app) ---------- */
.show {
  height: 64px; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 0 24px;
}
.brand { display: flex; align-items: baseline; gap: 10px; font-weight: 600; font-size: 15px; }
.brand span { color: var(--label2); font-weight: 400; font-size: 13px; }
.show-controls { display: flex; align-items: center; gap: 10px; }
.seg {
  display: inline-flex; padding: 2px; border-radius: 9px; background: var(--fill); position: relative;
}
.seg button {
  position: relative; z-index: 1; height: 28px; padding: 0 12px; border-radius: 7px;
  display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500;
  color: var(--label2); transition: color .2s;
}
.seg button[aria-pressed="true"] { color: var(--foreground); }
.seg .thumb {
  position: absolute; top: 2px; bottom: 2px; border-radius: 7px; background: var(--cell);
  box-shadow: 0 1px 3px rgb(0 0 0 / .12), 0 0 0 .5px rgb(0 0 0 / .04);
  transition: transform .32s cubic-bezier(.2,0,0,1), width .32s cubic-bezier(.2,0,0,1);
}
.dark .seg .thumb { background: #636366; }
.icon-btn {
  width: 32px; height: 32px; border-radius: 999px; display: grid; place-items: center;
  background: var(--fill); font-size: 16px; color: var(--foreground);
}
.icon-btn:active, .seg button:active { transform: scale(.94); }

.stage {
  height: calc(100% - 64px); display: grid; place-items: center; padding: 0 24px 24px;
  /* minmax(0, ...): the long card rows must not widen the track. */
  grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr);
}

/* ---------- Device frames ---------- */
.device { position: relative; transition: width .45s cubic-bezier(.32,.72,0,1), height .45s cubic-bezier(.32,.72,0,1), border-radius .45s; }
.device.mac {
  width: min(1280px, 100%); height: min(820px, 100%);
  border-radius: 16px; overflow: hidden;
  box-shadow: 0 0 0 1px var(--frame-edge), 0 30px 80px -20px rgb(0 0 0 / .55), 0 8px 24px -8px rgb(0 0 0 / .3);
}
.device.phone {
  width: 414px; height: min(868px, 100%); border-radius: 66px; padding: 12px;
  background: #0d0d0f;
  box-shadow: 0 0 0 1.5px #3a3a3e, 0 0 0 4px #1a1a1c, 0 40px 90px -20px rgb(0 0 0 / .6);
}
.device.phone .screen { border-radius: 54px; }
.screen { position: relative; width: 100%; height: 100%; overflow: hidden; background: var(--background); }
.island {
  display: none; position: absolute; top: 11px; left: 50%; transform: translateX(-50%);
  width: 122px; height: 35px; border-radius: 20px; background: #000; z-index: 40;
}
.device.phone .island { display: block; }

/* Small screens: the app itself, no frame. */
@media (max-width: 719px) {
  .show { display: none; }
  .stage { height: 100%; padding: 0; }
  .device.mac, .device.phone { width: 100%; height: 100%; border-radius: 0; padding: 0; box-shadow: none; background: none; }
  .device.phone .screen { border-radius: 0; }
  .device .island, .status { display: none !important; }
}

/* ---------- The app ---------- */
.app { container: app / inline-size; position: absolute; inset: 0; }
.scroll {
  position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden;
  padding-bottom: 180px; scrollbar-width: none;
}
.scroll::-webkit-scrollbar { display: none; }

.status {
  display: none; position: absolute; top: 0; left: 0; right: 0; height: 54px; z-index: 30;
  padding: 18px 34px 0 46px; justify-content: space-between; align-items: flex-start;
  font: 600 17px/22px -apple-system, "SF Pro Text", system-ui, sans-serif; color: #fff; pointer-events: none;
}
.status .icons { display: flex; gap: 6px; align-items: center; padding-top: 3px; }
.device.phone .status { display: flex; }

/* Hero: full-bleed, runs under the floating bars (background extension). */
.hero { position: relative; height: 460px; color: #fff; }
.hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgb(0 0 0 / .35), transparent 30%, transparent 45%, rgb(0 0 0 / .75) 88%, var(--background));
}
.hero .copy { position: absolute; left: 16px; right: 16px; bottom: 28px; z-index: 1; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .4px; text-transform: uppercase; opacity: .8; }
.hero h1 { font-size: 34px; line-height: 41px; font-weight: 700; letter-spacing: .4px; margin: 4px 0 4px; }
.hero p { margin: 0 0 16px; font-size: 15px; opacity: .85; max-width: 420px; }
.hero .actions { display: flex; gap: 10px; }
.btn-primary {
  height: 44px; padding: 0 22px; border-radius: 999px; background: #fff; color: #000;
  display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px;
  transition: transform .2s cubic-bezier(.2,0,0,1);
}
.btn-round {
  width: 44px; height: 44px; border-radius: 999px; display: grid; place-items: center;
  background: rgb(255 255 255 / .2); color: #fff; font-size: 20px;
}
.btn-primary:active, .btn-round:active, .card:active { transform: scale(.97); }

.section { padding: 28px 0 0; }
.section-head {
  display: flex; align-items: center; justify-content: space-between; padding: 0 16px 10px;
}
.section-head h2 { font-size: 22px; line-height: 28px; font-weight: 700; margin: 0; letter-spacing: .35px; }
.section-head a { color: var(--accent); font-size: 15px; text-decoration: none; }
.row {
  display: grid; grid-auto-flow: column; gap: 12px; overflow-x: auto; padding: 0 16px;
  scroll-snap-type: x mandatory; scroll-padding: 16px; scrollbar-width: none;
}
.row::-webkit-scrollbar { display: none; }
.card {
  scroll-snap-align: start; transition: transform .2s cubic-bezier(.2,0,0,1); text-align: left;
  display: flex; flex-direction: column; justify-content: flex-start; align-self: start;
}
.card img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; background: var(--fill); }
.card .t { margin-top: 6px; font-size: 13px; font-weight: 500; line-height: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .s { font-size: 13px; line-height: 18px; color: var(--label2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row.squares { grid-auto-columns: 150px; }

.row.picks { grid-auto-columns: 250px; }
.pick { border-radius: 14px; overflow: hidden; background: var(--cell); position: relative; }
.pick img { border-radius: 0; aspect-ratio: 1; }
.pick .cap { padding: 12px 14px 14px; color: #fff; }
.pick .cap .t { font-size: 15px; font-weight: 600; margin: 0; }
.pick .cap .s { color: rgb(255 255 255 / .7); white-space: normal; }
.pick .label { position: absolute; top: 12px; left: 14px; font-size: 12px; font-weight: 600; color: #fff; text-shadow: 0 1px 8px rgb(0 0 0 / .4); }

.row.stations { grid-auto-columns: 120px; }
.station img { border-radius: 999px; }
.station .t { text-align: center; }

/* Charts: an inset group of rows, solid. */
.charts { margin: 0 16px; background: var(--cell); border-radius: 14px; overflow: hidden; }
.dark .charts { background: #1c1c1e; }
.song {
  display: grid; grid-template-columns: 22px 44px 1fr auto 28px; align-items: center; gap: 12px;
  min-height: 60px; padding: 8px 12px 8px 14px; position: relative; width: 100%; text-align: left;
}
.song + .song::before {
  content: ""; position: absolute; top: 0; left: 92px; right: 0; height: .5px; background: var(--separator);
}
.song:active { background: var(--fill); }
.song .n { color: var(--label2); font-size: 15px; font-variant-numeric: tabular-nums; text-align: center; }
.song img { width: 44px; height: 44px; border-radius: 6px; object-fit: cover; }
.song .t { font-size: 15px; line-height: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.song .s { font-size: 13px; line-height: 18px; color: var(--label2); }
.song .d { color: var(--label2); font-size: 13px; font-variant-numeric: tabular-nums; }
.song .more { color: var(--label2); font-size: 18px; display: grid; place-items: center; }
.song .d { display: none; }

/* ---------- Floating controls: the glass layer ---------- */
.glass-btn {
  width: 44px; height: 44px; border-radius: 999px; display: grid; place-items: center;
  font-size: 19px; color: var(--foreground);
}
.toolbar { position: absolute; z-index: 20; top: 62px; right: 16px; display: flex; gap: 10px; }
.toolbar .search-pill { display: none; }
.hero-title-phone { display: none; }

.sidebar { display: none; }

.player {
  position: absolute; z-index: 20; left: 16px; right: 16px; bottom: 100px; height: 60px;
  border-radius: 999px; display: flex; align-items: center; gap: 12px; padding: 0 10px 0 8px;
}
.player .art { width: 44px; height: 44px; border-radius: 999px; object-fit: cover; flex: none; }
.player .meta { flex: 1; min-width: 0; }
.player .meta .t { font-size: 15px; font-weight: 600; line-height: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player .meta .s { font-size: 13px; line-height: 18px; color: var(--label2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player .ctl { display: flex; align-items: center; gap: 2px; }
.player .ctl button { width: 40px; height: 40px; border-radius: 999px; display: grid; place-items: center; font-size: 20px; transition: transform .18s; }
.player .ctl button:active { transform: scale(.88); }
.player .ctl .prev, .player .extra, .player .progress, .player .time { display: none; }

.tabbar-wrap {
  position: absolute; z-index: 20; left: 16px; right: 16px; bottom: 24px;
  display: flex; gap: 10px; align-items: center;
}
.tabbar {
  flex: 1; height: 64px; border-radius: 999px; display: grid; grid-template-columns: repeat(4, 1fr);
  align-items: center; padding: 0 4px;
}
.tab {
  position: relative; z-index: 1; display: grid; justify-items: center; gap: 1px;
  font-size: 10px; font-weight: 600; color: var(--foreground); height: 56px; align-content: center;
  transition: color .25s, transform .18s;
}
.tab svg { font-size: 23px; }
.tab[aria-current="page"] { color: var(--accent); }
.tab:active { transform: scale(.92); }
.tabbar .liquid-lens {
  position: absolute; top: 4px; bottom: 4px; left: 4px; border-radius: 999px; z-index: 0;
  transition: transform .42s cubic-bezier(.32,.72,0,1);
}
.tab-search { width: 64px; height: 64px; border-radius: 999px; display: grid; place-items: center; font-size: 23px; flex: none; }

/* Scroll edge: content fades as it slides under the bottom bars. */
.edge-bottom {
  position: absolute; left: 0; right: 0; bottom: 0; height: 190px; z-index: 10; pointer-events: none;
  background: linear-gradient(to top, var(--background) 0, color-mix(in srgb, var(--background) 60%, transparent) 40%, transparent);
}

/* ---------- Desktop layout (macOS) ---------- */
@container app (min-width: 760px) {
  .scroll { padding-bottom: 120px; }
  .content { padding-left: 264px; }
  .hero { height: 440px; margin-left: -264px; }
  .hero .copy { left: 296px; bottom: 36px; }
  .hero h1 { font-size: 40px; line-height: 46px; }
  .section-head, .row { padding-left: 32px; padding-right: 32px; }
  .row { scroll-padding: 32px; }
  .section-head h2 { font-size: 20px; line-height: 25px; }
  .row.squares { grid-auto-columns: 168px; }
  .row.picks { grid-auto-columns: 232px; }
  .charts { margin: 0 32px; display: grid; grid-template-columns: 1fr 1fr; column-gap: 0; }
  .song .d { display: block; }
  .song:nth-child(2)::before { content: none; }
  .song:nth-child(odd) { border-right: .5px solid var(--separator); }
  .song + .song::before { left: 92px; }

  .sidebar {
    display: flex; flex-direction: column; position: absolute; z-index: 20;
    top: 10px; bottom: 10px; left: 10px; width: 236px; border-radius: 22px; padding: 14px 10px;
    font-size: 13px;
  }
  .lights { display: flex; gap: 8px; padding: 4px 8px 18px; }
  .lights i { width: 12px; height: 12px; border-radius: 999px; display: block; box-shadow: inset 0 0 0 .5px rgb(0 0 0 / .2); }
  .lights i:nth-child(1) { background: #ff5f57; }
  .lights i:nth-child(2) { background: #febc2e; }
  .lights i:nth-child(3) { background: #28c840; }
  .side-search {
    height: 30px; border-radius: 8px; background: var(--fill); display: flex; align-items: center;
    gap: 6px; padding: 0 8px; color: var(--label2); margin: 0 4px 12px; font-size: 13px;
  }
  .side-group { font-size: 11px; font-weight: 600; color: var(--label2); padding: 14px 10px 4px; }
  .side-item {
    display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 10px; border-radius: 8px;
    font-size: 13px; width: 100%; text-align: left;
  }
  .side-item svg { font-size: 16px; color: var(--accent); flex: none; }
  .side-item[aria-current="page"] { background: color-mix(in srgb, var(--foreground) 10%, transparent); font-weight: 500; }
  .side-item:hover:not([aria-current="page"]) { background: color-mix(in srgb, var(--foreground) 5%, transparent); }

  .toolbar { top: 16px; right: 20px; }
  .toolbar .search-pill {
    display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px 0 14px; border-radius: 999px;
    font-size: 13px; color: var(--foreground); width: 220px;
  }
  .toolbar .search-pill span { opacity: .65; }
  .toolbar .glass-btn { width: 40px; height: 40px; font-size: 17px; }

  .tabbar-wrap { display: none; }
  .player {
    left: calc(256px + max(24px, (100% - 256px - 720px) / 2)); right: max(24px, (100% - 256px - 720px) / 2);
    bottom: 20px; height: 64px; padding: 0 18px 0 10px; gap: 14px;
  }
  .player .ctl .prev, .player .extra { display: flex; }
  .player .meta { flex: 0 1 200px; }
  .player .progress {
    display: flex; flex: 1; align-items: center; gap: 10px; font-size: 11px; color: var(--label2);
    font-variant-numeric: tabular-nums;
  }
  .player .bar { flex: 1; height: 4px; border-radius: 999px; background: var(--fill); overflow: hidden; }
  .player .bar i { display: block; height: 100%; width: 38%; background: var(--foreground); opacity: .75; border-radius: inherit; }
  .player .extra { gap: 4px; color: var(--label2); }
  .player .extra button { width: 32px; height: 32px; display: grid; place-items: center; font-size: 16px; border-radius: 999px; }
  .edge-bottom { height: 120px; }
}
