/* BRANK · sitio corporativo · concepto "pliegue editorial"
   Tokens tomados del design system en Figma (modos Claro / Oscuro). */

:root {
  --bg: #f6f4ef;
  --surface: #ffffff;
  --surface-sunken: #e9edf3;
  --text: #1f283a;
  --text-muted: #5b6678;
  --accent: #0042a9;
  --accent-fill: #0042a9;
  --on-accent-fill: #ffffff;
  --highlight: #ffe226;
  --on-highlight: #1f283a;
  --heat: #f8861e;
  --line: #d5dae3;
  --line-strong: #1f283a;
  --pattern: #1f283a;
  --focus: #0042a9;

  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 24px;
  --space-6: 32px; --space-7: 48px; --space-8: 64px; --space-9: 96px; --space-10: 128px;

  --margin: 96px;
  --section: 128px;
  --gutter: 32px;
  --max: 1440px;

  --font-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --font-text: "Instrument Sans", "Segoe UI", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --fs-hero: clamp(3.5rem, 10vw, 9rem);
  --fs-h1: clamp(2.75rem, 6.7vw, 6rem);
  --fs-h2: clamp(2.25rem, 5vw, 4.5rem);
  --fs-h3: clamp(1.375rem, 1.8vw, 1.625rem);
  --fs-lead: clamp(1.125rem, 1.4vw, 1.25rem);
}

.dark {
  --bg: #1f283a;
  --surface: #273148;
  --surface-sunken: #151c2b;
  --text: #f6f4ef;
  --text-muted: #a9b3c5;
  --accent: #4aa8ff;
  --accent-fill: #0096ff;
  --on-accent-fill: #151c2b;
  --line: #44506b;
  --line-strong: #f6f4ef;
  --pattern: #f6f4ef;
  --focus: #4aa8ff;
}

@media (max-width: 1100px) { :root { --margin: 48px; --section: 96px; --gutter: 24px; } }
@media (max-width: 640px)  { :root { --margin: 24px; --section: 64px; --gutter: 16px; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 17px/1.53 var(--font-text); -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, p, ul, ol, figure, dl, dd { margin: 0; padding: 0; }
ul, ol { list-style: none; }
button { font: inherit; color: inherit; }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.skip { position: absolute; left: 16px; top: -64px; z-index: 100; background: var(--text); color: var(--bg); padding: 12px 16px; transition: top .15s; }
.skip:focus { top: 16px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ——— tipografía ——— */
.display { font-family: var(--font-display); font-weight: 300; margin: 0; }
.hero-title { font-size: var(--fs-hero); line-height: .97; letter-spacing: -.04em; }
.h1 { font-size: var(--fs-h1); line-height: 1.02; letter-spacing: -.035em; }
.h2 { font-size: var(--fs-h2); line-height: 1.05; letter-spacing: -.03em; }
.h3 { font-family: var(--font-display); font-weight: 400; font-size: var(--fs-h3); line-height: 1.23; letter-spacing: -.015em; }
.muted { color: var(--text-muted); }
.duo > span { display: block; }
.duo > span + span { color: var(--text-muted); }
.lead { font-size: var(--fs-lead); line-height: 1.5; letter-spacing: -.005em; color: var(--text-muted); max-width: 34em; }
.small { font-size: 14px; line-height: 1.5; }
.label {
  font: 500 13px/1.4 var(--font-mono); letter-spacing: .08em; text-transform: uppercase;
}
.label.accent { color: var(--accent); }
.label.muted { color: var(--text-muted); }

/* ——— estructura ——— */
.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--margin); }
.section { background: var(--bg); color: var(--text); padding-block: var(--section); }
.section.tight { padding-block: calc(var(--section) * .75); }
.stack { display: flex; flex-direction: column; }
.head { display: flex; flex-direction: column; gap: var(--space-5); margin-bottom: var(--space-8); }
.head .lead { margin-top: 0; }

.grid { display: grid; gap: var(--gutter); }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 820px)  { .g2, .g3 { grid-template-columns: 1fr; } }
@media (max-width: 640px)  { .g4 { grid-template-columns: 1fr; } }

