:root {
  --emerald: #00a86b;
  --emerald-dim: rgba(0, 168, 107, 0.14);
  --emerald-line: rgba(0, 168, 107, 0.35);
  --carbon: #0f1115;
  --carbon-2: #151920;
  --carbon-3: #1b2129;
  --text-hi: #edeff2;
  --text-mid: #9ba3ae;
  --text-low: #5b636e;
  --border: rgba(255, 255, 255, 0.08);
}
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  scroll-behavior: smooth;
}
body {
  background: var(--carbon);
  color: var(--text-hi);
  font-family: "Inter", sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
}
::selection {
  background: var(--emerald);
  color: var(--carbon);
}
a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3 {
  font-family: "Space Grotesk", sans-serif;
  letter-spacing: -0.01em;
}
.mono {
  font-family: "JetBrains Mono", monospace;
}

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 32px;
}

/* subtle grid texture */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(
    ellipse 80% 60% at 50% 0%,
    black 40%,
    transparent 90%
  );
}

header.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
  background: rgba(15, 17, 21, 0.75);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 18px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.logo {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.02em;
}
.logo span {
  color: var(--emerald);
}
.nav-links {
  display: flex;
  gap: 28px;
  font-size: 14px;
  color: var(--text-mid);
}
.nav-links a:hover {
  color: var(--text-hi);
}
.nav-cta {
  font-size: 13px;
  padding: 8px 16px;
  border: 1px solid var(--emerald-line);
  border-radius: 2px;
  color: var(--emerald);
  font-family: "JetBrains Mono", monospace;
  clip-path: polygon(
    6px 0,
    100% 0,
    100% calc(100% - 6px),
    calc(100% - 6px) 100%,
    0 100%,
    0 6px
  );
}
.nav-cta:hover {
  background: var(--emerald-dim);
}

/* HERO */
.hero {
  position: relative;
  z-index: 1;
  padding: 100px 0 80px;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 56px;
  align-items: center;
}
.eyebrow {
  font-family: "JetBrains Mono", monospace;
  font-size: 12.5px;
  color: var(--emerald);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  letter-spacing: 0.04em;
}
.eyebrow::before {
  content: "";
  width: 7px;
  height: 7px;
  background: var(--emerald);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--emerald);
}
.hero h1 {
  font-size: 46px;
  font-weight: 700;
  line-height: 1.12;
  margin-bottom: 20px;
}
.hero h1 em {
  font-style: normal;
  color: var(--emerald);
}
.hero p.lead {
  font-size: 16.5px;
  color: var(--text-mid);
  max-width: 480px;
  margin-bottom: 32px;
}
.hero-ctas {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.btn-primary {
  background: var(--emerald);
  color: var(--carbon);
  font-weight: 600;
  font-size: 14px;
  padding: 13px 24px;
  border-radius: 2px;
  clip-path: polygon(
    8px 0,
    100% 0,
    100% calc(100% - 8px),
    calc(100% - 8px) 100%,
    0 100%,
    0 8px
  );
  display: inline-block;
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 168, 107, 0.25);
}
.btn-ghost {
  border: 1px solid var(--border);
  font-size: 14px;
  font-weight: 500;
  padding: 13px 22px;
  border-radius: 2px;
  color: var(--text-hi);
}
.btn-ghost:hover {
  border-color: var(--emerald-line);
  color: var(--emerald);
}

/* terminal signature element */
.terminal {
  background: var(--carbon-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.5);
}
.terminal-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 14px;
  background: var(--carbon-3);
  border-bottom: 1px solid var(--border);
}
.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #3a3f47;
}
.terminal-title {
  margin-left: 8px;
  font-family: "JetBrains Mono", monospace;
  font-size: 11.5px;
  color: var(--text-low);
}
.terminal-body {
  padding: 20px 18px;
  font-family: "JetBrains Mono", monospace;
  font-size: 12.8px;
  min-height: 230px;
}
.t-line {
  margin-bottom: 11px;
  opacity: 0;
  animation: fadeIn 0.4s forwards;
}
.t-user {
  color: var(--text-mid);
}
.t-user::before {
  content: "> ";
  color: var(--text-low);
}
.t-ai {
  color: var(--text-hi);
  padding-left: 14px;
  border-left: 2px solid var(--emerald-line);
  margin-left: 1px;
}
.t-status {
  color: var(--emerald);
  font-size: 11.5px;
}
.cursor {
  display: inline-block;
  width: 7px;
  height: 14px;
  background: var(--emerald);
  vertical-align: middle;
  animation: blink 1s step-end infinite;
}
@keyframes fadeIn {
  to {
    opacity: 1;
  }
}
@keyframes blink {
  50% {
    opacity: 0;
  }
}

