/* ===========================================================
   ESENCIAL — Estudio de Arquitectura
   =========================================================== */

:root {
  --bg:        #ffffff;
  --bg-stone:  #f3f1ec;
  --ink:       #13110d;
  --ink-soft:  #3a362f;
  --ink-mute:  #746f64;
  --accent:    #d81e1e;   /* rojo Esencial */
  --accent-2:  #a8140f;
  --paper:     #fbfaf7;
  --line:      rgba(19, 17, 13, 0.16);
  --line-soft: rgba(19, 17, 13, 0.08);

  --font-display: "Big Shoulders Display", "Arial Narrow", sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", Menlo, monospace;
  --font-brand: "Baloo 2", "Inter", sans-serif;

  --nav-h: 84px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

/* ---------- Reset ---------- */
* { box-sizing: border-box; }
html, body, div, section, article, header, footer, nav, h1, h2, h3, h4, p, ul, li, figure, figcaption, form, input, textarea, button {
  margin: 0; padding: 0;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
ul { list-style: none; }
input, textarea { font: inherit; color: inherit; }

html {
  overflow-x: clip;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

.container {
  width: 100%;
  max-width: 1440px;
  margin-inline: auto;
  padding-inline: clamp(20px, 4vw, 64px);
}

/* ---------- Grid system (brutalist hairlines) ---------- */
.grid-12 {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.grid-12 > * { background: var(--bg); }
.g-span-3 { grid-column: span 3; }
.g-span-4 { grid-column: span 4; }
.g-span-5 { grid-column: span 5; }
.g-span-6 { grid-column: span 6; }
.g-span-7 { grid-column: span 7; }
.g-span-8 { grid-column: span 8; }
.g-span-9 { grid-column: span 9; }
.g-span-12 { grid-column: span 12; }

@media (max-width: 900px) {
  .g-span-3, .g-span-4, .g-span-5 { grid-column: span 6; }
  .g-span-7, .g-span-8, .g-span-9 { grid-column: span 12; }
}
@media (max-width: 620px) {
  .g-span-3, .g-span-4, .g-span-5, .g-span-6 { grid-column: span 12; }
}

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  line-height: 0.96;
  color: var(--ink);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-mute);
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
}
.eyebrow .dot {
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
  display: inline-block;
}

.num {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-mute);
  letter-spacing: 0.04em;
}

p.lede {
  font-size: clamp(1.05rem, 1.4vw, 1.3rem);
  color: var(--ink-soft);
  max-width: 38ch;
  line-height: 1.5;
}

a.text-link {
  position: relative;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
a.text-link::after {
  content: "";
  position: absolute;
  left: 0; bottom: -4px;
  width: 100%; height: 1px;
  background: currentColor;
  transform: scaleX(1);
  transform-origin: right;
  transition: transform 0.4s var(--ease-out);
}
a.text-link:hover::after { transform: scaleX(0); transform-origin: left; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 1em 1.6em;
  border: 1px solid var(--ink);
  transition: background 0.35s var(--ease-out), color 0.35s var(--ease-out), border-color 0.35s var(--ease-out);
  white-space: nowrap;
}
.btn-primary {
  background: var(--ink);
  color: var(--paper);
}
.btn-primary:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn-ghost {
  background: transparent;
  color: var(--ink);
}
.btn-ghost:hover {
  background: var(--ink);
  color: var(--paper);
}
.btn-accent {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn-accent:hover {
  background: var(--ink);
  border-color: var(--ink);
}

/* ---------- Nav ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-inline: clamp(20px, 4vw, 64px);
  background: rgba(255, 255, 255, 0.0);
  border-bottom: 1px solid transparent;
  transition: background 0.4s var(--ease-out), border-color 0.4s var(--ease-out);
}
.nav.is-scrolled {
  background: rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-brand {
  font-family: var(--font-brand);
  font-weight: 700;
  font-size: 1.6rem;
  text-transform: lowercase;
  letter-spacing: 0;
  color: var(--accent);
}
.footer-brand .nav-brand,
.section-dark .nav-brand {
  color: var(--paper);
}
.nav-links {
  display: flex;
  gap: clamp(20px, 3vw, 44px);
  align-items: center;
}
.nav-links a {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  position: relative;
  padding-bottom: 4px;
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 0; height: 1px;
  background: var(--accent);
  transition: width 0.35s var(--ease-out);
}
.nav-links a:hover::after,
.nav-links a.is-active::after { width: 100%; }
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  z-index: 101;
}
.nav-toggle span {
  width: 24px; height: 1px;
  background: var(--ink);
  transition: transform 0.3s var(--ease-out), opacity 0.3s var(--ease-out);
}

@media (max-width: 860px) {
  .nav-links {
    position: fixed;
    inset: 0;
    height: 100vh;
    width: 100%;
    background: var(--bg);
    flex-direction: column;
    justify-content: center;
    gap: 28px;
    transform: translateY(-100%);
    transition: transform 0.5s var(--ease-in-out);
    pointer-events: none;
  }
  .nav-links.is-open {
    transform: translateY(0);
    pointer-events: auto;
  }
  .nav-links a { font-size: 1.4rem; }
  .nav-toggle { display: flex; }
  .nav-toggle.is-open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .nav-toggle.is-open span:nth-child(2) { opacity: 0; }
  .nav-toggle.is-open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding-top: var(--nav-h);
  border-bottom: 1px solid var(--line);
}
.hero-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: clamp(16px, 2vw, 32px);
  padding-inline: clamp(20px, 4vw, 64px);
  padding-bottom: clamp(32px, 5vw, 64px);
  align-items: end;
}
.hero-title {
  grid-column: 1 / 10;
  font-size: clamp(3rem, 9vw, 8.5rem);
  text-wrap: balance;
}
.hero-title em {
  font-style: normal;
  color: var(--accent);
}
.hero-meta {
  grid-column: 10 / 13;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  justify-self: end;
  text-align: right;
}
@media (max-width: 900px) {
  .hero-title { grid-column: 1 / 13; }
  .hero-meta { grid-column: 1 / 13; justify-self: start; text-align: left; }
}
.hero-photo {
  position: relative;
  margin-top: clamp(28px, 4vw, 48px);
  aspect-ratio: 16 / 7.5;
  overflow: hidden;
  background: var(--bg-stone);
}
.hero-photo img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.08);
  transform: scale(1.01);
}
.hero-photo .hero-photo-tag {
  position: absolute;
  bottom: 1.2rem; left: 1.2rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  color: #fff;
  background: rgba(19, 17, 13, 0.65);
  padding: 0.5em 0.9em;
}

/* ---------- Section scaffolding ---------- */
.section {
  position: relative;
  padding-block: clamp(64px, 10vw, 140px);
  border-bottom: 1px solid var(--line);
}
.section-stone { background: var(--bg-stone); }
.section-dark { background: var(--ink); color: var(--paper); }
.section-dark .ink-mute-on-dark { color: rgba(251, 250, 247, 0.6); }

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 2rem;
  margin-bottom: clamp(36px, 5vw, 72px);
  flex-wrap: wrap;
}
.section-head h2 {
  font-size: clamp(2.2rem, 5vw, 4.2rem);
}

/* ---------- Reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}
.reveal[data-split] {
  opacity: 1;
  transform: none;
}

/* ---------- Manifesto / asymmetric ---------- */
.manifesto {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: clamp(20px, 3vw, 48px);
}
.manifesto .num-big {
  grid-column: 1 / 3;
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--accent);
}
.manifesto .manifesto-text {
  grid-column: 3 / 11;
}
.manifesto .manifesto-text p {
  font-size: clamp(1.3rem, 2.6vw, 2.1rem);
  font-weight: 400;
  line-height: 1.35;
  color: var(--ink-soft);
  text-wrap: pretty;
}
.manifesto .manifesto-text p strong {
  color: var(--ink);
  font-weight: 600;
}
@media (max-width: 900px) {
  .manifesto .num-big, .manifesto .manifesto-text { grid-column: 1 / 13; }
}

/* ---------- Works grid (project cards) ---------- */
.works-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.work-card {
  position: relative;
  grid-column: span 6;
  background: var(--bg);
  overflow: hidden;
  display: block;
}
.work-card.is-wide { grid-column: span 12; }
@media (max-width: 760px) { .work-card { grid-column: span 12; } }

.work-photo {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--bg-stone);
}
.work-card.is-wide .work-photo { aspect-ratio: 16 / 7; }
.work-photo img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.05);
  transition: transform 0.7s var(--ease-out), filter 0.7s var(--ease-out);
}
.work-card:hover .work-photo img {
  transform: scale(1.06);
  filter: grayscale(0) saturate(0.85) contrast(1.05);
}
.work-photo .work-overlay {
  position: absolute;
  inset: 0;
  background: var(--accent);
  mix-blend-mode: multiply;
  opacity: 0;
  transition: opacity 0.5s var(--ease-out);
}
.work-card:hover .work-overlay { opacity: 0.16; }

