/* The guest Wi-Fi card of a hotel room, alone on white. GSAP moves only whole elements (the card, the letters, the
   arcs, the QR squares, the lines of text); colours, edges and states live in CSS on classes. A GSAP element never
   has a transform in the CSS. */
:root {
  --page: #ffffff;          /* the page */
  --card: #ffffff;          /* the card */
  --card-low: #fbfaf7;      /* the bottom of the card */
  --edge: rgba(23, 28, 33, 0.09);   /* the card edge */
  --ink: #171c21;           /* the main text */
  --muted: #7b8086;         /* labels and notes */
  --faint: #e6e3dc;         /* arcs still dark, the tab track */
  --sand: #f4f1ea;          /* the field and the tabs */
  --lagoon: #2b7a6b;        /* the one accent: lit arcs, copied, online */
  --lagoon-deep: #1d5a4f;   /* the accent in shadow */
  --lagoon-soft: #e4f1ed;   /* the accent as a tint */
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--page);
  color: var(--ink);
  font-family: "Mona Sans Variable", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
button:focus-visible { outline: 2px solid var(--lagoon); outline-offset: 3px; }

.stage {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 16px;
}

/* ---- the card ---- */
.wifi {
  position: relative;
  width: min(352px, 90vw);
  padding: clamp(13px, 3.2vh, 20px) clamp(13px, 4vw, 18px);
  border-radius: 24px;
  background: linear-gradient(180deg, var(--card) 0%, var(--card-low) 100%);
  border: 1px solid var(--edge);
  box-shadow:
    0 1px 1px rgba(23, 28, 33, 0.04),
    0 4px 10px -4px rgba(23, 28, 33, 0.07),
    0 22px 44px -20px rgba(23, 28, 33, 0.22),
    0 50px 80px -50px rgba(29, 90, 79, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 1);
  display: grid;
  gap: clamp(8px, 2vh, 13px);
  isolation: isolate;
}
/* a soft light that follows the pointer, clipped to the card by its own radius */
.wifi__glow {
  position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: -1;
  background: radial-gradient(220px 160px at var(--gx, 50%) var(--gy, 0%), rgba(43, 122, 107, 0.07), transparent 70%);
  opacity: 0; transition: opacity 0.5s ease;
}
.wifi.is-online .wifi__glow, .wifi.is-lit .wifi__glow { opacity: 1; }
/* the 1px edge that catches the light at the top */
.wifi__edge {
  position: absolute; inset: -1px; border-radius: inherit; pointer-events: none;
  padding: 1px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(43, 122, 107, 0) 40%),
              radial-gradient(160px 60px at var(--gx, 50%) 0%, rgba(43, 122, 107, 0.45), transparent 70%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0.0; transition: opacity 0.6s ease;
}
.wifi.is-online .wifi__edge, .wifi.is-lit .wifi__edge { opacity: 1; }

