/* ASM Web Solutions — scroll film (versão computador). */
:root {
  --bg: #0a0b0d;
  --bg-2: #101216;
  --ink: #f4f0e8;
  --muted: #a8a49b;
  --line: rgba(244, 240, 232, 0.12);
  --accent: #46c2f5;          /* azul do logótipo, aclarado para ler sobre fundo escuro */
  --accent-ink: #061018;
  --gutter: clamp(24px, 5vw, 80px);
  --serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--bg); color: var(--ink); -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
/* overflow-x: clip e NÃO hidden: "hidden" no body faz do body uma caixa de scroll em
   vários browsers de telemóvel (Safari do iPhone, Samsung Internet) e o palco do filme
   deixa de ficar preso (position: sticky) — sobe com a página e só se vê metade. */
body { background: var(--bg); font-family: var(--sans); font-size: 16px; line-height: 1.55; -webkit-font-smoothing: antialiased; overflow-x: clip; }
a { color: inherit; }
::selection { background: var(--accent); color: var(--accent-ink); }

.skip {
  position: fixed; z-index: 30; left: 12px; top: 12px; padding: 8px 12px; border-radius: 6px;
  background: var(--ink); color: var(--bg); transform: translateY(-200%);
}
.skip:focus { transform: none; }

/* ---------- barra de carregamento ---------- */
.film-loadbar {
  position: fixed; inset: 0 0 auto 0; height: 2px; z-index: 25; pointer-events: none;
  background: var(--accent); transform-origin: 0 50%;
  transform: scaleX(var(--film-loaded, 0));
  transition: transform 200ms var(--ease-out), opacity 400ms ease;
}
.film-ready .film-loadbar { opacity: 0; }

/* ---------- topo ---------- */
.topbar {
  position: fixed; z-index: 20; inset: 0 0 auto 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px var(--gutter);
  background: linear-gradient(to bottom, rgba(6, 7, 9, 0.55), rgba(6, 7, 9, 0));
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
/* Símbolo ASM como máscara (a mesma técnica da assinatura no donpapao.pt): a forma vem do
   SVG e a cor é a do texto, por isso fica nítido em qualquer tamanho e combina com a barra.
   Ao passar o rato ganha o gradiente da marca. */
.brand-mark {
  display: inline-block; flex: none; width: 66px; height: 27px;
  background: currentColor;
  -webkit-mask: url(assets/asm-mark.svg) center / contain no-repeat;
  mask: url(assets/asm-mark.svg) center / contain no-repeat;
  transition: opacity 250ms ease;
}
.brand:hover .brand-mark, .brand:focus-visible .brand-mark {
  background: linear-gradient(90deg, #2f73cc, #1f8fd2 50%, #3fd6f2);
}
.brand-name {
  font-size: 13px; font-weight: 500; color: var(--muted); letter-spacing: 0.16em; text-transform: uppercase;
  padding-left: 12px; border-left: 1px solid rgba(244, 240, 232, 0.22); line-height: 1.6;
}
.nav { display: flex; align-items: center; gap: 28px; font-size: 14px; }
.nav > a:not(.button) { text-decoration: none; color: rgba(244, 240, 232, 0.82); transition: color 160ms ease; }
.nav > a:not(.button):hover { color: var(--ink); }

/* ---------- pista + palco ---------- */
.film-track { position: relative; height: 1800vh; /* o motor acerta o valor */ }
/* 100lvh = altura com as barras do browser escondidas: o filme cobre sempre o ecrã todo
   (com 100svh ficava uma faixa vazia em baixo quando a barra do Firefox/Chrome se esconde). */
.film-stage { position: sticky; top: 0; height: 100vh; height: 100lvh; overflow: hidden; background: var(--bg); }
.film-canvas { display: block; width: 100%; height: 100%; opacity: 0; transition: opacity 700ms ease; }
.film-ready .film-canvas { opacity: 1; }

/* escurece a base e as laterais para os textos lerem sobre o céu claro */
.film-stage::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(to top, rgba(6, 7, 9, 0.82), rgba(6, 7, 9, 0.38) 34%, rgba(6, 7, 9, 0) 62%),
    linear-gradient(to right, rgba(6, 7, 9, 0.42), rgba(6, 7, 9, 0) 42%),
    linear-gradient(to left, rgba(6, 7, 9, 0.36), rgba(6, 7, 9, 0) 38%);
}

/* ---------- textos sobre o filme ---------- */
.film-copy {
  position: absolute; z-index: 2;
  left: var(--gutter); bottom: clamp(80px, 13vh, 150px);
  width: min(36rem, calc(100% - 2 * var(--gutter)));
  opacity: 0; visibility: hidden; will-change: opacity, transform;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45), 0 4px 32px rgba(0, 0, 0, 0.5);
}
.film-copy--right { left: auto; right: var(--gutter); width: min(30rem, calc(100% - 2 * var(--gutter))); }
.film-copy--final { width: min(40rem, calc(100% - 2 * var(--gutter))); }

