/* Quiz Odyssey — legal pages
   Warm, calm palette matching the app. Mobile-first, system fonts only.
   Light by default; follows the system colour scheme, and the header
   toggle lets the viewer override it (stored in localStorage). */

:root {
  color-scheme: light;

  --toggle-moon: inline-block;
  --toggle-sun: none;

  /* Page */
  --bg-top: #e4bdb5;
  --bg-bottom: #f1d1c3;

  /* Panel & text */
  --panel: #f8f0e1;
  --border: #dcb27a;
  --text: #3a2616;
  --muted: #9c8b70;
  --heading: #5a3a1a;
  --link: #b8702a;
  --soft: #f3e4cc;
  --shadow: 0 8px 28px rgba(120, 60, 10, 0.12);

  /* Accents */
  --accent-a: #efb664;
  --accent-b: #e09343;
  --gold-a: #f5d377;
  --gold-b: #e5b049;
  --on-accent: #4a2c0e;

  --measure: 60rem;
  --gutter: 1rem;
  /* Breathing room above everything, so the content does not start flush
     against the top of the screen. */
  --top-space: 1rem;
  --radius: 24px;
}

/* Dark palette: same warm character, dimmed. Applies when the system is
   dark and the viewer has not chosen light, or when they chose dark. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg-top: #2a211f;
    --bg-bottom: #3a2c28;
    --panel: #332926;
    --border: #7a5e3a;
    --text: #f3e6d6;
    --muted: #bba88f;
    --heading: #f3e6d6;
    --link: #e5b049;
    --soft: #3e322d;
    --shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
    --toggle-moon: none;
    --toggle-sun: inline-block;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg-top: #2a211f;
  --bg-bottom: #3a2c28;
  --panel: #332926;
  --border: #7a5e3a;
  --text: #f3e6d6;
  --muted: #bba88f;
  --heading: #f3e6d6;
  --link: #e5b049;
  --soft: #3e322d;
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
  --toggle-moon: none;
  --toggle-sun: inline-block;
}

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

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, "Noto Sans", sans-serif;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg-bottom)
    linear-gradient(to bottom, var(--bg-top), var(--bg-bottom)) fixed;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-inline: var(--gutter);
  padding-top: var(--top-space);
}

[id] {
  scroll-margin-top: 1rem;
}

a {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 0.15em;
  transition: color 120ms ease;
}

a:hover {
  color: var(--heading);
}

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

/* Tapping a control should not leave a rectangle behind; keyboard users
   still get the ring above through :focus-visible. */
button:focus:not(:focus-visible),
.button:focus:not(:focus-visible) {
  outline: none;
}

button,
.button {
  -webkit-tap-highlight-color: transparent;
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  padding: 0.5rem 0.75rem;
  background: var(--panel);
  color: var(--text);
  border: 2px solid var(--border);
  border-radius: 999px;
  z-index: 100;
}

.skip-link:focus {
  top: 0.5rem;
}

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

.wrap {
  width: 100%;
  max-width: var(--measure);
  margin-inline: auto;
}

.site-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding-top: 1.5rem;
}

.brand {
  display: block;
  line-height: 0;
  border-radius: 12px;
}

.brand img {
  width: min(240px, 70vw);
  height: auto;
}

@media (min-width: 40em) {
  .brand img {
    width: 280px;
  }
}

.lang-switch {
  display: flex;
  justify-content: center;
  gap: 1.75rem;
}

.lang-switch button {
  font: inherit;
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  background: transparent;
  border: 0;
  padding: 0.25rem 0.1rem;
  cursor: pointer;
  transition: color 120ms ease;
}

.lang-switch button:hover {
  color: var(--heading);
}

/* Active language: driven by data-lang on <html>, set before first paint. */
:root[data-lang="el"] .lang-switch [data-lang="el"],
:root[data-lang="en"] .lang-switch [data-lang="en"] {
  color: var(--accent-b);
}

