/* ChessBird — warm modern dark theme (pure CSS, MVP static site) */

:root {
  --bg: #1c1a17;
  --bg-soft: #22201c;
  --bg-elev: #292622;
  --card: #242220;
  --text: #f2ebe1;
  --muted: #a9a199;
  --line: rgba(255, 245, 230, 0.08);
  --line-strong: rgba(255, 245, 230, 0.12);
  --accent: #c9a86c;
  --accent-soft: rgba(201, 168, 108, 0.22);
  --accent-strong: #dcc08a;
  --accent-hover: #e4cda0;
  --cta-bg: #3d3428;
  --cta-border: rgba(212, 180, 120, 0.45);
  --cta-hover: #4a4134;
  --shadow-soft: 0 1px 2px rgba(0, 0, 0, 0.12);
  --shadow-card: 0 8px 24px rgba(0, 0, 0, 0.18);
  --max-width: 72rem;
  --radius: 0.85rem;
  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
  /* Portrait frame matches common Android captures (e.g. 1080 × 2273) — not legacy 9:16 */
  --screenshot-aspect: 1080 / 2273;
  --screenshot-hero-max-h: min(78vh, 600px);
  /* No percentage inside width — avoids circular sizing with fit-content / grid minmax(0, auto) */
  --screenshot-hero-frame-w: min(312px, 48vw, calc(var(--screenshot-hero-max-h) * 1080 / 2273));
  /* Secondary gallery (2–4 devices); caps scale down at 4-wide so row stays balanced */
  --screenshot-showcase-max-h: min(58vh, 480px);
  --screenshot-showcase-frame-w: min(300px, 42vw, calc(var(--screenshot-showcase-max-h) * 1080 / 2273));
}

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

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial,
    sans-serif;
  font-weight: 400;
  font-size: 1rem;
  background-color: var(--bg);
  background-image: radial-gradient(
    ellipse 120% 70% at 50% -8%,
    #2a2621 0%,
    var(--bg) 48%,
    #181613 100%
  );
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--accent-strong);
  text-decoration: none;
  transition: color 0.18s var(--ease);
}

a:hover,
a:focus-visible {
  color: var(--accent-hover);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.container {
  width: min(100% - 1.75rem, var(--max-width));
  margin-inline: auto;
}

.section {
  padding: 3rem 0;
}

h1,
h2,
h3 {
  margin: 0 0 0.65rem;
  line-height: 1.28;
  color: var(--text);
  font-weight: 600;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(1.95rem, 5vw, 2.95rem);
  font-weight: 600;
  letter-spacing: -0.03em;
}

h2 {
  font-size: clamp(1.3rem, 3.8vw, 1.85rem);
  font-weight: 600;
}

h3 {
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

p {
  margin: 0 0 1.05rem;
  color: var(--muted);
}

p:last-child {
  margin-bottom: 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--line);
  /* Slightly translucent so backdrop blur can read through; solid enough for legibility */
  background: rgba(28, 26, 23, 0.9);
  box-shadow: var(--shadow-soft);
}

@supports ((-webkit-backdrop-filter: blur(8px)) or (backdrop-filter: blur(8px))) {
  .site-header {
    background: rgba(28, 26, 23, 0.82);
    -webkit-backdrop-filter: blur(10px) saturate(1.05);
    backdrop-filter: blur(10px) saturate(1.05);
  }
}

.header-inner {
  min-height: 3.75rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1.1rem;
  font-size: 0.875rem;
  font-weight: 500;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--accent-strong);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.site-nav a[aria-current="page"] {
  color: var(--accent-strong);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  font-weight: 600;
  font-size: 0.9875rem;
  letter-spacing: -0.01em;
}

.brand img {
  border-radius: 0.55rem;
  box-shadow: 0 0 0 1px var(--line);
}

.hero.section {
  padding-top: 2.25rem;
}

.hero-grid {
  display: grid;
  gap: 1.15rem;
  align-items: start;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 0.45rem;
  color: var(--accent-strong);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 600;
}

.tagline {
  max-width: 52ch;
  font-size: clamp(1rem, 2.6vw, 1.125rem);
  line-height: 1.58;
}

.playstore-btn {
  display: inline-block;
  margin-top: 0.6rem;
  padding: 0.75rem 1.125rem;
  border-radius: 0.625rem;
  border: 1px solid var(--cta-border);
  color: var(--text);
  background: var(--cta-bg);
  font-weight: 600;
  font-size: 0.9375rem;
  letter-spacing: -0.01em;
  box-shadow: var(--shadow-soft);
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease),
    transform 0.2s var(--ease);
}

.playstore-btn:hover,
.playstore-btn:focus-visible {
  text-decoration: none;
  background: var(--cta-hover);
  border-color: rgba(212, 180, 120, 0.6);
}

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

.playstore-btn:active {
  transform: translateY(0.5px);
}

.feature-grid {
  display: grid;
  gap: 0.875rem;
}

.showcase-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
  justify-items: stretch;
}

/* Phone: outer device shell + inset screen (lightweight, not a mockup render) */
.screenshot-rotator {
  display: block;
  margin: 0;
  justify-self: center;
  width: max-content;
  max-width: 100%;
}

