/* Joel Cotardo — arquitecto */

@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500&display=swap");

:root {
  --ink: #1a1a1a;
  --muted: #8a8a8a;
  --line: #e6e6e6;
  --bg: #ffffff;
  --gutter: clamp(16px, 3.2vw, 48px);
  --header: 88px;
  --font: "Montserrat", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 300;
  font-size: 13px;
  line-height: 1.75;
  letter-spacing: 0.02em;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible { outline: 1px solid var(--ink); outline-offset: 4px; }

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 20;
  height: var(--header);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--gutter);
  background: rgba(255, 255, 255, 0.94);
}
.site-header.on-image { background: transparent; color: #fff; }
.brand { display: flex; align-items: center; gap: 14px; }
.brand svg { width: 64px; height: auto; display: block; }
.brand-name { font-size: 11px; font-weight: 400; letter-spacing: 0.22em; text-transform: uppercase; }

.nav { display: flex; gap: clamp(18px, 2.6vw, 40px); }
.nav a {
  font-size: 11px; font-weight: 400; letter-spacing: 0.22em; text-transform: uppercase;
  padding: 4px 0; border-bottom: 1px solid transparent; transition: border-color .2s;
}
.nav a:hover, .nav a[aria-current="page"] { border-bottom-color: currentColor; }

.menu-toggle {
  display: none; background: none; border: 0; color: inherit; cursor: pointer;
  font: inherit; font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; padding: 8px 0;
}

@media (max-width: 760px) {
  :root { --header: 68px; }
  .brand-name { display: none; }
  .brand svg { width: 54px; }
  .menu-toggle { display: block; }
  .nav {
    position: fixed; inset: var(--header) 0 auto 0; flex-direction: column; gap: 0;
    background: #fff; color: var(--ink); padding: 8px var(--gutter) 24px;
    border-bottom: 1px solid var(--line);
    display: none;
  }
  .nav.open { display: flex; }
  .nav a { padding: 14px 0; border-bottom: 1px solid var(--line); }
  .nav a:last-child { border-bottom: 0; }
}

/* ---------- Page scaffold ---------- */
main { padding-top: var(--header); }
.page { padding: calc(var(--header) + clamp(32px, 6vw, 80px)) var(--gutter) 96px; }
.eyebrow { font-size: 11px; font-weight: 400; letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted); }
h1, h2, h3 { font-weight: 400; letter-spacing: 0.18em; text-transform: uppercase; }
h1 { font-size: 15px; }
h2 { font-size: 12px; }
.prose { max-width: 560px; }
.prose p + p { margin-top: 1.2em; }

.site-footer {
  padding: 32px var(--gutter); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted);
  border-top: 1px solid var(--line);
}

/* ---------- Home ---------- */
.home main { padding-top: 0; }
.hero { position: relative; height: 100vh; height: 100svh; overflow: hidden; background: #ddd; }
.hero-slide {
  position: absolute; inset: 0; opacity: 0; transition: opacity 1.6s ease;
}
.hero-slide.active { opacity: 1; }
.hero-slide img { width: 100%; height: 100%; object-fit: cover; }
.hero-slide::after { content: ""; position: absolute; inset: 0 0 auto 0; height: 160px; background: linear-gradient(rgba(0,0,0,.28), transparent); }
.hero-caption {
  position: absolute; left: var(--gutter); bottom: 28px; z-index: 2; color: #fff;
  font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; text-shadow: 0 0 12px rgba(0,0,0,.35);
}
.hero-caption a:hover { text-decoration: underline; text-underline-offset: 4px; }

/* ---------- Works index ---------- */
.works-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 40px; }
.works-filter { display: flex; gap: 24px; flex-wrap: wrap; }
.works-filter button {
  background: none; border: 0; font: inherit; cursor: pointer; color: var(--muted);
  font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; padding: 2px 0;
}
.works-filter button.active { color: var(--ink); border-bottom: 1px solid var(--ink); }

.works-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); gap: 56px 32px; }
.work-card figure { overflow: hidden; aspect-ratio: 4 / 3; background: #f3f3f3; }
.work-card img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s ease, opacity .4s; }
.work-card:hover img { transform: scale(1.025); }
.work-card .meta { display: flex; justify-content: space-between; gap: 12px; margin-top: 14px; }
.work-card .title { font-size: 11px; font-weight: 400; letter-spacing: 0.2em; text-transform: uppercase; }
.work-card .sub { font-size: 11px; color: var(--muted); letter-spacing: 0.06em; }
.work-card[hidden] { display: none; }

