/* Forja Hidalgo — lime-washed walls, añil indigo, wrought iron, arc spark.
   Signature: the weld bead in stainless heat-tint colours (.bead). */

:root {
  --cal: #F1EFE8;        /* lime-wash wall */
  --cal-deep: #E4E0D4;
  --anil: #23306B;       /* indigo wall paint */
  --anil-deep: #18214D;
  --iron: #22262B;
  --iron-soft: #4A5058;
  --spark: #F0A202;
  --spark-deep: #C98500;
  --wa: #1F9D55;         /* WhatsApp action, darker than brand green for contrast */
  --wa-deep: #177A42;
  --error: #B42318;
  --tint: linear-gradient(90deg, #E9C46A 0%, #C0712F 35%, #6E4A9E 68%, #2F62B0 100%);

  --font-display: "Big Shoulders Display", "Arial Narrow", Impact, sans-serif;
  --font-body: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", sans-serif;

  --step--1: 0.9rem;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: clamp(1.6rem, 1.2rem + 1.6vw, 2.25rem);
  --step-3: clamp(2.1rem, 1.4rem + 3vw, 3.5rem);
  --step-4: clamp(2.8rem, 1.6rem + 5.2vw, 5.6rem);

  --gutter: 16px;
  --nav-h: 68px;
  --radius-s: 6px;
  --radius-m: 12px;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  overflow-x: hidden;           /* on html, never body: keeps the sticky nav working */
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--cal);
  color: var(--iron);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.55;
  padding-bottom: calc(72px + env(safe-area-inset-bottom));  /* room for the phone dock */
}
@media (min-width: 900px) { body { padding-bottom: 0; } }

img, svg { max-width: 100%; }
h1, h2, h3 { margin: 0; line-height: 1.05; }
p { margin: 0; }
a { color: inherit; }

:focus-visible { outline: 3px solid var(--spark); outline-offset: 3px; border-radius: 4px; }

.skip-link {
  position: absolute; left: -9999px; top: 8px; z-index: 2000;
  background: var(--spark); color: var(--iron); padding: 10px 14px; font-weight: 700;
}
.skip-link:focus { left: 8px; }

.wrap { width: min(1180px, 100% - 2 * var(--gutter)); margin-inline: auto; }

section[id] { scroll-margin-top: calc(var(--nav-h) + 16px); }

.icon { width: 1.25em; height: 1.25em; flex: none; }

/* ------------------------------------------------------------- buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  min-height: 48px; padding: .7em 1.2em;
  border: 2px solid transparent; border-radius: var(--radius-s);
  font: 700 var(--step-0)/1.1 var(--font-body);
  text-decoration: none; cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, transform .1s ease;
}
.btn:active { transform: translateY(1px); }
.btn-sm { min-height: 42px; padding: .5em .9em; font-size: var(--step--1); }
.btn-lg { min-height: 56px; padding: .8em 1.4em; font-size: var(--step-1); }
.btn-block { width: 100%; }

.btn-wa { background: var(--wa); color: #fff; }
.btn-wa:hover { background: var(--wa-deep); }
.btn-amber { background: var(--spark); color: var(--iron); }
.btn-amber:hover { background: var(--spark-deep); }
.btn-amber[disabled] { opacity: .6; cursor: progress; }
.btn-ghost { border-color: rgba(241, 239, 232, .55); color: var(--cal); }
.btn-ghost:hover { border-color: var(--cal); background: rgba(241, 239, 232, .08); }
.btn-ghost-dark { border-color: var(--iron); color: var(--iron); background: transparent; }
.btn-ghost-dark:hover { background: var(--iron); color: var(--cal); }

.link-btn {
  background: none; border: 0; padding: 12px 4px; min-height: 44px;
  font: inherit; color: var(--anil); text-decoration: underline; cursor: pointer;
}

/* ------------------------------------------------------------- navbar */

