/* Casa Joy – landing page (/).
   Consumes tokens.css. Colours, fonts and spacing come from the --cj-* tokens;
   the few page-only values below are prefixed --site-. */

:root {
  --site-gutter: clamp(20px, 5vw, 56px);
  --site-header: 84px;
  --site-oliva-hover: #494638;      /* oliva darkened 12%: color-mix(in srgb, var(--cj-oliva) 88%, black) */
  --site-linha-creme: rgba(241, 237, 226, 0.28);   /* rótulo hairline on the oliva footer */
  --site-secao: clamp(5rem, 4rem + 5vw, 9rem);      /* section rhythm, 80–144px on the 8-pt grid */
  --site-card-inset: 14px;          /* card padding around the photo; photo radius = card radius - inset */
}

/* ---------- base ---------- */

*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: var(--cj-space-3);
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--cj-papel);
  color: var(--cj-oliva);
  font-family: var(--cj-font-text);
  font-size: 1.0625rem;
  font-weight: 400;
  line-height: 1.6;
  font-variant-numeric: lining-nums;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p, ul, dl, dd, figure { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; }

h1, h2, h3 {
  font-family: var(--cj-font-display);
  font-weight: var(--cj-weight-display);
  letter-spacing: 0;
  text-wrap: balance;
}

p, dd { text-wrap: pretty; }

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

/* The skip link moves focus to <main tabindex="-1">; no ring on the whole page. */
main:focus { outline: none; }

::selection { background: var(--cj-oliva); color: var(--cj-rotulo); }

.vh {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.pular {
  position: absolute;
  left: var(--cj-space-2);
  top: -4rem;
  z-index: 10;
  padding: 0.75rem 1.25rem;
  border-radius: var(--cj-radius-pill);
  background: var(--cj-oliva);
  color: var(--cj-rotulo);
  font-weight: 500;
  text-decoration: none;
}
.pular:focus { top: var(--cj-space-2); }

.envelope {
  width: 100%;
  max-width: calc(var(--cj-max-width) + 2 * var(--site-gutter));
  margin-inline: auto;
  padding-inline: var(--site-gutter);
}

/* ---------- shared pieces ---------- */

/* The "HOME SPRAY" line from the label: Raleway caps, 27% tracking. */
.linha-produto {
  font-size: 0.8125rem;
  line-height: 1.4;
  letter-spacing: var(--cj-track-caps);
  text-transform: uppercase;
}

.num,
.tamanhos { font-family: var(--cj-font-num); font-weight: 400; }

.tamanhos {
  font-size: 0.9375rem;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.botao {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.7rem 1.6rem;
  border: 1px solid transparent;   /* invisible here, becomes the outline in forced-colours mode */
  border-radius: var(--cj-radius-pill);
  background: var(--cj-oliva);
  color: var(--cj-rotulo);
  font-family: var(--cj-font-text);
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0.06em;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.2s ease;
}
.botao:hover { background: var(--site-oliva-hover); }

.botao--creme { background: var(--cj-rotulo); color: var(--cj-oliva); }
.botao--creme:hover { background: var(--cj-papel); }

@media (forced-colors: active) {
  .botao { border-color: ButtonText; }
}

.link {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  font-weight: 500;
  font-size: 0.9375rem;
  letter-spacing: 0.02em;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--cj-divisor);
  text-underline-offset: 0.4em;
  transition: text-decoration-color 0.2s ease;
}
.link:hover { text-decoration-color: currentColor; }

/* ---------- header ---------- */

/* 1fr auto 1fr keeps the nav on the true centre of the page. */
.topo__barra {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  column-gap: var(--cj-space-4);
  min-height: var(--site-header);
}

.topo__marca {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  min-height: 44px;
}
/* 34px tall = symbol about 33px wide, above the brand's 32px minimum.
   Nudged up so the CASA JOY caps line up with the nav labels. */
.topo__marca img { width: auto; height: 34px; transform: translateY(-3px); }

.topo__nav ul {
  display: flex;
  justify-content: center;
  gap: 0 var(--cj-space-4);
}
.topo__nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 0.9375rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.45em;
  text-decoration-color: transparent;
  transition: text-decoration-color 0.2s ease;
}
.topo__nav a:hover { text-decoration-color: currentColor; }

.botao--topo { justify-self: end; min-height: 44px; padding-inline: 1.35rem; font-size: 0.875rem; }

/* ---------- hero ---------- */

.abertura {
  display: grid;
  grid-template-columns:
    minmax(var(--site-gutter), 1fr)
    minmax(0, calc(var(--cj-max-width) * 0.45))
    minmax(0, calc(var(--cj-max-width) * 0.55))
    minmax(var(--site-gutter), 1fr);
  min-height: clamp(600px, calc(100svh - var(--site-header)), 880px);
}