section {
  position: relative;
  z-index: 1;
  padding: 70px 0;
}
.section-head {
  margin-bottom: 44px;
}
.section-tag {
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  color: var(--emerald);
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}
.section-head h2 {
  font-size: 30px;
  font-weight: 700;
}
.section-head p {
  color: var(--text-mid);
  margin-top: 10px;
  max-width: 560px;
}

/* PROCESS */
.process {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.process-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
}
.process-step {
  padding: 26px 22px;
  border-right: 1px solid var(--border);
  position: relative;
}
.process-step:last-child {
  border-right: none;
}
.process-num {
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  color: var(--text-low);
  margin-bottom: 14px;
}
.process-step h3 {
  font-size: 16.5px;
  margin-bottom: 8px;
}
.process-step p {
  font-size: 13.5px;
  color: var(--text-mid);
}
.process-step::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 0;
  background: var(--emerald);
  transition: width 0.3s ease;
}
.process-step:hover::after {
  width: 100%;
}

/* PROJECTS */
.projects-grid {
  display: grid;
  gap: 18px;
}
.project {
  background: var(--carbon-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 28px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: start;
  transition:
    border-color 0.2s ease,
    transform 0.2s ease;
}
.project:hover {
  border-color: var(--emerald-line);
  transform: translateY(-2px);
}
.project-tag {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: var(--emerald);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.project h3 {
  font-size: 20px;
  margin-bottom: 8px;
}
.project p {
  color: var(--text-mid);
  font-size: 14px;
  max-width: 560px;
  margin-bottom: 14px;
}
.stack-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.pill {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  padding: 4px 10px;
  background: var(--carbon-3);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-mid);
}
.project-link {
  font-family: "JetBrains Mono", monospace;
  font-size: 12.5px;
  color: var(--text-hi);
  border: 1px solid var(--border);
  padding: 9px 16px;
  border-radius: 2px;
  white-space: nowrap;
  height: fit-content;
}
.project-link:hover {
  border-color: var(--emerald);
  color: var(--emerald);
}

/* STACK */
.stack-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.stack-item {
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  padding: 9px 16px;
  border: 1px solid var(--border);
  border-radius: 2px;
  color: var(--text-mid);
}
.stack-item:hover {
  border-color: var(--emerald-line);
  color: var(--emerald);
}

/* CONTACT */
.contact {
  text-align: center;
  padding: 90px 0 110px;
  border-top: 1px solid var(--border);
}
.contact h2 {
  font-size: 34px;
  margin-bottom: 16px;
}
.contact p {
  color: var(--text-mid);
  max-width: 460px;
  margin: 0 auto 34px;
}
.contact-links {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

footer {
  border-top: 1px solid var(--border);
  padding: 26px 0;
  text-align: center;
  color: var(--text-low);
  font-size: 12.5px;
  font-family: "JetBrains Mono", monospace;
}

@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
    padding-top: 60px;
  }
  .hero h1 {
    font-size: 34px;
  }
  .process-grid {
    grid-template-columns: 1fr 1fr;
  }
  .process-step {
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
  }
  .project {
    grid-template-columns: 1fr;
  }
  .nav-links {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .t-line {
    animation: none;
    opacity: 1;
  }
  .cursor {
    animation: none;
  }
}

/* =========================================
   CASO DE ESTUDIO — BAR JOAQUÍN
   ========================================= */

.case-study {
  position: relative;
  z-index: 1;
  padding: 70px 0;
  border-top: 1px solid var(--border);
}

.case-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.case-card {
  background: var(--carbon-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 26px;
  transition:
    border-color 0.2s ease,
    transform 0.2s ease;
}

.case-card:hover {
  border-color: var(--emerald-line);
  transform: translateY(-2px);
}

.case-label {
  display: block;
  margin-bottom: 10px;
  color: var(--emerald);
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.05em;
}

.case-card h3 {
  font-size: 18px;
  margin-bottom: 10px;
}

.case-card p {
  color: var(--text-mid);
  font-size: 14px;
  margin-bottom: 18px;
}

.case-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 18px;
}

.case-detail {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(21, 25, 32, 0.55);
}

.case-detail p {
  color: var(--text-mid);
  font-size: 14px;
}

.case-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

@media (max-width: 860px) {
  .case-grid,
  .case-details {
    grid-template-columns: 1fr;
  }
}
