/* ============================================================
   La Roche d'Aujoux — feuille de style commune
   Design system : design.md (Expo) appliqué littéralement.
   ============================================================ */

/* ---------- Design tokens ---------- */
:root {
  /* Surface */
  --canvas: #ffffff;
  --canvas-soft: #fafafa;
  --surface-card: #ffffff;
  --surface-strong: #f0f0f3;
  --surface-dark: #171717;
  --surface-dark-elevated: #1a1a1a;

  /* Hairlines */
  --hairline: #f0f0f3;
  --hairline-soft: #f5f5f7;
  --hairline-strong: #dcdee0;

  /* Text */
  --ink: #171717;
  --body: #60646c;
  --body-strong: #171717;
  --muted: #999999;
  --muted-soft: #cccccc;
  --on-primary: #ffffff;
  --on-dark: #ffffff;
  --on-dark-soft: #b0b4ba;

  /* Brand & Accent */
  --primary: #000000;
  --primary-active: #1a1a1a;
  --text-link: #0d74ce;
  --text-link-secondary: #476cff;
  --accent-link-bright: #47c2ff;

  /* Atmospheric backdrop (hero only) */
  --gradient-sky-light: #cfe7ff;
  --gradient-sky-mid: #a8c8e8;

  /* Semantic */
  --accent-warning: #ab6400;
  --accent-preview: #8145b5;
  --semantic-success: #16a34a;
  --semantic-error: #eb8e90;

  /* Spacing */
  --space-xxs: 4px;
  --space-xs: 8px;
  --space-sm: 12px;
  --space-base: 16px;
  --space-md: 20px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-xxl: 48px;
  --space-section: 96px;

  /* Radius */
  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;
  --r-xxl: 24px;
  --r-pill: 9999px;

  /* Container */
  --container: 1200px;
  --container-narrow: 880px;

  /* Type */
  --font-sans: "Inter", -apple-system, system-ui, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Elevation */
  --shadow-soft: 0 4px 12px rgba(0, 0, 0, 0.04);
}

/* ---------- Reset & base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--body);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: var(--text-link);
  text-decoration: none;
  transition: color 0.15s ease;
}

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

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  border-radius: var(--r-xs);
}

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-sans);
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 var(--space-base);
}

.display-mega {
  font-size: clamp(40px, 6vw, 64px);
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.display-xl {
  font-size: clamp(32px, 4.5vw, 48px);
  line-height: 1.1;
  letter-spacing: -0.025em;
}

.display-lg {
  font-size: clamp(28px, 3.5vw, 36px);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.display-md {
  font-size: clamp(22px, 2.5vw, 28px);
  line-height: 1.2;
  letter-spacing: -0.015em;
}

.display-sm {
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

p {
  margin: 0 0 var(--space-base);
}

.lead {
  font-size: 18px;
  line-height: 1.55;
  color: var(--body);
}

.eyebrow {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: var(--space-base);
}

.caption {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
  text-align: center;
  margin-top: var(--space-sm);
}

.inv-ref {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0;
}

strong {
  color: var(--body-strong);
  font-weight: 600;
}

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.container-narrow {
  width: 100%;
  max-width: var(--container-narrow);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

section {
  padding: var(--space-section) 0;
}

section.tight {
  padding: 64px 0;
}

.section-soft {
  background: var(--canvas-soft);
}

.section-dark {
  background: var(--surface-dark);
  color: var(--on-dark);
}

.section-dark h1,
.section-dark h2,
.section-dark h3 {
  color: var(--on-dark);
}

.divider {
  height: 1px;
  background: var(--hairline);
  border: 0;
  margin: 0;
}

/* ---------- Top navigation ---------- */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(8px);
  -webkit-backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--hairline);
}

.top-nav-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--space-lg);
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
}

.brand {
  display: flex;
  flex-direction: column;
  font-weight: 600;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.brand:hover {
  text-decoration: none;
  color: var(--ink);
}

.brand-line-2 {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-top: 2px;
}

.nav-links {
  display: flex;
  gap: var(--space-xl);
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--body);
  padding: 4px 0;
}

