/* Beaker's Lab theme. Outfit is SIL OFL; see fonts/OFL-Outfit.txt.
   One sans family: --font-display is the heavier weight, --font-ui the text.
   Below 820px the home screen is the phone layout. From 820px the home bench
   becomes a lab desk; app pages stay a centred phone-width column. */

@font-face {
  font-family: "Outfit";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/outfit-latin.woff2") format("woff2");
}

:root {
  --lab-night: #140c22;
  --lab-night-deep: #0c0716;
  --lab-plum: #241433;
  --purple: #8b6fd4;
  --purple-deep: #4c2d86;
  --teal: #2dd4bf;
  --teal-deep: #0f766e;
  --gold: #f5c451;
  --gold-deep: #c8881e;
  --cream: #f7f1e6;
  --ink: #241433;
  --muted: rgba(247, 241, 230, 0.72);
  --glass: rgba(255, 255, 255, 0.08);
  --glass-line: rgba(247, 241, 230, 0.16);
  --danger: #ffb4a8;
  --font-display: "Outfit", "Avenir Next", "Segoe UI", sans-serif;
  --font-ui: "Outfit", "Avenir Next", "Segoe UI", sans-serif;
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.32);
  --tile: 60px;
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  min-height: 100dvh;
  color: var(--cream);
  font-family: var(--font-ui);
  font-weight: 400;
  line-height: 1.4;
  background-color: var(--lab-night-deep);
  background-image:
    radial-gradient(ellipse 80% 50% at 100% -10%, rgba(245, 196, 81, 0.2), transparent 52%),
    radial-gradient(ellipse 70% 46% at -15% 110%, rgba(45, 212, 191, 0.16), transparent 48%),
    radial-gradient(ellipse 55% 40% at 70% 70%, rgba(139, 111, 212, 0.2), transparent 55%),
    linear-gradient(165deg, #2a1844 0%, #140c22 46%, #101820 100%);
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

button,
.tile {
  user-select: none;
}

:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
}

::selection {
  background: rgba(245, 196, 81, 0.35);
  color: #fff;
}

.wallpaper {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.orb {
  position: absolute;
  border-radius: 50%;
}

.orb-a {
  width: 240px;
  height: 240px;
  top: -70px;
  right: -60px;
  background: radial-gradient(circle, rgba(245, 196, 81, 0.38), transparent 68%);
}

.orb-b {
  width: 280px;
  height: 280px;
  bottom: 40px;
  left: -120px;
  background: radial-gradient(circle, rgba(45, 212, 191, 0.22), transparent 68%);
}

.orb-c {
  width: 180px;
  height: 180px;
  top: 42%;
  right: -70px;
  background: radial-gradient(circle, rgba(167, 139, 250, 0.28), transparent 70%);
}

.device {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
}

#gate,
#home,
.app-shell {
  min-height: 100dvh;
}

#home {
  display: none;
}

html.is-unlocked #gate {
  display: none;
}

html.is-unlocked #home {
  display: flex;
  animation: screen-in 0.45s ease;
}

@keyframes screen-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.status {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 48px;
  padding: calc(8px + env(safe-area-inset-top)) 16px 0;
}

.status > :first-child {
  justify-self: start;
}

.status > :last-child {
  justify-self: end;
}

.clock {
  min-width: 3.2em;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  font-size: 15px;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 10px var(--teal);
}

.icon-btn {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--glass);
  color: var(--cream);
}

.icon-btn:active {
  background: rgba(255, 255, 255, 0.16);
}

.gate {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 0 22px calc(16px + env(safe-area-inset-bottom));
}

.gate > * {
  position: relative;
  z-index: 1;
}

.gate-kicker,
.eyebrow {
  margin: 0;
  text-align: center;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 600;
  color: var(--teal);
}

.gate-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.mascot-btn {
  position: relative;
  width: min(168px, 46vw);
  margin-top: 4px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
}

.mascot-btn::before {
  content: "";
  position: absolute;
  inset: 12% 6% 8%;
  z-index: -1;
  background: radial-gradient(circle, rgba(245, 196, 81, 0.32), transparent 68%);
}

.flask {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.wave {
  animation: slosh 3.4s ease-in-out infinite;
}

@keyframes slosh {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(-22px); }
}

.flame {
  transform-box: fill-box;
  transform-origin: center bottom;
  animation: flicker 0.75s ease-in-out infinite alternate;
}