.abertura__texto {
  grid-column: 2;
  align-self: center;
  padding: var(--cj-space-5) clamp(2rem, 4vw, 4.5rem) var(--cj-space-6) 0;
}

/* Capped at 5.25rem so the signature always sets as "O cheiro de / estar em casa." */
.abertura h1 {
  margin-top: var(--cj-space-3);
  font-size: clamp(3.25rem, 1.4rem + 4.6vw, 5.25rem);
  line-height: 0.98;
  max-width: 7.5em;
}

.abertura__lead {
  max-width: 24rem;
  margin-top: var(--cj-space-4);
  padding-top: var(--cj-space-4);
  font-size: 1.125rem;
  line-height: 1.55;
  background: linear-gradient(var(--cj-divisor), var(--cj-divisor)) 0 0 / 64px 1.5px no-repeat;
}

.abertura__acoes {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--cj-space-2) var(--cj-space-4);
  margin-top: var(--cj-space-5);
}

.abertura__foto {
  grid-column: 3 / 5;
  position: relative;
  overflow: hidden;
  background: var(--cj-papel);
}
/* Crop from the top so the clear cap and black pump always stay in frame. */
.abertura__foto img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 20%;
}

/* Wide screens: stop the photo at the content edge so the cell stays portrait
   (at most 660 × 880, no upscaling of the 1145px source). */
@media (min-width: 1500px) {
  .abertura__foto {
    grid-column: 3;
    border-radius: 0 0 var(--cj-radius-card) var(--cj-radius-card);
  }
}

/* ---------- fragrâncias ---------- */

.fragrancias { padding-block: var(--site-secao); }

.secao-cabeca {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 22rem);
  align-items: end;
  gap: var(--cj-space-3) var(--cj-space-6);
  margin-bottom: clamp(var(--cj-space-5), 2rem + 2vw, var(--cj-space-6));
}

.secao-cabeca h2,
.uso__cabeca h2 {
  font-size: clamp(2.5rem, 1.6rem + 3vw, 4.25rem);
  line-height: 1.02;
}

.secao-cabeca p { padding-bottom: var(--cj-space-1); }

.fragrancias__lista {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(14px, 1.6vw, 24px);
}

.fragrancia {
  --tinta: var(--cj-papel);
  container-type: inline-size;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(1.75rem, 1.2rem + 1.5vw, 2.5rem) var(--site-card-inset) var(--site-card-inset);
  border-radius: var(--cj-radius-card);
  background: var(--tinta);
  text-align: center;
}
.fragrancia--bamboo { --tinta: var(--cj-bamboo); }
.fragrancia--primeira-luz { --tinta: var(--cj-primeira-luz); }
.fragrancia--vanilla { --tinta: var(--cj-vanilla); }

.fragrancia .linha-produto { padding-left: var(--cj-track-caps); }

.fragrancia__nome {
  margin-top: var(--cj-space-1);
  font-size: clamp(2.75rem, 2rem + 1.6vw, 3.5rem);
  line-height: 1;
}

.fragrancia__desc {
  flex: 1 0 auto;          /* longer descriptions push nothing out of line: photos stay level */
  max-width: 19rem;
  margin-top: var(--cj-space-2);
  padding-inline: var(--cj-space-1);
}

.fragrancia__foto {
  width: 100%;
  margin-top: var(--cj-space-3);
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: calc(var(--cj-radius-card) - var(--site-card-inset));
  background: var(--cj-papel);
}
/* Label close-up: at 1.55× with the origin at 53% the window runs from about 19% to 83%
   of the photo height – the whole pump collar (21–32%) and the label (47–81%) stay in frame. */
.fragrancia__foto img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
  transform: scale(1.55);
  transform-origin: 50% 53%;
}

.fragrancia__base {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--cj-space-2);
  width: 100%;
  padding: var(--cj-space-3) var(--cj-space-1) var(--cj-space-1);
}

/* rem, so it follows the visitor's font size; wraps instead of spilling out of the card. */
@container (min-width: 21.75rem) {
  .fragrancia__base {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
    column-gap: var(--cj-space-1);   /* row needs about 343px, so it fits from 21.75rem */
    padding: 1.1rem 0.25rem 0.1rem 0.85rem;
  }
  .fragrancia__base .botao { padding-inline: 1.1rem; }
}

/* ---------- como usar ---------- */

.uso { padding-block: 0 var(--site-secao); }

.uso__grade {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: var(--cj-space-5) var(--cj-space-6);
  align-items: start;
}

.uso__grade::before {
  content: "";
  grid-column: 1 / -1;
  height: 1px;
  margin-bottom: calc(var(--site-secao) - var(--cj-space-5));
  background: var(--cj-divisor);
}

