/* Basic reset */
*,
*::before,
*::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; scroll-behavior: smooth;}
body {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.55; color: var(--text); background: var(--bg);
}

/* ---------- Typography cleanup ---------- */
/* Comfortable line length for FR/EN and cleaner wrapping */
:root { --measure: 60ch; }
.hero-copy { max-width: var(--measure); }
.hero-copy p { max-width: 58ch; }

/* Stop aggressive breaks on key UI text */
.hero-copy h1,
.hero-copy h2,
.site-nav a,
.btn {
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
}

/* Headings: spacing + line-height tuned */
.hero-copy h1 { line-height: 1.15; letter-spacing: 0; margin-bottom: .35rem; }
.hero-copy h2 { line-height: 1.28; letter-spacing: 0; margin-bottom: .75rem; }

/* Nicer line breaking (supported browsers) */
@supports (text-wrap: balance) {
  .hero-copy h1, .hero-copy h2 { text-wrap: balance; }
}
@supports (text-wrap: pretty) {
  .hero-copy p { text-wrap: pretty; }
}

/* Global safety: only manual hyphens */
html { hyphens: manual; }

/* Slightly tighter tracking for FR headings */
html[lang="fr"] .hero-copy h1 { letter-spacing: -0.01em; }
html[lang="fr"] .hero-copy h2 { letter-spacing: -0.005em; }

:root {
  --bg: #ffffff;
  --text: #0f172a;
  --muted: #475569;
  --brand: #0ea5e9;
  --brand-ink: #0a6fa3;
  --surface: #f1f5f9;
  --ring: #93c5fd;
  --card: #ffffff;
  --border: #e2e8f0;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c2333;
    --text: #f8fafc;
    --muted: #d1d5db;
    --brand: #60a5fa;
    --brand-ink: #3b82f6;
    --surface: #2a3245;
    --card: #334155;
    --border: #475569;
    --ring: #93c5fd;
  }
}

/* --- Make contact links more legible in dark mode --- */
@media (prefers-color-scheme: dark) {
  #contact a { color: #93c5fd; }
  #contact a:hover,
  #contact a:focus { color: #bfdbfe; text-decoration: underline; }
}

/* --- Also apply if user selects manual "Dark" (system) mode --- */
html:not([data-theme="light"]) #contact a { color: #93c5fd; }
html:not([data-theme="light"]) #contact a:hover,
html:not([data-theme="light"]) #contact a:focus {
  color: #bfdbfe; text-decoration: underline;
}

.container { max-width: 1100px; margin: 0 auto; padding: 0 1rem; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  backdrop-filter: saturate(180%) blur(6px);
  overflow: visible;
}

/* Mobile-only container for theme buttons inside the menu */
.only-mobile { display: none; }
.theme-menu { display: grid; gap: .5rem; margin-top: .25rem; }

.menu-item-btn {
  display: inline-block;
  width: 100%;
  text-align: left;
  padding: .5rem .75rem;
  border: 1px solid var(--border);
  border-radius: .5rem;
  background: var(--card);
  color: var(--text);
  cursor: pointer;
}
.menu-item-btn:hover,
.menu-item-btn:focus { background: var(--surface); }

/* Show these only when the nav collapses on small screens */
@media (max-width: 700px) {
  .only-mobile { display: block; }

  /* ---------- Mobile Heading Adjustments ---------- */
  .hero-copy h1 {
    font-size: clamp(1.5rem, 5.2vw + 0.2rem, 1.9rem);
    line-height: 1.18;
    margin-bottom: 0.4rem;
  }
  .hero-copy h2 {
    font-size: clamp(1.05rem, 3.4vw + 0.3rem, 1.32rem);
    line-height: 1.32;
    font-weight: 500;
    color: var(--muted-text, var(--text));
    margin-bottom: 0.75rem;
  }
  .hero-copy { padding-top: 0.5rem; padding-bottom: 0.5rem; }
}

/* --- Theme overrides via data-theme on <html> --- */
:root[data-theme="light"] {
  --bg: #ffffff;
  --text: #0f172a;
  --muted: #475569;
  --brand: #0ea5e9;
  --brand-ink: #0a6fa3;
  --surface: #f1f5f9;
  --card: #ffffff;
  --border: #e2e8f0;
  --ring: #93c5fd;
}

