:root {
  --sand: #f1e3cc;
  --stone: #fff8ec;
  --terracotta: #b3512c;
  --terracotta-dark: #a94728;
  /* El acento como texto necesita más contraste que la superficie terracota:
     en claro es terracota hondo y en noche lavanda (ver bloque oscuro). */
  --text-accent: #a94728;
  --sun: #d99a2b;
  --cactus: #67723f;
  --earth: #38281f;
  --clay: #6b5949;
  --border: #d8c1a3;
  --white: #fffdf8;
  --shadow: rgba(75, 50, 32, 0.14);
  --display: "Space Grotesk", "DM Sans", system-ui, sans-serif;
  --body: "DM Sans", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--earth);
  background: var(--sand);
  font-family: var(--body);
  line-height: 1.6;
  overflow-x: hidden;
}

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

.skip-link {
  position: fixed;
  top: -100px;
  left: 1rem;
  z-index: 100;
  padding: 0.7rem 1rem;
  color: var(--white);
  background: var(--earth);
}

.skip-link:focus {
  top: 1rem;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 78px;
  padding: 0 5vw;
  border-bottom: 1px solid rgba(56, 40, 31, 0.15);
  background: rgba(241, 227, 204, 0.9);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  width: max-content;
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 700;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: var(--stone);
  border-radius: 50% 50% 45% 45%;
  background: var(--terracotta);
}

.main-nav {
  display: flex;
  gap: clamp(1.25rem, 3vw, 2.6rem);
  color: var(--clay);
  font-size: 0.88rem;
  font-weight: 600;
}

.main-nav a,
.text-link,
.contact-links a {
  transition: color 180ms ease;
}

.main-nav a:hover,
.main-nav a:focus-visible,
.text-link:hover,
.contact-links a:hover {
  color: var(--text-accent);
}

.header-actions {
  display: flex;
  align-items: center;
  justify-self: end;
  gap: 0.65rem;
}

.theme-toggle {
  position: relative;
  display: grid;
  width: 40px;
  height: 40px;
  padding: 0;
  place-items: center;
  color: var(--earth);
  border: 1px solid var(--border);
  border-radius: 50%;
  background: rgba(255, 248, 236, 0.45);
  cursor: pointer;
  font: inherit;
  transition: color 180ms ease, border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.theme-toggle:hover {
  color: var(--text-accent);
  border-color: var(--text-accent);
  transform: rotate(8deg);
}

.theme-toggle:focus-visible,
.header-cta:focus-visible,
.button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--sun);
  outline-offset: 3px;
}

.theme-icon {
  position: absolute;
  font-size: 1.1rem;
  line-height: 1;
  transition: opacity 180ms ease, transform 180ms ease;
}

.theme-icon-sun {
  opacity: 0;
  transform: scale(0.55) rotate(-35deg);
}

html[data-theme="dark"] .theme-icon-moon {
  opacity: 0;
  transform: scale(0.55) rotate(35deg);
}

html[data-theme="dark"] .theme-icon-sun {
  opacity: 1;
  transform: scale(1) rotate(0);
}

.header-cta {
  justify-self: end;
  padding: 0.6rem 1rem;
  color: var(--stone);
  border-radius: 999px;
  background: var(--earth);
  font-size: 0.86rem;
  font-weight: 700;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
  align-items: center;
  min-height: min(980px, calc(100vh - 78px));
  padding: clamp(5rem, 10vw, 9rem) 8vw;
  overflow: hidden;
}

.sun {
  position: absolute;
  top: 10%;
  left: 42%;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: var(--sun);
  opacity: 0.3;
  filter: blur(1px);
}

.hero-copy {
  position: relative;
  z-index: 2;
  min-width: 0;
  max-width: 720px;
}

.eyebrow,
.section-number {
  color: var(--text-accent);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.eyebrow > span {
  width: 34px;
  height: 1px;
  background: currentColor;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2 {
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.02;
}

h1 {
  max-width: 800px;
  margin-bottom: 1.7rem;
  font-size: clamp(4.4rem, 8.2vw, 9rem);
}

h2 {
  margin-bottom: 0;
  font-size: clamp(3rem, 5vw, 5.6rem);
}

h3 {
  margin-bottom: 0.5rem;
  font-family: var(--display);
  font-size: 1.45rem;
}

.hero-description {
  max-width: 580px;
  margin-bottom: 2rem;
  color: var(--clay);
  font-size: clamp(1rem, 1.4vw, 1.2rem);
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 1.8rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.6rem;
  min-width: 190px;
  padding: 0.85rem 1rem 0.85rem 1.3rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 700;
  transition: transform 180ms ease, background 180ms ease;
}

.button span {
  font-size: 1.2rem;
}

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

.button-primary {
  color: var(--white);
  background: var(--terracotta);
}

.button-primary:hover {
  background: var(--terracotta-dark);
}

.button-secondary {
  border-color: var(--border);
  background: transparent;
}

.text-link {
  font-size: 0.9rem;
  font-weight: 700;
}

.hero-art {
  position: relative;
  z-index: 1;
  justify-self: end;
  width: min(100%, 510px);
}

.arch {
  position: relative;
  height: min(62vh, 620px);
  min-height: 430px;
  overflow: hidden;
  border: 1px solid rgba(56, 40, 31, 0.16);
  border-radius: 50% 50% 12px 12px;
  background: #ead09f;
  box-shadow: 0 30px 70px var(--shadow);
}

.arch::after {
  position: absolute;
  right: -20%;
  bottom: -18%;
  width: 115%;
  height: 52%;
  border-radius: 50% 50% 0 0;
  background: var(--terracotta);
  content: "";
}

.arch::before {
  position: absolute;
  bottom: 10%;
  left: -30%;
  z-index: 1;
  width: 115%;
  height: 35%;
  border-radius: 50% 50% 0 0;
  background: #c99058;
  content: "";
}

.arch-sun {
  position: absolute;
  top: 20%;
  right: 18%;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: var(--sun);
  box-shadow: 0 0 50px rgba(217, 154, 43, 0.26);
}

.mesa {
  position: absolute;
  z-index: 1;
  bottom: 30%;
  height: 13%;
  background: #9d4b2b;
  clip-path: polygon(12% 0, 100% 0, 83% 100%, 0 100%);
}

.mesa-back {
  right: 2%;
  width: 38%;
  opacity: 0.75;
}

.mesa-front {
  right: 16%;
  bottom: 21%;
  z-index: 2;
  width: 52%;
}

.cactus {
  position: absolute;
  z-index: 4;
  width: 25px;
  border-radius: 20px 20px 4px 4px;
  background: var(--cactus);
}

.cactus::before,
.cactus::after,
.cactus i,
.cactus b {
  position: absolute;
  width: 15px;
  height: 58px;
  border-radius: 14px;
  background: inherit;
  content: "";
}

.cactus-one {
  right: 22%;
  bottom: 13%;
  height: 150px;
}

.cactus-one::before {
  top: 43px;
  right: 15px;
  transform: rotate(-40deg);
}

.cactus-one::after {
  top: 68px;
  left: 15px;
  transform: rotate(42deg);
}

.cactus-two {
  bottom: 8%;
  left: 22%;
  width: 18px;
  height: 93px;
  background: #59653b;
}

.cactus-two::before {
  top: 32px;
  right: 11px;
  height: 42px;
  transform: rotate(-42deg);
}

.cactus-two::after {
  top: 45px;
  left: 11px;
  height: 37px;
  transform: rotate(40deg);
}

.availability {
  position: absolute;
  right: 4vw;
  bottom: 28px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.7rem 1rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--stone);
  box-shadow: 0 12px 30px var(--shadow);
  font-size: 0.78rem;
  font-weight: 600;
}

.availability span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--cactus);
  box-shadow: 0 0 0 4px rgba(111, 122, 74, 0.17);
}

