/* =========================================================================
   MFM LOJA — LINKS OFICIAIS
   Design system herdado de savana.mfmloja.com (modo escuro)
   ========================================================================= */

/* -------------------------------------------------------------------------
   1. TOKENS
   ------------------------------------------------------------------------- */
:root {
  /* Superfícies */
  --bg:            #14100C;
  --bg-alt:        #1A140F;
  --surface:       #1E1811;
  --surface-hi:    #241D15;

  /* Tinta */
  --ink:           #F5EFE0;
  --ink-soft:      #C4BBAB;
  --ink-mute:      #8A8278;
  --ink-faint:     #5C554C;

  /* Linhas */
  --line:          rgba(245, 239, 224, 0.10);
  --line-strong:   rgba(245, 239, 224, 0.22);
  --grid-line:     rgba(245, 239, 224, 0.035);

  /* Accent */
  --accent:        #FFC61A;
  --accent-deep:   #E6AC00;
  --accent-dim:    rgba(255, 198, 26, 0.32);
  --on-accent:     #1F1812;

  /* Tipografia */
  --font-display:  'Bricolage Grotesque', system-ui, sans-serif;
  --font-body:     'Inter', system-ui, sans-serif;
  --font-mono:     'JetBrains Mono', ui-monospace, monospace;

  /* Métrica */
  --shell:         520px;
  --pad-x:         clamp(20px, 6vw, 40px);
  --pad-y:         clamp(40px, 9vh, 88px);

  /* Movimento */
  --ease:          cubic-bezier(0.22, 1, 0.36, 1);
}

/* -------------------------------------------------------------------------
   2. RESET
   ------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

* { margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100svh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }

a { color: inherit; text-decoration: none; }

::selection { background: var(--accent); color: var(--on-accent); }

.skip-link {
  position: absolute;
  top: -100px; left: 12px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--accent);
  color: var(--on-accent);
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  transition: top 0.2s ease;
}
.skip-link:focus { top: 12px; }

/* -------------------------------------------------------------------------
   3. CAMADAS DE FUNDO
   ------------------------------------------------------------------------- */