/* ——— botones y enlaces ——— */
.btn {
  display: inline-flex; align-items: center; gap: 12px; text-decoration: none; cursor: pointer;
  font: 600 16px/20px var(--font-text); padding: 16px 24px; border: 0; border-radius: 0;
  background: var(--accent-fill); color: var(--on-accent-fill);
  transition: transform .15s ease, background .15s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn::after { content: "→"; }
.btn.ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.btn.sm { padding: 12px 18px; font-size: 15px; }
.tlink {
  display: inline-flex; gap: 10px; align-items: center; text-decoration: none; font: 600 16px/20px var(--font-text);
  padding-bottom: 6px; border-bottom: 2px solid var(--line-strong);
}
.tlink::after { content: "→"; transition: transform .15s; }
.tlink:hover::after { transform: translateX(4px); }
.tlink.ext::after { content: "↗"; }
.actions { display: flex; flex-wrap: wrap; gap: var(--space-5); align-items: center; }

/* ——— encabezado ——— */
.site-header { background: var(--bg); border-bottom: 1px solid var(--line); position: relative; z-index: 20; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: var(--space-5); height: 88px; }
.logo { display: block; flex: none; }
.logo img { height: 40px; width: auto; }
.nav { display: flex; align-items: center; gap: var(--space-6); }
.nav ul { display: flex; gap: var(--space-6); }
.nav a.link { text-decoration: none; font: 500 16px/20px var(--font-text); padding-block: 8px; border-bottom: 2px solid transparent; }
.nav a.link:hover, .nav a.link[aria-current="page"] { border-bottom-color: var(--line-strong); }
.menu-toggle { display: none; background: none; border: 1.5px solid var(--line-strong); padding: 10px 14px; cursor: pointer; font: 500 13px/1 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; }
@media (max-width: 1000px) {
  .menu-toggle { display: block; }
  .nav { position: absolute; left: 0; right: 0; top: 100%; background: var(--bg); border-bottom: 1px solid var(--line);
    flex-direction: column; align-items: stretch; gap: var(--space-5); padding: var(--space-5) var(--margin) var(--space-6); display: none; }
  .nav.open { display: flex; }
  .nav ul { flex-direction: column; gap: 4px; }
  .nav a.link { display: block; font-size: 22px; padding-block: 12px; border-bottom: 1px solid var(--line); }
  .nav .btn { justify-content: center; }
}

/* ——— hero ——— */
.hero { position: relative; overflow: hidden; padding-block: var(--space-9) var(--section); }
.hero .wrap { position: relative; z-index: 1; display: flex; flex-direction: column; gap: var(--space-7); }
.hero .kicker { display: flex; align-items: center; gap: 12px; }
.hero .kicker::before { content: ""; width: 12px; height: 12px; background: var(--highlight); flex: none; }
.hero-foot { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--space-6); }
.trama {
  position: absolute; right: 0; top: 0; width: min(46vw, 640px); height: 100%; pointer-events: none; opacity: .16;
  background: repeating-linear-gradient(135deg, transparent 0 9px, var(--pattern) 9px 10px);
  -webkit-mask-image: linear-gradient(to left, #000, transparent 85%); mask-image: linear-gradient(to left, #000, transparent 85%);
}
.page-hero { padding-block: var(--space-9) var(--space-10); }
@media (max-width: 1100px) { .page-hero { padding-block: var(--space-8) var(--space-9); } .hero { padding-block: var(--space-8) var(--space-9); } }
@media (max-width: 640px)  { .page-hero, .hero { padding-block: var(--space-7) var(--space-8); } }

.hero-media { display: grid; grid-template-columns: 1.4fr 1fr; gap: var(--gutter); align-items: end; }
.hero-media figure:nth-child(2) { margin-bottom: 0; }
@media (max-width: 820px) { .hero-media { grid-template-columns: 1fr; } }

/* ——— imágenes ——— */
.pic { position: relative; background: var(--surface-sunken); overflow: hidden; }
.pic img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 3 / 2; transition: transform .5s ease; }
.pic.sq img { aspect-ratio: 1; }
.pic.wide img { aspect-ratio: 21 / 9; }
.pic.eq img { aspect-ratio: 4 / 5; }
.hero-media .pic img { aspect-ratio: 4 / 3; }
.pic.zoom { cursor: zoom-in; }
.pic.zoom:hover img { transform: scale(1.03); }
.pic.tile {
  aspect-ratio: 3 / 2; display: flex; align-items: flex-end; padding: var(--space-5);
  background: var(--surface-sunken);
}
.pic.tile::before { content: ""; position: absolute; right: 0; top: 0; width: 96px; height: 96px; background: linear-gradient(225deg, var(--highlight) 50%, transparent 50%); }
.pic.tile span { font-family: var(--font-display); font-weight: 300; font-size: clamp(2rem, 4vw, 3rem); letter-spacing: -.03em; line-height: 1; }
figure.piece { display: flex; flex-direction: column; gap: var(--space-3); }
figcaption { font: 500 13px/1.4 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); }
figcaption a { color: var(--accent); text-decoration: none; }
figcaption a:hover { text-decoration: underline; }

