/* ==========================================================================
   Onyla School — night-study notebook
   Tokens first, then base, layout and components.
   ========================================================================== */

:root {
  color-scheme: dark;

  --bg: #0C1424;
  --bg2: #111B30;
  --surface: #16223A;
  --line: #26344F;
  --fg: #F1ECE0;
  --muted: #A3AEC2;
  --accent: #E0A95F;
  --accent-bg: #E0A95F;
  --accent-ink: #1A1306;
  --green: #3FA574;
  --wa: #25D366;
  --wa-ink: #06210F;
  --danger: #F2938A;

  --rule: color-mix(in srgb, var(--line) 62%, transparent);
  --glow: color-mix(in srgb, var(--accent-bg) 11%, transparent);
  --header-bg: color-mix(in srgb, var(--bg) 90%, transparent);
  --shadow-lift: 0 22px 48px -32px rgb(0 0 0 / 0.85);
  --shadow-fab: 0 14px 32px -12px rgb(0 0 0 / 0.6);

  /* Muted green that still passes AA in both themes (no element opacity). */
  --disabled-bg: color-mix(in srgb, var(--wa) 30%, var(--bg2));
  --disabled-fg: var(--fg);

  --font-display: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  --font-body: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;

  --maxw: 1120px;
  --gutter: clamp(16px, 4vw, 32px);
  --radius: 14px;
  --header-h: 72px;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;

    --bg: #F6F8FB;
    --bg2: #EAEFF6;
    --surface: #FFFFFF;
    --line: #D3DBE8;
    --fg: #101A2E;
    --muted: #4F5D78;
    --accent: #8F5D0E;
    --accent-bg: #D9A55B;
    --accent-ink: #1A1306;
    --green: #1E7A4C;
    --wa: #25D366;
    --wa-ink: #06210F;
    --danger: #A32E1C;

    --shadow-lift: 0 22px 44px -34px rgb(15 23 42 / 0.4);
    --shadow-fab: 0 14px 30px -14px rgb(15 23 42 / 0.45);
  }
}

:root[data-theme="light"] {
  color-scheme: light;

  --bg: #F6F8FB;
  --bg2: #EAEFF6;
  --surface: #FFFFFF;
  --line: #D3DBE8;
  --fg: #101A2E;
  --muted: #4F5D78;
  --accent: #8F5D0E;
  --accent-bg: #D9A55B;
  --accent-ink: #1A1306;
  --green: #1E7A4C;
  --wa: #25D366;
  --wa-ink: #06210F;
  --danger: #A32E1C;

  --shadow-lift: 0 22px 44px -34px rgb(15 23 42 / 0.4);
  --shadow-fab: 0 14px 30px -14px rgb(15 23 42 / 0.45);
}

/* Base
   ========================================================================== */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.05;
}

