:root {
  --bg: #0a0b0d;
  --bg-elevated: #111317;
  --bg-elevated-hover: #14171c;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);

  --text-primary: #dfe2e6;
  --text-secondary: #8b93a1;
  --text-tertiary: #565c66;

  --accent: #e8a33d;
  --accent-soft: rgba(232, 163, 61, 0.12);
  --accent-dim: #a97a34;

  --code: #6fd1c2;

  --font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --font-sans: 'IBM Plex Sans', system-ui, -apple-system, sans-serif;

  --radius: 6px;
  --container: 1180px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #0a0b0d;
  padding: 10px 16px;
  font-family: var(--font-mono);
  font-weight: 700;
  z-index: 100;
}
.skip-link:focus {
  left: 16px;
  top: 16px;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------- Topbar ---------- */

.topbar {
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: rgba(10, 11, 13, 0.85);
  backdrop-filter: blur(10px);
  z-index: 20;
}

.topbar__inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.02em;
}
.logo span { color: var(--accent); }

.icon-link {
  display: inline-flex;
  color: var(--text-secondary);
  transition: color 0.15s ease;
}
.icon-link:hover { color: var(--accent); }

/* ---------- Hero ---------- */

.hero {
  max-width: var(--container);
  margin: 0 auto;
  padding: 64px 24px 0;
}

.hero__inner {
  max-width: 640px;
}

.hero__prompt {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--code);
  margin: 0 0 12px;
}

.hero__dump {
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--text-secondary);
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0.02) 0px,
      rgba(255, 255, 255, 0.02) 1px,
      transparent 1px,
      transparent 3px
    ),
    var(--bg-elevated);
  border: 1px solid var(--border);
  border-left: 2px solid var(--accent-dim);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin: 0 0 32px;
  overflow-x: auto;
  white-space: pre;
}

.hero__title {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 14px;
}
.hero__title span:first-of-type { color: var(--accent); }

.cursor {
  display: inline-block;
  color: var(--accent);
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.hero__subtitle {
  color: var(--text-secondary);
  font-size: 15px;
  margin: 0 0 48px;
}

/* Section map ("tabela de seções") */

.sectionmap {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 2px 0;
  margin-bottom: 8px;
  scrollbar-width: none;
}
.sectionmap::-webkit-scrollbar { display: none; }

.sectionmap a {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
  padding: 12px 14px;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}
.sectionmap a:hover,
.sectionmap a:focus-visible {
  color: var(--text-primary);
  border-bottom-color: var(--accent);
}

.sectionmap__addr {
  color: var(--accent-dim);
  margin-right: 4px;
}

/* ---------- Sections ---------- */

main {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.stack {
  padding: 72px 0 0;
  scroll-margin-top: 64px;
}
.stack:last-of-type { padding-bottom: 88px; }

.stack__head { margin-bottom: 32px; max-width: 620px; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent-dim);
  letter-spacing: 0.06em;
  margin: 0 0 10px;
}

.stack__head h2 {
  font-family: var(--font-mono);
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  font-weight: 700;
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}

.lede {
  color: var(--text-secondary);
  font-size: 14.5px;
  margin: 0;
}

/* ---------- Card grid ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 16px;
}

.card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.card:hover,
.card:focus-visible {
  transform: translateY(-3px);
  border-color: var(--border-strong);
  background: var(--bg-elevated-hover);
}

.card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 18px;
}

.card__code {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(232, 163, 61, 0.25);
  border-radius: 4px;
  padding: 4px 8px;
  letter-spacing: 0.03em;
}

.card__ext {
  color: var(--text-tertiary);
  font-size: 13px;
  transition: color 0.15s ease, transform 0.15s ease;
}
.card:hover .card__ext { color: var(--accent); transform: translate(1px, -1px); }

.card__title {
  font-size: 16.5px;
  font-weight: 600;
  margin: 0 0 10px;
  color: var(--text-primary);
}

.card__desc {
  color: var(--text-secondary);
  font-size: 13.5px;
  line-height: 1.6;
  margin: 0 0 20px;
  flex-grow: 1;
}

.card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 4px 7px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* ---------- Footer ---------- */

.footer {
  border-top: 1px solid var(--border);
  padding: 28px 24px;
  text-align: center;
}

.footer__prompt {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-tertiary);
  margin: 0;
}

/* ---------- Responsive ---------- */

@media (min-width: 640px) {
  .hero { padding-top: 88px; }
}

@media (min-width: 1024px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
  .hero { padding-top: 110px; }
}

@media (max-width: 639px) {
  .stack { padding-top: 56px; }
  .card { padding: 20px; }
}
