/* ==========================================================================
   O Meu Tarot — base: fontes, reset, tipografia, utilitárias
   ========================================================================== */

/* --- Fontes auto-alojadas (nenhum pedido a terceiros) -------------------- */
@font-face {
  font-family: "Cormorant Garamond";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("../fonts/cormorant-garamond-latin-var.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
                 U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F,
                 U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("../fonts/inter-latin-var.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
                 U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F,
                 U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + var(--s-4));
}

body {
  margin: 0;
  background: var(--night-900);
  color: var(--paper);
  font-family: var(--font-sans);
  font-size: var(--t-body);
  line-height: var(--lh-body);
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* Sem `overflow-x: hidden` de propósito. Em `body`, overflow-x:hidden faz o
     overflow-y computar para auto: o body passa a ser o contentor de scroll, o
     documento deixa de rolar e o `scroll-padding-top` do html (que compensa o
     header fixo nas âncoras) deixa de ter efeito. A auditoria em
     360/375/390/414/768/1024/1440 mede scrollWidth == clientWidth em todas as
     páginas, logo a rede de segurança não é precisa — e custava mais do que
     resolvia. */
}

img,
svg,
picture,
video {
  display: block;
  max-width: 100%;
  height: auto;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

/* --- Tipografia ---------------------------------------------------------- */
h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 500;
  line-height: var(--lh-title);
  letter-spacing: -0.005em;
  text-wrap: balance;
}

p, ul, ol { margin: 0; }

a {
  color: inherit;
  text-decoration-color: color-mix(in srgb, currentColor 40%, transparent);
  text-underline-offset: 0.22em;
  transition: color var(--dur-fast) var(--ease),
              text-decoration-color var(--dur-fast) var(--ease);
}

a:hover { text-decoration-color: currentColor; }

strong { font-weight: 600; }

/* Papéis de título — usar sempre estas classes, nunca tamanhos soltos. */
.t-hero        { font-size: var(--t-hero); line-height: var(--lh-tight); }
.t-page-title  { font-size: var(--t-page-title); }
.t-block-title { font-size: var(--t-block-title); }
.t-sub-title   { font-size: var(--t-sub-title); font-weight: 500; }
.t-card-title  { font-size: var(--t-card-title); }

.t-panel-title {
  font-family: var(--font-sans);
  font-size: var(--t-panel-title);
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: var(--track-caps);
  text-transform: uppercase;
}

.lead {
  font-size: var(--t-lead);
  line-height: 1.62;
  color: var(--fg);
  /* Sem isto, "O Tarot não decide nada por ti. Ajuda a ver." partia com
     "a ver." órfão na segunda linha. */
  text-wrap: balance;
}

/* As utilitárias (.flow, .mt-*, .text-*) estão em utilities.css, carregado
   depois dos componentes — ver o comentário no topo desse ficheiro. */

/* --- Acessibilidade ------------------------------------------------------ */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--gold-400);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

[data-surface="paper"] :where(a, button, input, select, textarea):focus-visible {
  outline-color: var(--gold-700);
}

.skip-link {
  position: absolute;
  top: var(--s-2);
  left: var(--s-2);
  z-index: 100;
  padding: var(--s-3) var(--s-4);
  background: var(--gold-400);
  color: var(--night-950);
  font-size: var(--t-small);
  font-weight: 600;
  border-radius: var(--r-sm);
  transform: translateY(-200%);
  transition: transform var(--dur) var(--ease);
}

.skip-link:focus { transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
