:root {
  --bg: #05060f;
  --surface: #0c1024;
  --surface-2: rgba(255, 255, 255, 0.04);
  --text: #e8f0ff;
  --muted: #9eb2d4;
  --accent: #7df1a8;
  --accent-2: #69c5ff;
  --accent-3: #f3a35c;
  --card-shadow: 0 22px 60px rgba(0, 0, 0, 0.35);
  --border: rgba(255, 255, 255, 0.1);
  --grid: rgba(255, 255, 255, 0.06);
}

body.theme-light {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: rgba(7, 16, 54, 0.05);
  --text: #0b1b38;
  --muted: #4b5970;
  --accent: #0b996b;
  --accent-2: #246ef7;
  --accent-3: #e16f2b;
  --border: rgba(11, 27, 56, 0.12);
  --card-shadow: 0 22px 60px rgba(26, 57, 118, 0.15);
  background: #eef2fb;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  background: radial-gradient(circle at 20% 20%, rgba(105, 197, 255, 0.08), transparent 22%),
    radial-gradient(circle at 80% 10%, rgba(125, 241, 168, 0.12), transparent 26%),
    linear-gradient(135deg, #05060f 0%, #0b1022 35%, #05060f 100%);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  transition: background 0.6s ease, color 0.6s ease;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(transparent 97%, var(--grid) 97%),
    linear-gradient(90deg, transparent 97%, var(--grid) 97%);
  background-size: 120px 120px, 120px 120px;
  opacity: 0.3;
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 120%, rgba(250, 172, 94, 0.15), transparent 40%);
  pointer-events: none;
  z-index: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

h1, h2, h3 {
  margin: 0;
  font-weight: 700;
}

p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.wrap {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: clamp(18px, 3vw, 32px);
}

header.hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  align-items: center;
  gap: clamp(16px, 4vw, 36px);
  padding: clamp(20px, 5vw, 50px) 0;
}

.eyebrow {
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 12px;
}

h1 {
  font-size: clamp(34px, 6vw, 54px);
  margin: 0 0 12px;
  line-height: 1.05;
}

h2 {
  margin: 0 0 10px;
  font-size: clamp(24px, 4vw, 32px);
}

.hero__lead {
  font-size: 18px;
  color: var(--text);
  margin-bottom: 18px;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-weight: 600;
  font-size: 13px;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.btn {
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  background: var(--surface-2);
  color: var(--text);
  box-shadow: none;
}

.btn.primary {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #041226;
  border: none;
  box-shadow: var(--card-shadow);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--card-shadow);
}

.pill-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.pill {
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-weight: 600;
}

.console {
  position: relative;
  background: linear-gradient(145deg, rgba(7, 13, 31, 0.9), rgba(8, 18, 48, 0.8));
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
  overflow: hidden;
  min-height: 320px;
  box-shadow: var(--card-shadow);
}

.console__title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  margin-bottom: 12px;
}

.console__glow {
  position: absolute;
  inset: -20% auto auto -10%;
  width: 240px;
  height: 240px;
  background: radial-gradient(circle, rgba(125, 241, 168, 0.25), transparent 40%);
  filter: blur(20px);
}

.console__grid {
  display: grid;
  gap: 10px;
  position: relative;
  z-index: 2;
}

.code-line {
  background: linear-gradient(90deg, rgba(125, 241, 168, 0.15), rgba(105, 197, 255, 0.08), transparent);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  color: var(--text);
  font-family: "JetBrains Mono", monospace;
  font-size: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.code-line span {
  color: var(--muted);
}

.code-chip {
  padding: 4px 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--accent);
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
}

.panel {
  margin-top: 30px;
  background: var(--surface);
  border-radius: 18px;
  border: 1px solid var(--border);
  box-shadow: var(--card-shadow);
  padding: 18px;
  position: relative;
}

.panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.search {
  width: 260px;
  max-width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  outline: none;
  font-size: 14px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.db-card {
  position: relative;
  display: grid;
  gap: 10px;
  padding: 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--card-shadow);
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
  overflow: hidden;
  isolation: isolate;
  animation: rise 0.6s ease both;
  animation-delay: calc(var(--i, 0) * 0.03s);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.db-card:hover {
  transform: translateY(-6px);
  border-color: var(--accent-2);
  box-shadow: 0 15px 45px rgba(36, 110, 247, 0.2);
}

.db-card__meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-family: "JetBrains Mono", monospace;
  color: var(--muted);
  font-size: 13px;
}

.db-card h3 {
  margin: 0;
  font-size: 20px;
  color: var(--text);
}

.db-card p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}

.db-card .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 12px;
  border: 1px solid var(--border);
}

.db-card .cta {
  font-weight: 700;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  position: relative;
}

