/* ============================================================
   Mélissa Vasta — portfolio · v3
   Layout language inspired by riseatseven.com: one tight grotesque
   at big sizes, rounded panels, pill buttons, real images set inside
   the headlines. Colour taken from her logo: brush ink, rice paper,
   and the red of Madagascar that closes the "MV." like a seal.
   ============================================================ */

:root {
  /* ---- colour · from the logo · pairs checked with contrast.ps1 ---- */
  --bg: #F2EEE6;           /* page: paper, one shade deeper than the cards */
  --white: #FCFAF6;        /* the logo's own paper — cards, chips, buttons */
  --ink: #1D1A17;          /* the logo's ink · 15.0:1 on bg */
  --ink-2: #4A4540;        /* 8.2:1 on bg */
  --ink-3: #6B655D;        /* 5.0:1 on bg, 5.5:1 on paper — not on rice */
  --line: #DCD5C9;
  --line-2: #C7BFB1;
  --panel: #1D1A17;        /* ink panels */
  --panel-2: #2A2622;
  --panel-line: #3A352F;
  --on-panel: #FCFAF6;     /* 16.6:1 on ink */
  --on-panel-2: #ADA59A;   /* 7.1:1 on ink */
  --on-panel-3: #7D766C;   /* 3.9:1 — large text only */
  --accent: #B4241F;       /* Madagascar red · 6.3:1 on paper, paper on it 6.3:1 */
  --accent-dark: #961C18;
  --on-accent: #FCFAF6;
  --accent-on-dark: #E2574C; /* 4.7:1 on ink */
  --rice: #EAE2D4;         /* quiet highlight surface, ink text only */
  /* older names, kept so every component follows the logo */
  --apricot: var(--accent);
  --apricot-2: var(--rice);
  --laterite: var(--accent);
  --laterite-on-dark: var(--accent-on-dark);
  --ok: #2F6B4F; --ok-bg: #DDEDE3;
  --wait: #8A5A00; --wait-bg: #F6EAD2;
  --info: #2C4F7C; --info-bg: #E2E9F2;

  /* ---- type · one family, tight, set big ---- */
  --font: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", Consolas, monospace;

  --t-xs: 0.8125rem;
  --t-sm: 0.875rem;
  --t-base: clamp(1rem, 0.96rem + 0.2vw, 1.125rem);
  --t-md: clamp(1.125rem, 1.04rem + 0.4vw, 1.375rem);
  --t-lg: clamp(1.5rem, 1.18rem + 1.3vw, 2.375rem);
  --t-xl: clamp(2.25rem, 1.3rem + 4vw, 4.75rem);
  --t-2xl: clamp(2.75rem, 1.1rem + 7vw, 7.75rem);
  --t-3xl: clamp(3.5rem, 0.8rem + 11.5vw, 12.5rem);

  /* ---- space · 4/8 scale ---- */
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px; --s-5: 24px;
  --s-6: 32px; --s-7: 48px; --s-8: 64px; --s-9: 96px; --s-10: 128px;
  --section: clamp(64px, 9vw, 144px);

  /* ---- shape ---- */
  --edge: 8px;             /* how far rounded panels sit from the window edge */
  --r-lg: 24px;
  --r-md: 18px;
  --r-sm: 12px;
  --r-xs: 6px;
  --pill: 999px;
  --shadow: 0 1px 2px rgb(17 17 17 / 0.06), 0 12px 32px -14px rgb(17 17 17 / 0.22);

  --container: 1240px;
  --gutter: 20px;
  --nav-h: 64px;

  /* motion · strong curves, short durations (Emil Kowalski's rules) */
  --ease: cubic-bezier(0.23, 1, 0.32, 1);          /* ease-out: enter, exit, press */
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);  /* things moving on screen */
  --t-press: 160ms;
  --t-ui: 200ms;
}

@media (min-width: 768px) { :root { --gutter: 40px; --edge: 12px; } }

/* ============================================================
   BASE
   ============================================================ */

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

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 40px); -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }

/* controls answer the finger at once: no double-tap wait, no text selection on long press */
a, button, summary, [role="button"] { touch-action: manipulation; }
.btn, .chip, summary, .nav-links a, .menu nav a, .mail-pill a { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }

body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: var(--t-base); line-height: 1.55;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, video { display: block; max-width: 100%; height: auto; }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure, blockquote { margin: 0; }
a { color: inherit; }
::selection { background: var(--accent); color: var(--on-accent); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 4px; }

