/* ============================================================
   LINA OPTIMIZER — design tokens + global styles
   Aesthetic: HUD control panel · terminal / CRT · neon red
   ============================================================ */

:root {
  /* Accent (overridden by tweak) */
  --accent: #ff2e3a;
  --accent-soft: #ff2e3a33;
  --accent-glow: 0 0 24px #ff2e3a55, 0 0 1px #ff2e3a;
  --accent-text: #ff5860;

  /* Surfaces */
  --bg: #050508;
  --bg-1: #0c0c12;
  --bg-2: #15151d;
  --bg-3: #1b1b26;
  --line: #303040;
  --line-2: #424257;
  --line-strong: #57576d;

  /* Text */
  --fg: #f3f4f7;
  --fg-dim: #d5d7df;
  --fg-mute: #9a9ead;
  --fg-faint: #6d7080;

  /* Status */
  --ok: #4ade80;
  --warn: #fbbf24;
  --bad: #ef4444;
  --info: #60a5fa;

  /* Type */
  --font-display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --font-pixel: "VT323", "JetBrains Mono", monospace;

  /* Radius */
  --r-sm: 4px;
  --r-md: 6px;
  --r-lg: 10px;

  /* Layout */
  --container: 1280px;
}

/* Accent palettes */
[data-accent="red"]    { --accent:#ff2e3a; --accent-text:#ff5860; --accent-soft:#ff2e3a33; --accent-glow:0 0 24px #ff2e3a55, 0 0 1px #ff2e3a; }
[data-accent="amber"]  { --accent:#ffb020; --accent-text:#ffc34d; --accent-soft:#ffb02033; --accent-glow:0 0 24px #ffb02055, 0 0 1px #ffb020; }
[data-accent="green"]  { --accent:#22e07a; --accent-text:#4ee892; --accent-soft:#22e07a33; --accent-glow:0 0 24px #22e07a55, 0 0 1px #22e07a; }
[data-accent="cyan"]   { --accent:#22d3ee; --accent-text:#5fdcf2; --accent-soft:#22d3ee33; --accent-glow:0 0 24px #22d3ee55, 0 0 1px #22d3ee; }
[data-accent="violet"] { --accent:#a855f7; --accent-text:#bf7afc; --accent-soft:#a855f733; --accent-glow:0 0 24px #a855f755, 0 0 1px #a855f7; }

[data-glow="off"]    { --accent-glow: none; }
[data-glow="low"]    { --accent-glow: 0 0 12px var(--accent-soft); }
[data-glow="medium"] { --accent-glow: 0 0 24px #ff2e3a55, 0 0 1px var(--accent); }
[data-glow="high"]   { --accent-glow: 0 0 36px var(--accent), 0 0 8px var(--accent), 0 0 1px var(--accent); }

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-display);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* ---------- Background grid + scanlines ---------- */
.bg-grid {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.022) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.022) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at 50% 30%, #000 30%, transparent 75%);
}
[data-grid="dense"] .bg-grid { background-size: 32px 32px; }
[data-grid="sparse"] .bg-grid { background-size: 96px 96px; }

.bg-vignette {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(circle at 20% 0%, var(--accent-soft), transparent 50%),
    radial-gradient(circle at 90% 30%, rgba(255,46,58,0.06), transparent 60%),
    radial-gradient(ellipse at 50% 100%, rgba(0,0,0,0.6), transparent 60%);
}

.scanlines {
  position: fixed; inset: 0; pointer-events: none; z-index: 1;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255,255,255,0.012) 0,
    rgba(255,255,255,0.012) 1px,
    transparent 1px,
    transparent 3px
  );
  mix-blend-mode: screen;
  opacity: 0.18;
}
[data-scanlines="false"] .scanlines { display: none; }

/* ---------- Typography helpers ---------- */
.mono { font-family: var(--font-mono); letter-spacing: 0.01em; }
.pixel { font-family: var(--font-pixel); }
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-text);
}
.eyebrow::before {
  content: "[ ";
  color: var(--accent);
  opacity: 0.7;
}
.eyebrow::after {
  content: " ]";
  color: var(--accent);
  opacity: 0.7;
}
.dim { color: var(--fg-dim); }
.mute { color: var(--fg-mute); }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--fg);
}
h1 { font-size: clamp(40px, 6vw, 76px); line-height: 1.02; }
h2 { font-size: clamp(28px, 3.6vw, 48px); line-height: 1.08; }
h3 { font-size: clamp(20px, 2vw, 24px); line-height: 1.2; }
p  { margin: 0; }

