/* SECONDHAND landing page. Brand: movie-studio brand.md and MOTION.md; dark only. */

@font-face {
  font-family: 'Syne';
  src: url('/assets/fonts/syne.woff2') format('woff2');
  font-weight: 400 800;
  font-display: swap;
}
@font-face {
  font-family: 'DM Sans';
  src: url('/assets/fonts/dm-sans.woff2') format('woff2');
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('/assets/fonts/jetbrains-mono.woff2') format('woff2');
  font-weight: 100 800;
  font-display: swap;
}

:root {
  --canvas: #000000;
  --lift: #0a0a0a;
  --hairline: #2c2c2c;
  --ink: #ffffff;
  --ink-2: #c8c8c8;
  --ink-3: #9a9a9a;
  --signal: #ff6b35;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --display: 'Syne', system-ui, sans-serif;
  --body: 'DM Sans', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  background: var(--canvas);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink-2);
  font: 400 1rem/1.6 var(--body);
}

a {
  color: var(--ink);
  text-underline-offset: 0.2em;
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.mono {
  font: 500 0.75rem/1.6 var(--mono);
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.small {
  font-size: 0.875rem;
  color: var(--ink-3);
}

/* Title card: the end of the teaser, and the whole first screen without JavaScript. */
#title,
.lost {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  padding: 4rem 16px;
  overflow-x: clip;
  text-align: center;
  container-type: inline-size;
}

#title > :not(h1),
.lost > :not(h1) {
  width: 100%;
  max-width: 32rem;
  margin: 0;
}

/* Syne 800 is wide ("SECONDHAND." is 12.6 em), so the title fits by width, as MOTION.md says. */
#title-heading,
.lost-heading {
  margin: 0;
  font: 800 min(calc(100cqi / 12.7), 5rem) / 1 var(--display);
  letter-spacing: -0.02em;
  color: var(--ink);
  white-space: nowrap;
}

.lost-heading {
  font-size: min(calc(100cqi / 13.4), 4rem);
}

#title-heading:focus {
  outline: none;
}

.dot {
  position: relative;
  display: inline-block;
  color: var(--signal);
}

/* A hairline sonar ring keeps leaving the dot. Drawn full size and scaled up, so the line stays 1 px. */
.dot::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0.14em;
  width: 1.6em;
  height: 1.6em;
  margin: 0 0 -0.8em -0.8em;
  border: 1px solid var(--hairline);
  border-radius: 50%;
  opacity: 0;
  animation: sonar 2.4s var(--ease) infinite;
  pointer-events: none;
}

@keyframes sonar {
  from {
    transform: scale(0.08);
    opacity: 1;
  }
  to {
    transform: scale(1);
    opacity: 0;
  }
}

.solved {
  color: var(--ink);
}

.lede {
  font-size: 1.125rem;
  color: var(--ink);
}

#notify {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

#notify input {
  flex: 999 1 14rem;
  min-width: 0;
  padding: 0.85rem 1rem;
  border: 1px solid var(--hairline);
  border-radius: 0;
  background: var(--lift);
  color: var(--ink);
  font: inherit;
}

#notify input::placeholder {
  color: var(--ink-3);
}

#notify button {
  flex: 1 0 auto;
  padding: 0.85rem 1.25rem;
  border: 0;
  border-radius: 0;
  background: var(--ink);
  color: var(--canvas);
  font: 600 1rem/1.2 var(--body);
  cursor: pointer;
}

#notify button:disabled {
  opacity: 0.6;
  cursor: progress;
}

.note {
  width: 100%;
  margin: 0;
  font-size: 0.875rem;
  color: var(--ink-3);
}

.note a {
  color: var(--ink-2);
}

/* The honeypot: people never see it; form-filling bots do. */
.trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.notify-status {
  display: none;
  color: var(--ink);
}

.notify-status.shown,
.no-js .notify-status:target {
  display: block;
}

.replay {
  padding: 0.6rem 1rem;
  border: 1px solid var(--hairline);
  border-radius: 0;
  background: none;
  color: var(--ink);
  font: 500 0.875rem/1.2 var(--body);
  cursor: pointer;
}

#title > .replay {
  width: auto;
}

.no-js #replay {
  display: none;
}

/* Below the fold. */
#story {
  max-width: 40rem;
  margin: 0 auto;
  padding: 4rem 16px;
}

#story h2 {
  margin: 0 0 2rem;
  font: 800 clamp(1.5rem, 6vw, 2.25rem) / 1.1 var(--display);
  letter-spacing: -0.02em;
  color: var(--ink);
}

.cards {
  display: grid;
  gap: 1px;
  margin: 0 0 2.5rem;
  padding: 0;
  border: 1px solid var(--hairline);
  background: var(--hairline);
  list-style: none;
}

.cards li {
  padding: 1.25rem;
  background: var(--canvas);
}

