/* Rusukh, apprusukh.com : la charte de l'app transposée au web.
   Nuit : or et cuivre sur graphite. Jour : or profond sur blanc cassé.
   Valeurs reprises de lib/theme/theme.dart ; rayons et ombre de la passe
   « jetons » (rPanel 18, rCard 16, rField 14, rChip 22, ombre 0/6 flou 14). */

@font-face { font-family: "Inter"; font-weight: 400; font-display: swap; src: url("../fonts/Inter-Regular.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-display: swap; src: url("../fonts/Inter-SemiBold.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 700; font-display: swap; src: url("../fonts/Inter-Bold.woff2") format("woff2"); }
@font-face { font-family: "Scheherazade New"; font-weight: 400; font-display: swap; src: url("../fonts/ScheherazadeNew-Regular.woff2") format("woff2"); }
@font-face { font-family: "Scheherazade New"; font-weight: 700; font-display: swap; src: url("../fonts/ScheherazadeNew-Bold.woff2") format("woff2"); }

:root {
  --bg: #0F1013; --surface: #16181D; --raised: #1C1F25;
  --gold: #D3A65A; --gold-bright: #E6C382; --copper: #A98457;
  --ink: #ECEDEF; --muted: #8B909A; --hair: #262A31; --danger: #C4574A;
  --jade: #6FBE9B; --lapis: #6E8FD1; --saffron: #E0A13C; --on-accent: #17130A;
  --shadow: 0 6px 14px -3px rgba(0, 0, 0, 0.45);
  --gold-soft: rgba(211, 166, 90, 0.14);
  --gold-line: rgba(211, 166, 90, 0.42);
  --r-panel: 18px; --r-card: 16px; --r-field: 14px; --r-chip: 22px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --arabic: "Scheherazade New", "Amiri", "Noto Naskh Arabic", serif;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #F7F7F5; --surface: #FFFFFF; --raised: #FFFFFF;
    --gold: #8F6E2A; --gold-bright: #74581E; --copper: #8A6A40;
    --ink: #1C1E22; --muted: #6E7178; --hair: #E8E6E1; --danger: #B04A38;
    --jade: #1E5540; --lapis: #3B5EA8; --saffron: #7B4F0E; --on-accent: #FFFFFF;
    --shadow: 0 6px 14px -3px rgba(28, 30, 34, 0.14);
    --gold-soft: rgba(143, 110, 42, 0.10);
    --gold-line: rgba(143, 110, 42, 0.40);
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #F7F7F5; --surface: #FFFFFF; --raised: #FFFFFF;
  --gold: #8F6E2A; --gold-bright: #74581E; --copper: #8A6A40;
  --ink: #1C1E22; --muted: #6E7178; --hair: #E8E6E1; --danger: #B04A38;
  --jade: #1E5540; --lapis: #3B5EA8; --saffron: #7B4F0E; --on-accent: #FFFFFF;
  --shadow: 0 6px 14px -3px rgba(28, 30, 34, 0.14);
  --gold-soft: rgba(143, 110, 42, 0.10);
  --gold-line: rgba(143, 110, 42, 0.40);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: 17px; line-height: 1.6;
  -webkit-font-smoothing: antialiased; overflow-x: clip;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--gold); text-decoration-color: var(--gold-line); text-underline-offset: 3px; }
