/* foursome.info: the app's puzzle-page look (ios/Packages/FoursomeDesign/Theme.swift) on the web. */
@font-face {
  font-family: "Zilla Slab";
  src: url("/fonts/zilla-slab-bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Libre Franklin";
  src: url("/fonts/libre-franklin.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --text: #121212;
  --muted: #5f6368;
  --hairline: #dcdcdc;
  --surface: #f6f7f8;
  --tile: #d3d6da;
  --key: #d3d6da;
  --correct: #4c8a47;
  --on-correct: #ffffff;
  --mine: #1565d8;
  --mine-tint: #eaf2fe;
  --theirs: #7b2fd6;
  --theirs-tint: #f3ecfd;
  --title: "Zilla Slab", Rockwell, "Roboto Slab", Georgia, serif;
  --body: "Libre Franklin", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --tile-size: 44px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121213;
    --text: #f8f8f8;
    --muted: #a9abad;
    --hairline: #3a3a3c;
    --surface: #1e1e20;
    --tile: #3a3a3c;
    --key: #818384;
    --correct: #538d4e;
    --mine: #5ba3ff;
    --mine-tint: #16263d;
    --theirs: #b48cff;
    --theirs-tint: #25193b;
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
/* One language at a time; without JavaScript the page stays Turkish. */
html[data-lang="tr"] [lang="en"], html[data-lang="en"] [lang="tr"] { display: none !important; }

a { color: inherit; text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--mine); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--title); font-weight: 700; line-height: 1.08; margin: 0; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
.wrap { width: 100%; max-width: 68rem; margin: 0 auto; padding: 0 1.25rem; }
.muted { color: var(--muted); }
.label {
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.075em; text-transform: uppercase; color: var(--muted);
}
.skip { position: absolute; left: -999px; top: 0.5rem; background: var(--text); color: var(--bg); padding: 0.5rem 0.9rem; border-radius: 2rem; }
.skip:focus { left: 0.5rem; z-index: 10; }

/* Header */
.site-header { border-bottom: 1px solid var(--hairline); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; min-height: 3.75rem; }
.wordmark { font-family: var(--title); font-weight: 700; font-size: 1.5rem; text-decoration: none; display: inline-flex; align-items: center; gap: 0.6rem; }
.wordmark img { width: 28px; height: 28px; border-radius: 7px; box-shadow: 0 0 0 1px var(--hairline); }
.lang { display: inline-flex; border: 1px solid var(--hairline); border-radius: 2rem; padding: 2px; }
.lang button {
  font: inherit; font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.04em; color: var(--muted);
  background: none; border: 0; border-radius: 2rem; min-width: 2.75rem; min-height: 2.25rem; cursor: pointer;
}
.lang button[aria-pressed="true"] { background: var(--text); color: var(--bg); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
  min-height: 3.25rem; padding: 0 1.6rem; border-radius: 2rem; border: 2px solid var(--text);
  background: var(--text); color: var(--bg);
}
.btn.secondary { background: transparent; color: var(--text); }
.btn:hover { opacity: 0.86; }
.btn[hidden] { display: none; }
.soon {
  display: inline-flex; align-items: center; gap: 0.55rem; min-height: 3.25rem; padding: 0 1.3rem;
  border: 1px dashed var(--muted); border-radius: 2rem; color: var(--muted); font-weight: 600;
}
.soon::before { content: ""; width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--correct); }

/* Tiles */
.tiles { display: flex; gap: 6px; }
.tile {
  width: var(--tile-size); height: var(--tile-size); flex: none;
  display: grid; place-items: center;
  border: 2px solid var(--tile); background: var(--bg);
  font-weight: 800; font-size: calc(var(--tile-size) * 0.5); font-variant-numeric: lining-nums tabular-nums; line-height: 1;
}
.tile.mine { border-color: var(--mine); background: var(--mine-tint); color: var(--mine); }
.tile.theirs { border-color: var(--theirs); background: var(--theirs-tint); color: var(--theirs); }
.tile.hit { border-color: var(--correct); background: var(--correct); color: var(--on-correct); }
.tile.active { border-color: var(--mine); }
.tile.active::after { content: ""; width: 2px; height: 46%; background: var(--mine); animation: blink 1.1s steps(1) infinite; }
.tile.pop { animation: pop 0.16s ease-out; }
@keyframes blink { 50% { opacity: 0; } }
@keyframes pop { from { transform: scale(0.86); } to { transform: scale(1); } }
.count { font-size: 0.875rem; font-weight: 500; }
.count b { font-size: 1rem; font-weight: 800; font-variant-numeric: tabular-nums; }

/* Hero */
.hero { padding: 3rem 0 3.5rem; }
.hero .wrap { display: grid; gap: 2.5rem; align-items: center; }
.hero h1 { font-size: clamp(2.6rem, 9vw, 4.4rem); letter-spacing: -0.01em; }
.hero .lede { font-size: 1.1875rem; color: var(--muted); margin-top: 1.1rem; max-width: 30rem; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.75rem; }
.hero .fine { margin-top: 1rem; font-size: 0.875rem; color: var(--muted); }
@media (min-width: 56rem) {
  .hero { padding: 4.5rem 0 5rem; }
  .hero .wrap { grid-template-columns: minmax(0, 1fr) minmax(0, 26rem); gap: 4rem; }
}

/* Playable demo */
.demo { border: 1px solid var(--hairline); border-radius: 14px; padding: 1.25rem; background: var(--bg); }
.demo h2 { font-size: 1.5rem; margin-top: 0.3rem; }
.demo .hint { font-size: 0.9375rem; color: var(--muted); margin-top: 0.35rem; }
.guesses { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: 0.6rem; max-height: 15.5rem; overflow-y: auto; overscroll-behavior: contain; }
.guesses:empty { display: none; }
.guesses li { display: flex; align-items: center; gap: 0.8rem; --tile-size: 38px; }
.entry { display: flex; align-items: center; gap: 0.8rem; margin-top: 0.6rem; --tile-size: 38px; }
.guesses + .entry { margin-top: 0.6rem; }
.demo .hint + .guesses, .demo .hint + .guesses:empty + .entry { margin-top: 1rem; }
.entry .count { color: var(--mine); font-weight: 600; }
.status { min-height: 1.5rem; margin-top: 0.75rem; font-size: 0.9375rem; font-weight: 600; }
.status.win { color: var(--correct); }
.keypad { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-top: 0.75rem; }
.keypad button {
  font: inherit; font-weight: 700; font-size: 1.25rem; font-variant-numeric: lining-nums;
  min-height: 3rem; border: 0; border-radius: 6px; background: var(--key); color: var(--text); cursor: pointer;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.keypad button:active { filter: brightness(0.88); }
.keypad button:disabled { opacity: 0.38; cursor: default; }
.keypad .submit { grid-column: span 4; font-size: 0.8125rem; letter-spacing: 0.08em; }
.keypad .submit.ready { background: var(--text); color: var(--bg); }
.keypad .del svg { width: 1.4rem; height: 1.4rem; vertical-align: middle; }
.demo-foot { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-top: 0.9rem; min-height: 2.75rem; }
.linkbtn { font: inherit; font-size: 0.9375rem; color: var(--muted); background: none; border: 0; padding: 0.6rem 0; text-decoration: underline; text-underline-offset: 0.18em; cursor: pointer; }
.demo-foot .btn { min-height: 2.75rem; padding: 0 1.2rem; }

/* Sections */
.section { padding: 3.5rem 0; border-top: 1px solid var(--hairline); }
.section > .wrap > h2 { font-size: clamp(1.9rem, 5vw, 2.6rem); margin-top: 0.5rem; }
.steps { list-style: none; padding: 0; margin: 2rem 0 0; display: grid; gap: 1rem; counter-reset: step; }
.steps li { border: 1px solid var(--hairline); border-radius: 12px; padding: 1.25rem; counter-increment: step; }
.steps li::before { content: counter(step); font-family: var(--title); font-size: 2.25rem; line-height: 1; display: block; margin-bottom: 0.6rem; }
.steps h3 { font-size: 1.3rem; }
.steps p { color: var(--muted); margin-top: 0.4rem; font-size: 1rem; }
.steps .example { margin-top: 1rem; display: grid; gap: 0.45rem; --tile-size: 34px; }
.features { list-style: none; padding: 0; margin: 2rem 0 0; display: grid; gap: 1.6rem 2.5rem; }
.features h3 { font-family: var(--body); font-size: 1.0625rem; font-weight: 700; line-height: 1.3; }
.features p { color: var(--muted); margin-top: 0.25rem; font-size: 1rem; }
.features li { padding-left: 1rem; border-left: 3px solid var(--text); }
.promise { background: var(--surface); }
.promise .wrap { display: grid; gap: 0.75rem; }
.promise h2 { font-size: clamp(1.9rem, 5vw, 2.6rem); }
.promise p { color: var(--muted); max-width: 38rem; }
@media (min-width: 44rem) {
  .steps { grid-template-columns: repeat(3, 1fr); }
  .features { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 62rem) { .features { grid-template-columns: repeat(3, 1fr); } }

/* Footer */
.site-footer { border-top: 1px solid var(--hairline); padding: 1.75rem 0 2.5rem; font-size: 0.9375rem; color: var(--muted); }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; justify-content: space-between; }
.site-footer nav { display: flex; gap: 1.25rem; }
.site-footer a { display: inline-block; padding: 0.35rem 0; }

/* Article pages (privacy, support) */
.article { max-width: 44rem; margin: 0 auto; padding: 3rem 1.25rem 4rem; }
.article h1 { font-size: clamp(2.3rem, 7vw, 3.2rem); }
.article .updated { color: var(--muted); font-size: 0.9375rem; margin-top: 0.6rem; }
.article .summary { margin-top: 1.5rem; padding: 1rem 1.15rem; background: var(--surface); border-radius: 10px; font-weight: 500; }
.article h2 { font-size: 1.55rem; margin-top: 2.4rem; }
.article h2 + p, .article h2 + ul, .article h2 + dl { margin-top: 0.7rem; }
.article p + p { margin-top: 0.8rem; }
.article ul { padding-left: 1.2rem; margin: 0.7rem 0 0; }
.article li { margin-top: 0.5rem; }
.article li::marker { color: var(--muted); }
.faq { margin-top: 1.5rem; border-top: 1px solid var(--hairline); }
.faq details { border-bottom: 1px solid var(--hairline); }
.faq summary { cursor: pointer; list-style: none; padding: 1rem 2rem 1rem 0; font-weight: 700; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 0.25rem; top: 50%; transform: translateY(-50%); font-size: 1.5rem; font-weight: 400; color: var(--muted); }
.faq details[open] summary::after { content: "\2013"; }
.faq details p { color: var(--muted); padding: 0 0 1.1rem; }

/* Invite and 404: one centred card */
.center { min-height: calc(100vh - 3.75rem - 1px); min-height: calc(100dvh - 3.75rem - 1px); display: grid; place-items: center; padding: 2rem 1.25rem 3rem; }
.card { width: 100%; max-width: 27rem; text-align: center; }
.card .appicon { width: 72px; height: 72px; border-radius: 16px; }
.card h1 { font-size: clamp(2rem, 8vw, 2.6rem); margin-top: 0.5rem; }
.card .lede { color: var(--muted); margin-top: 0.7rem; }
.card .tiles { justify-content: center; margin-top: 1.6rem; }
.card .codehint { margin-top: 0.6rem; font-size: 0.8125rem; color: var(--muted); }
.card .stack { display: grid; gap: 0.7rem; margin-top: 1.6rem; }
.card .help { margin-top: 1.6rem; padding-top: 1.3rem; border-top: 1px solid var(--hairline); text-align: left; font-size: 0.9375rem; color: var(--muted); display: grid; gap: 0.6rem; }
.card .help b { color: var(--text); }
.card .label { display: block; margin-top: 1.2rem; }
@media (max-width: 22.5rem) { .card { --tile-size: 40px; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .tile.pop, .tile.active::after { animation: none; }
}
