/* ==========================================================================
   VERNATTE — components
   Colour, type, borders and states. Flow and grids live in layout.css.
   ========================================================================== */

/* ---- Accessibility ------------------------------------------------------ */

:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }

.skip-link {
  position: absolute;
  top: -72px;
  left: 14px;
  z-index: 100;
  padding: 12px 20px;
  border-radius: var(--r-pill);
  background: var(--dark);
  color: var(--surface);
  font-size: var(--fs-small);
  font-weight: 500;
  transition: top var(--t-fast) var(--ease);
}
.skip-link:focus { top: 14px; }

/* ---- Panels ------------------------------------------------------------- */

.site-header,
.hero,
.site-footer { background: var(--surface); border: 1px solid var(--border); }

.sidebar { background: var(--sidebar); }

/* ---- Rules and icons ---------------------------------------------------- */

.rule { display: block; width: 48px; height: 1px; background: var(--accent); }

.icon {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---- Image slot --------------------------------------------------------- */
/* Every photograph sits in a slot. The slot owns the aspect ratio, so the
   layout is identical with or without the file. The <img> stays invisible
   until it has loaded; a missing file leaves the warm surface and a quiet
   label naming the asset. */

.slot {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: var(--placeholder);
}
.slot--1x1 { aspect-ratio: 1 / 1; }
.slot--3x4 { aspect-ratio: 3 / 4; }
.slot--5x4 { aspect-ratio: 5 / 4; }

.slot__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--pos, 50% 50%);
  opacity: 0;
  transition: opacity var(--t-image) var(--ease), transform var(--t-image) var(--ease);
}
.slot.is-loaded .slot__img { opacity: 1; }
.slot.is-missing .slot__img { display: none; }

/* Dev label: pinned top-left so it never collides with text laid over the slot. */
.slot::after {
  content: attr(data-asset) "\A" attr(data-spec);
  position: absolute;
  inset: 0;
  padding: 14px;
  white-space: pre-line;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.02em;
  color: var(--placeholder-ink);
  opacity: 0;
  pointer-events: none;
}
.slot.is-missing::after { opacity: 1; }
.mini .slot::after { padding: 10px; font-size: 0.6875rem; }

/* Without script nothing can reveal the image, so show it. */
@media (scripting: none) { .slot__img { opacity: 1; } }

/* ---- Brand -------------------------------------------------------------- */

.brand { display: inline-flex; align-items: center; gap: 12px; }

.brand__icon {
  width: auto;
  height: 40px;
  max-width: 56px;
  object-fit: contain;
  opacity: 0;
  transition: opacity var(--t-med) var(--ease);
}
.brand.is-loaded .brand__icon { opacity: 1; }
.brand.is-missing .brand__icon { display: none; }
@media (scripting: none) { .brand__icon { opacity: 1; } }

.brand__word {
  font-family: var(--font-display);
  font-size: var(--fs-wordmark);
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.012em;
}

/* ---- Primary navigation ------------------------------------------------- */

.nav { display: flex; align-items: center; gap: clamp(26px, 3.4vw, 54px); }

.nav__link {
  position: relative;
  padding: 10px 0;
  font-size: var(--fs-nav);
  font-weight: 500;
  letter-spacing: 0.01em;
}
.nav__link::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 4px;
  left: 0;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--t-med) var(--ease);
}
.nav__link[aria-current="page"] { font-weight: 600; }
.nav__link[aria-current="page"]::after,
.nav__link:hover::after,
.nav__link:focus-visible::after { transform: scaleX(1); }

/* ---- Icon buttons (search, bag, menu) ----------------------------------- */

.icon-btn {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  transition: background-color var(--t-fast) var(--ease);
}
.icon-btn:hover { background: rgb(var(--scrim) / 0.06); }

.icon-btn__badge {
  position: absolute;
  top: 5px;
  right: 3px;
  display: grid;
  place-items: center;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: var(--r-pill);
  background: var(--dark);
  color: var(--surface);
  font-size: 0.625rem;
  font-weight: 600;
  line-height: 1;
}

.site-header__divider { width: 1px; height: 20px; margin-inline: 4px; background: var(--border); }

