/* Lexi-Defense marketing site. Colours mirror LexiTheme
   (lib/ui/theme/lexi_theme.dart): neo-brutalist flat fills, near-black
   outlines, hard un-blurred shadows. No JS anywhere; the CSP forbids inline
   styles, so every rule lives here. */

:root {
  --cream: #f5f5dc;
  --light-cream: #fafaf0;
  --ink: #1a1a1a;
  --warm-gray: #4a4a4a;
  --coral: #ff6b6b;
  --teal: #4ecdc4;
  --deep-teal: #3ba99c;
  --yellow: #ffe66d;
  --pale-yellow: #fff8e1;
  --white: #ffffff;
  --border: 3px solid var(--ink);
  --shadow: 5px 5px 0 var(--ink);
  --shadow-sm: 3px 3px 0 var(--ink);
  --radius: 10px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  color-scheme: light;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--cream);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 20px;
}

a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--teal);
  text-decoration-thickness: 3px;
  text-underline-offset: 3px;
}

a:hover,
a:focus-visible {
  background: var(--yellow);
}

h1,
h2,
h3 {
  line-height: 1.15;
  font-weight: 900;
  letter-spacing: -0.01em;
}

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

.site-header {
  background: var(--white);
  border-bottom: var(--border);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  gap: 16px;
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  font-size: 1.25rem;
  text-decoration: none;
}

.wordmark img {
  border: 2px solid var(--ink);
  border-radius: 6px;
}

.wordmark:hover {
  background: none;
}

.site-nav {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.site-nav a {
  font-weight: 700;
  font-size: 0.95rem;
  padding: 6px 0;
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  text-decoration: underline;
  text-decoration-color: var(--coral);
  text-decoration-thickness: 3px;
  background: none;
}

@media (max-width: 480px) {
  .site-header .wrap {
    flex-wrap: wrap;
    justify-content: center;
    padding-top: 12px;
    padding-bottom: 12px;
  }
}

/* ---- Letter tiles (the game's towers) ---- */

.tiles {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  list-style: none;
}

.tile {
  position: relative;
  width: 84px;
  height: 84px;
  display: grid;
  place-items: center;
  background: var(--white);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  font-size: 2.4rem;
  font-weight: 900;
}

.tile small {
  position: absolute;
  right: 6px;
  bottom: 2px;
  font-size: 0.8rem;
  font-weight: 800;
}

.tile.teal { background: var(--teal); }
.tile.yellow { background: var(--yellow); }
.tile.coral { background: var(--coral); }

.tiles .tile:nth-child(odd) { transform: rotate(-3deg); }
.tiles .tile:nth-child(even) { transform: rotate(2deg); }

@media (max-width: 480px) {
  .tile {
    width: 54px;
    height: 54px;
    font-size: 1.8rem;
    box-shadow: var(--shadow-sm);
  }

  .tile small {
    right: 4px;
    bottom: 0;
    font-size: 0.62rem;
  }

  .tiles {
    gap: 7px;
  }
}

/* ---- Hero ---- */

.hero {
  padding: 56px 0 48px;
  text-align: center;
  background: var(--teal);
  border-bottom: var(--border);
}

.hero h1 {
  font-size: clamp(2.1rem, 6.5vw, 3.6rem);
  margin: 36px auto 14px;
  max-width: 18ch;
}

.hero h1 em {
  font-style: normal;
  background: var(--yellow);
  border: var(--border);
  box-shadow: var(--shadow-sm);
  padding: 0 10px;
  border-radius: 6px;
  display: inline-block;
  transform: rotate(-1.5deg);
}

.tagline {
  font-size: 1.2rem;
  font-weight: 500;
  max-width: 46ch;
  margin: 0 auto;
}

.cta-row {
  margin: 30px 0 16px;
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

.cta {
  display: inline-block;
  padding: 13px 24px;
  background: var(--white);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  font-weight: 900;
  text-decoration: none;
}

a.cta:hover,
a.cta:focus-visible {
  background: var(--yellow);
  transform: translate(2px, 2px);
  box-shadow: var(--shadow-sm);
}

.cta.soon {
  background: var(--pale-yellow);
}

.meta-strip {
  font-size: 0.95rem;
  font-weight: 700;
}

/* ---- Phone frames (real screenshots + the gameplay clip) ---- */

.phone {
  background: var(--ink);
  border: var(--border);
  border-radius: 30px;
  box-shadow: var(--shadow);
  padding: 7px;
  overflow: hidden;
}

.phone img,
.phone video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 540 / 1174;
  border-radius: 23px;
  background: var(--cream);
}

.hero-phone {
  width: min(300px, 78vw);
  margin: 40px auto 0;
  transform: rotate(2deg);
}

/* No autoplaying motion for people who asked the OS for less: the poster
   frame stands in. */
.hero-phone .still {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .hero-phone .motion {
    display: none;
  }

  .hero-phone .still {
    display: block;
  }
}

@media (min-width: 860px) {
  .hero {
    text-align: left;
  }

  .hero-grid {
    display: grid;
    grid-template-columns: 1fr 300px;
    align-items: center;
    gap: 48px;
  }

  .hero .tiles,
  .hero .cta-row {
    justify-content: flex-start;
  }

  .hero h1,
  .hero .tagline {
    margin-left: 0;
  }

  .hero-phone {
    width: 100%;
    margin: 0;
  }
}

/* The gallery: a row of five on desktop, a swipeable strip on phones. */
.shots {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
}

.shots figure {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.shots .phone {
  border-radius: 24px;
  padding: 5px;
  box-shadow: var(--shadow-sm);
}

.shots .phone img {
  border-radius: 19px;
}

.shots figcaption {
  font-size: 0.92rem;
  color: var(--warm-gray);
  line-height: 1.4;
}

.shots figcaption strong {
  display: block;
  color: var(--ink);
  font-size: 1rem;
  margin-bottom: 2px;
}

@media (max-width: 859px) {
  .shots {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: min(210px, 62vw);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    overscroll-behavior-x: contain;
    /* Bleed to the screen edge so the strip reads as swipeable, while the
       first card still lines up with the text above it. */
    margin: 0 -20px;
    padding: 4px 20px 16px;
    scroll-padding: 0 20px;
  }

  .shots li {
    scroll-snap-align: start;
  }
}

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

section {
  padding: 56px 0;
}

section + section {
  border-top: var(--border);
}

section.alt {
  background: var(--light-cream);
}

h2 {
  font-size: clamp(1.6rem, 4vw, 2.3rem);
  margin-bottom: 10px;
}

.section-lede {
  font-size: 1.1rem;
  color: var(--warm-gray);
  max-width: 60ch;
  margin-bottom: 30px;
}

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 22px;
  counter-reset: step;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 22px;
}

.card,
.step {
  background: var(--white);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}

.step {
  counter-increment: step;
}

.step h3::before {
  content: counter(step);
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-right: 10px;
  background: var(--yellow);
  border: 2px solid var(--ink);
  border-radius: 6px;
  font-size: 1.05rem;
}

.card h3,
.step h3 {
  font-size: 1.2rem;
  margin-bottom: 8px;
}

.card p,
.step p {
  color: var(--warm-gray);
}

.card.teal { border-top-width: 12px; border-top-color: var(--teal); }
.card.coral { border-top-width: 12px; border-top-color: var(--coral); }
.card.yellow { border-top-width: 12px; border-top-color: var(--yellow); }

.books {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 18px;
  list-style: none;
}

.books li {
  background: var(--white);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 18px;
}

.books strong {
  display: block;
  font-size: 1.05rem;
}

.books span {
  color: var(--warm-gray);
  font-size: 0.95rem;
}

.books .book-num {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--coral);
  border: 2px solid var(--ink);
  border-radius: 4px;
  padding: 0 8px;
  margin-bottom: 8px;
  color: var(--ink);
}

