/* ==========================================================================
   palis — design system compartilhado (home + projetos)
   ========================================================================== */

:root {
  /* paleta palis — tinta noturna, papel quente e verde-lima */
  --bg: #0c0b10;
  --bg-2: #100f17;
  --surface: #141320;
  --surface-2: #1b1929;
  --surface-3: #262338;
  --line: #2a2740;
  --line-2: #3b3757;
  --line-3: #514c73;
  --text: #f1e9d6;
  --text-2: #c8bfa9;
  --muted: #8b84a3;
  --faint: #5b5675;

  --accent: #c8f53c;
  --accent-2: #a6d822;
  --accent-dk: #7aa418;
  --accent-ink: #12180a;
  --accent-soft: rgba(200, 245, 60, 0.1);
  --accent-line: rgba(200, 245, 60, 0.5);

  --good: #64d98b;
  --good-soft: rgba(100, 217, 139, 0.12);
  --bad: #ff6159;
  --bad-soft: rgba(255, 97, 89, 0.12);
  --warn: #ffd23f;
  --warn-soft: rgba(255, 210, 63, 0.12);
  --info: #5b9bff;
  --info-soft: rgba(91, 155, 255, 0.12);
  --coin: #ffd23f;
  --orange: #ff8c2e;
  --pink: #ff7ab6;
  --purple: #8b5cf6;

  --pixel: 'Pixelify Sans', 'Silkscreen', ui-monospace, monospace;
  --pixel-ui: 'Silkscreen', 'Pixelify Sans', ui-monospace, monospace;
  --serif: var(--pixel);
  --sans: 'Geist', 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --r-xs: 0;
  --r-sm: 0;
  --r: 0;
  --r-lg: 0;
  --r-xl: 0;

  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --shadow: 4px 4px 0 0 rgba(0, 0, 0, 0.55);
  --gutter: 24px;

  color-scheme: dark;
}

@media (max-width: 640px) {
  :root { --gutter: 16px; }
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 400 15px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
img, svg, canvas { display: block; }
h1, h2, h3, h4, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
[hidden] { display: none !important; }

::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.icon {
  width: 16px; height: 16px;
  fill: none; stroke: currentColor; stroke-width: 1.6;
  stroke-linecap: round; stroke-linejoin: round;
  flex: none;
}

/* ---------- layout ---------- */

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---------- tipografia ---------- */

.eyebrow {
  font: 500 11px/1 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.serif { font-family: var(--serif); font-weight: 400; letter-spacing: -0.01em; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.accent { color: var(--accent); }
.tnum { font-variant-numeric: tabular-nums; }

/* ---------- botões ---------- */

.btn {
  --h: 40px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--h);
  padding: 0 16px;
  border-radius: 999px;
  font: 500 14px/1 var(--sans);
  letter-spacing: -0.005em;
  white-space: nowrap;
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--text);
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.2s var(--ease), color 0.2s var(--ease), opacity 0.2s;
  user-select: none;
}
.btn:hover { background: var(--surface-2); border-color: var(--line-3); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.4; pointer-events: none; }
.btn .icon { width: 15px; height: 15px; }

.btn-primary {
  background: var(--accent);
  border-color: transparent;
  color: var(--accent-ink);
  font-weight: 600;
}
.btn-primary:hover { background: #e1fa86; border-color: transparent; }

.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface); border-color: var(--line); color: var(--text); }

.btn-sm { --h: 32px; padding: 0 12px; font-size: 13px; }
.btn-lg { --h: 48px; padding: 0 22px; font-size: 15px; }
.btn-block { width: 100%; }

/* ---------- pílulas e etiquetas ---------- */

.pill {
  display: inline-flex; align-items: center; gap: 7px;
  height: 26px; padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  font: 500 12px/1 var(--sans);
  color: var(--text-2);
  white-space: nowrap;
}
.dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--muted);
  flex: none;
}
.dot.live { background: var(--good); box-shadow: 0 0 0 3px var(--good-soft); animation: pulse 2.4s var(--ease) infinite; }
.dot.build { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); }
.dot.idea { background: var(--info); box-shadow: 0 0 0 3px var(--info-soft); }

.tag {
  display: inline-flex; align-items: center;
  height: 22px; padding: 0 8px;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font: 500 11px/1 var(--mono);
  color: var(--text-2);
  letter-spacing: 0.01em;
  white-space: nowrap;
}

kbd {
  font: 500 11px/1 var(--mono);
  padding: 3px 6px;
  border-radius: 5px;
  border: 1px solid var(--line-2);
  border-bottom-width: 2px;
  color: var(--text-2);
  background: var(--surface);
}

/* ---------- superfícies ---------- */

.card {
  position: relative;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.022), rgba(255, 255, 255, 0.008));
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
}

/* textura de grão sutil sobre tudo */
.grain {
  position: fixed; inset: -50%;
  pointer-events: none;
  z-index: 100;
  opacity: 0.05;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* entrada suave dos elementos */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out); }
.reveal.in { opacity: 1; transform: none; }

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 3px var(--good-soft); }
  50% { box-shadow: 0 0 0 6px rgba(127, 216, 150, 0.04); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}
