/* ============================================================
   Isabella Perez Harretche — frisør portfolio
   Mobile-first. The signature: --accent is set at runtime by
   accent.js from the hair tone of the focused gallery image.
   ============================================================ */

:root {
  /* Fixed, quiet, warm-neutral canvas (so sampled color reads true) */
  --ivory:  #F4F1EC;   /* page bg */
  --linen:  #E7E1D7;   /* bands, cards */
  --graphite:#1C1A18;  /* text */
  --ash:    #6B6560;   /* secondary text */
  --silver: #C9C7C2;   /* hairlines */

  /* Dynamic accent — fallback copper until a gallery image is in focus */
  --accent: #B06A3B;
  --accent-ink: #2a1a10;     /* readable text color over --accent, set by JS */

  --maxw: 1280px;
  --gutter: clamp(1.25rem, 5vw, 4rem);
  --radius: 2px;

  --font-display: "Bodoni Moda", Georgia, "Times New Roman", serif;
  --font-body: "Hanken Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* Fluid type scale */
  --fs-eyebrow: 0.75rem;
  --fs-body: clamp(1rem, 0.96rem + 0.3vw, 1.125rem);
  --fs-h2: clamp(2rem, 1.4rem + 3.2vw, 4rem);
  --fs-h3: clamp(1.5rem, 1.2rem + 1.6vw, 2.25rem);
  --fs-hero: clamp(2.75rem, 1.6rem + 7vw, 7.5rem);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --accent-transition: 700ms ease;
}

/* ---------- Reset-ish ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ivory);
  color: var(--graphite);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3 { margin: 0; font-weight: 500; line-height: 1.05; }
p { margin: 0 0 1rem; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: inherit; }

/* ---------- Focus & skip link (a11y) ---------- */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--radius);
  transition: outline-color var(--accent-transition);
}
.skip-link {
  position: fixed; top: 0; left: 50%; transform: translate(-50%, -120%);
  z-index: 200; background: var(--graphite); color: var(--ivory);
  padding: 0.6rem 1.1rem; border-radius: 0 0 6px 6px; font-size: 0.85rem;
  text-decoration: none;
}
.skip-link:focus { transform: translate(-50%, 0); }

/* ---------- Shared bits ---------- */
.section { padding: clamp(3.5rem, 8vw, 8rem) var(--gutter); max-width: var(--maxw); margin-inline: auto; }
.eyebrow, .section__index, .visit__label {
  font-family: var(--font-body); font-weight: 500; font-size: var(--fs-eyebrow);
  letter-spacing: 0.22em; text-transform: uppercase; color: var(--ash); margin: 0 0 1rem;
}
.section__index { color: var(--accent); transition: color var(--accent-transition); }
.section__title { font-family: var(--font-display); font-size: var(--fs-h2); letter-spacing: -0.01em; }

/* ---------- Buttons ---------- */
.btn {
  --pad-y: 0.85rem; --pad-x: 1.5rem;
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: var(--pad-y) var(--pad-x);
  font-family: var(--font-body); font-weight: 500; font-size: 0.95rem;
  letter-spacing: 0.02em; text-decoration: none; cursor: pointer;
  border: 1px solid transparent; border-radius: 100px;
  transition: background var(--accent-transition), color var(--accent-transition),
              border-color var(--accent-transition), transform 240ms var(--ease);
}
.btn::after { content: "▸"; font-size: 0.8em; transform: translateX(0); transition: transform 240ms var(--ease); }
.btn:hover::after { transform: translateX(3px); }
.btn--solid { background: var(--accent); color: var(--accent-ink); }
.btn--solid:hover { transform: translateY(-2px); filter: brightness(1.04); }
.btn--ghost { background: transparent; color: var(--graphite); border-color: var(--silver); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn--ghost::after { content: "→"; }
.btn--light { color: var(--ivory); border-color: rgba(244,241,236,0.4); }
.btn--light:hover { border-color: var(--ivory); color: var(--ivory); }
.btn--lg { --pad-y: 1.1rem; --pad-x: 2.2rem; font-size: 1.05rem; }

.link-arrow {
  display: inline-block; text-decoration: none; font-weight: 500;
  border-bottom: 1px solid var(--silver); padding-bottom: 2px; margin-bottom: 0.5rem;
  transition: border-color var(--accent-transition), color var(--accent-transition);
}
.link-arrow:hover { color: var(--accent); border-color: var(--accent); }

/* ============================ NAV ============================ */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--ivory) 86%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--silver);
}
.nav__inner {
  max-width: var(--maxw); margin-inline: auto;
  display: flex; align-items: center; gap: 1rem;
  padding: 0.85rem var(--gutter);
}
.nav__brand { display: flex; align-items: center; text-decoration: none; font-weight: 600; }
.nav__brand-mark { font-family: var(--font-display); font-size: 1.35rem; letter-spacing: 0.02em; }
.nav__brand-full { display: none; }
.nav__links { display: none; gap: 1.75rem; margin-left: auto; }
.nav__links a {
  text-decoration: none; font-size: 0.9rem; font-weight: 500; color: var(--ash);
  position: relative; transition: color 200ms var(--ease);
}
.nav__links a::after {
  content: ""; position: absolute; left: 0; bottom: -4px; width: 100%; height: 1px;
  background: var(--accent); transform: scaleX(0); transform-origin: left;
  transition: transform 260ms var(--ease), background var(--accent-transition);
}
.nav__links a:hover { color: var(--graphite); }
.nav__links a:hover::after { transform: scaleX(1); }
.nav__right { display: flex; align-items: center; gap: 0.75rem; margin-left: auto; }
.nav__cta { padding: 0.55rem 1.1rem; font-size: 0.85rem; }

