/*
 * Sherlock.AI site: the base of every page. The values are the player app's "Cronaca Nera" light set
 * (apps/mobile/src/theme/tokens.ts): Sherlock's orange is the page, cards are paper washed with it,
 * ink for words and rules, the highlighters for people, the stamp ink for secrets.
 */

@font-face {
  font-family: 'Schibsted Grotesk';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url(/fonts/schibsted-grotesk-latin-400-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Schibsted Grotesk';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url(/fonts/schibsted-grotesk-latin-ext-400-normal.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Schibsted Grotesk';
  font-style: normal;
  font-display: swap;
  font-weight: 600;
  src: url(/fonts/schibsted-grotesk-latin-600-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Schibsted Grotesk';
  font-style: normal;
  font-display: swap;
  font-weight: 600;
  src: url(/fonts/schibsted-grotesk-latin-ext-600-normal.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Schibsted Grotesk';
  font-style: normal;
  font-display: swap;
  font-weight: 800;
  src: url(/fonts/schibsted-grotesk-latin-800-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Schibsted Grotesk';
  font-style: normal;
  font-display: swap;
  font-weight: 800;
  src: url(/fonts/schibsted-grotesk-latin-ext-800-normal.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-display: swap;
  font-weight: 500;
  src: url(/fonts/ibm-plex-mono-latin-500-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-display: swap;
  font-weight: 500;
  src: url(/fonts/ibm-plex-mono-latin-ext-500-normal.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  /* Colours: the light set of the app. */
  --ink: #151413;
  --page: #ffae5c;
  --band: #e8761a;
  --paper: #fff4e6;
  --paper-raised: #ffe0bd;
  --paper-white: #fffbf5;
  --muted: #5a3a14;
  --line: #d9a066;
  --yellow: #f2cd2e;
  --stamp: #27348b;
  --on-stamp: #ffffff;
  --hidden: #cfc9be;
  --danger: #8f1220;
  --bubble-out: #1e1c1a;
  --on-bubble-out: #f4f1ea;
  --hl-pink: #ff9cc2;
  --hl-green: #8fe388;
  --hl-teal: #6fe0d2;
  --hl-blue: #8cc8ff;
  --hl-violet: #c9b0ff;
  --tint-pink: #ffe3ee;
  --tint-violet: #efe6ff;
  --tint-teal: #dcf8f4;

  /* Type. */
  --font-brand: 'Schibsted Grotesk', ui-sans-serif, system-ui, sans-serif;
  --font-data: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --font-phone: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --step-display: clamp(2.1rem, 0.9rem + 5.6vw, 5.25rem);
  --step-title: clamp(1.75rem, 1.3rem + 1.8vw, 2.75rem);
  --step-heading: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);
  --step-body: 1.125rem;
  --step-small: 0.9375rem;
  --step-meta: 0.75rem;

  /* Space: the app's 4-pt scale. */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 64px;
  --s-9: 96px;
  --gutter: clamp(16px, 4vw, 48px);
  --content: 1200px;
  --text: 62ch;

  /* Material. */
  --radius-sm: 4px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --border: 2px;
  --press: 4px;
  --paper-shadow: 0 1px 1px rgb(90 58 20 / 0.18), 0 10px 22px -8px rgb(90 58 20 / 0.45);
  --lift-shadow: 0 2px 2px rgb(90 58 20 / 0.16), 0 22px 40px -14px rgb(90 58 20 / 0.55);

  /* Motion. */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-land: cubic-bezier(0.34, 1.56, 0.64, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: light;
  background: var(--page);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font-brand);
  font-size: var(--step-body);
  line-height: 1.5;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

img,
svg {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3,
p,
figure {
  margin: 0;
}

h1,
h2,
h3 {
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

a {
  color: inherit;
  text-decoration-thickness: 0.09em;
  text-underline-offset: 0.18em;
}

::selection {
  background: var(--yellow);
  color: var(--ink);
}

:focus-visible {
  outline: 3px solid var(--stamp);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

[hidden] {
  display: none !important;
}

.skip {
  position: absolute;
  left: var(--s-3);
  top: -100px;
  z-index: 10;
  padding: var(--s-3) var(--s-4);
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--radius-md);
  font-weight: 600;
}

.skip:focus {
  top: var(--s-3);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.meta {
  font-family: var(--font-data);
  font-size: var(--step-meta);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.icon {
  width: 1.25em;
  height: 1.25em;
  flex: none;
  fill: currentColor;
}

/* ---- The head of a page: the band, the logo, the masthead rule, the halftone running into the page. */

.masthead {
  position: relative;
  background: var(--band);
}

.masthead__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  max-width: var(--content);
  margin: 0 auto;
  padding: var(--s-4) var(--gutter) var(--s-3);
}

.masthead__logo img {
  width: clamp(148px, 22vw, 220px);
  height: auto;
}

.masthead__rule {
  height: 3px;
  max-width: calc(var(--content) - 2 * var(--gutter));
  margin: 0 auto;
  background: var(--ink);
}

.masthead::after {
  content: '';
  position: absolute;
  inset: 100% 0 auto;
  height: 420px;
  background: var(--band);
  -webkit-mask: url(/img/halftone-band.png) top center / 480px 420px repeat-x;
  mask: url(/img/halftone-band.png) top center / 480px 420px repeat-x;
  pointer-events: none;
  z-index: -1;
}

.lang {
  display: flex;
  gap: var(--s-1);
  font-family: var(--font-data);
  font-size: 0.8125rem;
  font-weight: 500;
}

.lang a {
  display: inline-grid;
  place-items: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0 var(--s-2);
  border-radius: var(--radius-sm);
  text-decoration: none;
  letter-spacing: 0.06em;
}

.lang a[aria-current='true'] {
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

/* ---- Controls: ink faces that move into their hard shadow when pressed (the app's pressable). */

.button {
  --face: var(--ink);
  --on-face: var(--paper);
  position: relative;
  display: inline-flex;
  min-height: 52px;
  padding: 0;
  border: 0;
  background: var(--ink);
  border-radius: var(--radius-md);
  color: var(--on-face);
  font: 600 1rem/1 var(--font-brand);
  text-decoration: none;
  cursor: pointer;
}

.button__face {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: 0 var(--s-5);
  width: 100%;
  border: var(--border) solid var(--ink);
  border-radius: var(--radius-md);
  background: var(--face);
  transform: translate(calc(-1 * var(--press)), calc(-1 * var(--press)));
  transition: transform 120ms var(--ease-out);
}

.button:hover .button__face {
  transform: translate(calc(-1 * var(--press) - 1px), calc(-1 * var(--press) - 1px));
}

.button:active .button__face {
  transform: translate(0, 0);
}

.button .icon {
  width: 1.15em;
  height: 1.15em;
}

.button:disabled {
  cursor: progress;
}

.button:disabled .button__face {
  transform: translate(0, 0);
}

.button--paper {
  --face: var(--paper);
  --on-face: var(--ink);
}

/* ---- Coming soon in the stores: a label, not a control, until the store pages exist. */

.stores {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

.store {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  min-height: 56px;
  padding: var(--s-2) var(--s-4) var(--s-2) var(--s-3);
  border: var(--border) solid var(--ink);
  border-radius: var(--radius-md);
  background: var(--paper);
  color: var(--ink);
}

.store .icon {
  width: 28px;
  height: 28px;
}

.store__text {
  display: grid;
  gap: 2px;
  line-height: 1.1;
}

.store__soon {
  color: var(--muted);
}

.store__name {
  font-weight: 800;
  font-size: 1.0625rem;
  letter-spacing: -0.01em;
}

/* ---- The board: pins, polaroids, notes, thread. */

.pin {
  position: absolute;
  top: -7px;
  left: 50%;
  width: 14px;
  height: 14px;
  margin-left: -7px;
  border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 2px 3px rgb(21 20 19 / 0.35);
  z-index: 3;
}

.pin::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgb(255 255 255 / 0.55);
}

.polaroid {
  position: relative;
  padding: 8px 8px 0;
  background: var(--paper-white);
  box-shadow: var(--paper-shadow);
  rotate: var(--tilt, 0deg);
}

.polaroid img {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  background: var(--paper-raised);
}

.polaroid figcaption {
  padding: 8px 2px 10px;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.2;
}

.polaroid figcaption small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-weight: 400;
}

.thread {
  fill: none;
  stroke: var(--ink);
  stroke-width: 2;
  stroke-linecap: round;
}

.secret-mark {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 50%;
  background: var(--stamp);
  color: var(--on-stamp);
}

.secret-mark .icon {
  width: 18px;
  height: 18px;
}

.secret-mark--hidden {
  background: var(--hidden);
  color: var(--ink);
}

/* ---- The phone register: a chat as the player's own phone (platform font). */

.chat {
  font-family: var(--font-phone);
  font-size: 0.9375rem;
  line-height: 1.35;
}

.chat__log {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bubble {
  max-width: 82%;
  padding: 8px 12px;
  border-radius: 16px;
  overflow-wrap: anywhere;
}

.bubble--them {
  align-self: flex-start;
  border: 1px solid rgb(21 20 19 / 0.14);
  border-bottom-left-radius: 4px;
  background: var(--bubble-them, var(--paper-white));
  color: var(--ink);
}

.bubble--me {
  align-self: flex-end;
  border-bottom-right-radius: 4px;
  background: var(--bubble-out);
  color: var(--on-bubble-out);
}

.bubble.is-new {
  animation: bubble-in 320ms var(--ease-out) both;
}

.bubble--me.is-new {
  transform-origin: 100% 100%;
}

.bubble--them.is-new {
  transform-origin: 0 100%;
}

@keyframes bubble-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.92);
  }
}

.typing {
  display: inline-flex;
  gap: 4px;
  align-self: flex-start;
  padding: 12px 14px;
  border: 1px solid rgb(21 20 19 / 0.14);
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  background: var(--bubble-them, var(--paper-white));
}

.typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
  animation: typing 1s infinite ease-in-out;
}

.typing.is-paused {
  visibility: hidden;
}

.typing span:nth-child(2) {
  animation-delay: 150ms;
}

.typing span:nth-child(3) {
  animation-delay: 300ms;
}

@keyframes typing {
  0%,
  60%,
  100% {
    opacity: 0.35;
    transform: translateY(0);
  }
  30% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

.bubble__key {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  margin-left: 6px;
  vertical-align: -4px;
  border-radius: 50%;
  background: var(--stamp);
  color: var(--on-stamp);
}

.bubble__key .icon {
  width: 12px;
  height: 12px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}

/* ---- The foot of every page. */

.footer {
  position: relative;
  z-index: 2;
}

.footer__inner {
  display: grid;
  gap: var(--s-2);
  max-width: var(--content);
  margin: 0 auto;
  padding: var(--s-5) var(--gutter) var(--s-7);
  border-top: 3px solid var(--ink);
  font-size: var(--step-small);
}

.footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--s-5);
  margin: 0 0 var(--s-2);
  padding: 0;
  list-style: none;
  font-weight: 600;
}

.footer__links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.footer__note {
  color: var(--muted);
}

.footer__note a {
  color: var(--ink);
}
