:root {
  --bg: #0a0a0a;
  --bg-soft: #111111;
  --card: rgba(18, 18, 18, 0.78);
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.22);
  --text: #e8e8e8;
  --text-soft: #888888;
  --accent: #e8622c;
  --accent-2: #ff7a3d;
  --danger: #ff5555;
  --warn: #e8622c;
  --ok: #4aba7a;
  --radius: 14px;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  font-family: "Space Grotesk", sans-serif;
  background:
    radial-gradient(circle at 10% 10%, #1a1208 0%, transparent 42%),
    radial-gradient(circle at 95% 5%, #1a1008 0%, transparent 40%),
    linear-gradient(160deg, #0a0a0a 0%, #0d0d0d 45%, #0a0a0a 100%);
  min-height: 100vh;
  overflow-x: hidden;
}

.bg-noise {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: radial-gradient(circle at center, black 48%, transparent 94%);
  pointer-events: none;
  z-index: -1;
}

.container {
  width: min(1120px, calc(100% - 2.25rem));
  margin-inline: auto;
}

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

.topbar-wrap {
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand {
  font-family: "JetBrains Mono", monospace;
  font-size: 1rem;
  color: var(--accent-2);
  text-decoration: none;
}

.top-nav {
  display: flex;
  gap: 0.65rem;
  margin-left: auto;
}

.top-nav a {
  text-decoration: none;
  color: var(--text-soft);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.82rem;
  padding: 0.56rem 0.74rem;
  border: 1px solid transparent;
  border-radius: 10px;
}

.top-nav a:hover {
  border-color: var(--line);
  color: var(--text);
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.18rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(18, 18, 18, 0.65);
}

.lang-btn {
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-soft);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.35rem 0.6rem;
  cursor: pointer;
  letter-spacing: 0.02em;
}

.lang-btn:hover {
  color: var(--text);
}

.lang-btn.is-active {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #0a0a0a;
}

.btn {
  border-radius: 999px;
  padding: 0.66rem 1rem;
  text-decoration: none;
  font-weight: 600;
  transition: 0.2s ease;
}

.btn-solid {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #0a0a0a;
  box-shadow: 0 10px 30px rgba(232, 98, 44, 0.3);
}

.btn-solid:hover {
  transform: translateY(-2px);
}

.btn-ghost {
  border: 1px solid var(--line);
  color: var(--text);
  background: rgba(18, 18, 18, 0.5);
}

.btn-ghost:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
}

.hero {
  padding: 3.6rem 0 1.8rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 1.4rem;
  align-items: start;
}

.eyebrow {
  font-family: "JetBrains Mono", monospace;
  color: var(--accent-2);
  font-size: 0.84rem;
  margin: 0 0 1rem;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 3.8vw, 4rem);
  line-height: 0.96;
  letter-spacing: -0.02em;
}

h1 span {
  display: block;
  font-size: clamp(1.1rem, 1.6vw, 1.45rem);
  color: var(--text-soft);
  margin-top: 0.95rem;
  letter-spacing: 0.01em;
}

.lead {
  margin: 1.25rem 0 1.6rem;
  max-width: 61ch;
  color: var(--text-soft);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.stats {
  margin-top: 1.4rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}

.stat-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.85rem 0.9rem;
  background: var(--card);
  box-shadow: var(--shadow);
}

.stat-card strong {
  display: block;
  font-size: 1.24rem;
  letter-spacing: -0.02em;
}

.stat-card span {
  color: var(--text-soft);
  font-size: 0.84rem;
}

.terminal-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: rgba(12, 12, 12, 0.95);
  box-shadow: var(--shadow);
}

.terminal-head {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  border-bottom: 1px solid var(--line);
  padding: 0.75rem 0.88rem;
  background: rgba(15, 15, 15, 0.9);
}

