:root {
  --lime: #F3EEE5;
  --lime-2: #E9E0D0;
  --ink: #17130F;
  --ink-2: #241D17;
  --soft: #4A3F35;
  --soft-d: #C4B9A8;
  --amber: #FCB109;
  --earth: #9C3E1C;
  --line: #D6CBB9;
  --line-d: #3A3027;
  --f: "Archivo", "Arial Narrow", system-ui, sans-serif;
  --gut: clamp(1rem, 0.4rem + 2.6vw, 3rem);
  --edge: max(var(--gut), calc((100vw - var(--max)) / 2 + var(--gut)));
  --max: 1440px;
  --s-sec: clamp(5rem, 3rem + 8vw, 12rem);
  --step-0: clamp(1rem, 0.95rem + 0.2vw, 1.125rem);
  --step-1: clamp(1.15rem, 1rem + 0.6vw, 1.5rem);
  --step-2: clamp(1.4rem, 1.1rem + 1.2vw, 2.2rem);
  --step-3: clamp(2rem, 1.4rem + 2.6vw, 4rem);
  --ease: cubic-bezier(.625, .05, 0, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 6rem; }
body {
  margin: 0; background: var(--lime); color: var(--ink);
  font-family: var(--f); font-size: var(--step-0); line-height: 1.6;
  font-variation-settings: "wdth" 100;
  overflow-x: clip;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, p, figure, blockquote, dl, dd, ol, ul { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; border-radius: 2px; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 1rem; top: -4rem; z-index: 100; background: var(--ink); color: var(--lime); padding: .6rem 1rem; }
.skip:focus { top: 1rem; }
.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gut); }