.nav-links a:hover {
  color: var(--ink);
  text-decoration: none;
}

.nav-links a[aria-current="page"] {
  color: var(--ink);
  border-bottom: 2px solid var(--ink);
}

.nav-cta {
  display: inline-flex;
  align-items: center;
}

.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-md);
}

.nav-toggle-icon,
.nav-toggle-icon::before,
.nav-toggle-icon::after {
  content: "";
  display: block;
  width: 20px;
  height: 2px;
  background: var(--ink);
  border-radius: 1px;
  position: relative;
  transition: transform 0.2s ease;
}

.nav-toggle-icon::before {
  position: absolute;
  top: -6px;
}

.nav-toggle-icon::after {
  position: absolute;
  top: 6px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  height: 40px;
  padding: 0 18px;
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--r-md);
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}

.btn:hover {
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: var(--on-primary);
}

.btn-primary:hover,
.btn-primary:focus-visible {
  background: var(--primary-active);
  color: var(--on-primary);
}

.btn-secondary {
  background: var(--surface-card);
  color: var(--ink);
  border: 1px solid var(--hairline-strong);
}

.btn-secondary:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.btn-secondary-on-dark {
  background: transparent;
  color: var(--on-dark);
  border: 1px solid rgba(255, 255, 255, 0.32);
}

.btn-secondary-on-dark:hover {
  border-color: var(--on-dark);
  color: var(--on-dark);
}

.btn-tertiary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-link);
  font-weight: 500;
  font-size: 14px;
}

.btn-tertiary::after {
  content: "→";
  transition: transform 0.15s ease;
}

.btn-tertiary:hover {
  text-decoration: none;
  color: var(--text-link);
}

.btn-tertiary:hover::after {
  transform: translateX(3px);
}

/* ---------- Hero ---------- */
.hero {
  padding: 96px 0 64px;
  text-align: center;
  position: relative;
  isolation: isolate;
}

/* Sky-blue gradient atmospheric wash — hero only (design.md) */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(
      ellipse 80% 60% at 50% 0%,
      var(--gradient-sky-light) 0%,
      rgba(207, 231, 255, 0.6) 30%,
      rgba(207, 231, 255, 0) 70%
    ),
    linear-gradient(
      180deg,
      var(--gradient-sky-mid) 0%,
      rgba(168, 200, 232, 0.25) 30%,
      var(--canvas) 75%
    );
  pointer-events: none;
}

.hero-inner {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.hero h1 {
  margin-bottom: var(--space-lg);
}

.hero p.lead {
  color: var(--body);
  margin-bottom: var(--space-xl);
}

.hero-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  justify-content: center;
}

.hero-image {
  margin-top: var(--space-xxl);
  border-radius: var(--r-xl);
  overflow: hidden;
  background: var(--surface-strong);
  aspect-ratio: 16 / 9;
  max-width: var(--container);
  margin-left: auto;
  margin-right: auto;
  padding: 0 var(--space-lg);
}

.hero-image-frame {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: var(--r-xl);
  overflow: hidden;
  background: var(--surface-strong);
}

.hero-page {
  padding: 64px 0 16px;
  text-align: center;
}

.hero-page .eyebrow {
  margin-bottom: var(--space-sm);
}

/* ---------- Image placeholders ---------- */
.img-frame {
  background: var(--surface-strong);
  border-radius: var(--r-lg);
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  padding: var(--space-lg);
}

.img-frame[data-ratio="16-9"] { aspect-ratio: 16 / 9; }
.img-frame[data-ratio="4-3"] { aspect-ratio: 4 / 3; }
.img-frame[data-ratio="3-2"] { aspect-ratio: 3 / 2; }
.img-frame[data-ratio="1-1"] { aspect-ratio: 1 / 1; }
.img-frame[data-ratio="3-4"] { aspect-ratio: 3 / 4; }