/* ——— fichas y listas ——— */
.ficha { border-top: 2px solid var(--line-strong); padding-top: var(--space-5); display: flex; flex-direction: column; gap: var(--space-3); }
.ficha .n { font: 500 13px/1.4 var(--font-mono); letter-spacing: .08em; color: var(--accent); }
.ficha p { color: var(--text-muted); font-size: 15px; line-height: 1.5; }
a.ficha { text-decoration: none; transition: background .2s, padding .2s; }
a.ficha:hover h3 { text-decoration: underline; text-underline-offset: 5px; }
.rows > * { display: grid; grid-template-columns: 96px 1fr 1.3fr; gap: var(--gutter); padding-block: var(--space-6); border-top: 1px solid var(--line); align-items: start; }
.rows > *:last-child { border-bottom: 1px solid var(--line); }
.rows h3 { font-family: var(--font-display); font-weight: 300; font-size: clamp(2rem, 4vw, 3.5rem); letter-spacing: -.03em; line-height: 1; }
.rows .d strong { display: block; font: 600 17px/1.4 var(--font-text); margin-bottom: 6px; }
.rows .d p { color: var(--text-muted); }
@media (max-width: 820px) { .rows > * { grid-template-columns: 1fr; gap: var(--space-3); } }
.checks li { display: flex; gap: 16px; padding-block: 18px; border-top: 1px solid var(--line); }
.checks li::before { content: ""; flex: none; width: 10px; height: 10px; margin-top: 8px; background: var(--accent); }
.checks li strong { display: block; font-weight: 600; }
.checks li span { display: block; color: var(--text-muted); font-size: 15px; }
.checks li:last-child { border-bottom: 1px solid var(--line); }
.pasos { counter-reset: p; }
.paso { border-top: 2px solid var(--line-strong); padding-top: var(--space-5); display: flex; flex-direction: column; gap: var(--space-3); }
.paso .n { font: 300 72px/1 var(--font-display); letter-spacing: -.04em; color: var(--text-muted); }
.paso p { color: var(--text-muted); font-size: 15px; }

/* ——— galerías ——— */
.gal { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gutter); }
.gal.feature > :first-child { grid-column: span 2; grid-row: span 2; }
.gal.feature > :first-child .pic, .gal.feature > :first-child .pic img { height: 100%; }
.gal.feature > :first-child .pic img { aspect-ratio: auto; min-height: 100%; }
.gal.feature figure.piece { height: 100%; }
.gal.feature > :first-child .pic { flex: 1; }
@media (max-width: 820px) { .gal { grid-template-columns: 1fr 1fr; gap: var(--space-4); } .gal.feature > :first-child { grid-column: span 2; grid-row: auto; } .gal.feature > :first-child .pic img { aspect-ratio: 3/2; } }
@media (max-width: 520px) { .gal { grid-template-columns: 1fr; } .gal.feature > :first-child { grid-column: auto; } }

/* ——— proyectos ——— */
.proyecto { padding-block: var(--space-9); border-top: 1px solid var(--line); }
.proyecto:first-of-type { border-top: 0; padding-top: 0; }
.proyecto .meta { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gutter); margin-bottom: var(--space-7); align-items: end; }
.proyecto .meta .actions { justify-content: flex-start; }
@media (max-width: 820px) { .proyecto .meta { grid-template-columns: 1fr; } .proyecto { padding-block: var(--space-8); } }