.work-info {
  padding: 1.4rem 1.6rem 1.8rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}
.work-info h3 {
  font-size: clamp(1.3rem, 2vw, 1.7rem);
  text-transform: none;
}
.work-meta {
  text-align: right;
  flex-shrink: 0;
}
.work-meta .num { display: block; }
.work-meta .work-cat {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.3em;
}

/* ---------- Marquee ---------- */
.marquee-strip {
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  padding-block: 1.1rem;
  background: var(--ink);
}
.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 32s linear infinite;
  will-change: transform;
}
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.marquee-track span {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--paper);
  padding-inline: 2rem;
  display: flex;
  align-items: center;
  gap: 2rem;
}
.marquee-track span::after { content: "—"; color: var(--accent); }

/* ---------- Stats ---------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: rgba(251, 250, 247, 0.18);
  border: 1px solid rgba(251, 250, 247, 0.18);
}
.stat-card {
  background: var(--ink);
  padding: clamp(24px, 3vw, 40px) clamp(16px, 2vw, 28px);
}
.stat-num {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5vw, 4rem);
  color: var(--paper);
  display: flex;
  align-items: baseline;
  gap: 0.1em;
}
.stat-num .suffix { font-size: 0.5em; color: var(--accent); }
.stat-label {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: rgba(251, 250, 247, 0.6);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.6rem;
}
@media (max-width: 760px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Two-col feature (about teaser, studio sections) ---------- */
.split {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: clamp(24px, 3vw, 56px);
  align-items: center;
}
.split-media { grid-column: span 6; }
.split-text { grid-column: span 6; }
.split.reverse .split-media { order: 2; }
@media (max-width: 860px) {
  .split-media, .split-text { grid-column: span 12; }
  .split.reverse .split-media { order: 0; }
}
.split-media .frame {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--bg-stone);
}
.split-media .frame.is-wide { aspect-ratio: 16 / 11; }
.split-media img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.05);
}
.split-text h2 { font-size: clamp(2rem, 4vw, 3.4rem); margin-block: 0.6em 0.9em; }
.split-text p { color: var(--ink-soft); max-width: 46ch; margin-bottom: 1rem; }
.split-text .pillars {
  margin-top: 1.6rem;
  display: grid;
  gap: 1.2rem;
}
.pillar { border-top: 1px solid var(--line); padding-top: 1rem; }
.pillar .num { color: var(--accent); }
.pillar h4 { font-size: 1.05rem; text-transform: none; margin-top: 0.3em; font-family: var(--font-body); font-weight: 600; }
.pillar p { font-size: 0.92rem; color: var(--ink-mute); margin-top: 0.3em; }

