/*
 * O quê: estilos partilhados da homepage tugachain.com (PT em /, EN em /en/).
 * Depende de: fontes em /assets/fonts/*.woff2 (self-hosted, sem Google Fonts).
 * Usado por: /index.html e /en/index.html.
 * Ao mexer: a Cloudflare guarda /assets/* 4 h — subir o ?v= nos dois HTML ou a mudança não aparece.
 *   Paleta = marca TC v2 (brand/README.md): laranja #FF8A2B → vermelho #FF3B3B; no tema claro os
 *   tons escurecem (#C2410C/#C42020/#A34A00) para cumprir contraste AA em texto.
 */

@font-face { font-family: "Inter"; font-weight: 400; font-style: normal; font-display: swap; src: url("/assets/fonts/inter-400.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 500; font-style: normal; font-display: swap; src: url("/assets/fonts/inter-500.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 700; font-style: normal; font-display: swap; src: url("/assets/fonts/inter-700.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 700; font-style: normal; font-display: swap; src: url("/assets/fonts/poppins-700.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 800; font-style: normal; font-display: swap; src: url("/assets/fonts/poppins-800.woff2") format("woff2"); }

:root {
  --bg: #071012;
  --bg-soft: #0b1719;
  --bg-card: rgba(255, 255, 255, 0.025);
  --bg-card-hover: rgba(255, 255, 255, 0.045);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.18);
  --text: #f1f5f4;
  --muted: #a3acaa;
  --accent: #ff8a2b;
  --accent-glow: rgba(255, 138, 43, 0.2);
  --accent-2: #ff3b3b;
  --accent-2-glow: rgba(255, 59, 59, 0.12);
  --accent-3: #ff6a00;
  --on-accent: #1a0b00;
  --radius: 18px;
  --maxw: 1120px;
  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #f4f8f7;
  --bg-soft: #ffffff;
  --bg-card: rgba(0, 0, 0, 0.025);
  --bg-card-hover: rgba(0, 0, 0, 0.045);
  --border: rgba(0, 0, 0, 0.09);
  --border-strong: rgba(0, 0, 0, 0.18);
  --text: #0c1517;
  --muted: #4f5d60;
  --accent: #c2410c;
  --accent-glow: rgba(194, 65, 12, 0.12);
  --accent-2: #c42020;
  --accent-2-glow: rgba(196, 32, 32, 0.08);
  --accent-3: #a34a00;
  --on-accent: #ffffff;
  color-scheme: light;
}

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

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
  background-image:
    radial-gradient(1100px 620px at 80% -10%, var(--accent-glow), transparent 60%),
    radial-gradient(900px 560px at -10% 110%, var(--accent-2-glow), transparent 60%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
::selection { background: var(--accent); color: var(--bg); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; width: 100%; }
@media (max-width: 480px) { .wrap { padding: 0 16px; } }

.skip {
  position: absolute; left: 16px; top: -48px; z-index: 100;
  background: var(--accent); color: var(--bg); padding: 8px 14px; border-radius: 8px; font-weight: 700; font-size: 14px;
}
.skip:focus { top: 12px; }

#mesh { position: fixed; inset: 0; z-index: 0; width: 100%; height: 100%; pointer-events: none; }
#mesh.off { display: none; }

/* ----- Navigation ----- */
header.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(140%) blur(16px);
  -webkit-backdrop-filter: saturate(140%) blur(16px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
}
header.nav.scrolled { border-bottom-color: var(--border); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 68px; }

.brand { display: flex; align-items: center; gap: 10px; font-family: "Poppins", sans-serif; font-weight: 800; font-size: 19px; letter-spacing: -0.02em; }
.brand img { width: 38px; height: auto; aspect-ratio: 292 / 186; display: block; }

.nav-right { display: flex; align-items: center; gap: 22px; }
.nav-links { display: flex; align-items: center; gap: 22px; }
.nav-links a { color: var(--muted); font-size: 14.5px; font-weight: 500; transition: color 0.2s; }
.nav-links a:hover { color: var(--text); }
@media (max-width: 720px) { .nav-links { display: none; } }

.nav-tools { display: flex; align-items: center; gap: 10px; }
.lang {
  display: inline-flex; align-items: center; gap: 2px; height: 38px;
  border: 1px solid var(--border-strong); border-radius: 10px; padding: 3px; background: var(--bg-card);
}
.lang .globe { color: var(--muted); margin: 0 4px 0 7px; flex-shrink: 0; }
.lang a {
  font-size: 13px; font-weight: 700; letter-spacing: 0.04em; color: var(--muted);
  padding: 6px 10px; border-radius: 7px; transition: color 0.2s, background 0.2s;
}
.lang a:hover { color: var(--text); background: var(--bg-card-hover); }
.lang a[aria-current="true"] { color: var(--on-accent); background: var(--accent); }
@media (max-width: 380px) {
  .lang .globe { display: none; }
  .nav-tools { gap: 6px; }
  .brand { font-size: 17px; gap: 8px; }
  .lang a { padding: 6px 8px; }
}

.icon-btn {
  width: 38px; height: 38px; display: grid; place-items: center; cursor: pointer;
  border-radius: 10px; border: 1px solid var(--border); background: var(--bg-card); color: var(--muted);
  transition: color 0.2s, border-color 0.2s;
}
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); }