.db-card .cta::after {
  content: "\2197";
  display: inline-flex;
  margin-left: 4px;
  transition: transform 0.2s ease;
  font-size: 14px;
}

.db-card:hover .cta::after {
  transform: translateX(3px) translateY(-2px);
}

.db-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(125, 241, 168, 0.12), rgba(105, 197, 255, 0.06));
  opacity: 0;
  transition: opacity 0.25s ease;
  z-index: -1;
}

.db-card:hover::before {
  opacity: 1;
}

.db-card.active {
  border-color: var(--accent-3);
  box-shadow: 0 12px 32px rgba(243, 163, 92, 0.25);
}

.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.stat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-weight: 700;
}

.timeline {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.timeline__item {
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 12px;
  border-radius: 12px;
  font-family: "JetBrains Mono", monospace;
  color: var(--text);
}

footer {
  margin: 32px 0;
  color: var(--muted);
  text-align: center;
  font-size: 14px;
}

@media (max-width: 700px) {
  .console {
    min-height: 260px;
  }

  .hero__actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .toolbar {
    flex-direction: column;
    align-items: flex-start;
  }
}

body.tema-page {
  --bg: #0a0d16;
  --surface: #121826;
  --surface-2: rgba(255, 255, 255, 0.04);
  --text: #f3f6ff;
  --muted: #9aa6c1;
  --accent: #c8a96a;
  --accent-2: #7fc6ff;
  --border: rgba(255, 255, 255, 0.12);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.38);
  margin: 0;
  font-family: "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 20% 20%, rgba(127, 198, 255, 0.12), transparent 35%),
    radial-gradient(circle at 75% 10%, rgba(200, 169, 106, 0.16), transparent 40%),
    linear-gradient(140deg, #070b12 0%, #0f1523 55%, #070b12 100%);
  color: var(--text);
  min-height: 100vh;
  padding: clamp(18px, 3vw, 32px);
}

body.tema-page,
body.tema-page *,
body.tema-page *::before,
body.tema-page *::after {
  box-sizing: border-box;
}

body.tema-page a {
  color: inherit;
  text-decoration: none;
}

body.tema-page .shell {
  max-width: 1100px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

body.tema-page header.hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: clamp(18px, 4vw, 40px);
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: clamp(20px, 4vw, 36px);
}

body.tema-page .eyebrow {
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 12px;
}

body.tema-page h1 {
  font-family: "Playfair Display", serif;
  font-size: clamp(34px, 6vw, 52px);
  margin: 0 0 8px;
}

body.tema-page .subtitle {
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 16px;
}

body.tema-page .lede {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.7;
}

body.tema-page .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0 18px;
}

body.tema-page .meta-pill {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-weight: 700;
  color: var(--text);
}

body.tema-page .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

body.tema-page .btn {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  font-weight: 700;
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

body.tema-page .btn.primary {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #0a1324;
  border: none;
  box-shadow: var(--shadow);
}

body.tema-page .btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

body.tema-page .console {
  background: linear-gradient(145deg, rgba(9, 15, 28, 0.95), rgba(14, 22, 40, 0.92));
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

body.tema-page .console::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(127, 198, 255, 0.18), transparent 50%);
  opacity: 0.6;
  pointer-events: none;
}

body.tema-page .console__title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-family: "Fira Code", monospace;
  font-size: 13px;
  margin-bottom: 12px;
  position: relative;
  z-index: 1;
}

body.tema-page .console__body {
  display: grid;
  gap: 10px;
  position: relative;
  z-index: 1;
}

body.tema-page .line {
  font-family: "Fira Code", monospace;
  background: rgba(255, 255, 255, 0.04);
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  color: var(--text);
  line-height: 1.5;
}

body.tema-page .line strong {
  color: var(--accent);
}

body.tema-page .grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  margin-top: 20px;
}

body.tema-page .card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 8px;
}

body.tema-page .card h3 {
  margin: 0;
  font-size: 18px;
  font-family: "Playfair Display", serif;
}

body.tema-page .card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

body.tema-page .label {
  font-family: "Fira Code", monospace;
  color: var(--accent-2);
  font-size: 13px;
  letter-spacing: 0.02em;
}

body.tema-page .chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

body.tema-page .chip {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px 10px;
  background: var(--surface-2);
  color: var(--text);
  font-weight: 700;
}

body.tema-page .callout {
  border: 1px solid rgba(200, 169, 106, 0.45);
  background: rgba(200, 169, 106, 0.08);
  border-radius: 16px;
  padding: 16px;
  color: var(--text);
  box-shadow: var(--shadow);
  margin-top: 18px;
}

body.tema-page footer {
  margin: 24px auto;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 700px) {
  body.tema-page .actions {
    flex-direction: column;
    align-items: flex-start;
  }
}