.lang { display: flex; align-items: center; gap: 0.35rem; }
.lang__btn {
  background: none; border: 0; cursor: pointer; font-family: var(--font-body);
  font-size: 0.8rem; font-weight: 600; letter-spacing: 0.08em; color: var(--ash);
  padding: 0.2rem; transition: color 200ms var(--ease);
}
.lang__btn.is-active { color: var(--graphite); }
.lang__sep { color: var(--silver); }

.nav__progress { height: 2px; background: transparent; }
.nav__progress-bar {
  display: block; height: 100%; width: 0%;
  background: var(--accent); transition: background var(--accent-transition);
}

@media (min-width: 900px) {
  .nav__links { display: flex; }
  .nav__right { margin-left: 0; }
  .nav__brand-mark { display: none; }
  .nav__brand-full { display: inline; font-family: var(--font-display); font-size: 1.15rem; letter-spacing: 0.01em; }
}

/* ============================ HERO ============================ */
.hero {
  position: relative;
  display: grid; grid-template: 1fr / 1fr;
  min-height: calc(100svh - 60px);
}
/* Mobile: video and text share one cell — video behind, text in front. */
.hero__media, .hero__text { grid-area: 1 / 1; }

.hero__media {
  position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
/* Instagram reel embed: cap its width, let it breathe, kill the default margins. */
.hero__media .instagram-media {
  margin: 0 auto !important;
  width: 100% !important; max-width: 360px !important; min-width: 0 !important;
}
/* Salon presentation video — full-bleed background on mobile. */
.hero__video {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
/* Scrim so the overlaid text stays legible over the video. */
.hero__media::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to top,
    rgba(20, 18, 16, 0.80) 0%, rgba(20, 18, 16, 0.42) 52%, rgba(20, 18, 16, 0.30) 100%);
}
.hero__text {
  position: relative; z-index: 1; color: var(--ivory);
  padding: clamp(1.5rem, 6vw, 3rem) var(--gutter) clamp(2.5rem, 8vw, 4rem);
  display: flex; flex-direction: column; justify-content: flex-end;
}
.hero__text .eyebrow { color: rgba(244, 241, 236, 0.82); }
.hero__name {
  font-family: var(--font-display); font-weight: 500;
  font-size: var(--fs-hero); letter-spacing: -0.02em; line-height: 0.95; margin: 0.25rem 0 1.25rem;
}
.hero__statement { font-size: clamp(1.1rem, 1rem + 0.7vw, 1.5rem); color: rgba(244, 241, 236, 0.88); max-width: 34ch; margin-bottom: 1.75rem; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.hero__actions .btn--ghost { color: var(--ivory); border-color: rgba(244, 241, 236, 0.5); }
.hero__actions .btn--ghost:hover { color: var(--ivory); border-color: var(--ivory); }

@media (min-width: 900px) {
  .hero { grid-template-columns: 1fr 1fr; grid-template-rows: auto; align-items: stretch; }
  /* Desktop: side by side again — undo the mobile overlap. */
  .hero__media { grid-area: auto; order: 2; padding: clamp(1.5rem, 4vw, 3rem); overflow: visible; }
  .hero__media::after { display: none; }
  .hero__text {
    grid-area: auto; order: 1; color: var(--graphite); justify-content: center;
    padding: clamp(1.5rem, 6vw, 3rem) var(--gutter) clamp(2.5rem, 6vw, 4rem);
  }
  .hero__text .eyebrow { color: var(--ash); }
  .hero__statement { color: var(--ash); }
  .hero__actions .btn--ghost { color: var(--graphite); border-color: var(--silver); }
  /* Sits within its half, a touch smaller than full-bleed. */
  .hero__video {
    max-width: 600px; width: 100%; height: auto; object-fit: initial;
    border-radius: var(--radius); box-shadow: 0 1px 10px rgba(28, 26, 24, 0.15);
  }
}

/* ============================ SALON (carousel) ============================ */
.salon__head { max-width: 60ch; margin-bottom: clamp(1.75rem, 4vw, 2.75rem); }
.salon__lead { color: var(--ash); max-width: 48ch; margin: 0.75rem 0 0; font-size: clamp(1.05rem, 1rem + 0.4vw, 1.25rem); }
.salon__media {
  position: relative; overflow: hidden; border-radius: var(--radius);
  aspect-ratio: 4 / 3; background: var(--linen);
}
@media (min-width: 700px) { .salon__media { aspect-ratio: 16 / 9; } }

.carousel { position: absolute; inset: 0; }
.carousel__viewport { position: absolute; inset: 0; overflow: hidden; }
.carousel__track {
  display: flex; height: 100%;
  transition: transform 700ms var(--ease);
  touch-action: pan-y;
}
.carousel__slide { position: relative; flex: 0 0 100%; min-width: 0; height: 100%; }
.carousel__slide img { width: 100%; height: 100%; object-fit: cover; }

/* No-JS / pre-init: stack slides, show only the first (track has no transform yet) */
html:not(.js) .carousel__track,
.carousel:not(.is-ready) .carousel__track { transition: none; }

.carousel__arrow {
  position: absolute; top: 50%; z-index: 3; transform: translateY(-50%);
  display: grid; place-items: center;
  width: 44px; height: 44px; border: 0; border-radius: 50%;
  background: rgba(244, 241, 236, 0.82); color: var(--graphite);
  cursor: pointer; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  box-shadow: 0 2px 10px rgba(28, 26, 24, 0.14);
  opacity: 0; transition: opacity 250ms var(--ease), background 250ms var(--ease);
}
.carousel__arrow--prev { left: clamp(0.6rem, 2vw, 1rem); }
.carousel__arrow--next { right: clamp(0.6rem, 2vw, 1rem); }
.carousel:hover .carousel__arrow,
.carousel:focus-within .carousel__arrow { opacity: 1; }
.carousel__arrow:hover { background: var(--ivory); }
/* Touch / coarse pointers: keep arrows visible (no hover to reveal them) */
@media (hover: none) { .carousel__arrow { opacity: 1; } }

.carousel__dots {
  position: absolute; z-index: 3; left: 0; right: 0;
  bottom: clamp(0.85rem, 2.5vw, 1.4rem);
  display: flex; justify-content: center; gap: 0.55rem;
}
.carousel__dot {
  width: 8px; height: 8px; padding: 0; border: 0; border-radius: 50%;
  background: rgba(244, 241, 236, 0.55); cursor: pointer;
  box-shadow: 0 0 0 1px rgba(28, 26, 24, 0.18);
  transition: background 250ms var(--ease), transform 250ms var(--ease), width 250ms var(--ease);
}
.carousel__dot:hover { background: rgba(244, 241, 236, 0.85); }
.carousel__dot.is-active { background: var(--accent); width: 22px; border-radius: 5px; }

@media (prefers-reduced-motion: reduce) {
  .carousel__track { transition: none; }
}

/* ============================ ABOUT ============================ */
/* Extra breathing room above/below this section. */
.about.section { padding-block: clamp(5rem, 11vw, 11rem); }
.about { display: grid; gap: clamp(2rem, 5vw, 4rem); grid-template-columns: 1fr; align-items: center; }
.about__portrait { margin: 0; }
.about__portrait img { width: 100%; border-radius: var(--radius); aspect-ratio: 9 / 11; object-fit: cover; }
.about__portrait .instagram-media { margin: 0 auto !important; width: 100% !important; min-width: 0 !important; }
.about__portrait-cap { margin-top: 0.75rem; font-size: 0.85rem; color: var(--ash); line-height: 1.5; }
.about__lead { font-family: var(--font-display); font-size: var(--fs-h3); line-height: 1.2; margin-bottom: 1.5rem; }
@media (min-width: 800px) {
  .about { grid-template-columns: 0.85fr 1.15fr; }
  .about__portrait { position: sticky; top: 100px; }
}

/* ============================ SERVICES ============================ */
.services__head { margin-bottom: clamp(2rem, 5vw, 3.5rem); }
.services__list { display: grid; gap: clamp(2.5rem, 5vw, 4.5rem); }
.service { display: grid; gap: 1.25rem; grid-template-columns: 1fr; align-items: center; }
.service__media { border-radius: var(--radius); }
.service__media:has(img) { overflow: hidden; }
.service__media img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; transition: transform 700ms var(--ease); }
.service__media .instagram-media { margin: 0 auto !important; width: 100% !important; min-width: 0 !important; }
.service:hover .service__media img { transform: scale(1.03); }
.service__name { font-family: var(--font-display); font-size: var(--fs-h3); margin: 0.25rem 0 0.75rem; }
.services__note { margin-top: clamp(2rem, 4vw, 3rem); color: var(--ash); font-size: 0.95rem; }
/* Mobile: show the heading/text before the image (single column). */
@media (max-width: 759px) {
  .service__media { order: 2; }
}
@media (min-width: 760px) {
  .service { grid-template-columns: 0.9fr 1.1fr; gap: clamp(2rem, 4vw, 4rem); }
  .service:nth-child(even) .service__media { order: 2; }
  .service__media img { aspect-ratio: 5 / 6; }
}