@keyframes flicker {
  from { transform: scaleY(0.92) rotate(-3deg); }
  to { transform: scaleY(1.08) rotate(3deg); }
}

.bub {
  transform-box: fill-box;
  transform-origin: center;
}

.b1 { animation: rise 3.1s ease-in infinite; }
.b2 { animation: rise 2.6s ease-in infinite 0.7s; }
.b3 { animation: rise 3.5s ease-in infinite 1.3s; }
.b4 { animation: rise 4s ease-in infinite 0.3s; }

@keyframes rise {
  0% { transform: translateY(8px); opacity: 0; }
  18% { opacity: 0.95; }
  100% { transform: translateY(-20px); opacity: 0; }
}

.mascot-btn.is-meep .flask {
  animation: wobble 0.48s ease;
}

@keyframes wobble {
  0% { transform: rotate(0); }
  30% { transform: rotate(-7deg); }
  62% { transform: rotate(6deg); }
  100% { transform: rotate(0); }
}

.meep {
  position: absolute;
  top: 8px;
  right: -4px;
  z-index: 2;
  padding: 6px 8px;
  border-radius: 999px;
  background: var(--gold);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28);
  transform: rotate(8deg);
}

.gate h1,
.home-intro h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: 1.02;
}

.gate h1 {
  margin-top: 2px;
  font-size: clamp(2.05rem, 10vw, 2.7rem);
  text-align: center;
}

.gate h1 em,
.home-intro h1 em {
  font-style: normal;
  font-weight: 700;
  color: var(--gold);
}

.gate-prompt {
  margin: 14px 0 12px;
  text-align: center;
  color: var(--muted);
}

.dots {
  display: flex;
  justify-content: center;
  gap: 14px;
  min-height: 16px;
}

.dots span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1.5px solid rgba(247, 241, 230, 0.55);
}

.dots span.is-on {
  background: var(--cream);
  border-color: var(--cream);
}

.dots.is-good span {
  background: var(--gold);
  border-color: var(--gold);
}

.dots.is-shake {
  animation: shake 0.42s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(4px); }
}

.pin-msg {
  min-height: 1.35em;
  margin: 10px 0 0;
  text-align: center;
  font-size: 14px;
  color: var(--muted);
}

.pin-msg.is-bad { color: var(--danger); }
.pin-msg.is-good { color: var(--gold); }

.keypad {
  display: grid;
  grid-template-columns: repeat(3, min(74px, 20vw));
  gap: 12px 18px;
  justify-content: center;
  margin-top: auto;
  padding-top: 18px;
}

.key {
  width: min(74px, 20vw);
  height: min(74px, 20vw);
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.08);
  font-size: min(30px, 7.4vw);
  font-weight: 500;
}

.key:active {
  background: rgba(255, 255, 255, 0.22);
  transform: scale(0.96);
}

.key-ghost {
  background: transparent;
  border-color: transparent;
}

.key-spacer {
  width: min(74px, 20vw);
  height: min(74px, 20vw);
}

.gate-foot {
  margin: 16px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.04em;
}

.home {
  flex-direction: column;
}

.home-intro {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
  padding: 6px 20px 4px;
}

.home-intro .mascot-btn {
  width: 74px;
  margin: 0;
}

.home-intro .meep {
  top: -2px;
  right: -12px;
  font-size: 11px;
  padding: 4px 6px;
}

.home-intro .eyebrow {
  text-align: left;
}

.home-intro h1 {
  font-size: clamp(1.45rem, 6.2vw, 1.85rem);
}

.lede {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13.5px;
}

.lock-label,
.motto,
.bench-label,
.tile-by {
  display: none;
}

.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px 4px;
  align-content: start;
  flex: 1 1 auto;
  padding: 18px 12px 12px;
}

.tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
}

.tile-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: var(--tile);
  height: var(--tile);
  border-radius: 22%;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.65),
    inset 0 -1px 0 rgba(0, 0, 0, 0.08),
    0 8px 14px rgba(0, 0, 0, 0.22);
  transition: transform 0.12s ease;
}

.tile-icon::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.38), rgba(255, 255, 255, 0) 42%);
  pointer-events: none;
}

.tile-icon svg,
.soon-pill {
  position: relative;
  z-index: 1;
}

.tile-icon svg {
  width: 30px;
  height: 30px;
  display: block;
}