/* Only one language is shown at a time. Without JS, data-lang is absent
   and both languages render, Greek first. */
:root[data-lang="el"] .only-en,
:root[data-lang="en"] .only-el {
  display: none !important;
}

.header-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.75rem;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 120ms ease;
}

.theme-toggle:hover {
  color: var(--heading);
}

.theme-toggle .icon-moon {
  display: var(--toggle-moon);
}

.theme-toggle .icon-sun {
  display: var(--toggle-sun);
}

main.wrap {
  flex: 1;
  padding-block: 1.5rem 2rem;
}

.site-footer {
  font-size: 0.875rem;
  color: var(--muted);
  padding-block: 1.75rem 2rem;
}

.site-footer .wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-align: center;
}

.site-footer p {
  margin: 0;
}

/* ---------- Document typography ---------- */

main h1,
main h2,
main h3,
main h4 {
  color: var(--heading);
  line-height: 1.25;
  overflow-wrap: anywhere;
}

main h1 {
  font-size: clamp(1.5rem, 3.5vw + 0.5rem, 2rem);
  margin: 0 0 1rem;
}

main h2 {
  font-size: clamp(1.25rem, 2vw + 0.5rem, 1.5rem);
  margin: 2rem 0 0.75rem;
}

main h3 {
  font-size: 1.125rem;
  margin: 1.75rem 0 0.5rem;
}

main h4 {
  font-size: 1rem;
  margin: 1.25rem 0 0.5rem;
}

main p,
main ul,
main ol,
main dl {
  margin: 0 0 1rem;
}

main ul,
main ol {
  padding-left: 1.5rem;
}

main li + li {
  margin-top: 0.35rem;
}

main li > ul,
main li > ol {
  margin-top: 0.35rem;
  margin-bottom: 0;
}

main dt {
  font-weight: 600;
}

main dd {
  margin: 0 0 0.5rem;
}

main strong {
  font-weight: 700;
}

main hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

main blockquote {
  margin: 1.25rem 0;
  padding: 0.75rem 1rem;
  border-left: 3px solid var(--gold-b);
  background: var(--soft);
  border-radius: 0 12px 12px 0;
}

main blockquote > :last-child {
  margin-bottom: 0;
}

main code,
main kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono",
    monospace;
  font-size: 0.925em;
  background: var(--soft);
  padding: 0.1em 0.35em;
  border-radius: 6px;
}

main pre {
  overflow-x: auto;
  padding: 0.75rem 1rem;
  background: var(--soft);
  border-radius: 12px;
}

main pre code {
  background: none;
  padding: 0;
}

main img {
  max-width: 100%;
  height: auto;
}

main address {
  font-style: normal;
}

/* Language sections */

.lang-section > :first-child {
  margin-top: 0.75rem;
}

/* ---------- Tables ---------- */

/* Tables are wrapped in .table-scroll (by script.js, or by hand) so the
   table itself can be wider than the viewport without the page scrolling. */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1.25rem 0;
  border: 1px solid var(--border);
  border-radius: 12px;
}

main table {
  border-collapse: collapse;
  width: 100%;
  min-width: 100%;
  font-size: 0.95rem;
}

.table-scroll > table {
  margin: 0;
  border: 0;
}

main caption {
  text-align: left;
  font-weight: 600;
  color: var(--heading);
  padding: 0.5rem 0.75rem;
  caption-side: top;
}