/* ----- Hero ----- */
main { position: relative; z-index: 2; flex: 1; }
section { position: relative; }
.hero { padding: 72px 0 40px; text-align: center; }
.hero-logo { width: clamp(150px, 19vw, 220px); height: auto; aspect-ratio: 292 / 186; margin: 0 auto 30px; display: block; filter: drop-shadow(0 18px 36px rgba(255, 80, 40, 0.22)); }
.tagline {
  display: block; margin: 0 0 20px;
  font-size: 12.5px; font-weight: 700; letter-spacing: 0.3em; text-transform: uppercase; color: var(--accent);
}
h1 {
  font-family: "Poppins", sans-serif; font-weight: 800;
  font-size: clamp(34px, 5.6vw, 64px); line-height: 1.08; letter-spacing: -0.03em;
  margin: 0 auto 20px; max-width: 18ch; text-wrap: balance;
}
.grad {
  background: linear-gradient(110deg, var(--accent) 15%, var(--accent-2) 85%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.lead { font-size: clamp(16px, 2vw, 19px); line-height: 1.65; color: var(--muted); max-width: 620px; margin: 0 auto; text-wrap: pretty; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 34px auto 0; justify-content: center; }

.btn {
  display: inline-flex; align-items: center; gap: 9px; cursor: pointer;
  padding: 12px 22px; border-radius: 12px; font-size: 14.5px; font-weight: 700; border: 1px solid transparent;
  transition: transform 0.15s, box-shadow 0.25s, border-color 0.2s;
}
.btn svg { flex-shrink: 0; }
.btn-primary { background: var(--accent); color: var(--on-accent); box-shadow: 0 8px 24px -10px var(--accent-glow); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -10px var(--accent-glow); }
.btn-ghost { border-color: var(--border); color: var(--text); background: var(--bg-card); }
.btn-ghost:hover { border-color: var(--border-strong); transform: translateY(-2px); }

/* ----- Sections ----- */
.sec { padding: 72px 0; }
.eyebrow { color: var(--accent); font-weight: 700; font-size: 12.5px; letter-spacing: 0.15em; text-transform: uppercase; display: block; }
.sec h2 { font-family: "Poppins", sans-serif; font-weight: 800; font-size: clamp(26px, 3.6vw, 38px); letter-spacing: -0.025em; margin: 10px 0 0; }
.sec .sub { color: var(--muted); font-size: 16.5px; max-width: 62ch; margin: 12px 0 0; line-height: 1.6; }

/* ----- Areas ----- */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 34px; }
@media (max-width: 900px) { .grid-3 { grid-template-columns: 1fr; } }

.area {
  padding: 26px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--bg-card);
  transition: border-color 0.25s, background 0.25s;
}
.area:hover { border-color: var(--border-strong); background: var(--bg-card-hover); }
.area .ico {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 16px;
  border: 1px solid var(--border); color: var(--accent); background: var(--bg-card);
}
.area:nth-child(2) .ico { color: var(--accent-3); }
.area:nth-child(3) .ico { color: var(--accent-2); }
.area h3 { font-family: "Poppins", sans-serif; font-weight: 700; font-size: 18px; margin: 0 0 8px; }
.area p { margin: 0; color: var(--muted); font-size: 14.5px; line-height: 1.6; }

/* ----- Projects ----- */
.projects { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 34px; }
@media (max-width: 1000px) { .projects { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 660px) { .projects { grid-template-columns: 1fr; } }

.card {
  position: relative; padding: 24px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--bg-card);
  display: flex; flex-direction: column;
  transition: transform 0.25s, border-color 0.25s, background 0.25s;
}
.card:hover { transform: translateY(-3px); border-color: var(--border-strong); background: var(--bg-card-hover); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.kind { font-size: 11.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.status {
  font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); color: var(--muted);
}
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status.live { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 35%, transparent); background: var(--accent-glow); }
.status.dev { color: var(--accent-3); border-color: color-mix(in srgb, var(--accent-3) 35%, transparent); }
.status.beta { color: var(--accent-2); border-color: color-mix(in srgb, var(--accent-2) 35%, transparent); background: var(--accent-2-glow); }

.card h3 { font-family: "Poppins", sans-serif; font-weight: 700; font-size: 18px; letter-spacing: -0.01em; margin: 0 0 8px; }
.card p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.6; flex: 1; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); }
.tag { font-size: 11.5px; font-weight: 500; color: var(--muted); border: 1px solid var(--border); padding: 2px 8px; border-radius: 6px; }
.card-link { margin-top: 14px; font-size: 13.5px; font-weight: 700; color: var(--accent); display: inline-flex; align-items: center; gap: 6px; }
.card-link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ----- About band ----- */
.band {
  padding: 48px 36px; border-radius: 24px; border: 1px solid var(--border);
  background: radial-gradient(600px 240px at 50% 0%, var(--accent-glow), transparent 70%), var(--bg-card);
  display: block;
}
.band h2 { margin-top: 8px; }
.band p { color: var(--muted); font-size: 16px; line-height: 1.65; margin: 12px 0 0; max-width: 60ch; }
@media (max-width: 760px) { .band { padding: 34px 22px; } }

/* ----- Footer ----- */
footer.site { position: relative; z-index: 2; border-top: 1px solid var(--border); margin-top: 72px; padding: 44px 0 32px; background: color-mix(in srgb, var(--bg) 50%, transparent); }
.foot-grid { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 32px; }
.foot-grid .brand { margin-bottom: 12px; }
.foot-grid p { color: var(--muted); font-size: 14px; max-width: 34ch; line-height: 1.6; margin: 0; }
.foot-links { display: flex; gap: 48px; flex-wrap: wrap; }
.foot-col h2 { font-family: "Inter", sans-serif; font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin: 0 0 12px; font-weight: 700; }
.foot-col a { display: block; color: var(--muted); font-size: 14px; padding: 4px 0; transition: color 0.2s; }
.foot-col a:hover { color: var(--accent); }
.foot-bottom { margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; color: var(--muted); font-size: 13px; }

/* ----- Reveal ----- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1); }
.reveal.in, .no-js .reveal { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .card:hover, .btn:hover { transform: none; }
}
