/* ----------------------------------------------------------------------
   Oustwit website — shared stylesheet
   Color palette pulled from GameTypes.h so the site matches the app.
   Mobile-first; expands at 720px / 1024px.
   ---------------------------------------------------------------------- */

:root {
  /* Brand palette */
  --bg:           rgb(245, 247, 250);
  --bg-elevated:  rgb(255, 255, 255);
  --bg-soft:      rgb(238, 241, 246);

  --text:         rgb(35, 40, 55);
  --text-muted:   rgb(80, 90, 110);
  --text-subtle:  rgb(100, 110, 130);

  --red:          rgb(199, 46, 36);
  --red-soft:     rgb(245, 220, 218);
  --blue:         rgb(36, 82, 209);
  --blue-soft:    rgb(218, 228, 247);
  --green:        rgb(50, 160, 70);
  --orange:       rgb(220, 140, 50);

  --border:       rgb(210, 215, 222);
  --border-soft:  rgb(228, 232, 238);

  --btn-primary-bg:    rgb(77, 158, 97);
  --btn-primary-hover: rgb(64, 138, 82);
  --btn-secondary-bg:  rgb(77, 128, 199);
  --btn-secondary-hover: rgb(58, 108, 178);

  /* Typography */
  --font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono:  ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  /* Layout */
  --content-max: 760px;
  --wide-max:    1080px;
  --radius:      8px;
  --radius-lg:   14px;
  --shadow-sm:   0 1px 2px rgba(20, 24, 38, 0.04), 0 1px 3px rgba(20, 24, 38, 0.06);
  --shadow-md:   0 4px 12px rgba(20, 24, 38, 0.07), 0 2px 4px rgba(20, 24, 38, 0.05);
}

/* ---------- Reset ---------- */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; }
img, svg { max-width: 100%; height: auto; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }

/* ---------- Base ---------- */

body {
  font-family: var(--font-stack);
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--blue);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease;
}
a:hover, a:focus { border-bottom-color: currentColor; }

h1, h2, h3, h4 {
  color: var(--text);
  font-weight: 700;
  line-height: 1.25;
  margin: 1.5em 0 0.5em;
}
h1 { font-size: 2.1rem; margin-top: 0; }
h2 { font-size: 1.55rem; }
h3 { font-size: 1.2rem; }
h4 { font-size: 1.05rem; }

p { margin: 0 0 1em; }
ul, ol { padding-left: 1.4em; margin: 0 0 1em; }
li { margin-bottom: 0.35em; }

blockquote {
  border-left: 3px solid var(--border);
  padding: 0.4em 0 0.4em 1em;
  margin: 1.4em 0;
  color: var(--text-muted);
  font-style: italic;
}

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--bg-soft);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}
pre {
  background: var(--bg-soft);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 1em;
  overflow-x: auto;
  font-size: 0.9rem;
}
pre code { background: none; padding: 0; }

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.2em 0;
  font-size: 0.95rem;
}
th, td {
  text-align: left;
  padding: 0.6em 0.8em;
  border-bottom: 1px solid var(--border-soft);
}
th { background: var(--bg-soft); font-weight: 600; }

hr {
  border: none;
  height: 1px;
  background: var(--border-soft);
  margin: 2.4em 0;
}

/* ---------- Layout shells ---------- */

.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 20px;
}
.container--wide { max-width: var(--wide-max); }

.page {
  padding: 32px 0 64px;
}

/* ---------- Header / nav ---------- */

.site-header {
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-soft);
  padding: 14px 0;
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: saturate(140%) blur(8px);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
}
.site-header__inner {
  max-width: var(--wide-max);
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.site-header__brand {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text);
  border-bottom: none;
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: center;
  gap: 9px;
}
/* Product icon as the header mark. */
.site-header__brand::before {
  content: "";
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: image-set(url('img/oustwit-icon-48.png') 1x, url('img/oustwit-icon-72.png') 2x) center / cover no-repeat;
  /* Fallback for browsers without image-set support */
  background-image: url('img/oustwit-icon-72.png');
  background-size: cover;
  background-position: center;
  box-shadow: var(--shadow-sm);
}
.site-header__brand:hover { border-bottom: none; }

