:root {
  --bg-hi: #f7f7f7;
  --bg-lo: #dcdcdc;
  --ink: #1d1d1d;
  --dim: #a3a3a3;
  --ring: #ffffff;
  --ring-edge: rgba(0, 0, 0, .3);
  --lift: 0 10px 24px -6px rgba(0, 0, 0, .4);
  --green: #4ca22b;
  --green-dk: #2f7a1c;
  --grey-dk: #4a4a4a;
  --grey: #6e6e6e;
  --grey-lt: #c4c4c4;
  --grey-lt-ink: #2b2b2b;
  --a: #5dbb2a;
  --font: 'Segoe UI', 'Open Sans', system-ui, sans-serif;
  /* tile grid: three rows of landscape cells */
  --row: clamp(84px, 21vh, 190px);
  --col: calc(var(--row) * 1.25);
  --gap: 8px;
  --pad: max(16px, 7vw);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg-hi: #2c2c2c;
    --bg-lo: #121212;
    --ink: #f2f2f2;
    --dim: #6b6b6b;
    --ring-edge: rgba(255, 255, 255, .15);
    --lift: 0 12px 28px -6px rgba(0, 0, 0, .85);
    --grey-lt: #8f8f8f;
    --grey-lt-ink: #ffffff;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg-hi: #2c2c2c;
  --bg-lo: #121212;
  --ink: #f2f2f2;
  --dim: #6b6b6b;
  --ring-edge: rgba(255, 255, 255, .15);
  --lift: 0 12px 28px -6px rgba(0, 0, 0, .85);
  --grey-lt: #8f8f8f;
  --grey-lt-ink: #ffffff;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: radial-gradient(130% 100% at 20% 0%, var(--bg-hi), var(--bg-lo)) fixed;
  background-color: var(--bg-lo);
  color: var(--ink);
  font: 400 1rem/1.4 var(--font);
  overflow-x: hidden;
}
button { font: inherit; color: inherit; }
:focus { outline: none; }
:focus-visible { outline: 3px solid var(--a); outline-offset: 3px; }

/* ---------- header: tabs on the left, the profile on the right ---------- */
.top {
  display: flex;
  align-items: flex-end;
  gap: 24px;
  padding: clamp(20px, 6vh, 56px) var(--pad) 0;
}
.pivots {
  flex: 1;
  min-width: 0;
  display: flex;
  gap: clamp(16px, 2.2vw, 30px);
  overflow-x: auto;
  scrollbar-width: none;
}
.pivots::-webkit-scrollbar { display: none; }
.pivots [role="tab"] {
  flex: none;
  padding: 0 0 4px;
  border: 0;
  background: none;
  cursor: pointer;
  font-size: clamp(1.35rem, 2.6vw, 2.05rem);
  font-weight: 300;
  letter-spacing: -.01em;
  color: var(--dim);
  transition: color .15s;
}
.pivots [aria-selected="true"] { color: var(--ink); }
.pivots [role="tab"]:focus-visible { outline: none; color: var(--ink); box-shadow: inset 0 -3px var(--a); }
@media (hover: hover) { .pivots [role="tab"]:hover { color: var(--ink); } }

.me { flex: none; display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; font-size: 1.05rem; }
.me img { width: 48px; height: 48px; padding: 3px; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); }

/* ---------- the panorama: every tab's tiles side by side, the next one peeking in ---------- */
main {
  position: relative;
  flex: 1;
  overflow: hidden;
  padding: 22px 0 18px;
  scroll-padding: 0 var(--pad);
}
.track { display: flex; align-items: flex-start; gap: clamp(40px, 5vw, 80px); width: max-content; padding: 0 100vw 0 var(--pad); }
.panel { flex: none; transition: opacity .3s; }
.panel[inert] { opacity: .45; }

.grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-rows: repeat(3, var(--row));
  grid-auto-columns: var(--col);
  grid-auto-flow: column dense;
  gap: var(--gap);
}
.grid .wide { grid-column: span 2; }
.grid .big { grid-column: span 2; grid-row: span 2; }
.grid li { display: flex; }

