/* ==================================================================
 * Apropesca OP — main.css
 * Paleta A ("Mar Ibérico"). Mobile-first, sem dependências externas.
 * Budget: ≤50KB (este ficheiro deve ficar abaixo de 20KB minificado).
 * ================================================================== */

@layer reset, tokens, base, layout, components, utilities;

/* ------------------------------------------------------------------
 * 0 · Fontes self-hosted (Inter 400 + 600)
 * ------------------------------------------------------------------ */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/Inter-Regular.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/fonts/Inter-SemiBold.woff2") format("woff2");
}

/* ------------------------------------------------------------------
 * 1 · Reset minimalista
 * ------------------------------------------------------------------ */
@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  html { -webkit-text-size-adjust: 100%; }
  body, h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd { margin: 0; }
  ul, ol { margin: 0; padding: 0; }
  img, svg { display: block; max-width: 100%; height: auto; }
  video { display: block; }
  button { font: inherit; cursor: pointer; background: none; border: 0; padding: 0; color: inherit; }
  a { color: inherit; text-decoration: none; }
  input, textarea, select { font: inherit; color: inherit; }
  :focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
    border-radius: 2px;
  }
  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
      animation-duration: 0.01ms !important;
      transition-duration: 0.01ms !important;
    }
  }
}

/* ------------------------------------------------------------------
 * 2 · Tokens
 * ------------------------------------------------------------------ */
@layer tokens {
  :root {
    /* cor — paleta A "Mar Ibérico" */
    --bg:        #FAFAF7;
    --fg:        #0E1824;
    --primary:   #0B4A6F;
    --primary-ink: #083a58; /* primária escurecida para hover */
    --accent:    #D3A44A;
    --accent-ink: #b1882f;
    --muted:     #5B6775;
    --line:      #E5E5E0;
    --surface:   #FFFFFF;

    /* tipografia */
    --ff: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --fs-xs:   0.75rem;
    --fs-sm:   0.875rem;
    --fs-base: 1rem;
    --fs-lg:   1.25rem;
    --fs-xl:   1.563rem;
    --fs-2xl:  1.953rem;
    --fs-3xl:  2.441rem;
    --fs-hero: clamp(2.25rem, 5vw + 1rem, 3.75rem);
    --lh-tight:  1.15;
    --lh-normal: 1.55;
    --lh-loose:  1.7;

    /* espaço */
    --sp-1: 4px;  --sp-2: 8px;  --sp-3: 16px; --sp-4: 24px;
    --sp-5: 32px; --sp-6: 48px; --sp-7: 64px; --sp-8: 96px; --sp-9: 128px;

    /* raio */
    --r-1: 4px;
    --r-2: 8px;

    /* sombras */
    --sh-sm: 0 1px 2px rgba(14,24,36,0.04);
    --sh-md: 0 4px 12px rgba(14,24,36,0.06);

    /* movimento */
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --t-fast: 150ms;
    --t-base: 250ms;

    /* containers */
    --wrap:     1200px;
    --wrap-wide: 1440px;
  }
}

/* ------------------------------------------------------------------
 * 3 · Base — tipografia + cores
 * ------------------------------------------------------------------ */
@layer base {
  html { color-scheme: light; }

  body {
    font-family: var(--ff);
    font-size: var(--fs-base);
    line-height: var(--lh-normal);
    color: var(--fg);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
  }

  h1, h2, h3, h4 {
    font-weight: 600;
    line-height: var(--lh-tight);
    letter-spacing: -0.015em;
  }
  h1 { font-size: var(--fs-3xl); }
  h2 { font-size: var(--fs-2xl); }
  h3 { font-size: var(--fs-xl); }
  h4 { font-size: var(--fs-lg); }

  p { max-width: 70ch; }
  p + p { margin-top: var(--sp-3); }

  a {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
    transition: color var(--t-fast) var(--ease);
  }
  a:hover { color: var(--primary-ink); }

  strong { font-weight: 600; }

  hr {
    border: 0;
    border-top: 1px solid var(--line);
    margin: var(--sp-6) 0;
  }

  /* selecção */
  ::selection { background: var(--primary); color: var(--bg); }

  /* skip-link a11y */
  .skip-link {
    position: absolute;
    top: -100px;
    left: var(--sp-3);
    background: var(--fg);
    color: var(--bg);
    padding: var(--sp-2) var(--sp-3);
    border-radius: var(--r-1);
    z-index: 100;
    text-decoration: none;
  }
  .skip-link:focus { top: var(--sp-3); }
}

