/* Manus Terra — design tokens & base */

:root {
  /* Paper & ink */
  --paper:        oklch(0.962 0.012 78);   /* warm cream */
  --paper-deep:   oklch(0.928 0.018 74);   /* aged cream */
  --paper-veil:   oklch(0.940 0.014 76);
  --ink:          oklch(0.175 0.012 60);   /* deep warm charcoal */
  --ink-soft:     oklch(0.32  0.012 60);
  --ink-mute:     oklch(0.52  0.010 60);
  --ink-faint:    oklch(0.74  0.008 70);
  --rule:         oklch(0.84  0.012 72);

  /* Accents — same lightness band */
  --terracotta:   oklch(0.62 0.130 40);
  --terracotta-d: oklch(0.50 0.130 40);
  --dust-blue:    oklch(0.62 0.060 240);
  --dust-blue-d:  oklch(0.50 0.070 240);
  --ochre:        oklch(0.66 0.090 80);

  /* Type */
  --serif: "Fraunces", "Iowan Old Style", Georgia, serif;
  --sans:  "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --mono:  "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  /* Geom */
  --maxw: 1240px;
  --gutter: clamp(20px, 4vw, 64px);
  --radius: 2px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

html {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  background-color: var(--paper);
  background-image:
    /* horizontal warm wash */
    radial-gradient(1200px 700px at 80% -10%, oklch(0.94 0.022 70 / .9), transparent 60%),
    radial-gradient(900px 600px at 0% 100%, oklch(0.94 0.020 80 / .7), transparent 60%),
    /* paper grain */
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.12  0 0 0 0 0.10  0 0 0 0 0.08  0 0 0 0.045 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-size: auto, auto, 200px 200px;
  background-attachment: fixed, fixed, fixed;
  min-height: 100vh;
}

/* Type ramp */
.display {
  font-family: var(--serif);
  font-weight: 300;
  font-style: normal;
  font-optical-sizing: auto;
  font-variation-settings: "SOFT" 80, "WONK" 0, "opsz" 144;
  letter-spacing: -0.018em;
  line-height: 0.96;
  color: var(--ink);
  text-wrap: balance;
}
.serif { font-family: var(--serif); font-variation-settings: "SOFT" 80, "opsz" 28; }
.italic-serif { font-family: var(--serif); font-style: italic; font-variation-settings: "SOFT" 80, "opsz" 28; }

.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

.mono { font-family: var(--mono); }

p { color: var(--ink-soft); line-height: 1.55; text-wrap: pretty; }
a { color: inherit; text-underline-offset: 3px; }

::selection { background: oklch(0.62 0.130 40 / .25); }

/* Layout */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }

.rule { border: 0; border-top: 1px solid var(--rule); margin: 0; }
.rule-dash { border: 0; border-top: 1px dashed var(--rule); margin: 0; }