.uso__cabeca p { max-width: 20rem; margin-top: var(--cj-space-3); }

.uso__lista { border-top: 1px solid var(--cj-divisor); }

.uso__item {
  display: grid;
  grid-template-columns: minmax(9rem, 2fr) minmax(0, 5fr);
  gap: var(--cj-space-1) var(--cj-space-4);
  align-items: baseline;
  padding-block: var(--cj-space-3);
  border-bottom: 1px solid var(--cj-divisor);
}

.uso__item dt {
  font-family: var(--cj-font-display);
  font-weight: var(--cj-weight-display);
  font-size: 1.75rem;
  line-height: 1.15;
}

.uso__item dd { max-width: 30rem; }

/* ---------- label card (shared with the 404) ---------- */

.rotulo {
  container-type: inline-size;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(100%, 38rem);
  border-radius: clamp(16px, 4.3vw, 26px);
  background: var(--cj-rotulo);
  text-align: center;
}

/* ---------- a marca: the label itself, at large scale ---------- */

.marca { padding-block: 0 var(--site-secao); }

.marca__grade {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  gap: var(--cj-space-5) var(--cj-space-6);
  align-items: center;
}

/* Everything below is sized in cqi against the card's content width, using the
   label's own ratios: CASA JOY 16cqi; HOME SPRAY 0.32×, fragrance 0.36×, volume 0.31×
   of it; symbol height 1.22× the wordmark size. The 555 × 706 shape is kept. */
.rotulo--marca {
  justify-self: start;
  aspect-ratio: 555 / 706;
  justify-content: center;
  padding: clamp(var(--cj-space-4), 6vw, var(--cj-space-6)) clamp(1.25rem, 4vw, 2.75rem);
}

.rotulo__simbolo { width: 23cqi; }

.rotulo__nome {
  margin-top: 0.095em;     /* symbol → cap height = 0.28 × font size (lockup rule) */
  font-size: 16cqi;        /* cqi only, so the wordmark always fits on one line */
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}

.rotulo--marca .linha-produto {
  margin-top: 8cqi;
  padding-left: var(--cj-track-caps);
  font-size: clamp(0.8125rem, 5.1cqi, 1.6rem);
}

.rotulo__divisor {
  width: 58%;
  height: 1px;
  margin: 9cqi 0 0;
  border: 0;
  background: var(--cj-divisor);
}

.rotulo__fragrancias {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25em;
  margin-top: 8cqi;
  font-size: clamp(0.875rem, 5.8cqi, 1.8rem);
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: var(--cj-track-fragrance);
  text-transform: uppercase;
}
.rotulo__fragrancias li { padding-left: var(--cj-track-fragrance); }

.rotulo--marca .tamanhos {
  margin-top: 9cqi;
  font-size: clamp(0.875rem, 4.9cqi, 1.5rem);
}

.marca__manifesto {
  max-width: 24em;
  padding-top: var(--cj-space-4);
  font-family: var(--cj-font-display);
  font-weight: var(--cj-weight-display);
  font-size: clamp(1.375rem, 0.9rem + 1.1vw, 2rem);
  line-height: 1.4;
  background: linear-gradient(var(--cj-divisor), var(--cj-divisor)) 0 0 / 64px 1.5px no-repeat;
}

/* ---------- footer with the closing call ---------- */

.rodape {
  padding-block: var(--site-secao) var(--cj-space-3);
  background: var(--cj-oliva);
  color: var(--cj-rotulo);
}
.rodape :focus-visible { outline-color: var(--cj-rotulo); }

.rodape__chamada {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: var(--cj-space-5) var(--cj-space-6);
  align-items: center;
}

.rodape__logo { width: clamp(150px, 15vw, 210px); justify-self: center; }

.rodape__titulo {
  max-width: 11em;
  font-size: clamp(2.5rem, 1.6rem + 3vw, 4.25rem);
  line-height: 1.04;
}

.rodape__texto p { max-width: 28rem; margin-top: var(--cj-space-3); }
.rodape__texto .botao { margin-top: var(--cj-space-4); }

.rodape__base {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--cj-space-1) var(--cj-space-4);
  margin-top: clamp(var(--cj-space-6), 3rem + 6vw, var(--cj-space-8));
  padding-top: var(--cj-space-2);
  border-top: 1px solid var(--site-linha-creme);
  font-size: 0.9375rem;
}

.rodape__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--cj-space-4);
}
.rodape__links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  text-decoration: none;
}
.rodape__links a:hover {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.35em;
}

.rodape__copy { letter-spacing: 0.02em; }

/* ---------- 404 ---------- */

