@font-face {
  font-family: "Montserrat";
  src: url("assets/fonts/montserrat-v1.woff2") format("woff2");
  font-weight: 500 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Fraunces";
  src: url("assets/fonts/fraunces-v1.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Paleta derivada da foto (cinza do teto) e da logo (vermelho) */
  --bg-page: #828484;      /* = borda superior da imagem retrato (scripts/build-images.py) */
  --cream: #fff9f1;        /* cartões */
  --ink: #2e1d14;          /* texto principal */
  --ink-soft: #6b4a36;     /* subtítulos */
  --red: #ba001a;          /* vermelho da logo */
  --red-deep: #8e0014;

  --font-ui: "Montserrat", "Segoe UI", system-ui, sans-serif;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;

  --gutter: 16px;
  --radius: 16px;
  --ease-out: cubic-bezier(.2, .7, .2, 1);

  /* Fração inferior da imagem ocupada pelos produtos (medida pelo script de imagens:
     retrato 90,2% → produtos nos 9,8% de baixo; paisagem 72,0% → 28%), com folga. */
  --jar-share: .12;
  --img-ratio: 2.2222;     /* altura/largura da imagem retrato (foto inteira + teto, 9:20) */
  --vh: 100vh;
}

@supports (height: 100svh) {
  :root { --vh: 100svh; }
}

* { box-sizing: border-box; }

html {
  background: var(--bg-page);
  -webkit-text-size-adjust: 100%;
}

body {
  position: relative;
  margin: 0;
  min-height: var(--vh);
  overflow-x: clip;
  color: var(--ink);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
}

/* ---------- Fundo ----------
   Caixa do tamanho da tela, ancorada no FIM da página. Se tudo cabe na tela,
   equivale a um fundo fixo em tela cheia; se o conteúdo precisar rolar, os potes
   ficam abaixo dele (nunca por baixo dos botões). Ancorada embaixo: quando o
   `cover` corta altura, o corte é no teto, nunca nos produtos. A borda de cima
   esfuma para --bg-page, então não há faixa quando sobra página acima dela. */
.backdrop {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--vh);
  pointer-events: none;
}

.backdrop img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center bottom;
  /* Topo esfumado para --bg-page (sem degrau se sobrar página acima da imagem). */
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 12%);
  mask-image: linear-gradient(to bottom, transparent, #000 12%);
}

/* ---------- Página ---------- */
.page {
  position: relative;
  z-index: 1;
  min-height: var(--vh);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding:
    max(28px, calc(env(safe-area-inset-top) + 16px))
    max(var(--gutter), calc(env(safe-area-inset-right) + 12px))
    calc(var(--jar-zone) + env(safe-area-inset-bottom))
    max(var(--gutter), calc(env(safe-area-inset-left) + 12px));
  /* altura renderizada da imagem = maior entre a tela e a largura × proporção */
  --jar-zone: calc(max(var(--vh), 100vw * var(--img-ratio)) * var(--jar-share) + 16px);
}

.intro {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

.brand { margin: 0; line-height: 0; }

.brand-logo {
  display: block;
  width: clamp(104px, 17svh, 152px);
  height: auto;
}

.tagline {
  margin: 0;
  max-width: 20ch;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.3rem, 1rem + 1.5vw, 1.6rem);
  line-height: 1.18;
  letter-spacing: -.01em;
  text-wrap: balance;
  color: var(--ink);
  /* Halo claro sutil: garante ≥ 3:1 onde a frase cruza partes escuras da foto
     (ex.: portas de vidro do armário em telas ultralargas). */
  text-shadow: 0 0 14px rgba(255, 255, 255, .55);
}

.links-nav { width: 100%; max-width: 400px; }

.links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

/* ---------- Cartões de link ---------- */
.link {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 64px;
  padding: 10px 16px 10px 10px;
  border-radius: var(--radius);
  background: var(--cream);
  border: 1px solid rgba(46, 29, 20, .07);
  box-shadow:
    0 1px 2px rgba(74, 44, 24, .08),
    0 10px 24px -12px rgba(74, 44, 24, .35);
  color: var(--ink);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition:
    transform 200ms var(--ease-out),
    box-shadow 200ms var(--ease-out),
    border-color 200ms var(--ease-out);
}

.link-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--red);
  color: var(--cream);
}