.h-sec {
  font-size: var(--step-3); font-weight: 800; line-height: 1.02;
  font-variation-settings: "wdth" 112; letter-spacing: -0.02em;
  padding-bottom: clamp(1rem, 2vw, 1.75rem); border-bottom: 1px solid var(--line);
  text-wrap: balance;
}
.tag { display: flex; align-items: center; gap: .6rem; font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 600; }
.sq { width: .55rem; height: .55rem; background: var(--amber); outline: 1px solid var(--ink); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 3rem;
  padding: .75rem 1.4rem; border-radius: 999px; font-weight: 700; text-decoration: none;
  font-variation-settings: "wdth" 106; letter-spacing: .01em; border: 2px solid transparent; cursor: pointer;
  transition: transform .4s var(--ease), background-color .3s, color .3s;
}
.btn:hover { transform: translateY(-2px); }
.btn--amber { background: var(--amber); color: var(--ink); }
.btn--amber:hover { background: #FFC23A; }
.btn--line { border-color: currentColor; }
.btn--line:hover { background: var(--ink); color: var(--lime); }

/* ---------- Header pill ---------- */
.pill {
  position: fixed; z-index: 50; top: 14px; left: 50%; transform: translateX(-50%);
  width: min(600px, calc(100% - 2 * var(--gut)));
  display: flex; align-items: center; gap: .5rem; padding: 6px 6px 6px 14px;
  background: rgba(243, 238, 229, .94); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-radius: 14px; box-shadow: 0 8px 30px rgba(23, 19, 15, .14);
}
.pill__logo img { width: 104px; height: auto; }
.pill__menu {
  margin-left: auto; display: inline-flex; align-items: center; gap: .7rem; min-height: 44px;
  background: none; border: 0; padding: 0 .8rem; cursor: pointer; font-weight: 600;
}
.pill__bars { display: grid; gap: 5px; width: 26px; }
.pill__bars i { display: block; height: 2px; background: var(--ink); transition: transform .4s var(--ease); }
.pill__menu[aria-expanded="true"] .pill__bars i:first-child { transform: translateY(3.5px) rotate(12deg); }
.pill__menu[aria-expanded="true"] .pill__bars i:last-child { transform: translateY(-3.5px) rotate(-12deg); }
.pill__call {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 1rem; border-radius: 10px;
  background: var(--ink); color: var(--lime); text-decoration: none; font-weight: 700; white-space: nowrap;
  font-variation-settings: "wdth" 100;
}
.pill__call:hover { background: var(--earth); }
.pill__call .hide-s { margin-right: .3em; }
.menu {
  position: absolute; left: 0; right: 0; top: calc(100% + 8px);
  background: var(--ink); color: var(--lime); border-radius: 14px; padding: 1rem 1.4rem 1.4rem;
}
.menu li a {
  display: block; padding: .9rem 0; border-bottom: 1px solid var(--line-d); text-decoration: none;
  font-size: var(--step-2); font-weight: 700; font-variation-settings: "wdth" 110;
}
.menu li a:hover { color: var(--amber); }
.menu__contact { display: grid; gap: .3rem; margin-top: 1.1rem; font-size: .95rem; }
.menu__contact a { text-decoration: none; color: var(--soft-d); }
.menu__contact a:hover { color: var(--amber); }

/* ---------- Hero (static flow by default: phones, reduced motion, no JS) ---------- */
.hero { position: relative; }
.hero__stage { position: relative; padding: 5.6rem var(--gut) 0; }
.hero__mark {
  font-size: 23.5vw; line-height: .8; font-weight: 900; letter-spacing: -0.045em;
  font-variation-settings: "wdth" 112; text-align: center; margin-inline: -0.5vw;
  white-space: nowrap;
}
.hero__label { font-size: .78rem; letter-spacing: .16em; text-transform: uppercase; font-weight: 600; }
.hero__label--l { margin-top: 1rem; float: left; }
.hero__label--r { margin-top: 1rem; float: right; }
.hero__title {
  clear: both; padding-top: 2.4rem; font-size: clamp(3rem, 1.6rem + 6vw, 7rem); line-height: .92;
  font-weight: 800; font-variation-settings: "wdth" 108; letter-spacing: -0.03em;
}
.hero__w { display: block; }
.hero__w--r { color: var(--earth); }
.hero__window { position: relative; margin-top: 1.8rem; aspect-ratio: 4 / 5; overflow: hidden; border-radius: 6px; background: var(--earth); }
.hero__slides, .hero__slides img { position: absolute; inset: 0; }
.hero__slides img { width: 100%; height: 100%; object-fit: cover; opacity: 0; }
.hero__slides img.is-on { opacity: 1; }
.hero__scrim { position: absolute; inset: auto 0 0 0; height: 45%; background: linear-gradient(to top, rgba(23,19,15,.75), rgba(23,19,15,0)); opacity: 0; }
.hero__foot { display: grid; gap: 1.2rem; padding: 1.6rem 0 0; max-width: 40rem; }
.hero__foot p { font-size: var(--step-1); line-height: 1.45; }
.hero__foot .btn { justify-self: start; }

@media (prefers-reduced-motion: no-preference) {
  .hero__slides img { transition: opacity 1.6s ease; }
  .hero__slides img.is-on { animation: drift 9s linear both; }
  @keyframes drift { from { transform: scale(1.06) translate3d(-1.2%, 0, 0); } to { transform: scale(1.01) translate3d(1.2%, 0, 0); } }
}
@media (min-width: 700px) {
  .hero__window { aspect-ratio: 16 / 9; }
}

/* Pinned hero on wide screens (set by main.js when motion is allowed) */
.is-pin .hero { height: 260vh; }
.is-pin .hero__stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; padding: 0; }
.is-pin .hero__mark { position: absolute; left: 0; right: 0; top: 4.6rem; font-size: 22.5vw; margin: 0; }
.is-pin .hero__label { position: absolute; top: calc(4.6rem + 18.6vw); margin: 0; float: none; }
.is-pin .hero__label--l { left: var(--edge); }
.is-pin .hero__label--r { right: var(--edge); }
.is-pin .hero__title {
  position: absolute; left: var(--edge); right: var(--edge); top: calc(4.6rem + 23vw); padding: 0;
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: clamp(2.6rem, 4.6vw, 6.6rem);
}
.is-pin .hero__w { display: inline; }
.is-pin .hero__window {
  position: absolute; inset: 0; margin: 0; aspect-ratio: auto; border-radius: 0;
  clip-path: inset(var(--it, 52vh) var(--is, 34vw) var(--ib, 6vh) var(--is, 34vw) round var(--ir, 6px));
  will-change: clip-path;
}
.is-pin .hero__scrim {
  opacity: var(--fo, 0); inset: 0; height: auto;
  background: linear-gradient(to top, rgba(23,19,15,.92) 0%, rgba(23,19,15,.6) 28%, rgba(23,19,15,0) 55%),
              linear-gradient(to right, rgba(23,19,15,.55), rgba(23,19,15,0) 50%);
}
.is-pin .hero__foot {
  position: absolute; left: var(--edge); bottom: clamp(2rem, 6vh, 4rem); color: var(--lime);
  opacity: var(--fo, 0); transform: translateY(calc((1 - var(--fo, 0)) * 24px)); max-width: 36rem;
}
.is-pin .hero__foot p { text-shadow: 0 1px 12px rgba(0,0,0,.35); }

