/* =========================================================================
   Barrios Building Solutions Corp — styles
   Sections: reset+tokens → type → buttons → nav → hero → sheet (svg) →
   sections → cards → steps → spec list → about → contact/forms → footer →
   reveals → responsive
   ========================================================================= */

/* ---------- reset + tokens ---------- */
@font-face {
  font-family: 'Archivo';
  src: url('fonts/Archivo-var.woff2') format('woff2');
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('fonts/IBMPlexMono-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('fonts/IBMPlexMono-500.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #ffffff;
  --bg-2: #f3f6fb;
  --surface: #ffffff;
  --surface-2: #f7f9fc;
  --ink: #0b1a3a;
  --ink-dim: #5b6474;
  --accent: #002860;
  --accent-hi: #0a46d2;
  --accent-deep: #001a44;
  --accent-grad: linear-gradient(135deg, #0a46d2, #002860);
  --draft: #a9c3e6;
  --hairline: #d5deea;
  --hairline-soft: #e8edf4;
  --on-accent: #ffffff;
  --on-accent-dim: #b8c6e0;

  --display: 'Archivo', 'Helvetica Neue', Arial, sans-serif;
  --body: 'Archivo', 'Helvetica Neue', Arial, sans-serif;
  --mono: 'IBM Plex Mono', 'SFMono-Regular', Menlo, Consolas, monospace;

  --pad: clamp(1rem, 4vw, 2.5rem);
  --max: 1160px;
  --radius: 4px;
  --nav-h: 76px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: var(--accent-hi); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 3px; }
.wrap { width: min(var(--max), 100% - 2 * var(--pad)); margin-inline: auto; }
.skip {
  position: absolute; left: -999px; top: 8px; z-index: 100;
  background: var(--accent); color: var(--on-accent); padding: .5rem .75rem; border-radius: var(--radius);
}
.skip:focus { left: 8px; }

/* ---------- type ---------- */
h1, h2, h3 { font-family: var(--display); color: var(--accent); margin: 0; }
h1 {
  font-size: clamp(2.3rem, 4.6vw, 3.6rem);
  font-weight: 700; font-stretch: 112%;
  line-height: 1.04; letter-spacing: -0.015em;
}
h2 {
  font-size: clamp(1.65rem, 3vw, 2.35rem);
  font-weight: 700; font-stretch: 110%;
  line-height: 1.12; letter-spacing: -0.01em;
  max-width: 22ch;
}
h3 { font-size: 1.15rem; font-weight: 600; font-stretch: 105%; line-height: 1.3; }
p { margin: 0; }
.lead { font-size: 1.15rem; line-height: 1.55; color: var(--ink); }
.eyebrow {
  font-family: var(--mono); font-size: .75rem; font-weight: 500;
  letter-spacing: .16em; text-transform: uppercase; color: var(--accent-hi);
  display: flex; align-items: center; gap: .75rem; margin-bottom: 1rem;
}
.eyebrow .idx { color: var(--ink-dim); }
.eyebrow-hero { display: block; }
.eyebrow-hero span { white-space: nowrap; }
.eyebrow .idx::after { content: '—'; margin-left: .75rem; }
.sec-head .eyebrow::after {
  content: ''; flex: 1; height: 1px; background: var(--hairline);
  margin-left: .5rem;
}
.sec-head .lead { color: var(--ink-dim); margin-top: 1rem; max-width: 56ch; }
.sec-head { margin-bottom: clamp(2rem, 4vw, 3.25rem); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font-family: var(--body); font-weight: 600; font-size: .95rem; letter-spacing: .01em;
  padding: .85rem 1.4rem; border-radius: var(--radius); border: 1px solid transparent;
  cursor: pointer; text-decoration: none; transition: background .18s, border-color .18s, color .18s;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hi); }
.btn-ghost { border-color: var(--hairline); color: var(--accent); background: var(--surface); }
.btn-ghost:hover { border-color: var(--accent-hi); color: var(--accent-hi); }
.btn-sm { padding: .6rem 1rem; font-size: .875rem; }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: var(--bg); border-bottom: 1px solid var(--hairline-soft);
  transition: box-shadow .2s;
}
.nav.scrolled { box-shadow: 0 1px 0 var(--hairline), 0 8px 24px -16px rgba(0, 40, 96, .25); }
.nav-in { display: flex; align-items: center; justify-content: space-between; height: var(--nav-h); gap: 1rem; }
.brand img { height: 52px; width: auto; }
.nav-links { display: flex; align-items: center; gap: 1.75rem; }
.nav-links a:not(.btn) {
  color: var(--ink); font-weight: 500; font-size: .95rem; position: relative;
}
.nav-links a:not(.btn):hover { color: var(--accent-hi); text-decoration: none; }
.nav-links a:not(.btn)::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -6px; height: 2px;
  background: var(--accent-hi); transform: scaleX(0); transform-origin: left; transition: transform .2s;
}
.nav-links a:not(.btn):hover::after { transform: scaleX(1); }
.nav-cta { margin-left: .5rem; }
.nav-phone {
  font-family: var(--mono) !important; font-size: .82rem !important; font-weight: 500 !important; letter-spacing: .04em;
  color: var(--accent) !important; white-space: nowrap;
}
.lang {
  font-family: var(--mono) !important; font-size: .78rem !important; font-weight: 500 !important; letter-spacing: .12em;
  border: 1px solid var(--hairline); border-radius: var(--radius); padding: .35rem .55rem; color: var(--accent) !important;
}
.lang:hover { border-color: var(--accent-hi); }
.nav-links .lang::after { display: none; }
.footer-links .lang { border-color: rgba(255, 255, 255, .3); color: var(--on-accent) !important; }
.nav-burger {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  width: 44px; height: 44px; padding: 10px; background: none; border: 1px solid var(--hairline);
  border-radius: var(--radius); cursor: pointer;
}
.nav-burger span { display: block; height: 2px; background: var(--accent); transition: transform .2s, opacity .2s; }
.nav.open .nav-burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav.open .nav-burger span:nth-child(2) { opacity: 0; }
.nav.open .nav-burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- hero ---------- */
.hero {
  position: relative; overflow: hidden;
  padding: clamp(3rem, 7vw, 6rem) 0 clamp(3rem, 6vw, 5rem);
  background:
    linear-gradient(to right, var(--bg) 0 46%, transparent 70%),
    repeating-linear-gradient(0deg, var(--hairline-soft) 0 1px, transparent 1px 32px),
    repeating-linear-gradient(90deg, var(--hairline-soft) 0 1px, transparent 1px 32px),
    var(--bg);
}
.hero::after { /* one accent rule at the bottom of the hero */
  content: ''; position: absolute; left: 0; bottom: 0; height: 3px; width: 100%;
  background: var(--accent-grad);
}
.hero-in {
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4.5rem); align-items: center;
}
.hero-copy h1 { margin-bottom: 1.25rem; }
.hero-copy .lead { color: var(--ink-dim); max-width: 52ch; }
.cta-row { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }
.hero-spec {
  display: grid; grid-template-columns: repeat(3, auto); gap: 1.5rem 2.5rem;
  margin: 2.75rem 0 0; padding-top: 1.5rem; border-top: 1px solid var(--hairline);
  justify-content: start;
}
.hero-spec dt {
  font-family: var(--mono); font-size: .7rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-dim); margin-bottom: .25rem;
}
.hero-spec dd { margin: 0; font-weight: 500; font-size: .95rem; color: var(--ink); }

