/* app.rewindchess.com: the website's colours and fonts (apps/web/src/styles/app.css), by hand. */

@font-face {
  font-family: "Fraunces Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("/fonts/fraunces-latin-wght-normal.woff2") format("woff2-variations");
  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 Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 400 900;
  src: url("/fonts/schibsted-grotesk-latin-wght-normal.woff2") format("woff2-variations");
  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;
}

:root {
  color-scheme: dark;
  --ink: #11120e;
  --surface: #181a14;
  --line: #30342a;
  --line-strong: #454a3c;
  --paper: #efe7d4;
  --muted: #a7a490;
  --go: #7dbb45;
  --go-strong: #5f9e2c;
  --on-accent: #11120e;
  --focus: #e7c66a;
  --glow: rgba(116, 140, 95, 0.22);
  --warm: rgba(236, 91, 63, 0.1);
  --phone-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.85);
  --display: "Fraunces Variable", ui-serif, Georgia, serif;
  --sans: "Schibsted Grotesk Variable", ui-sans-serif, system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
}

@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --ink: #f5f0e3;
    --surface: #fbf8f0;
    --line: #dcd3be;
    --line-strong: #c2b79e;
    --paper: #1c1d17;
    --muted: #57574a;
    --go: #3d7a1a;
    --go-strong: #2c5c11;
    --on-accent: #fffdf6;
    --focus: #8c6a0c;
    --glow: rgba(96, 130, 60, 0.2);
    --warm: rgba(196, 64, 31, 0.08);
    --phone-shadow: 0 40px 70px -28px rgba(60, 45, 20, 0.55);
  }
}

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

html {
  background: var(--ink);
}

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(60rem 30rem at 85% 10%, var(--glow), transparent 60%),
    radial-gradient(40rem 24rem at 10% 90%, var(--warm), transparent 60%), var(--ink);
  color: var(--paper);
  font: 400 1rem / 1.5 var(--sans);
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

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

/* ── Header and footer ─────────────────────────────────────────────────── */

.top,
.foot {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 16px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 10px;
  /* Dark in both themes, like the website's header (the mark has white parts). */
  background: #1f1d1a;
  text-decoration: none;
}

.logo img {
  display: block;
  height: 28px;
  width: auto;
}

.foot {
  margin-top: auto;
  color: var(--muted);
  font-size: 0.875rem;
}

.foot a {
  text-underline-offset: 3px;
}

/* ── The page ──────────────────────────────────────────────────────────── */

.hero {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 16px 48px;
  display: grid;
  gap: 48px;
  align-items: center;
}

@media (min-width: 900px) {
  .hero {
    grid-template-columns: 1.1fr 1fr;
    padding-top: 48px;
    padding-bottom: 72px;
  }
}

.copy {
  min-width: 0;
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  font: 500 0.75rem / 1.4 var(--mono);
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

h1 {
  margin: 20px 0 0;
  font: 500 clamp(2.4rem, 6vw, 4.6rem) / 1 var(--display);
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.lead {
  margin: 24px 0 0;
  max-width: 34rem;
  color: var(--muted);
  font-size: 1.125rem;
  line-height: 1.6;
}

.actions {
  margin-top: 32px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 24px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 1.0625rem;
  text-decoration: none;
  transition:
    background-color 0.15s,
    border-color 0.15s;
}

.button.go,
.button.play {
  background: var(--go);
  color: var(--on-accent);
}

.button.go:hover,
.button.play:hover {
  background: var(--go-strong);
}

.qr {
  margin: 40px 0 0;
  display: flex;
  align-items: center;
  gap: 16px;
}

.qr img {
  flex-shrink: 0;
  width: 132px;
  height: 132px;
  padding: 8px;
  border-radius: 10px;
  /* White in both themes, so phone cameras read it. */
  background: #fff;
  box-shadow: 0 0 0 1px var(--line);
}

.qr figcaption {
  max-width: 13rem;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.45;
}

/* A phone has nothing to scan: no QR code on small touch screens. */
@media (max-width: 899px) and (pointer: coarse) {
  .qr {
    display: none;
  }
}

/* ── The phone (apps/web/src/components/devices/PhoneFrame.tsx in CSS) ── */

.phone-wrap {
  margin: 0;
  display: flex;
  justify-content: center;
}

.phone {
  position: relative;
  width: min(300px, 72vw);
  aspect-ratio: 9 / 19.5;
  padding: 3.2%;
  border-radius: 13% / 6%;
  background: #0c0d0a;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.12),
    inset 0 0 0 1px rgba(255, 255, 255, 0.05),
    var(--phone-shadow);
  container-type: inline-size;
  transform: rotate(2.5deg);
}

[dir="rtl"] .phone {
  transform: rotate(-2.5deg);
}

.key {
  position: absolute;
  right: -1.2%;
  width: 1.2%;
  border-radius: 0 3px 3px 0;
  background: #2a2c23;
}

.key-1 {
  top: 20%;
  height: 10%;
}

.key-2 {
  top: 33%;
  height: 5%;
}

.screen {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 10% / 4.8%;
  background: #11120e;
}

.status {
  position: relative;
  flex-shrink: 0;
  height: 3.8%;
  padding: 0 7%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #efe7d4;
  font: clamp(6px, 3.4cqw, 11px) var(--mono);
  direction: ltr;
}

.camera {
  position: absolute;
  top: 50%;
  left: 50%;
  height: 62%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #000;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1);
  transform: translate(-50%, -50%);
}

.status-icons {
  display: flex;
  align-items: center;
  gap: 0.3em;
}

.screen picture {
  position: relative;
  flex: 1;
  min-height: 0;
}

.screen img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}

/* ── Android: the app opens (app.js); this is what stays if it doesn't ── */

.android-only {
  display: none;
}

.android .android-only {
  display: inline-flex;
}

.android .button.play {
  background: transparent;
  color: var(--paper);
  border: 1px solid var(--line-strong);
}

.android .button.play:hover {
  background: var(--surface);
}

.android .qr {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .button {
    transition: none;
  }
}