/* ——— cierre ——— */
.closing { position: relative; overflow: hidden; }
.closing::after { content: ""; position: absolute; right: 0; top: 0; width: 96px; height: 96px; background: linear-gradient(225deg, var(--highlight) 50%, transparent 50%); }
.closing .wrap { display: flex; flex-direction: column; gap: var(--space-6); align-items: flex-start; }
@media (max-width: 640px) { .closing::after { width: 64px; height: 64px; } }

/* ——— FAQ ——— */
.faq details { border-top: 1px solid var(--line); padding-block: 22px; }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; font: 400 clamp(1.25rem, 2vw, 1.625rem)/1.25 var(--font-display); letter-spacing: -.015em; list-style: none; display: flex; justify-content: space-between; gap: 24px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--font-mono); color: var(--accent); }
.faq details[open] summary::after { content: "–"; }
.faq details p { color: var(--text-muted); margin-top: 14px; max-width: 46em; }

/* ——— contacto ——— */
.contact-big { font: 300 clamp(2rem, 6vw, 5.5rem)/1 var(--font-display); letter-spacing: -.035em; text-decoration: none; }
.contact-big:hover { color: var(--accent); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.tags span { font: 500 12px/1 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; padding: 8px 10px; box-shadow: inset 0 0 0 1px var(--line-strong); }

/* ——— aviso ——— */
.legal { max-width: 760px; }
.legal h2 { font: 400 clamp(1.5rem, 2.4vw, 2rem)/1.2 var(--font-display); letter-spacing: -.02em; margin: var(--space-8) 0 var(--space-4); }
.legal p, .legal li { margin-bottom: 14px; }
.legal ul { list-style: square; padding-left: 22px; }
.legal ol { list-style: decimal; padding-left: 24px; }
.legal a { color: var(--accent); }
.legal hr { border: 0; border-top: 1px solid var(--line); margin: var(--space-7) 0; }

/* ——— pie ——— */
.site-footer { padding-block: var(--space-9) var(--space-6); }
.footer-cols { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: var(--gutter); }
.footer-cols .logo img { height: 44px; margin-bottom: var(--space-5); }
.footer-cols p { color: var(--text-muted); max-width: 26em; font-size: 15px; }
.footer-cols h2 { font: 500 13px/1.4 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); margin-bottom: var(--space-4); }
.footer-cols li { margin-bottom: 10px; font-size: 15px; }
.footer-cols a { text-decoration: none; }
.footer-cols a:hover { text-decoration: underline; text-underline-offset: 4px; }
.footer-base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: var(--space-8); padding-top: var(--space-5); border-top: 1px solid var(--line); }
.footer-base a { text-decoration: none; }
@media (max-width: 820px) { .footer-cols { grid-template-columns: 1fr 1fr; } .footer-cols > :first-child { grid-column: 1 / -1; } }
@media (max-width: 520px) { .footer-cols { grid-template-columns: 1fr; } }

/* ——— lightbox ——— */
dialog.lb { border: 0; padding: 0; background: transparent; max-width: 96vw; max-height: 96vh; }
dialog.lb::backdrop { background: rgba(21, 28, 43, .92); }
dialog.lb img { max-width: 96vw; max-height: 88vh; width: auto; height: auto; margin: auto; }
dialog.lb button { position: fixed; top: 16px; right: 16px; background: var(--highlight); color: var(--on-highlight); border: 0; padding: 12px 16px; font: 500 13px/1 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; cursor: pointer; }
dialog.lb p { color: #f6f4ef; font: 500 13px/1.4 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; text-align: center; padding-top: 12px; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
@media print { .site-header, .site-footer, .closing, .trama { display: none; } }

/* galería de 5: imagen principal a todo el ancho y cuatro debajo */
.gal.five { grid-template-columns: repeat(4, 1fr); }
.gal.five > :first-child { grid-column: 1 / -1; grid-row: auto; }
.gal.five > :first-child .pic img { aspect-ratio: 21 / 9; min-height: 0; height: auto; }
@media (max-width: 820px) { .gal.five { grid-template-columns: 1fr 1fr; } .gal.five > :first-child .pic img { aspect-ratio: 3 / 2; } }
@media (max-width: 520px) { .gal.five { grid-template-columns: 1fr; } }