/* ============================ GALLERY ============================ */
.gallery { max-width: var(--maxw); }
.gallery__head { margin-bottom: clamp(1.5rem, 4vw, 2.5rem); }
.gallery__hint { color: var(--ash); font-size: 0.95rem; max-width: 38ch; }
.filters { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.25rem; }
.chip {
  font-family: var(--font-body); font-size: 0.85rem; font-weight: 500;
  padding: 0.45rem 1rem; border-radius: 100px; cursor: pointer;
  background: transparent; border: 1px solid var(--silver); color: var(--ash);
  transition: all 240ms var(--ease), border-color var(--accent-transition);
}
.chip:hover { color: var(--graphite); border-color: var(--graphite); }
.chip.is-active { background: var(--graphite); color: var(--ivory); border-color: var(--graphite); }

/* CSS columns masonry — simple, no JS layout needed */
.grid { columns: 2 160px; column-gap: clamp(0.5rem, 2vw, 1.25rem); }
@media (min-width: 700px) { .grid { columns: 3 220px; } }
@media (min-width: 1100px) { .grid { columns: 4 240px; } }
.card {
  break-inside: avoid; margin-bottom: clamp(0.5rem, 2vw, 1.25rem);
  position: relative; overflow: hidden; border-radius: var(--radius);
  background: var(--linen);
  transition: opacity 400ms var(--ease), transform 400ms var(--ease), filter 500ms var(--ease);
}
.card img { width: 100%; height: auto; }
.card:not(.card--ba) img { transition: transform 800ms var(--ease); }
.card:not(.card--ba):hover img { transform: scale(1.04); }
.card.is-active { outline: 2px solid var(--accent); outline-offset: -2px; }
/* Filter hide */
.card.is-hidden { display: none; }
/* When a card is "active" (in focus) others recede slightly on wider screens */
@media (min-width: 700px) and (hover: hover) {
  .grid.has-active .card:not(.is-active):not(.card--ba) { filter: saturate(0.85) brightness(0.97); }
}