a:hover { color: var(--gold-bright); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 0.5em; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 6vw, 3.4rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2.2rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.wrap { width: min(100% - 32px, 1120px); margin-inline: auto; }
.narrow { width: min(100% - 32px, 780px); margin-inline: auto; }

/* L'arabe : toujours droit, dans sa police, jamais en italique. */
.ar, [lang="ar"] { font-family: var(--arabic); font-style: normal; direction: rtl; unicode-bidi: isolate; font-feature-settings: "calt", "liga"; }
.ar-inline { font-family: var(--arabic); font-size: 1.25em; line-height: 1; unicode-bidi: isolate; }

/* L'or bruni : le dégradé cuivre, or, éclat, or, cuivre qui épouse le texte.
   Réservé aux grands titres (dans l'app : seuil de 18 points). */
.or {
  background: linear-gradient(100deg, var(--copper) 0%, var(--gold) 28%, var(--gold-bright) 50%, var(--gold) 72%, var(--copper) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  -webkit-text-fill-color: transparent;
}
@supports not (background-clip: text) { .or { color: var(--gold); } }

/* en-tête */
.top {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(140%) blur(10px); -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--hair);
}
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; }
.brand { display: inline-flex; align-items: baseline; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 600; letter-spacing: 0.02em; }
.brand .ar-inline { font-size: 1.55rem; color: var(--gold); line-height: 1; transform: translateY(2px); }
.nav { display: flex; align-items: center; gap: 4px 18px; flex-wrap: wrap; justify-content: flex-end; font-size: 0.92rem; }
.nav a { color: var(--muted); text-decoration: none; padding: 6px 0; white-space: nowrap; }
@media (max-width: 679px) {
  .top .wrap { flex-wrap: wrap; row-gap: 0; padding-bottom: 8px; }
  .top .brand { order: 1; }
  .top .theme-btn { order: 2; }
  .nav { order: 3; flex: 1 1 100%; flex-wrap: nowrap; justify-content: flex-start; gap: 16px; overflow-x: auto; font-size: 0.86rem; padding-bottom: 2px; scrollbar-width: none; margin-left: 0; }
  .nav::-webkit-scrollbar { display: none; }
}
@media (min-width: 680px) { .nav { margin-left: auto; margin-right: 14px; } }
.nav a:hover, .nav a[aria-current="page"] { color: var(--gold); }
.theme-btn {
  appearance: none; border: 1px solid var(--hair); background: var(--surface); color: var(--muted);
  width: 38px; height: 38px; border-radius: 50%; display: inline-grid; place-items: center; cursor: pointer; padding: 0;
}
.theme-btn:hover { color: var(--gold); border-color: var(--gold-line); }
.theme-btn svg { width: 18px; height: 18px; }
.theme-btn .sun { display: none; }
:root[data-theme="dark"] .theme-btn .sun, :root:not([data-theme="light"]) .theme-btn .sun { display: block; }
:root[data-theme="dark"] .theme-btn .moon, :root:not([data-theme="light"]) .theme-btn .moon { display: none; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .theme-btn .sun { display: none; }
  :root:not([data-theme="dark"]) .theme-btn .moon { display: block; }
}
:root[data-theme="light"] .theme-btn .sun { display: none; }
:root[data-theme="light"] .theme-btn .moon { display: block; }

/* panneaux de manuscrit */
.panel {
  position: relative; background: var(--surface); border: 1px solid var(--hair);
  border-radius: var(--r-panel); padding: 24px; box-shadow: var(--shadow);
}
.panel::before {
  content: ""; position: absolute; inset: 6px; pointer-events: none;
  border: 1px solid var(--gold-line); border-radius: calc(var(--r-panel) - 6px);
}
.card { background: var(--surface); border: 1px solid var(--hair); border-radius: var(--r-card); padding: 18px 16px; box-shadow: var(--shadow); }
.label { font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); font-weight: 600; }

/* La rosace : huit rayons, deux cercles, comme SectionHeading dans l'app. */
.rosette { width: 22px; height: 22px; flex: none; color: var(--gold); }
.heading { display: flex; align-items: center; gap: 12px; margin: 0 0 14px; }
.heading h2, .heading h1 { margin: 0; }

/* boutons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 12px 22px; border-radius: var(--r-card); font-weight: 600; font-size: 1rem;
  text-decoration: none; border: 1px solid transparent; cursor: pointer; transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
.btn-gold {
  color: var(--on-accent);
  background: linear-gradient(135deg, var(--gold-bright) 0%, var(--gold) 45%, var(--copper) 100%);
  box-shadow: 0 8px 22px -8px color-mix(in srgb, var(--gold) 70%, transparent);
}
.btn-gold:hover { filter: brightness(1.06); transform: translateY(-1px); color: var(--on-accent); }
.btn-ghost { color: var(--ink); background: transparent; border-color: var(--hair); }
.btn-ghost:hover { border-color: var(--gold-line); color: var(--gold-bright); }
.btn[aria-disabled="true"] { cursor: default; opacity: 0.78; }
.btn .sub { display: block; font-size: 0.72rem; font-weight: 400; color: inherit; opacity: 0.8; line-height: 1.1; }
.btn-store { flex-direction: column; gap: 2px; min-width: 210px; line-height: 1.15; }

/* pied */
.foot { border-top: 1px solid var(--hair); margin-top: 72px; padding: 36px 0 44px; color: var(--muted); font-size: 0.92rem; }
.foot .cols { display: grid; gap: 22px 32px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .foot .cols { grid-template-columns: 1.4fr 1fr 1fr; } }
.foot h4 { font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); margin-bottom: 10px; }
.foot ul { list-style: none; padding: 0; margin: 0; }
.foot li { margin: 0 0 8px; }
.foot a { color: var(--muted); text-decoration: none; }
.foot a:hover { color: var(--gold); }
.foot .legal-line { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--hair); font-size: 0.84rem; }