main th,
main td {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.table-scroll th:first-child,
.table-scroll td:first-child {
  border-left: 0;
}

.table-scroll th:last-child,
.table-scroll td:last-child {
  border-right: 0;
}

.table-scroll tr:first-child > * {
  border-top: 0;
}

.table-scroll tr:last-child > * {
  border-bottom: 0;
}

main thead th {
  background: var(--soft);
  color: var(--heading);
  font-weight: 700;
}

/* ---------- Components ---------- */

.button {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: linear-gradient(to bottom, var(--accent-a), var(--accent-b));
  color: var(--on-accent);
  border: 0;
  border-radius: 999px;
  box-shadow: inset 0 -3px 0 rgba(120, 60, 10, 0.25);
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: filter 120ms ease;
}

.button:hover {
  color: var(--on-accent);
  filter: brightness(1.04);
}

.email-box {
  margin: 1.25rem 0 1.5rem;
}

.email-box p {
  margin: 0 0 0.35rem;
}

.email-box p:last-child {
  margin-bottom: 0;
}

.email-plain {
  display: block;
  margin: 0.35rem 0 0.5rem;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--heading);
  user-select: all;
  -webkit-user-select: all;
  overflow-wrap: anywhere;
}

.notice,
.email-box {
  padding: 0.75rem 1rem;
  border-left: 3px solid var(--gold-b);
  border-radius: 0 12px 12px 0;
  background: var(--soft);
}

.notice > :last-child,
.email-box > :last-child {
  margin-bottom: 0;
}

.page-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.page-list li {
  margin: 0;
  border-top: 1px solid var(--border);
}

.page-list a {
  display: block;
  padding: 0.9rem 0;
  text-decoration: none;
  font-weight: 700;
  color: var(--heading);
}

.page-list a:hover {
  color: var(--link);
}

.page-list small {
  display: block;
  font-weight: 400;
  color: var(--muted);
}

.muted {
  color: var(--muted);
}

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

/* ---------- Home page ---------- */

.wrap--wide {
  max-width: 72rem;
}

/* The home header holds only the controls; the logo is in the hero. */
.site-header--home {
  flex-direction: row;
  justify-content: flex-end;
  padding-top: 0;
  width: 100%;
  max-width: 72rem;
  margin-inline: auto;
}

.site-header--home .header-controls {
  gap: 1.25rem;
}

.home main.wrap {
  padding-top: 0.5rem;
}

/* Hero: text and carousel stacked on phones, side by side on wide screens. */
.hero {
  display: grid;
  /* minmax(0, …) stops the wide carousel strip from stretching the column. */
  grid-template-columns: minmax(0, 1fr);
  gap: 2rem;
  align-items: center;
  text-align: center;
}

main .hero-logo {
  margin: 0 auto 0.75rem;
  line-height: 0;
}

.hero-logo img {
  width: min(340px, 78vw);
  height: auto;
}

main .tagline {
  font-size: clamp(1.3rem, 2.5vw + 0.6rem, 1.85rem);
  font-weight: 800;
  line-height: 1.3;
  color: var(--heading);
  margin: 0 0 0.85rem;
  text-wrap: balance;
}

main .lead {
  font-size: 1.075rem;
  max-width: 34rem;
  margin: 0 auto 1.5rem;
}

.store-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
}

/* Google Play button, drawn in the style of the official store badge. */
.play-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1.35rem 0.6rem 1.1rem;
  min-height: 3.5rem;
  border-radius: 14px;
  background: #111;
  color: #fff;
  border: 1px solid #5f5f5f;
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.play-badge:hover {
  color: #fff;
  transform: translateY(-1px);
}

.play-badge__icon {
  flex: none;
  width: 1.6rem;
  height: auto;
}

.play-badge__text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: 0.01em;
}