.works-list { margin-top: 96px; border-top: 1px solid var(--line); }
.works-list a {
  display: grid; grid-template-columns: 70px 1.4fr 1fr 1fr; gap: 16px; padding: 14px 0;
  border-bottom: 1px solid var(--line); font-size: 11px; letter-spacing: 0.08em;
}
.works-list a:hover { color: var(--muted); }
.works-list .t { letter-spacing: 0.2em; text-transform: uppercase; }
@media (max-width: 760px) {
  .works-list a { grid-template-columns: 50px 1fr; }
  .works-list a span:nth-child(n+3) { display: none; }
}

/* ---------- Project ---------- */
.project-intro {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 32px 64px;
  padding: clamp(40px, 6vw, 80px) var(--gutter) 48px;
}
.project-intro h1 { font-size: 15px; margin-bottom: 6px; }
.project-intro .subtitle { color: var(--muted); font-size: 12px; letter-spacing: 0.04em; }

.gallery {
  display: flex; gap: 14px; overflow-x: auto; overscroll-behavior-x: contain;
  padding: 0 var(--gutter) 18px; scroll-snap-type: x proximity;
  scrollbar-width: thin; scrollbar-color: #cfcfcf transparent;
  cursor: grab;
}
.gallery.dragging { cursor: grabbing; scroll-snap-type: none; }
.gallery figure { flex: 0 0 auto; scroll-snap-align: start; }
.gallery img {
  height: min(68vh, 760px); width: auto; max-width: none; background: #f3f3f3;
  user-select: none; -webkit-user-drag: none; cursor: zoom-in;
}
.gallery figcaption { font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-top: 8px; }
.gallery-hint { padding: 6px var(--gutter) 0; font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); }

@media (max-width: 760px) {
  .project-intro { grid-template-columns: 1fr; }
  .gallery { flex-direction: column; overflow: visible; cursor: auto; gap: 24px; }
  .gallery img { height: auto; width: 100%; }
  .gallery-hint { display: none; }
}

.project-body {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 40px 64px;
  padding: 80px var(--gutter) 96px;
}
.datasheet { list-style: none; border-top: 1px solid var(--line); }
.datasheet li { display: grid; grid-template-columns: 120px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 11px; }
.datasheet li span:first-child { color: var(--muted); letter-spacing: 0.16em; text-transform: uppercase; font-size: 10px; padding-top: 1px; }
.link-line { display: inline-block; margin-top: 28px; font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; border-bottom: 1px solid currentColor; padding-bottom: 2px; }
.link-line:hover { color: var(--muted); }
@media (max-width: 760px) { .project-body { grid-template-columns: 1fr; padding-top: 48px; } }

.project-nav { display: flex; justify-content: space-between; padding: 28px var(--gutter); border-top: 1px solid var(--line); font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; }
.project-nav a:hover { color: var(--muted); }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 50; background: rgba(255,255,255,.98);
  display: none; align-items: center; justify-content: center; padding: 64px 72px;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lightbox button {
  position: absolute; background: none; border: 0; cursor: pointer; font: inherit; color: var(--ink);
  font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; padding: 12px;
}
.lb-close { top: 18px; right: calc(var(--gutter) - 12px); }
.lb-prev { left: calc(var(--gutter) - 12px); top: 50%; transform: translateY(-50%); }
.lb-next { right: calc(var(--gutter) - 12px); top: 50%; transform: translateY(-50%); }
.lb-count { position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%); font-size: 10px; letter-spacing: 0.2em; color: var(--muted); }
@media (max-width: 760px) { .lightbox { padding: 64px 8px; } .lb-prev, .lb-next { top: auto; bottom: 10px; transform: none; } }

/* ---------- Products / About / Contact ---------- */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 40px 64px; }
@media (max-width: 760px) { .split { grid-template-columns: 1fr; } }
.split h1 { margin-bottom: 8px; }

.store-card {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin-top: 56px; border: 1px solid var(--line);
}
.store-card .ph { aspect-ratio: 1; background: #f4f4f4; display: flex; align-items: center; justify-content: center; }
.store-card .ph svg { width: 46%; height: auto; color: #b9b9b9; }
.store-card .txt { padding: 32px; display: flex; flex-direction: column; justify-content: space-between; gap: 24px; }
@media (max-width: 560px) { .store-card { grid-template-columns: 1fr; } }

.contact-list { list-style: none; border-top: 1px solid var(--line); max-width: 560px; }
.contact-list li { display: grid; grid-template-columns: 140px 1fr; gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.contact-list li span:first-child { color: var(--muted); font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; padding-top: 2px; }
.contact-list a:hover { color: var(--muted); }
@media (max-width: 480px) { .contact-list li { grid-template-columns: 1fr; gap: 2px; } }

.cv { list-style: none; margin-top: 40px; border-top: 1px solid var(--line); max-width: 560px; }
.cv li { display: grid; grid-template-columns: 80px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.cv li span:first-child { color: var(--muted); }
