/* ============================================================
   Trade3online — warm earth editorial
   ============================================================ */

:root {
  --bg: #f5efe4;
  --bg-2: #efe6d6;
  --paper: #fbf7ee;
  --ink: #2b1e14;
  --ink-soft: #4a3a2c;
  --ink-mute: #6d5c4b;
  --rule: #d8cbb6;
  --accent: #c25a37;
  --accent-ink: #a4462a;
  --on-accent: #ffffff;
  --secondary: #6a7a4a;
  --accent-soft: #f0dfd0;
  --shadow: 0 1px 2px rgba(43, 30, 20, 0.06), 0 12px 28px -18px rgba(43, 30, 20, 0.35);
  --maxw: 1240px;
  --pad: clamp(20px, 5vw, 72px);
  --font-display: "Fraunces", "Cormorant Garamond", Georgia, serif;
  --font-body: "DM Sans", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #17130f;
    --bg-2: #1e1913;
    --paper: #211b15;
    --ink: #f3ead9;
    --ink-soft: #dccfba;
    --ink-mute: #b3a48d;
    --rule: #3b3126;
    --accent: #e08a63;
    --accent-ink: #eda37f;
    --on-accent: #2b1e14;
    --secondary: #9aab77;
    --accent-soft: #33251c;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 12px 28px -18px rgba(0, 0, 0, 0.8);
  }
}

:root[data-theme="dark"] {
  --bg: #17130f;
  --bg-2: #1e1913;
  --paper: #211b15;
  --ink: #f3ead9;
  --ink-soft: #dccfba;
  --ink-mute: #b3a48d;
  --rule: #3b3126;
  --accent: #e08a63;
  --accent-ink: #eda37f;
  --on-accent: #2b1e14;
  --secondary: #9aab77;
  --accent-soft: #33251c;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 12px 28px -18px rgba(0, 0, 0, 0.8);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  min-height: 100vh;
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

/* ---------- grain overlay ---------- */
.noise-field {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.055;
  mix-blend-mode: multiply;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .noise-field { mix-blend-mode: screen; opacity: 0.05; }
}
:root[data-theme="dark"] .noise-field { mix-blend-mode: screen; opacity: 0.05; }

/* ---------- shared container ---------- */
.wrap {
  position: relative;
  z-index: 1;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--pad);
}

/* ---------- header ---------- */
.site-head {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}
.site-head .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 68px;
  flex-wrap: wrap;
}

.brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.15rem, 1rem + 0.6vw, 1.4rem);
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
  display: inline-flex;
  align-items: baseline;
  gap: 0.4rem;
  font-variation-settings: "SOFT" 40, "WONK" 1;
}
.brand .brand-dot {
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
  translate: 0 -0.12em;
}

.head-tools {
  display: flex;
  align-items: center;
  gap: clamp(0.35rem, 1.5vw, 1.1rem);
}

.nav-link {
  font-size: 0.9rem;
  color: var(--ink-soft);
  text-decoration: none;
  padding: 0.6rem 0.4rem;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  border-bottom: 1.5px solid transparent;
  transition: color 0.18s ease, border-color 0.18s ease;
}
.nav-link:hover { color: var(--accent-ink); border-bottom-color: var(--accent); }

.theme-toggle {
  appearance: none;
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 999px;
  color: var(--ink);
  width: 44px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
.theme-toggle:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}

/* ---------- sections ---------- */
section { padding-block: clamp(64px, 9vw, 120px); }

.section-head {
  margin-bottom: clamp(2rem, 4vw, 3.25rem);
  max-width: 62ch;
}
.section-num {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  color: var(--accent-ink);
  margin-bottom: 0.7rem;
}
.section-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.75rem, 1.2rem + 2.2vw, 2.9rem);
  line-height: 1.1;
  letter-spacing: -0.025em;
  margin: 0 0 0.6rem;
  font-variation-settings: "SOFT" 40, "WONK" 1;
  text-wrap: balance;
}
.section-note {
  display: block;
  font-size: 0.95rem;
  color: var(--ink-mute);
  margin: 0;
}