/* Malha técnica — mesma linguagem do grid do Savana */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 72px 72px;
  background-position: center top;
  -webkit-mask-image: radial-gradient(ellipse 85% 60% at 50% 24%, #000 20%, transparent 100%);
          mask-image: radial-gradient(ellipse 85% 60% at 50% 24%, #000 20%, transparent 100%);
}

/* Brilho âmbar no topo */
.bg-glow {
  position: fixed;
  top: -26vh;
  left: 50%;
  z-index: 0;
  width: min(940px, 155vw);
  aspect-ratio: 1;
  margin-left: calc(min(940px, 155vw) / -2);
  pointer-events: none;
  background: radial-gradient(circle at 50% 50%,
              rgba(255, 198, 26, 0.095) 0%,
              rgba(255, 198, 26, 0.035) 34%,
              transparent 64%);
}

/* Granulado sutil — tira o aspecto "chapado" do fundo escuro */
.bg-noise {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* -------------------------------------------------------------------------
   4. ESTRUTURA
   ------------------------------------------------------------------------- */
.page {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100svh;
  padding: var(--pad-y) var(--pad-x);
}

.shell {
  position: relative;
  width: 100%;
  max-width: var(--shell);
}

/* Marcas de canto */
.corner {
  position: absolute;
  width: 14px;
  height: 14px;
  border: 1px solid var(--line-strong);
}
.corner--tl { top: -18px; left: -18px;  border-right: 0; border-bottom: 0; }
.corner--tr { top: -18px; right: -18px; border-left: 0;  border-bottom: 0; }
.corner--bl { bottom: -18px; left: -18px;  border-right: 0; border-top: 0; }
.corner--br { bottom: -18px; right: -18px; border-left: 0;  border-top: 0; }

/* -------------------------------------------------------------------------
   5. CABEÇALHO
   ------------------------------------------------------------------------- */
.hero { text-align: center; }

.hero__logo {
  display: flex;
  justify-content: center;
  margin-bottom: 22px;
}

.hero__logo img {
  width: clamp(112px, 26vw, 140px);
  height: auto;
  /* Logo original é preto: invertido para branco quente da marca */
  filter: invert(1) sepia(0.14) saturate(1.1) brightness(1.04);
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 13px;
  border: 1px solid var(--line-strong);
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  white-space: nowrap;
}
.hero__badge svg { color: var(--accent); }

.hero__bio {
  max-width: 42ch;
  margin: 20px auto 0;
  color: var(--ink-mute);
  font-size: clamp(13.5px, 3.4vw, 14.5px);
  line-height: 1.65;
  text-wrap: balance;
}

/* Régua divisória com rótulo */
.rule {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: clamp(30px, 6vh, 42px) 0 clamp(18px, 3vh, 24px);
}

.rule__line {
  position: relative;
  flex: 1;
  height: 1px;
  background: var(--line);
  overflow: hidden;
}

.rule__label {
  color: var(--ink-mute);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  white-space: nowrap;
}

/* -------------------------------------------------------------------------
   6. LINKS — o núcleo da página
   ------------------------------------------------------------------------- */
.links {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.link {
  position: relative;
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 15px 17px;
  background: var(--surface);
  border: 1px solid var(--line);
  isolation: isolate;
  cursor: pointer;
  transition:
    transform 0.34s var(--ease),
    background 0.34s var(--ease),
    border-color 0.34s var(--ease);
}

/* Marcador âmbar que cresce na borda esquerda */
.link::before {
  content: '';
  position: absolute;
  top: -1px;
  bottom: -1px;
  left: -1px;
  width: 2px;
  background: var(--accent);
  transform: scaleY(0);
  transform-origin: center;
  transition: transform 0.42s var(--ease);
}

/* Véu quente que acende a partir da esquerda */
.link::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(100deg,
              rgba(255, 198, 26, 0.075) 0%,
              rgba(255, 198, 26, 0.022) 38%,
              transparent 72%);
  opacity: 0;
  transition: opacity 0.42s var(--ease);
}

.link__index {
  color: var(--ink-faint);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  transition: color 0.28s var(--ease);
}

.link__icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  background: rgba(245, 239, 224, 0.025);
  color: var(--ink);
  transition: border-color 0.34s var(--ease), background 0.34s var(--ease);
}

/* Tamanhos calibrados por MEDIÇÃO, não a olho.
   Rasterizei cada asset, medi a caixa de tinta real e a densidade dentro dela,
   e resolvi o tamanho que dá a mesma área de tinta (~430px²) para todos —
   assim os quatro pesam igual mesmo tendo formatos diferentes.

     logo             proporção   densidade   →  render
     mercado-livre      1.44        0.80         28 × 19
     shopee             0.89        0.72         23 × 26
     mark-mfm           2.01        0.55         32 × 16
     instagram          1.00        0.45         31 × 31
     whatsapp           1.00        0.79         23 × 23                       */
.link__icon img,
.link__icon svg {
  object-fit: contain;
}

.link__icon--ml img     { width: 28px; height: 19px; }
.link__icon--shopee img { width: 23px; height: 26px; }
.link__icon--mark img   { width: 32px; height: 16px; opacity: 0.95; }
.link__icon--ig img     { width: 31px; height: 31px; }
.link__icon--wa svg     { width: 23px; height: 23px; color: #25D366; }

.link__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.link__title {
  font-family: var(--font-display);
  font-size: clamp(15.5px, 4vw, 17px);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.2;
  transition: color 0.28s var(--ease);
}

.link__sub {
  overflow: hidden;
  color: var(--ink-mute);
  font-size: 11.5px;
  line-height: 1.35;
  letter-spacing: 0.005em;
  white-space: nowrap;
  text-overflow: ellipsis;
  transition: color 0.28s var(--ease);
}

.link__arrow {
  display: grid;
  place-items: center;
  color: var(--ink-faint);
  transition: color 0.28s var(--ease), transform 0.32s var(--ease);
}

/* ---- Estado ativo: hover no desktop, toque no mobile ---- */
.link:hover,
.link:focus-visible,
.link.is-pressed {
  transform: translateY(-2px);
  background: var(--surface-hi);
  border-color: rgba(245, 239, 224, 0.20);
  outline: none;
}

.link:hover::before,
.link:focus-visible::before,
.link.is-pressed::before { transform: scaleY(1); }

.link:hover::after,
.link:focus-visible::after,
.link.is-pressed::after { opacity: 1; }

.link:hover .link__sub,
.link:focus-visible .link__sub,
.link.is-pressed .link__sub { color: var(--ink-soft); }

.link:hover .link__index,
.link:focus-visible .link__index,
.link.is-pressed .link__index { color: var(--accent); }

.link:hover .link__icon,
.link:focus-visible .link__icon,
.link.is-pressed .link__icon { border-color: rgba(245, 239, 224, 0.34); }

.link:hover .link__arrow,
.link:focus-visible .link__arrow,
.link.is-pressed .link__arrow {
  color: var(--accent);
  transform: translate(2px, -2px);
}

.link:active { transform: translateY(0); }

/* Foco por teclado — anel visível */
.link:focus-visible { box-shadow: 0 0 0 2px var(--bg), 0 0 0 3px var(--accent); }

/* -------------------------------------------------------------------------
   7. SELOS
   ------------------------------------------------------------------------- */
.seals {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 9px 18px;
  margin-top: clamp(26px, 5vh, 36px);
  padding-top: clamp(22px, 4vh, 28px);
  border-top: 1px solid var(--line);
}

.seal {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  white-space: nowrap;
  transition: color 0.25s ease;
}
.seal svg { color: var(--accent); opacity: 0.9; flex-shrink: 0; }
.seal:hover { color: var(--ink); }

/* -------------------------------------------------------------------------
   8. RODAPÉ
   ------------------------------------------------------------------------- */
.foot {
  margin-top: clamp(30px, 6vh, 44px);
  text-align: center;
}

.foot__text {
  margin-top: 14px;
  color: var(--ink-mute);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

/* -------------------------------------------------------------------------
   9. RESPONSIVO
   ------------------------------------------------------------------------- */

/* Telas muito estreitas (320–380px) */
@media (max-width: 380px) {
  .link { gap: 11px; padding: 13px 13px; }
  .link__icon { width: 38px; height: 38px; }
  .link__icon svg { width: 19px; height: 19px; }
  .link__index { display: none; }
  .link__sub { font-size: 11px; }
  .seals { gap: 8px 14px; }
  .seal { font-size: 9px; letter-spacing: 0.1em; }
  .corner { display: none; }
}

/* Tablet e acima — respira mais */
@media (min-width: 600px) {
  :root { --shell: 540px; }
  .link { padding: 17px 20px; gap: 16px; }
  .link__icon { width: 46px; height: 46px; }
  .links { gap: 13px; }
}

/* Telas grandes — escala suave sem estourar a leitura */
@media (min-width: 1600px) {
  :root { --shell: 580px; }
  body { font-size: 16px; }
  .bg-grid { background-size: 80px 80px; }
}

/* ---- Telas baixas ----------------------------------------------------
   Objetivo: os 4 botões visíveis sem rolagem em qualquer celular comum.
   A compactação é progressiva — quanto menor a altura, mais apertado. */

@media (max-height: 820px) {
  :root { --pad-y: clamp(24px, 4vh, 40px); }
  .hero__logo { margin-bottom: 16px; }
  .hero__logo img { width: clamp(92px, 22vw, 116px); }
  .hero__bio { margin-top: 14px; }
  .rule { margin: 30px 0 18px; }
  .links { gap: 10px; }
  .link { padding: 13px 16px; }
  .seals { margin-top: 30px; padding-top: 22px; }
  .foot { margin-top: 26px; }
}

@media (max-height: 700px) {
  /* O que precisa caber sem rolagem são os 4 botões. Selos, Instagram e
     rodapé podem ficar abaixo da dobra — daí os espaçamentos aqui serem
     confortáveis em vez de espremidos. */
  :root { --pad-y: 22px; }
  .hero__logo { margin-bottom: 13px; }
  .hero__logo img { width: clamp(96px, 24vw, 118px); }
  .hero__bio { margin-top: 12px; font-size: 13.5px; line-height: 1.58; }
  .rule { margin: 26px 0 15px; }
  .links { gap: 10px; }
  .link { padding: 13px 15px; }
  .link__icon { width: 40px; height: 40px; }
  .seals { margin-top: 26px; padding-top: 20px; }
  .foot { margin-top: 22px; }
  .foot__text { margin-top: 14px; }
}

@media (max-height: 610px) {
  :root { --pad-y: 16px; }
  .hero__logo { margin-bottom: 11px; }
  .hero__logo img { width: clamp(84px, 22vw, 100px); }
  .hero__badge { padding: 5px 11px; font-size: 9.5px; }
  .hero__bio { margin-top: 11px; font-size: 13px; }
  .rule { margin: 24px 0 15px; }
  .links { gap: 9px; }
  .link { padding: 12px 14px; }
  .link__icon { width: 38px; height: 38px; }
  .seals { margin-top: 24px; padding-top: 18px; }
  .foot { margin-top: 18px; }
  .foot__text { margin-top: 12px; }
}

/* Altura curta (celular deitado) */
@media (max-height: 640px) and (orientation: landscape) {
  .page { align-items: flex-start; }
  :root { --pad-y: 40px; }
}

/* Ponteiro grosso (toque): sem hover, o feedback vem do :active/is-pressed */
@media (hover: none) {
  .link:hover {
    transform: none;
    background: var(--surface);
    border-color: var(--line);
  }
  .link:hover::before { transform: scaleY(0); }
  .link:hover::after  { opacity: 0; }
  .link:hover .link__sub   { color: var(--ink-mute); }
  .link:hover .link__index { color: var(--ink-faint); }
  .link:hover .link__icon  { border-color: var(--line); }
  .link:hover .link__arrow { color: var(--ink-faint); transform: none; }
}

/* -------------------------------------------------------------------------
   10. PREFERÊNCIAS DO USUÁRIO
   ------------------------------------------------------------------------- */
/* A página não tem animação nenhuma — só transições de hover. Aqui elas são
   encurtadas para quem pede menos movimento. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .link:hover, .link:focus-visible, .link.is-pressed { transform: none; }
}

@media (prefers-contrast: more) {
  :root {
    --line:        rgba(245, 239, 224, 0.28);
    --line-strong: rgba(245, 239, 224, 0.45);
    --ink-mute:    #ACA396;
    --ink-faint:   #8A8278;
  }
}

/* -------------------------------------------------------------------------
   11. IMPRESSÃO
   ------------------------------------------------------------------------- */
@media print {
  .bg-grid, .bg-glow, .bg-noise, .corner { display: none; }
  body { background: #fff; color: #000; }
  .hero__logo img { filter: none; }
  .link { border: 1px solid #000; }
  .link__title, .link__sub, .link__index { color: #000; }
  .link::after { content: ' — ' attr(href); font-size: 10px; }
}
