:root,
[data-theme="light"] {
  --bg: #f6f3ee;
  --bg-alt: #efeae2;
  --card: #fffdf9;
  --ink: #1c2340;
  --muted: #5d6478;
  --line: rgba(28, 35, 64, 0.14);
  --header: #1b2454;
  --header-ink: #f4f7fb;
  --shadow: none;
  --soft: #e7e1d6;
  --danger: #9f2d2d;
  --footer: transparent;
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #10141f;
  --bg-alt: #171c2b;
  --card: #1a2030;
  --ink: #f3f5fb;
  --muted: #b7c0d4;
  --line: rgba(255, 255, 255, 0.12);
  --header: #0c1020;
  --header-ink: #f4f7fb;
  --shadow: none;
  --soft: #242b3e;
  --danger: #ffb4b4;
  --footer: transparent;
  color-scheme: dark;
}

:root {
  --navy: #2d3269;
  --blue: #2e4d8d;
  --accent: #5894ce;
  --white: #ffffff;
  --font: "Be Vietnam Pro", "Segoe UI", sans-serif;
  --rail: 248px;
  --rail-narrow: 76px;
  --bar: 68px;
  --radius: 0px;
  color: var(--ink);
  background: var(--bg);
  font-family: var(--font);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--bg);
}

html.rail-collapsed {
  --rail: var(--rail-narrow);
}

body {
  margin: 0 0 0 var(--rail);
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
  transition: margin-left 0.25s ease;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
}

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

button,
input,
textarea {
  font: inherit;
}

::selection {
  background: rgba(88, 148, 206, 0.35);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.skip-link {
  position: fixed;
  left: calc(var(--rail) + 1rem);
  top: 1rem;
  z-index: 50;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  background: var(--white);
  color: var(--navy);
}

.skip-link:focus {
  width: auto;
  height: auto;
  margin: 0;
  padding: 0.6rem 0.9rem;
  overflow: visible;
  clip: auto;
}

.container {
  width: min(1080px, calc(100% - 4rem));
  margin: 0 auto;
}

.container.narrow {
  width: min(760px, calc(100% - 4rem));
}

.page {
  animation: page-in 0.45s ease;
}

.site-header {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  width: var(--rail);
  display: flex;
  flex-direction: column;
  background: var(--header);
  color: var(--header-ink);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  transition: width 0.25s ease;
}

.header-bar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1.5rem;
  flex: 1;
  width: 100%;
  margin: 0;
  padding: 1.6rem 1.25rem 1.3rem;
}

.brand {
  display: flex;
  order: 1;
  min-width: 0;
}

.brand img {
  height: 34px;
  width: auto;
}

.site-header .mark-light {
  display: none;
}

.site-header .mark-dark {
  display: block;
}

.header-tools {
  display: flex;
  align-items: center;
  order: 3;
  gap: 0.55rem;
  margin-top: auto;
}

.main-nav {
  display: flex;
  flex-direction: column;
  order: 2;
  align-items: stretch;
  gap: 1.4rem;
}

