/* RK Advisory — design system
   Palette, type and spacing per planning/framework-assessment.md and
   registry/context-profiles/personal-rk-advisory-website.yaml. Do not
   deviate from these values without noting the change as a proposal. */

:root {
  --color-bg: #F7F7F5;
  --color-text: #1A1A1A;
  --color-accent: #6A1F2B;
  --color-secondary: #2F3E34;
  --color-grey: #6B6B68;
  --color-footer-text: #E4E4E0;

  --font-heading: Georgia, "Times New Roman", serif;
  --font-body: "Aptos", "Calibri", "Segoe UI", system-ui, sans-serif;

  --max-width: 1120px;
  --gutter: 24px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
}

h1, h2, h3 {
  font-family: var(--font-heading);
  font-weight: 400;
  margin: 0 0 0.5em;
}

h1 { font-size: clamp(2.25rem, 5vw, 4.5rem); line-height: 1.1; }
h2 { font-size: clamp(1.75rem, 3vw, 2.5rem); line-height: 1.2; }
h3 {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1.15rem;
}

p { margin: 0 0 1.2em; }

a {
  color: var(--color-accent);
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-position: left bottom;
  background-size: 0 1px;
  transition: background-size 0.25s ease;
}
a:hover { background-size: 100% 1px; }

.subtext, small {
  color: var(--color-grey);
  font-size: 0.85rem;
}

.text-accent { color: var(--color-accent); }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---------------------------------------------------------------- */
/* Top navigation                                                    */
/* ---------------------------------------------------------------- */

.site-header {
  padding: 20px 0;
  border-bottom: 1px solid rgba(26, 26, 26, 0.08);
  background: var(--color-bg);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(26, 26, 26, 0);
  transition: box-shadow 0.2s ease;
}

.site-header.is-scrolled {
  box-shadow: 0 2px 8px rgba(26, 26, 26, 0.08);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.wordmark {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-family: var(--font-heading);
  font-size: 1.4rem;
  color: var(--color-text);
  line-height: 1;
}

.wordmark .wm-advisory {
  color: var(--color-text);
}

.wordmark .wm-logo {
  height: 1.6rem;
  width: auto;
}

/* Drawn rule rather than a literal "|" glyph — the pipe character in
   Georgia carries a descender and sat below the cap line. This box is
   sized to the cap height and bottom-aligns to the text baseline, so it
   matches the capitals exactly. */
.wordmark .wm-bar {
  align-self: baseline;
  width: 2px;
  height: 0.72em;
  background: var(--color-accent);
}

/* Brand reveal — runs once on load: the mark drops in, the bar grows from
   its base, "Advisory" wipes in left to right. Fast and one-shot, not a
   scroll effect. */
.wordmark .wm-logo {
  animation: wm-drop-in 0.5s ease-out both;
}

.wordmark .wm-bar {
  transform-origin: bottom;
  animation: wm-grow-up 0.4s ease-out 0.35s both;
}

.wordmark .wm-advisory {
  display: inline-block;
  animation: wm-wipe-in 0.6s ease-out 0.5s both;
}

@keyframes wm-drop-in {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes wm-grow-up {
  from { opacity: 0; transform: scaleY(0); }
  to   { opacity: 1; transform: scaleY(1); }
}

@keyframes wm-wipe-in {
  from { clip-path: inset(0 100% 0 0); }
  to   { clip-path: inset(0 0 0 0); }
}

@media (prefers-reduced-motion: reduce) {
  .wordmark .wm-logo,
  .wordmark .wm-bar,
  .wordmark .wm-advisory {
    animation: none;
  }
}

/* Set by an inline script in <head> once the reveal has played this
   session — stops it from replaying on every internal navigation. */
html.no-wm-anim .wordmark .wm-logo,
html.no-wm-anim .wordmark .wm-bar,
html.no-wm-anim .wordmark .wm-advisory {
  animation: none;
}

/* Narrow phones: the logo mark alone carries the brand — drop the bar and
   "Advisory" to keep the header uncluttered at this width. */
@media (max-width: 480px) {
  .wordmark .wm-bar,
  .wordmark .wm-advisory {
    display: none;
  }
}

/* ---------------------------------------------------------------- */
/* Page-load fade — plays on every full page load/navigation           */
/* ---------------------------------------------------------------- */

main {
  animation: page-fade-in 0.5s ease both;
}

@keyframes page-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  main { animation: none; }
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 32px;
  flex-wrap: wrap;
}

.main-nav ul {
  list-style: none;
  display: flex;
  gap: 28px;
  margin: 0;
  padding: 0;
}

.main-nav a {
  color: var(--color-text);
  font-size: 0.95rem;
  letter-spacing: 0.01em;
}

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

.lang-toggle {
  display: flex;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--color-grey);
}