/* Hero on photo */
.hero-headline {
  color: oklch(0.97 0.012 78);
  text-shadow: 0 2px 14px oklch(0.10 0.012 60 / 0.55);
}
.hero-on-photo {
  color: oklch(0.84 0.014 78 / 0.86) !important;
}
.hero-on-photo::before { background: oklch(0.84 0.014 78 / 0.6) !important; }
.btn-on-photo-primary {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 22px;
  font-family: var(--sans); font-size: 14px; font-weight: 500;
  letter-spacing: 0.01em;
  border-radius: 999px;
  border: 1px solid oklch(0.62 0.130 40);
  background: oklch(0.62 0.130 40);
  color: oklch(0.97 0.012 78);
  cursor: pointer;
  transition: transform .25s ease, background .25s ease, border-color .25s ease, box-shadow .25s ease;
  box-shadow: 0 6px 18px oklch(0.30 0.130 40 / 0.45);
}
.btn-on-photo-primary:hover {
  transform: translateY(-1px);
  background: oklch(0.55 0.140 40);
  border-color: oklch(0.55 0.140 40);
  color: oklch(0.97 0.012 78);
  box-shadow: 0 8px 22px oklch(0.30 0.130 40 / 0.55);
}
.btn-on-photo-ghost {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 22px;
  font-family: var(--sans); font-size: 14px; font-weight: 500;
  letter-spacing: 0.01em;
  border-radius: 999px;
  border: 1px solid oklch(0.96 0.012 78 / 0.55);
  background: transparent;
  color: oklch(0.97 0.012 78);
  cursor: pointer;
  transition: all .25s ease;
  backdrop-filter: blur(4px);
}
.btn-on-photo-ghost:hover {
  background: oklch(0.97 0.012 78 / 0.12);
  border-color: oklch(0.97 0.012 78);
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 22px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.01em;
  border-radius: 999px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  cursor: pointer;
  text-decoration: none;
  transition: transform .25s ease, background .25s ease, color .25s ease, border-color .25s ease;
}
.btn:hover { transform: translateY(-1px); background: var(--terracotta-d); border-color: var(--terracotta-d); }
.btn-ghost {
  background: transparent; color: var(--ink); border-color: var(--ink);
}
.btn-ghost:hover { background: var(--ink); color: var(--paper); }
.btn-arrow::after { content: "→"; font-family: var(--mono); transition: transform .25s ease; }
.btn:hover .btn-arrow::after, .btn-arrow:hover::after { transform: translateX(3px); }

/* Photo placeholder */
.photo {
  position: relative;
  background:
    repeating-linear-gradient(
      135deg,
      oklch(0.88 0.012 70) 0 1px,
      transparent 1px 14px
    ),
    oklch(0.91 0.014 72);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
  color: var(--ink-mute);
}
.photo.photo-real {
  background: var(--paper-deep);
  border-color: transparent;
}
.photo.photo-real img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.photo .tag {
  position: absolute; left: 14px; top: 14px;
  font-family: var(--mono); font-size: 10.5px;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-mute);
  background: var(--paper);
  padding: 5px 9px;
  border: 1px solid var(--rule);
  z-index: 2;
}
.photo-real .tag {
  background: color-mix(in oklab, oklch(0.18 0.008 70) 60%, transparent);
  color: oklch(0.96 0.012 78 / .9);
  border-color: color-mix(in oklab, oklch(0.96 0.012 78) 25%, transparent);
  backdrop-filter: blur(8px);
}
.photo .ratio { content: ""; display: block; padding-top: 100%; }
.photo .caption {
  position: absolute; left: 14px; right: 14px; bottom: 12px;
  font-family: var(--mono); font-size: 10.5px;
  color: var(--ink-mute);
  display: flex; justify-content: space-between; gap: 12px;
  z-index: 2;
}
.photo .caption.caption-on {
  color: oklch(0.96 0.012 78 / .95);
  text-shadow: 0 1px 6px oklch(0.18 0.008 70 / .9);
}
.photo-real::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 50%, oklch(0.12 0.008 70 / .55) 100%);
  pointer-events: none;
  z-index: 1;
}

/* Section spacing */
.section { padding: clamp(80px, 10vw, 140px) 0; }
.section-tight { padding: clamp(56px, 7vw, 90px) 0; }