.hero-index {
  position: absolute;
  right: 2vw;
  bottom: 2rem;
  color: var(--clay);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  writing-mode: vertical-rl;
}

.section {
  padding: clamp(5rem, 9vw, 9rem) 8vw;
  border-top: 1px solid rgba(56, 40, 31, 0.15);
}

.section-heading {
  display: grid;
  grid-template-columns: minmax(180px, 0.34fr) minmax(0, 1fr);
  gap: 4rem;
  margin-bottom: clamp(3.5rem, 7vw, 7rem);
}

.about {
  background: var(--stone);
}

.about-grid,
.experience-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(3rem, 8vw, 9rem);
  margin-left: calc(34% + 4rem);
}

.lead {
  color: var(--earth);
  font-family: var(--display);
  font-size: clamp(1.5rem, 2.3vw, 2.4rem);
  line-height: 1.25;
}

.about-statement > p:last-child,
.projects-heading > p,
.faq-heading > p,
.case-intro > p:last-child,
.case-story p {
  color: var(--clay);
}

.about-details article {
  display: grid;
  grid-template-columns: 35px 1fr;
  gap: 1rem;
  padding: 1.4rem 0;
  border-top: 1px solid var(--border);
}

.about-details article > span,
.project-count,
.case-story article > span {
  color: var(--text-accent);
  font-family: var(--display);
  font-size: 0.86rem;
}

/* Los números de la trama caen sobre el panel oscuro del caso, donde el
   terracota de la paleta se hunde (3,3:1). Ahí usan el mismo ámbar que el
   resto de las etiquetas del caso. */
.case-study .case-story article > span {
  color: #e9b164;
}

.about-details p {
  margin-bottom: 0;
  color: var(--clay);
}

.projects {
  background: var(--sand);
}

.projects-heading {
  grid-template-columns: 1fr minmax(240px, 0.35fr);
  align-items: end;
}

.projects-heading > p {
  margin: 0;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 2rem;
}

.filter {
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--clay);
  font-size: 0.78rem;
}

.filter.active {
  color: var(--stone);
  border-color: var(--earth);
  background: var(--earth);
}

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

.project-card {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--stone);
  box-shadow: 0 18px 45px rgba(75, 50, 32, 0.06);
}

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

.project-visual {
  position: relative;
  display: grid;
  min-height: 350px;
  padding: 3rem;
  place-items: center;
  overflow: hidden;
}

.project-featured .project-visual {
  min-height: 520px;
}

.visual-one {
  background: #d9ae72;
}

.visual-one::before,
.visual-two::before,
.visual-three::before {
  position: absolute;
  width: 65%;
  aspect-ratio: 1;
  border: 1px solid rgba(255, 248, 236, 0.5);
  border-radius: 50%;
  content: "";
}

.visual-two {
  background: var(--cactus);
}

.visual-three {
  background: var(--terracotta);
}

.project-type {
  position: absolute;
  top: 1.2rem;
  left: 1.2rem;
  z-index: 2;
  padding: 0.4rem 0.75rem;
  color: var(--earth);
  border-radius: 999px;
  background: rgba(255, 248, 236, 0.88);
  font-size: 0.72rem;
  font-weight: 700;
}

.browser-mockup {
  position: relative;
  z-index: 1;
  width: min(76%, 760px);
  padding: 0.7rem;
  border: 1px solid rgba(56, 40, 31, 0.28);
  border-radius: 10px;
  background: var(--stone);
  box-shadow: 0 30px 70px rgba(56, 40, 31, 0.2);
  transform: rotate(-2deg);
}

.browser-bar {
  display: flex;
  gap: 5px;
  padding: 0.2rem 0 0.7rem;
}

.browser-bar i,
.case-window-bar i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border);
}

.browser-content {
  display: grid;
  grid-template-columns: 22% 1fr;
  min-height: 260px;
  border: 1px solid var(--border);
  background: #f8ead5;
}

.mock-sidebar {
  background: var(--earth);
}

.mock-main {
  padding: 2rem;
}

.mock-line {
  width: 42%;
  height: 9px;
  margin-bottom: 0.7rem;
  background: var(--border);
}

.mock-line.wide {
  width: 74%;
  height: 17px;
  background: var(--terracotta);
}

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

.mock-panels i {
  min-height: 110px;
  border: 1px solid var(--border);
  background: var(--stone);
}

.phone-mockup {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 160px;
  height: 275px;
  padding: 3.5rem 1.2rem 1.2rem;
  border: 8px solid var(--earth);
  border-radius: 28px;
  background: var(--stone);
  box-shadow: 0 24px 50px rgba(33, 40, 23, 0.3);
  transform: rotate(5deg);
}

.phone-mockup::before {
  position: absolute;
  top: 12px;
  left: 50%;
  width: 50px;
  height: 6px;
  border-radius: 999px;
  background: var(--earth);
  content: "";
  transform: translateX(-50%);
}

.phone-mockup span {
  height: 36px;
  border-radius: 6px;
  background: var(--sand);
}

.phone-mockup span:first-child {
  height: 68px;
  background: var(--terracotta);
}

.dashboard-mockup {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.8rem;
  width: min(78%, 430px);
  padding: 1.5rem;
  border-radius: 8px;
  background: var(--stone);
  box-shadow: 0 24px 50px rgba(86, 37, 20, 0.28);
  transform: rotate(-4deg);
}

.dashboard-mockup div {
  min-height: 75px;
  border: 1px solid var(--border);
  background: var(--sand);
}

.dashboard-mockup div:first-child {
  grid-column: 1 / -1;
  min-height: 42px;
  background: var(--earth);
}

.project-copy {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: 1.1rem;
  align-items: start;
  padding: 1.6rem;
}

.project-copy p {
  margin-bottom: 1rem;
  color: var(--clay);
}

.project-copy .project-count {
  color: var(--text-accent);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tag-list span {
  padding: 0.25rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--clay);
  font-size: 0.68rem;
}

.circle-link {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  color: var(--stone);
  border-radius: 50%;
  background: var(--earth);
  transition: transform 180ms ease, background 180ms ease;
}

.circle-link:hover {
  background: var(--terracotta);
  transform: rotate(10deg);
}