.main-nav ul {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.main-nav a:not(.btn) {
  display: block;
  padding: 0.7rem 0.75rem;
  color: rgba(255, 255, 255, 0.78);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.98rem;
  border-left: 2px solid transparent;
}

.main-nav a:not(.btn):hover,
.main-nav a.active {
  color: var(--white);
  background: rgba(255, 255, 255, 0.06);
  border-left-color: var(--accent);
}

.theme-toggle,
.menu-toggle {
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: transparent;
  color: var(--header-ink);
  cursor: pointer;
}

.theme-toggle {
  display: grid;
  place-items: center;
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-toggle .icon-sun {
  display: none;
}

[data-theme="dark"] .theme-toggle .icon-moon {
  display: none;
}

[data-theme="dark"] .theme-toggle .icon-sun {
  display: block;
}

.menu-toggle {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0;
}

.menu-toggle span:not(.sr-only) {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.menu-toggle.is-open span:nth-child(2) {
  transform: translateY(7px) rotate(45deg);
}

.menu-toggle.is-open span:nth-child(3) {
  opacity: 0;
}

.menu-toggle.is-open span:nth-child(4) {
  transform: translateY(-7px) rotate(-45deg);
}

.site-header .header-cta {
  margin-top: 0.4rem;
  background: transparent;
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: none;
}

.header-cta:hover {
  background: rgba(255, 255, 255, 0.08);
}

.rail-toggle {
  display: grid;
  place-items: center;
  order: 0;
  align-self: flex-end;
  width: 36px;
  height: 36px;
  margin-bottom: -0.4rem;
  border: 0;
  background: transparent;
  color: var(--header-ink);
  cursor: pointer;
}

.rail-toggle svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

html.rail-collapsed .header-bar {
  align-items: center;
  padding-inline: 0.55rem;
}

html.rail-collapsed .rail-toggle {
  align-self: center;
}

html.rail-collapsed .rail-toggle svg {
  transform: rotate(180deg);
}

html.rail-collapsed .brand {
  overflow: hidden;
}

html.rail-collapsed .brand {
  width: 42px;
  height: 42px;
}

html.rail-collapsed .brand img {
  width: 353px;
  max-width: none;
  height: 78px;
  margin: -17px 0 0 -29px;
  object-fit: fill;
}

html.rail-collapsed .main-nav,
html.rail-collapsed .main-nav ul,
html.rail-collapsed .header-tools {
  align-items: center;
}

html.rail-collapsed .header-tools {
  flex-direction: column;
}

html.rail-collapsed .main-nav a:not(.btn) {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-inline: auto;
  padding: 0;
  border-left-color: transparent;
}

html.rail-collapsed .main-nav a:not(.btn)::before {
  content: attr(data-short);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

html.rail-collapsed .main-nav a.active {
  border-left-color: transparent;
  box-shadow: inset 0 -2px 0 var(--accent);
}

html.rail-collapsed .nav-label,
html.rail-collapsed .header-cta span {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

html.rail-collapsed .header-cta {
  width: 44px;
  min-height: 44px;
  margin-inline: auto;
  padding: 0;
}

html.rail-collapsed .header-cta::before {
  content: "→";
  font-size: 1.05rem;
}

.hero {
  color: var(--ink);
  background: transparent;
  padding: 3.2rem 0 1rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  align-items: stretch;
  gap: 2.5rem;
  min-height: 0;
  padding: 0;
}

.hero h1 {
  margin: 0 0 1.5rem;
  max-width: 14em;
  color: var(--ink);
  font-size: clamp(2.1rem, 3.6vw, 3.4rem);
  line-height: 1.12;
  letter-spacing: -0.04em;
  font-weight: 600;
}

.hero-copy > * {
  animation: rise 0.7s ease both;
}

.hero-copy > *:nth-child(2) {
  animation-delay: 0.08s;
}

.hero-copy > *:nth-child(3) {
  animation-delay: 0.16s;
}

.hero-stage {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 340px;
  padding: 1.5rem;
  background: #1b2454;
  color: var(--white);
}

.hero-stage p {
  margin: 0.8rem 0 0;
  text-align: left;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
}

.hero-art {
  width: min(210px, 70%);
  margin: 0 0 0.4rem;
  animation: float 7s ease-in-out infinite;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.7rem;
  margin: 1.6rem 0 0;
  font-size: 0.92rem;
}

.hero-meta a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

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

.eyebrow {
  margin-bottom: 0.55rem;
  color: var(--blue);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

[data-theme="dark"] .eyebrow {
  color: var(--accent);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0.7rem 1.15rem;
  border: 1px solid transparent;
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.btn-primary {
  background: var(--navy);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--blue);
}

[data-theme="dark"] .btn-primary {
  background: var(--accent);
  color: #0c1020;
}

[data-theme="dark"] .btn-primary:hover {
  background: #8ebbe0;
}

[data-theme="dark"] .site-header .header-cta,
.site-header .header-cta {
  background: transparent;
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.35);
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink);
}

.btn-ghost:hover {
  background: var(--ink);
  color: var(--bg);
}

.stats {
  padding: 0.5rem 0 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.stats-grid div {
  padding: 1.4rem 0;
}

.stats-grid div + div {
  padding-left: 1.4rem;
  border-left: 1px solid var(--line);
}

.stats strong {
  display: block;
  color: var(--navy);
  font-size: 2.1rem;
  letter-spacing: -0.04em;
}

[data-theme="dark"] .stats strong {
  color: var(--accent);
}

.stats span {
  color: var(--muted);
}

.section {
  padding: 4.2rem 0;
}

.section-alt {
  background: var(--bg-alt);
}

.section-heading {
  max-width: 36rem;
  margin-bottom: 1.6rem;
}

.section-heading h1,
.section-heading h2,
.page-intro h1,
.detail h1,
.cta-inner h2 {
  margin-bottom: 0.55rem;
  font-size: clamp(2rem, 4vw, 3.1rem);
  line-height: 1.08;
  letter-spacing: -0.04em;
  font-weight: 600;
}

.section-heading p,
.page-intro p,
.lead,
.surface-card p {
  color: var(--muted);
  line-height: 1.7;
}

.split-heading {
  max-width: none;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1.5rem;
}

.card-grid {
  display: grid;
  grid-template-columns: 1fr;
}

.surface-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.3rem 1.1rem;
  align-items: start;
  padding: 1.35rem 0;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
}

.surface-card .icon-badge {
  grid-row: 1 / span 2;
}

.surface-card h3 {
  margin: 0.15rem 0 0;
  font-size: 1.2rem;
  letter-spacing: -0.03em;
}

.icon-badge {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  background: var(--navy);
}

.icon-badge img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.text-link {
  color: var(--blue);
  font-weight: 600;
  text-decoration: none;
}

[data-theme="dark"] .text-link {
  color: var(--accent);
}

.page-intro {
  padding: 3.2rem 0 0.4rem;
  border-bottom: 0;
}

.intro-split,
.about-intro {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  align-items: start;
}

.page-intro p {
  max-width: 40rem;
  font-size: 1.05rem;
}

.about-mark {
  width: 92px;
  margin: 0 0 0.4rem;
}

.mark-dark {
  display: none;
}

[data-theme="dark"] .mark-light {
  display: none;
}

[data-theme="dark"] .mark-dark {
  display: block;
}

.client-wall {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.2rem;
  align-items: center;
}

.client-logo {
  display: grid;
  place-items: center;
  min-height: 0;
  padding: 0;
  background: transparent;
  border: 0;
}

.client-logo img {
  max-height: 42px;
  width: auto;
  object-fit: contain;
  padding: 0.2rem 0.35rem;
  background: #fff;
}

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

.project-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.directory-row,
.project-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
  min-height: 210px;
  padding: 1.2rem;
  background: var(--card);
  border: 1px solid var(--line);
  text-decoration: none;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.directory-row:hover,
.project-row:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
}

.directory-index {
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.directory-copy,
.project-row > span:nth-child(2) {
  display: grid;
  gap: 0.3rem;
}

.directory-copy strong,
.project-row strong {
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.directory-copy span,
.project-row small {
  color: var(--muted);
  line-height: 1.5;
}

.directory-go {
  margin-top: auto;
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

[data-theme="dark"] .directory-go {
  color: var(--accent);
}

.project-row img {
  max-height: 48px;
  width: auto;
  max-width: 140px;
  object-fit: contain;
  padding: 0.35rem 0.45rem;
  background: #fff;
}

.form-intro h3 {
  margin: 0 0 0.25rem;
  font-size: 1.25rem;
}

.form-intro p,
.contact-form .field-error + p {
  margin-bottom: 0.3rem;
  color: var(--muted);
}

.contact-card a {
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}

.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 1.5rem;
  align-items: stretch;
}

.contact-layout iframe {
  width: 100%;
  min-height: 100%;
  height: 100%;
  border: 1px solid var(--line);
  background: var(--soft);
}

.contact-form {
  display: grid;
  gap: 0.85rem;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

.contact-form label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.88rem;
  font-weight: 600;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  padding: 0.7rem 0;
}

.contact-form input:focus,
.contact-form textarea:focus,
.btn:focus-visible,
.theme-toggle:focus-visible,
.rail-toggle:focus-visible,
.menu-toggle:focus-visible,
.main-nav a:focus-visible,
.directory-row:focus-visible,
.project-row:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.field-error,
.form-note {
  font-size: 0.84rem;
  font-weight: 500;
}

.field-error {
  color: var(--danger);
}

.field-error:empty {
  display: none;
}

.form-note {
  margin: 0;
  color: var(--muted);
}

.contact-form .btn {
  width: auto;
  justify-self: start;
  margin-top: 0.4rem;
}

.detail {
  padding-top: 3.2rem;
}

.detail-layout {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 2.5rem;
  align-items: start;
}

.detail-title {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 1rem;
}

.detail-title h1 {
  margin: 0;
}

.detail-image {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--card);
  padding: 0.6rem;
}

.detail-aside {
  padding: 1.4rem;
  background: var(--bg-alt);
  border-left: 3px solid var(--navy);
}

.detail-aside a {
  font-weight: 700;
  color: var(--blue);
  text-decoration: none;
}

.principle-card {
  display: block;
  padding: 1.6rem 0;
}

.principle-head {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 0.6rem;
}

.principle-card h2 {
  margin: 0;
  letter-spacing: 0.12em;
  font-size: 0.95rem;
}

.principle-card ul {
  margin: 0.4rem 0 0;
  padding-left: 1.1rem;
  color: var(--muted);
  line-height: 1.7;
}

.cta-band {
  padding: 0 0 4rem;
}

.cta-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1.5rem;
  padding: 2rem 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  color: var(--ink);
  background: transparent;
}

.cta-inner .eyebrow {
  color: var(--blue);
}

.cta-inner p {
  margin-bottom: 0;
  color: var(--muted);
}

.cta-inner .btn-primary {
  flex: none;
}

.site-footer {
  background: transparent;
  color: var(--muted);
  padding: 1.5rem 0 1.2rem;
  border-top: 1px solid var(--line);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.8fr 1fr;
  gap: 1.5rem;
  align-items: start;
}

.footer-logo {
  height: 30px;
  width: auto;
  margin-bottom: 0.7rem;
}

.site-footer h2 {
  margin-bottom: 0.55rem;
  color: var(--ink);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-footer li {
  margin: 0.3rem 0;
}

.site-footer a {
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--ink);
}

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

.footer-bottom p {
  margin: 0;
  font-size: 0.85rem;
}

html.js .reveal:not(.is-visible) {
  opacity: 0;
  transform: translateY(18px);
}

html.js .reveal {
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

@keyframes page-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

#contactos {
  scroll-margin-top: 1.5rem;
}

@media (max-width: 980px) {
  body {
    margin-left: 0;
  }

  .site-header {
    position: sticky;
    top: 0;
    width: auto;
    height: auto;
    inset: auto;
    flex-direction: row;
  }

  .header-bar {
    flex-direction: row;
    align-items: center;
    gap: 0.8rem;
    width: min(1080px, calc(100% - 1.6rem));
    min-height: var(--bar);
    margin: 0 auto;
    padding: 0;
  }

  .header-tools {
    margin-top: 0;
    margin-left: auto;
  }

  .menu-toggle {
    display: flex;
  }

  .rail-toggle {
    display: none;
  }

  .skip-link:focus {
    left: 1rem;
    top: calc(var(--bar) + 0.5rem);
  }

  .main-nav {
    display: none;
    position: fixed;
    inset: var(--bar) 0 0 0;
    z-index: 25;
    padding: 1.2rem 1.2rem 2rem;
    background: var(--header);
    overflow: auto;
  }

  .main-nav.open {
    display: flex;
  }

  .container,
  .container.narrow {
    width: min(1080px, calc(100% - 1.6rem));
  }

  .hero {
    padding-top: 1.6rem;
  }

  .hero-grid,
  .stats-grid,
  .directory,
  .project-list,
  .contact-layout,
  .detail-layout,
  .form-grid,
  .footer-grid,
  .cta-inner,
  .split-heading {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

  .stats-grid div + div {
    padding-left: 0;
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .hero h1 {
    max-width: none;
    font-size: 1.85rem;
  }

  .hero-stage {
    min-height: 240px;
  }

  .surface-card {
    grid-template-columns: auto 1fr;
  }

  .project-list {
    grid-template-columns: 1fr;
  }

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

  #contactos {
    scroll-margin-top: calc(var(--bar) + 0.8rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}

.brand-logo {
  max-height: 48px;
  width: auto;
  margin-bottom: 0.8rem;
}

.brand-tag {
  color: var(--blue);
  font-weight: 700;
}

[data-theme="dark"] .brand-tag {
  color: var(--accent);
}