.terminal-head p {
  margin: 0 0 0 0.36rem;
  font-family: "JetBrains Mono", monospace;
  color: var(--text-soft);
  font-size: 0.8rem;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dot.red {
  background: var(--danger);
}

.dot.yellow {
  background: var(--warn);
}

.dot.green {
  background: var(--ok);
}

.terminal-card pre {
  margin: 0;
  padding: 1rem;
  overflow: auto;
}

.terminal-card code {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.83rem;
  color: #d4d4d4;
  line-height: 1.65;
}

.section {
  padding: 2.7rem 0 1.2rem;
}

.section-head {
  margin-bottom: 1.2rem;
}

.section-file {
  margin: 0 0 0.7rem;
  font-family: "JetBrains Mono", monospace;
  color: var(--accent-2);
  font-size: 0.82rem;
}

h2 {
  margin: 0;
  font-size: clamp(1.5rem, 2.4vw, 2.2rem);
  letter-spacing: -0.02em;
}

.section-head p:last-child {
  color: var(--text-soft);
  margin-top: 0.65rem;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-bottom: 1rem;
}

.filter {
  border: 1px solid var(--line);
  color: var(--text);
  background: rgba(18, 18, 18, 0.8);
  border-radius: 999px;
  padding: 0.45rem 0.84rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.78rem;
  cursor: pointer;
}

.filter.is-active {
  border-color: transparent;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #0a0a0a;
}

.projects-grid,
.areas-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.project-card,
.area-card,
.timeline-item,
.faq-item,
.contact-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  background: var(--card);
  box-shadow: var(--shadow);
}

.project-card {
  display: flex;
  flex-direction: column;
  gap: 0.62rem;
  min-height: 190px;
  transition: 0.2s ease;
}

.project-card-featured {
  grid-column: 1 / -1;
  background:
    radial-gradient(circle at 92% 8%, rgba(232, 98, 44, 0.16), transparent 44%),
    radial-gradient(circle at 5% 95%, rgba(255, 122, 61, 0.1), transparent 50%),
    var(--card);
}

.project-media {
  position: relative;
  isolation: isolate;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(8, 8, 8, 0.9);
  padding: 0.55rem;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 168px;
  overflow: hidden;
}

.project-media::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 3;
  opacity: 0;
  transition: opacity 0.16s ease;
  background: radial-gradient(
    280px circle at var(--mx, 50%) var(--my, 50%),
    rgba(255, 144, 92, 0.5) 0%,
    rgba(232, 98, 44, 0.28) 28%,
    rgba(232, 98, 44, 0) 72%
  );
}

.project-media.is-hovering::after {
  opacity: 1;
}

.project-media.is-hovering {
  border-color: rgba(255, 154, 111, 0.65);
  box-shadow: 0 0 0 1px rgba(255, 142, 96, 0.28);
}

.gallery-main {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 0;
  position: relative;
  cursor: zoom-in;
}

.gallery-main img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 8px;
  transition: transform 0.24s ease;
}

.gallery-main span {
  position: absolute;
  right: 0.55rem;
  bottom: 0.55rem;
  background: rgba(0, 0, 0, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  padding: 0.2rem 0.46rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.66rem;
  color: #f0f0f0;
}

.gallery-main:hover img {
  transform: scale(1.015);
}

.project-thumbs {
  display: grid;
  grid-template-columns: repeat(4, minmax(92px, 1fr));
  gap: 0.45rem;
  overflow-x: auto;
  padding-bottom: 0.2rem;
  scrollbar-width: thin;
}

.thumb {
  border: 1px solid var(--line);
  background: rgba(8, 8, 8, 0.65);
  border-radius: 10px;
  overflow: hidden;
  padding: 0;
  cursor: pointer;
  min-height: 64px;
}

.thumb img {
  width: 100%;
  height: 64px;
  object-fit: cover;
  opacity: 0.72;
  transition: opacity 0.2s ease;
}

.thumb.is-active {
  border-color: rgba(232, 98, 44, 0.65);
}

.thumb.is-active img,
.thumb:hover img {
  opacity: 1;
}

.project-badge {
  margin: 0;
  width: fit-content;
  padding: 0.2rem 0.55rem;
  border: 1px solid rgba(232, 98, 44, 0.35);
  border-radius: 999px;
  background: rgba(232, 98, 44, 0.12);
  color: #ffb18f;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

.project-card:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
}

.project-card.is-hidden {
  display: none;
}

.file-name {
  margin: 0;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.79rem;
  color: var(--accent-2);
}

.project-card h3 {
  margin: 0;
  font-size: 1.06rem;
}

.project-card p {
  margin: 0;
  color: var(--text-soft);
}

.project-card ul {
  list-style: none;
  margin: auto 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.project-card li {
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.74rem;
}

.gallery-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 60;
  background: rgba(3, 3, 3, 0.62);
  backdrop-filter: blur(8px);
  padding: 1rem;
}

.gallery-modal.is-open {
  display: flex;
}

.gallery-stage {
  margin: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  overflow: hidden;
  background: #080808;
  width: min(980px, 92vw);
  max-height: 84vh;
  box-shadow: 0 34px 70px rgba(0, 0, 0, 0.45);
}

.gallery-stage img {
  width: 100%;
  height: 100%;
  max-height: 84vh;
  object-fit: contain;
  display: block;
}

.gallery-close,
.gallery-nav {
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(12, 12, 12, 0.72);
  color: #f1f1f1;
  border-radius: 999px;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.gallery-close {
  position: fixed;
  top: 1.2rem;
  right: 1.2rem;
  width: 42px;
  height: 42px;
}

.gallery-nav {
  width: 44px;
  height: 44px;
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
}

.gallery-nav.prev {
  left: 1rem;
}

.gallery-nav.next {
  right: 1rem;
}

body.modal-open {
  overflow: hidden;
}

.area-card span {
  font-family: "JetBrains Mono", monospace;
  color: var(--accent-2);
}

.area-card h3 {
  margin: 0.45rem 0 0.45rem;
}

.area-card p {
  margin: 0;
  color: var(--text-soft);
}

.stack-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.56rem;
}

.stack-cloud span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.4rem 0.72rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.76rem;
  background: rgba(18, 18, 18, 0.82);
}