.case-study {
  /* El panel del caso es oscuro en los dos temas, así que aquí se fijan los
     colores que usan sus textos: si no, el tema noche invierte --stone y deja
     las métricas, las negrillas y los enlaces de navegación en casi negro. */
  --stone: #fff8ec;
  --earth: #38281f;
  --sun: #d99a2b;
  color: var(--stone);
  background: var(--earth);
}

.case-study .section-number,
.case-kicker {
  color: #e9b164;
}

.case-intro {
  max-width: 850px;
}

.case-intro h2 {
  margin: 2rem 0;
}

.case-intro > p:last-child {
  max-width: 580px;
  color: #cbb9aa;
}

.case-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin: 4rem 0;
  border: 1px solid rgba(255, 248, 236, 0.2);
  background: rgba(255, 248, 236, 0.2);
}

.case-meta > div {
  display: flex;
  flex-direction: column;
  padding: 1.2rem;
  background: var(--earth);
}

.case-meta span {
  color: #cbb9aa;
  font-size: 0.72rem;
  text-transform: uppercase;
}

.case-meta strong {
  margin-top: 0.25rem;
  font-size: 0.9rem;
}

.case-canvas {
  display: grid;
  min-height: 590px;
  padding: 5vw;
  place-items: center;
  background: var(--terracotta);
}

.case-window {
  width: min(84%, 880px);
  padding: 0.8rem;
  border-radius: 8px;
  background: var(--stone);
  box-shadow: 0 35px 80px rgba(0, 0, 0, 0.22);
}

.case-window-bar {
  display: flex;
  gap: 6px;
  padding: 0.3rem 0 0.8rem;
}

.case-window-layout {
  display: grid;
  grid-template-columns: 23% 1fr;
  min-height: 360px;
  border: 1px solid var(--border);
  background: var(--sand);
}

.case-window-layout aside {
  background: var(--cactus);
}

.case-window-body {
  padding: 3rem;
}

.case-window-body > span {
  display: block;
  width: 65%;
  height: 13px;
  margin-bottom: 0.8rem;
  background: var(--terracotta);
}

.case-window-body > span:nth-child(2) {
  width: 40%;
  height: 8px;
  background: var(--border);
}

.case-window-body div {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 3rem;
}

.case-window-body i {
  min-height: 150px;
  border: 1px solid var(--border);
  background: var(--stone);
}

.case-story {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-top: 4rem;
}

.case-story article {
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 248, 236, 0.25);
}

.case-story p {
  color: #cbb9aa;
}

.experience {
  background: var(--stone);
}

.experience-layout {
  align-items: start;
}

.experience-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.9rem;
}

.experience-actions small,
.contact-note {
  color: var(--clay);
}

.faq {
  background: var(--sand);
}

.faq-heading {
  grid-template-columns: 1fr minmax(240px, 0.35fr);
  align-items: end;
}

.faq-list {
  margin-left: 34%;
  border-top: 1px solid var(--border);
}

.faq-list details {
  border-bottom: 1px solid var(--border);
}

.faq-list summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 1.6rem 0;
  cursor: pointer;
  font-family: var(--display);
  font-size: 1.25rem;
  list-style: none;
}

.faq-list summary::-webkit-details-marker {
  display: none;
}

.faq-list summary span {
  color: var(--text-accent);
  font-family: var(--body);
}

.faq-list details[open] summary span {
  font-size: 0;
}

.faq-list details[open] summary span::after {
  font-size: 1rem;
  content: "−";
}

.faq-list details p {
  max-width: 680px;
  padding: 0 0 1.5rem;
  color: var(--clay);
}

.contact {
  position: relative;
  min-height: 690px;
  overflow: hidden;
  color: var(--stone);
  background: var(--terracotta);
}

.contact-sun {
  position: absolute;
  right: 6vw;
  bottom: -14vw;
  width: 40vw;
  height: 40vw;
  border-radius: 50%;
  background: var(--sun);
  opacity: 0.85;
}

.contact .section-number {
  color: #fff1e6;
}

.eyebrow.light {
  margin-top: 7rem;
  color: #fff1e6;
}

.contact h2 {
  position: relative;
  z-index: 1;
  max-width: 880px;
  margin: 1.5rem 0 3rem;
}

.contact-mail {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  max-width: 760px;
  padding: 1rem 0;
  border-bottom: 1px solid rgba(255, 248, 236, 0.65);
  font-family: var(--display);
  font-size: clamp(1.5rem, 3vw, 3rem);
}

.contact-note {
  position: relative;
  z-index: 1;
  margin-top: 1rem;
  color: #fff1e6;
  font-size: 0.75rem;
}

.contact-links {
  position: absolute;
  right: 8vw;
  bottom: 4rem;
  z-index: 1;
  display: flex;
  gap: 2rem;
  font-size: 0.82rem;
  font-weight: 700;
}

.ai-preview {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 15;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.7rem;
  align-items: center;
  min-width: 235px;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 248, 236, 0.94);
  box-shadow: 0 15px 40px var(--shadow);
  backdrop-filter: blur(12px);
}