/* ---------- hero ---------- */
.hero { padding-block: clamp(40px, 6vw, 84px) clamp(64px, 9vw, 110px); }
.hero .wrap {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: clamp(32px, 5vw, 80px);
  align-items: center;
  min-height: min(78vh, 760px);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin: 0 0 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
}
.eyebrow::before {
  content: "";
  width: 2rem;
  height: 1.5px;
  background: var(--accent);
  display: inline-block;
  flex: none;
}

h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.3rem, 1.5rem + 4.4vw, 4.4rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
  margin: 0 0 1.4rem;
  font-variation-settings: "SOFT" 50, "WONK" 1;
  text-wrap: balance;
}
h1 span { display: block; }
h1 span:nth-child(2) { font-style: italic; font-weight: 400; color: var(--accent-ink); }

.hero-lede {
  font-size: clamp(1.02rem, 0.98rem + 0.3vw, 1.15rem);
  color: var(--ink-soft);
  max-width: 52ch;
  margin: 0 0 2rem;
  text-wrap: pretty;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  align-items: center;
}

.btn {
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  padding: 0.85rem 1.5rem;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 1.5px solid var(--ink);
  border-radius: 2px;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
.btn:hover { background: var(--ink); color: var(--bg); }
.btn--solid { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn--solid:hover { background: var(--accent-ink); border-color: var(--accent-ink); color: var(--on-accent); }

.hero-figure { margin: 0; }
.hero-figure img {
  width: 100%;
  height: 100%;
  max-height: 720px;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 3px;
}
.hero-figure figcaption {
  font-size: 0.8rem;
  color: var(--ink-mute);
  margin-top: 0.7rem;
}

/* ---------- catalogue ---------- */
.rayons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(20px, 3vw, 36px);
}

.rayon {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: clamp(24px, 3vw, 40px);
  box-shadow: var(--shadow);
}
.rayon--wide { grid-column: 1 / -1; }

.rayon .tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-ink);
  margin-bottom: 0.9rem;
}
.rayon h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.3rem, 1.1rem + 0.8vw, 1.75rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 0.9rem;
  font-variation-settings: "SOFT" 40, "WONK" 1;
}
.rayon p {
  margin: 0 0 0.9rem;
  color: var(--ink-soft);
  max-width: 62ch;
}
.rayon p:last-child { margin-bottom: 0; }

/* photo cards */
.rayon--photo { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.rayon--photo img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}
.rayon--photo .card-body { padding: clamp(20px, 2.6vw, 32px); }
.rayon--photo .card-body p { font-size: 0.95rem; color: var(--ink-mute); }

/* ---------- commander (index dépliable) ---------- */
.index-list {
  border-top: 1px solid var(--rule);
}

.entry { border-bottom: 1px solid var(--rule); }

.entry > summary {
  list-style: none;
  cursor: pointer;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: baseline;
  gap: clamp(0.8rem, 2.5vw, 1.8rem);
  padding: clamp(1.1rem, 2.4vw, 1.5rem) 0;
  min-height: 44px;
  transition: color 0.18s ease;
}
.entry > summary::-webkit-details-marker { display: none; }
.entry > summary:hover { color: var(--accent-ink); }
.entry > summary:hover .entry-title { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }

.entry-num {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--ink-mute);
}
.entry-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.15rem, 1rem + 0.9vw, 1.6rem);
  letter-spacing: -0.02em;
  line-height: 1.2;
  font-variation-settings: "SOFT" 40, "WONK" 1;
}
.entry-meta {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-mute);
  display: none;
}
@media (min-width: 720px) { .entry-meta { display: block; } }

.entry-plus {
  font-family: var(--font-body);
  font-size: 1.2rem;
  line-height: 1;
  color: var(--accent-ink);
  transition: rotate 0.22s ease;
  display: inline-block;
  width: 1.1rem;
  text-align: center;
}
.entry[open] .entry-plus { rotate: 45deg; }