/* Reveal — always visible; gentle fade-in only when triggered via JS class */
.reveal { opacity: 1; transform: none; }
.reveal.r-hidden { opacity: 0; transform: translateY(14px); transition: opacity .9s ease, transform .9s ease; }
.reveal.r-hidden.in { opacity: 1; transform: none; }

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in oklab, var(--paper) 88%, transparent);
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  border-bottom: 1px solid var(--rule);
}
.nav-row {
  display: flex; align-items: center; justify-content: space-between;
  height: 72px;
}
.nav-brand { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.nav-brand img { height: 36px; width: auto; display: block; }
.nav-brand .nm {
  font-family: var(--serif); font-size: 18px; font-weight: 400;
  letter-spacing: 0.06em; line-height: 1;
}
.nav-brand .tg { font-family: var(--mono); font-size: 10px; color: var(--ink-mute); letter-spacing: 0.18em; text-transform: uppercase; margin-top: 4px;}
.nav-links { display: flex; gap: 28px; align-items: center; }
.nav-link {
  font-size: 13.5px; color: var(--ink-soft); cursor: pointer;
  position: relative; padding: 6px 0;
}
.nav-link.active { color: var(--ink); }
.nav-link.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px;
  height: 1px; background: var(--terracotta);
}
.nav-link:hover { color: var(--ink); }

.nav-cta {
  font-family: var(--sans); font-size: 13px; font-weight: 500;
  padding: 10px 16px;
  border: 1px solid var(--ink); border-radius: 999px;
  background: var(--ink); color: var(--paper);
  cursor: pointer;
}
.nav-cta:hover { background: var(--terracotta-d); border-color: var(--terracotta-d); }

/* Footer */
.foot {
  background: oklch(0.16 0.008 70);
  color: oklch(0.82 0.008 70);
  padding: 80px 0 36px;
  margin-top: 80px;
}
.foot a { color: oklch(0.92 0.008 70); }
.foot .eyebrow { color: oklch(0.65 0.008 70); }

/* Cards */
.card {
  background: var(--paper-veil);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 28px;
}

/* Specific helpers */
.amp { font-family: var(--serif); font-style: italic; font-weight: 300; }

.dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--terracotta); margin-right: 10px; vertical-align: middle;
}

.kicker {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--ink-mute);
}
.kicker::before {
  content: ""; width: 24px; height: 1px; background: var(--ink-mute);
}

/* Modal */
.modal-bd {
  position: fixed; inset: 0; z-index: 100;
  background: oklch(0.16 0.008 70 / .55);
  display: grid; place-items: center;
  padding: 20px;
  animation: fadeIn .25s ease;
}
.modal {
  background: var(--paper);
  border: 1px solid var(--rule);
  max-width: 640px; width: 100%;
  padding: 40px;
  position: relative;
  animation: slideUp .35s cubic-bezier(.2,.7,.2,1);
}
@keyframes fadeIn { from {opacity: 0} to {opacity: 1} }
@keyframes slideUp { from {opacity: 0; transform: translateY(20px)} to {opacity:1; transform: none} }

.input, .ta, .sel {
  width: 100%; padding: 14px 16px;
  font-family: var(--sans); font-size: 14px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 2px;
  transition: border-color .2s ease;
}
.ta { min-height: 120px; resize: vertical; font-family: var(--sans); }
.input:focus, .ta:focus, .sel:focus {
  outline: none; border-color: var(--ink);
}
.lbl {
  display: block;
  font-family: var(--mono); font-size: 10.5px;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 8px;
}

/* ════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════════════════════════════ */

/* Hamburger toggle — hidden by default, shown on mobile */
.nav-toggle {
  display: none;
  width: 44px; height: 44px;
  border: 1px solid var(--rule);
  background: transparent;
  border-radius: 999px;
  align-items: center; justify-content: center;
  cursor: pointer;
  padding: 0;
}
.nav-toggle .bars {
  position: relative;
  width: 16px; height: 12px;
}
.nav-toggle .bars::before,
.nav-toggle .bars::after,
.nav-toggle .bars span {
  content: "";
  position: absolute; left: 0; right: 0;
  height: 1.5px;
  background: var(--ink);
  transition: all .25s ease;
}
.nav-toggle .bars::before { top: 0; }
.nav-toggle .bars span { top: 50%; transform: translateY(-50%); }
.nav-toggle .bars::after { bottom: 0; }
.nav-toggle.open .bars::before { top: 50%; transform: translateY(-50%) rotate(45deg); }
.nav-toggle.open .bars::after { bottom: 50%; transform: translateY(50%) rotate(-45deg); }
.nav-toggle.open .bars span { opacity: 0; }