.accent { color: var(--accent-text); }
.glow-text { text-shadow: 0 0 16px var(--accent-soft); }

/* ---------- Container ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 32px;
  position: relative;
  z-index: 2;
}
@media (max-width: 720px) { .container { padding: 0 20px; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  padding: 0 22px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-2);
  background: var(--bg-2);
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: none;
  transition: 160ms ease;
  position: relative;
}
.btn:hover { border-color: var(--accent); color: var(--accent-text); }
.btn .arrow { transition: transform 160ms ease; }
.btn:hover .arrow { transform: translateX(3px); }

.btn-primary {
  background: var(--accent);
  color: #0a0a0c;
  border-color: var(--accent);
  box-shadow: var(--accent-glow);
}
.btn-primary:hover {
  color: #0a0a0c;
  filter: brightness(1.08);
  transform: translateY(-1px);
}
.btn-primary::before {
  content: "";
  position: absolute;
  inset: -1px;
  border: 1px solid var(--accent);
  opacity: 0.3;
  transform: translate(3px, 3px);
  pointer-events: none;
}

.btn-ghost {
  background: transparent;
}

/* corner cuts */
.cut-corners {
  clip-path: polygon(
    10px 0, 100% 0, 100% calc(100% - 10px),
    calc(100% - 10px) 100%, 0 100%, 0 10px
  );
}

/* ---------- Cards ---------- */
.card {
  position: relative;
  background: linear-gradient(180deg, rgba(21,21,29,0.96), rgba(12,12,18,0.98));
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  padding: 24px;
  transition: 220ms ease;
}
.card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 0 0 1px var(--accent-soft), 0 24px 48px -24px var(--accent-soft);
}

/* corner brackets */
.brackets {
  position: relative;
}
.brackets::before, .brackets::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  border: 1px solid var(--accent);
  pointer-events: none;
  opacity: 0.7;
}
.brackets::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.brackets::after { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }

/* full 4-corner brackets */
.brackets-4 .bk { position: absolute; width: 14px; height: 14px; border: 1px solid var(--accent); pointer-events: none; opacity: 0.8; }
.brackets-4 .bk-tl { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.brackets-4 .bk-tr { top: -1px; right: -1px; border-left: 0; border-bottom: 0; }
.brackets-4 .bk-bl { bottom: -1px; left: -1px; border-right: 0; border-top: 0; }
.brackets-4 .bk-br { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }

/* ---------- Section ---------- */
section {
  position: relative;
  padding: 120px 0;
  z-index: 2;
}
section.tight { padding: 80px 0; }
.section-head {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 56px;
  max-width: 720px;
}
.section-head .lead { color: var(--fg-dim); font-size: 18px; line-height: 1.55; }

/* ---------- Tag / Pill ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 8px;
  border: 1px solid var(--line-2);
  border-radius: 2px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-dim);
  background: var(--bg-2);
}
.tag.accent { border-color: var(--accent); color: var(--accent-text); background: var(--accent-soft); }
.tag.ok { border-color: rgba(74,222,128,0.5); color: var(--ok); }
.tag.warn { border-color: rgba(251,191,36,0.5); color: var(--warn); }
.tag.bad { border-color: rgba(239,68,68,0.5); color: var(--bad); }

.dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}

/* ---------- HUD frame (used on dashboard) ---------- */
.hud {
  position: relative;
  background: linear-gradient(180deg, #0d0d14, #08080d);
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  overflow: hidden;
}
.hud-titlebar {
  display: flex; align-items: center;
  height: 36px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-2);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-mute);
  letter-spacing: 0.08em;
  gap: 10px;
}
.hud-titlebar .lights { display: flex; gap: 6px; }
.hud-titlebar .lights span { width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); }
.hud-titlebar .lights span:first-child { background: var(--accent); box-shadow: 0 0 6px var(--accent); }

