/* Site d'Afterdusk. Couleurs et rayons repris de docs/charte-graphique.md :
   le site doit ressembler au logiciel qu'il présente. */

/* Inter, le fichier embarqué dans l'application (licence OFL, voir fonts/OFL.txt). */
@font-face {
  font-family: Inter;
  src: url("fonts/InterVariable.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --ad-bg: #17191c;
  --ad-workspace: #111214;
  --ad-panel: #22252a;
  --ad-surface: #2c3036;
  --ad-border: #383d44;
  --ad-field-border: #6d737c;

  --ad-text: #f0f2f5;
  --ad-text-secondary: #aab0b9;
  --ad-text-muted: #959ba5;

  --ad-accent: #7598e8;
  --ad-accent-hover: #92acf0;
  --ad-on-accent: #17191c;
  --ad-success: #6ebc94;
  --ad-warning: #dbad69;

  --ad-radius-sm: 4px;
  --ad-radius-md: 6px;
  --ad-radius-lg: 10px;

  --ad-font:
    Inter, "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont,
    sans-serif;
  --ad-transition: 150ms ease;

  --page: 1120px;
  --gutter: clamp(16px, 4vw, 40px);
}

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

html {
  color-scheme: dark;
  scroll-padding-top: 16px;
}

body {
  margin: 0;
  background: var(--ad-bg);
  color: var(--ad-text);
  font: 400 16px/1.6 var(--ad-font);
  -webkit-text-size-adjust: 100%;
}

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

a {
  color: var(--ad-accent);
  text-underline-offset: 3px;
  transition: color var(--ad-transition);
}

a:hover {
  color: var(--ad-accent-hover);
}

:focus-visible {
  outline: 2px solid var(--ad-accent);
  outline-offset: 3px;
  border-radius: var(--ad-radius-sm);
}

.skip {
  position: absolute;
  left: 16px;
  top: -100px;
  padding: 10px 14px;
  background: var(--ad-accent);
  color: var(--ad-on-accent);
  border-radius: var(--ad-radius-md);
  z-index: 10;
}

.skip:focus {
  top: 12px;
}

.wrap {
  max-width: var(--page);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* En-tête */

.top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 24px;
  padding-top: 12px;
  padding-bottom: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--ad-text);
  font-weight: 600;
  font-size: 18px;
  text-decoration: none;
}

.brand:hover {
  color: var(--ad-text);
}

/* Le logo officiel en blanc, sans retoucher le SVG (charte, section 6). */
.logo {
  width: 28px;
  height: 28px;
  background: var(--ad-text);
  -webkit-mask: url("img/logo.svg") center / contain no-repeat;
  mask: url("img/logo.svg") center / contain no-repeat;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0 4px;
  margin: 0 -12px;
  padding: 0;
  list-style: none;
}

.nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  color: var(--ad-text-secondary);
  font-size: 15px;
  text-decoration: none;
}

.nav a:hover {
  color: var(--ad-text);
}

.nav .lang {
  color: var(--ad-text);
}

/* Photo d'ouverture : la plage de Cabourg à la tombée du jour, qui donne son nom au logiciel. */

.dusk {
  margin: 0;
  background: var(--ad-workspace);
}

.dusk img {
  width: 100%;
  height: clamp(200px, 33vw, 480px);
  object-fit: cover;
  object-position: 58% 50%;
}

.dusk figcaption {
  max-width: var(--page);
  margin: 0 auto;
  padding: 8px var(--gutter) 0;
  color: var(--ad-text-muted);
  font-size: 13px;
}

/* Présentation */

.intro {
  padding-top: clamp(32px, 6vw, 72px);
  padding-bottom: clamp(48px, 8vw, 96px);
}

.intro h1 {
  max-width: 17em;
  margin: 0;
  font-size: clamp(32px, 5.2vw, 56px);
  line-height: 1.1;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.lead {
  max-width: 38em;
  margin: 20px 0 0;
  color: var(--ad-text-secondary);
  font-size: clamp(17px, 1.6vw, 19px);
}

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

.button {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--ad-field-border);
  border-radius: var(--ad-radius-md);
  color: var(--ad-text);
  font-weight: 500;
  text-decoration: none;
  transition:
    background var(--ad-transition),
    border-color var(--ad-transition);
}

.button:hover {
  color: var(--ad-text);
  background: var(--ad-surface);
}

/* Le seul bouton bleu de la page : le code source, puisqu'il n'y a pas encore d'installateur. */
.button.primary {
  background: var(--ad-accent);
  border-color: var(--ad-accent);
  color: var(--ad-on-accent);
}

.button.primary:hover {
  background: var(--ad-accent-hover);
  border-color: var(--ad-accent-hover);
  color: var(--ad-on-accent);
}

.status {
  max-width: 38em;
  margin: 24px 0 0;
  color: var(--ad-text-muted);
  font-size: 14px;
}

/* Sections */

section {
  padding-top: clamp(48px, 7vw, 88px);
  padding-bottom: clamp(48px, 7vw, 88px);
  border-top: 1px solid var(--ad-border);
}

h2 {
  margin: 0;
  font-size: clamp(24px, 3vw, 32px);
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -0.01em;
}

h3 {
  margin: 0;
  font-size: 19px;
  line-height: 1.3;
  font-weight: 600;
}

/* Fonctions : texte et capture côte à côte, en alternance sur grand écran. */
.features {
  display: grid;
  gap: clamp(48px, 7vw, 96px);
}

.feature {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  align-items: center;
}

.feature-text p {
  margin: 12px 0 0;
  color: var(--ad-text-secondary);
  font-size: 16px;
  line-height: 1.6;
  max-width: 34em;
}

.feature-text h2 {
  margin-top: 6px;
}

.frame {
  color: var(--ad-text-muted);
  font-size: 14px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.shot {
  margin: 0;
}

.shot img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--ad-border);
  border-radius: var(--ad-radius-lg);
  background: var(--ad-workspace);
}

/* Et aussi, et les engagements : des cartes sobres sur fond de panneau. */
.extras,
.promises {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}

.extras li,
.promises li {
  padding: 20px;
  background: var(--ad-panel);
  border: 1px solid var(--ad-border);
  border-radius: var(--ad-radius-lg);
}

.extras h3,
.promises h3 {
  font-size: 17px;
}

.extras p,
.promises p {
  margin: 6px 0 0;
  color: var(--ad-text-secondary);
  font-size: 15px;
  line-height: 1.5;
}

.actions.end {
  margin-top: 36px;
}

/* Pied de page */

footer {
  padding-top: 32px;
  padding-bottom: 40px;
  border-top: 1px solid var(--ad-border);
  background: var(--ad-workspace);
  color: var(--ad-text-muted);
  font-size: 14px;
}

footer p {
  margin: 0 0 8px;
  max-width: 48em;
}

/* Grand écran : les colonnes s'ouvrent quand le texte garde une longueur de ligne lisible. */

@media (min-width: 720px) {
  .extras {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (min-width: 900px) {
  .feature {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: 48px;
  }

  /* Une fonction sur deux : la capture à gauche. */
  .feature:nth-child(even) {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  }

  .feature:nth-child(even) .feature-text {
    order: 2;
  }

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

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
