/* ===== Tokens ===== */
:root {
  --bg: #0b0b0c;
  --surface: #131315;
  --text: #f2f1ed;
  --text-muted: #8f8d89;
  --line: #232325;
  --accent: #c9a868;
  --font-head: 'Manrope', sans-serif;
  --font-body: 'Inter', sans-serif;
  --col-width: 640px;
  --edge: clamp(24px, 6vw, 96px);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-head);
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}

h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); }
h3 { font-size: 1.05rem; font-weight: 600; }

p { margin: 0 0 1em; color: var(--text); max-width: 62ch; }

a { color: inherit; }

button { font-family: var(--font-body); cursor: pointer; }

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

/* ===== Language modal ===== */
.lang-modal {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 1;
  transition: opacity 0.5s var(--ease);
}
.lang-modal[hidden] { display: none; }
.lang-modal.is-closing { opacity: 0; pointer-events: none; }

.lang-modal__card {
  max-width: 420px;
  padding: var(--edge);
  text-align: left;
  color: var(--text);
}
.lang-modal__mark {
  width: clamp(72px, 20vw, 96px);
  height: auto;
  margin-bottom: 20px;
  display: block;
  filter: invert(1);
}
.lang-modal__title {
  font-size: 1.6rem;
  margin-bottom: 0.6em;
}
.lang-modal__desc {
  color: var(--text-muted);
  font-size: 0.98rem;
}
.lang-modal__question {
  font-size: 0.98rem;
  margin-bottom: 1.2em;
}
.lang-modal__actions {
  display: flex;
  gap: 12px;
}
.lang-btn {
  flex: 1;
  padding: 12px 18px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 4px;
  font-size: 0.95rem;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.lang-btn:hover, .lang-btn:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
  outline: none;
}

/* ===== Header ===== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px var(--edge);
  z-index: 40;
  mix-blend-mode: normal;
}
.brand__mark {
  width: clamp(48px, 12vw, 60px);
  height: auto;
  display: block;
  filter: invert(1);
}
.header-controls {
  display: flex;
  align-items: center;
  gap: 18px;
}
.lang-toggle {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  display: flex;
  gap: 4px;
}
.lang-toggle__sep { color: var(--line); }
.lang-toggle[data-active="es"] span[data-lang-option="es"],
.lang-toggle[data-active="en"] span[data-lang-option="en"] {
  color: var(--text);
}

.menu-btn {
  width: 28px;
  height: 18px;
  position: relative;
  background: none;
  border: none;
  padding: 0;
}
.menu-btn span {
  position: absolute;
  left: 0;
  right: 0;
  height: 1.5px;
  background: var(--text);
  transition: transform 0.35s var(--ease), opacity 0.35s var(--ease), top 0.35s var(--ease);
}
.menu-btn span:nth-child(1) { top: 0; }
.menu-btn span:nth-child(2) { top: 8px; }
.menu-btn span:nth-child(3) { top: 16px; }
.menu-btn[aria-expanded="true"] span:nth-child(1) { top: 8px; transform: rotate(45deg); }
.menu-btn[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-btn[aria-expanded="true"] span:nth-child(3) { top: 8px; transform: rotate(-45deg); }

/* ===== Fullscreen nav ===== */
.nav-menu {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 30;
  display: flex;
  align-items: center;
  padding: var(--edge);
  transform: translateY(-100%);
  transition: transform 0.5s var(--ease);
}
.nav-menu.is-open { transform: translateY(0); }
.nav-menu__list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-menu__list li { margin-bottom: 0.3em; }
.nav-link {
  text-decoration: none;
  font-family: var(--font-head);
  font-size: clamp(2rem, 6vw, 3rem);
  font-weight: 700;
  color: var(--text-muted);
  transition: color 0.25s var(--ease);
}
.nav-link:hover, .nav-link:focus-visible { color: var(--text); outline: none; }

/* ===== Sections / layout ===== */
.section {
  max-width: var(--col-width);
  margin: 0 auto;
  padding: 96px var(--edge);
  border-top: 1px solid var(--line);
}
.section:first-of-type { border-top: none; }
.section-intro { color: var(--text-muted); }