.navbar {
  position: sticky; top: 0; z-index: 1000;
  background: var(--anil);
  color: var(--cal);
  transition: box-shadow .25s ease, background-color .25s ease;
}
.navbar.scrolled { background: var(--anil-deep); box-shadow: 0 8px 24px rgba(10, 14, 36, .35); }

.navbar-inner {
  width: min(1180px, 100% - 2 * var(--gutter)); margin-inline: auto;
  min-height: var(--nav-h);
  display: flex; align-items: center; gap: 12px;
}

.navbar-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; margin-right: auto; }
.navbar-logo {
  width: 46px; height: 46px; flex: none;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .28));
}
.navbar-brand-text { display: flex; flex-direction: column; min-width: 0; }
.navbar-brand-name {
  font-family: var(--font-display); font-weight: 900; font-size: 1.55rem;
  letter-spacing: .01em; line-height: 1;
}
.navbar-brand-tagline { font-size: .8rem; opacity: .8; white-space: nowrap; }

.nav-links { display: none; }
.nav-links a {
  display: flex; align-items: center; min-height: 44px; padding: 0 12px;
  text-decoration: none; font-weight: 700; border-radius: var(--radius-s);
}
.nav-links a:hover { background: rgba(241, 239, 232, .1); }

.nav-actions { display: flex; align-items: center; gap: 8px; }
.nav-wa { display: none; }