/* ---------- Marquee ---------- */
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
.marquee {
  display: flex;
  gap: 56px;
  animation: marquee 40s linear infinite;
  width: max-content;
}

/* ---------- Animations ---------- */
@keyframes blink { 50% { opacity: 0.2; } }
.blink { animation: blink 1.1s step-start infinite; }

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 0 0 var(--accent-soft); }
  50% { box-shadow: 0 0 24px 4px var(--accent-soft); }
}

@keyframes scan {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(100%); }
}
.scan-bar {
  position: absolute; left: 0; right: 0; height: 80px;
  background: linear-gradient(180deg, transparent, var(--accent-soft), transparent);
  animation: scan 4s linear infinite;
  pointer-events: none;
  opacity: 0.5;
}

@keyframes ticker {
  0% { width: 0; }
  100% { width: var(--w, 100%); }
}

@keyframes float-y {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* ---------- Tweaks panel theming ---------- */
:root {
  --tw-bg: var(--bg-1);
  --tw-text: var(--fg);
  --tw-border: var(--line-2);
  --tw-accent: var(--accent);
}

/* ---------- Utility ---------- */
.row { display: flex; align-items: center; }
.col { display: flex; flex-direction: column; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.gap-8 { gap: 32px; }
.between { justify-content: space-between; }
.center { justify-content: center; align-items: center; }

.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-2), transparent);
}

/* ---------- Prevent content shift while React loads ---------- */
#root:empty::before {
  content: "LOADING LINA";
  font-family: var(--font-mono);
  color: var(--accent);
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  letter-spacing: 0.4em;
  font-size: 14px;
  animation: blink 1s step-start infinite;
}


/* ---------- Scroll reveal — legível, reto, sem cilindro ---------- */
html { scroll-behavior: smooth; }
.site-flow {
  position: relative;
  z-index: 2;
}
.scroll-reveal {
  opacity: 0;
  transform: translateY(34px);
  filter: blur(3px);
  transition: opacity 520ms ease, transform 520ms ease, filter 520ms ease;
  will-change: opacity, transform, filter;
}
.scroll-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}
@media (prefers-reduced-motion: reduce) {
  .scroll-reveal { opacity: 1 !important; transform: none !important; filter: none !important; transition: none !important; }
}
/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  section { padding: 80px 0; }
  .section-head { margin-bottom: 40px; }
}


@media (max-width: 1100px) {
  nav.row { display: none; }
}
@media (max-width: 980px) {
  #tecnologia .hud > div[style*="repeat(3"],
  footer .container > div:first-child,
  footer .container > div:first-child > div:last-child {
    grid-template-columns: 1fr !important;
  }
}
@media (max-width: 760px) {
  h1 { font-size: clamp(36px, 12vw, 56px); }
  .btn { width: 100%; justify-content: center; }
  #tecnologia .hud > div[style*="repeat(5"] { grid-template-columns: 1fr !important; }
}

/* ---------- Mobile unsupported screen ---------- */
.mobile-unsupported {
  display: none;
}

