:root {
  --bg: #0c1116;
  --bg-2: #141b22;
  --surface: rgba(255, 255, 255, 0.05);
  --surface-2: rgba(255, 255, 255, 0.075);
  --line: rgba(255, 255, 255, 0.12);
  --line-hover: rgba(58, 174, 157, 0.4);
  --text: #e8edf1;
  --muted: #9aa8b3;
  --heading: #f4f7f8;
  --accent: #3aae9d;
  --blue: #24839f;
  --card: rgba(255, 255, 255, 0.05);
  --header-bg: rgba(12, 17, 22, 0.82);
  --shadow: 0 16px 40px rgba(8, 14, 20, 0.35);
  --radius: 18px;
  --radius-sm: 10px;
  --max: 1160px;
  --font: "Libre Franklin", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --page-bg: radial-gradient(ellipse 70% 42% at 50% -8%, rgba(36, 131, 159, 0.14), transparent 58%), var(--bg);
  --toolbar-h: 58px;
  --bar: #0a1016;
  --bar-text: #e8edf1;
  color-scheme: dark;
}

html[data-theme="light"] {
  --bg: #f4f6f8;
  --bg-2: #ffffff;
  --surface: rgba(16, 28, 36, 0.04);
  --surface-2: rgba(16, 28, 36, 0.07);
  --line: rgba(16, 28, 36, 0.12);
  --line-hover: rgba(36, 131, 159, 0.45);
  --text: #1a2430;
  --muted: #4d5d6b;
  --heading: #121a22;
  --accent: #24839f;
  --blue: #24839f;
  --card: #ffffff;
  --header-bg: rgba(244, 246, 248, 0.88);
  --shadow: 0 14px 36px rgba(16, 28, 36, 0.1);
  --page-bg: radial-gradient(ellipse 70% 42% at 50% -8%, rgba(36, 131, 159, 0.1), transparent 58%), var(--bg);
  --bar: #0a1016;
  --bar-text: #e8edf1;
  color-scheme: light;
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  font-kerning: normal;
  font-optical-sizing: auto;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  background: var(--page-bg);
  -webkit-font-smoothing: antialiased;
}

body.viewer-page {
  background: var(--bar);
  overflow: hidden;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
::selection { background: rgba(36, 131, 159, 0.38); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--bg-2);
  color: var(--heading);
  padding: 0.75rem 1rem;
  z-index: 100;
}
.skip-link:focus { left: 0.75rem; top: 0.75rem; }

.wrap {
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: 72px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: var(--header-bg);
  backdrop-filter: blur(14px);
}
.site-header:has(.lang-switch.is-open) { z-index: 80; }

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
}

.brand {
  display: inline-flex;
  align-items: center;
}
.logo-header {
  height: 42px;
  width: auto;
  object-fit: contain;
}
.logo-toolbar {
  height: 30px;
  width: auto;
  object-fit: contain;
}

.header-tools {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.back {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
}
.back:hover { color: var(--heading); }

.lang-switch { position: relative; display: inline-flex; align-items: center; z-index: 1; }
.lang-switch.is-open { z-index: 1000; }
.lang-switch-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2.4rem;
  padding: 0.4rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--heading);
}
.lang-caret { transition: transform 0.2s ease; }
.lang-switch.is-open .lang-caret { transform: rotate(180deg); }
.lang-flag {
  width: 1.25rem;
  height: 0.9rem;
  border-radius: 2px;
  display: inline-block;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
  background-size: cover;
  background-position: center;
}
.lang-flag-pt { background-image: url("/assets/flags/brasil.png"); }
.lang-flag-en { background-image: url("/assets/flags/estados-unidos.png"); }
.lang-flag-es { background-image: url("/assets/flags/espanha.png"); }
.lang-flag-it { background-image: url("/assets/flags/italia.png"); }
.lang-menu {
  position: absolute;
  top: calc(100% + 0.45rem);
  right: 0;
  z-index: 1001;
  min-width: 11.5rem;
  padding: 0.35rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-2);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.lang-menu[hidden] { display: none !important; }
.lang-menu button,
.lang-menu a {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem;
  min-height: 2.75rem;
  border-radius: 8px;
  color: var(--heading);
  width: 100%;
  text-align: left;
}
.lang-menu button:hover,
.lang-menu button.is-active,
.lang-menu a:hover,
.lang-menu a.is-active { background: var(--surface); }
.lang-name { flex: 1; font-size: 0.86rem; font-weight: 600; }
.lang-code { font-size: 0.68rem; font-weight: 700; color: var(--muted); }

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--heading);
  transition: background 0.2s ease, transform 0.15s ease;
}
.theme-toggle:hover { background: var(--surface-2); }
.theme-toggle:active { transform: scale(0.98); }
.theme-toggle svg { width: 1.1rem; height: 1.1rem; display: block; }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
html[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
html[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

.hero {
  padding: 86px 0 54px;
  max-width: 760px;
}
.eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 18px;
}
.hero h1 {
  font-weight: 800;
  font-size: clamp(40px, 6vw, 68px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0 0 20px;
  color: var(--heading);
}
.hero p {
  font-size: 17px;
  line-height: 1.7;
  color: var(--muted);
  margin: 0;
  max-width: 660px;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 12px 0 24px;
}
.toolbar h2 {
  font-weight: 800;
  font-size: 27px;
  letter-spacing: -0.03em;
  margin: 0;
  color: var(--heading);
}
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.filter {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 500;
  font-size: 12px;
}
.filter:hover,
.filter.active {
  color: var(--heading);
  border-color: var(--line-hover);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  padding-bottom: 72px;
}
.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card);
  transition: 0.2s ease;
  display: block;
}
.card:hover {
  transform: translateY(-3px);
  border-color: var(--line-hover);
  background: var(--surface-2);
}
.card.hidden { display: none; }

