@font-face {
  font-family: "Fraunces";
  src: url("/assets/fonts/fraunces-latin-full-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("/assets/fonts/fraunces-latin-full-italic.woff2") format("woff2");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Manrope";
  src: url("/assets/fonts/manrope-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}

/* Paleta: o violeta e o coral vêm do símbolo; o resto do fundo do mar. */
:root {
  --abyss: #0a0d24;
  --deep: #11163a;
  --tide: #1a2150;
  --violet: #6e78cf;
  --violet-soft: #a3a9f0;
  --coral: #f0988c;
  --coral-hot: #f2546a;
  --mint: #bee0c9;
  --sky: #99bbd0;
  --foam: #f6f1ea;
  --muted: #a9acc9;
  --line: rgba(246, 241, 234, 0.12);
  --radius: 22px;
  --serif: "Fraunces", "Iowan Old Style", Georgia, serif;
  --sans: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --gutter: clamp(20px, 5vw, 72px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

html { background: var(--abyss); }
body {
  margin: 0;
  background:
    radial-gradient(1200px 700px at 85% 0, rgba(110, 120, 207, 0.35), transparent 60%),
    radial-gradient(900px 600px at -10% 900px, rgba(240, 152, 140, 0.12), transparent 60%),
    radial-gradient(1000px 800px at 110% 55%, rgba(110, 120, 207, 0.14), transparent 60%),
    linear-gradient(180deg, var(--deep) 0, var(--abyss) 1200px, #060818 100%);
  background-color: var(--abyss);
  color: var(--foam);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 500;
  font-variation-settings: "SOFT" 100, "WONK" 1, "opsz" 144;
  line-height: 1.04;
  letter-spacing: -0.02em;
  margin: 0;
}
h1 i, h2 i {
  font-style: italic;
  background: linear-gradient(90deg, var(--coral), var(--violet-soft));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  padding-right: 0.08em;
  margin-right: -0.08em;
}
.eyebrow {
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--coral);
  font-weight: 700;
  margin: 0 0 18px;
}
.lead { color: var(--muted); font-size: clamp(17px, 1.4vw, 20px); max-width: 38em; }

.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 16px; z-index: 50; background: var(--foam); color: var(--abyss); padding: 8px 14px; border-radius: 8px; }

/* Navegação */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(14px + env(safe-area-inset-top, 0px)) var(--gutter) 14px;
  transition: background 0.3s, backdrop-filter 0.3s;
}
.nav.scrolled { background: rgba(10, 13, 36, 0.72); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; font-family: var(--serif); font-size: clamp(17px, 4.6vw, 21px); font-weight: 600; white-space: nowrap; }
.brand img { flex: none; }
@media (max-width: 380px) { .brand { gap: 8px; } .brand img { width: 30px; height: 30px; } }
.brand em { font-style: italic; font-weight: 400; color: var(--coral); }
.nav nav { display: flex; align-items: center; gap: clamp(12px, 2.4vw, 32px); }
.nav nav a { text-decoration: none; color: var(--muted); font-weight: 600; font-size: 15px; }
.nav nav a:hover { color: var(--foam); }
.langs { display: flex; gap: 2px; border: 1px solid var(--line); border-radius: 999px; padding: 4px; }
.nav nav .langs a { font-size: 13px; font-weight: 800; padding: 3px 9px; border-radius: 999px; color: var(--muted); }
.nav nav .langs a[aria-current] { background: var(--foam); color: var(--abyss); }
@media (max-width: 860px) { .nav nav > a { display: none; } }

/* Topo com o polvo */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: 120px var(--gutter) 80px;
  overflow: hidden;
}
#octo { position: absolute; inset: 0; width: 100%; height: 100%; cursor: pointer; }
.hero-copy { position: relative; max-width: 640px; pointer-events: none; }
.hero-copy a { pointer-events: auto; }
.hero h1 { font-size: clamp(44px, 6.4vw, 92px); margin-bottom: 26px; }
.ctas { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; }
.hint {
  position: absolute; right: var(--gutter); bottom: 34px; margin: 0;
  font-family: var(--serif); font-style: italic; color: var(--muted); font-size: 16px;
  opacity: 0; animation: fade-in 1s 3s forwards;
}
@keyframes fade-in { to { opacity: 0.8; } }
@media (max-width: 899px) {
  .hero { align-items: flex-end; padding-top: calc(42svh + 40px); min-height: auto; }
  #octo { height: 46svh; inset: 0 0 auto 0; -webkit-mask-image: linear-gradient(to bottom, #000 72%, transparent); mask-image: linear-gradient(to bottom, #000 72%, transparent); }
  .hint { display: none; }
}
@media (min-width: 900px) { .hero-copy { max-width: min(640px, 54%); } }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font: inherit; font-weight: 700; font-size: 16px; text-decoration: none; cursor: pointer;
  padding: 15px 26px; border-radius: 999px; border: 1px solid transparent;
  transition: transform 0.2s, background 0.2s, border-color 0.2s;
}
.btn:hover { transform: translateY(-2px); }
.btn.primary { background: linear-gradient(100deg, var(--coral), #f6b4a8); color: var(--abyss); box-shadow: 0 10px 40px -12px rgba(240, 152, 140, 0.7); }
.btn.ghost { background: rgba(246, 241, 234, 0.04); border-color: var(--line); color: var(--foam); backdrop-filter: blur(6px); }
.btn.ghost:hover { border-color: rgba(246, 241, 234, 0.35); }
.btn.small { padding: 10px 18px; font-size: 14px; }

/* Faixa com palavras a correr */
.marquee { overflow: hidden; border-block: 1px solid var(--line); padding: 18px 0; background: rgba(17, 22, 58, 0.5); }
.track { display: flex; gap: 56px; width: max-content; animation: slide 38s linear infinite; }
.track span { font-family: var(--serif); font-style: italic; font-size: clamp(22px, 3vw, 34px); color: var(--muted); white-space: nowrap; }
.track span::after { content: "✺"; font-style: normal; color: var(--coral); margin-left: 56px; font-size: 0.6em; vertical-align: middle; }
@keyframes slide { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .track { animation: none; } }

/* Secções */
section:not(.hero) { padding: clamp(80px, 12vw, 150px) var(--gutter); }
.section-head { max-width: 860px; margin-bottom: clamp(40px, 6vw, 70px); }
.section-head h2, .contact h2 { font-size: clamp(36px, 4.8vw, 68px); margin-bottom: 22px; }

.pillars { display: grid; grid-template-columns: 1fr; gap: 20px; }
@media (min-width: 700px) { .pillars, .how { grid-template-columns: repeat(3, 1fr); } .pillar { padding: 26px; } }
.pillar {
  position: relative; padding: 32px; border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(26, 33, 80, 0.85), rgba(17, 22, 58, 0.6));
  border: 1px solid var(--line); overflow: hidden;
}
.pillar::before {
  content: ""; position: absolute; width: 220px; height: 220px; right: -80px; top: -80px; border-radius: 50%;
  background: var(--glow); opacity: 0.22; filter: blur(30px);
}
.pillar.play { --glow: var(--coral); }
.pillar.watch { --glow: var(--violet); }
.pillar.learn { --glow: var(--mint); }
.pillar h3 { font-size: 34px; margin: 18px 0 10px; }
.pillar p { color: var(--muted); margin: 0; }
.icon svg { width: 48px; height: 48px; fill: none; stroke: var(--glow); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

.how { list-style: none; padding: 0; margin: 56px 0 0; display: grid; grid-template-columns: 1fr; gap: 28px; counter-reset: how; }
.how li { counter-increment: how; color: var(--muted); padding-top: 18px; border-top: 1px solid var(--line); }
.how li::before { content: "0" counter(how); display: block; font-family: var(--serif); font-size: 15px; color: var(--coral); margin-bottom: 8px; }
.how b { color: var(--foam); }

/* Projetos */
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 30px; }
.filters button {
  font: inherit; font-weight: 700; font-size: 15px; cursor: pointer;
  padding: 10px 20px; border-radius: 999px; border: 1px solid var(--line);
  background: transparent; color: var(--muted);
}
.filters button[aria-pressed="true"] { background: var(--foam); color: var(--abyss); border-color: var(--foam); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 20px; }
.card {
  position: relative; display: flex; flex-direction: column; border-radius: var(--radius); overflow: hidden;
  background: rgba(17, 22, 58, 0.75); border: 1px solid var(--line);
  transition: transform 0.25s, border-color 0.25s;
}
.card:hover { transform: translateY(-4px); border-color: rgba(246, 241, 234, 0.3); }
.card[hidden] { display: none; }
.card .art {
  position: relative; aspect-ratio: 16 / 10; display: grid; place-items: center; overflow: hidden;
  background: radial-gradient(circle at 30% 20%, color-mix(in srgb, var(--accent) 55%, transparent), transparent 60%),
              linear-gradient(150deg, color-mix(in srgb, var(--accent) 30%, var(--tide)), var(--deep));
}
.card .art svg { width: 38%; height: auto; fill: none; stroke: var(--foam); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; opacity: 0.92; }
.card .art .blocks { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; width: 42%; }
.card .art .blocks i { aspect-ratio: 1; border-radius: 6px; box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.25); }
.card .art .blocks i.empty { background: rgba(255, 255, 255, 0.06); box-shadow: none; }
.card .body { padding: 24px 26px 28px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card h3 { font-size: 28px; }
.card p { color: var(--muted); margin: 0; font-size: 16px; }
.meta { list-style: none; margin: 0; padding: 12px 0 0; display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }
.meta li { font-size: 12px; font-weight: 700; letter-spacing: 0.04em; padding: 5px 10px; border-radius: 999px; background: rgba(246, 241, 234, 0.07); color: var(--muted); }
.status { position: absolute; top: 14px; left: 14px; z-index: 1; font-size: 12px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; padding: 6px 12px; border-radius: 999px; background: rgba(10, 13, 36, 0.7); backdrop-filter: blur(6px); }
.status.dev { color: var(--coral); }
.status.prod { color: var(--violet-soft); }
.status.soon { color: var(--mint); }
.status.live { color: var(--abyss); background: var(--mint); }

/* Curiosidade */
.fact { text-align: center; background: linear-gradient(180deg, transparent, rgba(110, 120, 207, 0.12), transparent); }
.fact blockquote {
  font-family: var(--serif); font-style: italic; font-weight: 400;
  font-size: clamp(26px, 3.6vw, 46px); line-height: 1.2; max-width: 22em; margin: 0 auto 30px; min-height: 2.4em;
  transition: opacity 0.3s;
}

/* Trabalhar connosco */
.services { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0 32px; }
.services li { display: flex; flex-direction: column; gap: 6px; padding: 24px 0; border-top: 1px solid var(--line); }
.services h3 { font-size: 24px; }
.services p { color: var(--muted); margin: 0; }
.work-steps { margin-top: 44px; font-size: 18px; color: var(--muted); max-width: 44em; }
.work-steps b { color: var(--coral); }

/* Perguntas */
.faq-list { max-width: 900px; }
.faq details { border-top: 1px solid var(--line); padding: 6px 0; }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 18px 0; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary h3 { font-size: clamp(20px, 2.2vw, 26px); }
.faq summary h3 { min-width: 0; }
.faq summary::after { content: "+"; flex: 0 0 30px; text-align: center; line-height: 30px; font-size: 30px; color: var(--coral); }
.faq details[open] summary::after { content: "\2212"; }
.faq details p { color: var(--muted); margin: 0 0 20px; max-width: 48em; }

/* Contacto */
.contact { text-align: center; }
.contact .lead { margin: 0 auto 30px; }
.mail {
  display: inline-block; font-family: var(--serif); font-size: clamp(19px, 6.2vw, 64px); white-space: nowrap;
  text-decoration: none; background: linear-gradient(90deg, var(--coral), var(--violet-soft));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  border-bottom: 2px solid rgba(240, 152, 140, 0.4); padding-bottom: 4px;
}

.foot {
  display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; align-items: center;
  padding: 30px var(--gutter) calc(30px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line);
  color: var(--muted); font-size: 14px;
}
.foot div, .foot nav { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.foot a { color: var(--muted); }

/* Páginas de texto (privacidade) */
.doc { max-width: 760px; margin: 0 auto; padding: 140px var(--gutter) 100px; }
.doc h1 { font-size: clamp(38px, 5vw, 60px); margin-bottom: 12px; }
.doc h2 { font-size: 28px; margin: 48px 0 12px; }
.doc h3 { font-family: var(--sans); font-size: 18px; font-weight: 800; margin: 26px 0 6px; letter-spacing: 0; }
.doc p, .doc li { color: #d8d6e4; }
.doc ul { padding-left: 1.2em; }
.doc li { margin-bottom: 8px; }
.doc a { color: var(--coral); }
.doc table { width: 100%; border-collapse: collapse; font-size: 15px; margin: 16px 0; }
.doc th, .doc td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.doc .table { overflow-x: auto; }
/* No telemóvel cada linha da tabela vira um cartão, com o título de cada coluna ao lado do valor. */
@media (max-width: 640px) {
  .doc table, .doc tbody, .doc tr, .doc td { display: block; }
  .doc thead { display: none; }
  .doc tr { border: 1px solid var(--line); border-radius: 14px; padding: 6px 14px; margin-bottom: 14px; background: rgba(17, 22, 58, 0.6); }
  .doc td { border: 0; padding: 8px 0; }
  .doc td + td { border-top: 1px solid var(--line); }
  .doc td::before { content: attr(data-label); display: block; font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--coral); margin-bottom: 2px; }
}
.doc .updated { color: var(--muted); }

/* Aparecer ao fazer scroll */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.8s, transform 0.8s; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }
