html, body { height: 100%; overflow: hidden; }

:root {
  --gap: 8px;
  --radius: calc(16px * var(--round));
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* The site is one open page on black, with no panels. */

.app {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100dvh;
  background: var(--void);
}

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.875rem clamp(1rem, 4vw, 3rem);
}
.brand { display: inline-flex; align-items: center; gap: 0.625rem; }
.topbar-user { display: flex; align-items: center; justify-content: flex-end; gap: 0.75rem; }

.link-btn { color: var(--ash); font-weight: 650; transition: color 0.15s; }
.link-btn:hover { color: var(--ink); }

.icon-btn { border-radius: calc(11px * var(--round)); }
.btn-small { min-height: 2.25rem; padding-inline: 0.875rem; font-size: var(--step--1); }
.btn-small .icon { width: 1rem; height: 1rem; }
.btn-wide { width: 100%; }
.btn-big { min-height: 3.25rem; padding-inline: 1.5rem; font-size: var(--step-1); }

.avatar {
  --hue: 215;
  flex: none; display: grid; place-items: center;
  width: 2.5rem; height: 2.5rem;
  border-radius: 50%;
  background: oklch(0.42 0.13 var(--hue)); color: #fff;
  font-weight: 700;
  overflow: hidden;
}
button.avatar { transition: box-shadow 0.15s; }
button.avatar:hover { box-shadow: 0 0 0 3px var(--dusk-high); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-big { width: 7rem; height: 7rem; font-size: var(--step-3); }

.main { position: relative; min-height: 0; overflow-y: auto; outline: none; }
.stage { position: relative; min-height: 100%; }
.stage:has(.home) { height: 100%; }

.page { width: min(56rem, 100%); margin-inline: auto; padding: 1.5rem clamp(1rem, 4vw, 2rem) 3rem; }
.page-title { font-size: clamp(2rem, 4vw, 3rem); font-weight: 750; line-height: 1.05; letter-spacing: -0.02em; margin-bottom: 1rem; }
.block-title { font-size: var(--step-2); font-weight: 700; line-height: 1.2; margin-bottom: 0.625rem; }
.hint { color: var(--ash); }

/* Home */

.home {
  position: relative; overflow: hidden;
  min-height: 100%;
  display: grid; grid-template-rows: minmax(0, 1fr) auto;
  padding: 0 clamp(1rem, 4vw, 3rem) 1.5rem;
}
.home-sky { position: absolute; inset: 0; width: 100%; height: 100%; }
.home-copy {
  position: relative; align-self: center;
  display: grid; justify-items: start; gap: 1rem;
  width: min(35rem, 100%);
}
.home-copy h1 {
  font-size: clamp(3rem, 6.4vw, 5.5rem); font-weight: 800; line-height: 0.96; letter-spacing: -0.035em;
  text-wrap: balance;
}
.home-copy p { max-width: 28rem; color: var(--ash); font-size: var(--step-1); line-height: 1.4; }

.launch { display: flex; flex-wrap: wrap; align-items: center; gap: 0.625rem; margin-top: 0.75rem; }
.launch-join {
  display: flex; align-items: center;
  height: 3.25rem; padding: 0.25rem;
  background: color-mix(in srgb, var(--dusk-raised) 75%, transparent);
  border: 1px solid var(--line);
  border-radius: var(--key);
  transition: border-color 0.15s;
}
.launch-join:focus-within { border-color: var(--accent); }
.launch-join input { width: 12.5rem; min-width: 0; height: 100%; padding-inline: 0.75rem; background: none; border: 0; outline: none; }
.launch-join input::placeholder { color: var(--ash); }
.launch-join .btn { min-height: 100%; box-shadow: none; color: var(--accent-soft); }

.home-meetings { position: relative; min-width: 0; }
.shelf-title { margin-bottom: 0.5rem; color: var(--ash); font-size: var(--step-0); font-weight: 600; }
.meet-shelf {
  display: flex; gap: 0.5rem;
  overflow-x: auto; scroll-snap-type: x proximity;
  padding-bottom: 0.25rem;
}
.meet-card {
  flex: 0 0 min(17.5rem, 85%);
  display: flex; align-items: center;
  scroll-snap-align: start;
  background: color-mix(in srgb, var(--dusk-raised) 72%, transparent);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  backdrop-filter: blur(14px);
  transition: border-color 0.15s;
}
.meet-card:hover { border-color: color-mix(in srgb, var(--accent) 55%, transparent); }
.meet-link { flex: 1; min-width: 0; display: flex; align-items: center; gap: 0.75rem; padding: 0.625rem 0 0.625rem 0.625rem; }
.meet-names { min-width: 0; display: grid; line-height: 1.3; }
.meet-names b, .meet-names small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meet-names b { font-weight: 650; }
.meet-names small { color: var(--ash); font-size: var(--step--1); }
.meet-card.is-live .meet-names small { color: var(--accent-soft); }

/* A meeting's remaining time, running down from full */

.time-ring { position: relative; flex: none; display: grid; place-items: center; width: 2.75rem; height: 2.75rem; }
.time-ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); fill: none; stroke-width: 3; stroke: var(--dusk-high); }
.time-ring .time-left { stroke: var(--accent); stroke-linecap: round; }
.time-ring > span { color: var(--ink); font-size: 0.75rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.time-ring .icon { width: 1rem; height: 1rem; color: var(--accent); }

/* The card after New meeting */

.ready form { display: grid; gap: 0.875rem; }
.ready h2 { margin-bottom: 0; font-size: var(--step-3); font-weight: 800; letter-spacing: -0.025em; line-height: 1.05; }
.ready .dialog-actions { flex-wrap: wrap; margin-top: 0.375rem; }
.ready-link {
  display: flex; align-items: center; gap: 0.5rem;
  min-height: 2.75rem; padding-left: 0.875rem;
  background: var(--void);
  border: 1px solid var(--line);
  border-radius: calc(10px * var(--round));
}
.ready-link .selectable { flex: 1; min-width: 0; color: var(--accent-soft); font-weight: 600; overflow-wrap: anywhere; }

.empty { display: grid; justify-items: start; gap: 0.75rem; width: min(34rem, 100%); margin-inline: auto; padding: 16vh 1.5rem 0; }
.empty h1 { font-size: var(--step-3); font-weight: 750; line-height: 1.1; }
.empty p { color: var(--ash); }
.empty-actions { display: flex; gap: 0.625rem; margin-top: 0.5rem; }

/* Sign in */

.auth {
  position: fixed; inset: 0; z-index: 50;
  display: grid; align-items: center; justify-items: start;
  padding: 1rem clamp(1rem, 9vw, 8rem); overflow-y: auto;
  background: var(--void);
}
.auth-sky { position: fixed; inset: 0; width: 100%; height: 100%; }
.auth-card { position: relative; display: grid; gap: 1rem; justify-items: start; width: min(24rem, 100%); }
.auth-brand { display: flex; align-items: center; gap: 0.625rem; }
.auth-card h1 { font-size: var(--step-3); font-weight: 800; line-height: 1.05; letter-spacing: -0.02em; }
.auth-card form { display: grid; gap: 0.875rem; width: 100%; margin-top: 0.25rem; }
.auth-card .form-error { margin: 0; min-height: 0; }
.input-wrap { position: relative; display: block; }
.input-wrap > .icon { position: absolute; left: 0.75rem; top: 50%; width: 1.125rem; height: 1.125rem; margin-top: -0.5625rem; color: var(--ash); pointer-events: none; }
.input-wrap .input { padding-left: 2.5rem; }
.input-wrap:focus-within > .icon { color: var(--accent); }
.auth-switch { color: var(--ash); }
.auth-switch a { color: var(--ink); font-weight: 700; text-decoration: underline; }
.auth-back { color: var(--ash); font-size: var(--step--1); }
.auth-back:hover { color: var(--ink); }

/* Account */

.account { max-width: 30rem; }
.account-avatar { display: flex; align-items: center; gap: 1.25rem; margin-top: 1.5rem; }
.account-avatar .block-title { margin-bottom: 0.625rem; }
.account-avatar-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.account-avatar-actions label { cursor: pointer; }
.account-avatar-actions label:focus-within { outline: 2px solid var(--accent-soft); outline-offset: 2px; }

.crop { display: grid; justify-items: center; gap: 0.875rem; }
.crop canvas { width: 17.5rem; height: 17.5rem; border-radius: 50%; background: #000; cursor: grab; touch-action: none; }
.crop canvas:active { cursor: grabbing; }
.crop .range { width: 100%; flex: none; }
.account-form { display: grid; gap: 0.75rem; justify-items: start; margin-top: 2rem; }
.account-form .field { width: 100%; }
.account-form .form-error { margin: 0; }

.empty {
  display: grid; justify-items: start; gap: 0.75rem;
  max-width: 34rem; padding: 16vh clamp(1rem, 2.5vw, 1.75rem) 0;
}
.empty .art { width: 9.5rem; height: 9.5rem; margin-left: -1rem; }
.empty h1 { font-size: var(--step-3); font-weight: 700; line-height: 1.1; }
.empty p { color: var(--ash); }
.empty-actions { display: flex; gap: 0.625rem; margin-top: 0.5rem; }

/* One thin line for progress and volume */

.range {
  --level: 0%;
  flex: 1; min-width: 0;
  height: 1rem; margin: 0;
  appearance: none; background: none; cursor: pointer;
}
.range::-webkit-slider-runnable-track {
  height: 4px; border-radius: 2px;
  background: linear-gradient(90deg, var(--ink) var(--level), color-mix(in srgb, var(--ink) 22%, transparent) var(--level));
}
.range:hover::-webkit-slider-runnable-track {
  background: linear-gradient(90deg, var(--accent) var(--level), color-mix(in srgb, var(--ink) 22%, transparent) var(--level));
}
.range::-moz-range-track { height: 4px; border-radius: 2px; background: color-mix(in srgb, var(--ink) 22%, transparent); }
.range::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--ink); }
.range:hover::-moz-range-progress { background: var(--accent); }
.range::-webkit-slider-thumb {
  appearance: none; width: 12px; height: 12px; margin-top: -4px;
  border-radius: 50%; background: var(--ink);
  opacity: 0; transition: opacity 0.15s;
}
.range::-moz-range-thumb { width: 12px; height: 12px; border: 0; border-radius: 50%; background: var(--ink); opacity: 0; transition: opacity 0.15s; }
.range:hover::-webkit-slider-thumb, .range:focus-visible::-webkit-slider-thumb { opacity: 1; }
.range:hover::-moz-range-thumb, .range:focus-visible::-moz-range-thumb { opacity: 1; }

