/* ============================================================
   VINCIT — public site styles
   Design tokens + components.
   Palette: clay terracotta on warm paper.
   Type:    Fraunces display / Inter sans / JetBrains Mono.
============================================================ */


/* ============================================================
   1. Tokens
============================================================ */
:root {
  /* Accent — clay */
  --accent:       #a8472f;
  --accent-ink:   #7d3218;
  --accent-soft:  #f4e0d4;
  --accent-line:  #e7c6b1;

  /* Neutrals */
  --ink:    #1b1713;
  --ink-2:  #3d352c;
  --ink-3:  #6e6458;
  --mute:   #9a8f81;

  --line:   #e7ddd0;
  --line-2: #d8cbb8;

  --paper:   #f6f1ea;
  --paper-2: #efe7da;
  --paper-3: #e7dcc9;

  --white:   #fbf8f3;
  --black:   #161310;
  --stats-bg: #1b1713;

  /* Fonts */
  --font-display: "Fraunces", Georgia, serif;
  --font-sans:    "Inter", system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Radius / layout */
  --radius:    14px;
  --radius-sm: 6px;
  --maxw:      1280px;
  --pad-x:     clamp(1.25rem, 4vw, 2rem);
  --nav-h:     80px;

  --shadow-card: 0 20px 40px rgba(0,0,0,.08);
  --shadow-modal: 0 30px 80px rgba(0,0,0,.25);
  --transition: .25s ease;
}


/* ============================================================
   2. Reset + base
============================================================ */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; border: none; background: none; cursor: pointer; color: inherit; }
input, select, textarea { font: inherit; color: inherit; }

section { scroll-margin-top: calc(var(--nav-h) + 20px); }

::selection { background: var(--accent-soft); color: var(--accent-ink); }

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--pad-x);
}


/* ============================================================
   3. Typography utilities
============================================================ */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 500;
}

.mono { font-family: var(--font-mono); }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1.08;
}

h1 { letter-spacing: -0.025em; line-height: 1.02; }
h2 { font-size: clamp(32px, 3.6vw, 52px); line-height: 1.05; }
h3 { font-size: 20px; letter-spacing: -0.015em; }

em, .em-accent {
  font-style: italic;
  color: var(--accent);
  font-family: var(--font-display);
}


/* ============================================================
   4. Buttons
============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .55em;
  padding: 14px 24px;
  border-radius: 999px;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 14px;
  line-height: 1;
  letter-spacing: .01em;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition), transform var(--transition);
  white-space: nowrap;
  text-decoration: none;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  border: 1px solid transparent;
}
.btn-primary:hover { background: var(--accent-ink); }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--ink);
}
.btn-ghost:hover { background: var(--ink); color: var(--white); }

.btn-link {
  background: none;
  color: var(--accent);
  padding: 0;
  font-size: 14px;
  font-weight: 500;
}
.btn-link .arrow,
.btn .arrow { display: inline-block; transition: transform var(--transition); }
.btn-link:hover .arrow,
.btn:hover .arrow { transform: translateX(4px); }

.btn-sm { padding: 10px 18px; font-size: 13px; }


/* ============================================================
   5. Nav
============================================================ */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(251,248,243,.85);
  backdrop-filter: saturate(1.2) blur(10px);
  -webkit-backdrop-filter: saturate(1.2) blur(10px);
  border-bottom: 1px solid var(--line);
  transition: background var(--transition);
}
.nav.scrolled { background: rgba(251,248,243,.95); }

.nav-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 14px 0;
  gap: 24px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  justify-self: end;          /* logo pegado a la derecha */
  opacity: 0;                 /* arranca invisible; JS lo activa cuando el hero logo sale del viewport */
  pointer-events: none;
  transition: opacity .25s ease;
}
.nav-logo.visible {
  opacity: 1;
  pointer-events: auto;
}
.nav-logo img {
  height: 48px;
  width: auto;
  display: block;
}