/* Icon-style button (desktop toggle) */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  min-width: 38px;
  padding: 0 .5rem;
  border: 1px solid var(--border);
  border-radius: .5rem;
  background: var(--card);
  color: var(--text);
  cursor: pointer;
}
.icon-btn:hover, .icon-btn:focus { filter: brightness(0.98); outline: none; }

/* Make the hamburger and the icon share spacing */
.header-inner { gap: .5rem; }

/* Mobile-only menu item */
.only-mobile { display: none; }
.menu-item-btn {
  display: inline-block;
  width: 100%;
  text-align: left;
  padding: .5rem .75rem;
  border: 1px solid var(--border);
  border-radius: .5rem;
  background: var(--card);
  color: var(--text);
  cursor: pointer;
}
.menu-item-btn:hover, .menu-item-btn:focus { background: var(--surface); }

/* Show the mobile theme button when the menu collapses */
@media (max-width: 700px) {
  .only-mobile { display: block; }
}

.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px; gap: 1rem;
}
.brand {
  display: inline-flex; align-items: center; gap: .5rem;
  text-decoration: none; color: var(--text); font-weight: 700;
}
.brand .logo-mark {
  display: block;
  height: 64px; /* match header height so alignment stays centered */
  width: auto;
  margin-bottom: -8px; /* pulls the image 8px below the header border */
}

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: .5rem;
  padding: .5rem .6rem;
  cursor: pointer;
  color: var(--border);
}
.nav-toggle:hover,
.nav-toggle:focus {
  color: var(--brand);
  border-color: var(--brand);
}

.site-nav ul {
  list-style: none; display: flex; gap: 1rem; padding: 0; margin: 0;
}
.site-nav a {
  text-decoration: none; color: var(--text); padding: .5rem .75rem; border-radius: .5rem;
}
.site-nav a:hover, .site-nav a:focus {
  outline: none; background: var(--surface);
}

/* Ensure mobile menu fits longer FR labels */
@media (max-width: 700px) {
  .site-nav.open {
    display: block; position: absolute; right: 1rem; top: 64px;
    background: var(--card); border: 1px solid var(--border); border-radius: .75rem;
    padding: .5rem; min-width: 220px;
  }
  .site-nav ul { flex-direction: column; }
}

/* Hero */
.section { padding: clamp(2rem, 4vw + 1rem, 5rem) 0; }
.hero { background: linear-gradient(180deg, var(--surface), transparent); }

.grid-2 {
  display: grid; grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(1rem, 3vw, 2rem); align-items: center;
}
.hero-copy h1 { font-size: clamp(1.8rem, 1rem + 2.5vw, 3rem); margin: 0 0 .5rem 0; }
.hero-copy h3 {
  margin-top: 0.5rem; font-size: 1.2rem; color: var(--text);
}
.hero-copy p { margin-bottom: 0.8rem; color: var(--muted); }
.cta-row {
  display: flex; gap: .75rem; margin-top: 0.25rem; flex-wrap: wrap;
}
.feature-bullets { margin: 1rem 0 0; padding-left: 1.25rem; color: var(--muted); }
.hero-art { display: grid; place-items: center; }

/* Hero gallery */
.hero-gallery {
  display: grid; gap: .75rem; width: 100%; max-width: 720px; margin-inline: auto; margin: 0;
}
.hero-gallery img { width: 100%; height: auto; display: block; }

.thumb-row {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem;
}

.thumb {
  padding: 0;
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: .6rem;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}
.thumb:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.thumb[aria-current="true"] { box-shadow: 0 0 0 2px var(--ring) inset; filter: none; }
.thumb:not([aria-current="true"]):hover,
.thumb:not([aria-current="true"]):focus-visible { transform: translateY(-1px); }
.thumb img {
  display: block; width: 100%; height: auto; border-radius: .55rem;
  aspect-ratio: 4 / 5; object-fit: cover;
}

