@import url("tokens.css");

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.65;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
ul[role="list"] { list-style: none; }

.container { width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 1.25rem; }
.section { padding: 3.5rem 0; }
.section-alt { background: color-mix(in srgb, var(--color-primary) 5%, var(--color-bg)); }

/* Visual placeholders */
.visual-placeholder {
  display: block; width: 100%; border-radius: 8px; aspect-ratio: 16/9;
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--color-primary) 22%, var(--color-bg)) 0%,
    color-mix(in srgb, var(--color-primary) 10%, var(--color-bg)) 55%,
    color-mix(in srgb, var(--color-secondary) 18%, var(--color-bg)) 100%);
}
.visual-placeholder[data-aspect="4:3"] { aspect-ratio: 4/3; }
.visual-placeholder[data-aspect="1:1"] { aspect-ratio: 1/1; }
.visual-placeholder[data-aspect="3:4"] { aspect-ratio: 3/4; }
.visual-placeholder[data-aspect="21:9"] { aspect-ratio: 21/9; }
.visual-placeholder[data-tone="secondary"] {
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--color-secondary) 22%, var(--color-bg)) 0%,
    color-mix(in srgb, var(--color-secondary) 10%, var(--color-bg)) 55%,
    color-mix(in srgb, var(--color-primary) 16%, var(--color-bg)) 100%);
}
.visual-placeholder[data-tone="accent"] {
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--color-accent) 22%, var(--color-bg)) 0%,
    color-mix(in srgb, var(--color-primary) 12%, var(--color-bg)) 60%,
    color-mix(in srgb, var(--color-secondary) 16%, var(--color-bg)) 100%);
}
.visual-placeholder[data-tone="muted"] {
  background: color-mix(in srgb, var(--color-text) 8%, var(--color-bg));
}

h1,h2,h3,h4 { font-family: var(--font-display); font-weight: 700; line-height: 1.25; color: var(--color-primary); }
h1 { font-size: clamp(1.75rem, 5vw, 2.75rem); margin-bottom: 1rem; }
h2 { font-size: clamp(1.4rem, 4vw, 2rem); margin-bottom: 1rem; }
h3 { font-size: clamp(1.1rem, 3vw, 1.35rem); margin-bottom: 0.5rem; }
p { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }
.accent { color: var(--color-accent); }