.nav-links {
  display: flex;
  gap: 24px;
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 14.5px;
  justify-self: center;
  align-items: center;
}
.nav-links a {
  color: var(--ink-2);
  font-weight: 500;
  position: relative;
  padding: 8px 4px;
  transition: color var(--transition);
}
.nav-links a:hover { color: var(--ink); }
.nav-links a.nav-active { color: var(--accent); }
.nav-links a.nav-active::after {
  content: "";
  position: absolute;
  left: 4px; right: 4px; bottom: 0;
  height: 2px;
  background: var(--accent);
}
.nav-links a.cta {
  background: var(--accent);
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 500;
  transition: background var(--transition);
}
.nav-links a.cta:hover { background: var(--accent-ink); color: #fff; }
.nav-links a.cta::after { display: none; }

.nav-cta {
  justify-self: start;        /* burger + tag pegados a la izquierda */
  display: flex;
  align-items: center;
  gap: 10px;
}
.nav-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: .12em;
  text-transform: uppercase;
  font-weight: 500;
}

.nav-burger {
  display: none;
  width: 40px; height: 40px;
  padding: 10px;
  border-radius: 8px;
}
.nav-burger span {
  display: block;
  height: 2px;
  background: var(--ink);
  margin: 5px 0;
  transition: transform var(--transition), opacity var(--transition);
}
.nav-drawer {
  position: fixed;
  top: var(--nav-h);
  left: 0; right: 0;
  background: var(--paper);
  border-top: 1px solid var(--line);
  padding: 20px var(--pad-x) 30px;
  transform: translateY(-110%);
  transition: transform .3s ease;
  z-index: 49;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.nav-drawer.open { transform: translateY(0); }
.nav-drawer a {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--ink);
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.nav-progress {
  position: absolute;
  bottom: 0; left: 0;
  height: 2px;
  background: var(--accent);
  width: 0;
  transition: width .1s linear;
}


/* ============================================================
   6. Section base
============================================================ */
.section { padding: 120px 0; }


/* ============================================================
   7. Hero (split)
============================================================ */
.hero {
  padding: 48px 0 80px;
  background: var(--paper);
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 56px;
  align-items: center;         /* centrar carrusel verticalmente vs. copy */
}
.hero-copy { max-width: 620px; display: flex; flex-direction: column; }

.hero-title {
  font-size: clamp(34px, 5vw, 72px);
  margin-bottom: 0;
}
.hero-title em,
.hero-title .accent-word {
  color: var(--accent);
  font-style: italic;
  font-weight: 400;
}

.hero-lede {
  margin-top: 28px;
  font-size: 18px;
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 520px;
}

.hero-eyebrow-bottom {
  margin-top: 28px;
  display: flex;
  gap: 10px;
  align-items: center;
  padding-top: 20px;
  border-top: 1px dashed var(--line-2);
  max-width: 520px;
}
.hero-eyebrow-bottom .dot {
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
}

.hero-cta {
  margin-top: 8px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-meta {
  margin-top: 48px;
  display: flex;
  gap: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  max-width: 520px;
  flex-wrap: wrap;
}
.hero-meta-item .n {
  display: block;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1;
  margin-bottom: 2px;
}
.hero-meta-item .l {
  font-size: 13px;
  color: var(--ink-3);
}

/* Hero right column: logo box + carousel */
.hero-right {
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-self: stretch;
  min-width: 0;
}
.hero-logo {
  display: flex;
  align-items: center;
  align-self: center;     /* sin card, pegado a la izq */
  margin-bottom: 28px;
}
.hero-logo img {
  height: 96px;
  width: auto;
  display: block;
}

/* Hero carousel — aspect-ratio controla la altura, sin flex tricks */
.hero-carousel {
  position: relative;
  width: 100%;
  aspect-ratio: 3/2;          /* landscape — matchea los renders reales */
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 40px 60px -30px rgba(30,20,10,.25);
  background: var(--paper-3);
}
.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity .7s ease;
  cursor: pointer;
}
.hero-slide.on { opacity: 1; z-index: 1; }
.hero-slide .img {
  width: 100%; height: 100%;
  background-size: contain;         /* show full image, letterbox if needed */
  background-repeat: no-repeat;
  background-position: center;
  background-color: var(--paper-3);
}
.hero-slide .grad {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 45%;
  background: linear-gradient(to bottom, transparent, rgba(0,0,0,.65));
}
.hero-slide .tag {
  position: absolute;
  top: 16px; left: 16px;
  background: rgba(255,255,255,.92);
  color: var(--ink);
  padding: 6px 12px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  font-weight: 500;
  z-index: 2;
}
.hero-slide .tag.accent { background: var(--accent); color: #fff; }
.hero-slide .cap {
  position: absolute;
  bottom: 20px; left: 20px; right: 60px;
  color: #fff;
  z-index: 2;
}
.hero-slide .cap .name {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  margin-bottom: 2px;
}
.hero-slide .cap .loc {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  opacity: .85;
}

.hero-count {
  position: absolute;
  top: 20px; right: 20px;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .16em;
  z-index: 2;
  background: rgba(0,0,0,.35);
  padding: 6px 10px;
  border-radius: 6px;
}

.hero-nav {
  position: absolute;
  right: 16px; bottom: 16px;
  display: flex;
  gap: 6px;
  z-index: 3;
}
.hero-nav button {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(0,0,0,.45);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 18px;
  transition: background var(--transition);
}
.hero-nav button:hover { background: rgba(0,0,0,.65); }

.hero-dots {
  position: absolute;
  bottom: 16px; left: 24px;
  display: flex;
  gap: 8px;
  z-index: 3;
}
.hero-dots button {
  width: 22px; height: 3px;
  background: rgba(255,255,255,.4);
  border-radius: 2px;
  padding: 0;
  transition: background var(--transition), width var(--transition);
}
.hero-dots button.on { background: #fff; width: 34px; }


/* ============================================================
   8. About
============================================================ */
.about { background: var(--paper-2); padding: 120px 0; }
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: start;
}
.about-left h2 { font-size: clamp(30px, 3.4vw, 48px); margin-bottom: 24px; }
.about-left .eyebrow { display: block; margin-bottom: 16px; }
.about-left .lede { font-size: 17px; color: var(--ink-2); margin-bottom: 20px; }
.about-left p { color: var(--ink-2); margin-bottom: 24px; }

.feat-list { display: flex; flex-direction: column; }
.feat {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 20px;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}
.feat:last-child { border-bottom: 0; }
.feat .n {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
  letter-spacing: .1em;
  font-weight: 500;
}
.feat h3 { margin-bottom: 8px; }
.feat p { color: var(--ink-3); font-size: 15px; }


/* ============================================================
   9. Stats
============================================================ */
.stats { background: var(--stats-bg); color: var(--white); padding: 80px 0; }
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
}
.stat {
  padding: 16px 32px;
  border-left: 1px solid rgba(255,255,255,.12);
}
.stat:first-child { border-left: 0; padding-left: 0; }
.stat .n {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(36px, 4vw, 58px);
  font-weight: 500;
  line-height: 1;
  margin-bottom: 10px;
  letter-spacing: -0.02em;
}
.stat .n em { color: var(--accent); font-style: italic; }
.stat .l {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(255,255,255,.6);
}


/* ============================================================
   10. Portfolio
============================================================ */
.portfolio { background: var(--white); padding: 120px 0; }
.portfolio-head {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: end;
  margin-bottom: 48px;
}
.portfolio-head h2 { font-size: clamp(32px, 3.6vw, 52px); margin-top: 8px; }
.portfolio-head .eyebrow { display: block; margin-bottom: 8px; }
.portfolio-head .aside {
  font-size: 15px;
  color: var(--ink-3);
  max-width: 380px;
  justify-self: end;
}

.filters-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}
.filters {
  display: inline-flex;
  gap: 6px;
  background: var(--paper);
  padding: 5px;
  border-radius: 999px;
  border: 1px solid var(--line);
}
.filter-btn {
  padding: 9px 18px;
  border: 0;
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--ink-3);
  font-weight: 500;
  background: transparent;
  transition: background var(--transition), color var(--transition);
}
.filter-btn:hover { color: var(--ink); }
.filter-btn.on { background: var(--ink); color: #fff; }
.filter-count {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 500;
}

.pf-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: 200px;          /* more compact — feature fits in a 14"/15" laptop viewport */
  gap: 20px;                      /* separación más respirada entre cards */
}
.pf-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--paper-2);
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0,0,0,.03);
  transition: box-shadow var(--transition), transform var(--transition);
}
.pf-card:hover { box-shadow: var(--shadow-card); }