.ai-label {
  position: absolute;
  top: -9px;
  right: 10px;
  padding: 0.1rem 0.45rem;
  color: var(--stone);
  border-radius: 999px;
  background: var(--cactus);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ai-icon {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  color: var(--stone);
  border-radius: 50%;
  background: var(--terracotta);
  font-family: var(--display);
}

.ai-preview strong {
  display: block;
  font-size: 0.78rem;
}

.ai-preview p {
  margin: 0;
  color: var(--clay);
  font-size: 0.65rem;
}

footer {
  display: flex;
  justify-content: space-between;
  padding: 1.4rem 8vw;
  color: var(--clay);
  border-top: 1px solid var(--border);
  background: var(--sand);
  font-size: 0.75rem;
}

body,
.site-header,
.about,
.projects,
.project-card,
.experience,
.faq,
.ai-preview,
footer {
  transition: color 240ms ease, background-color 240ms ease, border-color 240ms ease, box-shadow 240ms ease;
}

@media (max-width: 960px) {
  .site-header {
    grid-template-columns: 1fr auto;
  }

  .main-nav {
    display: none;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 4rem;
    min-height: auto;
  }

  .hero-copy {
    padding-top: 2rem;
  }

  .hero-art {
    justify-self: center;
    width: min(90%, 530px);
  }

  .arch {
    height: 550px;
  }

  /* El indice vertical del hero caeria encima de la pastilla de disponibilidad. */
  .hero-index {
    display: none;
  }

  .section-heading,
  .projects-heading,
  .faq-heading {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .about-grid,
  .experience-layout {
    margin-left: 0;
  }

  .faq-list {
    margin-left: 0;
  }
}

@media (max-width: 720px) {
  .site-header {
    min-height: 66px;
    padding: 0 1.25rem;
  }

  .header-cta {
    padding: 0.5rem 0.75rem;
    font-size: 0.76rem;
  }

  .hero,
  .section {
    padding-right: 1.25rem;
    padding-left: 1.25rem;
  }

  h1 {
    max-width: 100%;
    font-size: clamp(3.2rem, 14vw, 4rem);
  }

  h2 {
    font-size: clamp(2.6rem, 12vw, 4rem);
  }

  .hero-actions {
    align-items: flex-start;
    flex-direction: column;
    gap: 1rem;
  }

  .hero-art {
    width: 100%;
  }

  .arch {
    height: 450px;
    min-height: auto;
  }

  .availability {
    right: 10px;
  }

  .about-grid,
  .experience-layout,
  .project-grid,
  .case-story,
  .case-meta {
    grid-template-columns: 1fr;
  }

  .project-featured {
    grid-column: auto;
  }

  .project-featured .project-visual,
  .project-visual {
    min-height: 340px;
    padding: 1.5rem;
  }

  .browser-mockup {
    width: 94%;
  }

  .browser-content {
    min-height: 200px;
  }

  .mock-main {
    padding: 1rem;
  }

  .case-canvas {
    min-height: 410px;
    padding: 1.2rem;
  }

  .case-window {
    width: 100%;
  }

  .case-window-layout {
    min-height: 250px;
  }

  .case-window-body {
    padding: 1.5rem;
  }

  .case-window-body div {
    gap: 0.4rem;
  }

  .case-window-body i {
    min-height: 90px;
  }

  .contact {
    min-height: 650px;
  }

  .contact-sun {
    right: -20%;
    bottom: -5%;
    width: 90vw;
    height: 90vw;
  }

  .contact-mail {
    gap: 1rem;
    overflow-wrap: anywhere;
    font-size: clamp(1.3rem, 7vw, 2.2rem);
  }

  .contact-mail span {
    flex: 0 0 auto;
  }

  .contact-links {
    right: auto;
    bottom: 2.4rem;
    left: 1.25rem;
    flex-wrap: wrap;
  }

  .ai-preview {
    right: 0.75rem;
    bottom: 0.75rem;
    min-width: auto;
  }

  .ai-preview > div:last-child {
    display: none;
  }

  footer {
    flex-direction: column;
    gap: 0.2rem;
    padding-right: 1.25rem;
    padding-left: 1.25rem;
  }
}

/* Modo noche: paleta neón entregada para Nesturfy. */
html[data-theme="dark"] {
  --sand: #121318;
  --stone: #1c1e26;
  --terracotta: #7c3aed;
  --terracotta-dark: #c400ab;
  --text-accent: #a78bfa;
  --sun: #2563eb;
  --cactus: #22d3ee;
  --earth: #f8fafc;
  --clay: #a1a1aa;
  --border: #343746;
  --white: #f8fafc;
  --shadow: rgba(0, 0, 0, 0.38);
}

html[data-theme="dark"] body {
  background: #121318;
}

html[data-theme="dark"] .site-header {
  border-bottom-color: rgba(248, 250, 252, 0.1);
  background: rgba(18, 19, 24, 0.88);
}

html[data-theme="dark"] .brand-mark {
  color: #f8fafc;
  background: linear-gradient(135deg, #7c3aed, #c400ab);
  box-shadow: 0 0 24px rgba(230, 0, 199, 0.22);
}

html[data-theme="dark"] .main-nav a:hover,
html[data-theme="dark"] .main-nav a:focus-visible,
html[data-theme="dark"] .text-link:hover,
html[data-theme="dark"] .contact-links a:hover {
  color: #22d3ee;
}

html[data-theme="dark"] .theme-toggle {
  color: #f8fafc;
  border-color: #343746;
  background: #1c1e26;
}

html[data-theme="dark"] .theme-toggle:hover {
  color: #22d3ee;
  border-color: #22d3ee;
}

html[data-theme="dark"] .header-cta {
  color: #f8fafc;
  background: #7c3aed;
}

html[data-theme="dark"] .header-cta:hover {
  background: #c400ab;
}

html[data-theme="dark"] .eyebrow,
html[data-theme="dark"] .section-number,
html[data-theme="dark"] .about-details article > span,
html[data-theme="dark"] .project-count,
html[data-theme="dark"] .case-story article > span {
  color: #22d3ee;
}

html[data-theme="dark"] .sun {
  background: #2563eb;
  opacity: 0.42;
  box-shadow: 0 0 70px rgba(37, 99, 235, 0.48);
}

html[data-theme="dark"] .button-primary {
  background: #7c3aed;
  box-shadow: 0 12px 30px rgba(139, 92, 246, 0.2);
}

html[data-theme="dark"] .button-primary:hover {
  background: #c400ab;
}

html[data-theme="dark"] .arch {
  border-color: rgba(248, 250, 252, 0.12);
  background: linear-gradient(160deg, #222437 0%, #171923 70%);
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.42), 0 0 80px rgba(139, 92, 246, 0.12);
}

html[data-theme="dark"] .arch::before {
  background: #182d6e;
}

html[data-theme="dark"] .arch::after {
  background: #4b1a75;
}

html[data-theme="dark"] .arch-sun {
  background: #e600c7;
  box-shadow: 0 0 65px rgba(230, 0, 199, 0.44);
}

html[data-theme="dark"] .mesa {
  background: #2563eb;
}

html[data-theme="dark"] .mesa-front {
  background: #6836cb;
}

html[data-theme="dark"] .cactus-two {
  background: #2563eb;
}

html[data-theme="dark"] .availability {
  color: #f8fafc;
  border-color: #343746;
  background: #1c1e26;
}

html[data-theme="dark"] .availability span {
  background: #22d3ee;
  box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.14), 0 0 18px rgba(34, 211, 238, 0.45);
}

/* En noche --earth y --white valen lo mismo: la skip link seria invisible
   al recibiar el foco de teclado. Se fija pareja oscura sobre clara. */
html[data-theme="dark"] .skip-link {
  color: #121318;
  background: #f8fafc;
}

html[data-theme="dark"] .section {
  border-top-color: rgba(248, 250, 252, 0.1);
}

html[data-theme="dark"] .about,
html[data-theme="dark"] .experience {
  background: #1c1e26;
}

html[data-theme="dark"] .projects,
html[data-theme="dark"] .faq,
html[data-theme="dark"] footer {
  background: #121318;
}

html[data-theme="dark"] .lead {
  color: #f8fafc;
}

html[data-theme="dark"] .filter.active {
  color: #f8fafc;
  border-color: #7c3aed;
  background: #7c3aed;
}

html[data-theme="dark"] .project-card {
  border-color: #343746;
  background: #1c1e26;
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.22);
}

html[data-theme="dark"] .visual-one {
  background: linear-gradient(135deg, #8b5cf6 0%, #5b36c9 52%, #2563eb 100%);
}

html[data-theme="dark"] .visual-two {
  background: linear-gradient(145deg, #0f7788, #22d3ee);
}

html[data-theme="dark"] .visual-three {
  background: linear-gradient(145deg, #2563eb, #791eb5 58%, #e600c7);
}

html[data-theme="dark"] .visual-one::before,
html[data-theme="dark"] .visual-two::before,
html[data-theme="dark"] .visual-three::before {
  border-color: rgba(248, 250, 252, 0.34);
}

html[data-theme="dark"] .project-type {
  color: #f8fafc;
  background: rgba(18, 19, 24, 0.84);
}

html[data-theme="dark"] .browser-mockup,
html[data-theme="dark"] .case-window,
html[data-theme="dark"] .dashboard-mockup,
html[data-theme="dark"] .phone-mockup {
  background: #1c1e26;
}

html[data-theme="dark"] .browser-content,
html[data-theme="dark"] .case-window-layout {
  background: #121318;
}

html[data-theme="dark"] .mock-sidebar,
html[data-theme="dark"] .phone-mockup::before,
html[data-theme="dark"] .dashboard-mockup div:first-child {
  background: #0b0c10;
}

html[data-theme="dark"] .mock-line.wide,
html[data-theme="dark"] .phone-mockup span:first-child,
html[data-theme="dark"] .case-window-body > span {
  background: #e600c7;
}

html[data-theme="dark"] .mock-panels i,
html[data-theme="dark"] .dashboard-mockup div,
html[data-theme="dark"] .phone-mockup span,
html[data-theme="dark"] .case-window-body i {
  background: #1c1e26;
}

html[data-theme="dark"] .circle-link {
  color: #f8fafc;
  background: #7c3aed;
}

html[data-theme="dark"] .circle-link:hover {
  background: #c400ab;
}

html[data-theme="dark"] .case-study {
  color: #f8fafc;
  background: #0b0c10;
}

html[data-theme="dark"] .case-study .section-number,
html[data-theme="dark"] .case-kicker {
  color: #22d3ee;
}

html[data-theme="dark"] .case-intro > p:last-child,
html[data-theme="dark"] .case-story p {
  color: #a1a1aa;
}

html[data-theme="dark"] .case-meta {
  border-color: rgba(248, 250, 252, 0.14);
  background: rgba(248, 250, 252, 0.14);
}

html[data-theme="dark"] .case-meta > div {
  background: #121318;
}

html[data-theme="dark"] .case-meta span {
  color: #a1a1aa;
}

html[data-theme="dark"] .case-canvas {
  background: linear-gradient(135deg, #8b5cf6 0%, #2563eb 52%, #e600c7 100%);
}

html[data-theme="dark"] .case-window-layout aside {
  background: #2563eb;
}

html[data-theme="dark"] .faq-list,
html[data-theme="dark"] .faq-list details,
html[data-theme="dark"] .about-details article {
  border-color: #343746;
}

html[data-theme="dark"] .faq-list summary span {
  color: #22d3ee;
}

html[data-theme="dark"] .contact {
  color: #f8fafc;
  background: linear-gradient(135deg, #5422b8 0%, #7c3aed 43%, #a4008f 100%);
}

html[data-theme="dark"] .contact-sun {
  background: #2563eb;
  box-shadow: 0 0 90px rgba(34, 211, 238, 0.2);
}

html[data-theme="dark"] .contact .section-number,
html[data-theme="dark"] .eyebrow.light {
  color: #dffbff;
}

html[data-theme="dark"] .contact-note {
  color: #f2f2f7;
}

/* La etiqueta cae sobre el cian del neón: ahí el texto tiene que ser oscuro. */
html[data-theme="dark"] .caption-chip {
  color: #121318;
}

/* Y la consola, al revés: fondo tinta, letras de cielo. */
html[data-theme="dark"] .terminal-line b {
  color: #60a5fa;
}

html[data-theme="dark"] .ai-preview {
  color: #f8fafc;
  border-color: #343746;
  background: rgba(28, 30, 38, 0.94);
}

html[data-theme="dark"] .ai-label {
  color: #121318;
  background: #22d3ee;
}

html[data-theme="dark"] .ai-icon {
  color: #f8fafc;
  background: linear-gradient(135deg, #7c3aed, #c400ab);
}

html[data-theme="dark"] footer {
  border-top-color: #343746;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}

/* Revisión de arquitectura y páginas interiores. */
section[id] {
  scroll-margin-top: 120px;
}

.main-nav a[aria-current="page"] {
  color: var(--text-accent);
}

.about-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-left: 0;
}

.projects-home {
  display: grid;
  grid-template-columns: minmax(260px, 0.7fr) minmax(0, 1.3fr);
  gap: clamp(3rem, 7vw, 8rem);
  align-items: center;
  color: var(--stone);
  background: var(--earth);
}

.projects-home-copy {
  position: relative;
  z-index: 1;
}

.projects-home-copy .section-number {
  color: #e9b164;
}

.projects-home-copy h2 {
  margin: 1.3rem 0 1.5rem;
}

.projects-home-copy > p:not(.section-number) {
  max-width: 460px;
  color: #cbb9aa;
}

.button-light {
  margin-top: 1rem;
  color: var(--earth);
  background: var(--stone);
}

.button-light:hover {
  background: #f1e3cc;
}

.projects-portal {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: clamp(430px, 42vw, 680px);
  padding: clamp(1.2rem, 2.5vw, 2.2rem);
  overflow: hidden;
  color: var(--earth);
  background: var(--terracotta);
  transition: transform 200ms ease, box-shadow 200ms ease;
}

.projects-portal::before {
  position: absolute;
  right: -15%;
  bottom: -45%;
  width: 80%;
  aspect-ratio: 1;
  border: 1px solid rgba(255, 248, 236, 0.36);
  border-radius: 50%;
  content: "";
}

.projects-portal:hover {
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.24);
  transform: translateY(-5px);
}

.portal-topline {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--white);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.projects-portal .case-window {
  z-index: 1;
  width: min(84%, 820px);
  margin: auto;
}

.faq-more {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 1.5rem 0;
  color: var(--terracotta-dark);
  border-bottom: 1px solid var(--border);
  font-family: var(--display);
  font-size: 1.25rem;
  font-weight: 700;
}

.faq-more small {
  display: block;
  margin-bottom: 0.15rem;
  color: var(--clay);
  font-family: var(--body);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.faq-more strong {
  display: grid;
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--white);
  border-radius: 50%;
  background: var(--terracotta);
  font-family: var(--body);
  transition: transform 180ms ease;
}

.faq-more:hover strong {
  transform: translateX(5px);
}

.page-hero {
  display: flex;
  min-height: min(78vh, 820px);
  padding: clamp(5rem, 10vw, 9rem) 8vw;
  flex-direction: column;
  justify-content: center;
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(circle at 80% 35%, rgba(217, 154, 43, 0.2) 0 7%, transparent 7.2%),
    var(--sand);
}

.page-hero-compact {
  min-height: min(66vh, 680px);
}

.page-hero h1,
.project-detail h1 {
  max-width: 1050px;
  margin: 1.2rem 0 2rem;
}

.page-hero > p:last-child {
  max-width: 650px;
  color: var(--clay);
  font-size: 1.05rem;
}

.back-link {
  width: max-content;
  margin-bottom: 2.5rem;
  color: var(--clay);
  font-size: 0.8rem;
  font-weight: 700;
}

.back-link:hover {
  color: var(--text-accent);
}

/* El arena del page-hero (#ecd4ac) es más oscuro que el resto del lienzo,
   así que allí el acento de texto se hunde un punto más en modo claro. */
html:not([data-theme="dark"]) .page-hero .eyebrow,
html:not([data-theme="dark"]) .page-hero .back-link:hover {
  color: #96401f;
}

.back-link-light {
  color: #cbb9aa;
}

.projects-page {
  border-top: 0;
}

.project-status {
  align-self: start;
  padding: 0.35rem 0.65rem;
  color: var(--clay);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.65rem;
  white-space: nowrap;
}

.project-detail {
  min-height: calc(100vh - 78px);
  padding-top: clamp(5rem, 8vw, 8rem);
}

.case-window {
  width: min(86%, 1200px);
}

.case-canvas {
  min-height: clamp(430px, 46vw, 780px);
}

.faq-page {
  border-top: 0;
}

.faq-group {
  margin-top: clamp(6rem, 10vw, 10rem);
}

.faq-archive {
  margin-left: min(34%, 430px);
}

footer a {
  font-weight: 700;
}

html[data-theme="dark"] .projects-home {
  color: #f8fafc;
  background: #0b0c10;
}

html[data-theme="dark"] .projects-home-copy .section-number {
  color: #22d3ee;
}

html[data-theme="dark"] .projects-home-copy > p:not(.section-number) {
  color: #a1a1aa;
}

html[data-theme="dark"] .button-light {
  color: #121318;
  background: #f8fafc;
}

html[data-theme="dark"] .projects-portal {
  color: #f8fafc;
  background: linear-gradient(135deg, #6d28d9 0%, #2563eb 58%, #a4008f 100%);
}

html[data-theme="dark"] .page-hero {
  background:
    radial-gradient(circle at 80% 35%, rgba(37, 99, 235, 0.32) 0 7%, transparent 7.2%),
    #121318;
}

html[data-theme="dark"] .faq-more {
  color: #22d3ee;
}

html[data-theme="dark"] .faq-more strong {
  color: #f8fafc;
  background: #7c3aed;
}

html[data-theme="dark"] .project-status {
  color: #a1a1aa;
}

@media (min-width: 1800px) {
  .case-window {
    width: min(76%, 1320px);
  }

  .projects-portal .case-window {
    width: min(80%, 960px);
  }
}

@media (max-width: 960px) {
  .site-header {
    grid-template-columns: 1fr auto;
    row-gap: 0;
    padding-top: 0.65rem;
  }

  .brand {
    grid-column: 1;
    grid-row: 1;
  }

  .header-actions {
    grid-column: 2;
    grid-row: 1;
  }

  .main-nav {
    display: flex;
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: flex-start;
    width: 100%;
    padding: 0.55rem 0 0.65rem;
    overflow-x: auto;
    scrollbar-width: none;
  }

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

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

  .projects-home-copy {
    max-width: 680px;
  }

  .projects-portal {
    min-height: 520px;
  }

  .faq-archive {
    margin-left: 0;
  }
}

@media (max-width: 720px) {
  section[id] {
    scroll-margin-top: 130px;
  }

  .main-nav {
    gap: 1.35rem;
    font-size: 0.76rem;
  }

  .about-grid {
    grid-template-columns: 1fr;
  }

  .projects-home {
    gap: 2.5rem;
  }

  .projects-portal {
    min-height: 390px;
    padding: 1rem;
  }

  .projects-portal .case-window {
    width: 100%;
  }

  .portal-topline {
    font-size: 0.62rem;
  }

  .page-hero {
    min-height: 620px;
    padding-right: 1.25rem;
    padding-left: 1.25rem;
  }

  .page-hero h1,
  .project-detail h1 {
    font-size: clamp(3.1rem, 14vw, 4.3rem);
  }

  .project-copy {
    grid-template-columns: 26px minmax(0, 1fr);
  }

  .project-copy .circle-link,
  .project-copy .project-status {
    grid-column: 2;
  }

  .project-status {
    width: max-content;
  }

  .case-canvas {
    min-height: 360px;
  }

  .ai-preview {
    display: none;
  }
}


/* ============================================================
   Fichas de proyecto: filtros reales, escenas y caso de estudio
   ============================================================ */

.filter {
  padding: 0.45rem 0.9rem;
  color: var(--clay);
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-size: 0.78rem;
  transition: color 180ms ease, border-color 180ms ease, background 180ms ease;
}

.filter:hover {
  color: var(--text-accent);
  border-color: var(--text-accent);
}

.filter-feedback {
  margin: 0 0 1.8rem;
  color: var(--clay);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.project-card {
  display: flex;
  flex-direction: column;
  transition: transform 220ms ease, box-shadow 220ms ease, color 240ms ease, background-color 240ms ease, border-color 240ms ease;
}

.project-card:hover {
  box-shadow: 0 26px 60px rgba(75, 50, 32, 0.13);
  transform: translateY(-4px);
}

.project-card[hidden] {
  display: none;
}

.project-card > .project-copy {
  flex: 1;
}

.project-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.1rem;
  margin-top: 1.1rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--border);
  color: var(--clay);
  font-size: 0.72rem;
}

.project-metrics b {
  display: block;
  color: var(--text-accent);
  font-family: var(--display);
  font-size: 1.05rem;
  line-height: 1.2;
}

/* Escenas nuevas: misma luz que las tres de origen. */

.visual-four {
  background: var(--clay);
}

.visual-five {
  background: var(--sun);
}

.visual-six {
  background: #2c3444;
}

.visual-four::before,
.visual-five::before,
.visual-six::before {
  position: absolute;
  width: 65%;
  aspect-ratio: 1;
  border: 1px solid rgba(255, 248, 236, 0.5);
  border-radius: 50%;
  content: "";
}

/* Servidor: torres con bahías de disco y testigo luminoso. */

.rack-scene {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 0.55rem;
  width: min(72%, 400px);
  padding: 1rem;
  border: 1px solid rgba(56, 40, 31, 0.3);
  border-radius: 10px;
  background: var(--stone);
  box-shadow: 0 28px 62px rgba(56, 40, 31, 0.22);
  transform: rotate(-2deg);
}

.rack-unit {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.7rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--sand);
}

.rack-slots {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}

.rack-slots i {
  height: 12px;
  border-radius: 2px;
  background: var(--border);
}

.rack-unit strong {
  color: var(--clay);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}

.rack-unit-led {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--sun);
  box-shadow: 0 0 12px var(--sun);
  animation: led-pulse 2.6s ease-in-out infinite;
}

.rack-unit-accent {
  background: var(--earth);
}

.rack-unit-accent strong {
  color: var(--stone);
}

.rack-bar {
  height: 7px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--terracotta), var(--sun));
}

@keyframes led-pulse {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 1; }
}

/* Conducto de datos: nodos enlazados de izquierda a derecha. */

.pipeline-scene {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 0.7rem;
  width: min(88%, 560px);
  padding: 1.3rem;
  border-radius: 10px;
  background: var(--stone);
  box-shadow: 0 26px 58px rgba(56, 40, 31, 0.2);
  transform: rotate(2deg);
}

.pipe-node {
  display: grid;
  gap: 0.4rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--sand);
  color: var(--clay);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pipe-node i {
  height: 6px;
  border-radius: 999px;
  background: var(--border);
}

.pipe-node-key {
  color: var(--stone);
  border-color: var(--earth);
  background: var(--earth);
}

.pipe-node-key i {
  background: var(--sun);
}

/* Terminal de trabajo: sesiones, banderas y progreso. */

.terminal-scene {
  position: relative;
  z-index: 1;
  width: min(80%, 560px);
  padding: 0.8rem;
  border: 1px solid rgba(56, 40, 31, 0.28);
  border-radius: 10px;
  background: var(--earth);
  box-shadow: 0 30px 68px rgba(56, 40, 31, 0.26);
  transform: rotate(-3deg);
}

.terminal-body {
  display: grid;
  gap: 0.55rem;
  padding: 1rem;
  font-size: 0.68rem;
}

.terminal-line {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.6rem;
  align-items: center;
  color: #cbb9aa;
  font-family: ui-monospace, "Cascadia Mono", monospace;
}

.terminal-line b {
  color: var(--sun);
  font-weight: 600;
}

.terminal-line span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.terminal-progress {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 248, 236, 0.18);
}

