/* ============================================================
   RACHID SALON — Architectural Minimalist
   Design tokens from DESIGN.md
   ============================================================ */
:root {
  --surface: #f9f9f9;
  --white: #ffffff;
  --black: #000000;
  --ink: #1a1c1c;
  --on-variant: #4c4546;
  --gray: #707070;
  --bone: #f5f5f5;
  --line: #d1d1d1;
  --outline-variant: #cfc4c5;

  /* Footer stripe palette (from reference image page_2) */
  --pal-orange: #c1441c;
  --pal-olive: #b6bd67;
  --pal-teal: #1a8ca3;
  --pal-brown: #2a2521;

  --font-head: 'Montserrat', Arial, sans-serif;
  --font-body: 'Inter', Helvetica, Arial, sans-serif;

  --max: 1280px;
  --edge: 64px;
  --gutter: 32px;
  --section: 128px;
}

/* ---------- Dark mode (palette from reference image page_1) ----------
   Default follows the OS/browser setting; the header toggle pins an
   explicit choice via [data-theme] on <html> (persisted in localStorage).
   All components reference these tokens, so invert states keep working. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --surface: #161616;
  --white: #161616;   /* inverted "paper": mattes, hover fills */
  --black: #ffffff;   /* inverted "ink": borders, rules, buttons */
  --ink: #ffffff;
  --on-variant: #a8a8a8;
  --gray: #9a9a9a;
  --bone: #1f1f1f;
  --line: #3a3a3a;
  --outline-variant: #4a4546;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --surface: #161616;
    --white: #161616;
    --black: #ffffff;
    --ink: #ffffff;
    --on-variant: #a8a8a8;
    --gray: #9a9a9a;
    --bone: #1f1f1f;
    --line: #3a3a3a;
    --outline-variant: #4a4546;
  }
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 24px;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--black); outline-offset: 4px; }
ul { list-style: none; }
::selection { background: var(--black); color: var(--white); }
.container { max-width: var(--max); margin: 0 auto; padding-left: var(--edge); padding-right: var(--edge); }

/* ---------- Typography ---------- */
.display { font-family: var(--font-head); font-weight: 700; font-size: 80px; line-height: 90px; letter-spacing: -0.02em; text-transform: uppercase; }
.headline-lg { font-family: var(--font-head); font-weight: 600; font-size: 48px; line-height: 56px; letter-spacing: -0.01em; text-transform: uppercase; }
.headline-md { font-family: var(--font-head); font-weight: 500; font-size: 24px; line-height: 32px; letter-spacing: 0.02em; }
.body-lg { font-size: 18px; line-height: 28px; font-weight: 400; }
.body-md { font-size: 16px; line-height: 24px; }
.label-caps, .eyebrow { font-size: 12px; font-weight: 600; line-height: 16px; letter-spacing: 0.15em; text-transform: uppercase; }
.eyebrow { color: var(--gray); }

.rule { display: block; width: 72px; height: 4px; background: var(--black); }
.rule-center { margin-left: auto; margin-right: auto; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 12px; font-weight: 600; letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--black);
  background: transparent;
  border: 1px solid var(--black);
  border-radius: 0;
  padding: 16px 40px;
  cursor: pointer;
  transition: background .2s ease, color .2s ease;
  text-align: center;
  white-space: nowrap;
}
.btn:hover, .btn:focus-visible { background: var(--black); color: var(--white); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--surface);
  border-bottom: 1px solid var(--black);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 32px; height: 88px; }