h2 {
  font-size: clamp(30px, 4.2vw, 44px);
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

p {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

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

svg {
  display: block;
}

[hidden] {
  display: none !important;
}

::selection {
  background: var(--accent-bg);
  color: var(--accent-ink);
}

:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

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

.skip-link {
  position: fixed;
  top: -120px;
  inset-inline-start: 16px;
  z-index: 200;
  padding: 12px 18px;
  border-radius: 10px;
  background: var(--accent-bg);
  color: var(--accent-ink);
  font-weight: 700;
  text-decoration: none;
  transition: top 0.18s ease;
}

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

.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

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

/* Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 22px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease,
    color 0.18s ease, transform 0.18s ease;
}

.btn svg {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.btn--wa {
  background: var(--wa);
  color: var(--wa-ink);
}

.btn--wa svg {
  fill: currentColor;
  stroke: none;
}

.btn--wa:hover {
  background: color-mix(in srgb, var(--wa) 86%, var(--wa-ink));
}

.btn--gold {
  background: var(--accent-bg);
  color: var(--accent-ink);
}

.btn--gold:hover {
  background: color-mix(in srgb, var(--accent-bg) 86%, var(--fg));
}

.btn--ghost {
  background: color-mix(in srgb, var(--surface) 55%, transparent);
  border-color: var(--line);
  color: var(--fg);
}

.btn--ghost:hover {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  color: var(--accent);
}

.btn--sm {
  min-height: 44px;
  padding: 9px 16px;
  font-size: 14px;
}

.btn--sm svg {
  width: 17px;
  height: 17px;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

/* Header
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  border-bottom: 1px solid var(--line);
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(14px) saturate(130%);
  backdrop-filter: blur(14px) saturate(130%);
}

.header__inner {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: var(--header-h);
}

.brand {
  --brand-size: clamp(24px, 4.2vw, 30px);

  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: var(--fg);
}

.brand__lockup {
  direction: ltr;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.brand__word {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-display);
  font-size: var(--brand-size);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.015em;
  text-transform: uppercase;
}

.brand__y {
  width: 0.78em;
  height: 0.74em;
  margin-inline: 0.015em;
  overflow: visible;
  transform: translateY(0.02em);
}

.brand__y path {
  fill: none;
  stroke: var(--green);
  stroke-width: 7;
  stroke-linecap: round;
}

.brand__y path.brand__y--gold {
  stroke: var(--accent-bg);
}

.brand__school {
  font-family: var(--font-display);
  font-size: calc(var(--brand-size) * 0.36);
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.3em;
  padding-inline-start: 0.3em;
  color: var(--accent);
  text-transform: uppercase;
}

.header__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-inline-start: 10px;
}

.header__cta {
  min-height: 44px;
  padding: 10px 20px;
  font-size: 15px;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}

.lang-switch__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  min-height: 40px;
  padding: 0 6px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1;
  cursor: pointer;
  transition: color 0.18s ease, background-color 0.18s ease;
}

.lang-switch__btn:hover {
  color: var(--fg);
  background: color-mix(in srgb, var(--accent-bg) 16%, transparent);
}

.lang-switch__btn[aria-pressed="true"] {
  background: var(--accent-bg);
  color: var(--accent-ink);
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition: color 0.18s ease, border-color 0.18s ease;
}

.icon-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-btn:hover {
  color: var(--fg);
  border-color: color-mix(in srgb, var(--accent) 50%, var(--line));
}

.theme-toggle .icon-moon {
  display: none;
}

:root[data-theme="light"] .theme-toggle .icon-sun {
  display: none;
}

:root[data-theme="light"] .theme-toggle .icon-moon {
  display: block;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .theme-toggle .icon-sun {
    display: none;
  }

  :root:not([data-theme="dark"]) .theme-toggle .icon-moon {
    display: block;
  }
}

.nav-toggle .icon-close {
  display: none;
}

.nav-toggle[aria-expanded="true"] .icon-close {
  display: block;
}

.nav-toggle[aria-expanded="true"] .icon-menu {
  display: none;
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-inline-start: auto;
}

.nav__list {
  display: flex;
  align-items: center;
  gap: 2px;
}

.nav__list a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.18s ease, background-color 0.18s ease;
}

.nav__list a:hover {
  color: var(--fg);
  background: var(--surface);
}

.nav__cta {
  display: none;
}

.nav-toggle {
  display: none;
}

/* Hero
   ========================================================================== */

.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: radial-gradient(90% 75% at 88% 0%, var(--glow), transparent 65%),
    var(--bg);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0 31px,
    var(--rule) 31px 32px
  );
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 55%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 55%, transparent 100%);
}

.hero__grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
  align-items: center;
  gap: clamp(32px, 5vw, 56px);
  padding-block: clamp(52px, 8vw, 96px);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 12px;
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  background: var(--green);
}

.hero h1 {
  max-width: 20ch;
  margin-bottom: 16px;
  font-size: clamp(2.7rem, 6.6vw, 4.6rem);
  line-height: 0.94;
  letter-spacing: 0.005em;
  text-transform: uppercase;
  text-wrap: balance;
}

.hero__tagline {
  margin-bottom: 16px;
  font-family: var(--font-display);
  font-size: clamp(18px, 2.3vw, 23px);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.hero__lead {
  max-width: 54ch;
  color: var(--muted);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.hero__actions .btn {
  padding-inline: 24px;
}

/* "En bref" card */

.brief {
  padding: clamp(20px, 3vw, 26px);
  border: 1px solid var(--line);
  border-top: 2px solid var(--accent-bg);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-lift);
}

.brief__title {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--accent);
  text-transform: uppercase;
}

.brief__list {
  margin-top: 10px;
}

.brief__list li {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding-block: 11px;
  border-top: 1px solid var(--line);
  font-size: 15.5px;
  line-height: 1.45;
}