.terminal-progress i {
  display: block;
  width: 68%;
  height: 100%;
  border-radius: 999px;
  background: var(--cactus);
}

/* Subtítulo en directo: fotograma con su tercio inferior. */

.caption-scene {
  position: relative;
  z-index: 1;
  display: grid;
  width: min(78%, 480px);
  aspect-ratio: 16 / 10;
  padding: 1.1rem;
  border-radius: 10px;
  background: var(--earth);
  box-shadow: 0 28px 60px rgba(56, 40, 31, 0.25);
  transform: rotate(-2deg);
}

.caption-scene::before {
  width: 45%;
  height: 45%;
  border-radius: 50% 50% 0 0;
  background: var(--sun);
  opacity: 0.35;
  content: "";
}

.caption-bar {
  align-self: end;
  justify-self: center;
  display: grid;
  gap: 0.3rem;
  max-width: 90%;
  padding: 0.5rem 0.8rem;
  border-radius: 5px;
  background: rgba(255, 248, 236, 0.92);
}

.caption-bar i {
  height: 7px;
  border-radius: 999px;
  background: var(--earth);
}

.caption-bar i:last-child {
  width: 62%;
  background: var(--terracotta);
}

.caption-chip {
  position: absolute;
  top: 1rem;
  right: 1rem;
  padding: 0.25rem 0.55rem;
  color: var(--white);
  border-radius: 999px;
  background: var(--cactus);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

/* Cartas: mano de póker con fichas de apuesta. */

.cards-scene {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
}

.playing-card {
  display: grid;
  grid-template-columns: repeat(2, 9px);
  gap: 8px;
  width: 96px;
  height: 138px;
  padding: 0.7rem;
  border: 1px solid rgba(56, 40, 31, 0.3);
  border-radius: 8px;
  background: var(--stone);
  box-shadow: 0 22px 48px rgba(56, 40, 31, 0.22);
}

.playing-card:first-child {
  transform: rotate(-9deg);
}

.playing-card:last-child {
  transform: rotate(7deg) translateY(14px);
}

.playing-card i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--terracotta);
}