/* Mosaic: [4×2 big feature] + [2×1 stack on right] + [3 × 2×1 in bottom row]
   All cards sit near 3:2, matching typical real-estate renders.
   Uses :nth-of-type so Alpine's <template> sibling doesn't throw off the count. */
.pf-card:nth-of-type(6n+1) { grid-column: span 4; grid-row: span 2; }
.pf-card:nth-of-type(6n+2) { grid-column: span 2; grid-row: span 1; }
.pf-card:nth-of-type(6n+3) { grid-column: span 2; grid-row: span 1; }
.pf-card:nth-of-type(6n+4) { grid-column: span 2; grid-row: span 1; }
.pf-card:nth-of-type(6n+5) { grid-column: span 2; grid-row: span 1; }
.pf-card:nth-of-type(6n+6) { grid-column: span 2; grid-row: span 1; }

.pf-img {
  position: absolute;
  inset: 0;
  background-size: contain;         /* show the whole photo, letterbox if needed */
  background-repeat: no-repeat;
  background-position: center;
  background-color: var(--paper-3);
  transition: transform .6s ease;
}
.pf-card:hover .pf-img { transform: scale(1.04); }

.pf-tag {
  position: absolute;
  top: 14px; left: 14px;
  background: rgba(255,255,255,.94);
  color: var(--ink);
  padding: 6px 12px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  font-weight: 500;
  z-index: 2;
  backdrop-filter: blur(4px);
}
.pf-tag.accent { background: var(--accent); color: #fff; }

.pf-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 40%, rgba(0,0,0,.7));
  opacity: 0;
  transition: opacity var(--transition);
  z-index: 1;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 20px;
  gap: 14px;
}
.pf-card:hover .pf-overlay { opacity: 1; }
.pf-overlay .title {
  color: #fff;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  max-width: 70%;
  line-height: 1.1;
}
.pf-overlay .title small {
  display: block;
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: rgba(255,255,255,.75);
  font-weight: 400;
  margin-top: 6px;
}
.pf-overlay .pill {
  background: #fff;
  color: var(--ink);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transform: translateY(6px);
  transition: transform var(--transition);
}
.pf-card:hover .pf-overlay .pill { transform: translateY(0); }