.lang-toggle a {
  color: var(--color-grey);
}

.lang-toggle a[aria-current="true"] {
  color: var(--color-accent);
  font-weight: 600;
}

/* Mobile hamburger menu — pattern per guidecaisseenregistreuse */

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--color-text);
  border-radius: 1px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 760px) {
  .site-header .container { position: relative; }

  .nav-toggle { display: flex; }

  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
    background: var(--color-bg);
    border-bottom: 1px solid rgba(26, 26, 26, 0.08);
    padding: 20px var(--gutter) 28px;
  }

  .main-nav.is-open { display: flex; }

  .main-nav ul {
    flex-direction: column;
    gap: 16px;
    width: 100%;
  }
}

/* ---------------------------------------------------------------- */
/* Hero                                                               */
/* ---------------------------------------------------------------- */

.hero {
  padding-top: 14vh;
  padding-bottom: 8vh;
  text-align: center;
}

.hero h1 { margin-bottom: 0.3em; }

/* Static baseline correction lives on the wrapper, separately from the
   entrance animation's own transform on the image — the two can't share a
   transform without one clobbering the other (animation fill-mode "both"
   keeps its own final transform value). */
.hero-logo-wrap {
  display: inline-block;
  vertical-align: baseline;
  transform: translateY(0.217em);
}

.hero-logo {
  display: block;
  height: 1em;
  width: auto;
}

/* Drawn rule, cap-height, baseline-aligned — see .wordmark .wm-bar */
.hero-bar {
  display: inline-block;
  width: 3px;
  height: 0.7em;
  margin: 0 0.14em;
  background: var(--color-accent);
  vertical-align: baseline;
}

/* Brand reveal, same choreography as the header wordmark (.wordmark .wm-*)
   — logo drops in, the bar grows from its base, "Advisory" wipes in. Gated
   by the same once-per-session sessionStorage flag (html.no-wm-anim), set
   in base.njk's inline head script. */
.hero-logo {
  animation: wm-drop-in 0.5s ease-out both;
}

.hero-bar {
  transform-origin: bottom;
  animation: wm-grow-up 0.4s ease-out 0.35s both;
}

.hero-advisory {
  display: inline-block;
  animation: wm-wipe-in 0.6s ease-out 0.5s both;
}

@media (prefers-reduced-motion: reduce) {
  .hero-logo,
  .hero-bar,
  .hero-advisory {
    animation: none;
  }
}

html.no-wm-anim .hero-logo,
html.no-wm-anim .hero-bar,
html.no-wm-anim .hero-advisory {
  animation: none;
}

.hero .strapline {
  font-family: var(--font-heading);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.1rem, 2vw, 1.5rem);
  color: var(--color-grey);
  margin: 0 auto;
}

.positioning {
  max-width: 760px;
  margin: 0 auto;
  padding: 6vh var(--gutter);
  text-align: center;
  font-family: var(--font-heading);
  font-size: clamp(1.15rem, 1.6vw, 1.4rem);
  line-height: 1.6;
}

/* ---------------------------------------------------------------- */
/* Stats band (Accueil, just before the footer)                       */
/* ---------------------------------------------------------------- */

.stats-band {
  border-top: 1px solid rgba(26, 26, 26, 0.08);
  border-bottom: 1px solid rgba(26, 26, 26, 0.08);
  background: #F0F0EC;
}

.stats {
  display: flex;
  align-items: stretch;
  padding-top: 6vh;
  padding-bottom: 6vh;
}

.stat {
  flex: 1 1 0;
  padding: 0 24px;
  border-left: 1px solid rgba(26, 26, 26, 0.08);
}

.stat:first-child {
  padding-left: 0;
  border-left: none;
}

.stat-number {
  font-family: var(--font-heading);
  font-size: clamp(2.5rem, 4vw, 3.5rem);
  color: var(--color-accent);
  line-height: 1;
  margin: 0 0 0.25em;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.stat:hover .stat-number {
  transform: scale(1.05);
  filter: brightness(0.85);
}

.stat-label {
  font-weight: 600;
  margin: 0 0 0.2em;
}

.stat-sublabel {
  color: var(--color-grey);
  font-size: 0.85rem;
  margin: 0;
}

@media (max-width: 780px) {
  .stats { flex-direction: column; gap: 28px; }
  .stat {
    padding: 0;
    border-left: none;
  }
}

/* ---------------------------------------------------------------- */
/* Expertise grid (Accueil section 3, and Expertise page)             */
/* ---------------------------------------------------------------- */

.section { padding-top: 6vh; padding-bottom: 6vh; }

.section-title {
  text-align: center;
  margin-bottom: 1.5em;
}

.expertise-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px 48px;
}

