:root {
  color-scheme: dark;
  --paper: #f1ede6;
  --ink: #1d1d1d;
  --mono: "Courier New", monospace;
  color: var(--paper);
  background: #101010;
  font: 16px/1.45 Arial, Helvetica, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  min-height: 100svh;
  background: linear-gradient(#101010e8, #101010f2), url("../assets/stargate.webp") center top / cover;
}
a { color: inherit; }
button { font: inherit; }
button:not(:disabled) { cursor: pointer; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
.layout {
  display: grid;
  grid-template-columns: minmax(0, 645fr) minmax(0, 734fr);
  column-gap: 10px;
  align-items: start;
  width: min(1390px, calc(100% - 7vw));
  margin: auto;
}
.identity { align-self: center; margin-block-end: clamp(44px, 9.3vw, 143px); }
.identity h1 { margin: 0; }
.identity h1 img { display: block; width: 100%; height: auto; }
.details { margin: 2% 8% 0 9.5%; }
.intro { margin: 0 0 clamp(18px, 2.6vw, 40px); font: 400 clamp(14px, 1.42vw, 21px)/1.4 var(--mono); }
.passes { display: grid; gap: clamp(10px, 1.3vw, 21px); margin: 0; }
.passes div {
  display: grid;
  grid-template-columns: 35% 1fr;
  align-items: center;
  gap: 6%;
  padding: clamp(9px, 1.25vw, 17px) 6%;
  border: 2px solid #e8e4dc;
  border-radius: clamp(11px, 1.3vw, 20px);
}
.passes dt { font-size: clamp(18px, 2.65vw, 39px); font-style: italic; font-weight: 900; line-height: 1.1; white-space: nowrap; }
.passes dd { margin: 0; padding-left: 8%; border-left: 1px solid #f1ede6; font-size: clamp(12px, 1.43vw, 22px); line-height: 1.3; }
.messages-link { display: none; }
.phone { position: relative; min-width: 0; container-type: inline-size; }
.handset {
  /* Extend the straight sides while keeping the speaker, hinge and keys at their original proportions. */
  width: 100%;
  aspect-ratio: 734 / 1214;
  border-style: solid;
  border-width: 28.61cqw 0 44.14cqw;
  border-image: url("../assets/giveaway-sms-phone.webp") 210 0 324 0 fill stretch;
}
.screen {
  position: absolute;
  inset: 25.25cqw 11.7% 43.1cqw 12.4%;
  border-radius: 4cqw;
  overflow: hidden;
  color-scheme: light;
  color: var(--ink);
  background: repeating-linear-gradient(0deg, #27272709 0 1px, transparent 1px 4px), #e4e1da;
  box-shadow: inset 0 0 3cqw #17171756;
  font: 700 clamp(12px, 3.25cqw, 24px)/1.2 var(--mono);
}
.unread, .conversation {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 1.8cqw 2.7cqw 2.1cqw;
}
.unread { align-items: center; justify-content: center; text-align: center; gap: 3cqw; }
.unread p { margin: 0; letter-spacing: .06em; }
.envelope { object-fit: contain; width: 12cqw; height: auto; animation: blink 1.8s steps(1, end) 3; }
@keyframes blink { 50% { opacity: .42; } }
.sender {
  display: flex;
  align-items: center;
  gap: 2.5cqw;
  flex: none;
  padding: 0 1.35cqw 1cqw;
  border-bottom: 2px solid var(--ink);
}
.sender img { display: block; width: 14.3cqw; height: auto; border-radius: 50%; border: 1px solid var(--ink); }
.sender h2, .sender p { margin: 0; }
.sender h2 { font-size: 1.38em; line-height: 1; }
.sender p { margin-left: auto; font-variant-numeric: tabular-nums; }
.thread {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 1.7cqw 1cqw 1.65cqw;
  scrollbar-width: thin;
  scrollbar-color: #97938b transparent;
  display: flex;
  flex-direction: column;
  gap: 1.5cqw;
}
.thread:focus-visible { outline-offset: -2px; }
.bubble {
  margin: 0;
  padding: .42em .55em;
  align-self: start;
  max-width: 95%;
  border: 1px solid var(--ink);
  border-radius: .65em .65em .65em .12em;
  background-color: #f2efe64f;
  overflow-wrap: anywhere;
}
.bubble.reply {
  align-self: end;
  color: #f5f1eb;
  background: var(--ink);
  border-radius: .65em .65em .12em .65em;
}
.bubble.arrived { animation: arrive 180ms ease-out both; }
@keyframes arrive { from { opacity: 0; transform: translateY(3px); } }
.controls { flex: none; text-align: center; padding-inline: 1.4cqw; }
.task-controls { display: grid; grid-template-columns: 1.3fr 1fr; gap: 1.4cqw 2.8cqw; }
.reply-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1.2cqw 1.4cqw; }
.task-proof, .input-error { grid-column: 1 / -1; }
.sms-input {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding-inline: .5em;
  border: 1px solid var(--ink);
  border-radius: .48em;
  background: #f2efe6;
  text-align: left;
}
.sms-input:focus-within { outline: 2px solid var(--ink); outline-offset: 2px; }
.sms-input input {
  flex: 1;
  min-width: 0;
  padding: .4em .14em;
  border: 0;
  outline: none;
  background: transparent;
  color: inherit;
  font: inherit;
}
.sms-input input::placeholder { color: #605e59; }
.input-error { margin: .3em 0 0; text-align: left; font-size: .82em; }
.input-error:empty { margin: 0; }
.action {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: .35em;
  min-width: 0;
  min-height: max(36px, 8cqw);
  padding: .3em .5em;
  border: 1px solid var(--ink);
  border-radius: .48em;
  background: #d6d3cd;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
}
.action:hover:not(:disabled) { background: #f6f3ed; }
.primary { background: #262626; color: #f5f1eb; }
.primary:hover:not(:disabled) { background: #414141; }
.primary:focus-visible { outline-color: #242424; }
.action:disabled { background: #cdcbc6; border-color: #96948e; color: #65635f; }
.countdown { grid-column: 1 / -1; margin: 0; font-size: .91em; min-height: 1.2em; }
.footer {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  gap: 12px 24px;
  color: #c9c5be;
  padding: 12px 0 20px;
  font: .82rem/1.5 var(--mono);
}
.footer p { margin: 0; }
.demo-destination { width: min(520px, calc(100% - 36px)); margin: 12vh auto; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
@media (min-width: 851px) {
  .handset { min-height: min(calc(100svh - 54px), 215cqw); }
}
@media (851px <= width <= 1050px) {
  .passes dt { font-size: 2.4vw; }
}
@media (min-width: 1200px) {
  .layout {
    --phone-height: 1184;
    --phone-width: min(660px, calc(92svh * 734 / var(--phone-height)));
    grid-template-columns: minmax(0, min(580px, calc(var(--phone-width) * 1.1))) var(--phone-width);
    justify-content: center;
    column-gap: clamp(32px, 4vw, 86px);
    padding-top: clamp(12px, 2svh, 24px);
  }
  .identity {
    container-type: inline-size;
    /* Align the midpoint of the title block with the LCD, above the keypad. */
    margin-block-end: calc(var(--phone-width) * .1785);
  }
  .handset { aspect-ratio: 734 / var(--phone-height); min-height: 0; }
  .intro { font-size: clamp(13px, 3.4cqw, 18.5px); text-wrap: balance; }
  .passes dt { font-size: clamp(17px, 5.7cqw, 34px); }
  .passes dd { font-size: clamp(12px, 3.6cqw, 21px); }
}
@media (max-width: 850px) {
  html { scroll-behavior: smooth; }
  .layout { width: min(560px, calc(100% - 20px)); grid-template-columns: minmax(0, 1fr); }
  .identity {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100svh;
    margin-block-end: 0;
    padding-block: 24px;
  }
  .identity h1 { width: min(94%, 400px); margin-inline: auto; }
  .details { margin: 0 5%; }
  .intro { text-align: center; margin-bottom: 12px; }
  .passes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .passes div { grid-template-columns: 1fr; justify-items: start; gap: 4px; padding: 8px 10px; border-width: 1px; }
  .passes dd { padding: 0; border: 0; }
  .messages-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .7em;
    min-height: 48px;
    margin-top: 20px;
    padding: 8px 14px;
    border-radius: 8px;
    background: var(--paper);
    color: var(--ink);
    font: 700 1rem/1.2 var(--mono);
    text-decoration: none;
  }
  .messages-link:hover { background: #fff; }
  .phone { scroll-margin-top: 12px; }
  .sms-input input { font-size: 16px; }
  .footer { flex-wrap: wrap; }
}
@media (max-width: 400px) {
  .sender img { width: 10cqw; }
  .screen { font-size: 12px; }
  .action { min-height: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .envelope, .bubble.arrived { animation: none; }
}