/* ------------------------------------------------------------------
 * 4 · Layout — containers, grid, spacing utilities
 * ------------------------------------------------------------------ */
@layer layout {
  .wrap {
    width: 100%;
    max-width: var(--wrap);
    margin-inline: auto;
    padding-inline: var(--sp-4);
  }
  @media (min-width: 768px) {
    .wrap { padding-inline: var(--sp-5); }
  }

  .wrap-wide {
    width: 100%;
    max-width: var(--wrap-wide);
    margin-inline: auto;
    padding-inline: var(--sp-4);
  }

  /* secções verticais */
  .section {
    padding-block: var(--sp-7);
  }
  @media (min-width: 1024px) {
    .section { padding-block: var(--sp-8); }
  }

  .section--tight { padding-block: var(--sp-6); }

  /* grid responsivo */
  .grid {
    display: grid;
    gap: var(--sp-4);
  }
  .grid--2 { grid-template-columns: 1fr; }
  .grid--3 { grid-template-columns: 1fr; }
  @media (min-width: 768px) {
    .grid--2 { grid-template-columns: repeat(2, 1fr); }
    .grid--3 { grid-template-columns: repeat(2, 1fr); }
  }
  @media (min-width: 1024px) {
    .grid--3 { grid-template-columns: repeat(3, 1fr); gap: var(--sp-5); }
    .grid--2 { gap: var(--sp-6); }
  }

  /* títulos de secção */
  .section__title {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    font-size: var(--fs-sm);
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--fg);
    margin-bottom: var(--sp-5);
  }
  .section__title::before {
    content: "";
    width: 32px;
    height: 2px;
    background: var(--accent);
    flex-shrink: 0;
  }
}

/* ------------------------------------------------------------------
 * 5 · Componentes
 * ------------------------------------------------------------------ */
