/* Libergot website: one stylesheet for every page.
   Colours taken from the logo: cream paper, ink, and its watercolours
   (slate blue, terracotta roof, ochre wall, pink door). */

@font-face {
  font-family: "Amatic SC";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  /* Self-hosted (SIL Open Font License): no request to Google. */
  src: url("/assets/fonts/amatic-sc-700.woff2") format("woff2");
}

:root {
  --paper: #f7f2e8;
  --surface: #fffdf8;
  --ink: #2a2420;
  --muted: #6b5f55;
  --line: #e6dccb;
  /* Historical names, kept so every rule still applies: --green is the
     main accent (terracotta), --yellow the highlight (ochre). */
  --green: #a4553f;
  --green-soft: #f2e5d8;
  --yellow: #d9a04e;
  --blue: #8fa7b6;
  --blue-soft: #e4ebee;
  --link: #9c4f38;
  --radius: 18px;
  --shadow: 0 1px 2px rgb(42 36 32 / 6%), 0 8px 24px rgb(42 36 32 / 7%);
  --hand: "Amatic SC", "Comic Sans MS", cursive;
  --on-accent: #ffffff;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1e1a16;
    --surface: #27221d;
    --ink: #f3ede3;
    --muted: #b8ada0;
    --line: #3a332c;
    --green: #c9775f;
    --green-soft: #33281f;
    --blue-soft: #232a2d;
    --link: #e3a37f;
    --on-accent: #1e1a16;
    --shadow: none;
    color-scheme: dark;
  }
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

a {
  color: var(--link);
  text-underline-offset: 3px;
}

a:focus-visible,
.button:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 3px;
  border-radius: 6px;
}

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

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

.narrow {
  max-width: 720px;
}

/* Header and footer */

.site-header {
  background: var(--paper);
  border-bottom: 2px dashed var(--line);
  color: var(--ink);
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-family: var(--hand);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1;
  text-decoration: none;
}

/* The little house, always on paper (also in dark mode). */
.brand img {
  width: 44px;
  height: 44px;
  background: #f7f2e8;
  border-radius: 50%;
  padding: 3px;
}

.site-header nav {
  display: flex;
  align-items: center;
  gap: 16px;
}

.site-header nav a {
  color: var(--ink);
  font-size: 0.95rem;
  text-decoration: none;
  opacity: 0.9;
}

.site-header nav a:hover {
  opacity: 1;
  text-decoration: underline;
}

main {
  padding: 48px 0 64px;
}

.site-footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
  padding: 24px 0 32px;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  justify-content: space-between;
}

/* Language switch: two small pills, the current language filled in. */

.lang-switch {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
}

.site-header .lang-switch a {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  opacity: 1;
  padding: 3px 10px;
}

.site-header .lang-switch a[aria-current="page"] {
  background: var(--yellow);
  color: #2a2420;
}

.site-header .lang-switch a:not([aria-current]):hover {
  background: var(--green-soft);
  text-decoration: none;
}

/* Typography */

h1,
h2,
h3 {
  line-height: 1.25;
  margin: 0 0 0.5em;
}

h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 5vw, 2.6rem);
}

h2 {
  font-size: 1.35rem;
  margin-top: 2em;
}

h3 {
  font-size: 1.1rem;
}

.lead {
  color: var(--muted);
  font-size: 1.15rem;
  max-width: 38em;
}

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

/* Home: the logo on its watercolour wash, then the apps */

.home-hero {
  position: relative;
  text-align: center;
  padding: 8px 0 16px;
}

/* Two soft watercolour blots behind the logo (blue and ochre). */
.home-hero::before {
  content: "";
  position: absolute;
  inset: -10px 0 auto;
  height: 360px;
  background:
    radial-gradient(closest-side, rgb(143 167 182 / 22%), transparent) 22% 30% / 260px 220px no-repeat,
    radial-gradient(closest-side, rgb(217 160 78 / 20%), transparent) 78% 55% / 280px 220px no-repeat;
  pointer-events: none;
  z-index: -1;
}

.home-logo {
  display: block;
  width: min(300px, 70vw);
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
  /* The logo keeps its own paper, even in dark mode. */
  background: #f7f2e8;
}