.poker-chip {
  width: 74px;
  height: 74px;
  border: 7px dashed var(--stone);
  border-radius: 50%;
  background: var(--earth);
  box-shadow: 0 18px 40px rgba(56, 40, 31, 0.26);
  transform: translateY(22px) rotate(12deg);
}

/* Documento: hoja con su objetivo de peso. */

.document-scene {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 0.5rem;
  width: min(58%, 250px);
  padding: 1.4rem;
  border: 1px solid rgba(56, 40, 31, 0.26);
  border-radius: 6px;
  background: var(--white);
  box-shadow: 0 26px 56px rgba(56, 40, 31, 0.2);
  transform: rotate(3deg);
}

.document-scene i {
  height: 8px;
  border-radius: 999px;
  background: var(--border);
}

.document-scene i:first-child {
  width: 55%;
  height: 14px;
  background: var(--terracotta);
}

.document-target {
  justify-self: start;
  margin-top: 0.5rem;
  padding: 0.35rem 0.7rem;
  color: var(--stone);
  border-radius: 999px;
  background: var(--cactus);
  font-size: 0.66rem;
  font-weight: 700;
}

/* Bloque de herramientas menores. */

.tools-block {
  margin-top: clamp(3.5rem, 7vw, 6rem);
  padding-top: 2.4rem;
  border-top: 1px solid var(--border);
}