/* Make the row wrap on small screens */
@media (max-width: 700px) { .thumb-row { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 480px) {
  .brand .logo-mark {
    height: 56px;
    margin-bottom: -6px; /* slightly smaller overlap for tighter header */
  }
}

/* Cover image */
.cover-img {
  display: block; max-width: 100%; height: auto; max-height: 80vh; margin: 0 auto; image-rendering: auto;
}
.hero-art { overflow: auto; }

.card h3 { margin-top: 0; }

/* Contact */
.contact-list { padding-left: 1rem; }
.contact-form { display: grid; gap: .75rem; }
.contact-form label { display: grid; gap: .35rem; font-weight: 600; }
.contact-form input, .contact-form textarea {
  width: 100%; padding: .75rem .8rem; border-radius: .7rem;
  border: 1px solid var(--border); background: var(--card); color: var(--text);
}
#contact { background: var(--surface); }
.contact-form input:focus, .contact-form textarea:focus { outline: 2px solid var(--ring); outline-offset: 2px; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: 1rem 0; color: var(--muted); }

/* Buttons */
.btn {
  display: inline-block; text-decoration: none; background: var(--brand); color: white;
  border: 1px solid var(--brand-ink); padding: .7rem 1rem; border-radius: .7rem; font-weight: 700;
}
.btn:hover, .btn:focus { filter: brightness(0.95); }
.btn-outline { background: transparent; color: var(--brand-ink); border-color: var(--brand-ink); }
.btn-outline:hover, .btn-outline:focus { background: var(--surface); }
.btn-outline:active { filter: brightness(0.9); }

/* Skip link & a11y */
.skip-link {
  position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden;
}
.skip-link:focus {
  position: fixed; left: 1rem; top: 1rem; width: auto; height: auto; padding: .5rem .75rem;
  background: var(--brand); color: white; border-radius: .5rem; z-index: 100;
}
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ---------- Mobile description toggle ---------- */
/* Default (desktop/tablet): show description, hide "More info" */
.link-more {
  display: none; margin: .5rem 0 1rem; padding: 0; background: none; border: 0;
  color: var(--brand-ink); font-weight: 700; cursor: pointer; text-decoration: underline;
}
.link-more:focus { outline: 2px solid var(--ring); outline-offset: 2px; }

@media (max-width: 700px) {
  /* Hide long paragraphs only on mobile */
  .hero-copy .desc { display: none; }
  /* Show the trigger on mobile */
  .link-more { display: inline-block; }
}

/* ---------- Modal ---------- */
.modal {
  position: fixed; inset: 0; display: grid; place-items: center;
  visibility: hidden; z-index: 9999;
}
.modal[aria-hidden="true"] { pointer-events: none; }
.modal.open { visibility: visible; }

.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(15, 23, 42, 0.55);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  z-index: 9998;
}
.modal-panel {
  position: relative; z-index: 9999; width: min(92vw, 640px); max-height: 86vh; overflow: auto;
  background: var(--card); color: var(--text); border: 1px solid var(--border);
  border-radius: 1rem; padding: 1rem 1.1rem 1.1rem; box-shadow: 0 10px 30px rgba(0,0,0,.25);
  margin-top: env(safe-area-inset-top, 1rem);
}
.modal-close {
  position: absolute; top: .5rem; right: .5rem;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  border-radius: .6rem; width: 36px; height: 36px; cursor: pointer;
}
.modal-close:hover, .modal-close:focus { filter: brightness(0.98); outline: none; }
.modal-content p { color: var(--muted); }

/* Responsive */
@media (max-width: 960px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .gallery { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 700px) {
  .site-nav { display: none; }
  .nav-toggle { display: inline-block; }
  /* .site-nav.open moved above with FR tweaks */
  .site-nav ul { flex-direction: column; }
  .cta-row { margin-top: 1.5rem; }
  .grid-2 {
    grid-template-columns: 1fr;
    column-gap: 0;
    row-gap: 0.75rem;
    align-items: start;
  }
  .feature-bullets li.only-mobile { list-style: none; }
}
@media (max-width: 480px) {
  .cards { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: 1fr; }
  .header-inner { height: 56px; }
}