/* ============================================================
   11. Modal (project detail)
============================================================ */
.modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(10,8,6,.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}
.modal-bg.open { opacity: 1; pointer-events: auto; }

.modal {
  width: 100%;
  max-width: 1100px;
  max-height: 90vh;
  background: var(--white);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-modal);
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  position: relative;
  transform: scale(.96);
  transition: transform .25s ease;
}
.modal-bg.open .modal { transform: scale(1); }

.modal-media {
  position: relative;
  background: var(--paper-2);
  min-height: 560px;
}
.modal-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity .4s ease;
}
.modal-slide.on { opacity: 1; }
.modal-slide img {
  width: 100%; height: 100%;
  object-fit: contain;              /* show full image; paper-coloured bars around if needed */
}
.modal-slide .ph {
  width: 100%; height: 100%;
  background: linear-gradient(135deg, #c9966e, #7a5438);
}

.modal-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,.92);
  color: var(--ink);
  display: grid;
  place-items: center;
  font-size: 20px;
  box-shadow: 0 6px 18px rgba(0,0,0,.2);
  z-index: 3;
  transition: background var(--transition), transform var(--transition);
}
.modal-nav:hover { background: #fff; transform: translateY(-50%) scale(1.05); }
.modal-nav.prev { left: 18px; }
.modal-nav.next { right: 18px; }

.modal-tag {
  position: absolute;
  top: 20px; left: 20px;
  background: var(--accent);
  color: #fff;
  padding: 6px 12px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  font-weight: 500;
  z-index: 3;
}

.modal-count {
  position: absolute;
  bottom: 20px; left: 20px;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .12em;
  background: rgba(0,0,0,.45);
  padding: 5px 11px;
  border-radius: 999px;
  z-index: 3;
  backdrop-filter: blur(4px);
}

.modal-dots {
  position: absolute;
  bottom: 22px; right: 22px;
  display: flex;
  gap: 6px;
  z-index: 3;
}
.modal-dots button {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,.45);
  padding: 0;
  transition: background var(--transition), transform var(--transition);
}
.modal-dots button.on { background: #fff; transform: scale(1.3); }

.modal-body {
  padding: 40px 36px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.modal-body .eyebrow { margin-bottom: 10px; }
.modal-body h2 { font-size: clamp(28px, 3vw, 38px); margin-bottom: 8px; }
.modal-location {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 18px;
}
.modal-desc { color: var(--ink-2); font-size: 15px; line-height: 1.6; margin-bottom: 24px; }

.modal-facts {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 18px 24px;
  padding: 18px 0;
  border-top: 1px dashed var(--line-2);
  border-bottom: 1px dashed var(--line-2);
  margin-bottom: 28px;
}
.modal-fact .k {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 4px;
}
.modal-fact .v { font-size: 15px; color: var(--ink); font-weight: 500; }

.modal-typologies { margin-bottom: 24px; }
.modal-typologies h4 {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 12px;
  font-weight: 500;
}
.typology-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.typology-table th, .typology-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}
.typology-table th {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 500;
}
.typology-table td { color: var(--ink-2); }

.modal-downloads {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}
.modal-download {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-2);
  font-size: 13px;
  transition: border-color var(--transition), background var(--transition);
}
.modal-download:hover { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent-ink); }