/* ---------- sheet (hero svg) ---------- */
.sheet {
  margin: 0; background: var(--surface);
  border: 1px solid var(--hairline);
  box-shadow: 0 30px 60px -30px rgba(0, 40, 96, .35), 0 2px 0 var(--hairline-soft);
  position: relative;
}
.sheet::before, .sheet::after { /* registration ticks on the paper corners */
  content: ''; position: absolute; width: 14px; height: 14px; pointer-events: none;
  border-color: var(--accent-hi); border-style: solid; border-width: 0;
}
.sheet::before { top: -7px; left: -7px; border-top-width: 1px; border-left-width: 1px; }
.sheet::after { bottom: -7px; right: -7px; border-bottom-width: 1px; border-right-width: 1px; }
.sheet svg { width: 100%; height: auto; font-family: var(--mono); }
.s-grid { fill: none; stroke: var(--hairline-soft); stroke-width: 1; }
.s-frame { fill: none; stroke: var(--hairline); stroke-width: 1; }
.s-ink { fill: none; stroke: var(--accent); stroke-width: 1.5; stroke-linecap: square; stroke-linejoin: miter; }
.s-floor { fill: none; stroke: var(--hairline); stroke-width: 1; }
.s-hatch { fill: none; stroke: var(--draft); stroke-width: 1; }
.s-draft { fill: none; stroke: var(--draft); stroke-width: 1; stroke-dasharray: 4 4; }
.s-tick { fill: none; stroke: var(--accent-hi); stroke-width: 1; }
.s-win rect { fill: var(--bg-2); stroke: var(--accent); stroke-width: 1; }
.s-dim { fill: none; stroke: var(--accent-hi); stroke-width: 1; }
.s-label { font-size: 9.5px; fill: var(--accent-hi); font-weight: 500; letter-spacing: .04em; }
.s-label-ink { fill: var(--accent); }
.s-xs { font-size: 7px; }
.s-tb-name { font-size: 8.5px; fill: var(--accent); font-weight: 500; letter-spacing: .04em; }
.s-tb-dim { font-size: 7px; fill: var(--ink-dim); letter-spacing: .08em; }
.s-tb-sheet { font-family: var(--display); font-size: 30px; font-weight: 700; font-stretch: 115%; fill: var(--accent); letter-spacing: -.01em; }