.timeline {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
}

.timeline-item p {
  margin: 0;
  color: var(--accent-2);
  font-family: "JetBrains Mono", monospace;
}

.timeline-item h3 {
  margin: 0.52rem 0 0.68rem;
  font-size: 1rem;
}

.timeline-item span {
  color: var(--text-soft);
  font-size: 0.95rem;
}

.faq-list {
  display: grid;
  gap: 0.66rem;
}

.faq-item {
  transition: border-color 0.2s ease, background 0.2s ease;
}

.faq-item:hover {
  border-color: rgba(255, 176, 134, 0.5);
  background: rgba(232, 98, 44, 0.08);
}

.faq-trigger {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: none;
  color: var(--text);
  padding: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s ease;
}

.faq-item:hover .faq-trigger {
  color: #ffb086;
}

.faq-item p {
  margin: 0.65rem 0 0;
  color: var(--text-soft);
  display: none;
}

.faq-item.is-open {
  border-color: rgba(232, 98, 44, 0.68);
  background: rgba(232, 98, 44, 0.14);
}

.faq-item.is-open .faq-trigger,
.faq-item.is-open p {
  color: #ffc4a8;
}

.faq-item.is-open p {
  display: block;
}

.contact-card h2 {
  margin-bottom: 0.6rem;
}

.contact-card p {
  color: var(--text-soft);
}

.contact-links {
  display: grid;
  gap: 0.35rem;
  margin-top: 0.8rem;
}

.contact-links a {
  color: var(--accent-2);
  text-decoration: none;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.9rem;
  width: fit-content;
}

.contact-links a:hover {
  color: #ff9966;
}

.footer {
  margin-top: 2rem;
  border-top: 1px solid var(--line);
  padding: 1rem 0 1.4rem;
}

.footer-wrap {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.footer-wrap p {
  margin: 0;
  color: #666666;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.8rem;
}

.reveal {
  opacity: 0;
  transform: translateY(14px);
  animation: reveal 0.5s ease forwards;
}

.reveal:nth-child(2) {
  animation-delay: 0.08s;
}

.reveal:nth-child(3) {
  animation-delay: 0.16s;
}

@keyframes reveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 980px) {
  .hero-grid,
  .timeline {
    grid-template-columns: 1fr;
  }

  .projects-grid,
  .areas-grid {
    grid-template-columns: 1fr;
  }

  .terminal-card {
    max-width: 100%;
  }
}