/* pages légales */
.legal { padding: 36px 0 20px; }
.legal header { margin-bottom: 26px; }
.legal header .label { margin-bottom: 8px; display: block; }
.legal h1 { font-size: clamp(1.8rem, 5vw, 2.6rem); }
.legal .meta { color: var(--muted); font-size: 0.95rem; }
.legal .notice { border-left: 3px solid var(--gold); background: var(--gold-soft); padding: 12px 16px; border-radius: 0 var(--r-field) var(--r-field) 0; margin: 18px 0; font-size: 0.96rem; }
.legal .lang { font-size: 0.9rem; color: var(--muted); }
.legal h2 { font-size: 1.45rem; margin-top: 2.2em; scroll-margin-top: 80px; }
.legal h3 { font-size: 1.1rem; margin-top: 1.6em; color: var(--gold-bright); scroll-margin-top: 80px; }
.legal ul, .legal ol { padding-left: 1.3em; }
.legal li { margin-bottom: 0.45em; }
.legal li::marker { color: var(--gold); }
.legal .toc { padding: 18px 20px 14px; margin: 22px 0 10px; }
.legal .toc ol { margin: 0; padding-left: 1.2em; columns: 1; }
@media (min-width: 640px) { .legal .toc ol { columns: 2; column-gap: 28px; } }
.legal .toc li { break-inside: avoid; margin-bottom: 0.35em; font-size: 0.95rem; }
.legal .toc a { text-decoration: none; }
.legal .toc a:hover { text-decoration: underline; }
.legal .table-wrap { overflow-x: auto; margin: 16px -16px; padding: 0 16px; -webkit-overflow-scrolling: touch; }
.legal table { border-collapse: collapse; width: 100%; min-width: 640px; font-size: 0.93rem; line-height: 1.45; }
.legal th, .legal td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--hair); }
.legal th { color: var(--gold); font-weight: 600; font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; }
.legal tr:last-child td { border-bottom: none; }
.legal tbody tr:nth-child(odd) td { background: color-mix(in srgb, var(--surface) 60%, transparent); }
.legal .steps { counter-reset: etape; list-style: none; padding: 0; }
.legal .steps li { position: relative; padding-left: 48px; margin-bottom: 14px; }
.legal .steps li::before {
  counter-increment: etape; content: counter(etape); position: absolute; left: 0; top: 0;
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 700; font-size: 0.9rem; color: var(--on-accent);
  background: linear-gradient(135deg, var(--gold-bright), var(--copper));
}
.legal .ui { font-weight: 600; color: var(--ink); white-space: nowrap; }
.legal address { font-style: normal; }
.legal .summary { display: grid; gap: 10px; grid-template-columns: 1fr; padding: 0; list-style: none; margin: 18px 0 8px; }
@media (min-width: 640px) { .legal .summary { grid-template-columns: 1fr 1fr; } }
.legal .summary li { background: var(--surface); border: 1px solid var(--hair); border-radius: var(--r-card); padding: 12px 14px; font-size: 0.95rem; margin: 0; }
.legal .summary li strong { color: var(--gold-bright); display: block; font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 2px; }
.legal .mail { font-weight: 600; overflow-wrap: anywhere; }
.legal a, .legal code { overflow-wrap: anywhere; }

/* apparitions */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  *, *::before, *::after { animation-duration: 0.001s !important; animation-iteration-count: 1 !important; transition-duration: 0.001s !important; }
}
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); color: var(--gold); padding: 8px 12px; border-radius: 8px; z-index: 50; }
.skip:focus { left: 8px; }