/* draw-on animation (JS present, motion allowed) */
.js .sheet .d { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.1s cubic-bezier(.4, 0, .2, 1) forwards; animation-delay: calc(.12s * var(--i, 0)); }
.js .sheet .s-draft .d { stroke-dasharray: 1; }
.js .sheet .s-win rect { opacity: 0; animation: fadein .5s ease forwards; }
.js .sheet .w1 rect { animation-delay: .8s; }
.js .sheet .w2 rect { animation-delay: 1s; }
.js .sheet .w3 rect { animation-delay: 1.1s; }
.js .sheet .s-label, .js .sheet .s-tb { opacity: 0; animation: fadein .6s ease 1.1s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fadein { to { opacity: 1; } }
/* dashed construction lines: dash pattern in userspace after the draw finishes */
.js .sheet .s-draft .d { animation-name: draw-dash; }
@keyframes draw-dash { 0% { stroke-dashoffset: 1; stroke-dasharray: 1; } 99% { stroke-dashoffset: 0; stroke-dasharray: 1; } 100% { stroke-dashoffset: 0; stroke-dasharray: 4 4; } }
@media (prefers-reduced-motion: reduce) {
  .js .sheet .d, .js .sheet .s-win rect, .js .sheet .s-label, .js .sheet .s-tb { animation: none; opacity: 1; stroke-dashoffset: 0; }
  .js .sheet .s-draft .d { stroke-dasharray: 4 4; }
  html { scroll-behavior: auto; }
}

/* ---------- sections ---------- */
.section { padding: clamp(4rem, 8vw, 7rem) 0; scroll-margin-top: var(--nav-h); }
.section-alt { background: var(--bg-2); border-top: 1px solid var(--hairline-soft); border-bottom: 1px solid var(--hairline-soft); }
.split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(2rem, 5vw, 5rem); align-items: start; }
.split .sec-head { margin-bottom: 0; }