@media (max-width: 920px), ((hover: none) and (pointer: coarse) and (max-width: 1180px)) {
  html, body {
    width: 100%;
    min-height: 100%;
    overflow: hidden;
  }

  .desktop-site {
    display: none !important;
  }

  .mobile-unsupported {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 22px;
    overflow: hidden;
    background:
      radial-gradient(circle at 50% 0%, rgba(168, 85, 247, 0.24), transparent 34%),
      linear-gradient(180deg, #13051f 0%, #06060a 54%, #020205 100%);
    color: var(--fg);
    z-index: 99999;
  }

  .mobile-unsupported::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
      linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
      linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px);
    background-size: 24px 24px;
    mask-image: radial-gradient(circle at center, black 0 48%, transparent 82%);
  }

  .mobile-card {
    position: relative;
    width: min(100%, 430px);
    padding: 26px 22px;
    border: 1px solid rgba(168, 85, 247, 0.55);
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(18,18,28,0.96), rgba(7,7,12,0.96));
    box-shadow: 0 0 38px rgba(168, 85, 247, 0.22), inset 0 0 0 1px rgba(255,255,255,0.04);
    text-align: center;
  }

  .mobile-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 22px;
  }

  .mobile-logo .logo-mark {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border: 1px solid var(--accent);
    color: var(--accent);
    font-family: var(--font-mono);
    font-weight: 900;
    box-shadow: 0 0 14px var(--accent-soft);
  }

  .mobile-logo strong {
    display: block;
    font-family: var(--font-display);
    font-size: 16px;
    letter-spacing: -0.02em;
    text-align: left;
  }

  .mobile-logo small {
    display: block;
    margin-top: 2px;
    font-family: var(--font-mono);
    font-size: 9px;
    letter-spacing: 0.22em;
    color: var(--fg-mute);
    text-align: left;
  }

  .mobile-status {
    display: inline-flex;
    padding: 8px 10px;
    margin-bottom: 16px;
    border: 1px solid rgba(168, 85, 247, 0.38);
    border-radius: 999px;
    background: rgba(168, 85, 247, 0.1);
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.14em;
  }

  .mobile-card h1 {
    margin: 0 0 12px;
    font-family: var(--font-display);
    font-size: clamp(34px, 10vw, 48px);
    line-height: 0.95;
    letter-spacing: -0.05em;
  }

  .mobile-card p {
    margin: 0 auto 22px;
    max-width: 34ch;
    color: var(--fg-dim);
    font-size: 15px;
    line-height: 1.55;
  }

  .mobile-discord {
    width: 100%;
    min-height: 54px;
    white-space: normal;
    line-height: 1.2;
  }

  .mobile-note {
    display: block;
    margin-top: 14px;
    color: var(--fg-dim);
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.08em;
  }
}

/* ---------- Updated brand logo ---------- */
.brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--fg);
  text-decoration: none;
  min-width: 0;
}
.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--accent) 70%, white 8%);
  background:
    linear-gradient(135deg, rgba(255,255,255,0.1), transparent 40%),
    radial-gradient(circle at 50% 0%, var(--accent-soft), transparent 70%),
    rgba(10,10,14,0.94);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04), 0 0 18px var(--accent-soft);
  clip-path: polygon(9px 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%, 0 9px);
}
.brand-mark span {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 15px;
  letter-spacing: -0.08em;
  line-height: 1;
  color: var(--fg);
  text-shadow: 0 0 14px var(--accent-soft);
}
.brand-title {
  display: block;
  font-family: var(--font-display);
  font-weight: 900;
  letter-spacing: -0.055em;
  color: var(--fg);
  white-space: nowrap;
}
.brand-title span {
  margin-left: 5px;
  color: var(--accent-text);
}
.brand-subtitle {
  display: block;
  margin-top: 5px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  color: var(--fg-mute);
  white-space: nowrap;
}

/* ---------- Social links ---------- */
.social-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.social-link {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 14px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: rgba(21,21,29,0.74);
  color: var(--fg-dim);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: 160ms ease;
}
.social-link:hover {
  color: var(--accent-text);
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 20px var(--accent-soft);
  transform: translateY(-1px);
}
.social-links.compact {
  justify-content: flex-start;
}
.social-links.compact .social-link {
  width: 38px;
  min-height: 38px;
  padding: 0;
}

@media (max-width: 720px) {
  .brand-subtitle { display: none; }
  .brand-mark { width: 34px; height: 34px; }
}
