/* ---------------------------------------------------------------
   Hack Club QWERTY
   One photo, one screen, four apps.
   --------------------------------------------------------------- */

:root {
  --font: "LINE Seed JP", "Hiragino Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --phone-h: clamp(520px, 90vh, 940px);
  --phone-h: clamp(520px, 90svh, 940px);
  --phone-w: min(92vw, calc(var(--phone-h) * 0.55848));
  --ink: #111;
  --hint: #a3a3a3;
}

* { box-sizing: border-box; }

html { height: 100%; }

body {
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  justify-content: safe center;
  gap: 12px;
  padding: 16px;
  overflow-x: hidden;
  background: #fff;
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

/* ---------------------------------------------------------------
   The phone
   --------------------------------------------------------------- */

.stage {
  display: flex;
  align-items: center;
  justify-content: center;
}

.phone {
  position: relative;
  width: var(--phone-w);
  aspect-ratio: 1485 / 2659;
  filter: drop-shadow(0 20px 30px rgba(0, 0, 0, 0.12))
          drop-shadow(0 2px 5px rgba(0, 0, 0, 0.06));
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.phone__body {
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
  -webkit-user-drag: none;
}

/* The LCD, measured off the photo. */
.screen {
  position: absolute;
  left: 8.2155%;
  top: 16.43%;
  width: 83.905%;
  height: 35.15%;
  overflow: hidden;
  border-radius: 1.4%;
  background: #000;
  container-type: inline-size;
  font-family: var(--font);
  color: #fff;
  font-size: 3.75cqw;
  line-height: 1.33;
}

.view {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.view[hidden] { display: none; }

/* ---------------------------------------------------------------
   Homescreen
   --------------------------------------------------------------- */

.view--home {
    background:
    radial-gradient(110% 62% at 50% 100%, rgba(47, 77, 121, 0.17), rgba(47, 77, 121, 0) 74%),
    linear-gradient(180deg, #0c1117 0%, #070a0e 58%, #030405 100%);
}

.statusbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 1.2cqw;
  height: 6.6cqw;
  padding: 0 3.4cqw;
  color: #e9e9e9;
  font-size: 2.7cqw;
  letter-spacing: 0.02em;
}

.statusbar__signal {
  display: flex;
  align-items: flex-end;
  gap: 0.55cqw;
  height: 3.1cqw;
}

.statusbar__signal i {
  width: 0.75cqw;
  background: #e9e9e9;
  border-radius: 0.25cqw 0.25cqw 0 0;
}

.statusbar__signal i:nth-child(1) { height: 1.1cqw; }
.statusbar__signal i:nth-child(2) { height: 1.8cqw; }
.statusbar__signal i:nth-child(3) { height: 2.5cqw; }
.statusbar__signal i:nth-child(4) { height: 3.1cqw; }

.statusbar__battery {
  position: relative;
  margin-left: auto;
  width: 4.2cqw;
  height: 2.1cqw;
  padding: 0.28cqw;
  border: 1px solid #bdbdbd;
  border-radius: 0.5cqw;
}

.statusbar__battery i {
  display: block;
  width: 78%;
  height: 100%;
  background: #e9e9e9;
  border-radius: 0.2cqw;
}

.statusbar__battery::after {
  content: "";
  position: absolute;
  top: 0.55cqw;
  right: -0.75cqw;
  width: 0.45cqw;
  height: 1cqw;
  background: #bdbdbd;
  border-radius: 0 0.2cqw 0.2cqw 0;
}

.statusbar__time {
  color: #f2f2f2;
  font-size: 2.75cqw;
}

.icons {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-content: start;
  padding: 8.5cqw 1.4cqw 0;
}

.appicon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.8cqw;
  padding: 1.4cqw 0;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.tile {
  position: relative;
  display: grid;
  place-items: center;
  width: 16.5cqw;
  height: 16.5cqw;
  border-radius: 3.4cqw;
  overflow: hidden;
  box-shadow: inset 0 0.35cqw 0 rgba(255, 255, 255, 0.22),
              0 0.4cqw 1cqw rgba(0, 0, 0, 0.45);
}

.tile::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg,
    rgba(255, 255, 255, 0.28) 0%,
    rgba(255, 255, 255, 0.05) 46%,
    rgba(0, 0, 0, 0.04) 54%,
    rgba(0, 0, 0, 0.18) 100%);
}

.tile--about { background: linear-gradient(180deg, #5b8def, #2c56ab); }
.tile--how   { background: linear-gradient(180deg, #38b47e, #15784c); }
.tile--rsvp  { background: linear-gradient(180deg, #f4566c, #bf1f39); }
.tile--slack { background: linear-gradient(180deg, #ffffff, #e6e6e6); }

.tile__svg {
  position: relative;
  z-index: 1;
  width: 62%;
  height: 62%;
  color: #fff;
}

.appicon__label {
  color: #d6d6d6;
  font-size: 3.1cqw;
  text-shadow: 0 0.2cqw 0.5cqw rgba(0, 0, 0, 0.9);
  white-space: nowrap;
}

/* The highlight ring above is the only focus indicator we want. */
.appicon:focus,
.appicon:focus-visible { outline: none; }

.appicon.is-active .tile {
  outline: 0.5cqw solid #8ab4ff;
  outline-offset: 0.55cqw;
  box-shadow: 0 0 2.4cqw rgba(90, 150, 255, 0.5),
              inset 0 0.35cqw 0 rgba(255, 255, 255, 0.22);
}

.appicon.is-active .appicon__label { color: #fff; }

.appicon:active .tile { filter: brightness(0.88); }

/* ---------------------------------------------------------------
   App screens
   --------------------------------------------------------------- */

.titlebar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 1.2cqw;
  height: 8.6cqw;
  padding: 0 3.4cqw 0 2.2cqw;
  border-bottom: 1px solid #2b2b2b;
  background: linear-gradient(180deg, #202020, #131313);
}

.backbtn {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 6.4cqw;
  height: 6.4cqw;
  margin-left: -1.2cqw;
  border-radius: 1.2cqw;
  color: #dfe6ef;
  -webkit-tap-highlight-color: transparent;
}

.backbtn svg { width: 4.6cqw; height: 4.6cqw; }

.backbtn:hover { background: rgba(255, 255, 255, 0.08); }
.backbtn:focus-visible { outline: 1px solid #7fb0ee; }

.titlebar__title {
  font-size: 3.9cqw;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.docwrap {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
}

.doc {
  height: 100%;
  padding: 3.6cqw 5.2cqw 4cqw;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
}

.doc::-webkit-scrollbar { display: none; }

.doc p {
  margin: 0 0 3.2cqw;
  color: #ededed;
  font-size: 3.55cqw;
  line-height: 1.38;
}

.doc .lead {
  color: #fff;
  font-size: 3.75cqw;
}

.doc h2 {
  margin: 0 0 0.8cqw;
  color: #8fa8c4;
  font-size: 2.9cqw;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.doc .step { margin: 0 0 3.4cqw; }

.doc .step__heading {
  margin: 0 0 0.9cqw;
  color: #fff;
  font-size: 3.4cqw;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

.doc .step p { margin: 0; }

.doc .note {
  margin: 0;
  color: #9aa0a6;
  font-size: 3.2cqw;
}

/* Thin BlackBerry-style scrollbar */

.scrollbar {
  position: absolute;
  top: 1cqw;
  right: 0.5cqw;
  bottom: 1cqw;
  width: 0.9cqw;
  opacity: 0;
  transition: opacity 160ms linear;
}

.scrollbar__thumb {
  width: 100%;
  border-radius: 1cqw;
  background: rgba(255, 255, 255, 0.32);
}

/* Glass sheen, keeps the screen from looking like a flat div */

.glass {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background:
    linear-gradient(114deg, rgba(255, 255, 255, 0.055) 0%, rgba(255, 255, 255, 0.012) 24%, transparent 48%),
    radial-gradient(130% 70% at 50% -18%, rgba(255, 255, 255, 0.05), transparent 62%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.055);
}

/* ---------------------------------------------------------------
   The trackpad and the keys on the photo
   --------------------------------------------------------------- */

.trackpad,
.key {
  position: absolute;
  cursor: pointer;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 120ms linear, box-shadow 120ms linear;
}

.trackpad {
  left: 43.2%;
  top: 55.2%;
  width: 14.6%;
  height: 6.7%;
  border-radius: 24% / 30%;
}

.key {
  top: 55.2%;
  height: 6.4%;
  border-radius: 18% / 26%;
}

#key-back { left: 58.2%; width: 19.4%; }
#key-end  { left: 78.2%; width: 17.4%; }

.trackpad:hover,
.key:hover { background: rgba(255, 255, 255, 0.035); }

.trackpad.is-down,
.key:active {
  background: rgba(0, 0, 0, 0.18);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.55);
}

/* ---------------------------------------------------------------
   The one line of help, gone after the first input
   --------------------------------------------------------------- */

.hint {
  margin: 0;
  color: var(--hint);
  font-size: 12.5px;
  letter-spacing: 0.01em;
  transition: opacity 500ms ease;
}

.hint.is-gone {
  opacity: 0;
  pointer-events: none;
}

.hint__touch { display: none; }

@media (hover: none) {
  .hint__keys { display: none; }
  .hint__touch { display: inline; }
}

@media (prefers-reduced-motion: reduce) {
  .hint,
  .scrollbar,
  .trackpad,
  .key { transition: none; }
}