.modal-cta {
  margin-top: auto;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 20px;
}

.modal-close {
  position: absolute;
  top: 16px; right: 16px;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,.94);
  color: var(--ink);
  display: grid;
  place-items: center;
  z-index: 5;
  box-shadow: 0 4px 14px rgba(0,0,0,.15);
  transition: background var(--transition), transform var(--transition);
}
.modal-close:hover { background: #fff; transform: rotate(90deg); }


/* ============================================================
   12. Process
============================================================ */
.process { background: var(--paper-2); padding: 120px 0; }
.process-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 48px;
}
.step {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  transition: transform var(--transition), box-shadow var(--transition);
}
.step:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-card);
}
.step .n {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 48px;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 18px;
}
.step h3 { margin-bottom: 10px; }
.step p { color: var(--ink-3); font-size: 14.5px; line-height: 1.6; }


/* ============================================================
   13. Press
============================================================ */
.press { background: var(--paper); padding: 120px 0; }
.press-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 80px;
  align-items: center;
}
.press-quote {
  font-family: var(--font-display);
  font-size: clamp(22px, 2.4vw, 34px);
  line-height: 1.35;
  color: var(--ink);
  font-weight: 400;
  letter-spacing: -0.01em;
  position: relative;
}
.press-quote .mark { color: var(--accent); font-size: 1.1em; font-style: italic; }
.press-cite {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-top: 22px;
}
.press-cite em { font-style: italic; color: var(--ink-2); }

.press-logos {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.press-logo {
  aspect-ratio: 1.4/1;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  text-align: center;
  padding: 12px;
  transition: border-color var(--transition);
}
.press-logo:hover { border-color: var(--line-2); }
.press-logo img { max-height: 60%; max-width: 80%; object-fit: contain; }


/* ============================================================
   14. Contact
============================================================ */
.contact { background: var(--paper-2); padding: 120px 0; }
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 80px;
  align-items: start;
}
.contact-left h2 { font-size: clamp(32px, 3.6vw, 52px); margin: 14px 0 24px; }
.contact-left .eyebrow { display: block; }
.contact-left .lede {
  font-size: 17px;
  color: var(--ink-2);
  max-width: 420px;
}