.brief__list svg {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  fill: none;
  stroke: var(--green);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Sections
   ========================================================================== */

.section {
  padding-block: clamp(52px, 8vw, 84px);
}

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

.section__head {
  max-width: 760px;
  margin-bottom: clamp(24px, 4vw, 38px);
}

.section__lead {
  max-width: 64ch;
  margin-top: 12px;
  color: var(--muted);
  font-size: 16.5px;
}

/* Niveaux — 4-step path */

.path {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.path::before {
  content: "";
  position: absolute;
  top: 39px;
  inset-inline: 8px;
  height: 1px;
  background: var(--line);
  z-index: 0;
}

.path__step {
  position: relative;
  z-index: 1;
  padding-block: 20px 22px;
  padding-inline: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color 0.18s ease;
}

.path__step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 35px;
  inset-inline-end: -11px;
  width: 8px;
  height: 8px;
  z-index: 2;
  border-top: 1.6px solid var(--accent);
  border-inline-end: 1.6px solid var(--accent);
  background: var(--bg);
  transform: rotate(45deg);
}

.path__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid color-mix(in srgb, var(--accent) 55%, var(--line));
  border-radius: 999px;
  background: var(--bg);
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.path__step h3 {
  margin-block: 14px 6px;
  margin-inline: 0;
  font-size: 21px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.path__step p {
  color: var(--muted);
  font-size: 15px;
}

/* Matières — chips */

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding-block: 9px;
  padding-inline: 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.3;
}

.chip--more {
  border-style: dashed;
  border-color: color-mix(in srgb, var(--accent) 60%, var(--line));
  background: transparent;
  color: var(--accent);
  font-weight: 600;
}

/* Nos atouts — cards */

.cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.card {
  padding-block: 24px;
  padding-inline: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color 0.18s ease;
}

.card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line));
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent-bg) 12%, transparent);
  color: var(--accent);
}

.card__icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.card h3 {
  margin-block: 16px 8px;
  margin-inline: 0;
  font-size: 21px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.card p {
  color: var(--muted);
  font-size: 15.5px;
}

@media (hover: hover) {
  .card:hover,
  .path__step:hover {
    border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  }
}

/* Contact
   ========================================================================== */

.contact__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.form-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: clamp(20px, 3vw, 30px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.form-card h3 {
  font-size: 23px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.form__row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.field label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 600;
}

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

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 48px;
  padding-block: 12px;
  padding-inline: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--fg);
  font-family: inherit;
  font-size: 16px;
  line-height: 1.4;
  transition: border-color 0.18s ease;
}

.field textarea {
  min-height: 112px;
  resize: vertical;
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--muted);
  opacity: 1;
}

.field input:hover,
.field select:hover,
.field textarea:hover {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
}

.field input[aria-invalid="true"],
.field select[aria-invalid="true"],
.field textarea[aria-invalid="true"] {
  border-color: var(--danger);
}

.field__error {
  margin-top: 6px;
  color: var(--danger);
  font-size: 13.5px;
  line-height: 1.4;
}

.form__required {
  margin-top: -4px;
  color: var(--muted);
  font-size: 13px;
}

.form__submit {
  width: 100%;
}

.form__submit[aria-disabled="true"] {
  border-color: var(--line);
  background: var(--disabled-bg);
  color: var(--disabled-fg);
  cursor: not-allowed;
}

.form__submit[aria-disabled="true"]:hover {
  transform: none;
  background: var(--disabled-bg);
}