/* ---------- Process / numbered list ---------- */
.process-list { display: grid; gap: 0; }
.process-item {
  display: grid;
  grid-template-columns: 80px 1fr 1fr;
  gap: 2rem;
  padding-block: clamp(20px, 3vw, 36px);
  border-top: 1px solid var(--line);
  align-items: baseline;
}
.process-item:last-child { border-bottom: 1px solid var(--line); }
.process-item .num { font-size: 1rem; color: var(--accent); }
.process-item h3 { font-size: clamp(1.3rem, 2.4vw, 1.9rem); text-transform: none; }
.process-item p { color: var(--ink-mute); font-size: 0.95rem; }
@media (max-width: 760px) {
  .process-item { grid-template-columns: 1fr; gap: 0.6rem; }
}

/* ---------- Testimonial / quote ---------- */
.quote-block {
  max-width: 56ch;
}
.quote-block blockquote {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3.4vw, 2.6rem);
  line-height: 1.25;
  text-transform: none;
  font-weight: 500;
}
.quote-block cite {
  display: block;
  margin-top: 1.4rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--ink-mute);
  font-style: normal;
}

/* ---------- CTA ---------- */
.cta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}
.cta h2 { font-size: clamp(2.4rem, 6vw, 5rem); max-width: 14ch; }