/* ---------- Profile ---------- */
.profile { padding-block: var(--s-sec) calc(var(--s-sec) * .8); }
.profile__grid { display: grid; gap: 1.5rem; padding-top: 2rem; align-items: start; }
.profile__grid .tag { padding-top: .6rem; }
.profile__text { display: grid; gap: 1.2rem; max-width: 40rem; color: var(--soft); }
.profile__text .lead { font-size: var(--step-2); line-height: 1.3; color: var(--ink); font-weight: 500; }
.years { display: grid; gap: 0; margin-top: clamp(3rem, 6vw, 6rem); border-top: 1px solid var(--line); }
.years li { display: grid; grid-template-columns: 6.5rem 1fr; gap: 1rem; padding: 1.1rem 0; border-bottom: 1px solid var(--line); }
.years__y { font-weight: 800; font-variation-settings: "wdth" 112; color: var(--earth); font-size: var(--step-1); }
.motto { margin-top: clamp(4rem, 9vw, 9rem); }
.motto blockquote p {
  font-size: clamp(2.6rem, 1rem + 8vw, 10rem); line-height: .9; font-weight: 900; letter-spacing: -0.04em;
  font-variation-settings: "wdth" 115; text-wrap: balance;
}
.motto figcaption { margin-top: 1rem; font-size: .8rem; letter-spacing: .16em; text-transform: uppercase; font-weight: 600; }
@media (min-width: 900px) {
  .profile__grid { grid-template-columns: 5fr 7fr; }
  .years { grid-template-columns: repeat(3, 1fr); border-top: 0; }
  .years li { grid-template-columns: 1fr; border-top: 1px solid var(--ink); border-bottom: 0; padding-right: 2rem; }
  .motto blockquote p { max-width: 11ch; }
}