/* ---------- Before/After scrub ---------- */
.ba { position: relative; user-select: none; touch-action: pan-y; cursor: ew-resize; }
.ba__img { width: 100%; height: auto; display: block; pointer-events: none; }
.ba__after { position: relative; z-index: 1; }
.ba__before-wrap { position: absolute; inset: 0; z-index: 2; width: 50%; overflow: hidden; will-change: width; }
.ba__before-wrap .ba__before { position: absolute; top: 0; left: 0; height: 100%; width: auto; max-width: none; }
.ba__range {
  position: absolute; inset: 0; z-index: 4; width: 100%; height: 100%;
  margin: 0; opacity: 0; cursor: ew-resize;
}
.ba__handle {
  position: absolute; top: 0; bottom: 0; left: 50%; z-index: 3; width: 2px;
  background: var(--ivory); transform: translateX(-1px); pointer-events: none;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.15);
}
.ba__handle::after {
  content: "⇆"; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 34px; height: 34px; border-radius: 50%; background: var(--ivory); color: var(--graphite);
  display: grid; place-items: center; font-size: 0.9rem; box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.ba__tag {
  position: absolute; bottom: 8px; z-index: 3; font-size: 0.7rem; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--ivory);
  background: rgba(28,26,24,0.55); padding: 0.2rem 0.5rem; border-radius: 3px; pointer-events: none;
}
.ba__tag--before { left: 8px; }
.ba__tag--after { right: 8px; }