.tint-gold { background: linear-gradient(165deg, #ffe7ad 0%, #f5c451 42%, #e39b16 100%); color: #3b2460; }
.tint-teal { background: linear-gradient(165deg, #c8fff6 0%, #5eead4 40%, #0f9f93 100%); color: #08312e; }
.tint-purple { background: linear-gradient(165deg, #efe7ff 0%, #c4b5fd 45%, #8b6fd4 100%); color: #32145c; }
.tint-flame { background: linear-gradient(165deg, #ffe0c2 0%, #fdba74 42%, #f0732a 100%); color: #431407; }

.tile:active .tile-icon {
  transform: scale(0.92);
}

.tile-label {
  max-width: 76px;
  color: var(--cream);
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.2;
  text-align: center;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tile.is-soon .tile-icon {
  background: rgba(255, 255, 255, 0.04);
  color: var(--gold);
  border: 1.5px dashed rgba(245, 196, 81, 0.55);
  box-shadow: none;
}

.tile.is-soon .tile-icon::after {
  display: none;
}

.tile.is-soon .tile-label {
  color: rgba(247, 241, 230, 0.78);
}

.soon-pill {
  position: absolute;
  left: 50%;
  bottom: -7px;
  transform: translateX(-50%);
  padding: 2px 5px;
  border-radius: 999px;
  border: 1px solid rgba(245, 196, 81, 0.5);
  background: rgba(20, 12, 34, 0.9);
  color: var(--gold);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.empty-bench {
  grid-column: 1 / -1;
  margin: 12px 8px;
  color: var(--muted);
}

.dock {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 8px 12px calc(12px + env(safe-area-inset-bottom));
  padding: 12px 8px 10px;
  border-radius: 32px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(22px) saturate(1.4);
  -webkit-backdrop-filter: blur(22px) saturate(1.4);
}

.dock .tile {
  width: 76px;
  flex: 0 0 76px;
}

.toast {
  position: fixed;
  bottom: calc(20px + env(safe-area-inset-bottom));
  left: 50%;
  z-index: 30;
  max-width: min(320px, calc(100% - 32px));
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(245, 196, 81, 0.45);
  background: rgba(28, 16, 46, 0.94);
  color: var(--cream);
  font-size: 14px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

#home .toast {
  bottom: calc(124px + env(safe-area-inset-bottom));
}

.toast.is-on {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-height: 740px) {
  .gate .mascot-btn {
    width: min(124px, 34vw);
  }

  .gate h1 {
    font-size: 2rem;
  }

  .gate-prompt {
    margin: 8px 0;
  }

  .pin-msg {
    margin-top: 6px;
  }

  .keypad {
    grid-template-columns: repeat(3, 62px);
    gap: 8px 16px;
    padding-top: 8px;
  }

  .key,
  .key-spacer {
    width: 62px;
    height: 62px;
  }

  .key {
    font-size: 26px;
  }

  .gate-foot {
    margin-top: 10px;
  }
}

.app-shell {
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
  padding: calc(8px + env(safe-area-inset-top)) 12px 10px;
  background: linear-gradient(180deg, rgba(18, 10, 30, 0.94), rgba(18, 10, 30, 0.72) 72%, transparent);
}

.back {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 8px 8px 8px 2px;
  color: var(--teal);
  font-weight: 600;
  text-decoration: none;
}

.back svg {
  display: block;
}

.topbar-title {
  min-width: 0;
  text-align: center;
}

.topbar-title h1 {
  margin: 0;
  overflow: hidden;
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-title p {
  margin: 1px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 10px;
  padding: 12px 16px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, #f8d56a, #e0a22a);
  color: #2a1840;
  font-weight: 650;
}

.primary:active {
  filter: brightness(0.96);
}

@media (hover: hover) {
  .key:hover {
    background: rgba(255, 255, 255, 0.16);
  }

  .key-ghost:hover {
    background: transparent;
  }

  .tile:hover .tile-icon {
    transform: translateY(-2px);
  }

  .tile.is-soon:hover .tile-icon {
    transform: translateY(-2px);
  }
}

/* Wide screens: apps keep the phone column. The home bench opens into a desk. */
@media (min-width: 820px) {
  .app-shell {
    width: 420px;
    margin-inline: auto;
    background: linear-gradient(180deg, rgba(20, 12, 34, 0.9), rgba(12, 10, 20, 0.94));
    border-left: 1px solid rgba(247, 241, 230, 0.08);
    border-right: 1px solid rgba(247, 241, 230, 0.08);
    box-shadow: 0 0 80px rgba(0, 0, 0, 0.28);
  }

  body:not(:has(.app-shell)) .device {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    justify-content: safe center;
    padding: 32px 28px;
  }

  body:not(:has(.app-shell)) .orb-a {
    width: 520px;
    height: 520px;
    top: -160px;
    right: -100px;
  }

  body:not(:has(.app-shell)) .orb-b {
    width: 640px;
    height: 640px;
    bottom: -180px;
    left: -200px;
  }

  body:not(:has(.app-shell)) .orb-c {
    width: 380px;
    height: 380px;
    top: 12%;
    right: 10%;
  }

  body:not(:has(.app-shell)) .wallpaper::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
      linear-gradient(rgba(247, 241, 230, 0.045) 1px, transparent 1px),
      linear-gradient(90deg, rgba(247, 241, 230, 0.045) 1px, transparent 1px);
    background-size: 64px 64px;
    mask-image: radial-gradient(ellipse at 50% 45%, transparent 28%, #000 76%);
    pointer-events: none;
  }

  #gate,
  #home {
    width: min(720px, 100%);
    min-height: 0;
    border-radius: 36px;
    border: 1px solid rgba(247, 241, 230, 0.16);
    background:
      radial-gradient(90% 60% at 0% 0%, rgba(245, 196, 81, 0.1), transparent 50%),
      radial-gradient(80% 70% at 100% 100%, rgba(45, 212, 191, 0.1), transparent 48%),
      rgba(14, 9, 24, 0.74);
    box-shadow:
      0 30px 80px rgba(0, 0, 0, 0.4),
      inset 0 1px 0 rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(18px) saturate(1.35);
    -webkit-backdrop-filter: blur(18px) saturate(1.35);
  }

  #gate::after,
  #home::after {
    content: "";
    position: absolute;
    inset: 12px;
    z-index: 0;
    border-radius: 26px;
    pointer-events: none;
    background:
      linear-gradient(var(--gold), var(--gold)) left top / 22px 1px no-repeat,
      linear-gradient(var(--gold), var(--gold)) left top / 1px 22px no-repeat,
      linear-gradient(var(--gold), var(--gold)) right top / 22px 1px no-repeat,
      linear-gradient(var(--gold), var(--gold)) right top / 1px 22px no-repeat,
      linear-gradient(var(--teal), var(--teal)) left bottom / 22px 1px no-repeat,
      linear-gradient(var(--teal), var(--teal)) left bottom / 1px 22px no-repeat,
      linear-gradient(var(--teal), var(--teal)) right bottom / 22px 1px no-repeat,
      linear-gradient(var(--teal), var(--teal)) right bottom / 1px 22px no-repeat;
    opacity: 0.7;
  }

  #home {
    position: relative;
  }

  #home > *:not(.toast) {
    position: relative;
    z-index: 1;
  }

  .status {
    min-height: 58px;
    margin-bottom: 6px;
    padding: 12px 8px 10px;
    border-bottom: 1px solid rgba(247, 241, 230, 0.1);
  }

  .clock {
    font-size: 17px;
  }

  .live-dot {
    width: 8px;
    height: 8px;
    box-shadow:
      0 0 0 6px rgba(45, 212, 191, 0.12),
      0 0 14px var(--teal);
  }

  #lock-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: auto;
    height: 40px;
    padding: 0 14px 0 12px;
    border-radius: 999px;
    border: 1px solid rgba(247, 241, 230, 0.16);
  }

  .lock-label {
    display: inline;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }

  .gate {
    padding: 6px 36px 28px;
  }

  .gate .keypad {
    margin-top: 18px;
  }

  .gate-prompt {
    margin-top: 18px;
    font-family: var(--font-display);
    font-size: 1.65rem;
    font-weight: 560;
    letter-spacing: -0.02em;
    color: var(--cream);
  }

  .gate .mascot-btn {
    width: 188px;
  }

  .gate h1 {
    font-size: 3rem;
  }

  .dots {
    gap: 16px;
  }

  .dots span {
    width: 13px;
    height: 13px;
  }

  .home-intro {
    grid-template-columns: auto auto;
    justify-content: center;
    gap: 6px 26px;
    width: fit-content;
    max-width: 100%;
    margin-inline: auto;
    padding: 18px 8px 4px;
  }

  .home-intro .mascot-btn {
    width: 124px;
  }

  .home-intro .mascot-btn::before {
    inset: 6% 0 4%;
    background: radial-gradient(circle, rgba(245, 196, 81, 0.4), transparent 68%);
  }

  .home-intro h1 {
    font-size: 2.7rem;
  }

  .lede {
    font-size: 15px;
  }

  .motto {
    display: block;
    max-width: 28em;
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 15px;
  }

  .bench-label {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 18px 8px 0;
    color: var(--teal);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
  }

  .bench-label::before,
  .bench-label::after {
    content: "";
    height: 1px;
    flex: 1;
    background: linear-gradient(90deg, transparent, rgba(247, 241, 230, 0.32), transparent);
  }

  .grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-content: start;
    gap: 16px;
    flex: 0 0 auto;
    width: 100%;
    padding: 18px 12px 8px;
  }

  .tile {
    width: 196px;
    flex: 0 0 196px;
    gap: 12px;
    padding: 20px 12px 16px;
    border: 1px solid rgba(247, 241, 230, 0.12);
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.045);
    transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
  }

  .tile-icon {
    width: 92px;
    height: 92px;
  }

  .tile-icon svg {
    width: 44px;
    height: 44px;
  }

  .tile-label {
    max-width: none;
    font-size: 14.5px;
  }

  .tile-by {
    display: block;
    min-height: 1.15em;
    color: var(--gold);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .tile.is-soon {
    background: transparent;
    border-style: dashed;
    border-color: rgba(245, 196, 81, 0.32);
  }

  .tile.is-soon .tile-icon {
    border: 0;
    background: transparent;
  }

  .soon-pill {
    font-size: 9px;
  }

  .dock {
    display: none;
  }

  #home .toast {
    bottom: 22px;
  }

  .empty-bench {
    flex: 1 0 100%;
    margin: 8px;
    text-align: center;
  }
}

/* Tall tablet: keep the desk a solid object, with the bench centred under the clock. */
@media (min-width: 820px) and (max-width: 1099px) {
  #home.home {
    min-height: min(720px, calc(100dvh - 160px));
  }

  .home-intro {
    margin-top: auto;
  }

  .grid {
    margin-bottom: auto;
  }
}

@media (min-width: 820px) and (hover: hover) {
  #lock-btn:hover {
    background: rgba(255, 255, 255, 0.14);
    color: var(--gold);
  }

  .key:hover {
    border-color: rgba(45, 212, 191, 0.5);
    background: rgba(45, 212, 191, 0.14);
  }

  .tile:hover {
    transform: translateY(-5px);
    border-color: rgba(247, 241, 230, 0.28);
    background: rgba(255, 255, 255, 0.08);
  }

  .tile:hover .tile-icon {
    transform: scale(1.05);
  }

  .tile:hover .tint-gold {
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.65),
      0 14px 28px rgba(245, 196, 81, 0.38);
  }

  .tile:hover .tint-teal {
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.65),
      0 14px 28px rgba(45, 212, 191, 0.34);
  }

  .tile:hover .tint-purple {
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.65),
      0 14px 28px rgba(139, 111, 212, 0.4);
  }

  .tile:hover .tint-flame {
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.65),
      0 14px 28px rgba(240, 115, 42, 0.36);
  }

  .tile.is-soon:hover {
    background: rgba(245, 196, 81, 0.06);
    border-color: rgba(245, 196, 81, 0.6);
  }

  .tile.is-soon:hover .tile-icon {
    transform: scale(1.04);
  }

  .mascot-btn:hover .flask {
    filter: drop-shadow(0 12px 18px rgba(245, 196, 81, 0.28));
  }
}