.brand { font-family: var(--font-head); font-weight: 700; font-size: 20px; letter-spacing: 0.02em; white-space: nowrap; }
.site-nav { display: flex; gap: 48px; }
.site-nav a { font-size: 12px; font-weight: 600; letter-spacing: 0.15em; padding-bottom: 2px; border-bottom: 1px solid transparent; transition: border-color .2s ease; }
.site-nav a:hover { border-bottom-color: var(--black); }
.header-actions { display: flex; align-items: center; gap: 16px; }
.theme-toggle {
  width: 40px; height: 40px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: none; color: var(--black);
  border: 1px solid var(--black); border-radius: 0;
  cursor: pointer; transition: background .2s ease, color .2s ease;
}
.theme-toggle:hover { background: var(--black); color: var(--white); }
.theme-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
/* Responsive icon: moon in light mode, sun in dark mode */
.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; }
}
.nav-toggle { display: none; background: none; border: 0; cursor: pointer; width: 40px; height: 40px; position: relative; }
.nav-toggle span { position: absolute; left: 8px; right: 8px; height: 2px; background: var(--black); }
.nav-toggle span:first-child { top: 15px; }
.nav-toggle span:last-child { bottom: 15px; }

/* ---------- Hero ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 7fr) auto minmax(0, 4fr);
  gap: var(--gutter);
  align-items: center;
  padding-top: 96px;
  padding-bottom: var(--section);
}
.hero .rule { margin: 40px 0 32px; }
.hero-line { font-style: italic; text-transform: uppercase; letter-spacing: 0.04em; color: var(--on-variant); font-size: 18px; line-height: 28px; }
.hero-line + .hero-line { margin-top: 16px; }
.hero-vertical {
  writing-mode: vertical-rl;
  font-size: 12px; font-weight: 600; letter-spacing: 0.35em; text-transform: uppercase;
  color: var(--gray);
  justify-self: center;
}
.hero-figure { justify-self: end; width: 100%; max-width: 420px; }
.frame, .work-frame {
  display: block;
  background: var(--white);
  border: 1px solid var(--black);
  padding: 16px;
}
.hero-figure img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; filter: grayscale(1) contrast(1.05); }

/* ---------- Sections ---------- */
.section { padding-top: var(--section); }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 32px;
  border-bottom: 1px solid var(--black);
  padding-bottom: 24px;
  margin-bottom: 72px;
}
.section-head .gallery-count { color: var(--gray); font-size: 12px; font-weight: 600; letter-spacing: 0.15em; text-transform: uppercase; white-space: nowrap; }

/* ---------- Works ---------- */
.works-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gutter); }
.work-frame { transition: background .25s ease; }
.work-frame:hover { background: var(--bone); }
.work-frame img { width: 100%; }
.work:nth-child(3n+2) { margin-top: 64px; }
.work-meta { display: flex; justify-content: space-between; align-items: baseline; margin-top: 16px; }
.work-title { font-size: 12px; font-weight: 600; letter-spacing: 0.15em; text-transform: uppercase; }
.work-num { font-size: 12px; font-weight: 500; letter-spacing: 0.15em; color: var(--gray); }
.works-empty { color: var(--gray); }
/* "Show more": extras are only hidden when JS is on (no-JS shows everything);
   the button itself is revealed by JS only when extras exist. */