.contact-links {
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.c-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  border-radius: 12px;
  border: 1px solid var(--line-2);
  background: var(--white);
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  transition: border-color var(--transition), background var(--transition);
}
.c-link:hover { border-color: var(--ink-2); }
.c-link .ic {
  width: 22px; height: 22px;
  display: grid;
  place-items: center;
  color: var(--accent);
  flex-shrink: 0;
}
.c-link .arrow {
  margin-left: auto;
  color: var(--ink-3);
  opacity: .6;
  transition: opacity var(--transition), transform var(--transition);
}
.c-link:hover .arrow { opacity: 1; transform: translateX(3px); }
.c-link.wa {
  background: #128c4b;
  color: #fff;
  border-color: transparent;
}
.c-link.wa:hover { background: #0f7a40; border-color: transparent; }
.c-link.wa .ic,
.c-link.wa .arrow { color: #fff; opacity: .9; }

/* Form card */
.contact-form {
  background: var(--white);
  padding: 36px;
  border-radius: 16px;
  border: 1px solid var(--line);
  display: grid;
  gap: 0;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.field {
  margin-bottom: 16px;
}
.field label {
  display: block;
  font-size: 13px;
  color: var(--ink-2);
  font-weight: 500;
  margin-bottom: 6px;
  font-family: var(--font-sans);
  letter-spacing: 0;
  text-transform: none;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: var(--white);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 14.5px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.field textarea { min-height: 120px; resize: vertical; }
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 2px solid var(--accent-line);
  outline-offset: 0;
  border-color: var(--accent);
}
.field .err { color: #b94434; font-size: 12px; display: none; margin-top: 4px; }
.field.invalid input,
.field.invalid select,
.field.invalid textarea { border-color: #b94434; }
.field.invalid .err { display: block; }

.form-submit {
  width: 100%;
  justify-content: center;
  margin-top: 8px;
}

.form-success {
  display: none;
  padding: 18px;
  border: 1px dashed var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent-ink);
  border-radius: var(--radius);
  font-size: 14px;
  margin-bottom: 0;
}
.form-success.on { display: block; }
.contact-form.sent .form-submit,
.contact-form.sent .form-row,
.contact-form.sent .field:not(.form-success-field) { display: none; }

.is-loading { opacity: .7; pointer-events: none; }


/* ============================================================
   15. Footer
============================================================ */
.footer {
  background: var(--ink);
  color: var(--white);
  padding: 80px 0 30px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 60px;
}
.footer-brand { max-width: 320px; }
.footer-logo {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
}
.footer-logo img {
  height: 72px;
  width: auto;
  display: block;   /* force white on dark footer (remove if logo is already light) */
}
.footer-tag {
  color: rgba(255,255,255,.55);
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 24px;
}

.footer-col h5 {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(255,255,255,.45);
  font-weight: 500;
  margin-bottom: 18px;
}
.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.footer-col a {
  color: rgba(255,255,255,.75);
  font-size: 14px;
  transition: color var(--transition);
}
.footer-col a:hover { color: #fff; }

.footer-bottom {
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255,255,255,.45);
}


/* ============================================================
   16. Skeleton
============================================================ */
.skeleton {
  position: relative;
  overflow: hidden;
  background: var(--paper-2);
}
.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.45), transparent);
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}


/* ============================================================
   17. Scroll reveal
============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .55s ease, transform .55s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }


/* ============================================================
   18. Back to top + toast
============================================================ */
.back-top {
  position: fixed;
  bottom: 24px; right: 24px;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 8px 22px rgba(0,0,0,.2);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity var(--transition), transform var(--transition), background var(--transition);
  z-index: 40;
}
.back-top.visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.back-top:hover { background: var(--accent); }

.toast {
  position: fixed;
  bottom: 30px; left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: var(--ink);
  color: #fff;
  padding: 11px 20px;
  border-radius: 8px;
  font-size: 13.5px;
  opacity: 0;
  z-index: 9999;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  box-shadow: 0 8px 22px rgba(0,0,0,.25);
}
.toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.success { background: #0f7a40; color: #fff; }
.toast.error   { background: #b94434; color: #fff; }


/* ============================================================
   19. Focus / a11y
============================================================ */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}


/* ============================================================
   20. Responsive
============================================================ */
@media (max-width: 1100px) {
  .hero-grid { gap: 40px; }
  .modal { grid-template-columns: 1fr; max-height: 92vh; }
  .modal-media { min-height: 320px; aspect-ratio: 16/11; }
  .modal-body { padding: 28px 24px; }
}

@media (max-width: 900px) {
  .section, .about, .portfolio, .press, .contact, .process { padding: 80px 0; }
  .hero { padding: 24px 0 60px; }

  .nav-inner { grid-template-columns: auto 1fr; }
  .nav-inner > nav { display: none; }       /* hide middle column entirely so grid stays 2-col */
  .nav-cta .nav-tag { display: none; }      /* only burger on the left */
  .nav-burger { display: block; }
  .nav-logo img { height: 40px; }

  .hero-grid { grid-template-columns: 1fr; gap: 32px; }
  .hero-copy { max-width: 100%; }
  .hero-title { font-size: clamp(28px, 7vw, 42px); }
  .hero-logo { margin-bottom: 20px; }
  .hero-logo img { height: 64px; }
  .hero-meta { gap: 20px; }
  .hero-meta-item .n { font-size: 22px; }
  .hero-meta-item .l { font-size: 11px; }
  .hero-carousel { aspect-ratio: 4/3; }      /* un poco más alto en mobile para verlo entero sin scroll */

  /* Portfolio filters: wrap multi-line centered en mobile */
  .filters-bar {
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }
  .filters {
    flex-wrap: wrap;
    justify-content: center;
    border-radius: 14px;       /* menos pill, más relaxed cuando hay múltiples filas */
  }

  .about-grid { grid-template-columns: 1fr; gap: 40px; }
  .portfolio-head { grid-template-columns: 1fr; }
  .portfolio-head .aside { justify-self: start; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .stat { padding: 20px; border-left: 0; border-top: 1px solid rgba(255,255,255,.1); }
  .stat:first-child, .stat:nth-child(2) { border-top: 0; }

  .pf-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
    gap: 14px;
  }
  .pf-card,
  .pf-card:nth-child(6n+1),
  .pf-card:nth-child(6n+2),
  .pf-card:nth-child(6n+3),
  .pf-card:nth-child(6n+4),
  .pf-card:nth-child(6n+5),
  .pf-card:nth-child(6n+6) {
    grid-column: span 1;
    grid-row: auto;
    aspect-ratio: 3/2;
  }

  .process-grid { grid-template-columns: repeat(2, 1fr); }
  .press-grid { grid-template-columns: 1fr; gap: 40px; }
  .contact-grid { grid-template-columns: 1fr; gap: 40px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
}

@media (max-width: 600px) {
  .section, .about, .portfolio, .press, .contact, .process, .hero, .stats { padding: 56px 0; }
  .hero { padding-top: 18px; }
  .process-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr; }
  .stat { border-top: 1px solid rgba(255,255,255,.1) !important; }
  .stat:first-child { border-top: 0 !important; }
  .form-row { grid-template-columns: 1fr; }
  .press-logos { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; gap: 10px; text-align: center; }
  .hero-count { font-size: 10px; }
  .hero-title { font-size: clamp(24px, 8vw, 36px); }
  .hero-meta { grid-template-columns: 1fr; gap: 10px; padding-top: 18px; }
  .modal-body { padding: 22px 18px; }
  .modal-cta { flex-direction: column; }
  .modal-cta .btn { width: 100%; justify-content: center; }
  .modal-facts { grid-template-columns: 1fr 1fr; }
}