.preview {
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid var(--line);
  background: #0a1016;
  overflow: hidden;
}
.preview-chrome {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  background: color-mix(in srgb, var(--bg-2) 88%, #000);
  border-bottom: 1px solid var(--line);
}
.preview-chrome i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--muted) 55%, transparent);
}
.preview-chrome i:nth-child(1) { background: #ff5f57; }
.preview-chrome i:nth-child(2) { background: #febc2e; }
.preview-chrome i:nth-child(3) { background: #28c840; }
.preview-chrome span {
  margin-left: 6px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--muted);
}
.preview-viewport {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--preview-accent, var(--accent)) 16%, #f7f7f5), #ffffff);
}
.preview-viewport::after {
  content: "";
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--preview-accent, var(--accent)) 28%, transparent);
  pointer-events: none;
}
.preview-frame {
  position: absolute;
  top: 0;
  left: 0;
  width: 1280px;
  height: 800px;
  border: 0;
  background: #fff;
  transform-origin: top left;
  pointer-events: none;
}
.content { padding: 20px; }
.meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
}
.arrow { color: var(--accent); font-size: 18px; }
.card h3 {
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.025em;
  margin: 18px 0 8px;
  color: var(--heading);
}
.card p {
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
  margin: 0;
}

footer {
  border-top: 1px solid var(--line);
  padding: 28px 0 34px;
  color: var(--muted);
  font-size: 12px;
}
.footer-row {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
}

/* Viewer */
.toolbar-bar {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--toolbar-h);
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0 0.75rem;
  background: linear-gradient(180deg, #0b1822 0%, var(--bar) 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--bar-text);
}
.toolbar-brand {
  display: inline-flex;
  align-items: center;
  margin-right: 0.35rem;
  padding-right: 0.7rem;
  border-right: 1px solid rgba(255, 255, 255, 0.12);
  flex-shrink: 0;
}
.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}
.tool-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 40px;
  min-width: 40px;
  padding: 0 0.8rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 650;
  color: var(--bar-text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.tool-btn:hover,
.tool-btn:focus-visible {
  background: rgba(58, 174, 157, 0.28);
  border-color: rgba(58, 174, 157, 0.55);
  outline: none;
}
.tool-btn.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.tool-btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.toolbar-title {
  flex: 1;
  min-width: 0;
  margin: 0 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0.92;
}
.toolbar-badge {
  display: none;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
  padding: 0.28rem 0.55rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
}
@media (min-width: 720px) {
  .toolbar-badge { display: inline-block; }
  .tool-btn .label-short { display: none; }
}
@media (max-width: 719px) {
  .tool-btn .label-full { display: none; }
}

.viewer-stage {
  position: fixed;
  inset: var(--toolbar-h) 0 0 0;
  display: flex;
  align-items: stretch;
  justify-content: center;
  background: radial-gradient(circle at 50% 0%, rgba(58, 174, 157, 0.12), transparent 42%), #050b10;
  padding: 0;
  transition: padding 0.35s ease;
}
.viewer-stage.is-mobile-preview {
  padding: 1.25rem 1rem 1.5rem;
  align-items: center;
}
.frame-shell {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #fff;
  transition: width 0.4s cubic-bezier(0.22, 1, 0.36, 1), height 0.4s cubic-bezier(0.22, 1, 0.36, 1), border-radius 0.35s ease, box-shadow 0.35s ease;
}
.viewer-stage.is-mobile-preview .frame-shell {
  width: min(390px, 100%);
  height: min(780px, 100%);
  border-radius: 28px;
  box-shadow: 0 0 0 10px #11181f, 0 0 0 12px #2a3640, 0 30px 60px rgba(0, 0, 0, 0.45);
}
.frame-shell iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}
.watermark {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.watermark span {
  font-family: var(--font);
  font-size: clamp(1.1rem, 3.5vw, 1.85rem);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(10, 22, 32, 0.06);
  transform: rotate(-28deg);
  white-space: nowrap;
  user-select: none;
}
.viewer-error {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: none;
  place-items: center;
  padding: 2rem;
  text-align: center;
  background: #0b141c;
  color: #d7e2ea;
}
.viewer-error.is-visible { display: grid; }
.viewer-error h2 { margin: 0 0 0.5rem; font-weight: 700; }
.viewer-error p { margin: 0; color: #8aa0b0; max-width: 36ch; }

body.protect-shell {
  -webkit-user-select: none;
  user-select: none;
}

@media (max-width: 900px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .toolbar { align-items: flex-start; flex-direction: column; }
  .hero { padding-top: 70px; }
}
@media (max-width: 620px) {
  .wrap { width: min(var(--max), calc(100% - 28px)); }
  .grid { grid-template-columns: 1fr; }
  .hero { padding: 54px 0 42px; }
  .hero p { font-size: 15px; }
  .back { display: none; }
  .footer-row { flex-direction: column; align-items: flex-start; }
  .logo-header { height: 36px; }
}