/* ---------- cards ---------- */
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
.card {
  position: relative; background: var(--surface); border: 1px solid var(--hairline);
  border-radius: var(--radius); padding: 1.75rem 1.5rem 1.6rem;
  transition: border-color .2s, transform .2s;
}
.card:hover { border-color: var(--accent-hi); transform: translateY(-2px); }
.card::before { /* corner tick, like the logo's construction marks */
  content: ''; position: absolute; top: 10px; right: 10px; width: 10px; height: 10px;
  border-top: 1px solid var(--draft); border-right: 1px solid var(--draft);
}
.card-idx {
  position: absolute; top: 12px; left: 16px;
  font-family: var(--mono); font-size: .68rem; letter-spacing: .12em; color: var(--ink-dim);
}
.icon { width: 40px; height: 40px; margin: 1rem 0 1.1rem; fill: none; stroke: var(--accent); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.icon .hi { stroke: var(--accent-hi); }
.card h3 { margin-bottom: .6rem; }
.card p { color: var(--ink-dim); font-size: .98rem; line-height: 1.6; }

/* ---------- steps (process) ---------- */
.steps {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2rem;
  position: relative;
}
.steps::before { /* the dimension line the steps hang from */
  content: ''; position: absolute; left: 0; right: 0; top: 24px; height: 1px; background: var(--hairline);
}
.step { position: relative; padding-top: 3.5rem; }
.step::before { /* tick on the dimension line */
  content: ''; position: absolute; left: 0; top: 18px; width: 1px; height: 13px; background: var(--accent-hi);
}
.step-n {
  position: absolute; top: 6px; left: 12px;
  font-family: var(--mono); font-size: .78rem; font-weight: 500; letter-spacing: .12em; color: var(--accent-hi);
  background: var(--bg-2); padding: 0 .4rem;
}
.step h3 { margin-bottom: .6rem; }
.step p { color: var(--ink-dim); font-size: .98rem; }

/* ---------- spec list (projects) ---------- */
.spec-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--hairline); }
.spec-list li {
  display: grid; grid-template-columns: 140px 1fr; gap: 1.5rem; align-items: baseline;
  padding: 1.15rem 0; border-bottom: 1px solid var(--hairline);
}
.spec-k { font-family: var(--mono); font-size: .74rem; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--accent-hi); }
.spec-v { color: var(--ink); }

/* ---------- about ---------- */
.facts {
  margin: 2rem 0 0; border: 1px solid var(--hairline); border-radius: var(--radius); background: var(--surface);
  position: relative;
}
.facts::before { content: ''; position: absolute; top: 8px; right: 8px; width: 10px; height: 10px; border-top: 1px solid var(--draft); border-right: 1px solid var(--draft); }
.facts > div { display: grid; grid-template-columns: 8.5rem 1fr; gap: 1rem; padding: .7rem 1rem; border-top: 1px solid var(--hairline-soft); align-items: baseline; }
.facts > div:first-child { border-top: 0; }
.facts dt { font-family: var(--mono); font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-dim); }
.facts dd { margin: 0; font-size: .95rem; font-weight: 500; color: var(--ink); }
.facts dd a { color: var(--accent); }
.facts dd a:hover { color: var(--accent-hi); }
.about-copy > p + p { margin-top: 1.1rem; color: var(--ink-dim); }
.values { list-style: none; padding: 0; margin: 1.75rem 0 0; display: grid; gap: .9rem; }
.values li { position: relative; padding-left: 1.4rem; color: var(--ink-dim); }
.values li::before { content: ''; position: absolute; left: 0; top: .62em; width: .7rem; height: 1px; background: var(--accent-hi); }
.values strong { color: var(--accent); font-weight: 600; }

/* ---------- contact / forms ---------- */
.contact-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.form { display: grid; gap: 1.1rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
.field { display: grid; gap: .4rem; }
.field > span { font-family: var(--mono); font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-dim); }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--hairline); border-radius: var(--radius); padding: .75rem .85rem;
  transition: border-color .15s, box-shadow .15s;
}
.field textarea { resize: vertical; min-height: 130px; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--accent-hi); box-shadow: 0 0 0 3px rgba(10, 70, 210, .14);
}
.field input::placeholder, .field textarea::placeholder { color: var(--ink-dim); opacity: .75; }
.form .btn { justify-self: start; margin-top: .25rem; }
.form-note { font-size: .85rem; color: var(--ink-dim); }
.contact-side { display: grid; gap: 1.4rem; padding: 1.75rem 1.5rem; background: var(--bg-2); border: 1px solid var(--hairline-soft); border-radius: var(--radius); }
.contact-block .k { display: block; font-family: var(--mono); font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-dim); margin-bottom: .3rem; }
.contact-block a { font-weight: 500; color: var(--accent); word-break: break-word; }
.contact-block a:hover { color: var(--accent-hi); }
.contact-block p { color: var(--ink); }