.wrap { width: 100%; max-width: calc(var(--container) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }

.skip { position: absolute; inset-inline-start: var(--s-2); top: -100px; z-index: 100; background: var(--ink); color: var(--white); padding: var(--s-3) var(--s-4); border-radius: var(--pill); text-decoration: none; }
.skip:focus { top: var(--s-2); }
.vh { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ============================================================
   TYPE
   ============================================================ */

.d-2xl, .d-xl, .d-lg { font-weight: 500; letter-spacing: -0.045em; text-wrap: balance; }
.d-2xl { font-size: var(--t-2xl); line-height: 0.94; }
.d-xl { font-size: var(--t-xl); line-height: 0.98; }
.d-lg { font-size: var(--t-lg); line-height: 1.05; letter-spacing: -0.035em; }

.lede { font-size: var(--t-md); line-height: 1.45; color: var(--ink-2); max-width: 46ch; text-wrap: pretty; letter-spacing: -0.01em; }
.eyebrow { font-size: var(--t-sm); font-weight: 600; letter-spacing: -0.01em; }
.muted { color: var(--ink-3); }

.prose p { max-width: 64ch; color: var(--ink-2); text-wrap: pretty; }
.prose p + p { margin-top: var(--s-4); }
.prose strong { color: var(--ink); font-weight: 600; }


/* ============================================================
   NAV — one bar, the same width as everything under it
   ============================================================ */

/* the bar floats just inside the rounded panels, never on their edge. It lies over the page (fixed):
   it takes no room, so slimming it never moves anything under it */
/* once the page has scrolled (site.js adds .is-compact) the bar slims: as narrow as its content and
   centred, 52 px high instead of 64, a smaller logo, its buttons a little lower. It is whole again back
   at the top, with the keyboard in it, or while one of its menus is open (not under the mouse: she
   found that a bother). --bar goes from 1 (whole) to 0 (slim); --tap is its buttons' height */
@property --bar { syntax: "<number>"; inherits: true; initial-value: 1; }
.site-header {
  --gap: calc(var(--edge) + 10px);
  --bar: 1;
  --tap: calc(40px + 4px * var(--bar));
  position: fixed; top: var(--gap); left: 0; right: 0; z-index: 60; margin-inline: auto;
  display: flex; align-items: center; gap: var(--s-3);
  /* whole: the page's width; slim: just its content (--fit, measured by site.js), centred */
  width: min(100% - 2 * var(--gap), var(--fit, 100vw) + (100% - 2 * var(--gap) - var(--fit, 100vw)) * var(--bar));
  height: calc(var(--nav-h) - 12px * (1 - var(--bar)));
  padding: 0 10px;
  background: rgb(255 255 255 / 0.9); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border: 1px solid rgb(17 17 17 / 0.06); border-radius: var(--pill);
  box-shadow: 0 6px 20px -14px rgb(17 17 17 / 0.25);
  transition: --bar 300ms var(--ease);
}
.site-header.is-compact:not(:has(:focus-visible, details[open])) { --bar: 0; }
.site-header > .btn { min-height: var(--tap); }
@media print { .site-header { position: absolute; } }

.wordmark { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding-inline-end: var(--s-2); text-decoration: none; white-space: nowrap; }
.wordmark .logo { height: calc(30px + 10px * var(--bar)); width: auto; flex: none; }
.wordmark .wm { font-size: 1.125rem; font-weight: 600; letter-spacing: -0.035em; line-height: 1; }

/* availability, said once and quietly */
.nav-status {
  display: none; align-items: center; gap: 7px; margin-inline-end: auto;
  padding: 6px 12px; border-radius: var(--pill); background: var(--bg);
  font-size: 0.8125rem; font-weight: 500; letter-spacing: -0.01em; color: var(--ink-2); white-space: nowrap;
}
.nav-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px rgb(47 107 79 / 0.18); }
@media (min-width: 900px) { .nav-status { display: inline-flex; } }
@media (max-width: 899px) { .wordmark { margin-inline-end: auto; } }

.nav-links { display: none; align-items: center; gap: 2px; margin-inline-end: var(--s-2); }
@media (min-width: 720px) { .nav-links { display: flex; } }
.nav-links a {
  position: relative; display: inline-flex; align-items: center; gap: 7px;
  min-height: var(--tap, 44px); padding: 0 14px; border-radius: var(--pill);
  font-size: 0.9375rem; font-weight: 500; letter-spacing: -0.015em; color: var(--ink-2); text-decoration: none; white-space: nowrap;
  transition: color var(--t-ui) ease, background-color var(--t-ui) ease;
}
/* on a tablet the bar is tight: the links sit closer, the logo speaks for itself (the name stays for
   screen readers) and the button just says "Contact" */
@media (min-width: 720px) and (max-width: 899px) {
  .nav-links a { padding: 0 9px; }
  .wordmark .wm { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .site-header .btn .hide-sm { display: none; }
  .site-header .btn .show-sm { display: inline; }
}
@media (hover: hover) and (pointer: fine) { .nav-links a:hover { color: var(--ink); background: var(--bg); } }
.nav-links a[aria-current="page"] { color: var(--ink); }
.nav-links a[aria-current="page"]::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--laterite); }