/* ---- the head ---- */
.head { display: flex; align-items: center; gap: 10px; }
.mark {
  width: 32px; height: 32px; border-radius: 10px; flex: none;
  display: grid; place-items: center;
  background: linear-gradient(180deg, #2f8373, var(--lagoon-deep));
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.35) inset, 0 4px 10px -4px rgba(29, 90, 79, 0.6);
}
.mark svg { width: 16px; height: 16px; fill: none; stroke: #f3f8f6; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.head__txt { display: grid; line-height: 1.2; min-width: 0; }
.head__name { font-size: 14px; font-weight: 650; letter-spacing: -0.01em; }
.head__sub { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.head__sub b { font-weight: 600; color: var(--ink); }
.chip {
  margin-left: auto; flex: none;
  height: 24px; padding: 0 10px; border-radius: 999px;
  display: grid; align-items: center;
  font-size: 11px; font-weight: 560; color: var(--muted);
  background: var(--sand);
  box-shadow: inset 0 0 0 1px rgba(23, 28, 33, 0.05);
  transition: color 0.4s ease, background-color 0.4s ease, box-shadow 0.4s ease;
  overflow: hidden;
}
.wifi.is-online .chip { color: var(--lagoon-deep); background: var(--lagoon-soft); box-shadow: inset 0 0 0 1px rgba(43, 122, 107, 0.18); }
.chip__roll { display: grid; height: 24px; align-items: center; }
.chip__line { grid-area: 1 / 1; white-space: nowrap; line-height: 24px; }

/* ---- the network row ---- */
.net { display: flex; align-items: center; gap: 12px; padding: 2px 0; }
.arcs { width: clamp(46px, 13vh, 58px); height: auto; flex: none; overflow: visible; }
.arc { fill: none; stroke-width: 4.2; stroke-linecap: round; }
.arc--track { stroke: var(--faint); }
.arc--lit { stroke: url(#arcLit); }
.wifi.is-online .arcs { filter: drop-shadow(0 5px 8px rgba(43, 122, 107, 0.28)); }
.arcs { transition: filter 0.6s ease; }
.wedge { fill: var(--faint); transition: fill 0.4s ease; }
.wifi.is-online .wedge, .wifi.is-lit .wedge { fill: var(--lagoon-deep); }
.net__txt { display: grid; min-width: 0; line-height: 1.25; flex: 1; }
.net__name { font-size: clamp(15px, 4.4vh, 17px); font-weight: 640; font-stretch: 96%; letter-spacing: -0.015em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.net__meta { display: grid; height: 17px; overflow: hidden; font-size: 11.5px; color: var(--muted); }
.net__line { grid-area: 1 / 1; white-space: nowrap; line-height: 17px; }
.speed { display: grid; justify-items: end; line-height: 1; opacity: 0.35; transition: opacity 0.4s ease; flex: none; }
.wifi.is-online .speed { opacity: 1; }
.speed__num { font-size: 20px; font-weight: 660; font-stretch: 90%; letter-spacing: -0.02em; }
.speed__unit { font-size: 10.5px; color: var(--muted); margin-top: 3px; }

/* ---- the tabs ---- */
.tabs {
  position: relative;
  display: grid; grid-template-columns: 1fr 1fr;
  padding: 3px; border-radius: 12px;
  background: var(--sand);
  box-shadow: inset 0 1px 2px rgba(23, 28, 33, 0.05);
}
.tabs__pill {
  position: absolute; top: 3px; left: 3px; bottom: 3px; width: calc(50% - 3px);
  border-radius: 9px; background: #fff;
  box-shadow: 0 1px 2px rgba(23, 28, 33, 0.08), 0 3px 8px -3px rgba(23, 28, 33, 0.12), inset 0 0 0 1px rgba(23, 28, 33, 0.04);
}
.tab {
  position: relative; height: clamp(26px, 7vh, 30px); border-radius: 9px;
  font-size: 12.5px; font-weight: 520; color: var(--muted);
  transition: color 0.3s ease, font-weight 0.3s ease;
}
.tab.is-on { color: var(--ink); font-weight: 610; }

/* ---- the panel ---- */
.panel { position: relative; height: clamp(76px, 21vh, 96px); }
.view { position: absolute; inset: 0; display: grid; align-content: center; gap: 7px; }
.view--qr { grid-template-columns: auto 1fr; align-items: center; gap: 14px; visibility: hidden; }

.field {
  position: relative;
  display: flex; align-items: center;
  height: clamp(42px, 11vh, 48px);
  padding: 0 6px 0 14px; border-radius: 13px;
  background: var(--sand);
  box-shadow: inset 0 0 0 1px rgba(23, 28, 33, 0.05), inset 0 1px 2px rgba(23, 28, 33, 0.05);
}
.field__clip { position: absolute; inset: 0; border-radius: inherit; overflow: hidden; pointer-events: none; }
.field__sweep {
  position: absolute; top: 0; bottom: 0; left: 0; width: 46%;
  border-radius: 13px;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.9) 45%, rgba(214, 238, 230, 0.8) 55%, transparent);
  opacity: 0; pointer-events: none;
}
.field__pw {
  position: relative; flex: 1; min-width: 0;
  font-family: "JetBrains Mono Variable", ui-monospace, monospace;
  font-size: clamp(13px, 3.9vw, 15px); font-weight: 520; letter-spacing: 0.01em;
  white-space: nowrap; display: flex;
}
.ch { display: inline-block; transition: color 0.35s ease; }
.ch.is-dash { color: var(--muted); }
.ch.is-num { color: var(--lagoon); }
.field.is-copied .ch { color: var(--lagoon-deep); }

.copy {
  position: relative; flex: none;
  width: 36px; height: 36px; border-radius: 10px;
  display: grid; place-items: center;
  background: #fff;
  box-shadow: 0 1px 2px rgba(23, 28, 33, 0.08), 0 4px 10px -5px rgba(23, 28, 33, 0.18), inset 0 0 0 1px rgba(23, 28, 33, 0.06);
  color: var(--ink);
  transition: background-color 0.3s ease, color 0.3s ease;
}
.field.is-copied .copy { background: var(--lagoon); color: #fff; }
.copy__icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }
.copy__tick { stroke-width: 2; stroke-dasharray: 16; stroke-dashoffset: 16; }

.toast {
  position: absolute; right: 48px; top: calc(50% - 12px);
  height: 24px; line-height: 24px; padding: 0 9px; border-radius: 8px;
  font-size: 11px; font-weight: 600; color: #fff;
  background: var(--ink);
  box-shadow: 0 6px 14px -6px rgba(23, 28, 33, 0.5);
  opacity: 0; visibility: hidden; pointer-events: none;
}
.note { font-size: 11px; color: var(--muted); padding-left: 2px; }

.qr__tile {
  display: grid; place-items: center;
  width: clamp(74px, 20.5vh, 94px); aspect-ratio: 1;
  padding: 7px; border-radius: 13px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(23, 28, 33, 0.07), 0 8px 18px -10px rgba(23, 28, 33, 0.3), inset 0 0 0 1px rgba(23, 28, 33, 0.07);
}
.qr { width: 100%; height: 100%; display: block; overflow: visible; }
.qr rect { fill: var(--ink); }
.qr rect.is-eye { fill: var(--lagoon-deep); }
.qr__txt { display: grid; gap: 4px; line-height: 1.3; min-width: 0; }
.qr__title { font-size: 13px; font-weight: 620; letter-spacing: -0.01em; }
.qr__sub { font-size: 11.5px; color: var(--muted); }
.qr__sub b { font-weight: 600; color: var(--ink); }

/* ---- the join button ---- */
.join {
  position: relative; height: clamp(42px, 11vh, 48px); border-radius: 14px;
  background: linear-gradient(180deg, #252b31, var(--ink));
  color: #fbfaf7;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.14) inset, 0 -1px 0 rgba(0, 0, 0, 0.3) inset, 0 8px 18px -10px rgba(23, 28, 33, 0.7);
  overflow: hidden;
  transition: background-color 0.4s ease, color 0.4s ease;
}
.join__fill {
  position: absolute; left: 0; top: 0; bottom: 0; width: 0;
  background: linear-gradient(90deg, rgba(63, 143, 127, 0.0), rgba(63, 143, 127, 0.55));
  pointer-events: none;
}
.join::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.10), transparent 55%);
}
.wifi.is-online .join { background: linear-gradient(180deg, #eef6f3, var(--lagoon-soft)); color: var(--lagoon-deep); box-shadow: inset 0 0 0 1px rgba(43, 122, 107, 0.2), 0 6px 14px -10px rgba(29, 90, 79, 0.5); }
.join__face { position: relative; display: flex; align-items: center; justify-content: center; gap: 7px; height: 100%; }
.join__tick { width: 0; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: width 0.35s ease; }
.join__tick path { stroke-dasharray: 14; stroke-dashoffset: 14; }
.wifi.is-online .join__tick { width: 16px; }
.join__roll { display: grid; overflow: hidden; height: 20px; }
.join__label { grid-area: 1 / 1; font-size: 14px; font-weight: 600; letter-spacing: -0.005em; line-height: 20px; white-space: nowrap; }

@media (hover: hover) {
  .tab:not(.is-on):hover { color: var(--ink); }
  .copy:hover { box-shadow: 0 1px 2px rgba(23, 28, 33, 0.1), 0 6px 14px -6px rgba(23, 28, 33, 0.28), inset 0 0 0 1px rgba(23, 28, 33, 0.1); }
  .wifi:hover .wifi__glow { opacity: 1; }
}

/* ---- the drawn pointer of the autopilot ---- */
.ghost {
  position: fixed; left: 0; top: 0; width: 22px; height: 22px; z-index: 10;
  pointer-events: none; opacity: 0; visibility: hidden;
  filter: drop-shadow(0 2px 3px rgba(23, 28, 33, 0.3));
}
.ghost path { fill: var(--ink); stroke: #fff; stroke-width: 1.4; stroke-linejoin: round; }

@media (max-height: 470px) {
  .note { display: none; }
}