/* ---------- footer ---------- */
.footer { background: var(--accent); color: var(--on-accent-dim); padding: 3.5rem 0 2.5rem; }
.footer-in { display: grid; grid-template-columns: 1fr auto; gap: 2rem 3rem; align-items: start; }
.footer-brand { display: grid; gap: .15rem; }
.wordmark { font-family: var(--display); font-weight: 800; font-stretch: 125%; font-size: 1.75rem; letter-spacing: .02em; color: var(--on-accent); line-height: 1; }
.wordmark-sub { font-family: var(--mono); font-size: .72rem; letter-spacing: .2em; text-transform: uppercase; color: var(--on-accent-dim); }
.footer-links { display: flex; flex-wrap: wrap; gap: 1.5rem; padding-top: .4rem; }
.footer-links a { color: var(--on-accent); font-size: .9rem; font-weight: 500; }
.footer-fine a { color: var(--on-accent); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(255, 255, 255, .4); }
.footer-fine { grid-column: 1 / -1; font-size: .82rem; line-height: 1.7; border-top: 1px solid rgba(255, 255, 255, .14); padding-top: 1.5rem; margin-top: .5rem; color: var(--on-accent-dim); }

/* ---------- reveals ---------- */
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .js .reveal { opacity: 1; transform: none; transition: none; } }

/* ---------- responsive ---------- */
@media (max-width: 1200px) {
  .nav-phone { display: none; }
}
@media (max-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2.5rem 2rem; }
  .steps::before { display: none; }
  .step { padding-top: 0; padding-left: 1rem; border-left: 1px solid var(--hairline); }
  .step::before { display: none; }
  .step-n { position: static; display: block; padding: 0; margin-bottom: .6rem; background: none; }
}
@media (max-width: 900px) {
  .hero-in { grid-template-columns: 1fr; }
  .hero { background: var(--bg); }
  .sheet { max-width: 640px; }
  .sheet::before, .sheet::after { display: none; }
  .split, .contact-grid { grid-template-columns: 1fr; }
  .split .sec-head { margin-bottom: 1.5rem; }
  .facts { max-width: 520px; }
  h2 { max-width: none; }
}
@media (max-width: 980px) {
  .nav-burger { display: flex; }
  .nav-phone { display: block; }
  .nav-links {
    display: none; position: absolute; left: 0; right: 0; top: var(--nav-h);
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--hairline); padding: .5rem var(--pad) 1rem;
  }
  .nav.open .nav-links { display: flex; }
  .nav-links a:not(.btn) { padding: .85rem 0; border-bottom: 1px solid var(--hairline-soft); font-size: 1rem; }
  .nav-links a:not(.btn)::after { display: none; }
  .nav-links .lang { justify-self: start; margin-top: 1rem; border-bottom: 1px solid var(--hairline) !important; padding: .35rem .55rem !important; align-self: flex-start; }
  .nav-cta { margin: 1rem 0 0; }
  .nav-phone { padding: .85rem 0 0; font-size: 1rem !important; }
}
@media (max-width: 760px) {
  :root { --nav-h: 64px; }
  .brand img { height: 42px; }
  .hero-spec { grid-template-columns: 1fr 1fr; gap: 1.25rem 1.5rem; }
  .grid-3 { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .spec-list li { grid-template-columns: 1fr; gap: .3rem; }
  .field-row { grid-template-columns: 1fr; }
  .footer-in { grid-template-columns: 1fr; }
  .cta-row .btn { flex: 1 1 auto; }
}