@media (max-width: 720px) {
  .expertise-grid { grid-template-columns: 1fr; }
  .expertise-grid .expertise-block {
    padding-top: 28px;
    border-top: 1px solid rgba(26, 26, 26, 0.08);
  }
  .expertise-grid .expertise-block:first-child {
    padding-top: 0;
    border-top: none;
  }
}

.expertise-block h3 { margin-bottom: 0.4em; }
.roman { color: var(--color-accent); margin-right: 0.4em; }
.expertise-block a.read-more {
  font-size: 0.85rem;
  display: inline-block;
  margin-top: 0.4em;
}

/* Generic scroll-reveal utility — applied to repeating content blocks
   across every page (expertise blocks, missions, pillars, expertise-area
   sections, profile/contact columns), not just the homepage. */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ---------------------------------------------------------------- */
/* Approach pillars band                                              */
/* ---------------------------------------------------------------- */

.pillars-band {
  border-top: 1px solid rgba(26, 26, 26, 0.08);
  border-bottom: 1px solid rgba(26, 26, 26, 0.08);
  background: #F0F0EC;
}

.pillars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  padding-top: 6vh;
  padding-bottom: 6vh;
}

@media (max-width: 820px) {
  .pillars { grid-template-columns: 1fr; }
  .pillar {
    padding-top: 28px;
    border-top: 1px solid rgba(26, 26, 26, 0.08);
  }
  .pillar:first-child {
    padding-top: 0;
    border-top: none;
  }
}

.pillar h3 {
  color: var(--color-accent);
  margin-bottom: 0.5em;
}

/* ---------------------------------------------------------------- */
/* Representative missions                                            */
/* ---------------------------------------------------------------- */

.missions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px 48px;
}

@media (max-width: 720px) {
  .missions { grid-template-columns: 1fr; }
  .mission {
    padding-top: 28px;
    border-top: 1px solid rgba(26, 26, 26, 0.08);
  }
  .mission:first-child {
    padding-top: 0;
    border-top: none;
  }
}

.mission h3 {
  font-size: 1rem;
  color: var(--color-accent);
}

/* ---------------------------------------------------------------- */
/* Client recommendations (tombstone format)                          */
/* ---------------------------------------------------------------- */

.testimonials {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px 48px;
}

@media (max-width: 720px) {
  .testimonials { grid-template-columns: 1fr; }
}

.testimonial {
  margin: 0;
  padding-left: 20px;
  border-left: 2px solid var(--color-accent);
}

.testimonial blockquote {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 1.05rem;
  line-height: 1.55;
}

.testimonial figcaption {
  margin-top: 1em;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.85rem;
  color: var(--color-grey);
}

.testimonial-logo {
  display: block;
  height: 40px;
  max-width: 180px;
  width: auto;
  margin-bottom: 10px;
  object-fit: contain;
  object-position: left center;
  filter: grayscale(1);
  opacity: 0.85;
}

/* ---------------------------------------------------------------- */
/* Expertise detail page                                              */
/* ---------------------------------------------------------------- */

.expertise-area {
  padding-top: 5vh;
  padding-bottom: 5vh;
  border-top: 1px solid rgba(26, 26, 26, 0.08);
  background-color: rgba(106, 31, 43, 0);
  transition: background-color 1.2s ease;
}

.expertise-area.flash {
  background-color: rgba(106, 31, 43, 0.06);
}

.expertise-area h2 { margin-bottom: 0.6em; }
.expertise-area h4 {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-grey);
  margin: 1.4em 0 0.4em;
}

/* ---------------------------------------------------------------- */
/* Profile page                                                       */
/* ---------------------------------------------------------------- */

.profile-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 56px;
  align-items: start;
}

@media (max-width: 780px) {
  .profile-layout { grid-template-columns: 1fr; }
  .profile-layout > *:last-child {
    padding-top: 28px;
    border-top: 1px solid rgba(26, 26, 26, 0.08);
  }
}

.profile-photo {
  aspect-ratio: 3 / 4;
  background: #ECECE8;
  overflow: hidden;
}

.profile-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: grayscale(1);
}

.profile-name h2 { margin-bottom: 0.2em; }
.profile-titles {
  color: var(--color-grey);
  font-size: 0.95rem;
  margin-bottom: 1.5em;
}

