/* Guess What I Did Last Night — single-page gag site */
:root {
  --glass-top: #2b3036;
  --glass-bottom: #15181b;
  --ink: #ffffff;
  --ink-soft: #c9ced4;
  --sticker: #ffffff;
  --sticker-edge: rgba(0, 0, 0, 0.08);
  --focus: #ffd23f;
  --gutter: 16px;
  --top-gap: clamp(56px, 14vh, 160px);
}

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

html { height: 100%; -webkit-text-size-adjust: 100%; }

body {
  min-height: 100%;
  min-height: 100dvh;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--glass-bottom);
  background-image:
    linear-gradient(160deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0) 38%),
    linear-gradient(180deg, var(--glass-top) 0%, var(--glass-bottom) 100%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  line-height: 1.4;
  padding-block: var(--top-gap) max(24px, env(safe-area-inset-bottom));
  padding-inline: max(var(--gutter), env(safe-area-inset-left)) max(var(--gutter), env(safe-area-inset-right));
  overflow-x: hidden;
  touch-action: manipulation;
}

::selection { background: var(--focus); color: #111; }

header {
  text-align: center;
  max-width: 40rem;
  margin-inline: auto;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 7.5vw, 4.25rem);
  font-weight: 900;
  line-height: 0.98;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  text-wrap: balance;
  max-width: 14ch;
  margin-inline: auto;
}

header p {
  margin: 0.75em 0 0;
  font-size: clamp(1rem, 2.2vw, 1.25rem);
  font-weight: 400;
  color: var(--ink-soft);
}

main {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-block: clamp(28px, 6vh, 64px) 8px;
}

.sticker {
  display: block;
  margin: 0;
  background: var(--sticker);
  padding: clamp(10px, 2.5vw, 22px);
  border-radius: clamp(14px, 2.5vw, 26px);
  border: 1px solid var(--sticker-edge);
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.25),
    0 24px 48px -20px rgba(0, 0, 0, 0.6);
  transform: rotate(-2.5deg);
  max-width: min(100%, 520px);
}

.sticker img {
  display: block;
  width: 100%;
  height: auto;
  max-height: min(62dvh, 640px);
  object-fit: contain;
  border-radius: 6px;
}

@media (orientation: landscape) and (max-height: 520px) {
  :root { --top-gap: 24px; }
  h1 { font-size: clamp(1.75rem, 5.5vh, 2.5rem); }
  header p { margin-top: 0.4em; }
  main { padding-block: 14px 8px; }
  .sticker { padding: 10px; }
  .sticker img { max-height: 50dvh; }
}

@media (min-width: 1024px) {
  :root { --top-gap: clamp(72px, 15vh, 180px); }
}

/* One authored moment: the sticker gets slapped on. */
@media (prefers-reduced-motion: no-preference) {
  .sticker {
    animation: slap 520ms cubic-bezier(0.2, 0.9, 0.3, 1) both;
  }
  @keyframes slap {
    from { opacity: 0; transform: rotate(-2.5deg) scale(1.08); }
    to   { opacity: 1; transform: rotate(-2.5deg) scale(1); }
  }
}

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