@media (min-width: 1100px) {
  #gate,
  #home {
    width: min(1080px, 100%);
  }

  .gate {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(300px, 0.92fr);
    grid-template-areas:
      "status status"
      "hero prompt"
      "hero dots"
      "hero msg"
      "hero keys"
      "foot foot";
    column-gap: 28px;
    align-items: center;
    justify-items: center;
    padding: 8px 44px 28px;
  }

  .gate .status {
    grid-area: status;
    justify-self: stretch;
  }

  .gate-hero {
    grid-area: hero;
    justify-content: center;
  }

  .gate .mascot-btn {
    width: 210px;
  }

  .gate h1 {
    font-size: 3.5rem;
  }

  .gate-prompt {
    grid-area: prompt;
    align-self: end;
    margin: 0 0 12px;
    font-size: 1.85rem;
  }

  .gate .dots {
    grid-area: dots;
  }

  .gate .pin-msg {
    grid-area: msg;
    margin-top: 8px;
  }

  .gate .keypad {
    grid-area: keys;
    align-self: start;
    margin-top: 16px;
    grid-template-columns: repeat(3, 76px);
    gap: 12px 18px;
  }

  .gate .key,
  .gate .key-spacer {
    width: 76px;
    height: 76px;
  }

  .gate .key {
    font-size: 30px;
  }

  .gate-foot {
    grid-area: foot;
    justify-self: stretch;
    margin-top: 16px;
  }

  html.is-unlocked #home.home {
    display: grid;
    grid-template-columns: minmax(280px, 0.92fr) minmax(340px, 1.08fr);
    grid-template-areas:
      "status status"
      "intro bench"
      "intro apps";
    column-gap: 36px;
    align-items: center;
    padding: 8px 40px 32px;
  }

  #home .status {
    grid-area: status;
  }

  .home-intro {
    grid-area: intro;
    grid-template-columns: 1fr;
    justify-items: start;
    justify-content: center;
    width: auto;
    margin: 0;
    padding: 12px 8px 12px 4px;
    text-align: left;
  }

  .home-intro .eyebrow {
    margin-top: 14px;
  }

  .home-intro .mascot-btn {
    width: 176px;
  }

  .home-intro h1 {
    font-size: 3.6rem;
  }

  .motto {
    max-width: 22em;
  }

  .bench-label {
    grid-area: bench;
    align-self: end;
    margin: 0 0 4px;
    justify-content: flex-start;
  }

  .bench-label::before,
  .bench-label::after {
    display: none;
  }

  .grid {
    grid-area: apps;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(176px, 1fr));
    align-self: start;
    padding: 0 0 4px;
  }

  .tile {
    width: auto;
    flex: none;
  }

  .tile-icon {
    width: 100px;
    height: 100px;
  }

  .tile-icon svg {
    width: 48px;
    height: 48px;
  }
}