@media (max-width: 780px) {
  .topbar-wrap {
    flex-wrap: wrap;
    padding: 0.65rem 0;
    gap: 0.5rem;
  }

  .top-nav {
    order: 3;
    width: 100%;
    margin: 0;
    overflow-x: auto;
    padding-bottom: 0.2rem;
    scrollbar-width: none;
  }

  .top-nav::-webkit-scrollbar {
    display: none;
  }

  .btn.btn-ghost {
    margin-left: auto;
  }

  .lang-switch {
    margin-left: auto;
  }

  .stats {
    grid-template-columns: repeat(3, 1fr);
  }

  .gallery-main img {
    height: 200px;
  }

  .gallery-nav {
    width: 40px;
    height: 40px;
  }

  .hero {
    padding: 2.5rem 0 1.2rem;
  }

  .section {
    padding: 2.2rem 0 1rem;
  }
}

@media (max-width: 600px) {
  .container {
    width: calc(100% - 1.5rem);
  }

  /* Topbar */
  .brand {
    font-size: 0.9rem;
  }

  .top-nav a {
    font-size: 0.75rem;
    padding: 0.45rem 0.55rem;
    white-space: nowrap;
  }

  .btn {
    font-size: 0.88rem;
    padding: 0.6rem 0.9rem;
  }

  .lang-btn {
    font-size: 0.68rem;
    padding: 0.32rem 0.52rem;
  }

  /* Hero */
  .hero {
    padding: 2rem 0 1rem;
  }

  h1 {
    font-size: clamp(1.7rem, 7.5vw, 2.5rem);
  }

  h1 span {
    font-size: clamp(0.95rem, 3.5vw, 1.2rem);
    margin-top: 0.7rem;
  }

  .lead {
    font-size: 0.95rem;
    max-width: 100%;
    margin: 1rem 0 1.3rem;
  }

  .hero-actions {
    gap: 0.6rem;
  }

  .stats {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.6rem;
    margin-top: 1rem;
  }

  .stat-card {
    padding: 0.7rem 0.65rem;
  }

  .stat-card strong {
    font-size: 1.05rem;
  }

  .stat-card span {
    font-size: 0.74rem;
  }

  /* Terminal */
  .terminal-card {
    overflow: hidden;
  }

  .terminal-card pre {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .terminal-card code {
    font-size: 0.76rem;
  }

  /* Projetos */
  .project-card-featured {
    grid-column: 1 / -1;
  }

  .gallery-main img {
    height: 220px;
    object-fit: cover;
  }

  /* Thumbnails: 4 colunas iguais sem largura mínima */
  .project-thumbs {
    grid-template-columns: repeat(4, 1fr);
  }

  .thumb {
    min-height: unset;
  }

  .thumb img {
    height: 54px;
  }

  /* Modal */
  .gallery-stage {
    width: 97vw;
    max-height: 78vh;
    border-radius: 10px;
  }

  .gallery-nav {
    width: 36px;
    height: 36px;
    font-size: 1.1rem;
  }

  .gallery-nav.prev {
    left: 0.4rem;
  }

  .gallery-nav.next {
    right: 0.4rem;
  }

  .gallery-close {
    top: 0.75rem;
    right: 0.75rem;
    width: 36px;
    height: 36px;
    font-size: 1.1rem;
  }

  /* Seções */
  h2 {
    font-size: clamp(1.3rem, 5.5vw, 1.8rem);
  }

  .section {
    padding: 1.8rem 0 0.8rem;
  }

  .section-head p:last-child {
    font-size: 0.92rem;
  }

  /* Stack */
  .stack-cloud span {
    font-size: 0.72rem;
    padding: 0.35rem 0.6rem;
  }

  /* Timeline */
  .timeline-item h3 {
    font-size: 0.95rem;
  }

  /* FAQ */
  .faq-trigger {
    font-size: 0.95rem;
  }

  /* Contato */
  .contact-card h2 {
    font-size: 1.3rem;
  }

  /* Footer */
  .footer-wrap {
    flex-direction: column;
    gap: 0.3rem;
  }
}

/* Telas muito pequenas (< 380px) */
@media (max-width: 380px) {
  .container {
    width: calc(100% - 1rem);
  }

  .top-nav a {
    font-size: 0.7rem;
    padding: 0.4rem 0.45rem;
  }

  .stats {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.45rem;
  }

  .stat-card strong {
    font-size: 0.95rem;
  }

  .stat-card span {
    font-size: 0.68rem;
  }

  .thumb img {
    height: 46px;
  }

  h1 {
    font-size: 1.6rem;
  }
}