.tools-heading {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1.6rem;
}

.tools-heading h3 {
  font-size: clamp(1.4rem, 2.2vw, 2rem);
}

.tools-heading p {
  max-width: 480px;
  color: var(--clay);
  font-size: 0.85rem;
}

.tools-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1px;
  border: 1px solid var(--border);
  background: var(--border);
  list-style: none;
  margin: 0;
  padding: 0;
}

.tools-list li {
  padding: 1.3rem;
  background: var(--stone);
}

.tools-list h4 {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  font-family: var(--display);
  font-size: 1rem;
}

.tools-list h4 small {
  color: var(--text-accent);
  font-family: var(--body);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.tools-list p {
  margin: 0.5rem 0 0.9rem;
  color: var(--clay);
  font-size: 0.82rem;
}

/* Caso de estudio ampliado. */

.case-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px;
  margin: 3rem 0;
  border: 1px solid rgba(255, 248, 236, 0.2);
  background: rgba(255, 248, 236, 0.2);
}

.case-metrics div {
  padding: 1.3rem;
  background: var(--earth);
}

.case-metrics b {
  display: block;
  color: var(--stone);
  font-family: var(--display);
  font-size: clamp(1.8rem, 3vw, 2.7rem);
  line-height: 1.1;
}

.case-metrics span {
  display: block;
  margin-top: 0.35rem;
  color: #cbb9aa;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.case-section {
  margin-top: clamp(4rem, 8vw, 7rem);
}

.case-section-head {
  display: grid;
  grid-template-columns: minmax(160px, 0.3fr) minmax(0, 1fr);
  gap: 2rem 4rem;
  align-items: start;
  margin-bottom: 2.4rem;
  border-top: 1px solid rgba(255, 248, 236, 0.25);
  padding-top: 1.6rem;
}

.case-section-head h2 {
  font-size: clamp(1.6rem, 2.7vw, 2.4rem);
}

.case-section-head p {
  max-width: 640px;
  color: #cbb9aa;
}