.menu-btn {
  width: 44px; height: 44px; display: inline-flex; flex-direction: column; justify-content: center; gap: 5px;
  align-items: center; background: transparent; border: 2px solid rgba(241, 239, 232, .35);
  border-radius: var(--radius-s); cursor: pointer; padding: 0;
}
.menu-btn span { display: block; width: 20px; height: 2px; background: var(--cal); transition: transform .2s ease, opacity .2s ease; }
.menu-btn[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-btn[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Phone menu: a panel under the bar, always inside the viewport */
.nav-links.open {
  display: flex; flex-direction: column;
  position: absolute; left: 0; right: 0; top: 100%;
  background: var(--anil-deep); padding: 8px var(--gutter) 16px;
  box-shadow: 0 14px 24px rgba(10, 14, 36, .35);
}
.nav-links.open a { min-height: 52px; font-size: var(--step-1); border-bottom: 1px solid rgba(241, 239, 232, .1); }

@media (min-width: 900px) {
  .nav-links, .nav-links.open {
    display: flex; flex-direction: row; position: static; padding: 0; background: none; box-shadow: none;
  }
  .nav-links.open a { min-height: 44px; font-size: inherit; border: 0; }
  .menu-btn { display: none; }
  .nav-wa { display: inline-flex; }
}
@media (max-width: 380px) { .navbar-brand-tagline { display: none; } }

/* language selector */
.lang-selector-wrapper { position: relative; }
.lang-selector-btn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 10px;
  background: transparent; color: var(--cal); border: 2px solid rgba(241, 239, 232, .35);
  border-radius: var(--radius-s); font: 700 .95rem var(--font-body); cursor: pointer;
}
.lang-dropdown {
  display: none; position: absolute; right: 0; top: calc(100% + 8px);
  width: min(240px, calc(100vw - 2 * var(--gutter)));
  background: #fff; color: var(--iron); border-radius: var(--radius-m);
  box-shadow: 0 16px 40px rgba(10, 14, 36, .3); overflow: hidden; z-index: 1100;
}
.lang-dropdown.active { display: block; }
.lang-search { padding: 8px; border-bottom: 1px solid var(--cal-deep); }
.lang-search input { width: 100%; min-height: 40px; padding: 0 10px; border: 1px solid var(--cal-deep); border-radius: var(--radius-s); font: inherit; }
.lang-list { list-style: none; margin: 0; padding: 6px; max-height: 50vh; overflow-y: auto; }
.lang-item { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 10px; border-radius: var(--radius-s); cursor: pointer; }
.lang-item:hover, .lang-item.active { background: var(--cal); }
.lang-item.active { font-weight: 700; }
.lang-endonym { margin-left: auto; color: var(--iron-soft); font-size: .9rem; }

/* ------------------------------------------------------------- weld bead */

.bead {
  height: 14px; width: 100%;
  background:
    radial-gradient(circle at 50% 120%, transparent 55%, rgba(34, 38, 43, .55) 56%, transparent 66%) 0 0 / 14px 14px repeat-x,
    var(--tint);
  border-radius: 7px;
  -webkit-mask: radial-gradient(circle at 50% 50%, #000 66%, transparent 68%) 0 0 / 9px 14px repeat-x;
          mask: radial-gradient(circle at 50% 50%, #000 66%, transparent 68%) 0 0 / 9px 14px repeat-x;
}
.hero .bead { width: min(340px, 80%); margin: 22px 0 24px; transform-origin: left; }
@media (prefers-reduced-motion: no-preference) {
  .hero .bead { animation: lay-bead 1.1s cubic-bezier(.6, .1, .2, 1) .25s both; }
}
@keyframes lay-bead { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
.bead-wide { width: min(1180px, 100% - 2 * var(--gutter)); margin: 0 auto; }

/* ------------------------------------------------------------- hero */

.hero {
  background: var(--anil);
  color: var(--cal);
  padding: 40px 0 56px;
  position: relative;
}
.hero-inner {
  width: min(1180px, 100% - 2 * var(--gutter)); margin-inline: auto;
  display: grid; gap: 32px; align-items: center;
}
.hero-place { font-size: var(--step--1); opacity: .85; margin-bottom: 14px; max-width: 36ch; }
.hero-title {
  font-family: var(--font-display); font-weight: 900;
  font-size: var(--step-4); line-height: .92; letter-spacing: -.005em;
  max-width: 12ch; text-wrap: balance;
}
.hero-lede { font-size: var(--step-1); max-width: 40ch; opacity: .95; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 18px; }
.hero-ctas .btn { flex: 1 1 220px; }
.hero-hours { font-size: var(--step--1); opacity: .8; }
.hero-art {
  margin: 0; position: relative; overflow: hidden;
  border: 1px solid rgba(241, 239, 232, .24);
  border-radius: 4px 4px 28px 4px;
  box-shadow: 18px 20px 0 rgba(10, 14, 36, .32), 0 24px 56px rgba(10, 14, 36, .42);
}
.hero-art::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(135deg, rgba(35, 48, 107, .08), transparent 48%, rgba(240, 162, 2, .08));
}
.hero-art img { width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; display: block; }

@media (max-width: 899px) {
  .hero-art { width: min(100%, 560px); justify-self: center; box-shadow: 10px 12px 0 rgba(10, 14, 36, .3); }
}
@media (min-width: 900px) {
  .hero { padding: 72px 0 88px; }
  .hero-inner { grid-template-columns: 1.15fr .85fr; gap: 56px; }
  .hero-ctas .btn { flex: 0 0 auto; }
}

/* ------------------------------------------------------------- sections */

.section { padding: 64px 0; }
.section-title {
  font-family: var(--font-display); font-weight: 800;
  font-size: var(--step-3); line-height: .98; max-width: 18ch; text-wrap: balance;
}
.section-lede { margin-top: 14px; font-size: var(--step-1); max-width: 52ch; color: var(--iron-soft); }

@media (min-width: 900px) { .section { padding: 96px 0; } }

/* services: a ledger of trades, not identical cards */
.services {
  list-style: none; margin: 40px 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  border-top: 2px solid var(--iron);
}
.service {
  display: grid; grid-template-columns: 52px 1fr; column-gap: 16px; row-gap: 6px;
  padding: 24px 4px; border-bottom: 1px solid var(--cal-deep);
}
.service-icon { grid-row: span 2; width: 48px; height: 48px; color: var(--anil); }
.service h3 { font-family: var(--font-display); font-weight: 800; font-size: 1.6rem; line-height: 1; }
.service p { color: var(--iron-soft); max-width: 46ch; }
@media (min-width: 700px) { .service { padding: 28px 20px 28px 4px; } }

/* approach: the dark iron band; the sequence really is a sequence */
.section-iron { background: var(--iron); color: var(--cal); }
.section-iron .section-lede { color: #C4C8CD; }
.approach { display: grid; gap: 40px; }
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; display: grid; gap: 4px; }
.steps li {
  counter-increment: step; position: relative;
  padding: 20px 0 20px 64px; border-top: 1px solid rgba(241, 239, 232, .14);
}
.steps li::before {
  content: counter(step);
  position: absolute; left: 0; top: 16px;
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  font: 900 1.5rem/1 var(--font-display); color: var(--iron);
  background: var(--spark);
}
.steps h3 { font-family: var(--font-display); font-weight: 800; font-size: 1.7rem; margin-bottom: 6px; }
.steps p { color: #C4C8CD; max-width: 50ch; }
@media (min-width: 1000px) {
  .approach { grid-template-columns: .9fr 1.1fr; gap: 72px; align-items: start; }
  .approach-intro { position: sticky; top: calc(var(--nav-h) + 32px); }
}

/* work */
.demo-note {
  display: inline-block; margin-top: 18px; padding: 6px 12px;
  background: #FFF4CC; border-left: 4px solid var(--spark); font-size: var(--step--1);
}
.projects {
  margin-top: 32px; display: grid; gap: 28px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr));
}
.project {
  background: #fff; border-radius: var(--radius-m); overflow: hidden;
  border: 1px solid var(--cal-deep); box-shadow: 0 10px 28px rgba(34, 38, 43, .09);
}
.project img {
  display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover;
  background: var(--anil); filter: saturate(.88) contrast(1.04);
  transition: transform .45s ease, filter .45s ease;
}
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .project:hover img { transform: scale(1.025); filter: saturate(1) contrast(1.06); }
}
.project-body { padding: 18px 20px 22px; }
.project-tag { font-size: var(--step--1); font-weight: 700; color: var(--anil); margin-bottom: 4px; }
.project h3 { font-family: var(--font-display); font-weight: 800; font-size: 1.55rem; margin-bottom: 8px; }
.project p:last-child { color: var(--iron-soft); }
/* the first project leads on wide screens */
@media (min-width: 1000px) {
  .projects { grid-template-columns: repeat(3, 1fr); }
  .project:first-child { grid-column: span 2; grid-row: span 2; display: flex; flex-direction: column; }
  .project:first-child img { flex: 1; min-height: 0; object-fit: cover; aspect-ratio: auto; }
  .project:first-child .project-body { padding: 24px 28px 28px; }
  .project:first-child h3 { font-size: 2.1rem; }
}

/* community */
.section-wall { background: var(--cal-deep); }
.community { display: grid; gap: 36px; }
.community-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.community-list li { padding-left: 28px; position: relative; max-width: 56ch; }
.community-list li::before {
  content: ""; position: absolute; left: 0; top: .45em; width: 14px; height: 14px; border-radius: 50%;
  background: var(--tint);
}
.quotes { display: grid; gap: 20px; }
.quotes blockquote { margin: 0; padding: 22px 24px; background: var(--cal); border-radius: var(--radius-m); border-left: 6px solid var(--anil); }
.quotes p { font-size: var(--step-1); }
.quotes footer { margin-top: 10px; color: var(--iron-soft); font-size: var(--step--1); }
@media (min-width: 1000px) {
  .community { grid-template-columns: 1fr 1fr; column-gap: 72px; }
  .quotes { grid-column: 1 / -1; grid-template-columns: 1fr 1fr; }
}

/* ------------------------------------------------------------- contact */

.contact { display: grid; gap: 40px; }
.visit { margin-top: 32px; padding: 22px; border: 2px solid var(--iron); border-radius: var(--radius-m); }
.visit h3 { font-family: var(--font-display); font-weight: 800; font-size: 1.6rem; margin-bottom: 8px; }
.visit p + p { margin-top: 6px; color: var(--iron-soft); }
.visit-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }

@media (min-width: 1000px) {
  .contact { grid-template-columns: .85fr 1.15fr; gap: 72px; align-items: start; }
  .contact-intro { position: sticky; top: calc(var(--nav-h) + 32px); }
}

.quote-form, .sent {
  background: #fff; border-radius: var(--radius-m); padding: 22px var(--gutter) 26px;
  border: 1px solid var(--cal-deep); box-shadow: 0 2px 0 var(--cal-deep);
}
@media (min-width: 600px) { .quote-form, .sent { padding: 32px; } }

.field { margin: 0 0 20px; padding: 0; border: 0; min-width: 0; }
.field > label, .field > legend { display: block; font-weight: 700; margin-bottom: 8px; padding: 0; }
.optional { font-weight: 400; color: var(--iron-soft); }
.field input[type="text"], .field input[type="tel"], .field input[type="email"], .field textarea {
  width: 100%; min-height: 52px; padding: 12px 14px;
  border: 2px solid #C9C5B8; border-radius: var(--radius-s); background: #fff;
  font: 1.0625rem/1.4 var(--font-body); color: var(--iron);   /* ≥16px stops iOS zoom */
}
.field textarea { min-height: 130px; resize: vertical; }
.field input:focus, .field textarea:focus { border-color: var(--anil); outline: none; box-shadow: 0 0 0 3px rgba(35, 48, 107, .2); }
.field.invalid input, .field.invalid textarea { border-color: var(--error); }
.field-error { color: var(--error); font-size: var(--step--1); margin-top: 6px; min-height: 0; }
.field-error:empty { display: none; }