/* Appearance */

.appearance { max-width: 56rem; }
.appearance section { margin-top: 2rem; }
.appearance .block-title { margin-bottom: 0.875rem; }

.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: 0.75rem; }
.theme-card { position: relative; min-width: 0; }
.theme-card > button:first-child { display: grid; gap: 0.5rem; width: 100%; text-align: left; font-weight: 600; }
.theme-card > button:first-child > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.theme-sample {
  position: relative; display: block; overflow: hidden;
  height: 5rem;
  border-radius: calc(10px * var(--round));
  box-shadow: inset 0 0 0 1px var(--line);
  transition: box-shadow 0.15s, transform 0.2s var(--ease);
}
.theme-sample i { position: absolute; left: 0.625rem; bottom: 0.625rem; width: 1.5rem; height: 1.5rem; border-radius: 50%; }
.theme-sample b { position: absolute; left: 0.625rem; top: 0.75rem; width: 55%; height: 0.375rem; border-radius: 3px; opacity: 0.75; }
.theme-sample u { position: absolute; left: 0.625rem; top: 1.5rem; width: 35%; height: 0.375rem; border-radius: 3px; opacity: 0.4; }
.theme-card:hover .theme-sample { transform: translateY(-2px); }
button[aria-pressed='true'] .theme-sample { box-shadow: 0 0 0 2px var(--accent-soft); }
.theme-delete { position: absolute; right: 0.25rem; top: 0.25rem; width: 2rem; height: 2rem; background: var(--dusk-high); }
.theme-delete .icon { width: 1rem; height: 1rem; }