.case-body {
  max-width: 780px;
  color: #ddcebf;
  font-size: 1.02rem;
}

.case-body p + p {
  margin-top: 1.1rem;
}

.case-body strong {
  color: var(--stone);
}

.case-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.42fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
}

.case-stack {
  display: grid;
  gap: 1.4rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.case-stack li {
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 248, 236, 0.22);
}

.case-stack h3 {
  color: #e9b164;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.case-stack ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.7rem 0 0;
  list-style: none;
  padding: 0;
}

.case-stack ul li {
  padding: 0;
  border: 0;
}

.case-stack ul span {
  display: inline-block;
  margin: 0 0.3rem 0.3rem 0;
  padding: 0.3rem 0.6rem;
  color: #ddcebf;
  border: 1px solid rgba(255, 248, 236, 0.28);
  border-radius: 999px;
  font-size: 0.7rem;
}

.case-decision {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 1rem;
  padding: 1.5rem 0;
  border-top: 1px solid rgba(255, 248, 236, 0.25);
}

.case-decision > span {
  color: #e9b164;
  font-family: var(--display);
  font-size: 0.86rem;
}

.case-decision h3 {
  margin-bottom: 0.5rem;
  font-size: 1.12rem;
}

.case-decision p {
  max-width: 720px;
  color: #cbb9aa;
  font-size: 0.94rem;
}

.case-decision p em {
  color: #e9b164;
  font-style: normal;
}

.case-numbers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1px;
  border: 1px solid rgba(255, 248, 236, 0.2);
  background: rgba(255, 248, 236, 0.2);
  list-style: none;
  margin: 0;
  padding: 0;
}

.case-numbers li {
  padding: 1.2rem;
  background: var(--earth);
  color: #cbb9aa;
  font-size: 0.8rem;
}

.case-numbers b {
  display: block;
  margin-bottom: 0.3rem;
  color: var(--stone);
  font-family: var(--display);
  font-size: 1.5rem;
}

.case-note {
  margin-top: 2.4rem;
  padding: 1.4rem 1.6rem;
  border-left: 2px solid var(--sun);
  background: rgba(255, 248, 236, 0.07);
}

.case-note h3 {
  color: #e9b164;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.case-note p {
  max-width: 700px;
  margin: 0.5rem 0 0;
  color: #cbb9aa;
  font-size: 0.92rem;
}

.case-code {
  overflow-x: auto;
  margin: 1.6rem 0 0;
  padding: 1.2rem 1.4rem;
  border: 1px solid rgba(255, 248, 236, 0.2);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.28);
  color: #ddcebf;
  font-family: ui-monospace, "Cascadia Mono", monospace;
  font-size: 0.76rem;
  line-height: 1.8;
  white-space: pre;
}

.case-code b {
  color: #e9b164;
}

/* Código en línea dentro de los paneles oscuros del caso de estudio. */
.case-body code,
.case-note code,
.case-decision code {
  padding: 0.08rem 0.34rem;
  border: 1px solid rgba(255, 248, 236, 0.22);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.24);
  color: #e9b164;
  font-family: ui-monospace, "Cascadia Mono", monospace;
  font-size: 0.86em;
}

.case-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  margin-top: clamp(4rem, 8vw, 7rem);
  padding-top: 1.6rem;
  border-top: 1px solid rgba(255, 248, 236, 0.25);
  font-size: 0.82rem;
  font-weight: 700;
}

.case-nav a {
  color: var(--stone);
  transition: color 180ms ease;
}

.case-nav a:hover {
  color: #e9b164;
}

.case-nav small {
  display: block;
  margin-bottom: 0.25rem;
  color: #cbb9aa;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* Modo noche para las piezas nuevas. */

html[data-theme="dark"] .project-card:hover {
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.45);
}

html[data-theme="dark"] .visual-four {
  background: #262832;
}

html[data-theme="dark"] .visual-five {
  background: #1b2440;
}

html[data-theme="dark"] .visual-six {
  background: #0b0c10;
}

html[data-theme="dark"] .rack-scene,
html[data-theme="dark"] .pipeline-scene,
html[data-theme="dark"] .document-scene {
  border-color: #343746;
  box-shadow: 0 28px 62px rgba(0, 0, 0, 0.5);
}

html[data-theme="dark"] .rack-unit,
html[data-theme="dark"] .pipe-node {
  border-color: #343746;
  background: #121318;
}

html[data-theme="dark"] .rack-slots i {
  background: #343746;
}

html[data-theme="dark"] .rack-unit-accent {
  background: #f8fafc;
}

html[data-theme="dark"] .rack-unit-accent strong {
  color: #121318;
}

html[data-theme="dark"] .rack-bar {
  background: linear-gradient(90deg, #8b5cf6, #22d3ee);
}

html[data-theme="dark"] .pipe-node-key {
  color: #121318;
  border-color: #22d3ee;
  background: #22d3ee;
}

html[data-theme="dark"] .pipe-node-key i {
  background: #e600c7;
}

html[data-theme="dark"] .terminal-scene {
  background: #0b0c10;
  border-color: #343746;
}

html[data-theme="dark"] .caption-bar {
  background: rgba(248, 250, 252, 0.92);
}

html[data-theme="dark"] .caption-bar i {
  background: #121318;
}

html[data-theme="dark"] .caption-bar i:last-child {
  background: #8b5cf6;
}

html[data-theme="dark"] .playing-card {
  background: #1c1e26;
  border-color: #343746;
}

html[data-theme="dark"] .playing-card i {
  background: #8b5cf6;
}

html[data-theme="dark"] .poker-chip {
  border-color: #121318;
  background: #8b5cf6;
}

html[data-theme="dark"] .document-scene {
  background: #1c1e26;
}

html[data-theme="dark"] .document-scene i {
  background: #343746;
}

html[data-theme="dark"] .document-scene i:first-child {
  background: #22d3ee;
}

html[data-theme="dark"] .case-metrics,
html[data-theme="dark"] .case-numbers {
  border-color: #343746;
  background: #343746;
}

html[data-theme="dark"] .case-metrics div,
html[data-theme="dark"] .case-numbers li {
  background: #0b0c10;
}

@media (prefers-reduced-motion: reduce) {
  .rack-unit-led {
    animation: none;
  }

  .project-card:hover {
    transform: none;
  }
}

@media (max-width: 960px) {
  .case-split,
  .case-section-head {
    grid-template-columns: 1fr;
    gap: 1.6rem;
  }
}

@media (max-width: 720px) {
  .project-visual,
  .project-featured .project-visual {
    min-height: 250px;
    padding: 1.6rem;
  }

  .rack-scene,
  .pipeline-scene,
  .terminal-scene,
  .caption-scene,
  .document-scene {
    width: 100%;
    transform: none;
  }

  .cards-scene {
    gap: 0.4rem;
  }

  .playing-card {
    width: 74px;
    height: 108px;
  }

  .poker-chip {
    width: 54px;
    height: 54px;
    border-width: 5px;
  }

  .case-metrics b {
    font-size: 1.7rem;
  }
}