.cards h3 {
  margin: 0 0 0.5rem;
  font: 800 1.125rem/1.2 var(--display);
  letter-spacing: -0.02em;
  color: var(--ink);
}

.cards p {
  margin: 0;
}

.question {
  margin: 0 0 2rem;
  font-size: 1.25rem;
  line-height: 1.5;
  color: var(--ink);
}

.disclosure {
  margin: 0;
  font-size: 0.875rem;
  color: var(--ink-3);
}

/* Privacy and Support. */
.doc-head {
  max-width: 40rem;
  margin: 0 auto;
  padding: 1.5rem 16px 0;
}

.home {
  font: 800 1.125rem/1 var(--display);
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
}

.doc {
  max-width: 40rem;
  margin: 0 auto;
  padding: 3rem 16px 4rem;
}

.doc h1 {
  margin: 0 0 0.75rem;
  font: 800 clamp(1.75rem, 8vw, 2.75rem) / 1.05 var(--display);
  letter-spacing: -0.02em;
  color: var(--ink);
}

.doc h2 {
  margin: 2.25rem 0 0.5rem;
  font: 600 1.125rem/1.3 var(--body);
  color: var(--ink);
}

.doc p {
  margin: 0 0 0.75rem;
}

footer {
  max-width: 40rem;
  margin: 0 auto;
  padding: 2rem 16px 3rem;
  border-top: 1px solid var(--hairline);
  font-size: 0.875rem;
  color: var(--ink-3);
}

footer .brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 1rem;
  color: var(--ink);
}

footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
}

footer a {
  color: var(--ink-2);
}

/* The teaser layer covers the page, which stays put underneath until the title card. */
#stage {
  display: none;
}

.js.teasing #stage {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 10;
  background: var(--canvas);
}

.js.teasing,
.js.teasing body {
  overflow: hidden;
  overscroll-behavior: none;
}

.stage-button {
  position: absolute;
  bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 2;
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: rgba(10, 10, 10, 0.72);
  color: var(--ink-2);
  font: 500 0.6875rem/1 var(--mono);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  cursor: pointer;
}

.stage-button.sound {
  left: calc(16px + env(safe-area-inset-left));
}

.stage-button.skip {
  right: calc(16px + env(safe-area-inset-right));
}

.sound[aria-pressed='false'] {
  color: var(--ink-3);
  text-decoration: line-through;
}

/* A. The find: a mono line, a dark phone buzzing, one button. */
.find {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  padding: 24px 16px 96px;
}

.find-line {
  min-height: 3.2em;
  max-width: 22rem;
  margin: 0;
  font: 500 0.8125rem/1.6 var(--mono);
  letter-spacing: 0.35em;
  text-align: center;
  color: var(--ink);
}

.dark-phone {
  width: 132px;
  height: 272px;
  border: 1px solid var(--hairline);
  border-radius: 30px;
  background: linear-gradient(160deg, #141414 0%, #050505 45%, #000000 100%);
}

.pickup {
  padding: 0.95rem 2.2rem;
  border: 0;
  border-radius: 0;
  background: var(--ink);
  color: var(--canvas);
  font: 600 1rem/1.2 var(--body);
  cursor: pointer;
}

/* B–D. The found phone: full screen on a phone, a drawn 390×844 frame on a computer. Type is the phone's own. */
.phone {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #000000;
  color: var(--ink);
  font-family: system-ui, -apple-system, 'Helvetica Neue', sans-serif;
}

@media (min-width: 601px) {
  .phone {
    inset: auto;
    left: 50%;
    top: 50%;
    width: 390px;
    height: 844px;
    margin: -422px 0 0 -195px;
    border-radius: 54px;
    box-shadow:
      0 0 0 10px var(--lift),
      0 0 0 11px var(--hairline);
    transform: scale(var(--fit, 1));
  }
}

.screen {
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 70% at 50% 0%, #1a1a1a 0%, #060606 55%, #000000 100%);
}

.lock {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: calc(12px + env(safe-area-inset-top)) 14px calc(16px + env(safe-area-inset-bottom));
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

.status {
  display: flex;
  justify-content: space-between;
  margin: 0;
  padding: 0 12px;
  font-size: 15px;
  font-weight: 600;
}

.battery::after {
  content: '';
  display: inline-block;
  width: 24px;
  height: 12px;
  margin-left: 6px;
  padding: 1px;
  border: 1.5px solid currentColor;
  border-radius: 4px;
  background: linear-gradient(90deg, currentColor 58%, transparent 58%) content-box;
  vertical-align: -1px;
}

.lock-date {
  margin: 22px 0 0;
  font-size: 19px;
  font-weight: 600;
  text-align: center;
  color: rgba(255, 255, 255, 0.86);
}

.lock-time {
  margin: -2px 0 0;
  font-size: 92px;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
  text-align: center;
}

/* The wallpaper: Dani's week card, with the 5 circled (the one orange thing). */
.week {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 132px;
  margin: 6px 0;
}

.week-head {
  margin-bottom: 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.24em;
  color: rgba(255, 255, 255, 0.6);
}

.week-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  width: 100%;
  max-width: 330px;
  margin: 0;
  padding: 0;
  list-style: none;
  text-align: center;
}

.week-days li {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.dow {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.5);
}

.day {
  position: relative;
  font-size: 22px;
  font-weight: 500;
}

.circled::after {
  content: '';
  position: absolute;
  inset: -7px -11px;
  border: 2px solid var(--signal);
  border-radius: 50%;
  transform: rotate(-10deg);
}

.week-note {
  margin: 12px 0 0;
  font-size: 16px;
  font-style: italic;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.82);
  transform: rotate(-3deg);
}