.home-hero h1 {
  font-family: var(--hand);
  font-size: clamp(2.6rem, 7vw, 3.6rem);
  letter-spacing: 0.03em;
  margin-top: 8px;
}

.home-hero .lead {
  margin: 0 auto;
}

.home-section {
  text-align: center;
  font-family: var(--hand);
  font-size: 2.2rem;
  letter-spacing: 0.05em;
}

/* App cards */

.apps {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  margin-top: 32px;
  padding: 0;
  list-style: none;
}

.app-card {
  display: flex;
  gap: 16px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: inherit;
  padding: 20px;
  text-decoration: none;
  transition: transform 0.15s ease;
}

.app-card:hover {
  transform: translateY(-2px);
  border-color: var(--yellow);
}

.app-card h3 {
  margin: 0 0 4px;
}

.app-card p {
  color: var(--muted);
  margin: 0;
  font-size: 0.95rem;
}

.app-icon {
  border-radius: 22%;
  flex: none;
}

/* App page */

.hero {
  display: flex;
  flex-wrap: wrap;
  gap: 24px 32px;
  align-items: center;
}

.hero .app-icon {
  box-shadow: var(--shadow);
}

.hero-text {
  flex: 1 1 320px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

.button {
  display: inline-block;
  background: var(--green);
  border-radius: 999px;
  color: var(--on-accent);
  font-weight: 600;
  padding: 10px 22px;
  text-decoration: none;
}

.button.secondary {
  background: transparent;
  border: 2px solid var(--line);
  color: var(--ink);
}

.button[aria-disabled="true"] {
  opacity: 0.6;
  pointer-events: none;
}

.features {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

.features li {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
}

.features strong {
  display: block;
  margin-bottom: 4px;
}

.features span {
  color: var(--muted);
  font-size: 0.95rem;
}

.note {
  background: var(--green-soft);
  border-left: 4px solid var(--yellow);
  border-radius: 0 12px 12px 0;
  margin: 32px 0 0;
  padding: 16px 20px;
}

/* Screenshot strip: the panels touch, so the picture reads as one. */

.gallery {
  margin: 40px 0 8px;
}

.gallery-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  scrollbar-color: var(--green) transparent;
  /* Starts aligned with the text, and can still scroll to the edges. */
  padding: 0 max(20px, calc((100vw - 880px) / 2 + 20px)) 12px;
  scroll-padding: 0 max(20px, calc((100vw - 880px) / 2 + 20px));
}

.gallery-track:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: -3px;
}

.gallery-track img {
  flex: none;
  width: auto;
  /* On a phone, the next panel peeks in: a hint that the strip scrolls. */
  height: clamp(300px, min(52vh, 100vw), 440px);
  scroll-snap-align: start;
}

.gallery-track img:first-child {
  border-radius: 20px 0 0 20px;
}

.gallery-track img:last-child {
  border-radius: 0 20px 20px 0;
}

/* Landscape screenshots (games): separate rounded frames, side by side. */

.gallery-track.landscape {
  gap: 16px;
}

.gallery-track.landscape img {
  height: clamp(190px, min(36vh, 52vw), 340px);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

/* Trailer (game pages) */

.trailer {
  margin-top: 40px;
}

.trailer h2 {
  text-align: center;
}

.trailer video {
  display: block;
  /* Assez grande pour lire les légendes, sans écraser la page. */
  width: min(100%, 640px);
  margin: 0 auto;
  height: auto;
  aspect-ratio: 16 / 9;
  border-radius: 16px;
  background: var(--ink);
  box-shadow: var(--shadow);
}

/* Long-form text (privacy policy) */

.prose h2 {
  border-top: 1px solid var(--line);
  padding-top: 1.2em;
}

.prose li {
  margin-bottom: 0.4em;
}

.prose table {
  border-collapse: collapse;
  display: block;
  font-size: 0.95rem;
  margin: 1em 0;
  overflow-x: auto;
  width: 100%;
}

.prose th,
.prose td {
  border: 1px solid var(--line);
  padding: 8px 12px;
  text-align: left;
  vertical-align: top;
}

.prose th {
  background: var(--green-soft);
}

.breadcrumb {
  font-size: 0.9rem;
  margin-bottom: 16px;
}

@media (prefers-reduced-motion: reduce) {
  .app-card {
    transition: none;
  }
}