.play-badge__text small {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

@media (min-width: 56em) {
  .hero {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
    gap: 3rem;
    text-align: left;
    padding-block: 1rem 2rem;
  }

  main .hero-logo {
    margin-left: 0;
  }

  .hero-logo img {
    width: 380px;
  }

  main .lead {
    margin-left: 0;
  }

  .store-row {
    align-items: flex-start;
  }
}

/* ---------- Screenshot carousel ---------- */

.carousel {
  --phone-w: min(220px, 55vw);
  position: relative;
  /* Let the strip bleed to the screen edges on phones so neighbouring
     screenshots peek in from the sides. */
  margin-inline: calc(var(--gutter) * -1);
}

main .carousel__track {
  display: flex;
  gap: 0.9rem;
  margin: 0;
  padding: 0.75rem calc(50% - var(--phone-w) / 2) 0.5rem;
  list-style: none;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  /* Fade the strip out at both edges instead of cutting it off. */
  -webkit-mask-image: linear-gradient(to right, transparent, #000 22%, #000 78%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 22%, #000 78%, transparent);
}

.carousel__track::-webkit-scrollbar {
  display: none;
}

.carousel__track:focus-visible {
  outline-offset: -2px;
  border-radius: var(--radius);
}

main .carousel__slide {
  flex: 0 0 var(--phone-w);
  margin: 0;
  scroll-snap-align: center;
  transition: opacity 250ms ease, transform 250ms ease;
}

/* Only dims the neighbours once the script has marked the active slide. */
.carousel.is-ready .carousel__slide:not(.is-active) {
  opacity: 0.45;
  transform: scale(0.92);
}

.carousel__slide figure {
  margin: 0;
}

.carousel__slide img {
  display: block;
  width: 100%;
  height: auto;
  /* Matches the rounded corners of the phone frame in the screenshots. */
  border-radius: 10% / 4.9%;
  box-shadow: 0 14px 32px rgba(60, 30, 5, 0.28);
}

.carousel__slide figcaption {
  margin-top: 0.85rem;
  font-size: 0.95rem;
  font-weight: 700;
  text-align: center;
  color: var(--heading);
}

.carousel__nav {
  position: absolute;
  top: calc(50% - 1.75rem);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(to bottom, var(--accent-a), var(--accent-b));
  color: var(--on-accent);
  box-shadow: var(--shadow), inset 0 -3px 0 rgba(120, 60, 10, 0.25);
  cursor: pointer;
  transition: filter 120ms ease, opacity 120ms ease;
}

.carousel__nav[hidden] {
  display: none;
}

.carousel__nav:hover {
  filter: brightness(1.05);
}

.carousel__nav:disabled {
  opacity: 0.35;
  cursor: default;
}

.carousel__nav--prev {
  left: max(0.5rem, calc(50% - var(--phone-w) / 2 - 3.5rem));
}

.carousel__nav--next {
  right: max(0.5rem, calc(50% - var(--phone-w) / 2 - 3.5rem));
}

.carousel__dots {
  display: flex;
  justify-content: center;
  gap: 0.25rem;
  margin-top: 0.75rem;
}

.carousel__dots[hidden] {
  display: none;
}

/* Small visible dot inside a larger tap target. */
.carousel__dots button {
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.carousel__dots button::before {
  content: "";
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 999px;
  background: var(--border);
  transition: background 150ms ease, transform 150ms ease;
}

.carousel__dots button[aria-current="true"]::before {
  background: var(--accent-b);
  transform: scale(1.35);
}

@media (min-width: 56em) {
  .carousel {
    --phone-w: 240px;
    margin-inline: 0;
  }

  .carousel__nav--prev {
    left: 0;
  }

  .carousel__nav--next {
    right: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .carousel__slide,
  .play-badge {
    transition: none;
  }
}

/* ---------- Features ---------- */

.features {
  padding-block: 2.5rem 1rem;
}

main .section-title {
  text-align: center;
  font-size: clamp(1.5rem, 3vw + 0.5rem, 2.1rem);
  margin: 0 0 1.75rem;
}

main .feature-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 40em) {
  main .feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 62em) {
  main .feature-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
  }
}

main .feature {
  margin: 0;
  padding: 1.25rem 1.25rem 1.1rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.feature__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 999px;
  background: linear-gradient(to bottom, var(--gold-a), var(--gold-b));
  font-size: 1.5rem;
  line-height: 1;
}

main .feature h3 {
  margin: 0.75rem 0 0.35rem;
  font-size: 1.1rem;
}

main .feature p {
  margin: 0;
}

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

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem 1.25rem;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--heading);
  text-decoration: underline;
}
