:root {
  color-scheme: light;
  --canvas: #f5f5f7;
  --ink: #1d1d1f;
  --muted: #86868b;
  --line: rgba(0, 0, 0, .08);
  --shadow: 0 34px 70px rgba(0, 0, 0, .13), 0 3px 9px rgba(0, 0, 0, .07);
}

* { box-sizing: border-box; }
html { background: var(--canvas); }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: radial-gradient(circle at 50% 38%, rgba(255, 255, 255, .95), transparent 32rem), var(--canvas);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.75;
}

.site-header {
  position: fixed;
  z-index: 5;
  inset: 0 0 auto;
  height: 80px;
  padding: 0 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand { color: var(--ink); text-decoration: none; }
.brand-name { display: none; }

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  background: #1d1d1f;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -.03em;
  box-shadow: inset 0 1px rgba(255, 255, 255, .18), 0 1px 3px rgba(0, 0, 0, .14);
}

.sign-out {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #55555a;
  background: rgba(255, 255, 255, .7);
  box-shadow: inset 0 0 0 1px var(--line), 0 2px 8px rgba(0, 0, 0, .04);
  backdrop-filter: blur(18px);
  cursor: pointer;
  transition: transform .22s ease, color .22s ease, background .22s ease;
}

.sign-out:hover { color: #000; background: #fff; transform: translateY(-1px); }
.sign-out svg { width: 18px; height: 18px; }
main { min-height: 100vh; }

.portal-view {
  min-height: 100vh;
  padding: 110px 32px 92px;
  display: grid;
  place-items: center;
}

.single-view { align-content: center; gap: 46px; }
.entry-copy { text-align: center; }

.entry-copy span,
.message-view span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.entry-copy h1,
.message-view h1 {
  margin: 10px 0 0;
  font-size: clamp(38px, 5vw, 58px);
  font-weight: 600;
  letter-spacing: -.055em;
  line-height: 1;
}

.device-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(190px, 236px));
  gap: clamp(38px, 6vw, 76px);
}

.device-link {
  display: grid;
  justify-items: center;
  gap: 24px;
  color: var(--ink);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.device {
  position: relative;
  width: min(54vw, 236px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 54px;
  background: linear-gradient(145deg, rgba(255, 255, 255, .08), transparent 42%), linear-gradient(160deg, #303034, #171719 68%);
  box-shadow: var(--shadow), inset 0 1px rgba(255, 255, 255, .16), inset 0 -1px rgba(0, 0, 0, .5);
  transition: transform .32s cubic-bezier(.2, .8, .2, 1), box-shadow .32s ease;
}

.device.light {
  border-color: rgba(255, 255, 255, .9);
  background: linear-gradient(145deg, rgba(255, 255, 255, .9), transparent 38%), linear-gradient(160deg, #e8e8ea, #bebec2 72%);
  box-shadow: 0 34px 70px rgba(0, 0, 0, .12), 0 3px 9px rgba(0, 0, 0, .06), inset 0 1px #fff, inset 0 -1px rgba(0, 0, 0, .13);
}

.device::before {
  content: "";
  position: absolute;
  inset: 15px;
  border-radius: 42px;
  border: 1px solid rgba(255, 255, 255, .045);
}

.device.light::before { border-color: rgba(255, 255, 255, .46); }

.device::after {
  content: "";
  position: absolute;
  left: 21%;
  right: 21%;
  bottom: -5px;
  height: 10px;
  border-radius: 50%;
  background: rgba(0, 0, 0, .22);
  filter: blur(3px);
}

.device-icon {
  position: relative;
  z-index: 1;
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #1d1d1f;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .16), inset 0 1px #fff;
}

.light .device-icon {
  color: #fff;
  background: #1d1d1f;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .19), inset 0 1px rgba(255, 255, 255, .18);
}

.device-icon svg { width: 25px; height: 25px; }
.device-icon svg path[d^="m9"] { fill: currentColor; stroke: none; }

.device-light {
  position: absolute;
  right: 27px;
  bottom: 25px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #8ee53f;
  box-shadow: 0 0 7px rgba(142, 229, 63, .75);
}

.device-link:hover .device,
.device-link:focus-visible .device {
  transform: translateY(-8px) scale(1.015);
  box-shadow: 0 42px 80px rgba(0, 0, 0, .16), 0 5px 12px rgba(0, 0, 0, .08), inset 0 1px rgba(255, 255, 255, .16);
}

.device-link:active .device { transform: translateY(-2px) scale(.985); }

.device-link:focus-visible {
  outline: 3px solid rgba(0, 122, 255, .44);
  outline-offset: 10px;
  border-radius: 8px;
}

.device-label { font-size: 17px; font-weight: 560; letter-spacing: -.02em; }
.message-view { text-align: center; }
.message-view p { color: var(--muted); margin: 16px 0 0; }

.loading { height: 100vh; display: grid; place-items: center; }
.loading::after {
  content: "";
  width: 22px;
  height: 22px;
  border: 2px solid rgba(0, 0, 0, .08);
  border-top-color: #1d1d1f;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

.loading span, footer { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 620px) {
  .site-header { height: 68px; padding: 0 20px; }
  .brand-mark { width: 31px; height: 31px; border-radius: 9px; }
  .sign-out { width: 39px; height: 39px; }
  .portal-view { padding: 94px 24px 64px; }
  .device-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; width: min(100%, 390px); }
  .device-grid .device { width: 100%; }
  .single-view .device { width: min(58vw, 218px); }
  .device { border-radius: clamp(34px, 10vw, 46px); }
  .device::before { inset: 11px; border-radius: clamp(27px, 8vw, 37px); }
  .device-icon { width: 50px; height: 50px; }
  .device-icon svg { width: 22px; height: 22px; }
  .device-light { right: 21px; bottom: 20px; }
  .device-label { font-size: 15px; }
  .single-view { gap: 36px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation-duration: .01ms !important; }
}