.form__hint {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

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

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

.info-card__label {
  margin-bottom: 4px;
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.info-card__number {
  display: block;
  color: var(--fg);
  font-family: var(--font-display);
  font-size: clamp(26px, 3vw, 30px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0.04em;
  text-decoration: none;
}

a.info-card__number:hover {
  color: var(--accent);
}

.info-card__note {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.info-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.copy-btn.is-copied {
  border-color: color-mix(in srgb, var(--green) 55%, var(--line));
  color: var(--green);
}

/* Footer
   ========================================================================== */

.site-footer {
  padding-block-start: clamp(40px, 6vw, 64px);
  padding-block-end: calc(120px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--bg);
}

.footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.footer__brand .brand {
  --brand-size: clamp(26px, 3.4vw, 32px);
}

.footer__tagline {
  margin-top: 12px;
  color: var(--muted);
  font-size: 15px;
}

.footer__slogan {
  margin-top: 2px;
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.footer__social {
  display: flex;
  align-items: center;
  min-height: 44px;
}

.social {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  color: var(--muted);
  transition: color 0.18s ease, background-color 0.18s ease;
}

.social a:hover {
  color: var(--accent);
  background: var(--surface);
}

.social svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 20px;
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13.5px;
}

/* Sticky WhatsApp button
   ========================================================================== */

.wa-fab {
  position: fixed;
  /* Exception to logical properties: the button stays bottom-right in RTL. */
  right: calc(16px + env(safe-area-inset-right));
  bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 100;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding-block: 0;
  padding-inline: 17px 20px;
  direction: ltr;
  border-radius: 999px;
  background: var(--wa);
  color: var(--wa-ink);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  box-shadow: var(--shadow-fab);
}

.wa-fab svg {
  width: 24px;
  height: 24px;
  flex: none;
  fill: currentColor;
}

.wa-fab::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 2px solid var(--wa);
  border-radius: inherit;
  pointer-events: none;
  animation: wa-ring 2.8s ease-out infinite;
}

.wa-fab:hover {
  background: color-mix(in srgb, var(--wa) 88%, var(--wa-ink));
}

@keyframes wa-ring {
  0% {
    transform: scale(1);
    opacity: 0.55;
  }
  70%,
  100% {
    transform: scale(1.42);
    opacity: 0;
  }
}

/* Responsive
   ========================================================================== */

@media (max-width: 1000px) {
  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .header__inner {
    gap: 8px;
  }

  .header__actions {
    gap: 6px;
    margin-inline-start: 4px;
  }

  .nav {
    position: absolute;
    top: 100%;
    inset-inline: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    max-height: calc(100dvh - var(--header-h));
    margin: 0;
    padding-block: 10px 20px;
    padding-inline: var(--gutter);
    overflow-y: auto;
    border-bottom: 1px solid var(--line);
    background: var(--bg2);
    box-shadow: var(--shadow-lift);
  }

  .nav.is-open {
    display: flex;
  }

  .nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
  }

  .nav__list a {
    min-height: 48px;
    padding-inline: 14px;
    border-radius: 10px;
    font-size: 16px;
  }

  .nav__cta {
    display: inline-flex;
    margin-top: 8px;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .header__cta {
    display: none;
  }

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

  .brief {
    max-width: 560px;
  }

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

  .contact__cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }

  .contact__cards .info-card:last-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  :root {
    --header-h: 66px;
  }

  .hero h1 {
    max-width: 22ch;
  }

  .path {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  .path::before {
    display: none;
  }

  .path__step:not(:last-child)::after {
    top: auto;
    inset-inline-end: auto;
    inset-inline-start: 50%;
    bottom: -10px;
    margin-inline-start: -4px;
    transform: rotate(135deg);
    background: var(--bg);
  }

  .path__step {
    padding-block: 18px 20px;
    padding-inline: 18px;
  }

  .path__step h3 {
    margin-top: 12px;
  }

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

@media (max-width: 640px) {
  .contact__cards {
    grid-template-columns: minmax(0, 1fr);
  }

  .contact__cards .info-card:last-child {
    grid-column: auto;
  }

  .wa-fab {
    justify-content: center;
    width: 56px;
    padding: 0;
  }

  .wa-fab__label {
    display: none;
  }
}

@media (max-width: 520px) {
  .brand {
    --brand-size: 22px;
  }

  .lang-switch {
    gap: 0;
    padding: 1px;
  }

  .lang-switch__btn {
    padding-inline: 3px;
  }

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

  .hero__actions .btn {
    width: 100%;
  }

  .footer__bottom {
    flex-direction: column;
    gap: 4px;
  }
}

/* Arabic and right-to-left
   ========================================================================== */

html[lang="ar"] {
  --font-display: "Noto Kufi Arabic", "Noto Sans Arabic", system-ui, sans-serif;
  --font-body: "Noto Sans Arabic", system-ui, -apple-system, sans-serif;
}

html[lang="ar"] body {
  line-height: 1.75;
}

/* Arabic script must not be uppercased or letter-spaced: both break joining. */
html[lang="ar"] :where(h1, h2, h3, h4, p, li, a, button, label, span, strong, em, option, input, textarea, select, small) {
  letter-spacing: 0;
  text-transform: none;
}

html[lang="ar"] h1,
html[lang="ar"] h2,
html[lang="ar"] h3 {
  line-height: 1.28;
}

html[lang="ar"] .hero h1 {
  line-height: 1.2;
}

html[lang="ar"] .hero__tagline {
  line-height: 1.45;
}

/* The wordmark is a brand, not Arabic copy: keep its letterspacing and case. */
html[lang="ar"] .brand__word {
  font-family: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  letter-spacing: 0.015em;
  text-transform: uppercase;
}

html[lang="ar"] .brand__school {
  font-family: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  letter-spacing: 0.3em;
  padding-inline-start: 0.3em;
  text-transform: uppercase;
}

html[lang="ar"] .lang-switch__btn {
  letter-spacing: 0.08em;
}

/* Phone numbers and step numbers stay in Latin numerals. */
html[lang="ar"] .info-card__number,
html[lang="ar"] .path__num {
  font-family: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
}

[dir="ltr"] {
  unicode-bidi: isolate;
}

.wa-fab__label {
  unicode-bidi: isolate;
}

[dir="rtl"] .hero {
  background: radial-gradient(90% 75% at 12% 0%, var(--glow), transparent 65%),
    var(--bg);
}

/* The desktop path runs right to left; the chevron follows it. */
@media (min-width: 761px) {
  [dir="rtl"] .path__step:not(:last-child)::after {
    transform: rotate(-45deg);
  }
}

@media (max-width: 760px) {
  [dir="rtl"] .path__step:not(:last-child)::after {
    transform: rotate(-135deg);
  }
}

/* Motion preferences
   ========================================================================== */

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

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .wa-fab::after {
    display: none;
  }

  .btn:hover,
  .wa-fab:hover {
    transform: none;
  }
}