.tile {
  position: relative;
  display: flex;
  align-items: flex-end;
  width: 100%;
  height: 100%;
  padding: 0;
  overflow: hidden;
  border: 0;
  color: #fff;
  text-decoration: none;
  text-align: left;
  cursor: pointer;
  background: var(--green);
  transition: transform .14s cubic-bezier(.2, .8, .2, 1), box-shadow .14s;
}
.tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tile .label { position: relative; width: 100%; padding: 22px 10px 7px; font-size: .9rem; }
/* a cover is just its art: its title (and on home, what it is) only show while it's selected */
.tile img ~ .label { background: linear-gradient(transparent, rgba(0, 0, 0, .55)); opacity: 0; transition: opacity .14s; }
.tile:focus img ~ .label, .tile:focus .tag { opacity: 1; }
.big .label { padding: 40px 14px 10px; font-size: 1.15rem; }
/* what a home tile is, along its top */
.tile .tag {
  position: absolute;
  inset: 0 0 auto;
  padding: 7px 10px 20px;
  background: linear-gradient(rgba(0, 0, 0, .6), transparent);
  text-shadow: 0 1px 3px rgba(0, 0, 0, .7);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .02em;
  opacity: 0;
  transition: opacity .14s;
}
.big .tag { padding: 10px 14px 28px; font-size: .9rem; }
.tile:focus, .tile:focus-visible {
  z-index: 1;
  outline: none;
  transform: scale(1.04);
  box-shadow: 0 0 0 3px var(--ring), 0 0 0 4px var(--ring-edge), var(--lift);
}

/* tiles without a cover: a name in large type on a flat colour */
.tile.text {
  container-type: size;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  padding: 10px 12px 11px;
}
.big .tile.text { padding: 16px 18px 18px; }
.tile .kicker { position: relative; font-size: .78rem; font-weight: 600; letter-spacing: .02em; opacity: .85; }
.tile .icon ~ .kicker { padding-right: 26px; }
.tile .name {
  position: relative;
  font-size: clamp(.95rem, min(9cqw, 17cqh), 3.2rem);
  font-weight: 300;
  line-height: 1.08;
  letter-spacing: -.01em;
  overflow-wrap: anywhere;
}
.tile .icon {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: .8;
}
.tile.still { cursor: default; }

/* coming soon tiles, in flat greens and greys */
.soon { cursor: default; }
.soon svg {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(34%, 56px);
  translate: -50% -60%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  opacity: .45;
}
.big .soon svg { width: min(26%, 84px); }
.soon .kicker { position: absolute; top: 10px; left: 12px; }
.soon.c1 { background: var(--grey-dk); }
.soon.c2 { background: var(--grey-lt); color: var(--grey-lt-ink); }
.soon.c3 { background: var(--green-dk); }
.soon.c4 { background: var(--grey); }
.soon.nope { animation: nope .32s; }
@keyframes nope { 25% { translate: -6px 0; } 50% { translate: 5px 0; } 75% { translate: -3px 0; } }

/* the tile growing to fill the screen as something opens */
.launch { position: fixed; z-index: 10; pointer-events: none; }
.launch img { width: 100%; height: 100%; object-fit: cover; }

/* what was copied, briefly */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 20;
  margin: 0;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--bg-lo);
  font-size: .9rem;
  box-shadow: var(--lift);
  opacity: 0;
  translate: -50% 10px;
  pointer-events: none;
  transition: opacity .18s, translate .18s;
}
.toast.on { opacity: 1; translate: -50% 0; }

/* ---------- controller hints ---------- */
.hints { display: flex; gap: 28px; padding: 8px var(--pad) clamp(18px, 4vh, 36px); font-size: .85rem; color: var(--ink); }
.hints span { display: inline-flex; align-items: center; gap: 8px; }
.btn {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  border-radius: 11px;
  font-size: .68rem;
  font-weight: 600;
  color: #fff;
}
.btn.a { background: var(--a); }
.btn.bumper { min-width: 30px; padding: 0 6px; border-radius: 5px 5px 9px 9px; background: var(--grey); }
.btn.bumper + .btn.bumper { margin-left: -4px; }
@media (pointer: coarse) { .hints { display: none; } }

/* ---------- phones: each tab is a two-column stack ---------- */
@media (max-width: 640px) {
  :root { --pad: 16px; }
  .top { flex-direction: column-reverse; align-items: stretch; gap: 10px; padding-top: 16px; }
  .me { align-self: flex-end; font-size: .95rem; }
  .me img { width: 36px; height: 36px; }
  .track { gap: 12px; }
  .panel { width: calc(100vw - 48px); }
  .grid { grid-template-rows: none; grid-template-columns: repeat(2, 1fr); grid-auto-flow: row dense; grid-auto-rows: auto; }
  .grid .big { grid-row: auto; }
  .grid li { aspect-ratio: 1.33; }
  .grid .wide { aspect-ratio: 2.66; }
}

/* ---------- error and notice pages ---------- */
.notice { max-width: 34rem; margin: 18vh auto 0; padding: 0 16px; }
.notice h1 { font-size: 2.4rem; font-weight: 300; margin: 0 0 8px; }
.notice p { color: var(--dim); }
.notice a { color: var(--ink); font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
  .tile, .tile .label, .tile .tag, .pivots [role="tab"], .panel, .toast { transition: none; }
  .soon.nope { animation: none; }
}