.affiliations {
  margin-top: 4vh;
  padding-top: 2vh;
  border-top: 1px solid rgba(26, 26, 26, 0.08);
  font-size: 0.85rem;
  color: var(--color-grey);
}

.affiliations ul {
  padding-left: 1.2em;
  margin: 0 0 1.4em;
}

.affiliations ul:last-child { margin-bottom: 0; }

.affiliations p + p { margin-top: 1.4em; }

.affiliations .profile-langs { margin-top: 0.4em; }

/* Second and subsequent profiles on the page: generous vertical
   separation, no intermediate "L'équipe" heading — the juxtaposition
   carries the meaning (per the Meryem El Khatib integration brief). */
.profile-entry + .profile-entry {
  margin-top: clamp(72px, 12vw, 120px);
  padding-top: clamp(72px, 12vw, 120px);
  border-top: 1px solid rgba(107, 107, 104, 0.35);
}

/* ---------------------------------------------------------------- */
/* Contact page                                                       */
/* ---------------------------------------------------------------- */

.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
}

@media (max-width: 780px) {
  .contact-layout { grid-template-columns: 1fr; }
  .contact-layout > *:last-child {
    padding-top: 28px;
    border-top: 1px solid rgba(26, 26, 26, 0.08);
  }
}

.contact-details p { margin-bottom: 0.3em; }

.contact-form .fg {
  margin-bottom: 20px;
}

.contact-form label {
  display: block;
  font-size: 0.85rem;
  color: var(--color-grey);
  margin-bottom: 6px;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 10px 12px;
  border: 1px solid rgba(26, 26, 26, 0.2);
  border-radius: 2px;
  background: #fff;
  color: var(--color-text);
}

.contact-form textarea { min-height: 140px; resize: vertical; }

.contact-form .fg.has-error input,
.contact-form .fg.has-error textarea {
  border-color: var(--color-accent);
}

.contact-form .err-msg {
  display: none;
  color: var(--color-accent);
  font-size: 0.8rem;
  margin-top: 4px;
}

.contact-form .fg.has-error .err-msg { display: block; }

.honeypot { position: absolute; left: -9999px; }

/* intl-tel-input — vendored from guidecaisseenregistreuse's /devis/ pattern,
   restyled to the RK Advisory design system instead of its navy/red theme. */
.iti { width: 100%; }
.iti__flag { background-image: url("/assets/iti/img/flags.png"); }
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 2dppx) {
  .iti__flag { background-image: url("/assets/iti/img/flags@2x.png"); }
}
.iti input[type="tel"] {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 10px 12px 10px 52px;
  border: 1px solid rgba(26, 26, 26, 0.2);
  border-radius: 2px;
  background: #fff;
  color: var(--color-text);
}
.fg.has-error .iti input[type="tel"] { border-color: var(--color-accent); }

.btn-submit {
  background: var(--color-accent);
  color: #fff;
  border: none;
  padding: 12px 28px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  cursor: pointer;
  border-radius: 2px;
}

.btn-submit:disabled { opacity: 0.6; cursor: default; }

.notice { margin-top: 16px; font-size: 0.9rem; }
.notice.success { color: var(--color-secondary); }
.notice.error { color: var(--color-accent); }

.gdpr-notice {
  margin-top: 24px;
  font-size: 0.78rem;
  color: var(--color-grey);
}

/* ---------------------------------------------------------------- */
/* Footer                                                              */
/* ---------------------------------------------------------------- */

.site-footer {
  background: var(--color-secondary);
  color: var(--color-footer-text);
  padding: 6vh 0 4vh;
  margin-top: 8vh;
  font-size: 0.85rem;
  line-height: 1.7;
}

.site-footer a { color: var(--color-footer-text); text-decoration: underline; background-image: none; }
.site-footer p { margin: 0 0 0.6em; }

.footer-legal {
  margin-top: 2em;
  padding-top: 1.2em;
  border-top: 1px solid rgba(228, 228, 224, 0.2);
  font-size: 0.78rem;
  color: rgba(228, 228, 224, 0.8);
}

.footer-links {
  margin-top: 1em;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

/* ---------------------------------------------------------------- */
/* Plain content pages (legal, sitemap)                                */
/* ---------------------------------------------------------------- */

.prose { max-width: 760px; margin: 0 auto; padding: 8vh var(--gutter); }
.prose h1 { margin-bottom: 0.6em; }
.prose h2 { font-size: 1.4rem; margin-top: 1.4em; }
.tbd { background: rgba(106, 31, 43, 0.08); padding: 0 4px; }