/* phone menu: a <details> needs no script. Its panel hangs from the header bar
   itself, not from the burger, so it stays on screen whatever sits beside it. */
.menu { position: static; }
@media (min-width: 720px) { .menu { display: none; } }
.menu summary { list-style: none; cursor: pointer; display: grid; place-items: center; width: var(--tap, 44px); height: var(--tap, 44px); border-radius: 50%; background: var(--bg); }
.menu summary::-webkit-details-marker { display: none; }
.burger, .burger::before, .burger::after { display: block; width: 16px; height: 2px; border-radius: 2px; background: var(--ink); transition: transform 0.2s var(--ease), background-color 0.2s var(--ease); }
.burger { position: relative; }
.burger::before, .burger::after { content: ""; position: absolute; left: 0; }
.burger::before { top: -5px; }
.burger::after { top: 5px; }
.menu[open] .burger { background: transparent; }
.menu[open] .burger::before { transform: translateY(5px) rotate(45deg); }
.menu[open] .burger::after { transform: translateY(-5px) rotate(-45deg); }

@media (max-width: 519px) {
  .site-header { gap: var(--s-2); padding-inline: 6px 6px; }
  .wordmark { gap: 8px; }
  .wordmark .logo { height: calc(28px + 6px * var(--bar)); }
}
/* below 640px the logo says it on its own, so the switcher fits; the name stays for screen readers */
@media (max-width: 639px) {
  .wordmark .wm { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
/* the smallest phones: Contact is in the menu and in every page's own call to action */
@media (max-width: 389px) { .site-header > .btn { display: none; } }
.menu nav {
  position: absolute; inset-inline-end: 0; top: calc(100% + 10px); width: min(300px, 100%);
  display: grid; gap: 2px; padding: var(--s-2); border-radius: var(--r-md);
  background: var(--white); box-shadow: var(--shadow);
  /* it grows out of the bar's corner, not out of its own centre */
  transform-origin: top right;
  transition: opacity var(--t-ui) var(--ease), transform var(--t-ui) var(--ease);
}
@starting-style { .menu[open] nav { opacity: 0; transform: translateY(-4px) scale(0.97); } }
.menu nav a { padding: var(--s-3) var(--s-4); border-radius: var(--r-sm); font-size: 1.125rem; font-weight: 500; letter-spacing: -0.02em; text-decoration: none; }
.menu nav a[aria-current="page"], .menu nav a:active { background: var(--bg); }
@media (hover: hover) and (pointer: fine) { .menu nav a:hover { background: var(--bg); } }

/* ============================================================
   BUTTONS, CHIPS, LINKS
   ============================================================ */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 22px; border: 0; border-radius: var(--pill);
  font: 500 1rem/1 var(--font); letter-spacing: -0.015em;
  text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: transform var(--t-press) var(--ease), background-color var(--t-ui) ease, color var(--t-ui) ease;
}
.btn .arr { display: inline-block; font-size: 0.9em; transition: transform var(--t-ui) var(--ease); }
.btn:active { transform: scale(0.97); }

.btn-white { background: var(--white); color: var(--ink); box-shadow: 0 1px 2px rgb(17 17 17 / 0.06); }
.btn-dark { background: var(--ink); color: var(--white); }
.btn-apricot { background: var(--accent); color: var(--on-accent); }
.btn-ghost { background: transparent; color: inherit; padding-inline: var(--s-3); }

/* hover only where there is a real pointer — on a phone it would stick after the tap */
@media (hover: hover) and (pointer: fine) {
  .btn:hover .arr { transform: translate(2px, -2px); }
  .btn-white:hover { background: var(--apricot-2); }
  .btn-dark:hover { background: #35302B; }
  .btn-apricot:hover { background: var(--accent-dark); }
  .btn-ghost:hover { text-decoration: underline; text-underline-offset: 4px; }
}
.btn-sm { min-height: 44px; padding: 0 18px; font-size: 0.9375rem; }

.btn-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-3); }
/* a label longer than a small phone wraps instead of pushing the page sideways (French, Malagasy) */
.btn { max-width: 100%; }
@media (max-width: 479px) { main .btn { white-space: normal; line-height: 1.2; padding-block: 12px; text-align: center; } }

