/* ==========================================================================
   Au Rocher salin — stylesheet
   Order: tokens → reset → base → layout → hero/crossfade → responsive
   ========================================================================== */

/* ---- fonts ---- */
@font-face {
  font-family: "Fraunces";
  src: url("/assets/fonts/Fraunces-Variable.woff2") format("woff2-variations"),
       url("/assets/fonts/Fraunces-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/Inter-Variable.woff2") format("woff2-variations"),
       url("/assets/fonts/Inter-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ---- tokens ---- */
:root {
  --rs-cream:      #f3ede3;
  --rs-tan:        #c8b88a;
  --rs-ochre:      #6b5d3e;
  --rs-forest:     #3c5238;
  --rs-ink:        #2b2a1f;
  --rs-white:      #ffffff;
  --rs-scrim:      rgba(0, 0, 0, 0.75);

  --rs-font-serif: "Fraunces", Georgia, "Times New Roman", serif;
  --rs-font-sans:  "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  --rs-pad-x:      clamp(24px, 5vw, 72px);
  --rs-pad-y:      clamp(20px, 3vw, 32px);
}

/* ---- reset ---- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--rs-ink);
  color: var(--rs-white);
  font-family: var(--rs-font-sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100dvh;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }

/* ---- base typography ---- */
h1, h2, h3, p { margin: 0; }
.brand,
.title {
  font-family: var(--rs-font-serif);
  font-weight: 400;
  font-style: normal;
  letter-spacing: -0.015em;
  font-variation-settings: "opsz" 144, "SOFT" 50;
}
.tag,
.lang-toggle,
.cta,
.hero-footer,
.copyright { font-family: var(--rs-font-sans); }

/* ---- layout: hero container ---- */
.hero {
  position: relative;
  width: 100%;
  min-height: 100dvh;
  overflow: hidden;
  background: var(--rs-ink);
}

.hero-photo {
  position: absolute;
  inset: 0;
  z-index: 1;
}
.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.72);
}

.hero-scrim {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.18) 0%, rgba(0, 0, 0, 0) 22%, rgba(0, 0, 0, 0) 50%, rgba(0, 0, 0, 0.78) 100%);
  pointer-events: none;
}

/* ---- top bar ---- */
.hero-top {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--rs-pad-y) var(--rs-pad-x);
  color: var(--rs-white);
}
.hero-top .brand {
  font-size: clamp(15px, 1.6vw, 19px);
  font-style: italic;
  letter-spacing: 0;
}
.lang-toggle {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 2px;
}
.lang-toggle a {
  opacity: 0.55;
  transition: opacity 0.2s ease;
  padding: 10px 10px;
}
.lang-toggle a:hover,
.lang-toggle a:focus-visible {
  opacity: 1;
}
.lang-toggle a.active {
  opacity: 1;
  font-weight: 500;
}

/* ---- editorial anchor (bottom-left) ---- */
.hero-anchor {
  position: absolute;
  left: var(--rs-pad-x);
  right: var(--rs-pad-x);
  bottom: clamp(80px, 14vh, 140px);
  z-index: 3;
  max-width: 640px;
  color: var(--rs-white);
}
.hero-anchor .tag {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.85;
  margin-bottom: 14px;
}
.hero-anchor .title {
  font-size: clamp(44px, 8vw, 88px);
  line-height: 1;
  margin-bottom: 16px;
}
.hero-anchor .tagline {
  font-family: var(--rs-font-serif);
  font-style: italic;
  font-size: clamp(16px, 2.2vw, 22px);
  line-height: 1.35;
  opacity: 0.92;
  margin-bottom: 26px;
  max-width: 32ch;
}
.cta {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 26px;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  border: 1px solid currentColor;
  border-radius: 2px;
  color: var(--rs-white);
  background: transparent;
  transition: background 0.2s ease, color 0.2s ease;
}
.cta:hover,
.cta:focus-visible {
  background: var(--rs-white);
  color: var(--rs-ink);
}
.cta .arrow { display: inline-block; transition: transform 0.2s ease; }
.cta:hover .arrow { transform: translateX(3px); }

/* ---- footer ---- */
.hero-footer {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: clamp(14px, 2vw, 22px) var(--rs-pad-x);
  color: var(--rs-white);
  font-size: 11px;
  letter-spacing: 0.06em;
}
.hero-footer a,
.hero-footer .copyright {
  color: rgba(255, 255, 255, 0.78);
  transition: color 0.2s ease;
}
.hero-footer a:hover,
.hero-footer a:focus-visible {
  color: var(--rs-white);
}
.social {
  display: flex;
  gap: 14px;
  align-items: center;
}
.social a {
  display: inline-flex;
  align-items: center;
  padding: 8px;
}
.citq {
  display: inline-block;
  padding: 6px 0;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

/* ---- focus-visible defaults ---- */
a:focus-visible,
button:focus-visible {
  outline: 1px solid var(--rs-white);
  outline-offset: 3px;
}

/* ---- hero photo crossfade ----
   3 photos, 21s cycle, 7s stride. Each photo is "on" for 9s:
     - 0..2s  fade in
     - 2..7s  fully visible
     - 7..9s  fade out (overlaps NEXT photo's 0..2s fade-in, since
              the next photo's delay lands at this photo's local 7s)
   Photo 2 and 3 offset by 7s and 14s. With a 9s active window and
   a 7s stride, adjacent photos overlap by 2s during the crossfade.
   Keyframe percentages (of 21s):
     0%     opacity 0   (start of fade-in)
     9.52%  opacity 1   (2s / 21s — fade-in complete)
     33.33% opacity 1   (7s — begin fade-out)
     42.86% opacity 0   (9s — fade-out complete)
     100%   opacity 0   (stay hidden through rest of cycle)
*/
@keyframes rs-crossfade {
  0%     { opacity: 0; }
  9.52%  { opacity: 1; }
  33.33% { opacity: 1; }
  42.86% { opacity: 0; }
  100%   { opacity: 0; }
}
.hero-photo {
  opacity: 0;
  animation: rs-crossfade 21s infinite ease-in-out both;
}
.hero-photo[data-hero="1"] { animation-delay: 0s; }
.hero-photo[data-hero="2"] { animation-delay: 7s; }
.hero-photo[data-hero="3"] { animation-delay: 14s; }

@media (prefers-reduced-motion: reduce) {
  .hero-photo { animation: none; opacity: 0; }
  .hero-photo[data-hero="1"] { opacity: 1; }
}

/* ---- responsive: tablet and below ---- */
@media (max-width: 768px) {
  .hero-anchor {
    bottom: clamp(96px, 18vh, 140px);
    max-width: 100%;
  }
  .hero-footer {
    flex-wrap: wrap;
    gap: 10px 18px;
    font-size: 10px;
  }
  .hero-footer .copyright { order: 3; width: 100%; text-align: center; opacity: 0.6; }
}

/* ---- responsive: small phones ---- */
@media (max-width: 420px) {
  :root {
    --rs-pad-x: 22px;
    --rs-pad-y: 18px;
  }
  .hero-anchor .tagline { max-width: 100%; }
  .cta { padding: 12px 22px; }
}