.site-nav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.site-nav a {
  position: relative;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius);
  border-bottom: none;
  transition: color 0.18s ease, background 0.18s ease;
}
/* Animated underline that slides in on hover and stays under the active page. */
.site-nav a::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 1px;
  height: 2px;
  background: var(--blue);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.2s ease;
}
.site-nav a:hover {
  color: var(--text);
  background: var(--bg-soft);
}
.site-nav a:hover::after { transform: scaleX(1); }
.site-nav a[aria-current="page"] {
  color: var(--text);
  font-weight: 600;
}
.site-nav a[aria-current="page"]::after { transform: scaleX(1); }

@media (max-width: 640px) {
  .site-header__inner { flex-direction: column; align-items: center; gap: 10px; }
  .site-nav { gap: 2px; font-size: 0.9rem; justify-content: center; }
  .site-nav a { padding: 6px 10px; }
}

/* ---------- Hero (homepage) ---------- */

.hero {
  padding: 56px 0 40px;
  text-align: center;
}
.hero__eyebrow {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.78rem;
  color: var(--text-subtle);
  margin-bottom: 14px;
}
.hero__title {
  font-size: 2.6rem;
  margin: 0 0 14px;
  letter-spacing: -0.015em;
}
.hero__sub {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto 28px;
}
.hero__ctas {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.hero__small {
  font-size: 0.9rem;
  color: var(--text-subtle);
  margin-top: 16px;
}
.hero__visual {
  margin-top: 0;
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-subtle);
  font-size: 0.95rem;
}
.hero__visual picture {
  display: block;
  width: 100%;
  height: 100%;
}
.hero__visual img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
@media (min-width: 720px) {
  .hero__title { font-size: 3.2rem; }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 1rem;
  border: 1px solid transparent;
  cursor: pointer;
  background: var(--btn-primary-bg);
  color: white;
  transition: background 0.15s ease, transform 0.15s ease;
  text-decoration: none;
}
.btn:hover {
  background: var(--btn-primary-hover);
  border-bottom: 1px solid transparent;
}
.btn:active { transform: translateY(1px); }
.btn--secondary {
  background: var(--btn-secondary-bg);
}
.btn--secondary:hover { background: var(--btn-secondary-hover); }
.btn--ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn--ghost:hover { background: var(--bg-soft); }
.btn--danger {
  background: var(--red);
}
.btn--danger:hover { background: rgb(170, 38, 30); }
.btn--provider {
  background: var(--btn-secondary-bg);
  color: var(--text);
  border-color: var(--border);
}
.btn--provider:hover { background: var(--bg-soft); }

.auth-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 18px 0 8px;
}
.auth-choices .btn { flex: 1 1 200px; }
.subtle--divider {
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--border-soft);
}

.btn-store {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 22px;
  background: var(--text);
  color: var(--bg-elevated);
  border-radius: var(--radius);
  font-weight: 600;
  text-decoration: none;
  border: none;
  transition: background 0.15s ease;
}
.btn-store:hover { background: rgb(20, 25, 40); border-bottom: none; }
.btn-store__small { font-size: 0.7rem; opacity: 0.8; line-height: 1; }
.btn-store__big   { font-size: 1.05rem; line-height: 1.1; }

/* ---------- Feature grid ---------- */

.grid {
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) { .grid--3 { grid-template-columns: repeat(3, 1fr); } .grid--2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .grid--3-lg { grid-template-columns: repeat(3, 1fr); } }

.tile {
  background: var(--bg-elevated);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}
.tile__step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--blue-soft);
  color: var(--blue);
  font-weight: 700;
  margin-bottom: 14px;
}
.tile h3 { margin-top: 0; }

/* ---------- Sections ---------- */

.section {
  padding: 48px 0;
}
.section--alt {
  background: var(--bg-elevated);
  border-top: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
}
.section__title {
  text-align: center;
  margin: 0 0 32px;
}
.section__lead {
  text-align: center;
  color: var(--text-muted);
  max-width: 640px;
  margin: 0 auto 32px;
}

.two-col {
  display: grid;
  gap: 28px;
  grid-template-columns: 1fr;
}
@media (min-width: 720px) {
  .two-col { grid-template-columns: 1fr 1fr; gap: 36px; }
}