.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px; border-radius: var(--pill);
  background: rgb(255 255 255 / 0.88); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  color: var(--ink); font-size: var(--t-sm); font-weight: 500; letter-spacing: -0.01em; line-height: 1.2; white-space: nowrap;
}
.chip.flat { background: var(--white); -webkit-backdrop-filter: none; backdrop-filter: none; }
.chip.apricot { background: var(--accent); color: var(--on-accent); }
.chip img.chip-logo { width: auto; height: 14px; border-radius: 0; object-fit: contain; }
.chip.dark { background: rgb(255 255 255 / 0.12); color: var(--on-panel); }
.chip img { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; object-position: center 20%; }
.chips { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.chips .chip { max-width: 100%; white-space: normal; }

.link-arrow { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; letter-spacing: -0.01em; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 5px; text-decoration-color: var(--line-2); transition: text-decoration-color var(--t-ui) ease; }
@media (hover: hover) and (pointer: fine) { .link-arrow:hover { text-decoration-color: currentColor; } }

/* ============================================================
   PANELS & SECTIONS
   ============================================================ */

.panel { margin-inline: var(--edge); border-radius: var(--r-lg); background: var(--panel); color: var(--on-panel); }
.panel :focus-visible { outline-color: var(--on-panel); }
.card { background: var(--white); border-radius: var(--r-md); }

.section { padding-block: var(--section); }
.section + .section { padding-top: 0; }

.sec-top { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: var(--s-5); padding-bottom: var(--s-6); margin-bottom: var(--s-7); border-bottom: 1px solid var(--line); }
.sec-top .d-xl { max-width: 16ch; }

/* ---------- inner page head ---------- */
.page-head { padding: calc(var(--nav-h) + var(--s-10)) 0 var(--s-8); }
.page-head .eyebrow { margin-bottom: var(--s-5); }
.page-head .d-2xl { max-width: 14ch; }
.page-head .lede { margin-top: var(--s-6); }
.page-head .btn-row { margin-top: var(--s-6); }

/* ============================================================
   INTERFACE SCHEMATICS (drawn in HTML) + SPEC ANNOTATIONS
   ============================================================ */

.screen { position: relative; background: var(--white); border-radius: var(--r-md); box-shadow: var(--shadow); font-size: 0.8125rem; line-height: 1.4; overflow: hidden; }
.screen-bar { display: flex; align-items: center; gap: 6px; padding: 12px var(--s-4); border-bottom: 1px solid var(--line); background: #F7F6F4; }
.screen-bar i { width: 9px; height: 9px; border-radius: 50%; background: var(--line-2); }
.screen-bar span { flex: 1; text-align: center; font-size: 0.75rem; font-weight: 500; color: var(--ink-3); margin-inline-end: 33px; }
.screen-bar a { font-size: 0.75rem; font-weight: 600; text-decoration: none; white-space: nowrap; }
@media (hover: hover) and (pointer: fine) { .screen-bar a:hover { text-decoration: underline; } }
.screen-body { display: flex; }
.screen-side { flex: none; width: 132px; padding: var(--s-3) var(--s-2); border-inline-end: 1px solid var(--line); background: #F7F6F4; display: grid; gap: 2px; align-content: start; }
.screen-side span { padding: 7px var(--s-2); border-radius: 8px; color: var(--ink-2); white-space: nowrap; }
.screen-side span.on { background: var(--white); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgb(17 17 17 / 0.08); }
.screen-main { flex: 1; min-width: 0; padding: var(--s-4); display: grid; gap: var(--s-3); align-content: start; }
.screen-title { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-3); }
.screen-title b { font-size: 0.9375rem; font-weight: 600; letter-spacing: -0.01em; }
.screen-title span { font-size: 0.75rem; color: var(--ink-3); }
.screen-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.ui-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.ui-table th { text-align: start; font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-3); padding-block: 0 var(--s-2); padding-inline: 0 var(--s-3); border-bottom: 1px solid var(--line); white-space: nowrap; }
.ui-table td { padding-block: 9px; padding-inline: 0 var(--s-3); border-bottom: 1px solid var(--line); white-space: nowrap; color: var(--ink-2); vertical-align: middle; }
.ui-table tr:last-child td { border-bottom: 0; }
.ui-table td.ref { font-family: var(--mono); font-size: 0.75rem; color: var(--ink); }
.ui-table .trunc { display: block; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ui-table td.empty { color: var(--ink-3); font-style: italic; }

.tag { display: inline-flex; align-items: center; gap: 6px; padding: 3px var(--s-2); border-radius: var(--pill); font-size: 0.75rem; font-weight: 600; line-height: 1.3; white-space: nowrap; background: #F0EFED; color: var(--ink-2); }
.tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tag.ok { background: var(--ok-bg); color: var(--ok); }
.tag.wait { background: var(--wait-bg); color: var(--wait); }
.tag.info { background: var(--info-bg); color: var(--info); }

/* pins sit in the flow beside what they explain, so they never cover it */
.anchor { display: inline-flex; align-items: center; gap: 7px; max-width: 100%; }
.pin {
  flex: none; display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%;
  background: var(--ink); color: var(--white); font-size: 0.6875rem; font-weight: 600; line-height: 1; letter-spacing: 0; text-transform: none;
  box-shadow: 0 0 0 3px rgb(180 36 31 / 0.28);
  transition: transform var(--t-ui) var(--ease);
}
[data-note] { outline: 2px dashed transparent; outline-offset: 3px; border-radius: 4px; transition: outline-color 150ms ease; }
[data-note].is-on { outline-color: var(--ink); }
.pin.is-on { transform: scale(1.18); }
/* pins arrive from a visible size, never from nothing */
.js .annotated .pin { opacity: 0; transform: scale(0.85); transition: opacity 240ms var(--ease), transform 240ms var(--ease); }
.js .annotated.in .pin { opacity: 1; transform: none; }
.js .annotated.in [data-pin="1"] { transition-delay: 60ms; }
.js .annotated.in [data-pin="2"] { transition-delay: 140ms; }
.js .annotated.in [data-pin="3"] { transition-delay: 220ms; }
.js .annotated.in .pin.is-on { transform: scale(1.18); transition-delay: 0s; }
.annotated .screen-scroll { padding: 4px 0 0 4px; margin: -4px 0 0 -4px; }

.legend { list-style: none; padding: 0; margin: var(--s-5) 0 0; display: grid; gap: var(--s-3); }
@media (min-width: 720px) { .legend.cols-3 { grid-template-columns: repeat(3, 1fr); } .legend.cols-2 { grid-template-columns: repeat(2, 1fr); } }
.legend li { display: grid; grid-template-columns: 24px 1fr; gap: var(--s-3); align-items: start; padding: var(--s-4); border-radius: var(--r-sm); background: var(--white); font-size: 0.9375rem; line-height: 1.45; color: var(--ink-2); transition: background-color 150ms ease; }
.legend li b { display: block; color: var(--ink); font-weight: 600; letter-spacing: -0.01em; }
.legend .num { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--ink); color: var(--white); font-size: 0.75rem; font-weight: 600; }
.legend li.is-on { background: var(--apricot-2); }

.fig-cap { margin-top: var(--s-4); font-size: var(--t-sm); line-height: 1.5; color: var(--ink-3); max-width: 62ch; }
.fig-cap b { color: var(--ink); font-weight: 600; }

/* a real screenshot in a rounded frame */
.shot { position: relative; overflow: hidden; border-radius: var(--r-md); background: #DAD7D2; }
.shot img, .shot video { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top center; transition: transform 300ms var(--ease); }
a.shot { display: block; }
.shot .chip { position: absolute; inset-inline-end: var(--s-4); bottom: var(--s-4); text-decoration: none; }
@media (hover: hover) and (pointer: fine) { a:hover .shot :is(img, video), a.shot:hover :is(img, video) { transform: scale(1.03); } }

/* ============================================================
   KINETIC CLOSING LINE + FOOTER PANEL
   ============================================================ */

.closing { padding: var(--section) 0 var(--s-9); text-align: center; overflow: hidden; }
.closing .big { font-size: var(--t-xl); font-weight: 500; letter-spacing: -0.05em; line-height: 0.98; text-wrap: balance; max-width: 18ch; margin-inline: auto; }
.closing .big .ch { display: inline-block; }
/* a one-off, marketing-grade moment, so it may run longer than UI motion */
.js .closing .big .ch { transform: translateY(0.35em) rotate(var(--rot, 6deg)); opacity: 0; transition: transform 600ms var(--ease), opacity 400ms var(--ease); transition-delay: calc(var(--i) * 16ms); }
.js .closing.in .big .ch { transform: none; opacity: 1; }
.closing p { margin: var(--s-6) auto 0; max-width: 46ch; color: var(--ink-2); font-size: var(--t-md); }
.closing .btn-row { justify-content: center; margin-top: var(--s-6); }

.site-footer { margin: 0 var(--edge) var(--edge); padding: var(--s-7) var(--s-5) var(--s-5); border-radius: var(--r-lg); background: var(--panel); color: var(--on-panel); }
@media (min-width: 768px) { .site-footer { padding: var(--s-8) var(--s-7) var(--s-6); } }
.foot-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-7); }
@media (min-width: 900px) { .foot-grid { grid-template-columns: 5fr 7fr; gap: var(--s-8); } }
.foot-hello h2 { font-size: var(--t-lg); font-weight: 500; letter-spacing: -0.035em; line-height: 1.05; }
.mail-pill { display: flex; align-items: center; gap: var(--s-2); margin-top: var(--s-5); padding-block: 6px; padding-inline: var(--s-5) 6px; border-radius: var(--pill); background: var(--panel-2); max-width: 420px; }
.mail-pill button { flex: 1; min-width: 0; padding: 10px 0; background: none; border: 0; color: var(--on-panel); font: 500 1.0625rem/1.2 var(--font); letter-spacing: -0.02em; text-align: start; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-pill button.copied { color: var(--laterite-on-dark); }
/* the smallest phones: the whole address stays readable instead of ending in "…" */
@media (max-width: 359px) { .mail-pill { padding-inline-start: var(--s-4); } .mail-pill button { font-size: 0.875rem; } }
.mail-pill a { flex: none; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--accent); color: var(--on-accent); text-decoration: none; font-size: 1.125rem; transition: transform var(--t-press) var(--ease); }
.foot-logo { display: block; width: auto; height: 84px; margin-bottom: var(--s-6); }
.mail-pill a:active { transform: scale(0.94); }
.foot-hello .chips { margin-top: var(--s-4); }
.foot-hello .chip { text-decoration: none; transition: background-color var(--t-ui) ease, transform var(--t-press) var(--ease); }
.foot-hello .chip:active { transform: scale(0.97); }
.site-footer :focus-visible { outline-color: var(--on-panel); }
@media (hover: hover) and (pointer: fine) {
  .mail-pill a:hover { transform: rotate(-12deg); }
  .foot-hello .chip:hover { background: rgb(255 255 255 / 0.2); }
}
.foot-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-6) var(--s-5); }
/* the third column gets the full width on phones: "Antananarivo" in Arabic is one long word */
@media (max-width: 599px) { .foot-cols div:nth-child(3) { grid-column: 1 / -1; } }
@media (min-width: 600px) { .foot-cols { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.foot-cols div { display: grid; gap: var(--s-2); align-content: start; padding-inline-start: var(--s-4); border-inline-start: 1px solid var(--panel-line); }
.foot-cols p { font-size: var(--t-sm); color: var(--on-panel-2); margin-bottom: var(--s-1); }
.foot-cols a, .foot-cols span { font-size: 1.125rem; font-weight: 500; letter-spacing: -0.025em; text-decoration: none; line-height: 1.3; }
@media (hover: hover) and (pointer: fine) { .foot-cols a:hover { text-decoration: underline; text-underline-offset: 4px; } }
.foot-base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s-2) var(--s-5); margin-top: var(--s-9); font-size: var(--t-xs); color: var(--on-panel-2); }