.erro {
  display: grid;
  place-items: center;
  min-height: 100svh;
  padding: var(--cj-space-4) var(--site-gutter);
}
.erro .rotulo {
  width: min(100%, 32rem);
  padding: clamp(2.5rem, 2rem + 4vw, 4.5rem) clamp(1.5rem, 1rem + 4vw, 3.5rem);
}
.rotulo__logo { width: clamp(140px, 36cqi, 176px); }
.erro .linha-produto { margin-top: var(--cj-space-5); padding-left: var(--cj-track-caps); }
.erro h1 {
  margin-top: var(--cj-space-2);
  font-size: clamp(2.5rem, 11cqi, 3.75rem);
  line-height: 1.02;
}
.erro p:not(.linha-produto) { max-width: 22rem; margin-top: var(--cj-space-3); }
.erro .botao { margin-top: var(--cj-space-4); }

/* ---------- responsive ---------- */

@media (max-width: 1080px) {
  .fragrancia__nome { font-size: 2.6rem; }
}

@media (max-width: 899px) {
  /* Two-row header: logo + WhatsApp on top, the three anchors underneath. */
  .topo__barra {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "marca cta"
      "nav nav";
    min-height: 0;
    padding-top: 0.75rem;
  }
  .topo__marca { grid-area: marca; }
  .botao--topo { grid-area: cta; padding-inline: 1.1rem; font-size: 0.8125rem; letter-spacing: 0.04em; }
  .topo__nav {
    grid-area: nav;
    margin-top: var(--cj-space-1);
    border-block: 1px solid var(--cj-divisor);
  }
  .topo__nav ul { gap: 0 var(--cj-space-5); }

  /* Tablet keeps the two-column hero; its height follows the text. */
  .abertura { min-height: 0; }
  .abertura__texto { padding-block: var(--cj-space-5); padding-right: var(--cj-space-3); }

  .secao-cabeca { grid-template-columns: minmax(0, 1fr); }

  .fragrancias__lista {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--cj-space-5);
  }

  .uso__grade { grid-template-columns: minmax(0, 1fr); }

  .rodape__chamada { grid-template-columns: minmax(0, 1fr); }
  .rodape__logo { justify-self: start; }
}

/* Tablet: horizontal fragrance cards – photo left, text right, aligned to the envelope. */
@media (min-width: 600px) and (max-width: 899px) {
  .fragrancia {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    grid-template-rows: 1fr auto auto auto auto 1fr;
    grid-template-areas:
      "foto ."
      "foto linha"
      "foto nome"
      "foto desc"
      "foto base"
      "foto .";
    column-gap: var(--cj-space-4);
    align-items: start;
    padding: var(--site-card-inset) var(--cj-space-4) var(--site-card-inset) var(--site-card-inset);
    text-align: left;
  }
  .fragrancia .linha-produto { grid-area: linha; padding-left: 0; }
  .fragrancia__nome { grid-area: nome; }
  .fragrancia__desc { grid-area: desc; max-width: 22rem; padding-inline: 0; }
  .fragrancia__foto { grid-area: foto; align-self: center; margin-top: 0; }
  .fragrancia .fragrancia__base {
    grid-area: base;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--cj-space-2);
    padding: var(--cj-space-3) 0 0;
  }
}

@media (max-width: 760px) {
  .uso__item { grid-template-columns: minmax(0, 1fr); }
  .uso__item dt { font-size: 1.6rem; }

  .rodape__base { flex-direction: column; align-items: flex-start; }
  .rodape__links { gap: 0 var(--cj-space-3); }
}

/* Phones and small tablets: the hero stacks. */
@media (max-width: 719px) {
  .abertura { grid-template-columns: var(--site-gutter) minmax(0, 1fr) var(--site-gutter); }
  .abertura__texto { grid-column: 2; padding: var(--cj-space-5) 0 var(--cj-space-5); }
  .abertura__foto {
    grid-column: 2;
    aspect-ratio: 5 / 6;
    border-radius: var(--cj-radius-card);
  }

  /* The label, then the manifesto underneath. */
  .marca__grade { grid-template-columns: minmax(0, 1fr); }
  .rotulo--marca { justify-self: center; }
  .marca__manifesto { justify-self: center; width: min(100%, 38rem); max-width: none; }
}

/* Phones: square label close-ups so the cards do not repeat the hero scene.
   At 1.55× in a square crop the origin sits low (97%) to centre the label (47–81%). */
@media (max-width: 599px) {
  .fragrancia__foto { aspect-ratio: 1 / 1; }
  .fragrancia__foto img { transform-origin: 50% 97%; }
}

@media (max-width: 520px) {
  /* The hero CTA follows right below, so the header keeps only the brand and the anchors. */
  .botao--topo { display: none; }
  .topo__nav ul { flex-wrap: wrap; justify-content: space-between; gap: 0 var(--cj-space-2); }
  .botao { white-space: normal; max-width: 100%; }
  .fragrancia__nome { font-size: 2.25rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