.notices {
  display: flex;
  flex: 0 1 auto;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  list-style: none;
  /* Older notes slide under the bottom edge, as a stack does. */
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 24px), transparent);
  mask-image: linear-gradient(to bottom, #000 calc(100% - 24px), transparent);
}

.notice {
  display: grid;
  flex: none;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  align-items: start;
  padding: 12px 14px;
  border-radius: 22px;
  background: rgba(44, 44, 44, 0.86);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  cursor: pointer;
}

.notice-icon {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: #1c1c1c;
}

.notice[data-app='messages'] .notice-icon::after {
  content: '';
  position: absolute;
  left: 7px;
  top: 9px;
  width: 20px;
  height: 15px;
  border-radius: 8px;
  background: var(--ink);
}

.notice[data-app='news'] .notice-icon {
  background:
    linear-gradient(var(--ink), var(--ink)) 8px 10px / 18px 2px no-repeat,
    linear-gradient(var(--ink), var(--ink)) 8px 16px / 18px 2px no-repeat,
    linear-gradient(var(--ink), var(--ink)) 8px 22px / 11px 2px no-repeat,
    #1c1c1c;
}

.notice-body {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.notice-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
}

.notice-sender {
  font-size: 15px;
  font-weight: 600;
}

.notice-text {
  font-size: 15px;
  line-height: 1.3;
  color: rgba(255, 255, 255, 0.92);
}

.open-hint {
  align-self: center;
  margin-top: 10px;
  padding: 8px 12px;
  border: 0;
  background: none;
  color: rgba(255, 255, 255, 0.72);
  font: 500 15px/1.2 system-ui, -apple-system, sans-serif;
  cursor: pointer;
}

.open-hint.pulse {
  animation: hint 1.8s ease-in-out infinite;
}

@keyframes hint {
  50% {
    opacity: 0.35;
    transform: translateY(-3px);
  }
}

.keypad {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px calc(72px + env(safe-area-inset-bottom));
  background: rgba(0, 0, 0, 0.72);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
}

.keypad-title {
  margin: 0 0 18px;
  font-size: 20px;
  font-weight: 500;
}

.dots {
  display: flex;
  gap: 20px;
  margin: 0 0 14px;
}

.dots span {
  width: 13px;
  height: 13px;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
}

.dots span.on {
  background: var(--ink);
}

.keypad-help {
  min-height: 2.8em;
  max-width: 270px;
  margin: 0 0 14px;
  font-size: 14px;
  line-height: 1.4;
  text-align: center;
  color: var(--ink-2);
}

.keys {
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: 14px 22px;
}

.keys button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: min(78px, 21vw);
  aspect-ratio: 1;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  color: var(--ink);
  font: 400 32px/1 system-ui, -apple-system, sans-serif;
  cursor: pointer;
}

.keys small {
  margin-top: 2px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.18em;
}

.keys .key-text {
  background: none;
  font-size: 16px;
}

.thread {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: calc(12px + env(safe-area-inset-top)) 14px calc(80px + env(safe-area-inset-bottom));
  background: #000000;
}

.thread:focus {
  outline: none;
}

.thread-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 22px 0 14px;
  border-bottom: 1px solid var(--hairline);
}

.thread-avatar {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--hairline);
  font-size: 22px;
  font-weight: 600;
}

.thread-name {
  font-size: 13px;
  color: var(--ink-2);
}

.bubbles {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: flex-end;
  gap: 6px;
  margin: 0;
  padding: 16px 0 0;
  list-style: none;
}

.bubble {
  align-self: flex-start;
  max-width: 80%;
  padding: 9px 14px;
  border-radius: 19px;
  background: var(--hairline);
  font-size: 16px;
  line-height: 1.35;
}

.typing {
  display: flex;
  gap: 5px;
  padding: 14px 16px;
}

.typing span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ink-3);
  animation: typing 1.2s ease-in-out infinite;
}

.typing span:nth-child(2) {
  animation-delay: 0.15s;
}

.typing span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes typing {
  0%,
  60%,
  100% {
    opacity: 0.4;
  }
  30% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .dot::after,
  .open-hint.pulse,
  .typing span {
    animation: none;
  }
}