.theme-controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem 2rem; }
.theme-field { display: grid; gap: 0.5rem; min-width: 0; }
.theme-field > span { display: flex; justify-content: space-between; gap: 1rem; color: var(--ash); font-size: var(--step--1); }
.theme-field output { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.theme-color { display: flex; align-items: center; gap: 0.625rem; }
.theme-color input[type='color'] {
  flex: none; width: 2.75rem; height: 2.75rem; padding: 0;
  background: none; border: 1px solid var(--line); border-radius: calc(8px * var(--round));
  cursor: pointer; overflow: hidden;
}
.theme-color input[type='color']::-webkit-color-swatch-wrapper { padding: 0; }
.theme-color input[type='color']::-webkit-color-swatch { border: 0; }
.theme-fonts { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.theme-fonts button { padding: 0.4375rem 0.875rem; border-radius: calc(10px * var(--round)); box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow 0.15s; }
.theme-fonts button[aria-pressed='true'] { background: var(--accent); color: var(--on-accent); box-shadow: none; }
.theme-warning { display: flex; align-items: center; gap: 0.5rem; margin-top: 1rem; color: var(--danger); font-size: var(--step--1); }
.theme-warning .icon { width: 1rem; height: 1rem; }
.theme-actions { display: flex; flex-wrap: wrap; gap: 0.625rem; margin-top: 1.5rem; }

/* Menus */

.menu {
  position: fixed; z-index: 60;
  display: grid; width: 15.5rem; max-height: 60vh; overflow-y: auto;
  padding: 0.25rem;
  background: var(--dusk-high);
  border: 1px solid var(--line);
  border-radius: var(--key);
  box-shadow: 0 16px 34px rgb(0 0 0 / 0.55);
  animation: menu-in 0.14s var(--ease);
}
@keyframes menu-in { from { opacity: 0; transform: translateY(-4px); } }
.menu button {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.5rem 0.75rem; border-radius: calc(9px * var(--round)); text-align: left;
}
.menu button .icon { width: 1.125rem; height: 1.125rem; color: var(--ash); fill: none; transition: color 0.12s; }
.menu button:hover .icon, .menu button:focus-visible .icon { color: var(--accent-soft); }
.menu button span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu button:hover, .menu button:focus-visible { background: color-mix(in srgb, var(--ink) 10%, transparent); outline: none; }
.menu hr { width: 100%; margin: 0.25rem 0; border: 0; border-top: 1px solid var(--line); }
.menu p { padding: 0.25rem 0.75rem; color: var(--ash); font-size: var(--step--1); }

.menu button.is-danger, .menu button.is-danger .icon { color: var(--danger); }


.menu-slider { display: grid; gap: 0.125rem; padding: 0.375rem 0.75rem 0.5rem; color: var(--ash); font-size: var(--step--1); }
.menu-slider .range { width: 100%; }
.menu-slider .range::-webkit-slider-thumb { opacity: 1; }

.tabs { display: none; }

/* Phones */

@media (max-width: 760px) {
  :root { --tabs-height: 3.75rem; --dock-height: calc(var(--tabs-height) + 0.75rem); }

  .app { padding-bottom: calc(var(--tabs-height) + env(safe-area-inset-bottom)); }
  .topbar { padding-block: 0.625rem; }
  .topbar .icon-btn, .link-btn { display: none; }

  .tabs {
    position: fixed; inset: auto 0 0; z-index: 25;
    display: flex; justify-content: space-around;
    height: calc(var(--tabs-height) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: var(--void);
    border-top: 1px solid var(--line);
  }
  .tabs a { flex: 1; display: grid; place-items: center; align-content: center; gap: 0.125rem; color: var(--ash); font-size: 0.625rem; }
  .tabs a[aria-current='page'] { color: var(--accent-soft); }

  .home { grid-template-rows: auto auto; align-content: start; gap: 1.25rem; min-height: 100%; padding-top: 13.5rem; }
  .home-copy { gap: 0.75rem; }
  .home-copy h1 { font-size: 2.75rem; }
  .home-copy p { font-size: var(--step-0); }
  .launch { margin-top: 0.25rem; }
  .launch, .launch-join, .launch .btn-primary { width: 100%; }
  .launch-join input { flex: 1; width: auto; }
  .theme-controls { grid-template-columns: minmax(0, 1fr); }
  .auth { justify-items: center; }
}