.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-top: none;
  max-width: none;
  padding-left: var(--edge);
  padding-right: var(--edge);
}
.hero__mark {
  width: clamp(130px, 32vw, 220px);
  height: auto;
  margin-bottom: 28px;
  display: block;
  opacity: 0;
  transform: translateY(10px) scale(0.96);
  animation: rise 0.9s var(--ease) forwards 0.3s;
  filter: invert(1);
}

.hero__title {
  font-size: clamp(2.6rem, 7vw, 4.4rem);
  max-width: 620px;
  opacity: 0;
  transform: translateY(14px);
  animation: rise 0.9s var(--ease) forwards 0.9s;
}
.hero__bio {
  max-width: 46ch;
  color: var(--text-muted);
  font-size: 1.05rem;
  opacity: 0;
  transform: translateY(14px);
  animation: rise 0.9s var(--ease) forwards 1.15s;
}
@keyframes rise { to { opacity: 1; transform: translateY(0); } }

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  max-width: 860px;
}
@media (max-width: 640px) {
  .split { grid-template-columns: 1fr; gap: 40px; }
}

/* ===== Team ===== */
.team-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 32px;
}
.team-list__item {
  display: flex;
  gap: 18px;
  align-items: flex-start;
}
.team-list__avatar {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-head);
  font-size: 0.82rem;
  color: var(--text-muted);
  overflow: hidden;
}
.team-list__avatar--img { padding: 8px; }
.team-list__avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.team-list__item h3 { margin-bottom: 0.2em; }
.team-list__item h3 span { color: var(--text-muted); font-weight: 400; font-size: 0.85em; }
.team-list__item p { color: var(--text-muted); margin: 0; }

/* ===== Projects ===== */
.project-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  margin-top: 32px;
}
@media (max-width: 640px) {
  .project-grid { grid-template-columns: 1fr; }
}
.project-card {
  border: 1px solid var(--line);
  padding: 28px;
  border-radius: 4px;
}
.project-card__logo {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-head);
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  overflow: hidden;
}
.project-card__logo--img { padding: 0; }
.project-card__logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.project-card__logo--img img { object-fit: cover; transform: scale(1.7); }
.project-card p { color: var(--text-muted); font-size: 0.95rem; }

.btn-text {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 0.92rem;
  padding: 0;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s var(--ease);
}
.btn-text:hover, .btn-text:focus-visible { border-color: var(--accent); outline: none; }

/* ===== Contact form ===== */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 28px;
}
.contact-form label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 14px;
}
.contact-form input,
.contact-form textarea {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 4px;
  padding: 12px 14px;
  font-family: var(--font-body);
  font-size: 1rem;
  resize: vertical;
}
.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.btn-primary {
  align-self: flex-start;
  margin-top: 22px;
  background: var(--accent);
  color: #14120c;
  border: none;
  padding: 12px 26px;
  border-radius: 4px;
  font-size: 0.95rem;
  font-weight: 600;
  transition: opacity 0.2s var(--ease);
}
.btn-primary:hover, .btn-primary:focus-visible { opacity: 0.85; outline: none; }

/* ===== Project detail overlay ===== */
.project-detail {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 50;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.45s var(--ease);
}
.project-detail.is-open { transform: translateX(0); }
.project-detail__inner {
  max-width: var(--col-width);
  margin: 0 auto;
  padding: 120px var(--edge) 96px;
}
.project-detail__back {
  margin-bottom: 40px;
  display: inline-block;
}
.project-detail__logo {
  width: 48px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-head);
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 20px;
  overflow: hidden;
}
.project-detail__logo--img { padding: 0; }
.project-detail__logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.project-detail__logo--img img { object-fit: cover; transform: scale(1.7); }
.project-detail__desc { color: var(--text-muted); }
.project-detail__steps {
  padding-left: 1.2em;
  color: var(--text-muted);
}
.project-detail__steps li { margin-bottom: 0.5em; }

/* ===== Footer ===== */
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding: 40px var(--edge) 56px;
  border-top: 1px solid var(--line);
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.95rem;
}
.footer-brand__mark { width: clamp(32px, 8vw, 40px); height: auto; display: block; filter: invert(1); }
.footer-links {
  display: flex;
  gap: 20px;
  font-size: 0.88rem;
  color: var(--text-muted);
}
.footer-links a { text-decoration: none; }
.footer-links a:hover { color: var(--text); }

/* Utility */
[hidden] { display: none !important; }