/* Mobile menu sheet */
.nav-sheet {
  display: none;
}

/* Tablet ─────────────────────────────────────────────────────────── */
@media (max-width: 980px) {
  .nav-links { gap: 16px; }
  .nav-link { font-size: 13px; }
  .nav-cta { padding: 9px 14px; font-size: 12.5px; }
}

/* Mobile ─────────────────────────────────────────────────────────── */
@media (max-width: 760px) {
  :root {
    --gutter: 20px;
  }

  body {
    /* Lighter background washes on mobile to save paint */
    background-image: none;
    background: var(--paper);
  }

  /* ── Nav ────────────────────────────────────── */
  .nav-row { height: 60px; }
  .nav-brand { gap: 10px; }
  .nav-brand img { height: 32px; }
  .nav-brand .nm { font-size: 14px; letter-spacing: 0.04em; }
  .nav-brand .tg { display: none; }
  .nav-links { display: none; }
  .nav-toggle { display: inline-flex; }

  .nav-sheet {
    display: block;
    position: fixed;
    top: 60px; left: 0; right: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--rule);
    box-shadow: 0 10px 30px oklch(0.18 0.008 70 / 0.10);
    transform: translateY(-110%);
    opacity: 0;
    transition: transform .35s cubic-bezier(.2,.7,.2,1), opacity .25s ease;
    z-index: 49;
    padding: 12px 20px 24px;
    pointer-events: none;
  }
  .nav-sheet.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
  .nav-sheet .ms-link {
    display: block;
    padding: 18px 4px;
    border-bottom: 1px solid var(--rule);
    font-family: var(--serif);
    font-weight: 300;
    font-variation-settings: "SOFT" 80, "opsz" 28;
    font-size: 24px;
    color: var(--ink);
    cursor: pointer;
    letter-spacing: -0.005em;
    display: flex; align-items: center; justify-content: space-between;
  }
  .nav-sheet .ms-link::after {
    content: "→";
    font-family: var(--mono);
    color: var(--ink-mute);
    font-size: 16px;
  }
  .nav-sheet .ms-link.active { color: var(--terracotta-d); }
  .nav-sheet .ms-cta {
    margin-top: 24px;
    width: 100%;
    padding: 16px;
    justify-content: center;
    font-size: 14px;
  }

  /* ── Section spacing ───────────────────────── */
  .section { padding: 56px 0; }
  .section-tight { padding: 40px 0; }

  /* ── Force all inline grid layouts to a single column ── */
  main [style*="grid-template-columns"],
  .modal [style*="grid-template-columns"],
  .foot [style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }
  /* Keep 4-button grids (amount / type pills) as 2-col */
  .modal [style*="repeat(4, 1fr)"],
  main [style*="repeat(4, 1fr)"] {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
  }
  /* Six-entries cards: keep 2-col so they scan as cards, not a long list */
  main section [style*="repeat(3, 1fr)"][style*="grid"] {
    /* default single column from above already applied */
  }

  /* ── Display & headlines: scale down on small screens ── */
  .display, h1, h2 {
    font-size: clamp(34px, 8.4vw, 56px) !important;
    line-height: 1.05 !important;
  }
  /* But honour explicit very-large clamp() heads via cap */
  .display[style*="clamp"] { font-size: clamp(34px, 8.4vw, 56px) !important; }

  /* Buttons: wider tap targets, can wrap */
  .btn, .btn-ghost, .btn-on-photo-primary, .btn-on-photo-ghost {
    padding: 14px 20px;
    font-size: 14px;
  }

  /* Hero: tighter vertical space, balanced text */
  main > section:first-child,
  section[style*="hero"],
  section[style*="rencontre"] {
    padding-top: 60px !important;
    padding-bottom: 70px !important;
  }

  /* Photos: cap aspect ratios on mobile so portrait shots don't dominate */
  .photo[style*="aspect-ratio: 4 / 5"],
  .photo[style*="aspect-ratio:4 / 5"] {
    aspect-ratio: 4 / 4 !important;
  }
  .photo[style*="aspect-ratio: 21 / 9"],
  .photo[style*="aspect-ratio:21 / 9"] {
    aspect-ratio: 16 / 10 !important;
  }

  /* Cards & padding */
  .card { padding: 22px !important; }

  /* Section-with-internal-grids that often used negative space ── */
  main [style*="padding: 32px 30px"],
  main [style*="padding: 44px 32px"],
  main [style*="padding: 42px 32px"],
  main [style*="padding: 40px 32px"],
  main [style*="padding: 36px 32px"] {
    padding: 24px 20px !important;
  }

  main [style*="padding: \"32px 30px\""],
  main [style*="42px 0"] {
    padding-block: 22px !important;
  }

  /* Tighten margins around stack-row patterns */
  main [style*="marginBottom: 70"],
  main [style*="margin-bottom: 70"] { margin-bottom: 36px !important; }
  main [style*="marginBottom: 60"],
  main [style*="margin-bottom: 60"] { margin-bottom: 32px !important; }
  main [style*="marginBottom: 90"] { margin-bottom: 40px !important; }
  main [style*="marginBottom: 50"] { margin-bottom: 28px !important; }
  main [style*="marginTop: 90"] { margin-top: 36px !important; }
  main [style*="marginTop: 56"] { margin-top: 28px !important; }
  main [style*="marginTop: 60"] { margin-top: 28px !important; }
  main [style*="marginTop: 50"] { margin-top: 24px !important; }
  main [style*="marginTop: 40"] { margin-top: 20px !important; }

  /* ── Footer ──────────────────────────────── */
  .foot { padding: 56px 0 28px; margin-top: 56px; }
  .foot > .wrap[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
    gap: 32px !important;
  }
  .foot > .wrap[style*="justify-content"]:last-of-type {
    gap: 16px !important;
  }
  .foot > .wrap > div > .display { font-size: 24px !important; }

  /* ── Modal ───────────────────────────────── */
  .modal-bd { padding: 0; align-items: flex-end; }
  .modal {
    padding: 24px 22px 30px;
    max-height: 92vh;
    overflow-y: auto;
    max-width: 100%;
    width: 100%;
    border-radius: 18px 18px 0 0;
    animation: slideUpMobile .35s cubic-bezier(.2,.7,.2,1);
  }
  .modal .display { font-size: 28px !important; }
  @keyframes slideUpMobile {
    from { transform: translateY(40px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
  }
  .modal-bd > .modal button[style*="top: 16px"] {
    /* The close button anchor */
  }

  /* ── Form fields larger ──────────────────── */
  .input, .ta, .sel {
    padding: 14px 14px;
    font-size: 16px; /* prevents iOS zoom */
  }

  /* ── Tweaks panel: keep at bottom on mobile ── */
  [data-tweaks-panel] {
    /* The starter component already handles this OK */
  }

  /* ── Reveal: skip translate on mobile for stability ── */
  .reveal.r-hidden { transform: none; }

  /* ── Hide certain heavy backgrounds (hero watermarks etc) ── */
  /* Keep the hero photo but ease the readability layer */

  /* Stack contact info block on contact page */
  main .input,
  main .ta,
  main .sel,
  main button[type="submit"] {
    width: 100%;
  }
}

/* Very small ─────────────────────────────────────────────────────── */
@media (max-width: 380px) {
  :root { --gutter: 16px; }
  .nav-brand .nm { font-size: 13px; }
  .display, h1, h2 {
    font-size: clamp(28px, 9vw, 48px) !important;
  }
  .modal { padding: 20px 16px 24px; }
  .modal .display { font-size: 24px !important; }
}