.img-frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.img-placeholder-label {
  position: relative;
  z-index: 1;
  padding: var(--space-sm) var(--space-base);
  background: rgba(255, 255, 255, 0.85);
  border-radius: var(--r-sm);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0;
  border: 1px dashed var(--hairline-strong);
}

.figure {
  margin: 0;
}

.figure figcaption {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.45;
  text-align: center;
  margin-top: var(--space-sm);
  font-style: italic;
}

/* Measure rule (parure en or scale ref) — archaeological black/white/red */
.measure-rule {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  margin: var(--space-sm) auto 0;
  max-width: 220px;
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--muted);
}

.measure-rule-bar {
  flex: 1;
  height: 10px;
  border-radius: 2px;
  background: linear-gradient(
    to right,
    #1a1a1a 0 20%,
    #ffffff 20% 40%,
    #cc1e1e 40% 60%,
    #ffffff 60% 80%,
    #1a1a1a 80% 100%
  );
  border: 1px solid var(--hairline-strong);
}

/* ---------- Two-column blocks ---------- */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xxl);
  align-items: center;
}

.split-text > .eyebrow + h2,
.split-text > h2 {
  margin-bottom: var(--space-lg);
}

.split.reverse > .split-text {
  order: 2;
}

/* ---------- Quote block ---------- */
.quote {
  text-align: center;
  max-width: 780px;
  margin: 0 auto;
  padding: var(--space-xl) var(--space-lg);
  position: relative;
}

.quote::before,
.quote::after {
  content: "";
  display: block;
  width: 40px;
  height: 1px;
  background: var(--hairline-strong);
  margin: 0 auto;
}

.quote::before { margin-bottom: var(--space-lg); }
.quote::after { margin-top: var(--space-lg); }

.quote p {
  font-family: var(--font-sans);
  font-style: italic;
  color: var(--ink);
  font-size: clamp(20px, 2.2vw, 26px);
  line-height: 1.35;
  letter-spacing: -0.01em;
  margin: 0;
  font-weight: 500;
}

.quote cite {
  display: block;
  margin-top: var(--space-base);
  font-size: 11px;
  font-style: normal;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

/* ---------- M3 accordion ---------- */
.m3-list {
  display: grid;
  gap: var(--space-base);
  margin-top: var(--space-xl);
}

.m3-item {
  border: 1px solid var(--hairline-strong);
  border-radius: var(--r-lg);
  background: var(--surface-card);
  overflow: hidden;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.m3-item:hover {
  box-shadow: var(--shadow-soft);
}

.m3-item[data-open="true"] {
  border-color: var(--ink);
}

.m3-trigger {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
  padding: var(--space-lg) var(--space-xl);
  text-align: left;
  background: transparent;
}

.m3-trigger:hover {
  background: var(--canvas-soft);
}

.m3-trigger-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.m3-trigger-text .m3-title {
  display: block;
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.005em;
}

.m3-trigger-teaser {
  font-size: 14px;
  color: var(--body);
}

.m3-chevron {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-md);
  background: var(--surface-strong);
  color: var(--ink);
  font-weight: 600;
  font-size: 18px;
  transition: transform 0.25s ease, background 0.15s ease, color 0.15s ease;
}

.m3-item[data-open="true"] .m3-chevron {
  transform: rotate(45deg);
  background: var(--primary);
  color: var(--on-primary);
}

.m3-body {
  padding: 0 var(--space-xl) var(--space-xl);
  display: grid;
  grid-template-columns: minmax(220px, 320px) 1fr;
  gap: var(--space-xl);
  align-items: start;
}

.m3-body[hidden] {
  display: none;
}

.m3-body .img-frame {
  margin: 0;
}

.m3-body p {
  margin: 0 0 var(--space-sm);
  color: var(--body);
}

.m3-body p:last-child {
  margin-bottom: 0;
}

/* ---------- Tags grid (spécialités) — badge-pill from design.md ---------- */
.tag-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin: var(--space-base) 0 0;
  padding: 0;
  list-style: none;
}

.tag-grid li {
  background: var(--surface-strong);
  color: var(--ink);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px 10px;
  border-radius: var(--r-pill);
}