.entry-body {
  padding: 0 0 clamp(1.5rem, 3vw, 2.2rem);
  max-width: 70ch;
  animation: openIn 0.3s ease both;
}
@keyframes openIn {
  from { opacity: 0; translate: 0 -6px; }
  to { opacity: 1; translate: 0 0; }
}
.entry-body p { margin: 0 0 0.9rem; color: var(--ink-soft); }
.entry-body p:last-child { margin-bottom: 0; }
.entry-body ul {
  margin: 0 0 0.9rem;
  padding-left: 1.15rem;
  color: var(--ink-soft);
}
.entry-body li { margin-bottom: 0.4rem; }
.entry-body li::marker { color: var(--accent); }
.entry-body strong { color: var(--ink); font-weight: 600; }

/* ---------- contact ---------- */
.contact {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
}
.contact-copy p { color: var(--ink-soft); margin: 0 0 1.1rem; max-width: 52ch; }

.contact-list {
  list-style: none;
  padding: 0;
  margin: 2rem 0 0;
  font-size: 0.95rem;
}
.contact-list li {
  padding: 0.85rem 0;
  border-top: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.contact-list li:last-child { border-bottom: 1px solid var(--rule); }
.contact-list span:first-child {
  color: var(--ink-mute);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding-top: 0.2rem;
}

form {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: clamp(24px, 3vw, 40px);
  box-shadow: var(--shadow);
}

.field { margin-bottom: 1.15rem; }
.field label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 0.45rem;
}
.field input,
.field textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 0.75rem 0.85rem;
  min-height: 44px;
}
.field textarea { min-height: 8rem; resize: vertical; }
.field input:focus-visible,
.field textarea:focus-visible,
.btn:focus-visible,
.theme-toggle:focus-visible,
.entry > summary:focus-visible,
a:focus-visible {
  outline: 2.5px solid var(--accent);
  outline-offset: 3px;
}

.form-status {
  font-size: 0.9rem;
  margin: 1rem 0 0;
  color: var(--accent-ink);
}

/* ---------- placeholder fill-ins ---------- */
.ph {
  background: var(--accent-soft);
  border-bottom: 1.5px dotted var(--accent);
  padding: 0 0.15em;
  font-style: normal;
  color: var(--ink-soft);
}

/* ---------- footer ---------- */
.site-foot {
  border-top: 1px solid var(--rule);
  background: var(--bg-2);
}
.site-foot .wrap {
  padding-block: clamp(32px, 4vw, 48px);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.88rem;
  color: var(--ink-mute);
}

/* ---------- gentle fade + rise on scroll enter ---------- */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .reveal {
      animation: fadeRise linear both;
      animation-timeline: view();
      animation-range: entry 0% cover 25%;
    }
    @keyframes fadeRise {
      from { opacity: 0; translate: 0 12px; }
      to { opacity: 1; translate: 0 0; }
    }
  }
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .hero .wrap { grid-template-columns: 1fr; min-height: 0; }
  .hero-figure img { aspect-ratio: 16 / 11; max-height: none; }
  .rayons { grid-template-columns: 1fr; }
  .contact { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .site-head .wrap { min-height: 60px; }
  .nav-link { font-size: 0.85rem; padding-inline: 0.25rem; }
  .entry > summary { grid-template-columns: auto 1fr auto; }
  .entry-meta { display: none; }
  .contact-list li { flex-direction: column; gap: 0.2rem; }
}

/* ---------- attribution (free tier) ---------- */
.attribution {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 0.9rem 1rem 1.4rem;
  font-size: 0.78rem;
  color: var(--ink-mute);
  background: var(--bg-2);
}
.attribution a { color: var(--ink-mute); text-decoration: none; }
.attribution a:hover { text-decoration: underline; }

@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;
  }
}