/* ---------- Footer ---------- */

.site-footer {
  background: var(--bg-elevated);
  border-top: 1px solid var(--border-soft);
  padding: 40px 0 32px;
  margin-top: 56px;
  font-size: 0.92rem;
  color: var(--text-muted);
}
.site-footer__cols {
  max-width: var(--wide-max);
  margin: 0 auto;
  padding: 0 20px;
  display: grid;
  gap: 28px;
  grid-template-columns: 1fr;
}
@media (min-width: 720px) {
  .site-footer__cols { grid-template-columns: repeat(3, 1fr); }
}
.site-footer h4 {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-subtle);
  margin: 0 0 12px;
}
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 6px; }
.site-footer a { color: var(--text-muted); border-bottom: none; }
.site-footer a:hover { color: var(--text); }
.site-footer__legal {
  max-width: var(--wide-max);
  margin: 28px auto 0;
  padding: 20px 20px 0;
  border-top: 1px solid var(--border-soft);
  font-size: 0.82rem;
  color: var(--text-subtle);
}

/* ---------- Forms (account deletion) ---------- */

.form {
  background: var(--bg-elevated);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  margin: 24px 0;
}
.form__row {
  margin-bottom: 18px;
}
.form__row:last-child { margin-bottom: 0; }
.form label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 0.95rem;
}
.form input[type="email"],
.form input[type="text"] {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  font-size: 1rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.form input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-soft);
}
.form__hint {
  font-size: 0.85rem;
  color: var(--text-subtle);
  margin-top: 6px;
}

/* ---------- Callouts ---------- */

.note {
  background: var(--blue-soft);
  border-left: 3px solid var(--blue);
  padding: 14px 16px;
  border-radius: var(--radius);
  margin: 1.4em 0;
  color: var(--text);
  font-size: 0.95rem;
}
.note--warn {
  background: rgb(252, 240, 220);
  border-left-color: var(--orange);
}

/* ---------- Misc ---------- */

.text-center { text-align: center; }
.muted { color: var(--text-muted); }
.subtle { color: var(--text-subtle); font-size: 0.92rem; }

/* Postal address rendered as an image so the street address can't be easily scraped.
   The PNG is exported at body-text size; we let it scale naturally next to the
   surrounding text and add a touch of top margin to sit under the wordmark. */
.postal-mark {
  display: inline-block;
  margin-top: 6px;
  vertical-align: top;
  user-select: none;
}
.spaced > * + * { margin-top: 1em; }

/* Brand wordmark image — used in place of the company name to slow down text scrapers.
   The PNGs are rendered tight to the glyph extent (cap-line to descender), so:
     - image height: 30px @ 1x
     - baseline:    23px from top (= 76.7% of image height)
     - descender:    7px below baseline (= 23.3% of image height)
   To match the surrounding text's cap-height (~70% of em) and align baselines,
   we set height: 0.9em and drop the image down so its internal baseline meets
   the surrounding text baseline. */
.brand-mark {
  display: inline-block;
  height: 0.9em;
  width: auto;
  vertical-align: -0.21em;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}
/* Same alignment, slightly bigger in the footer where text is smaller. */
.brand-mark--footer {
  height: 1em;
  vertical-align: -0.23em;
}

/* Email address rendered as an image (anti-scraping). The clickable wrapper
   assembles the mailto: at click time from split data attributes, so the
   address appears nowhere in the static HTML. Same glyph proportions as the
   wordmark (descender ≈ 22% of height). */
.email-link {
  display: inline-block;
  border-bottom: none;
  cursor: pointer;
  line-height: 0;
}
.email-mark {
  display: inline-block;
  height: 1em;
  width: auto;
  vertical-align: -0.23em;
  user-select: none;
  -webkit-user-drag: none;
}
.email-link:hover .email-mark { opacity: 0.75; }

/* dl-style key/value (fact sheet) */
.kv {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px 18px;
  margin: 1em 0;
}
@media (min-width: 600px) {
  .kv { grid-template-columns: 200px 1fr; }
}
.kv dt {
  font-weight: 600;
  color: var(--text-muted);
}
.kv dd {
  margin: 0 0 10px;
}