/* ============================================================
   MOTION · reduced
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; transition-delay: 0s !important; }
  .js .annotated .pin, .js .closing .big .ch { opacity: 1; transform: none; }
}

@media (max-width: 559px) { .screen-side { display: none; } }
@media (max-width: 479px) {
  .screen { font-size: 0.75rem; }
  .ui-table { font-size: 0.6875rem; }
  .ui-table th { font-size: 0.625rem; letter-spacing: 0.02em; }
  .ui-table th, .ui-table td { padding-inline-end: var(--s-2); }
  .tag { font-size: 0.6875rem; padding: 2px 6px; gap: 4px; }
  .anchor { gap: 4px; }
  .pin { width: 18px; height: 18px; font-size: 0.625rem; }
  .screen-main { padding-inline: var(--s-2) !important; }
}

/* ============================================================
   LANGUAGE SWITCHER — top right, a <details> so it needs no script
   ============================================================ */

.lang-switch { position: relative; flex: none; }
.lang-switch summary {
  list-style: none; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
  min-height: var(--tap, 44px); padding: 0 14px; border-radius: var(--pill);
  background: var(--bg); font-size: 0.875rem; font-weight: 600; letter-spacing: 0.02em;
  transition: background-color var(--t-ui) ease;
}
.lang-switch summary::-webkit-details-marker { display: none; }
.lang-switch summary::after {
  content: ""; width: 6px; height: 6px; margin-top: -3px;
  border-inline-end: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg); transition: transform var(--t-ui) var(--ease);
}
.lang-switch[open] summary::after { transform: translateY(3px) rotate(-135deg); }
.lang-switch ul {
  position: absolute; inset-inline-end: 0; top: calc(100% + 12px); z-index: 70;
  min-width: 190px; margin: 0; padding: var(--s-2); list-style: none;
  display: grid; gap: 2px; border-radius: var(--r-md); background: var(--white); box-shadow: var(--shadow);
  transform-origin: top right;
  transition: opacity var(--t-ui) var(--ease), transform var(--t-ui) var(--ease);
}
@starting-style { .lang-switch[open] ul { opacity: 0; transform: translateY(-4px) scale(0.97); } }
.lang-switch a {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-4);
  min-height: 44px; padding: 0 var(--s-4); border-radius: var(--r-sm);
  font-size: 1rem; font-weight: 500; text-decoration: none;
}
.lang-switch a[aria-current] { background: var(--bg); }
.lang-switch a[aria-current]::after { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.lang-switch a:active { background: var(--rice); }
@media (hover: hover) and (pointer: fine) {
  .lang-switch summary:hover { background: var(--rice); }
  .lang-switch a:hover { background: var(--bg); }
}
@media (max-width: 519px) { .lang-switch summary { padding: 0 12px; gap: 6px; } }

/* ============================================================
   ARABIC — right to left
   Layout already mirrors through logical properties; what is left
   is the type: an Arabic face, no tracking (it would break the
   joined letters), taller lines, and arrows that point the new way.
   ============================================================ */

:root:lang(ar) { --font: "Instrument Sans", "IBM Plex Sans Arabic", system-ui, sans-serif; }
:lang(ar) body, :lang(ar) .btn, :lang(ar) .chip, :lang(ar) * { letter-spacing: 0 !important; }
:lang(ar) .d-2xl { line-height: 1.18; }
:lang(ar) .d-xl, :lang(ar) .hero .h1, :lang(ar) .closing .big, :lang(ar) .marquee-track p { line-height: 1.22; }
/* Arabic words run longer: a wider measure and a slightly smaller headline keep it to four lines */
:lang(ar) .hero .h1 { max-width: 15ch; font-size: clamp(2.5rem, min(0.5rem + 6vw, 10.5svh), 7rem); }
:lang(ar) .d-lg { line-height: 1.3; }
:lang(ar) body { line-height: 1.75; }
@media (hover: hover) and (pointer: fine) { [dir="rtl"] .btn:hover .arr { transform: translate(-2px, -2px); } }
[dir="rtl"] .menu nav { transform-origin: top left; }
[dir="rtl"] .lang-switch ul { transform-origin: top left; }
/* a phone number is still read left to right inside Arabic: without this, "+33 7 80…" comes out as "…80 7 33+" */
[dir="rtl"] a.chip[href^="tel:"], [dir="rtl"] a[href^="tel:"] .val, [dir="rtl"] a[href^="https://wa.me"] .val { direction: ltr; unicode-bidi: isolate; }
[dir="rtl"] a[href^="tel:"] .val, [dir="rtl"] a[href^="https://wa.me"] .val { text-align: right; }