/* ---------- Axes list ---------- */
.axes-list {
  margin: var(--space-base) 0 var(--space-lg);
  padding: 0;
  list-style: none;
  display: grid;
  gap: var(--space-sm);
}

.axes-list li {
  padding-left: 28px;
  position: relative;
  color: var(--body);
}

.axes-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.65em;
  width: 16px;
  height: 1px;
  background: var(--ink);
}

/* ---------- Partners strip ---------- */
.partners {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-base) var(--space-xl);
  padding: 0;
  list-style: none;
  margin: 0;
}

.partners li {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}

/* ---------- CTA band + HelloAsso placeholder ---------- */
.cta-band {
  background: var(--canvas);
  color: var(--ink);
  padding: var(--space-section) 0;
  text-align: center;
  border-top: 1px solid var(--hairline);
}

.cta-band-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.cta-band h2 {
  color: var(--ink);
  margin-bottom: var(--space-base);
}

.cta-band p {
  color: var(--body);
  font-size: 17px;
  margin-bottom: var(--space-xl);
}

.helloasso-embed {
  background: var(--canvas-soft);
  border: 1px dashed var(--hairline-strong);
  border-radius: var(--r-lg);
  min-height: 480px;
  margin: var(--space-xl) auto 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-xl);
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.helloasso-embed .placeholder-note {
  max-width: 360px;
}

.helloasso-embed .placeholder-note strong {
  color: var(--ink);
}

.helloasso-embed code {
  font-family: var(--font-mono);
  background: var(--surface-strong);
  padding: 2px 6px;
  border-radius: var(--r-xs);
  font-size: 12px;
  color: var(--ink);
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--canvas);
  border-top: 1px solid var(--hairline);
  padding: 64px 0 48px;
  color: var(--body);
  font-size: 14px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: var(--space-xxl);
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.footer-col h3 {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0 0 var(--space-base);
}

.footer-col p,
.footer-col ul {
  font-size: 14px;
  color: var(--body);
  margin: 0 0 var(--space-xs);
}

.footer-col ul {
  list-style: none;
  padding: 0;
  display: grid;
  gap: var(--space-xs);
}

.footer-bottom {
  max-width: var(--container);
  margin: 48px auto 0;
  padding: var(--space-lg) var(--space-lg) 0;
  border-top: 1px solid var(--hairline);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-base);
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  :root {
    --space-section: 80px;
  }
  .split {
    gap: var(--space-xl);
  }
  .m3-body {
    grid-template-columns: minmax(200px, 280px) 1fr;
    gap: var(--space-lg);
  }
}

@media (max-width: 768px) {
  :root {
    --space-section: 64px;
  }
  .nav-links,
  .nav-cta {
    display: none;
  }
  .nav-toggle {
    display: inline-flex;
  }
  .top-nav.is-open .nav-links {
    display: flex;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--canvas);
    flex-direction: column;
    gap: 0;
    padding: var(--space-base) var(--space-lg);
    border-bottom: 1px solid var(--hairline);
    box-shadow: var(--shadow-soft);
  }
  .top-nav.is-open .nav-links li {
    border-bottom: 1px solid var(--hairline-soft);
  }
  .top-nav.is-open .nav-links li:last-child {
    border-bottom: 0;
  }
  .top-nav.is-open .nav-links a {
    display: block;
    padding: var(--space-base) 0;
  }

  .split {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }
  .split.reverse > .split-text {
    order: 0;
  }
  .m3-body {
    grid-template-columns: 1fr;
  }
  .m3-trigger {
    padding: var(--space-base) var(--space-lg);
  }
  .m3-body {
    padding: 0 var(--space-lg) var(--space-lg);
  }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }
  .hero {
    padding: 64px 0 48px;
  }
  .hero-image {
    margin-top: var(--space-xl);
  }
  .helloasso-embed {
    min-height: 600px;
  }
}

@media (max-width: 480px) {
  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .hero-actions .btn {
    width: 100%;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
