:root {
  --bg: #0a0b0d;
  --bg-term: #111316;
  --bg-bar: #1a1d21;
  --text: #d4d8dc;
  --text-dim: #7d8590;
  --accent: #3ddc84;
  --border: #2a2e33;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--mono);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 15px;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.highlight { color: var(--accent); }

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

/* Nav */
.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.1rem 2rem;
  border-bottom: 1px solid var(--border);
}

.nav-brand { font-weight: 600; font-size: 0.95rem; }

.nav nav a { margin-left: 1.5rem; color: var(--text-dim); font-size: 0.9rem; }
.nav nav a:hover { color: var(--accent); text-decoration: none; }

/* Terminal window chrome */
.term-window {
  background: var(--bg-term);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}

.term-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.8rem;
  background: var(--bg-bar);
  border-bottom: 1px solid var(--border);
}

.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot-red { background: #ff5f56; }
.dot-yellow { background: #ffbd2e; }
.dot-green { background: #27c93f; }

.term-title {
  margin-left: 0.6rem;
  color: var(--text-dim);
  font-size: 0.8rem;
}

.term-body { padding: 1.5rem; }

.term-line { color: var(--text-dim); margin: 0 0 0.4rem; font-size: 0.9rem; }
.prompt { color: var(--accent); font-weight: 600; margin-right: 0.4rem; }

/* Hero */
.hero {
  padding: 3.5rem 2rem 2.5rem;
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 2.5rem;
}

.hero-term { flex: 1 1 480px; max-width: 640px; }
.hero-term .term-body h1 { font-size: 1.9rem; margin: 0.3rem 0 1.2rem; line-height: 1.3; }
.hero-term .term-body > p:not(.term-line) { color: var(--text-dim); margin-bottom: 0; }

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

.hero-photo {
  flex: 0 0 300px;
  width: 300px;
  display: flex;
  justify-content: center;
}

.hero-photo img {
  width: 100%;
  max-width: 300px;
  object-fit: contain;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.5));
}

@media (max-width: 760px) {
  .hero { flex-direction: column-reverse; }
  .hero-photo { flex: 0 0 200px; width: 200px; }
  .hero-photo img { max-width: 200px; }
}

/* Stats */
.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  padding: 0 2rem 3rem;
  max-width: 1100px;
  margin: 0 auto;
}

.stat {
  flex: 1 1 220px;
  border-top: 2px solid var(--accent);
  padding-top: 0.75rem;
}

.stat strong { display: block; font-size: 1.05rem; margin-bottom: 0.25rem; }
.stat span { color: var(--text-dim); font-size: 0.82rem; }

/* Sections */
.section { padding: 2.5rem 2rem; max-width: 960px; margin: 0 auto; }

.cmd {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text);
}

.section .term-body p { color: var(--text-dim); }
.section .term-body p + p { margin-top: 1rem; }
.sobre-ia-intro { margin-top: 1.5rem !important; color: var(--text) !important; }

/* Cards (as terminal windows) */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.card .term-body { padding: 1.25rem; }
.card h3 { margin: 0 0 0.6rem; font-size: 1rem; }
.card p { color: var(--text-dim); font-size: 0.88rem; }

/* Tag badges */
.tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }
.tags span {
  background: rgba(61, 220, 132, 0.08);
  color: var(--accent);
  border: 1px solid rgba(61, 220, 132, 0.25);
  border-radius: 4px;
  padding: 0.25rem 0.65rem;
  font-size: 0.75rem;
}
.tags-large span { font-size: 0.85rem; padding: 0.4rem 0.9rem; }

/* Project card image + link */
.card-img-btn {
  display: block;
  width: 100%;
  padding: 0;
  margin: 0;
  border: none;
  border-bottom: 1px solid var(--border);
  background: none;
  cursor: zoom-in;
  line-height: 0;
}
.card-img { width: 100%; display: block; }

.card-link { margin-top: 0.9rem !important; font-size: 0.82rem; }
.card-link a { color: var(--accent); }

/* Gallery lightbox */
.gallery-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}
.gallery-modal.open { display: flex; }

.gallery-box {
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.gallery-close {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 1rem;
  margin-left: auto;
  padding: 0;
}
.gallery-close:hover { color: var(--accent); }

.gallery-body {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  overflow: hidden;
}

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

.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(10, 11, 13, 0.65);
  border: 1px solid var(--border);
  color: var(--text);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gallery-prev { left: 0.75rem; }
.gallery-next { right: 0.75rem; }
.gallery-nav:hover { border-color: var(--accent); color: var(--accent); }

.gallery-caption {
  padding: 0.9rem 1.25rem;
  margin: 0;
  color: var(--text-dim);
  font-size: 0.85rem;
  text-align: center;
  border-top: 1px solid var(--border);
}

@media (max-width: 600px) {
  .gallery-nav { width: 30px; height: 30px; font-size: 1rem; }
  .gallery-body img { max-height: 55vh; }
}

/* Buttons — bracket style, no pill */
.btn {
  padding: 0.6rem 1.1rem;
  border-radius: 4px;
  font-weight: 500;
  font-size: 0.88rem;
  display: inline-block;
  font-family: var(--mono);
}

.btn-primary { background: var(--accent); color: #06110c; }
.btn-primary:hover { text-decoration: none; opacity: 0.85; }
.btn-secondary { border: 1px solid var(--border); color: var(--text); }
.btn-secondary:hover { text-decoration: none; border-color: var(--accent); color: var(--accent); }

/* Chat widget */
.chat-widget {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 100;
  font-family: var(--mono);
}

.chat-toggle {
  width: 52px;
  height: 52px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-term);
  color: var(--accent);
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-panel {
  display: none;
  flex-direction: column;
  position: absolute;
  bottom: 64px;
  right: 0;
  width: 340px;
  height: 440px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.chat-widget.open .chat-panel { display: flex; }

.chat-header { justify-content: space-between; }

.chat-header button {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 1rem;
  margin-left: auto;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.chat-message {
  font-size: 0.85rem;
  max-width: 90%;
}

.chat-message-bot { color: var(--text); align-self: flex-start; }
.chat-message-user { color: var(--accent); align-self: flex-end; text-align: right; }

.chat-form {
  display: flex;
  align-items: center;
  border-top: 1px solid var(--border);
  padding: 0.6rem 0.8rem;
  gap: 0.5rem;
}

.chat-form input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.85rem;
}
.chat-form input:focus { outline: none; }

.chat-form button {
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.3rem 0.7rem;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.8rem;
  cursor: pointer;
}
.chat-form button:hover { border-color: var(--accent); }
