:root {
  --dg-1: #C2410C;
  --dg-5: #1C1917;
  --arch-blue: #3B668C;
  --inst-amber: #D97706;
  --stone-bg: #F5F5F4;
  --bg: #fafafa;
  --surface: #ffffff;
  --text: #1C1917;
  --muted: rgba(28, 25, 23, 0.7);
  --border: rgba(28, 25, 23, 0.12);
  --nav-bg: rgba(255, 255, 255, 0.95);
  --footer-bg: #0F0D0C;
  --about-bg: #1C1917;
  --about-text: rgba(255, 255, 255, 0.8);
}

html[data-theme="dark"] {
  --bg: #1C1917;
  --surface: #292524;
  --text: #f5f5f4;
  --muted: rgba(245, 245, 244, 0.72);
  --border: rgba(245, 245, 244, 0.14);
  --stone-bg: #221f1d;
  --nav-bg: rgba(28, 25, 23, 0.94);
  --footer-bg: #0a0908;
  --about-bg: #151312;
  --about-text: rgba(245, 245, 244, 0.82);
}

html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  margin: 0;
}
img, video { max-width: 100%; }
img.obra-foto { filter: none !important; }

.theme-toggle {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.45rem 0.7rem;
  cursor: pointer;
}
.theme-toggle:focus-visible,
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--dg-1);
  outline-offset: 2px;
}

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

.title-fluid {
  font-size: clamp(1.7rem, 4.2vw, 3.2rem);
  line-height: 1.05;
}
.hero-title-btn { transition: opacity 0.3s ease, color 0.3s ease, transform 0.2s ease; }
@media (hover: hover) {
  .hero-title-btn:hover { opacity: 0.8; transform: translateX(4px); }
}
.hero-title-btn.active-civil { color: var(--arch-blue); }
.hero-title-btn.active-instalaciones { color: var(--inst-amber); }
.hero-title-btn.active-deuda {
  background: repeating-linear-gradient(-45deg, #C2410C, #C2410C 12px, #1C1917 12px, #1C1917 24px);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.input-brutal {
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  border: 2px solid var(--border);
  border-radius: 0;
  padding: 24px 16px 8px;
  color: var(--text);
  font-weight: 600;
  width: 100%;
  box-sizing: border-box;
}
.input-brutal:focus { outline: none; border-color: var(--dg-1); }
.btn-brutal {
  background: var(--dg-5);
  color: var(--bg);
  border: 2px solid var(--dg-5);
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
}
html[data-theme="dark"] .btn-brutal { color: #1C1917; background: #f5f5f4; }

.home-works {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}
@media (min-width: 768px) {
  .home-works { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 1100px) {
  .home-works { grid-template-columns: 1fr 1fr 1fr; }
}
.home-work {
  display: block;
  color: inherit;
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--border);
}
.home-work img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  display: block;
}
.home-work-body { padding: 1rem 1.1rem 1.2rem; }
.home-work h3 {
  font-size: 1rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  margin: 0 0 0.35rem;
}
.home-work p { margin: 0; font-size: 0.8rem; color: var(--muted); }

.legal, .estudio-wrap, .error-wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 3rem 1.25rem 5rem;
}
.legal h1, .estudio-wrap h1, .error-wrap h1 {
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.03em;
}


/* Theme that actually flips Tailwind utilities on the home */
html[data-theme="dark"] body {
  background: #141211 !important;
  color: #f5f5f4 !important;
}
html[data-theme="dark"] #main-nav {
  background: rgba(20,18,17,.96) !important;
  border-color: rgba(245,245,244,.12) !important;
  color: #f5f5f4;
}
html[data-theme="dark"] [class*="text-dg-5"] { color: #f5f5f4 !important; }
html[data-theme="dark"] [class*="bg-white"] { background-color: #1c1917 !important; }
html[data-theme="dark"] [class*="bg-stone"] { background-color: #1a1816 !important; }
html[data-theme="dark"] [class*="border-dg-5"] { border-color: rgba(245,245,244,.14) !important; }
html[data-theme="dark"] [class*="text-stone"] { color: rgba(245,245,244,.62) !important; }
html[data-theme="dark"] .bg-dg-1,
html[data-theme="dark"] [class*="bg-dg-1"] { background-color: #C2410C !important; color: #fff !important; }
html[data-theme="dark"] #about { background: #0f0e0d !important; }
html[data-theme="dark"] img.obra-foto,
html[data-theme="dark"] .js-project-card img,
html[data-theme="dark"] #destacados-carousel img {
  filter: none !important;
}

html[data-theme="light"] .obras-app {
  --o-bg: #f4efe6;
  --o-panel: #fffdf8;
  --o-line: rgba(28,25,23,.12);
  --o-text: #1c1917;
  --o-dim: rgba(28,25,23,.62);
}