.eyebrow {
  font-size: 12px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 16px;
}
.film-copy h1, .film-copy h2, .content h2 {
  font-family: var(--serif); font-weight: 400; letter-spacing: -0.01em; line-height: 1.02; text-wrap: balance;
}
.film-copy h1 { font-size: clamp(3rem, 6.2vw, 6rem); }
/* a linha pequena por cima do título faz parte do H1 (o Google lê "Criação de sites na Covilhã") */
.film-copy h1 .h1-kicker { display: block; font-family: var(--sans); line-height: 1.5; text-wrap: wrap; }
.film-copy h2 { font-size: clamp(2.4rem, 4.6vw, 4.4rem); }
.lede { margin-top: 18px; max-width: 30rem; font-size: clamp(1rem, 1.2vw, 1.15rem); color: rgba(244, 240, 232, 0.9); text-wrap: pretty; }
.cue {
  display: flex; align-items: center; gap: 12px; margin-top: 36px;
  font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted);
}
.cue-line { display: block; width: 1px; height: 36px; background: linear-gradient(var(--ink), transparent); animation: cue 2.2s var(--ease-out) infinite; transform-origin: top; }
@keyframes cue { 0% { transform: scaleY(0); opacity: 1; } 70% { transform: scaleY(1); opacity: 1; } 100% { transform: scaleY(1); opacity: 0; } }