/* ============================ INSTAGRAM EMBEDS (in gallery) ============================ */
/* A separate responsive grid below the masonry image grid. Embeds keep their own
   inline min-width (326px) and self-size their height after embed.js hydrates, so
   they need wider columns than the masonry cards — hence their own grid. */
/* Horizontal carousel of the embeds: native scroll-snap track + arrow buttons. */
.ig-carousel { position: relative; margin-top: clamp(0.5rem, 2vw, 1.25rem); }
.ig-embeds {
  display: flex; align-items: flex-start;
  gap: clamp(1rem, 2vw, 1.5rem);
  overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 1rem;            /* room for the scrollbar */
  scrollbar-width: thin;
  scrollbar-color: var(--silver) transparent;
}
.ig-embeds::-webkit-scrollbar { height: 6px; }
.ig-embeds::-webkit-scrollbar-thumb { background: var(--silver); border-radius: 3px; }
.ig-embeds::-webkit-scrollbar-track { background: transparent; }
/* Each embed is a fixed-width slide that snaps into place. */
.card--embed { flex: 0 0 auto; width: min(86vw, 340px); scroll-snap-align: start; }

/* Arrows: only shown on devices with a hover pointer (touch users just swipe). */
.ig-carousel__arrow { display: none; }
@media (hover: hover) and (min-width: 760px) {
  .ig-carousel__arrow { display: grid; opacity: 1; }
  .ig-carousel__arrow[hidden] { display: none; }
  .ig-carousel__arrow.carousel__arrow--prev { left: -8px; }
  .ig-carousel__arrow.carousel__arrow--next { right: -8px; }
}
/* Embed cards opt out of the masonry .card chrome (linen bg, clip) — the embed
   brings its own white card + shadow. Still a .card so the filter logic sees it.
   (Width is set above by the carousel-slide rule.) */
.card--embed { overflow: visible; background: none; border-radius: 0; margin: 0; }
.card--embed .instagram-media { margin: 0 auto !important; width: 100% !important; min-width: 0 !important; }

/* ============================ BOOK ============================ */
.book { text-align: center; max-width: 760px; }
.book__title { font-family: var(--font-display); font-size: var(--fs-h2); margin: 0.5rem 0 1rem; }
.book__lead { color: var(--ash); font-size: 1.15rem; margin-bottom: 2rem; }

/* ============================ VISIT ============================ */
.visit { display: grid; gap: clamp(2rem, 5vw, 3rem); grid-template-columns: 1fr; border-top: 1px solid var(--silver); }
.visit__address { font-style: normal; font-size: 1.1rem; line-height: 1.8; margin: 1rem 0 1.25rem; }
.visit__label--mt { margin-top: 2rem; }
@media (min-width: 700px) { .visit { grid-template-columns: 1.4fr 1fr; } }

/* Map below the Visit section, constrained to the section content width. */
.map-band {
  max-width: var(--maxw); margin-inline: auto;
  padding: 0 var(--gutter) clamp(3.5rem, 8vw, 8rem);
}
.map-band iframe {
  display: block; width: 100%; height: clamp(320px, 45vh, 520px); border: 0;
  border-radius: var(--radius); background: var(--linen);
  border: 1px solid var(--silver);
}

/* ============================ FOOTER ============================ */
.footer { background: var(--graphite); color: var(--ivory); padding: clamp(2.5rem, 6vw, 4rem) var(--gutter); }
.footer__top {
  max-width: var(--maxw); margin-inline: auto;
  display: flex; flex-wrap: wrap; gap: 1.5rem; align-items: center; justify-content: space-between;
  padding-bottom: 2rem; border-bottom: 1px solid rgba(244,241,236,0.18);
}
.footer__name { font-family: var(--font-display); font-size: clamp(1.75rem, 4vw, 3rem); margin: 0; }
.footer__meta {
  max-width: var(--maxw); margin: 1.5rem auto 0;
  display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; justify-content: space-between;
  font-size: 0.85rem; color: rgba(244,241,236,0.6);
}

/* ============================ MOTION PREFERENCES ============================ */
/* Reveal-on-scroll baseline (JS adds .is-in). Hidden only if JS present. */
.js [data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity 800ms var(--ease), transform 800ms var(--ease); }
.js [data-reveal].is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  :root { --accent-transition: 0ms; }
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  .js [data-reveal] { opacity: 1; transform: none; }
}