.btn { display: inline-block; padding: 0.8rem 1.75rem; border-radius: 6px; font-family: var(--font-display); font-weight: 700; font-size: 0.95rem; text-decoration: none; border: 2px solid transparent; transition: all 0.2s; white-space: nowrap; }
.btn-primary { background: var(--color-secondary); color: #fff; border-color: var(--color-secondary); }
.btn-primary:hover { background: color-mix(in srgb, var(--color-secondary) 85%, #000); }
.btn-secondary { background: transparent; color: var(--color-primary); border-color: var(--color-primary); }
.btn-secondary:hover { background: var(--color-primary); color: #fff; }

.site-header { position: sticky; top: 0; z-index: 100; background: var(--color-bg); box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.header-top { background: var(--color-primary); text-align: center; padding: 0.4rem 1rem; }
.header-phone { color: #fff; text-decoration: none; font-weight: 600; font-size: 0.9rem; font-family: var(--font-display); }
.header-phone:hover { color: var(--color-secondary); }

.site-nav { padding: 0 1.25rem; }
.nav-inner { display: flex; align-items: center; justify-content: space-between; max-width: 1100px; margin: 0 auto; height: 64px; }
.nav-logo img { display: block; }
.nav-toggle { display: flex; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 6px; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--color-primary); border-radius: 2px; transition: all 0.25s; }
.nav-menu { display: none; flex-direction: column; position: absolute; top: 100%; left: 0; right: 0; background: var(--color-bg); padding: 1rem 1.25rem; border-top: 2px solid var(--color-primary); box-shadow: 0 4px 12px rgba(0,0,0,.1); }
.nav-menu.is-open { display: flex; }
.nav-link { display: block; padding: 0.65rem 0; text-decoration: none; font-family: var(--font-display); font-weight: 600; font-size: 0.95rem; color: var(--color-primary); border-bottom: 1px solid color-mix(in srgb, var(--color-primary) 12%, transparent); }
.nav-link:hover { color: var(--color-secondary); }
.nav-cta { margin-top: 0.75rem; background: var(--color-secondary); color: #fff; border-radius: 6px; padding: 0.65rem 1.25rem; text-align: center; border-bottom: none; }
.nav-cta:hover { background: color-mix(in srgb, var(--color-secondary) 85%, #000); color: #fff; }

.hero { background: color-mix(in srgb, var(--color-primary) 5%, var(--color-bg)); padding: 3rem 0; }
.hero-inner { display: flex; flex-direction: column; gap: 2rem; }
.hero-sub { font-size: 1.05rem; color: color-mix(in srgb, var(--color-text) 80%, transparent); margin: 1rem 0 1.5rem; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 0.75rem; }

.section-intro { font-size: 1.05rem; margin-bottom: 2rem; }
.cards-grid { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
.card { background: var(--color-bg); border-radius: 10px; overflow: hidden; box-shadow: 0 2px 12px rgba(0,0,0,.07); padding: 0 0 1.25rem; }
.card .visual-placeholder { border-radius: 0; margin-bottom: 1rem; }
.card h3 { padding: 0 1.25rem; }
.card p { padding: 0 1.25rem; font-size: 0.95rem; }
.link-more { display: inline-block; padding: 0 1.25rem; margin-top: 0.75rem; font-weight: 600; color: var(--color-accent); text-decoration: none; font-size: 0.9rem; }
.link-more:hover { text-decoration: underline; }

.why-inner { display: flex; flex-direction: column; gap: 2rem; }
.why-list { list-style: none; display: flex; flex-direction: column; gap: 0.85rem; margin-bottom: 1.5rem; }
.why-list li { padding-left: 1.5rem; position: relative; }
.why-list li::before { content: "v"; position: absolute; left: 0; color: var(--color-secondary); font-weight: 700; }

.page-hero { background: var(--color-primary); color: #fff; padding: 2.5rem 0; }
.page-hero h1 { color: #fff; margin-bottom: 0.5rem; }
.page-hero p { color: color-mix(in srgb, #fff 85%, transparent); margin-bottom: 0; font-size: 1.05rem; }

.service-inner { display: flex; flex-direction: column; gap: 2rem; }
.service-content ul { padding-left: 1.5rem; margin-bottom: 1.5rem; }
.service-content ul li { margin-bottom: 0.4rem; }

.values-grid { display: grid; grid-template-columns: 1fr; gap: 1.25rem; margin-top: 1.5rem; }
.value-item { background: var(--color-bg); border-left: 4px solid var(--color-accent); padding: 1.25rem 1.25rem 1.25rem 1.5rem; border-radius: 0 8px 8px 0; }
.value-item h3 { color: var(--color-accent); margin-bottom: 0.4rem; font-size: 1rem; }
.value-item p { font-size: 0.95rem; margin: 0; }

.about-inner { display: flex; flex-direction: column; gap: 2rem; }

.gallery-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 2.5rem; }
.gallery-item { margin: 0; }
.gallery-item figcaption { font-size: 0.82rem; color: color-mix(in srgb, var(--color-text) 70%, transparent); margin-top: 0.4rem; }
.gallery-cta { text-align: center; }
.gallery-cta p { margin-bottom: 1rem; }

.contact-inner { display: flex; flex-direction: column; gap: 2.5rem; }
.contact-list { list-style: none; display: flex; flex-direction: column; gap: 1rem; margin-bottom: 1.5rem; }
.contact-list a { color: var(--color-accent); font-weight: 600; text-decoration: none; }
.contact-list a:hover { text-decoration: underline; }
.contact-form { display: flex; flex-direction: column; gap: 1rem; }
.form-group { display: flex; flex-direction: column; gap: 0.4rem; }
.form-group label { font-weight: 600; font-size: 0.9rem; color: var(--color-primary); }
.form-group input, .form-group select, .form-group textarea { padding: 0.7rem 1rem; border: 2px solid color-mix(in srgb, var(--color-primary) 25%, transparent); border-radius: 6px; font-family: var(--font-body); font-size: 0.95rem; color: var(--color-text); background: var(--color-bg); transition: border-color 0.2s; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: var(--color-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-accent) 20%, transparent); }
.form-rgpd { font-size: 0.8rem; color: color-mix(in srgb, var(--color-text) 65%, transparent); }

.legal-content h2 { font-size: 1.2rem; margin-top: 2rem; margin-bottom: 0.5rem; }
.legal-content h2:first-child { margin-top: 0; }
.legal-content a { color: var(--color-accent); }

.site-footer { background: var(--color-primary); color: #fff; padding: 3rem 0 1.5rem; }
.footer-grid { display: grid; grid-template-columns: 1fr; gap: 2rem; margin-bottom: 2rem; }
.footer-brand p { font-size: 0.9rem; color: color-mix(in srgb, #fff 80%, transparent); margin-top: 0.75rem; }
.footer-links h3, .footer-contact h3 { color: var(--color-secondary); font-size: 0.9rem; margin-bottom: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; }
.footer-links ul { display: flex; flex-direction: column; gap: 0.4rem; }
.footer-links a, .footer-contact a { color: color-mix(in srgb, #fff 85%, transparent); text-decoration: none; font-size: 0.9rem; }
.footer-links a:hover, .footer-contact a:hover { color: var(--color-secondary); }
.footer-contact p { font-size: 0.9rem; color: color-mix(in srgb, #fff 85%, transparent); margin-bottom: 0.4rem; }
.footer-bottom { border-top: 1px solid color-mix(in srgb, #fff 20%, transparent); padding-top: 1.25rem; text-align: center; font-size: 0.82rem; color: color-mix(in srgb, #fff 60%, transparent); }
.footer-bottom a { color: color-mix(in srgb, #fff 70%, transparent); text-decoration: none; }
.footer-bottom a:hover { color: var(--color-secondary); }

@media (min-width: 640px) {
  .cards-grid { grid-template-columns: repeat(2, 1fr); }
  .values-grid { grid-template-columns: repeat(2, 1fr); }
  .gallery-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ===== ANIMATIONS (template A — atelier technique sobre) ===== */
/* Focus-visible ring: always on, independent of motion preference */
:where(a.btn, a.nav-link, a.link-more, .header-phone, .footer-links a, .footer-contact a, .contact-list a):focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-accent) 40%, transparent);
  border-radius: 6px;
}

@media (prefers-reduced-motion: no-preference) {
  /* 1. Hero entry — slide-in diptych */
  .hero-text   { animation: apcHeroSlideL 640ms cubic-bezier(.22,1,.36,1) both; }
  .hero-visual { animation: apcHeroSlideR 640ms cubic-bezier(.22,1,.36,1) 100ms both; }
  @keyframes apcHeroSlideL {
    from { opacity: 0; transform: translate3d(-14px, 0, 0); }
    to   { opacity: 1; transform: translate3d(0, 0, 0); }
  }
  @keyframes apcHeroSlideR {
    from { opacity: 0; transform: translate3d(14px, 0, 0); }
    to   { opacity: 1; transform: translate3d(0, 0, 0); }
  }

  /* 2. Scroll-driven fade-up on rhythm elements (Chromium 115+).
     No fallback needed: outside @supports, elements stay fully visible. */
  @supports (animation-timeline: view()) {
    .card,
    .value-item,
    .why-inner > *,
    .service-inner > *,
    .about-inner > *,
    .gallery-item,
    .contact-inner > *,
    .legal-content > * {
      animation: apcFadeUp linear both;
      animation-timeline: view();
      animation-range: entry 10% cover 35%;
    }
  }
  @keyframes apcFadeUp {
    from { opacity: 0; transform: translate3d(0, 18px, 0); }
    to   { opacity: 1; transform: translate3d(0, 0, 0); }
  }

  /* 3. Card hover — lift + shadow + inner placeholder zoom */
  .card { transition: transform 260ms cubic-bezier(.22,1,.36,1), box-shadow 260ms ease; }
  .card:hover { transform: translateY(-4px); box-shadow: 0 12px 26px rgba(0,0,0,.10); }
  .card .visual-placeholder { transition: transform 500ms cubic-bezier(.22,1,.36,1); }
  .card:hover .visual-placeholder { transform: scale(1.035); }

  /* 4. Value-item hover — subtle slide + accent widen */
  .value-item { transition: transform 220ms ease, border-left-width 220ms ease, background 220ms ease; }
  .value-item:hover {
    transform: translateX(3px);
    border-left-width: 6px;
    background: color-mix(in srgb, var(--color-accent) 4%, var(--color-bg));
  }

  /* 5. Primary button — light sweep on hover (artisan "coup de brosse") */
  .btn-primary { position: relative; overflow: hidden; isolation: isolate; }
  .btn-primary::after {
    content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
    background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.30) 50%, transparent 70%);
    transform: translateX(-110%);
    transition: transform 550ms cubic-bezier(.22,1,.36,1);
  }
  .btn-primary:hover::after,
  .btn-primary:focus-visible::after { transform: translateX(110%); }

  /* 6. Nav-link — animated underline (desktop nav) */
  @media (min-width: 900px) {
    .nav-link:not(.nav-cta) {
      background-image: linear-gradient(var(--color-accent), var(--color-accent));
      background-size: 0% 2px;
      background-position: 50% calc(100% - 2px);
      background-repeat: no-repeat;
      transition: background-size 260ms cubic-bezier(.22,1,.36,1), color 200ms ease;
    }
    .nav-link:not(.nav-cta):hover,
    .nav-link:not(.nav-cta)[aria-current="page"] { background-size: 65% 2px; }
  }
}

/* Reduced-motion safety — WCAG 2.3.3 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
@media (min-width: 900px) {
  .nav-toggle { display: none; }
  .nav-menu { display: flex !important; flex-direction: row; position: static; background: none; padding: 0; border: none; box-shadow: none; gap: 0.25rem; align-items: center; }
  .nav-link { padding: 0.5rem 0.75rem; border-bottom: none; border-radius: 6px; font-size: 0.9rem; }
  .nav-cta { margin-top: 0; padding: 0.5rem 1.25rem; }
  .hero { padding: 5rem 0; }
  .hero-inner { flex-direction: row; align-items: center; gap: 3rem; }
  .hero-inner > * { flex: 1; }
  .why-inner { flex-direction: row; align-items: flex-start; gap: 3rem; }
  .why-inner > * { flex: 1; }
  .cards-grid { grid-template-columns: repeat(3, 1fr); }
  .service-inner { flex-direction: row; align-items: flex-start; }
  .service-inner--reverse { flex-direction: row-reverse; }
  .service-visual { flex: 0 0 42%; }
  .service-content { flex: 1; }
  .about-inner { flex-direction: row; align-items: flex-start; gap: 3rem; }
  .about-inner > * { flex: 1; }
  .contact-inner { flex-direction: row; align-items: flex-start; }
  .contact-info { flex: 0 0 42%; }
  .contact-form-wrap { flex: 1; }
  .footer-grid { grid-template-columns: 2fr 1fr 1fr; }
}