/* ---------- botões ---------- */
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.button {
  display: inline-flex; align-items: center; padding: 14px 24px; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink); font-weight: 600; font-size: 15px; text-decoration: none; text-shadow: none;
  transition: transform 160ms var(--ease-out), background-color 160ms ease;
}
@media (hover: hover) { .button:hover { background: #6fd1f8; } }
.button:active { transform: scale(0.97); }
.button--small { padding: 9px 16px; font-size: 14px; }
.button--ghost { background: rgba(244, 240, 232, 0.08); color: var(--ink); box-shadow: inset 0 0 0 1px rgba(244, 240, 232, 0.28); backdrop-filter: blur(6px); }
@media (hover: hover) { .button--ghost:hover { background: rgba(244, 240, 232, 0.16); } }

/* ---------- conteúdo depois do filme ---------- */
.content { position: relative; z-index: 1; background: var(--bg); border-top: 1px solid var(--line); padding: clamp(96px, 15vh, 168px) 0; }
.content--alt { background: var(--bg-2); }
.wrap { width: min(74rem, 100% - 2 * var(--gutter)); margin-inline: auto; }
.content h2 { font-size: clamp(2.6rem, 4.6vw, 4.2rem); margin-bottom: 20px; }
.intro { color: var(--muted); max-width: 38rem; font-size: 1.075rem; }
.content h3 { font-size: 1.05rem; font-weight: 600; margin-bottom: 8px; }
.content li p { color: var(--muted); font-size: 0.975rem; }

.services {
  list-style: none; margin-top: 56px;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  border-top: 1px solid var(--line);
}
.services li { padding: 28px 24px 8px 0; border-bottom: 1px solid var(--line); }

/* ---------- trabalhos (portefólio) ---------- */
.case {
  margin-top: 48px; display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(28px, 4vw, 56px); align-items: center;
}
.case-img { display: block; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: var(--bg-2); }
.case-img img { display: block; width: 100%; height: auto; transition: transform 600ms var(--ease-out); }
@media (hover: hover) { .case-img:hover img { transform: scale(1.025); } }
.case-tag { font-size: 12px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.case-text h3 { font-family: var(--serif); font-weight: 400; font-size: clamp(1.7rem, 2.6vw, 2.3rem); line-height: 1.1; margin-bottom: 14px; }
.case-text > p { color: var(--muted); }
.case-list { margin: 18px 0 8px; padding-left: 1.1em; display: grid; gap: 8px; color: rgba(244, 240, 232, 0.84); font-size: 0.975rem; }
@media (max-width: 900px) { .case { grid-template-columns: 1fr; } }

.steps { list-style: none; margin-top: 56px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; }
.step-n { display: block; font-family: var(--serif); font-size: 2.6rem; line-height: 1; color: var(--accent); margin-bottom: 18px; }
@media (max-width: 900px) { .steps { grid-template-columns: 1fr 1fr; } }

.content--cta { text-align: left; }

.footer { border-top: 1px solid var(--line); padding: 56px 0 28px; font-size: 14px; color: var(--muted); }
.footer-grid { display: flex; justify-content: space-between; align-items: flex-start; gap: 40px; flex-wrap: wrap; padding-bottom: 40px; }
.footer-brand { display: flex; flex-direction: column; gap: 16px; color: var(--ink); }
.footer-brand p { color: var(--muted); line-height: 1.7; }
.brand-mark--footer { width: 86px; height: 36px; }
.footer-links { display: flex; flex-direction: column; gap: 10px; }
.footer-row { display: flex; justify-content: space-between; gap: 16px; padding-top: 24px; border-top: 1px solid var(--line); }
.footer a { text-decoration: none; }
.footer-inline { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.footer-inline a[aria-current="page"] { color: var(--ink); }
@media (hover: hover) { .footer a:hover { color: var(--ink); } }

/* ---------- páginas legais ---------- */
.legal-top { position: static; background: none; border-bottom: 1px solid var(--line); }
.legal { padding: clamp(48px, 9vh, 96px) 0 96px; }
.legal .wrap { max-width: 46rem; }
.legal h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(2.4rem, 5vw, 3.6rem); line-height: 1.05; margin-bottom: 12px; }
.legal .updated { color: var(--muted); font-size: 14px; margin-bottom: 40px; }
.legal h2 { font-size: 1.15rem; font-weight: 600; margin: 40px 0 12px; }
.legal p, .legal li { color: rgba(244, 240, 232, 0.84); }
.legal p + p { margin-top: 12px; }
.legal ul { margin: 12px 0 0 1.2em; display: grid; gap: 8px; }
.legal a { color: var(--accent); }
.legal table { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 15px; }
.legal th, .legal td { text-align: left; padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.legal th { color: var(--muted); font-weight: 500; }
.legal-id { padding: 16px 18px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255, 255, 255, 0.02); }

/* ---------- telemóvel ---------- */
html { -webkit-tap-highlight-color: transparent; }

@media (max-width: 640px) {
  :root { --gutter: 20px; }
  .topbar {
    padding: calc(14px + env(safe-area-inset-top)) var(--gutter) 14px;
    background: linear-gradient(to bottom, rgba(6, 7, 9, 0.6), rgba(6, 7, 9, 0));
  }
  .brand-mark { width: 56px; height: 23px; }
  .brand-name { font-size: 11px; letter-spacing: 0.12em; padding-left: 10px; }
  .brand { gap: 10px; }
  .nav { gap: 0; }
  .nav > a:not(.button) { display: none; }
  .button--small { padding: 8px 14px; font-size: 13px; }

  /* todos os textos em baixo, à esquerda, por cima de um degradê mais forte */
  .film-copy, .film-copy--right, .film-copy--final {
    left: var(--gutter); right: var(--gutter); width: auto;
    bottom: calc(48px + env(safe-area-inset-bottom));
    /* o palco tem a altura máxima; sobe os textos o tamanho da barra do browser,
       para nunca ficarem tapados quando ela está visível */
    bottom: calc(48px + env(safe-area-inset-bottom) + (100lvh - 100svh));
  }
  .film-stage::after {
    background:
      linear-gradient(to top, rgba(6, 7, 9, 0.92), rgba(6, 7, 9, 0.6) 32%, rgba(6, 7, 9, 0) 62%),
      linear-gradient(to bottom, rgba(6, 7, 9, 0.35), rgba(6, 7, 9, 0) 18%);
  }
  .eyebrow { font-size: 11px; margin-bottom: 12px; }
  .film-copy h1 { font-size: clamp(2.5rem, 11vw, 3.2rem); }
  .film-copy h2 { font-size: clamp(2.1rem, 9.4vw, 2.7rem); }
  .lede { margin-top: 14px; font-size: 1rem; }
  .cue { margin-top: 26px; }
  .actions { margin-top: 24px; gap: 10px; }
  .actions .button { flex: 1 1 auto; justify-content: center; }
  .button { padding: 14px 20px; }

  .content { padding: 88px 0; }
  .content h2 { font-size: clamp(2.3rem, 10vw, 2.9rem); }
  .services { margin-top: 40px; }
  .services li { padding: 22px 0 14px; }
  .steps { grid-template-columns: 1fr; gap: 28px; margin-top: 40px; }
  .step-n { font-size: 2.2rem; margin-bottom: 10px; }
  .footer { padding-bottom: calc(28px + env(safe-area-inset-bottom)); }
  .footer-row { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .film-loadbar, .film-canvas, .button { transition: none; }
  .cue-line { animation: none; }
}