.screenshot-rotator--hero {
  min-width: min(312px, 48vw);
}

.screenshot-rotator--showcase {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  justify-self: stretch;
}

/* Device chassis — sizing lives here; screen gets portrait aspect inside */
.screenshot-rotator__frame {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  margin-inline: auto;
  width: var(--screenshot-showcase-frame-w);
  max-width: 100%;
  padding: 0.4rem 0.45rem 0.5rem;
  border-radius: 0.78rem;
  background: linear-gradient(165deg, #2f2a26 0%, #1f1d1a 42%, #181614 100%);
  border: 1px solid rgba(255, 245, 230, 0.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22), 0 1px 0 rgba(255, 255, 255, 0.04) inset;
}

.screenshot-rotator--hero .screenshot-rotator__frame {
  width: var(--screenshot-hero-frame-w);
}

.screenshot-rotator--showcase .screenshot-rotator__frame {
  width: min(100%, var(--screenshot-showcase-frame-w));
}

.screenshot-rotator__device-top {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0.65rem;
  padding-bottom: 0.2rem;
}

.screenshot-rotator__earpiece {
  display: block;
  width: 2.25rem;
  height: 0.2rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06);
  opacity: 0.85;
}

/* Inset “glass” — screenshots sit here only; neutral lift so UI stays readable */
.screenshot-rotator__screen {
  position: relative;
  flex: 0 0 auto;
  width: 100%;
  aspect-ratio: var(--screenshot-aspect);
  max-height: calc(var(--screenshot-showcase-max-h) - 1.4rem);
  border-radius: 0.4rem;
  overflow: hidden;
  background: #121110;
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    inset 0 2px 10px rgba(0, 0, 0, 0.35);
}

.screenshot-rotator--hero .screenshot-rotator__screen {
  max-height: calc(var(--screenshot-hero-max-h) - 1.5rem);
}

.screenshot-rotator__layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  /* Frame matches shot aspect; contain keeps full UI visible without stretch */
  object-fit: contain;
  object-position: center;
  opacity: 0;
  z-index: 0;
  transition: opacity 0.75s var(--ease);
  pointer-events: none;
  filter: contrast(1.02);
}

.screenshot-rotator__layer--visible {
  opacity: 1;
  z-index: 1;
}

.screenshot-rotator--showcase .screenshot-rotator__caption {
  margin: 0.38rem 0 0;
  padding: 0;
  max-width: 100%;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--muted);
  text-align: center;
  line-height: 1.35;
}

.section-intro code {
  font-size: 0.9em;
  color: var(--accent-strong);
  font-weight: 500;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.05rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  transition: border-color 0.22s var(--ease), box-shadow 0.22s var(--ease);
}

.card:hover {
  border-color: var(--line-strong);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.14);
}

.card p {
  margin-bottom: 0;
  font-size: 0.9575rem;
  line-height: 1.55;
}

.section-intro {
  max-width: 58ch;
  font-size: 0.9625rem;
  line-height: 1.55;
}

.contact-panel,
.legal-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.2rem 1.25rem;
  box-shadow: var(--shadow-card);
}

/* Unified gallery surface — same visual language as contact, tuned for title + copy + devices */
.showcase-panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem 1.2rem 1rem;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.14);
}

.showcase-panel > h2 {
  margin-bottom: 0.45rem;
}

.showcase-panel .section-intro--showcase {
  margin-bottom: 0.95rem;
}

.showcase-panel .showcase-grid {
  margin-bottom: 0;
}

.section--showcase {
  padding-bottom: 2.85rem;
}

.legal-main {
  min-height: calc(100vh - 10rem);
}

.legal-notice {
  color: var(--accent-strong);
  font-weight: 600;
}

.legal-card--policy {
  max-width: 52rem;
  margin-inline: auto;
}

.legal-card--policy h1 {
  margin-bottom: 0.75rem;
  font-size: 1.35rem;
}

.legal-card--policy h2 {
  margin-top: 1.35rem;
  margin-bottom: 0.5rem;
  font-size: 1.05rem;
}

.legal-card--policy h3 {
  margin-top: 1rem;
  margin-bottom: 0.4rem;
  font-size: 0.95rem;
}

.legal-card--policy p {
  margin-bottom: 0.65rem;
  font-size: 0.9425rem;
  line-height: 1.55;
}

.legal-card--policy ul {
  margin: 0 0 0.75rem 1.15rem;
  padding-left: 0.35rem;
}

.legal-card--policy li {
  margin-bottom: 0.35rem;
  font-size: 0.9425rem;
  line-height: 1.5;
}

.legal-card--policy a {
  color: var(--accent);
}

/* Contact page — spacious form on shared card surface */
.contact-page {
  max-width: 38rem;
  margin-inline: auto;
}

.contact-intro {
  margin-bottom: 1.75rem;
}

.contact-intro h1 {
  margin-bottom: 0.55rem;
}

.contact-lede {
  margin: 0;
  max-width: 48ch;
  font-size: 1.02rem;
  line-height: 1.58;
  color: var(--muted);
}