/* ---------- Forms ---------- */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.4rem;
}
.form-grid .field-full { grid-column: span 2; }
@media (max-width: 620px) {
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .field-full { grid-column: span 1; }
}
.field label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-mute);
  margin-bottom: 0.5em;
}
.field input, .field textarea {
  width: 100%;
  border: none;
  border-bottom: 1px solid var(--line);
  background: transparent;
  padding: 0.7em 0.1em;
  font-size: 1rem;
  transition: border-color 0.3s var(--ease-out);
}
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.field textarea { resize: vertical; min-height: 110px; }
.form-foot {
  margin-top: 2rem;
  display: flex;
  align-items: center;
  gap: 1.4rem;
  flex-wrap: wrap;
}
.form-status {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--ink-mute);
}
.form-status.is-success { color: var(--accent); }

/* ---------- Footer ---------- */
.footer {
  padding-block: clamp(48px, 6vw, 80px) clamp(24px, 3vw, 40px);
  background: var(--ink);
  color: var(--paper);
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 2rem;
  padding-bottom: clamp(32px, 5vw, 56px);
}
.footer-brand { grid-column: span 4; }
.footer-brand .nav-brand { color: var(--paper); }
.footer-brand p { color: rgba(251, 250, 247, 0.6); margin-top: 1rem; max-width: 30ch; }
.footer-col { grid-column: span 2; }
.footer-col h4 {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(251, 250, 247, 0.5);
  margin-bottom: 1rem;
  font-weight: 400;
}
.footer-col a, .footer-col p {
  display: block;
  color: rgba(251, 250, 247, 0.85);
  margin-bottom: 0.6rem;
  font-size: 0.92rem;
}
.footer-col a:hover { color: var(--accent); }
@media (max-width: 860px) {
  .footer-brand { grid-column: span 12; }
  .footer-col { grid-column: span 4; }
}
@media (max-width: 540px) {
  .footer-col { grid-column: span 6; }
}
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  padding-top: 1.6rem;
  border-top: 1px solid rgba(251, 250, 247, 0.16);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: rgba(251, 250, 247, 0.5);
}

/* ---------- Page hero (sub-pages) ---------- */
.page-hero {
  padding-top: calc(var(--nav-h) + clamp(40px, 6vw, 80px));
  padding-bottom: clamp(40px, 6vw, 72px);
  border-bottom: 1px solid var(--line);
}
.page-hero h1 {
  font-size: clamp(2.8rem, 7vw, 6rem);
  margin-top: 0.6em;
  max-width: 16ch;
}

/* ---------- Filters (obras page) ---------- */
.filters {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: clamp(28px, 4vw, 48px);
}
.filter-btn {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.6em 1.1em;
  border: 1px solid var(--line);
  transition: background 0.3s var(--ease-out), color 0.3s var(--ease-out), border-color 0.3s var(--ease-out);
}
.filter-btn:hover, .filter-btn.is-active {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

/* ---------- Misc utilities ---------- */
.mt-0 { margin-top: 0 !important; }
.text-center { text-align: center; }
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

/* ---------- Cursor coordinates (subtle brutalist touch) ---------- */
.coord-tag {
  position: fixed;
  z-index: 90;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--ink-mute);
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 0.2em 0.5em;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s var(--ease-out);
  transform: translate(-50%, 16px);
}
.coord-tag.is-visible { opacity: 1; }
@media (hover: none) { .coord-tag { display: none; } }

/* ---------- Splash (kept minimal, light) ---------- */
.splash {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: splashSafety 0.01s 2.6s forwards;
}
.splash-mark {
  font-family: var(--font-brand);
  font-weight: 700;
  font-size: clamp(2rem, 6vw, 4rem);
  text-transform: lowercase;
  color: var(--accent);
}
.splash.is-out {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s var(--ease-out);
}
@keyframes splashSafety {
  to { opacity: 0; pointer-events: none; }
}