.js .work-extra:not(.is-shown) { display: none; }
.works-more { display: none; margin-top: 64px; text-align: center; }
.js .works-more.is-available { display: block; }
/* ---------- Studio ---------- */
.studio { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 64px; }
.studio-lede { border-left: 1px solid var(--black); padding-left: 32px; align-self: start; }
.studio-lede .headline-md { margin-top: 24px; }
.studio-body .body-lg { max-width: 62ch; }
.hairline-light { border: 0; border-top: 1px solid var(--line); margin: 48px 0; }
.features { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
.feature h3 { margin-bottom: 12px; }
.feature p { color: var(--on-variant); }

/* ---------- Contact ---------- */
.contact { padding-bottom: var(--section); }
.contact-info { max-width: 640px; }
.contact .headline-lg { margin: 24px 0 32px; }
.contact-detail { margin-top: 48px; }
.contact-detail dt { font-size: 12px; font-weight: 600; letter-spacing: 0.15em; text-transform: uppercase; color: var(--gray); margin-top: 24px; }
.contact-detail dd { font-size: 16px; margin-top: 8px; }
.contact-detail a { border-bottom: 1px solid var(--line); transition: border-color .2s ease; }
.contact-detail a:hover { border-bottom-color: var(--black); }

/* ---------- Footer ---------- */
.site-footer { padding: 0 0 48px; text-align: center; }
/* Color stripe band (palette from reference image page_2) — replaces the old 2px top rule */
.footer-palette { display: flex; height: 12px; margin-bottom: 96px; }
.footer-palette span { flex: 1; }
.footer-palette span:nth-child(1) { background: var(--pal-orange); }
.footer-palette span:nth-child(2) { background: var(--pal-olive); }
.footer-palette span:nth-child(3) { background: var(--pal-teal); }
.footer-palette span:nth-child(4) { background: var(--pal-brown); }

/* ---------- Floating WhatsApp button ---------- */
.whatsapp-float {
  position: fixed; right: 24px; bottom: 24px; z-index: 60;
  width: 56px; height: 56px;
  display: flex; align-items: center; justify-content: center;
  background: var(--black); color: var(--white);
  border: 1px solid var(--black); border-radius: 0;
  transition: background .2s ease, color .2s ease;
}
.whatsapp-float:hover { background: var(--white); color: var(--black); }
.whatsapp-float svg { width: 28px; height: 28px; }
.footer-name { font-family: var(--font-head); font-weight: 700; font-size: 24px; letter-spacing: 0.02em; }
.site-footer .rule { margin: 24px auto; }
.footer-tag { font-size: 12px; font-weight: 600; letter-spacing: 0.3em; text-transform: uppercase; color: var(--gray); }
.footer-cols { display: flex; justify-content: center; gap: 128px; flex-wrap: wrap; margin: 72px 0; }
.footer-col h3 { margin-bottom: 20px; }
.footer-col p, .footer-col a { font-size: 14px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--on-variant); line-height: 28px; }
.footer-col a:hover { text-decoration: underline; text-underline-offset: 4px; }
.footer-legal { max-width: 720px; margin: 0 auto; border-top: 1px solid var(--line); padding-top: 40px; }
.copyright { font-size: 11px; font-weight: 500; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gray); }

/* ---------- Reveal (progressive enhancement) ---------- */
.js .reveal { opacity: 0; transform: translateY(20px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .hero { grid-template-columns: minmax(0, 1fr) auto; }
  .hero-figure { grid-column: 1 / -1; justify-self: center; margin-top: 48px; }
  .hero-vertical { grid-column: 2; grid-row: 1; }
  .works-grid { grid-template-columns: repeat(2, 1fr); }
  .work:nth-child(3n+2) { margin-top: 0; }
  .work:nth-child(2n) { margin-top: 64px; }
  .studio { grid-template-columns: 1fr; gap: 64px; }
}
@media (max-width: 860px) {
  .site-nav {
    display: none;
    position: absolute; top: 88px; left: 0; right: 0;
    flex-direction: column; gap: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--black);
    padding: 8px var(--edge) 24px;
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 16px 0; border-bottom: 1px solid var(--line); }
  .site-nav a:last-child { border-bottom: 0; }
  .nav-toggle { display: block; }
  .btn-book { display: none; }
}
@media (max-width: 768px) {
  :root { --edge: 24px; --section: 88px; }
  .display { font-size: 48px; line-height: 52px; }
  .headline-lg { font-size: 32px; line-height: 40px; }
  .hero { grid-template-columns: 1fr; padding-top: 64px; }
  .hero-vertical { display: none; }
  .works-grid { grid-template-columns: 1fr; }
  .work:nth-child(2n) { margin-top: 0; }
  .features { grid-template-columns: 1fr; }
  .section-head { flex-direction: column; gap: 12px; margin-bottom: 48px; }
  .footer-cols { gap: 48px; }
}