.contact-feedback {
  margin-bottom: 1.5rem;
  padding: 1rem 1.1rem;
  border-radius: var(--radius);
  border: 1px solid rgba(201, 168, 108, 0.35);
  background: var(--accent-soft);
}

.contact-feedback p {
  margin-bottom: 0.5rem;
  color: var(--text);
  font-size: 0.9375rem;
  line-height: 1.55;
}

.contact-feedback p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.9025rem;
}

.contact-panel--form {
  padding: 1.35rem 1.35rem 1.4rem;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.contact-honeypot {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-field label {
  font-size: 0.8825rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

.field-optional {
  font-weight: 500;
  color: var(--muted);
}

.field-required {
  color: var(--accent-strong);
  font-weight: 600;
}

.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form select,
.contact-form textarea {
  width: 100%;
  margin: 0;
  padding: 0.62rem 0.72rem;
  font: inherit;
  font-size: 0.9375rem;
  color: var(--text);
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 0.55rem;
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}

.contact-form select {
  cursor: pointer;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 1.1rem) 50%, calc(100% - 0.72rem) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 2rem;
}

.contact-form textarea {
  resize: vertical;
  min-height: 8.5rem;
  line-height: 1.55;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: rgba(169, 161, 153, 0.72);
}

.contact-form input:hover,
.contact-form select:hover,
.contact-form textarea:hover {
  border-color: var(--line-strong);
}

.contact-form input:focus-visible,
.contact-form select:focus-visible,
.contact-form textarea:focus-visible {
  outline: none;
  border-color: rgba(201, 168, 108, 0.55);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.contact-form-note {
  margin: 0;
  font-size: 0.8525rem;
  line-height: 1.5;
  color: var(--muted);
}

.contact-submit {
  align-self: flex-start;
  margin-top: 0.15rem;
  padding: 0.72rem 1.2rem;
  border-radius: 0.625rem;
  border: 1px solid var(--cta-border);
  color: var(--text);
  background: var(--cta-bg);
  font: inherit;
  font-weight: 600;
  font-size: 0.9375rem;
  letter-spacing: -0.01em;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.2s var(--ease);
}

.contact-submit:hover,
.contact-submit:focus-visible {
  background: var(--cta-hover);
  border-color: rgba(212, 180, 120, 0.6);
}

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

.contact-submit:active {
  transform: translateY(0.5px);
}

.contact-panel .contact-cta {
  margin-top: 0.35rem;
}

.contact-panel .contact-alt {
  margin-bottom: 0;
  margin-top: 0.85rem;
  font-size: 0.9025rem;
}

/* Custom 404 — same rhythm as contact/legal, calm recovery */
.not-found {
  max-width: 40rem;
  margin-inline: auto;
  text-align: center;
}

.not-found .eyebrow {
  margin-bottom: 0.5rem;
}

.not-found__title {
  margin-bottom: 0.65rem;
  font-size: clamp(1.35rem, 4vw, 1.85rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
}

.not-found__lede {
  margin: 0 auto 1.35rem;
  max-width: 44ch;
  font-size: 1.02rem;
  line-height: 1.58;
  color: var(--muted);
  text-align: center;
}

.not-found__actions {
  margin: 0 0 1.5rem;
}

.not-found__cta {
  margin-top: 0;
}

.not-found__panel {
  margin-inline: auto;
  max-width: 36rem;
  padding: 1rem 1.15rem;
  text-align: center;
}

.not-found__hint {
  margin: 0;
  font-size: 0.9225rem;
  line-height: 1.55;
  color: var(--muted);
}

.not-found__hint a {
  color: var(--accent-strong);
  font-weight: 500;
}

.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 1.25rem;
  background: rgba(24, 22, 20, 0.6);
}

.footer-links {
  min-height: 3.65rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.875rem 1.25rem;
  font-size: 0.92rem;
}

.footer-links a {
  color: var(--muted);
  transition: color 0.18s var(--ease);
}

.footer-links a:hover,
.footer-links a:focus-visible {
  color: var(--accent-strong);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (min-width: 48rem) {
  .container {
    width: min(100% - 2.5rem, var(--max-width));
  }

  .section {
    padding: 3.5rem 0;
  }

  .hero.section {
    padding-top: 2.5rem;
  }

  .hero-grid {
    /* Second column: floor width so the phone track cannot collapse to 0 with max-content sizing */
    grid-template-columns: minmax(0, 1.12fr) minmax(min(260px, 100%), max-content);
    align-items: center;
    gap: clamp(1rem, 3vw, 1.65rem);
  }

  .feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
  }

  .showcase-grid {
    grid-template-columns: repeat(2, minmax(min(220px, 100%), 1fr));
    gap: 0.5rem;
  }
}

@media (min-width: 64rem) {
  :root {
    --screenshot-showcase-max-h: min(56vh, 480px);
    --screenshot-showcase-frame-w: min(272px, 22.5vw, calc(var(--screenshot-showcase-max-h) * 1080 / 2273));
  }

  .feature-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .showcase-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.45rem;
  }
}