.check { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 6px 12px; border: 2px solid var(--cal-deep); border-radius: var(--radius-s); cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--anil); flex: none; margin: 0; }
.check:has(input:checked) { border-color: var(--anil); background: #EEF0F8; }
.check-inline { border: 0; padding: 0; margin: -6px 0 18px; }
.check-inline:has(input:checked) { background: none; }
.check-grid { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); }

.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg label { flex: 1 1 120px; margin: 0; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg span {
  display: flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 12px;
  border: 2px solid var(--cal-deep); border-radius: var(--radius-s); font-weight: 700; cursor: pointer; text-align: center;
}
.seg input:checked + span { border-color: var(--anil); background: var(--anil); color: #fff; }
.seg input:focus-visible + span { outline: 3px solid var(--spark); outline-offset: 2px; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

#captcha:not(:empty) { margin-bottom: 16px; }
.form-status { margin-bottom: 14px; font-weight: 700; }
.form-status:empty { display: none; }
.form-status.error { color: var(--error); }
.form-fine { margin-top: 12px; font-size: var(--step--1); color: var(--iron-soft); text-align: center; }

.sent { text-align: center; }
.sent:focus { outline: none; }
.sent-icon { width: 64px; height: 64px; color: #fff; background: var(--wa); border-radius: 50%; padding: 14px; }
.sent h3 { font-family: var(--font-display); font-weight: 800; font-size: var(--step-2); margin: 14px 0 10px; }
.sent p { color: var(--iron-soft); max-width: 42ch; margin: 0 auto 22px; }

/* ------------------------------------------------------------- footer + dock */

.footer { background: var(--anil-deep); color: var(--cal); padding: 40px 0; }
.footer-inner { display: grid; gap: 10px; }
.footer-brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font: 900 1.5rem var(--font-display); min-height: 44px; }
.footer-small { font-size: var(--step--1); opacity: .75; }

.dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 900;
  display: grid; grid-template-columns: 1fr 1.4fr; gap: 8px;
  padding: 8px var(--gutter) calc(8px + env(safe-area-inset-bottom));
  background: rgba(24, 33, 77, .96);
  box-shadow: 0 -6px 18px rgba(10, 14, 36, .25);
}
.dock-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px;
  border-radius: var(--radius-s); font-weight: 700; font-size: var(--step-1); text-decoration: none;
}
.dock-call { background: var(--cal); color: var(--iron); }
.dock-wa { background: var(--wa); color: #fff; }
@media (min-width: 900px) { .dock { display: none; } }