@media (min-width: 1500px) {
  body:not(:has(.app-shell)) .device {
    padding: 40px 48px;
  }

  body:not(:has(.app-shell)) .orb-a {
    width: 720px;
    height: 720px;
    top: -220px;
    right: -80px;
  }

  body:not(:has(.app-shell)) .orb-b {
    width: 860px;
    height: 860px;
    left: -260px;
    bottom: -260px;
  }

  #gate {
    width: min(1240px, 100%);
  }

  #home {
    width: min(1520px, 100%);
    min-height: min(700px, calc(100dvh - 120px));
  }

  .gate {
    padding: 12px 64px 36px;
    column-gap: 48px;
  }

  .gate .mascot-btn {
    width: 248px;
  }

  .gate h1 {
    font-size: 4.35rem;
  }

  .gate-prompt {
    font-size: 2.15rem;
  }

  .gate .keypad {
    grid-template-columns: repeat(3, 88px);
    gap: 14px 22px;
  }

  .gate .key,
  .gate .key-spacer {
    width: 88px;
    height: 88px;
  }

  .gate .key {
    font-size: 34px;
  }

  html.is-unlocked #home.home {
    grid-template-columns: minmax(420px, 0.9fr) minmax(520px, 1.1fr);
    column-gap: 64px;
    align-content: center;
    padding: 18px 64px 36px;
    border-radius: 42px;
  }

  .home-intro .mascot-btn {
    width: 240px;
  }

  .home-intro h1 {
    font-size: 4.8rem;
  }

  .lede,
  .motto {
    font-size: 17px;
  }

  .grid {
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 20px;
  }

  .tile {
    padding: 26px 16px 20px;
    border-radius: 32px;
  }

  .tile-icon {
    width: 128px;
    height: 128px;
  }

  .tile-icon svg {
    width: 58px;
    height: 58px;
  }

  .tile-label {
    font-size: 16px;
  }
}

@media (min-width: 1100px) and (max-height: 760px) {
  .gate .mascot-btn {
    width: 148px;
  }

  .gate h1 {
    font-size: 2.7rem;
  }

  .gate .keypad {
    grid-template-columns: repeat(3, 62px);
    gap: 8px 14px;
  }

  .gate .key,
  .gate .key-spacer {
    width: 62px;
    height: 62px;
  }

  .gate .key {
    font-size: 26px;
  }

  .home-intro .mascot-btn {
    width: 120px;
  }

  .home-intro h1 {
    font-size: 2.8rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