@layer components {

  /* ---------- Header + Nav ----------
     Header fixo e transparente sobre o primeiro bloco (hero no home,
     page-header nas interiores — ambos têm fundo escuro). Quando o
     utilizador desce para além desse bloco, o JS aplica a classe
     `.site-header--solid` que activa o estado frosted-glass. */
  .site-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    background: transparent;
    border-bottom: 1px solid transparent;
    color: var(--bg);
    z-index: 50;
    transition:
      background-color var(--t-base) var(--ease),
      border-color var(--t-base) var(--ease),
      color var(--t-base) var(--ease);
  }
  .site-header .site-header__brand-name { color: var(--bg); }
  .site-header .site-header__brand-tagline { color: rgba(255, 255, 255, 0.65); }
  .site-header .nav__link { color: var(--bg); }
  .site-header .menu-toggle { color: var(--bg); }
  /* Painel submenu mantém-se sempre claro (fundo próprio). */
  .site-header .nav__submenu,
  .site-header .nav__submenu a { color: var(--fg); }

  .site-header--solid {
    background: rgba(250, 250, 247, 0.92);
    backdrop-filter: saturate(1.1) blur(10px);
    -webkit-backdrop-filter: saturate(1.1) blur(10px);
    border-bottom-color: var(--line);
    color: var(--fg);
  }
  .site-header--solid .site-header__brand-name,
  .site-header--solid .nav__link,
  .site-header--solid .menu-toggle { color: var(--fg); }
  .site-header--solid .site-header__brand-tagline { color: var(--muted); }

  /* Compensar o header fixo nas páginas interiores (o page-header é o
     primeiro bloco; acrescentamos a altura do header ao padding-top). */
  main > .page-header:first-child { padding-top: calc(72px + var(--sp-7)); }
  .site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-4);
    min-height: 72px;
  }
  .site-header__brand {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    text-decoration: none;
    color: inherit;
  }
  .site-header__logo {
    height: 48px;
    width: auto;
  }
  /* Logo branca por defeito (header transparente). A variante azul aparece
     quando o header passa a frosted-glass. */
  .site-header__logo--on-light { display: none; }
  .site-header__logo--on-dark { display: block; }
  .site-header--solid .site-header__logo--on-light { display: block; }
  .site-header--solid .site-header__logo--on-dark { display: none; }
  .site-header__brand-text {
    display: none;
    line-height: 1.15;
  }
  @media (min-width: 768px) {
    .site-header__brand-text { display: block; }
  }
  .site-header__brand-name {
    font-weight: 600;
    font-size: var(--fs-base);
    letter-spacing: -0.01em;
    color: var(--fg);
    display: block;
  }
  .site-header__brand-tagline {
    font-size: var(--fs-xs);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
  }

  .nav {
    display: none;
  }
  @media (min-width: 1024px) {
    .nav { display: block; }
  }
  .nav__list {
    display: flex;
    list-style: none;
    gap: var(--sp-5);
    align-items: center;
  }
  .nav__item { position: relative; }
  .nav__link {
    font-size: var(--fs-sm);
    font-weight: 500;
    letter-spacing: 0.02em;
    color: var(--fg);
    text-decoration: none;
    padding-block: var(--sp-3);
    border-bottom: 2px solid transparent;
    transition: border-color var(--t-fast) var(--ease);
  }
  .nav__link:hover,
  .nav__link[aria-current="page"],
  .nav__item[data-active="true"] > .nav__link {
    border-bottom-color: var(--accent);
  }
  .nav__link[aria-current="page"],
  .nav__item[data-active="true"] > .nav__link {
    font-weight: 700;
  }
  .nav__chevron {
    display: inline-block;
    width: 8px; height: 8px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
    margin-left: var(--sp-1);
  }

  .nav__submenu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-2);
    box-shadow: var(--sh-md);
    padding: var(--sp-2);
    list-style: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(4px);
    transition: opacity var(--t-fast) var(--ease),
                transform var(--t-fast) var(--ease),
                visibility var(--t-fast) var(--ease);
  }
  .nav__item:hover > .nav__submenu,
  .nav__item:focus-within > .nav__submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
  .nav__submenu a {
    display: block;
    padding: var(--sp-2) var(--sp-3);
    font-size: var(--fs-sm);
    border-radius: var(--r-1);
    text-decoration: none;
    color: var(--fg);
  }
  .nav__submenu a:hover { background: var(--bg); color: var(--primary); }

  /* ---------- Menu mobile ---------- */
  .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px; height: 44px;
    color: var(--fg);
  }
  @media (min-width: 1024px) {
    .menu-toggle { display: none; }
  }
  .menu-toggle__bars { position: relative; width: 22px; height: 2px; background: currentColor; }
  .menu-toggle__bars::before,
  .menu-toggle__bars::after {
    content: ""; position: absolute; left: 0;
    width: 22px; height: 2px; background: currentColor;
    transition: transform var(--t-fast) var(--ease);
  }
  .menu-toggle__bars::before { top: -7px; }
  .menu-toggle__bars::after  { top: 7px; }

  .mobile-nav {
    position: fixed;
    inset: 0;
    background: var(--bg);
    z-index: 60;
    transform: translateX(-100%);
    transition: transform var(--t-base) var(--ease);
    overflow-y: auto;
    padding: var(--sp-3) var(--sp-4) var(--sp-7);
  }
  .mobile-nav[data-open="true"] { transform: translateX(0); }

  .mobile-nav__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 72px;
  }
  .mobile-nav__close {
    width: 44px; height: 44px;
    font-size: 28px;
    line-height: 1;
  }
  .mobile-nav__list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
    margin-top: var(--sp-4);
  }
  .mobile-nav__list a {
    display: block;
    padding: var(--sp-3) var(--sp-2);
    font-size: var(--fs-lg);
    font-weight: 500;
    border-bottom: 1px solid var(--line);
    text-decoration: none;
    color: var(--fg);
  }
  .mobile-nav__sub {
    list-style: none;
    padding-left: var(--sp-4);
  }
  .mobile-nav__sub a {
    font-size: var(--fs-base);
    font-weight: 400;
    color: var(--muted);
  }
  .mobile-nav__footer {
    margin-top: var(--sp-6);
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
    color: var(--muted);
    font-size: var(--fs-sm);
  }

  /* ---------- Botões ---------- */
  .btn {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    padding: var(--sp-3) var(--sp-4);
    font-size: var(--fs-sm);
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: 0;
    transition: background-color var(--t-fast) var(--ease),
                color var(--t-fast) var(--ease),
                border-color var(--t-fast) var(--ease);
  }
  .btn--primary {
    background: var(--fg);
    color: var(--bg);
  }
  .btn--primary:hover { background: var(--primary); color: var(--bg); }
  .btn--ghost {
    border-color: var(--fg);
    color: var(--fg);
  }
  .btn--ghost:hover { background: var(--fg); color: var(--bg); }
  .btn--accent {
    background: var(--accent);
    color: var(--fg);
  }
  .btn--accent:hover { background: var(--accent-ink); color: var(--bg); }
  .btn__arrow::after { content: "→"; margin-left: var(--sp-1); }

  /* ---------- Link com seta ---------- */
  .link-arrow {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    font-weight: 600;
    font-size: var(--fs-sm);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-decoration: none;
    border-bottom: 1px solid currentColor;
    padding-bottom: 2px;
  }
  .link-arrow::after { content: "→"; transition: transform var(--t-fast) var(--ease); }
  .link-arrow:hover::after { transform: translateX(3px); }

  /* ---------- Hero (home) ---------- */
  .hero {
    position: relative;
    background-color: var(--fg);
    color: var(--bg);
    overflow: hidden;
    isolation: isolate;
    /* Altura explícita (não só min-height) para que os filhos absolutos
       com inset:0 resolvam para o viewport completo. */
    height: 100vh;         /* fallback */
    height: 100svh;
    min-height: 640px;
    display: flex;
    align-items: center;
    padding-block: var(--sp-8);
  }
  /* Imagem fallback (também identidade quando vídeo está a carregar). */
  .hero__fallback {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    z-index: 0;
  }
  /* Vídeo de fundo (autoplay silencioso). Fica atrás do overlay e do texto. */
  .hero__video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    z-index: 0;
    /* O ficheiro MP4 tem letterbox baked-in (~87px top+bottom em 720).
       scale(1.33) "zoom" para empurrar as barras pretas para fora
       do viewport, deixando só o conteúdo visível. */
    transform: scale(1.33);
    transform-origin: center;
    /* Começa invisível; JS revela quando o vídeo está pronto. */
    opacity: 0;
    transition: opacity 400ms var(--ease);
  }
  .hero__video[data-ready="true"] { opacity: 1; }
  /* Overlay azul — mais escuro à esquerda (onde vive o texto) e leve à
     direita para deixar a imagem/vídeo respirar. */
  .hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(
      90deg,
      rgba(11, 24, 40, 0.70) 0%,
      rgba(11, 24, 40, 0.45) 35%,
      rgba(11, 24, 40, 0.15) 70%,
      rgba(11, 24, 40, 0.05) 100%);
    pointer-events: none;
  }
  /* Pequena sombra inferior para fundir com o resto da página. */
  .hero::after {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    height: 120px;
    z-index: 1;
    background: linear-gradient(180deg, transparent, rgba(11, 24, 40, 0.55));
    pointer-events: none;
  }
  /* Quem prefere menos movimento não vê o vídeo — a imagem de fundo do
     .hero fica como fallback estático automaticamente. */
  @media (prefers-reduced-motion: reduce) {
    .hero__video { display: none; }
  }
  .hero__inner {
    position: relative;
    z-index: 2;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--sp-6);
    align-items: center;
  }
  @media (min-width: 1024px) {
    .hero__inner { grid-template-columns: 1.4fr 1fr; gap: var(--sp-8); }
  }
  .hero__eyebrow {
    display: inline-block;
    font-size: var(--fs-xs);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: var(--sp-4);
  }
  .hero__title {
    font-size: var(--fs-hero);
    line-height: var(--lh-tight);
    letter-spacing: -0.025em;
    max-width: 16ch;
    margin-bottom: var(--sp-5);
    color: var(--bg);
  }
  .hero__title::after {
    content: "";
    display: block;
    width: 56px;
    height: 3px;
    background: var(--accent);
    margin-top: var(--sp-5);
  }
  .hero__lead {
    font-size: var(--fs-lg);
    color: rgba(255,255,255,0.72);
    max-width: 52ch;
    margin-bottom: var(--sp-6);
  }
  .hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-3);
    align-items: center;
  }
  /* marca "EST. 1985" — elemento tipográfico identitário */
  .hero__mark {
    justify-self: center;
    text-align: center;
    font-family: var(--ff);
    color: var(--accent);
    border: 1px solid rgba(211,164,74,0.4);
    padding: var(--sp-5) var(--sp-6);
    aspect-ratio: 1;
    width: min(260px, 100%);
    display: grid;
    place-content: center;
    gap: var(--sp-2);
  }
  .hero__mark-eyebrow {
    font-size: var(--fs-sm);
    letter-spacing: 0.3em;
    text-transform: uppercase;
    opacity: 0.8;
  }
  .hero__mark-year {
    font-size: clamp(3rem, 5vw, 4.5rem);
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1;
  }
  .hero__mark-subtitle {
    font-size: var(--fs-xs);
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.6);
    margin-top: var(--sp-2);
    border-top: 1px solid rgba(211,164,74,0.25);
    padding-top: var(--sp-3);
  }
  @media (max-width: 767px) {
    .hero__mark { width: 200px; }
  }

  /* ---------- Page header (bandas azuis das páginas interiores) ---------- */
  .page-header {
    --page-header-bg: url("/assets/img/slide-ap-02-scaled.jpg");
    position: relative;
    background: var(--primary);
    color: var(--bg);
    padding-block: var(--sp-7) var(--sp-8);
    overflow: hidden;
    isolation: isolate;
  }
  .page-header::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image:
      linear-gradient(135deg, rgba(11, 74, 111, 0.55) 0%, rgba(14, 24, 36, 0.75) 100%),
      var(--page-header-bg);
    background-position: center, var(--page-header-pos, center);
    background-size: cover;
    background-repeat: no-repeat;
  }
  .page-header::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: min(1200px, 100%);
    height: 1px;
    background: rgba(211,164,74,0.35);
    z-index: 1;
  }
  .page-header__breadcrumb {
    font-size: var(--fs-xs);
    letter-spacing: 0.08em;
    color: rgba(255,255,255,0.55);
    margin-bottom: var(--sp-5);
    text-transform: uppercase;
  }
  .page-header__breadcrumb a {
    color: inherit;
    text-decoration: none;
  }
  .page-header__breadcrumb a:hover { color: var(--accent); }
  .page-header__breadcrumb span[aria-current] { color: rgba(255,255,255,0.85); }
  .page-header__breadcrumb .breadcrumb__sep { margin-inline: var(--sp-2); color: rgba(211,164,74,0.5); }

  .page-header__eyebrow {
    display: inline-block;
    font-size: var(--fs-xs);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: var(--sp-3);
  }
  .page-header__title {
    font-size: clamp(2rem, 3vw + 1rem, 3rem);
    line-height: var(--lh-tight);
    letter-spacing: -0.02em;
    max-width: 24ch;
    margin: 0 0 var(--sp-4);
    color: var(--bg);
  }
  .page-header__title::after {
    content: "";
    display: block;
    width: 48px;
    height: 3px;
    background: var(--accent);
    margin-top: var(--sp-4);
  }
  .page-header__lead {
    font-size: var(--fs-lg);
    color: rgba(255,255,255,0.72);
    max-width: 62ch;
    margin: 0;
  }
  .page-header__meta {
    font-size: var(--fs-xs);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.6);
    margin-top: var(--sp-4);
  }

  /* ---------- Pull quote (mensagem presidente) ---------- */
  .pull-quote {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--sp-5);
    align-items: start;
    position: relative;
  }
  @media (min-width: 768px) {
    .pull-quote { grid-template-columns: auto 1fr; gap: var(--sp-7); }
  }
  .pull-quote::before {
    content: "\201C"; /* aspa curva dupla */
    position: absolute;
    top: -24px;
    left: -4px;
    font-size: 120px;
    line-height: 1;
    color: var(--accent);
    opacity: 0.35;
    font-family: Georgia, "Times New Roman", serif;
    pointer-events: none;
  }
  @media (min-width: 768px) {
    .pull-quote::before { top: -40px; left: -12px; font-size: 180px; }
  }
  .pull-quote__avatar {
    width: 140px; height: 140px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--line);
    padding: 4px;
    background: var(--bg);
  }
  .pull-quote__text {
    font-size: var(--fs-lg);
    line-height: var(--lh-loose);
    color: var(--fg);
    max-width: 55ch;
    position: relative;
  }
  .pull-quote__attribution {
    margin-top: var(--sp-4);
    font-size: var(--fs-sm);
    color: var(--fg);
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: var(--sp-3);
  }
  .pull-quote__attribution::before {
    content: "";
    width: 24px;
    height: 2px;
    background: var(--accent);
  }

  /* ---------- Card ---------- */
  .card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-2);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: border-color var(--t-fast) var(--ease),
                transform var(--t-fast) var(--ease);
  }
  .card:hover {
    border-color: var(--muted);
    transform: translateY(-2px);
  }
  .card__image-wrap {
    aspect-ratio: 16 / 10;
    background: var(--line);
    overflow: hidden;
  }
  .card__image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  .card__body {
    padding: var(--sp-4);
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
    flex: 1;
  }
  .card__meta {
    font-size: var(--fs-xs);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
  }
  .card__title {
    font-size: var(--fs-lg);
    line-height: var(--lh-tight);
  }
  .card__title a { color: inherit; text-decoration: none; }
  .card__title a:hover { color: var(--primary); }
  .card__excerpt {
    color: var(--muted);
    font-size: var(--fs-sm);
  }

  /* ---------- Accordion (projectos) ---------- */
  .accordion { border-top: 1px solid var(--line); }
  .accordion__item { border-bottom: 1px solid var(--line); }
  .accordion__header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--sp-4) 0;
    font-size: var(--fs-lg);
    font-weight: 600;
    text-align: left;
    color: var(--fg);
  }
  .accordion__sign {
    flex-shrink: 0;
    width: 20px; height: 20px;
    position: relative;
    margin-left: var(--sp-3);
  }
  .accordion__sign::before,
  .accordion__sign::after {
    content: "";
    position: absolute;
    background: var(--fg);
    transition: transform var(--t-fast) var(--ease);
  }
  .accordion__sign::before {
    top: 9px; left: 0; width: 100%; height: 2px;
  }
  .accordion__sign::after {
    top: 0; left: 9px; width: 2px; height: 100%;
  }
  .accordion__item[open] .accordion__sign::after {
    transform: scaleY(0);
  }
  .accordion__body {
    padding-bottom: var(--sp-5);
    color: var(--muted);
    max-width: 75ch;
  }
  .accordion__body dl {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: var(--sp-2) var(--sp-4);
    margin-block: var(--sp-3);
    color: var(--fg);
    font-size: var(--fs-sm);
  }
  .accordion__body dt { color: var(--muted); }
  .accordion__body dd { margin: 0; }

  /* ---------- Formulário ----------
     Forma sóbria, sem card. Os campos fluem no grid da página, com o
     mesmo ritmo vertical das outras secções (gap sp-4 = 24px). */
  .field { display: grid; gap: var(--sp-2); }
  .field__label {
    font-size: var(--fs-sm);
    font-weight: 500;
    color: var(--fg);
  }
  .field__label abbr {
    border: 0;
    color: var(--accent);
    text-decoration: none;
    margin-left: 2px;
  }
  .field__input,
  .field__textarea {
    width: 100%;
    padding: var(--sp-3);
    border: 1px solid var(--line);
    border-radius: var(--r-1);
    background: var(--bg);
    font: inherit;
    color: var(--fg);
    transition: border-color var(--t-fast) var(--ease),
                box-shadow var(--t-fast) var(--ease);
  }
  .field__textarea {
    resize: vertical;
    min-height: 160px;
    line-height: var(--lh-normal);
  }
  .field__input:hover,
  .field__textarea:hover { border-color: #c9c9c3; }
  .field__input:focus,
  .field__textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(11, 74, 111, 0.14);
  }
  /* Estado inválido — só depois do utilizador ter escrito algo.
     O placeholder " " (espaço) activa :placeholder-shown. */
  .field__input:not(:placeholder-shown):invalid,
  .field__textarea:not(:placeholder-shown):invalid { border-color: #c0392b; }
  .field__input:not(:placeholder-shown):invalid:focus,
  .field__textarea:not(:placeholder-shown):invalid:focus {
    box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.14);
  }
  .field__help { font-size: var(--fs-xs); color: var(--muted); }

  .field--consent label {
    display: grid;
    grid-template-columns: 18px 1fr;
    gap: var(--sp-3);
    align-items: start;
    font-size: var(--fs-sm);
    color: var(--muted);
    line-height: var(--lh-normal);
    cursor: pointer;
  }
  .field--consent input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 3px 0 0;
    accent-color: var(--primary);
  }

  /* Honeypots: invisíveis mas presentes no DOM. Bots preenchem e
     a validação server-side (fase 4) rejeita o submit. */
  .field__hp {
    position: absolute !important;
    left: -10000px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }

  /* ---------- Footer ---------- */
  .site-footer {
    background: var(--fg);
    color: var(--bg);
    margin-top: var(--sp-9);
  }
  .site-footer a { color: var(--bg); text-decoration: none; }
  .site-footer a:hover { color: var(--accent); }
  .site-footer__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--sp-6);
    padding-block: var(--sp-7);
  }
  @media (min-width: 768px) {
    .site-footer__grid { grid-template-columns: 1.5fr 1fr 1fr; }
  }
  .site-footer__title {
    font-size: var(--fs-xs);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: var(--sp-3);
  }
  .site-footer__list { list-style: none; display: grid; gap: var(--sp-2); font-size: var(--fs-sm); }
  .site-footer__legal {
    border-top: 1px solid rgba(255,255,255,0.08);
    padding-block: var(--sp-4);
    font-size: var(--fs-xs);
    color: var(--muted);
  }
  .socials { display: flex; gap: var(--sp-2); margin-top: var(--sp-3); }
  .socials a {
    display: inline-flex;
    width: 36px; height: 36px;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 50%;
    transition: background var(--t-fast) var(--ease),
                border-color var(--t-fast) var(--ease);
  }
  .socials a:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--fg);
  }

  /* ---------- Breadcrumb ---------- */
  .breadcrumb {
    font-size: var(--fs-sm);
    color: var(--muted);
    padding-top: var(--sp-4);
  }
  .breadcrumb a { color: inherit; }
  .breadcrumb a:hover { color: var(--primary); }
  .breadcrumb__sep { margin-inline: var(--sp-2); }

  /* ---------- Prose (texto longo dentro de página) ---------- */
  .prose { max-width: 70ch; color: var(--fg); }
  .prose > * + * { margin-top: var(--sp-3); }
  .prose h2 {
    font-size: var(--fs-xl);
    margin-top: var(--sp-6);
    padding-bottom: var(--sp-2);
    border-bottom: 1px solid var(--line);
  }
  .prose h3 {
    font-size: var(--fs-lg);
    margin-top: var(--sp-5);
  }
  .prose ul, .prose ol {
    padding-left: 1.25em;
    color: var(--fg);
  }
  .prose li + li { margin-top: var(--sp-1); }
  .prose img {
    margin-block: var(--sp-5);
    border-radius: var(--r-2);
  }
  .prose a {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 3px;
  }
  .prose blockquote {
    border-left: 3px solid var(--accent);
    padding-left: var(--sp-3);
    color: var(--muted);
    font-style: italic;
  }

  /* ---------- Contacto ----------
     Duas colunas em desktop: detalhes (40%) + formulário (60%).
     Em mobile, stack simples. Ritmo vertical em sp-6 entre blocos
     dentro da coluna de detalhes. */
  .contact-layout {
    display: grid;
    gap: var(--sp-7);
  }
  @media (min-width: 1024px) {
    .contact-layout {
      grid-template-columns: 2fr 3fr;
      gap: var(--sp-8);
      align-items: start;
    }
  }

  .contact-details {
    display: grid;
    gap: var(--sp-6);
    align-content: start;
  }

  .contact-block { display: grid; gap: var(--sp-2); }
  .contact-block__label {
    margin: 0;
    font-size: var(--fs-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
  }
  .contact-block__body {
    margin: 0;
    font-size: var(--fs-base);
    line-height: var(--lh-normal);
    color: var(--fg);
  }
  .contact-block__body a {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid var(--line);
    transition: border-color var(--t-fast) var(--ease);
  }
  .contact-block__body a:hover { border-bottom-color: var(--primary); }
  .contact-block__link { margin-top: var(--sp-1); }

  .contact-phones {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0;
  }
  .contact-phones li {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--sp-4);
    padding: var(--sp-3) 0;
    border-bottom: 1px solid var(--line);
  }
  .contact-phones li:first-child { padding-top: 0; }
  .contact-phones li:last-child { border-bottom: 0; padding-bottom: 0; }
  .contact-phones a {
    font-size: var(--fs-lg);
    font-weight: 500;
    color: var(--fg);
    text-decoration: none;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.01em;
    transition: color var(--t-fast) var(--ease);
  }
  .contact-phones a:hover { color: var(--primary); }
  .contact-phones span {
    font-size: var(--fs-xs);
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
  }

  .contact-hours {
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-1) var(--sp-3);
    font-size: var(--fs-base);
    color: var(--fg);
    font-variant-numeric: tabular-nums;
  }
  .contact-hours span + span::before {
    content: "";
    display: inline-block;
    width: 16px;
    height: 1px;
    background: var(--line);
    vertical-align: middle;
    margin-right: var(--sp-3);
  }

  .contact-form { display: grid; gap: var(--sp-4); }
  .contact-form__head {
    display: grid;
    gap: var(--sp-2);
    margin-bottom: var(--sp-2);
  }
  .contact-form__lead {
    margin: 0;
    font-size: var(--fs-base);
    color: var(--muted);
    line-height: var(--lh-normal);
  }


  /* ---------- TOC lateral (Quem somos) ---------- */
  .page-with-toc {
    display: grid;
    gap: var(--sp-6);
  }
  @media (min-width: 1024px) {
    .page-with-toc { grid-template-columns: 1fr 240px; gap: var(--sp-8); }
  }
  .toc {
    font-size: var(--fs-sm);
  }
  .toc__title {
    font-size: var(--fs-xs);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
    margin-bottom: var(--sp-2);
  }
  .toc__list { list-style: none; display: grid; gap: var(--sp-2); }
  .toc__list a { color: var(--muted); text-decoration: none; }
  .toc__list a:hover { color: var(--primary); }
  @media (min-width: 1024px) {
    .toc { position: sticky; top: 96px; align-self: start; }
  }
}

/* ------------------------------------------------------------------
 * 6 · Utilidades
 * ------------------------------------------------------------------ */
@layer utilities {
  .sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap; border: 0;
  }
  .text-muted { color: var(--muted); }
  .text-center { text-align: center; }
  .flex { display: flex; }
  .flex-between { display: flex; align-items: center; justify-content: space-between; }
  .mt-5 { margin-top: var(--sp-5); }
  .mt-6 { margin-top: var(--sp-6); }
  .mb-4 { margin-bottom: var(--sp-4); }
  .gap-3 { gap: var(--sp-3); }
  [hidden] { display: none !important; }
}