.faq h3 {
  font-size: 1.15rem;
  margin: 26px 0 6px;
}

.faq p {
  color: var(--warm-gray);
  max-width: 70ch;
}

/* ---- Legal / support pages ---- */

.doc {
  padding: 48px 20px 64px;
  max-width: 760px;
}

.doc h1 {
  font-size: clamp(2rem, 5vw, 2.8rem);
  margin-bottom: 6px;
}

.doc .effective {
  color: var(--warm-gray);
  font-weight: 700;
  margin-bottom: 28px;
}

.doc h2 {
  font-size: 1.35rem;
  margin: 34px 0 10px;
}

.doc p,
.doc li {
  margin-bottom: 10px;
}

.doc ul {
  padding-left: 22px;
}

.doc .callout {
  background: var(--pale-yellow);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 16px 18px;
  margin: 18px 0;
}

.doc table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0 18px;
  background: var(--white);
  border: var(--border);
}

.doc th,
.doc td {
  text-align: left;
  vertical-align: top;
  padding: 10px 12px;
  border-bottom: 2px solid var(--ink);
  font-size: 0.95rem;
}

.doc th {
  background: var(--teal);
}

@media (max-width: 560px) {
  .doc table,
  .doc tbody,
  .doc tr,
  .doc td {
    display: block;
  }

  .doc thead {
    display: none;
  }

  .doc td:first-child {
    font-weight: 800;
    background: var(--light-cream);
  }
}

.error-page {
  padding: 80px 20px;
  text-align: center;
}

.error-page h1 {
  font-size: 3rem;
  margin: 28px 0 10px;
}

.error-page p {
  margin-bottom: 20px;
}

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

.site-footer {
  background: var(--ink);
  color: var(--cream);
  padding: 30px 0;
}

.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

.footer-links {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.site-footer a {
  color: var(--cream);
  text-decoration-color: var(--teal);
}

.site-footer a:hover {
  background: none;
  color: var(--yellow);
}