/* Text button used for the mobile menu toggle. */
.menu-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 8px 0 10px;
  font-size: var(--fs-nav);
  font-weight: 500;
}
.menu-toggle__bars { position: relative; width: 18px; height: 10px; }
.menu-toggle__bars::before,
.menu-toggle__bars::after {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  height: 1.5px;
  background: currentColor;
  transition: transform var(--t-med) var(--ease), top var(--t-med) var(--ease);
}
.menu-toggle__bars::before { top: 0; }
.menu-toggle__bars::after { top: 8.5px; }
.menu-toggle[aria-expanded="true"] .menu-toggle__bars::before { top: 4.25px; transform: rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-toggle__bars::after { top: 4.25px; transform: rotate(-45deg); }

/* ---- Buttons ------------------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 48px;
  padding: 0 26px;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  font-size: var(--fs-nav);
  font-weight: 500;
  letter-spacing: 0.01em;
  white-space: nowrap;
  transition: background-color var(--t-med) var(--ease), color var(--t-med) var(--ease),
    border-color var(--t-med) var(--ease);
}
.btn__arrow { width: 16px; height: 16px; stroke-width: 1.6; transition: transform var(--t-med) var(--ease); }
.btn:hover .btn__arrow { transform: translateX(3px); }

.btn--solid { background: var(--dark); border-color: var(--dark); color: var(--surface); }
.btn--solid:hover { background: #3A352D; border-color: #3A352D; }

.btn--outline { width: 100%; background: transparent; border-color: var(--text-2); color: var(--text); }
.btn--outline:hover { background: var(--dark); border-color: var(--dark); color: var(--surface); }

/* ---- Sidebar ------------------------------------------------------------ */

.sidebar__title {
  font-family: var(--font-display);
  font-size: var(--fs-side-title);
  font-weight: 500;
  line-height: 1.14;
}
.sidebar__title-line { display: block; }
.sidebar__title + .rule { margin-top: 22px; }

.sidebar__figure { border-radius: var(--r-small); }
.sidebar__figure .slot { border-radius: var(--r-small); }

.sidebar__copy { color: var(--text-2-aa); font-size: var(--fs-body); line-height: 1.65; text-wrap: pretty; }

.social { display: flex; align-items: center; gap: 2px; }
.social__link {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  transition: background-color var(--t-fast) var(--ease);
}
.social__link .icon { width: 20px; height: 20px; }
.social__link:hover { background: rgb(var(--scrim) / 0.07); }
.sidebar .social { margin-left: -10px; }

.mini { display: grid; justify-items: start; gap: 14px; }
.mini .slot { width: 112px; border-radius: var(--r-panel); }
.mini__text { font-family: var(--font-display); font-size: 1.1875rem; font-weight: 500; line-height: 1.25; }
.mini__line { display: block; }

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

.hero > .slot { border-radius: 0; }

.hero__eyebrow {
  font-size: var(--fs-eyebrow);
  font-weight: 500;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--text-2-aa);
}
.hero__title {
  margin-top: 18px;
  font-family: var(--font-display);
  font-size: var(--fs-h1);
  font-weight: 500;
  line-height: 0.98;
  letter-spacing: -0.012em;
}
.hero__title-line { display: block; }
.hero__copy .rule { margin-block: 28px; }
.hero__lede { max-width: 27ch; color: var(--text-2-aa); font-size: var(--fs-lede); line-height: 1.65; text-wrap: pretty; }
.hero__cta { margin-top: 32px; }

/* ---- Feature cards ------------------------------------------------------ */
/* The slot sizes the card; the text block is stacked over it in the same grid
   cell. A soft scrim keeps the text readable on any photograph (and on the
   placeholder). It is a legibility device, not decoration. */

.card {
  position: relative;
  display: grid;
  overflow: hidden;
  isolation: isolate;
  border-radius: var(--r-panel);
  background: var(--placeholder);
}
.card > .slot { grid-area: 1 / 1; }
.card::after {
  content: "";
  grid-area: 1 / 1;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    to top,
    rgb(var(--scrim) / 0.58) 0%,
    rgb(var(--scrim) / 0.26) 36%,
    rgb(var(--scrim) / 0) 68%
  );
}
.card__body {
  grid-area: 1 / 1;
  z-index: 2;
  align-self: end;
  display: grid;
  grid-template-rows: auto auto 3em;
  row-gap: 10px;
  padding: clamp(16px, 1.8vw, 24px);
  color: var(--on-image);
  font-size: var(--fs-small);
  line-height: 1.5;
}
.card__title { font-family: var(--font-display); font-size: var(--fs-card-title); font-weight: 500; line-height: 1.1; }
.card__dash { display: block; width: 26px; height: 1px; background: var(--accent); }
.card__text { color: rgb(251 249 244 / 0.9); text-wrap: pretty; }

/* Tone is set by main.js from the brightness of the photograph's lower part.
   Light photographs get dark text on a soft ivory fade; the default (dark
   scrim, ivory text) covers everything else, including the placeholder. */
.card[data-tone="light"]::after {
  background: linear-gradient(
    to top,
    rgb(249 247 242 / 0.9) 0%,
    rgb(249 247 242 / 0.66) 28%,
    rgb(249 247 242 / 0) 68%
  );
}
.card[data-tone="light"] .card__body { color: var(--text); }
.card[data-tone="light"] .card__text { color: rgb(23 21 18 / 0.84); }

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

.site-footer__statement {
  max-width: 26ch;
  margin-top: 20px;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 500;
  line-height: 1.28;
  text-wrap: balance;
}
.footer-nav { display: grid; gap: 0; }
.footer-nav__link { display: inline-block; padding: 5px 0; font-size: var(--fs-nav); font-weight: 500; }
.site-footer > .social { align-self: start; margin-right: -10px; }
.footer-nav__link:hover { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 6px; }

.site-footer__legal { border-top: 1px solid var(--border); color: var(--text-2-aa); font-size: var(--fs-small); }
.legal-nav { display: flex; gap: 24px; }
.legal-nav__link:hover { color: var(--text); text-decoration: underline; text-underline-offset: 4px; }

/* ---- Crop map ------------------------------------------------------------
   Where each photograph is anchored when its slot crops it (object-position).
   Retune per image once the final photographs are in. */

[data-asset="hero-editorial.jpg"] { --pos: 50% 40%; }
[data-asset="sidebar-editorial.jpg"] { --pos: 50% 30%; }
[data-asset="fragrance-detail.jpg"] { --pos: 50% 55%; }
[data-asset="fabric-detail.jpg"] { --pos: 50% 50%; }
[data-asset="perfume.jpg"] { --pos: 50% 55%; }
[data-asset="collection-rack.jpg"] { --pos: 50% 45%; }

/* ---- Hover refinements (pointer devices only) --------------------------- */

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .card:hover .slot__img,
  .sidebar__figure:hover .slot__img,
  .hero > .slot:hover .slot__img { transform: scale(1.025); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