/* ---------- Ground profile ---------- */
.ground { padding-bottom: var(--s-sec); }
.ground__intro { max-width: 34rem; padding-top: 1.4rem; color: var(--soft); font-size: var(--step-1); line-height: 1.45; }
.ground__body { position: relative; margin-top: clamp(2.5rem, 5vw, 5rem); }
.profile-col { display: none; }
.layer { position: relative; padding: 0 0 3.5rem 1.4rem; }
.layer::before { content: ""; position: absolute; left: 0; top: .4rem; bottom: 0; width: 4px; background: var(--c, var(--earth)); }
.layer[data-i="0"] { --c: #D9C7A3; }
.layer[data-i="1"] { --c: #A69B8C; }
.layer[data-i="2"] { --c: #C8783A; }
.layer[data-i="3"] { --c: #9C3E1C; }
.layer[data-i="4"] { --c: #3B2A20; }
.layer__depth { font-size: .78rem; letter-spacing: .16em; text-transform: uppercase; font-weight: 600; color: var(--soft); }
.layer h3 { font-size: var(--step-3); line-height: 1; font-weight: 800; font-variation-settings: "wdth" 110; letter-spacing: -0.02em; margin: .4rem 0 1.2rem; text-wrap: balance; }
.layer__img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 4px; margin-bottom: 1.2rem; }
.layer p:last-child { max-width: 34rem; color: var(--soft); font-size: var(--step-1); line-height: 1.5; }

@media (min-width: 900px) {
  .ground__body { display: grid; grid-template-columns: 5fr 6fr; gap: clamp(2rem, 6vw, 7rem); }
  .profile-col { display: block; }
  .strata {
    position: sticky; top: 12vh; height: 76vh; display: flex; flex-direction: column; gap: 3px;
    padding-left: 2.2rem;
  }
  .stratum { position: relative; flex: 1 1 0; min-height: 2.6rem; overflow: hidden; border-radius: 3px; transition: flex-grow .9s var(--ease); }
  .stratum.is-on { flex-grow: 6; }
  .stratum img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transform: scale(1.08); transition: opacity .7s ease, transform 1.2s var(--ease); }
  .stratum.is-on img { opacity: 1; transform: scale(1); }
  .stratum span {
    position: absolute; left: .9rem; bottom: .55rem; z-index: 1; font-size: .78rem; letter-spacing: .16em;
    text-transform: uppercase; font-weight: 700; padding: .2rem .5rem; border-radius: 3px;
    background: rgba(23,19,15,.82); color: var(--lime);
  }
  .s1 { background: #D9C7A3; } .s2 { background: #A69B8C; } .s3 { background: #C8783A; }
  .s4 { background: #9C3E1C; } .s5 { background: #3B2A20; }
  .s4, .s5 { background-image: radial-gradient(rgba(255,255,255,.08) 1px, transparent 1.4px); background-size: 7px 7px; }
  .probe { position: absolute; left: .6rem; top: 0; bottom: 0; width: 2px; background: var(--line); }
  .probe i { position: absolute; inset: 0; background: var(--ink); transform-origin: top; transform: scaleY(var(--gp, 0)); }
  .probe::after {
    content: ""; position: absolute; left: 50%; top: calc(var(--gp, 0) * 100%); width: 14px; height: 14px;
    background: var(--amber); border: 2px solid var(--ink); transform: translate(-50%, -50%) rotate(45deg);
  }
  .layer { min-height: 76vh; display: flex; flex-direction: column; justify-content: center; padding: 0 0 0 1.8rem; }
  .layer::before { top: 30%; bottom: 30%; transform: scaleY(.3); transform-origin: center; transition: transform .8s var(--ease); }
  .layer.is-on::before { transform: scaleY(1); }
  .layer__img { display: none; }
}

/* ---------- Work ---------- */
.work { background: var(--ink); color: var(--lime); padding-block: var(--s-sec); }
.work .h-sec { border-color: var(--line-d); }
.work__intro { max-width: 36rem; padding-top: 1.4rem; color: var(--soft-d); font-size: var(--step-1); line-height: 1.45; }
.work__body { display: grid; gap: 2.5rem; margin-top: clamp(2.5rem, 5vw, 5rem); }
.map { width: 100%; max-width: 520px; height: auto; }
.map__roads path { stroke-dasharray: 4 6; }
.pin circle { fill: var(--soft-d); transition: fill .3s; }
.pin .pin__halo { fill: var(--amber); opacity: 0; transform: scale(.4); transition: opacity .4s, transform .6s var(--ease); }
.pin text { fill: var(--lime); font-family: var(--f); font-size: 19px; font-weight: 700; letter-spacing: .02em; }
.pin.is-on circle:not(.pin__halo) { fill: var(--amber); }
.pin.is-on .pin__halo { opacity: .25; transform: scale(1); }
.map__note { fill: var(--soft-d); font-family: var(--f); font-size: 14px; }
.jobs { border-top: 1px solid var(--line-d); }
.job {
  display: grid; gap: .35rem; width: 100%; text-align: left; background: none; border: 0; cursor: pointer;
  padding: 1.3rem 0 1.3rem 0; border-bottom: 1px solid var(--line-d); position: relative;
  transition: padding .5s var(--ease);
}
.job::before { content: ""; position: absolute; left: 0; top: 1.3rem; bottom: 1.3rem; width: 4px; background: var(--amber); transform: scaleY(0); transition: transform .5s var(--ease); }
.job__name { font-size: var(--step-2); font-weight: 800; font-variation-settings: "wdth" 108; line-height: 1.1; }
.job__meta { color: var(--amber); font-weight: 600; font-size: .95rem; }
.job__desc { color: var(--soft-d); max-width: 36rem; }
.job.is-on, .job:hover { padding-left: 1.3rem; }
.job.is-on::before, .job:hover::before { transform: scaleY(1); }
.shots { display: grid; gap: 2rem; margin-top: var(--s-sec); }
.shot img { width: 100%; aspect-ratio: 970 / 300; object-fit: cover; border-radius: 4px; }
.shot figcaption { display: flex; justify-content: space-between; gap: 1rem; padding-top: .7rem; font-size: .9rem; color: var(--soft-d); }
.shot figcaption span:first-child { color: var(--lime); font-weight: 600; }
@media (min-width: 900px) {
  .work__body { grid-template-columns: 5fr 6fr; gap: clamp(2rem, 6vw, 7rem); align-items: start; }
  .map-col { position: sticky; top: 14vh; }
  .shots { grid-template-columns: 1fr 1fr; column-gap: clamp(2rem, 5vw, 6rem); row-gap: 4rem; }
  .shot--b, .shot--d { margin-top: 9rem; }
  .shot--c { margin-top: -5rem; }
}

/* ---------- Tenders ---------- */
.tenders { padding-block: var(--s-sec); }
.reg { display: grid; margin-top: 2rem; }
.reg div { display: grid; gap: .3rem; padding: 1.2rem 0; border-bottom: 1px solid var(--line); }
.reg dt { font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 600; color: var(--soft); }
.reg dd { font-size: var(--step-1); font-weight: 600; line-height: 1.35; }
@media (min-width: 900px) {
  .reg div { grid-template-columns: 5fr 7fr; gap: 2rem; }
}

/* ---------- Contact ---------- */
.contact { background: var(--lime-2); padding-block: var(--s-sec); }
.contact .h-sec { border-color: #CBBEA9; }
.contact__grid { display: grid; gap: 3rem; }
.contact__lead { padding-top: 1.4rem; font-size: var(--step-1); line-height: 1.45; color: var(--soft); max-width: 32rem; }
.contact__btns { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 2rem; }
.contact__dl { display: grid; gap: 1.4rem; margin-top: 2.6rem; }
.contact__dl dt { font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 600; color: var(--soft); }
.contact__dl dd { font-weight: 600; overflow-wrap: anywhere; }
.quote { display: grid; gap: 1rem; background: var(--ink); color: var(--lime); padding: clamp(1.4rem, 3vw, 2.6rem); border-radius: 10px; align-self: start; }
.quote h3 { font-size: var(--step-2); font-weight: 800; font-variation-settings: "wdth" 110; }
.quote__note { color: var(--soft-d); font-size: .95rem; margin-top: -.4rem; }
.quote label { display: grid; gap: .35rem; font-size: .9rem; font-weight: 600; }
.quote input, .quote select, .quote textarea {
  width: 100%; min-height: 3rem; padding: .7rem .9rem; border-radius: 6px; border: 1px solid #5A4C3E;
  background: var(--ink-2); color: var(--lime); font-weight: 400;
}
.quote input:focus, .quote select:focus, .quote textarea:focus { border-color: var(--amber); }
.quote .btn { justify-self: start; margin-top: .4rem; }
.quote__err { color: var(--amber); font-weight: 600; }
.mapbox { position: relative; margin-top: clamp(3rem, 6vw, 6rem); }
.mapbox iframe { display: block; width: 100%; height: clamp(320px, 45vw, 520px); border: 0; border-radius: 8px; filter: sepia(.25) saturate(.9); }
.mapbox__dir { position: absolute; right: calc(var(--gut) + 1rem); bottom: 1rem; box-shadow: 0 6px 20px rgba(0,0,0,.25); }
@media (min-width: 900px) {
  .contact__grid { grid-template-columns: 6fr 5fr; gap: clamp(2rem, 6vw, 7rem); }
}

.profile, .work, .tenders, .contact { scroll-margin-top: calc(1rem - var(--s-sec)); }

/* ---------- Footer ---------- */
.foot { background: var(--ink); color: var(--lime); padding-top: clamp(3rem, 6vw, 5rem); overflow: hidden; }
.foot__top { display: grid; gap: 2rem; grid-template-columns: 1fr 1fr; }
.foot__mark { grid-column: 1 / -1; }
.foot a { text-decoration: none; }
.foot a:hover { color: var(--amber); }
.foot__nav, .foot__ext { display: grid; gap: .5rem; font-weight: 600; }
.foot__ext { justify-items: end; text-align: right; }
.foot__word {
  font-size: 23.5vw; line-height: .78; font-weight: 900; letter-spacing: -0.045em; color: var(--amber);
  font-variation-settings: "wdth" 112; text-align: center; margin: clamp(3rem, 8vw, 7rem) -0.5vw 0; white-space: nowrap;
}
.foot__base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 2rem; padding-block: 1.4rem; font-size: .85rem; color: var(--soft-d); }
@media (min-width: 900px) {
  .foot__top { grid-template-columns: auto 1fr 1fr; }
  .foot__mark { grid-column: auto; }
}

/* ---------- Reveal ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js .rv { opacity: 0; transform: translateY(28px); transition: opacity .9s ease, transform 1.1s var(--ease); }
  .js .rv.in { opacity: 1; transform: none; }
}

@media (max-width: 520px) {
  .hide-s { display: none; }
  .pill__logo img { width: 88px; }
  .pill__menu { padding: 0 .5rem; }
  .pill__call { padding: 0 .7rem; font-size: .92rem; }
}