.link-icon svg,
.link-arrow {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.link-icon svg { width: 22px; height: 22px; }

.link-text { flex: 1; min-width: 0; }

.link-label {
  display: block;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.25;
}

.link-sub {
  display: block;
  margin-top: 2px;
  font-weight: 500;
  font-size: .8125rem;
  line-height: 1.3;
  color: var(--ink-soft);
}

.link-arrow {
  flex: none;
  width: 20px;
  height: 20px;
  color: var(--red);
  transition: transform 200ms var(--ease-out);
}

@media (hover: hover) {
  .link:hover {
    transform: translateY(-2px);
    border-color: rgba(186, 0, 26, .22);
    box-shadow:
      0 2px 4px rgba(74, 44, 24, .1),
      0 16px 32px -14px rgba(74, 44, 24, .45);
  }
  .link:hover .link-arrow { transform: translateX(3px); }
}

.link:active {
  transform: translateY(0) scale(.98);
  box-shadow: 0 1px 2px rgba(74, 44, 24, .12);
  transition-duration: 100ms;
}

.link:focus-visible {
  outline: 3px solid var(--red-deep);
  outline-offset: 3px;
}

/* ---------- Celular em pé com pouca altura (ex.: navegador do Instagram) ---------- */
@media (orientation: portrait) and (max-height: 700px) {
  .page { gap: 14px; padding-top: max(20px, calc(env(safe-area-inset-top) + 12px)); }
  .intro { gap: 8px; }
  .tagline { font-size: 1.2rem; }
  .links { gap: 8px; }
  .link { min-height: 58px; }
}

/* ---------- Tablet em pé ---------- */
@media (orientation: portrait) and (min-width: 600px) and (min-height: 800px) {
  .page { gap: 28px; }
  .brand-logo { width: 184px; }
  .tagline { font-size: 2.1rem; }
  .links-nav { max-width: 460px; }
  .links { gap: 12px; }
  .link { min-height: 76px; }
  .link-label { font-size: 1.125rem; }
  .link-sub { font-size: .875rem; }
}

/* ---------- Paisagem (desktop, notebook, tablet deitado) ----------
   A foto (~4:3, ancorada embaixo) deixa uma faixa clara larga acima dos produtos:
   os três botões vão lado a lado para o bloco caber inteiro nela. */
@media (orientation: landscape) and (min-height: 500.02px) {
  :root {
    --jar-share: .30;   /* produtos começam em 72,0% */
    --img-ratio: .78125;   /* 3840×3000 */
  }

  /* Suaviza a vinheta do topo da foto para a cor da página (sem degrau caso
     sobre página acima da imagem em janelas baixas). Sem esfumado lateral:
     a foto inteira mostra todos os produtos. */
  .backdrop img {
    -webkit-mask-image: linear-gradient(to bottom, transparent, #000 24%);
    mask-image: linear-gradient(to bottom, transparent, #000 24%);
  }

  .page { gap: 22px; }
  .brand-logo { width: clamp(120px, 14svh, 168px); }
  .tagline { max-width: none; font-size: clamp(1.5rem, 1rem + 1vw, 2.1rem); }
}

@media (orientation: landscape) and (min-height: 500.02px) and (min-width: 900px) {
  .links-nav { max-width: 940px; }
  .links { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
}

@media (orientation: landscape) and (min-width: 1600px) and (min-height: 900px) {
  .page { gap: 28px; }
  .brand-logo { width: 184px; }
  .tagline { font-size: 2.4rem; }
  .links-nav { max-width: 1080px; }
  .links { gap: 20px; }
  .link { min-height: 80px; padding-inline: 12px 20px; }
  .link-icon { width: 52px; height: 52px; }
  .link-icon svg { width: 26px; height: 26px; }
  .link-label { font-size: 1.125rem; }
  .link-sub { font-size: .875rem; }
}

/* ---------- Celular deitado: layout dividido ----------
   Não há altura para links + potes empilhados. Links à esquerda sobre o cinza,
   versão retrato da foto na metade direita, esfumada na borda. */
@media (orientation: landscape) and (max-height: 500px) {
  .backdrop {
    left: auto;
    width: 55%;
    -webkit-mask-image: linear-gradient(to right, transparent, #000 28%);
    mask-image: linear-gradient(to right, transparent, #000 28%);
  }

  .page {
    width: 50%;
    min-width: 300px;
    gap: 12px;
    align-items: stretch;
    padding:
      max(16px, calc(env(safe-area-inset-top) + 12px))
      8px
      max(16px, calc(env(safe-area-inset-bottom) + 12px))
      max(20px, calc(env(safe-area-inset-left) + 16px));
  }
  .intro { flex-direction: row; gap: 14px; text-align: left; }
  .brand-logo { width: 88px; }
  .tagline { font-size: 1.15rem; max-width: 18ch; }
  .links-nav { max-width: none; }
  .links { gap: 8px; }
  .link { min-height: 56px; padding-block: 6px; }
  .link-icon { width: 40px; height: 40px; }
}

/* ---------- Entrada ---------- */
@media (prefers-reduced-motion: no-preference) {
  .brand, .tagline, .links li {
    animation: rise 480ms var(--ease-out) both;
  }
  .tagline { animation-delay: 80ms; }
  .links li:nth-child(1) { animation-delay: 160ms; }
  .links li:nth-child(2) { animation-delay: 230ms; }
  .links li:nth-child(3) { animation-delay: 300ms; }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .link, .link-arrow { transition: none; }
  .link:hover, .link:active, .link:hover .link-arrow { transform: none; }
}
