/*
 * pimy.garden: one stylesheet for every page.
 * Colours come from the Pimy app palette (docs/brand/BRAND-GUIDELINES.md, C-22): Crème page,
 * Vert Profond text, text-safe Vert Feuille links, Corail accent word, Lavande focus ring, and the
 * Pimy Plus violet only for Pimy Plus. Light only, like the app's first pages.
 * Font: Plus Jakarta Sans 400/700 (SIL Open Font License 1.1, assets/fonts/OFL.txt), served
 * from this site: no third-party request.
 */

@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/PlusJakartaSans-Regular.ttf') format('truetype');
}

@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/assets/fonts/PlusJakartaSans-Bold.ttf') format('truetype');
}

:root {
  color-scheme: light;
  --page: #fff9f0; /* Crème */
  --surface: #ffffff;
  --surface-sand: #f2e8d9; /* Sable */
  --surface-muted: #f7f0e5;
  --surface-leaf: #e8f5da;
  --mascot: #fff7e8; /* the companion art backdrop */
  --border: #e6d9c3;
  --text: #0f3d2e; /* Vert Profond */
  --text-secondary: #4a5a50;
  --link: #176f33; /* text-safe Vert Feuille */
  --link-pressed: #0f5a27;
  --brand: #1b7f3a; /* Vert Feuille */
  --accent-text: #b92e3a; /* text-safe Corail */
  --focus: #5b45c2; /* Lavande, text shade */
  --plus: #7357e8; /* Pimy Plus violet, fill with white text */
  --plus-soft: #efebff;
  --plus-ink: #1f1650;
  --radius-card: 24px;
  --radius-pill: 999px;
  --gutter: 16px;
  --font:
    'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
    sans-serif;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--page);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-wrap: break-word;
}

main {
  flex: 1;
}

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

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

a:hover {
  color: var(--link-pressed);
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 6px;
}

h1,
h2,
h3 {
  line-height: 1.2;
  font-weight: 700;
  color: var(--text);
}

h1 {
  font-size: clamp(2rem, 7vw, 3.25rem);
  margin: 0 0 16px;
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.4rem, 4.5vw, 1.9rem);
  margin: 48px 0 16px;
}

h3 {
  font-size: 1.15rem;
  margin: 28px 0 8px;
}

p,
ul,
ol {
  margin: 0 0 16px;
}

.wrap {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.wrap--text {
  max-width: 760px;
}

.skip-link {
  position: absolute;
  left: 8px;
  top: -100px;
  padding: 8px 16px;
  background: var(--surface);
  color: var(--link);
  border-radius: var(--radius-pill);
  z-index: 10;
}

.skip-link:focus {
  top: 8px;
}

/* Header */
.site-header {
  padding: 16px 0;
}

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

.site-header img {
  width: 108px;
  height: 36px;
}

.lang-link {
  font-weight: 700;
  font-size: 0.95rem;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  text-decoration: none;
}

/* Hero */
.hero {
  display: grid;
  gap: 24px;
  align-items: center;
  padding: 16px 0 24px;
}

.hero-art {
  width: min(240px, 60vw);
  margin: 0 auto;
}

.accent {
  color: var(--accent-text);
}

.lead {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 34em;
}

.availability {
  display: inline-block;
  margin: 8px 0 0;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  background: var(--surface-leaf);
  font-weight: 700;
}

/* Companions strip */
.companions {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.companions li {
  background: var(--mascot);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 8px 8px 12px;
  text-align: center;
  font-weight: 700;
  font-size: 0.95rem;
}

.companions img {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 18px;
}

/* Feature cards */
.cards {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 16px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 20px 22px;
}

.card h3 {
  margin-top: 0;
}

.card p {
  margin: 0;
  color: var(--text-secondary);
}

/* Pimy Plus line */
.plus {
  margin: 40px 0 8px;
  padding: 18px 22px;
  border-radius: var(--radius-card);
  background: var(--plus-soft);
  color: var(--plus-ink);
}

.plus p {
  margin: 0;
}

.plus-badge {
  display: inline-block;
  margin-right: 8px;
  padding: 2px 12px;
  border-radius: var(--radius-pill);
  background: var(--plus);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.9rem;
}

/* Legal pages */
.legal {
  padding-bottom: 24px;
}

.legal h1 {
  font-size: clamp(1.75rem, 6vw, 2.5rem);
  margin-top: 16px;
}

.legal .updated {
  color: var(--text-secondary);
}

.legal li {
  margin-bottom: 6px;
}

.legal .note {
  background: var(--surface-muted);
  border-radius: 12px;
  padding: 12px 16px;
}

.legal table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 16px;
  font-size: 0.95rem;
}

.legal th,
.legal td {
  text-align: left;
  vertical-align: top;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.legal thead th {
  background: var(--surface-sand);
}

/* Small screens: each table row becomes a card. */
@media (max-width: 719px) {
  .legal table,
  .legal tbody,
  .legal tr,
  .legal td {
    display: block;
  }

  .legal thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .legal tr {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 6px 0;
    margin-bottom: 12px;
  }

  .legal td {
    border: 0;
    padding: 6px 14px;
  }

  .legal td::before {
    content: attr(data-label);
    display: block;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-secondary);
  }
}

/* 404 */
.not-found {
  text-align: center;
  padding: 24px 0 48px;
}

.not-found img {
  width: 180px;
  margin: 0 auto 16px;
}

/* Footer */
.site-footer {
  margin-top: 56px;
  padding: 32px 0 40px;
  background: var(--surface-sand);
  font-size: 0.95rem;
}

.site-footer ul {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}

.site-footer a {
  display: inline-block;
  padding: 4px 0;
}

.site-footer p {
  margin: 0 0 8px;
}

.site-footer .copyright {
  color: var(--text-secondary);
}

@media (min-width: 720px) {
  :root {
    --gutter: 32px;
  }

  .hero {
    grid-template-columns: 1.4fr 1fr;
    padding: 32px 0 40px;
  }

  .hero-art {
    width: 100%;
    max-width: 320px;
    order: 2;
  }

  .companions {
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
  }

  .cards {
    grid-template-columns: repeat(2, 1fr);
  }
}
