/* ==========================================================================
   Javi García BCN: base styles (shared by every page)
   Mobile first. Breakpoints: 768px (iPad) and 1100px (desktop).
   ========================================================================== */

/* ---------- Fonts (self-hosted Geist) ---------- */
@font-face{font-family:"Geist";font-weight:400;font-style:normal;font-display:swap;
  src:url("/assets/fonts/geist-latin-400-normal.woff2") format("woff2");
  unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:"Geist";font-weight:500;font-style:normal;font-display:swap;
  src:url("/assets/fonts/geist-latin-500-normal.woff2") format("woff2");
  unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:"Geist";font-weight:600;font-style:normal;font-display:swap;
  src:url("/assets/fonts/geist-latin-600-normal.woff2") format("woff2");
  unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:"Geist";font-weight:400;font-style:normal;font-display:swap;
  src:url("/assets/fonts/geist-latin-ext-400-normal.woff2") format("woff2");
  unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:"Geist";font-weight:500;font-style:normal;font-display:swap;
  src:url("/assets/fonts/geist-latin-ext-500-normal.woff2") format("woff2");
  unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:"Geist";font-weight:600;font-style:normal;font-display:swap;
  src:url("/assets/fonts/geist-latin-ext-600-normal.woff2") format("woff2");
  unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}

/* ---------- Tokens ---------- */
:root{
  --bg:#FBFAF7;
  --ink:#111;
  --ink-2:#333;
  --muted:#555;
  --muted-2:#777;
  --red:#C8202F;
  --band:#EFEDE7;
  --ph:#E4E0D8;
  --black:#111;

  --glass-bg:rgba(251,250,247,.56);
  --glass-filter:blur(18px) saturate(1.6);
  --glass-border:1px solid rgba(255,255,255,.6);
  --glass-shadow:0 2px 14px rgba(0,0,0,.14);

  --gutter:16px;
  --header-top:10px; --header-side:8px; --header-h:56px;
  --ease:cubic-bezier(.2,.7,.2,1);
  --font:"Geist",system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
}
@media (min-width:768px){:root{--gutter:32px;--header-top:14px;--header-side:16px;--header-h:64px}}
/* desktop: 100px sides leave room for the page ruler on the left (stretched ticks stop at 90px);
   the header bar sits wider than the content, 40px from the window edges */
@media (min-width:1100px){:root{--gutter:100px;--header-top:18px;--header-side:40px;--header-h:68px}}

/* ---------- Reset ---------- */
*,*::before,*::after{box-sizing:border-box}
/* sharp corners everywhere (a design choice): this one rule overrides every border-radius in the CSS */
*,*::before,*::after{border-radius:0!important}
html{-webkit-text-size-adjust:100%;scroll-behavior:smooth;scroll-padding-top:90px}
/* no native scrollbar: on desktop the ruler on the left (.ruler, main.js) shows the position */
html{scrollbar-width:none}
html::-webkit-scrollbar{display:none}
body{margin:0;background:var(--bg);color:var(--ink);font-family:var(--font);font-size:16px;line-height:1.5;overflow-x:hidden;-webkit-font-smoothing:antialiased}
/* short pages (404): main grows so the footer wordmark still sits flush with the bottom of the screen */
body{min-height:100vh;display:flex;flex-direction:column}
main{flex:1 0 auto}
img{display:block;max-width:100%}
a{color:inherit}
button,input,textarea{font:inherit;color:inherit}
h1,h2,h3,p{margin:0}
:focus-visible{outline:2px solid var(--red);outline-offset:3px}
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
@media (prefers-reduced-motion:reduce){html{scroll-behavior:auto}*,*::before,*::after{animation:none!important;transition-duration:.01ms!important}}

/* Photos fade in as they load */
@keyframes ph{from{opacity:0}to{opacity:1}}
img:not([fetchpriority="high"]){animation:ph .8s ease both}

/* ---------- Accordion chevron (.chev: project panels and servicios): ˅ closed, ˄ open (the page CSS sets --o:1 when its
   panel is open). One shape, a six-point polygon (the two arms share the vertex points, so the join is always clean;
   two separate strokes left a notch there). Toggling, --tilt animates from 45deg to -45deg: the vertex slides straight
   down or up through a flat line, the two outer points spread a little to the sides on the way (about 20% wider when
   flat, as if the arms were stiff) and come back, and the arms stay 2px thick at every angle. Every corner is square:
   the vertex is 90deg at rest and each arm's end is cut at right angles to the arm (not vertically).
   --chev = arm length at rest; --s = half the width and --hh = half the height (along the arms' centre line);
   --c/--sn = the 1px half-thickness turned with the arm (the square ends); --t = the vertex's half-thickness. */
@property --tilt{syntax:"<angle>";inherits:false;initial-value:45deg}
.chev{position:relative;--chev:9px}
.chev::after{display:none} /* a copy, for the photo panels' hover (accordion.css) */
.chev::before,.chev::after{content:"";position:absolute;inset:0;background:currentColor;
  --tilt:calc(45deg - 90deg * var(--o,0));transition:--tilt .35s var(--ease);
  --s:calc(var(--chev) * (.354 + .5 * cos(var(--tilt))));--hh:calc(var(--s) * tan(var(--tilt)) / 2);
  --c:calc(1px * cos(var(--tilt)));--sn:calc(1px * sin(var(--tilt)));--t:calc(1px / cos(var(--tilt)));
  clip-path:polygon(calc(50% - var(--s) + var(--sn)) calc(50% - var(--hh) - var(--c)),50% calc(50% + var(--hh) - var(--t)),
    calc(50% + var(--s) - var(--sn)) calc(50% - var(--hh) - var(--c)),calc(50% + var(--s) + var(--sn)) calc(50% - var(--hh) + var(--c)),
    50% calc(50% + var(--hh) + var(--t)),calc(50% - var(--s) - var(--sn)) calc(50% - var(--hh) + var(--c)))}

/* Windows High Contrast repaints every background in its own colour, so an icon drawn as a background cut to a shape
   would vanish: these keep its text colour. The chevrons, the autoplay's pause/play icon (.pause, accordion.css) and
   the phone menu's burger bars */
@media (forced-colors:active){.chev::before,.chev::after,.pause::before,.menu-btn .bars i{forced-color-adjust:none;background:CanvasText}}

/* ---------- Frosted glass (anything that sits on a photo) ---------- */
.glass{background:var(--glass-bg);-webkit-backdrop-filter:var(--glass-filter);backdrop-filter:var(--glass-filter);border:var(--glass-border);box-shadow:var(--glass-shadow)}

/* ---------- Header: floating frosted bar ---------- */
.site-header{position:fixed;z-index:50;left:var(--header-side);right:var(--header-side);top:var(--header-top);height:var(--header-h);
  display:flex;align-items:center;justify-content:space-between;padding:0 6px 0 18px;border-radius:20px;
  background:rgba(251,250,247,.62);border:1px solid rgba(255,255,255,.55);
  -webkit-backdrop-filter:blur(18px) saturate(1.5);backdrop-filter:blur(18px) saturate(1.5);box-shadow:0 4px 24px rgba(0,0,0,.12)}
/* Chromium (main.js adds .grain and the #grain filter): what's behind is scattered into grain instead of blurred
   (the bar, the phone menu and every .glass button). The grain stays sharp where the blur smoothed, so the bar is
   more opaque, or dark things behind it (a black button) fight with the menu links */
html.grain .site-header{background:rgba(251,250,247,.8);-webkit-backdrop-filter:url(#grain) saturate(1.5);backdrop-filter:url(#grain) saturate(1.5)}
html.grain .menu-panel{-webkit-backdrop-filter:url(#grain) saturate(1.5);backdrop-filter:url(#grain) saturate(1.5)}
html.grain{--glass-filter:url(#grain) saturate(1.6)}
.brand{font-size:16px;font-weight:600;letter-spacing:-.01em;text-decoration:none}
.brand span,.wordmark span{color:var(--red)}

.menu-btn{width:44px;height:44px;display:flex;align-items:center;justify-content:center;background:none;border:0;padding:0;cursor:pointer}
/* The burger: two bars that turn into an X (main.js only flips aria-expanded). Opening, they first slide together into
   one line, then turn ±45° with a little overshoot; closing, the other way round: they turn back, then spread apart
   (like the chevron sliding through a flat line, or the cursor's corners-then-turn). Square ends, like everything */
.menu-btn .bars{position:relative;width:18px;height:14px}
.menu-btn .bars i{position:absolute;left:0;top:calc(50% - .875px);width:18px;height:1.75px;background:currentColor;translate:0 -3px;
  transition:rotate .2s cubic-bezier(.4,0,.2,1),translate .18s cubic-bezier(.4,0,.2,1) .17s}
.menu-btn .bars i+i{translate:0 3px}
.menu-btn[aria-expanded="true"] .bars i{translate:0 0;rotate:45deg;
  transition:translate .18s cubic-bezier(.4,0,.2,1),rotate .34s cubic-bezier(.34,1.56,.64,1) .15s}
.menu-btn[aria-expanded="true"] .bars i+i{rotate:-45deg}

/* Main nav (inline on iPad/desktop; panel on mobile) */
.main-nav{display:none}
.menu-panel{position:fixed;z-index:49;left:var(--header-side);right:var(--header-side);top:calc(var(--header-top) + var(--header-h) + 8px);
  padding:8px 20px 12px;border-radius:20px;background:rgba(251,250,247,.72);border:1px solid rgba(255,255,255,.55);
  -webkit-backdrop-filter:blur(24px) saturate(1.5);backdrop-filter:blur(24px) saturate(1.5);box-shadow:0 8px 40px rgba(0,0,0,.18);
  display:flex;flex-direction:column;opacity:0;visibility:hidden;transform:translateY(-8px);clip-path:inset(0 0 100% 0);
  transition:clip-path .3s cubic-bezier(.4,0,.2,1),opacity .2s .1s,transform .3s var(--ease),visibility 0s .3s}
/* Opening, it unrolls from under the bar (the clip opens downwards, past its edges so the shadow shows), and its
   links and the languages drop into place one after another (--d), following it down; closing, it rolls back up
   quicker and they rise with it, all together. From above, not below: the panel can scroll (short screens), and
   links sliding up from 14px lower stuck 2px out of its bottom, which flashed a scrollbar while it moved */
.menu-panel.open{opacity:1;visibility:visible;transform:none;clip-path:inset(-50px -50px -70px -50px);
  transition:clip-path .55s cubic-bezier(.22,1,.36,1),opacity .2s,transform .55s cubic-bezier(.22,1,.36,1),visibility 0s}
.menu-panel a.item,.menu-panel .langs{opacity:0;translate:0 -12px;transition:opacity .15s,translate .2s}
.menu-panel.open a.item,.menu-panel.open .langs{opacity:1;translate:none;
  transition:opacity .3s var(--d,0s),translate .5s cubic-bezier(.22,1,.36,1) var(--d,0s)}
.menu-panel a.item:nth-of-type(1){--d:.07s}
.menu-panel a.item:nth-of-type(2){--d:.12s}
.menu-panel a.item:nth-of-type(3){--d:.17s}
.menu-panel a.item:nth-of-type(4){--d:.22s}
.menu-panel .langs{--d:.27s}
/* "reduce motion" already makes every transition instant (top of this file); these delays would still hold them back */
@media (prefers-reduced-motion:reduce){.menu-btn .bars i,.menu-panel,.menu-panel a.item,.menu-panel .langs{transition-delay:0s!important}}
/* a short screen (phone on its side, zoomed page): the panel scrolls instead of running off the bottom */
.menu-panel{max-height:calc(100vh - var(--header-top) - var(--header-h) - 16px);max-height:calc(100svh - var(--header-top) - var(--header-h) - 16px);overflow-y:auto;overscroll-behavior:contain}
.menu-panel a.item{min-height:64px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid rgba(17,17,17,.18);font-size:28px;letter-spacing:-.02em;text-decoration:none}
.menu-panel a.item:last-of-type{border-bottom:0}
.menu-panel a.item .arrow{font-size:20px;color:var(--red)}
.menu-panel a.item[aria-current] span:first-child{color:var(--red)}
.menu-panel .langs{display:flex;align-items:center;justify-content:center;gap:4px;font-size:15px;margin-top:4px}
.menu-panel .langs a{min-width:48px;height:48px;display:flex;align-items:center;justify-content:center;color:#444;text-decoration:none}
.menu-panel .langs a[aria-current="true"]{font-weight:600;color:var(--ink);text-decoration:underline;text-underline-offset:4px}
.menu-panel .langs .sep{color:var(--muted-2)}

/* the nav pill's edges, top and height (set by main.js): registered so each one animates on its own */
@property --l{syntax:"<length>";inherits:false;initial-value:0px}
@property --r{syntax:"<length>";inherits:false;initial-value:0px}
@property --y{syntax:"<length>";inherits:false;initial-value:0px}
@property --h{syntax:"<length>";inherits:false;initial-value:0px}

@media (min-width:768px){
  .site-header{padding:0 12px 0 28px}
  .brand{font-size:18px}
  .menu-btn,.menu-panel{display:none}
  .main-nav{display:flex;align-items:center;position:relative;font-size:16px}
  .main-nav a{position:relative;z-index:1;height:44px;padding:0 14px;display:flex;align-items:center;justify-content:center;text-align:center;text-decoration:none;transition:color .25s}
  .main-nav a[aria-current]{color:var(--red)}
  .main-nav a.lang{min-width:44px;padding-left:18px;font-size:15px;color:var(--muted)}
  /* the pill: its edges (--l/--r), top and height (--y/--h) come from main.js so it works at any width and can stretch
     toward the cursor; --pill-h is its resting height, about the height of the text. Moving to another link the edge
     on that side leads and the other follows a moment later (it stretches, then contracts; .to-left mirrors it).
     .grow: appearing, it grows a little past its size and settles. .shrink: leaving, it widens a little, then shrinks
     into a dot as it fades. .elastic: stretching toward the cursor, quick. Sideways only: the height never overshoots. */
  .main-nav{--pill-h:22px}
  .main-nav .ind{position:absolute;left:0;top:0;width:max(0px,var(--r) - var(--l));height:var(--h);border-radius:500px;background:var(--red);
    transform:translate(var(--l),var(--y));opacity:0;pointer-events:none;
    transition:--r .2s cubic-bezier(.25,1,.5,1),--l .3s cubic-bezier(.6,0,.3,1.3),--y .2s,--h .2s,opacity .13s}
  .main-nav.to-left .ind{transition:--l .2s cubic-bezier(.25,1,.5,1),--r .3s cubic-bezier(.6,0,.3,1.3),--y .2s,--h .2s,opacity .13s}
  .main-nav.grow .ind{transition:--l .3s cubic-bezier(.3,1.8,.5,1),--r .3s cubic-bezier(.3,1.8,.5,1),--y .17s ease-out,--h .17s ease-out,opacity .1s}
  .main-nav.shrink .ind{transition:--l .27s cubic-bezier(.4,-.8,.6,1),--r .27s cubic-bezier(.4,-.8,.6,1),--y .27s ease-in,--h .27s ease-in,opacity .27s ease-in}
  .main-nav.elastic .ind{transition:--l .05s ease-out,--r .05s ease-out,--y .05s,--h .05s,opacity .13s}
  /* .resting = not hovered: the pill sits on the current page's link (white text), see main.js */
  .main-nav.hovering .ind,.main-nav.resting .ind{opacity:1}
  /* the other links, dimmed: #57544f is 7.2:1 on the cream and still 4.5:1 or more over the black contáctanos block or a
     dark photo, as long as the bar is .8 opaque (WCAG 4.5; #8f8c84 was 3.2:1, #6b6862 2.2:1 there in Safari). Chromium's
     grain bar always is; the blurred one (Safari, Firefox) is .62, so it firms up to .8 while the menu is hovered */
  .main-nav.hovering a{color:#57544f}
  .site-header{transition:background-color .25s}
  .site-header:has(.main-nav.hovering){background:rgba(251,250,247,.8)}
  .main-nav.hovering a.is-target,.main-nav.resting a.is-target{color:#fff}
}
@media (min-width:1100px){
  .site-header{padding:0 12px 0 36px}
  .brand{font-size:20px}
  .main-nav{font-size:17px}
  .main-nav a{height:48px;padding:0 16px}
  .main-nav a.lang{min-width:48px;padding-left:24px;font-size:16px}
  .main-nav{--pill-h:24px}
}

/* ---------- Layout helpers ---------- */
.wrap{padding-inline:var(--gutter)}
.link{display:inline-flex;align-items:center;gap:8px;min-height:44px;text-decoration:none;transition:color .2s}
.link .arrow{color:var(--red)}
.link:hover{color:var(--red)}
/* Arrow links on hover, and the "ver proyecto" buttons on the photos (.more), like bcgbuildingdesign.com.au's "Learn
   More" (main.js builds the pieces and adds .roll; without JS they just turn red): the text rolls up and out while a copy rolls in from below, the arrow slides out ahead and a
   copy slides in behind it, and a 1px line draws in above them from the left (it goes back out when the cursor leaves).
   No colour change. Keyboard focus does the same. */
.roll{--roll:cubic-bezier(.25,.46,.45,.94)}
.roll:hover{color:inherit}
.link-in{position:relative;display:inline-flex;align-items:center;gap:inherit}
.link-txt,.roll .arrow{position:relative;display:inline-block;overflow:hidden;line-height:1.3}
.link-txt>span,.roll .arrow>span{display:block;transition:transform .4s var(--roll)}
.link-txt>span+span,.roll .arrow>span+span{position:absolute;left:0;top:0}
/* the copies are empty spans (main.js): their text is drawn here, so it isn't on the page twice */
.link-txt>span+span::after,.roll .arrow>span+span::after{content:attr(data-copy)}
.link-txt>span+span{transform:translateY(100%)}
.roll .arrow>span+span{transform:translateX(-100%)}
.roll.back .arrow>span+span{transform:translateX(100%)} /* "← back": the other way */
.roll:is(:hover,:focus-visible) .link-txt>span:first-child{transform:translateY(-100%)}
.roll:is(:hover,:focus-visible) .arrow>span:first-child{transform:translateX(100%)}
.roll.back:is(:hover,:focus-visible) .arrow>span:first-child{transform:translateX(-100%)}
.roll:is(:hover,:focus-visible) :is(.link-txt,.arrow)>span+span{transform:none}
/* the line sits right on the top edge of the text's box (1.3em tall, centred), so the text rolls out under it */
.link-line{position:absolute;left:0;right:0;top:calc(50% - .65em);height:1px;overflow:hidden;pointer-events:none}
.link-line::before{content:"";position:absolute;inset:0;background:currentColor;transform:translateX(-101%);transition:transform .8s var(--roll)}
.roll:is(:hover,:focus-visible) .link-line::before{transform:none}
@media (prefers-reduced-motion:reduce){.roll *,.roll *::before,.roll *::after{transition:none}}

/* ---------- Black contáctanos block ---------- */
.contact{margin-top:40px;border-top:3px solid var(--red);background:var(--black);color:#fff;padding:32px var(--gutter)}
.contact__inner{width:100%;max-width:560px;margin:0 auto;display:flex;flex-direction:column;gap:14px}
.contact h2{font-size:28px;line-height:1.1;font-weight:500;letter-spacing:-.02em}
.contact h2 span{color:var(--red)}
.btn-wa{height:52px;display:flex;align-items:center;justify-content:center;border-radius:26px;background:#fff;color:var(--ink);font-weight:500;text-decoration:none;transition:background .2s,color .2s,transform .2s}
/* WhatsApp green on hover; dark text, since white on this green is hard to read */
.btn-wa:hover{background:#25D366;color:var(--ink);transform:translateY(-2px)}
.contact .divider{display:flex;align-items:center;gap:12px;color:#999;font-size:14px;margin-top:10px}
.contact .divider::before,.contact .divider::after{content:"";flex:1;height:1px;background:#444}
.form{--form-gap:12px;display:flex;flex-direction:column;gap:var(--form-gap);margin-top:8px}
/* the Turnstile box (main.js adds it when the form is first touched) is usually invisible, 0px tall: take back the gap
   it would add, or everything under it jumped down as soon as someone clicked into a field */
.form > .ts{margin-top:calc(-1 * var(--form-gap))}
.field{position:relative;display:flex;flex-direction:column}
/* underlined fields with a floating label: no box, only a line under each field (buttons and the checkbox keep theirs).
   The label sits in the empty field like a placeholder and moves up to the top of it, smaller, when the field is
   focused or has text; the text goes in under it. The inputs carry placeholder=" " so CSS can tell when they are
   empty (:placeholder-shown). */
.field label{position:absolute;left:0;top:50%;z-index:1;font-size:16px;line-height:1.2;color:#999;
  pointer-events:none;transform:translateY(-50%);transform-origin:left center;transition:top .2s cubic-bezier(.4,0,.2,1),transform .2s cubic-bezier(.4,0,.2,1),color .2s}
.field:has(textarea) label{top:36px}
.field:has(:focus) label,.field:has(input:not(:placeholder-shown),textarea:not(:placeholder-shown)) label{top:10px;transform:translateY(-50%) scale(.75);color:#ddd}
/* the field being typed in: its label turns red, with or without text (:has(input:focus) weighs as much as the
   "has text" rule above, and comes after it, so it wins; a plain :has(:focus) weighed less and lost once there was text) */
.field:has(input:focus,textarea:focus) label{color:var(--red)}
.field input::placeholder,.field textarea::placeholder{color:transparent}
.field input,.field textarea{height:52px;padding:20px 0 4px;border:0;border-bottom:1px solid #666;background:transparent;color:#fff;transition:border-color .2s} /* #666: 3.3:1 on the black block (WCAG 3:1 for a field's edge) */
/* room at the bottom for the counter. It grows and shrinks with its text (main.js sets its height, the owner's ask):
   4 rows at least, 16 at most, then it scrolls (its scrollbar drawn for the dark block: color-scheme) */
.field textarea{height:auto;padding:26px 0 24px;resize:none;min-height:calc(4lh + 51px);max-height:calc(16lh + 51px);color-scheme:dark}
.form--light .field textarea{color-scheme:light}
.field input:hover,.field textarea:hover,.field input:focus,.field textarea:focus{border-color:#999}
/* the red label shows which field it is; the outline is there but transparent, so Windows High Contrast mode (which
   repaints it in its own colour) still shows the focus */
.field input:focus,.field textarea:focus{outline:2px solid transparent}
/* main.js: characters left in the message (bottom right), and a note under a field that doesn't check out (the email) */
.field-count{position:absolute;right:0;bottom:6px;font-size:12px;color:#888;pointer-events:none} /* #888: 5.3:1 on the black block (WCAG 4.5) */
.field-count.full,.field-count.short{color:#ff7a80}
.field-msg{margin-top:6px;font-size:13px;line-height:18px;color:#ff7a80} /* a lighter red, readable on the black block */
.field:has(> .field-msg:not(:empty)) .field-count{bottom:30px} /* the note goes under the line: the counter stays above it */
.check + .field-msg{margin-top:-10px} /* the privacy note is a row of the form itself: take back the form's gap (~6px left, like the others) */
.check{display:flex;align-items:flex-start;gap:10px;font-size:14px;color:#ccc}
.check input{width:22px;height:22px;margin:0;flex-shrink:0;accent-color:var(--red)}
.check a{color:#fff}
.actions{display:flex;flex-direction:column;gap:16px}
.actions .row{display:flex;flex-direction:column;gap:12px}
.btn-send{height:52px;border:1px solid #fff;border-radius:26px;background:transparent;color:#fff;font-weight:500;cursor:pointer;transition:background .2s,color .2s}
.btn-send:hover{background:#fff;color:var(--ink)}
/* locked until every field checks out, and while sending (aria-disabled, main.js): dimmed, no hover change */
.btn-send[aria-disabled="true"]{opacity:.35;cursor:default}
.btn-send[aria-disabled="true"]:hover{background:transparent;color:#fff}
.hp{position:absolute;left:-9999px;width:1px;height:1px;overflow:hidden}   /* honeypot */
.form-status{font-size:14px;min-height:1.4em;color:#ddd}
.contact .wa-row{display:none}
@media (min-width:768px){
  .contact{margin-top:72px;padding:44px var(--gutter)}
  .contact h2{font-size:40px;line-height:1.05;letter-spacing:-.03em}
  .contact__inner{gap:0}
  .contact h2{margin-bottom:24px}
  .contact .wa-top,.contact .divider{display:none}
  .contact .wa-row{display:flex}
  .form{margin-top:0;--form-gap:14px}
  .actions .row{flex-direction:row}
  .actions .row>*{flex:1;height:48px;font-size:16px}
}
@media (min-width:1100px){
  .contact{margin-top:140px;padding:72px 0}
  .contact__inner{max-width:640px;padding:0 40px}
  .contact h2{font-size:72px;line-height:.95;letter-spacing:-.05em;margin-bottom:24px}
  .actions .row>*{font-size:17px}
}

/* ---------- Footer ---------- */
.site-footer{padding:24px var(--gutter) 0;font-size:13px;color:var(--muted);display:flex;flex-direction:column;gap:8px;overflow:hidden}
.site-footer a{display:flex;align-items:center;min-height:44px}
.footer-links{display:flex;justify-content:space-between;gap:12px;font-size:15px;color:var(--ink)}
.footer-legal{display:flex;justify-content:space-between;gap:12px}
.footer-address{font-style:normal} /* <address> is italic by default (here, not inline in the pages: the CSP can stay strict on styles) */
.footer-links a,.footer-legal a{transition:color .2s}
.footer-links a:hover,.footer-legal a:hover{color:var(--red)}
/* wordmark: scales with the viewport and is cropped flush with the page bottom */
.wordmark{margin:20px 0 0 -.04em;font-size:14.2vw;line-height:1;height:.96em;overflow:hidden;font-weight:600;letter-spacing:-.06em;white-space:nowrap;color:var(--ink);transition:color .3s;user-select:none}
.wordmark:hover{color:var(--red)}
@media (min-width:768px){
  .site-footer{padding-top:32px;font-size:14px;display:grid;grid-template-columns:1fr auto;gap:12px 40px;align-items:start}
  .footer-links{order:2;gap:28px;justify-content:flex-start;font-size:16px}
  .footer-address{order:1}
  .footer-legal{order:3;gap:28px;justify-content:flex-start}
  .wordmark{order:4;grid-column:1/-1;margin-top:32px}
}
@media (min-width:1100px){
  .site-footer{padding-top:48px;row-gap:14px}
  .footer-links{gap:36px;font-size:17px}
  .footer-legal{gap:36px}
  .wordmark{margin-top:24px}
}
@media (min-width:1500px){.wordmark{font-size:14.2vw}}

/* ---------- Skip link (keyboard users) ---------- */
.skip{position:fixed;z-index:100;left:12px;top:-80px;padding:12px 18px;border-radius:14px;background:var(--ink);color:#fff;font-weight:500;text-decoration:none;transition:top .2s}
.skip:focus{top:12px}

/* ---------- Inner page title (every page except the home) ---------- */
.page-head{padding:92px var(--gutter) 20px}
.page-head h1{font-size:44px;line-height:1;font-weight:500;letter-spacing:-.03em;color:var(--red)}
.page-head .back{font-size:15px;margin-bottom:4px}
.page-head .back:not(.roll) .arrow{transition:transform .25s var(--ease)} /* without JS; with it, .roll above */
.page-head .back:not(.roll):hover .arrow{transform:translateX(-4px)}
@media (min-width:768px){
  .page-head{padding:128px var(--gutter) 32px}
  .page-head h1{font-size:72px;letter-spacing:-.04em}
  .page-head .back{font-size:17px;margin-bottom:8px}
}
@media (min-width:1100px){
  .page-head{padding:150px var(--gutter) 56px}
  .page-head h1{font-size:152px;line-height:.86;letter-spacing:-.065em}
  .page-head .back{font-size:18px;margin-bottom:16px}
}

/* ---------- Dark pill button ("pedir presupuesto", WhatsApp on light pages) ---------- */
.btn-dark{height:52px;padding:0 28px;display:inline-flex;align-items:center;justify-content:center;border-radius:26px;background:var(--ink);color:#fff;font-weight:500;text-decoration:none;transition:background .2s,transform .2s}
.btn-dark:hover{background:var(--red);transform:translateY(-2px)}
@media (min-width:1100px){.btn-dark{height:56px;padding:0 30px;border-radius:28px}}

/* ---------- Label / value rows (contacto, project pages) ---------- */
.facts{margin:0}
.facts>div{padding:16px 0;border-top:1px solid var(--ink)}
.facts>div:first-child{padding-top:0;border-top:0}
.facts>div:last-child{border-bottom:1px solid var(--ink)}
.facts dt{font-size:13px;color:#666;margin-bottom:4px}
.facts dd{margin:0;font-size:18px;line-height:1.5}
.facts dd a{text-decoration:none;transition:color .2s}
.facts dd a:hover{color:var(--red)}
@media (min-width:768px){.facts>div{padding:22px 0}.facts>div:first-child{padding-top:0}.facts dd{font-size:20px}}
@media (min-width:1100px){.facts dd{font-size:22px}}

/* ---------- Garraf map (servicios, contacto). The SVG is inline so it uses Geist. It is drawn from OpenStreetMap
   data by tools/build-map.mjs (the Garraf in red, the real coast, roads, towns), so it credits OpenStreetMap ---------- */
.map{position:relative;width:100%;height:300px;border-radius:14px;overflow:hidden;background:#D5DFE4}
.map svg{display:block;width:100%;height:100%}
.map__link{position:absolute;left:16px;top:16px;height:44px;padding:0 20px;display:flex;align-items:center;gap:8px;border-radius:22px;background:var(--ink);color:#fff;font-size:15px;font-weight:500;text-decoration:none;transition:background .2s,transform .2s}
.map__link .arrow{color:var(--red);transition:color .2s}
.map__link:hover{background:var(--red);transform:translateY(-2px)}
.map__link:hover .arrow{color:#fff}
.map__credit{position:absolute;right:0;bottom:0;padding:3px 6px;background:rgba(251,250,247,.75);color:#555;font-size:10px;line-height:1.2;text-decoration:none}
.map__credit:hover{text-decoration:underline}
/* the whole Garraf always fits the box ("meet"), so a narrow box draws it smaller: its names, in map units, grow to
   stay about 11-15px on screen (the SVG says 24, right for desktop). The Garraf's other towns (.sm, grey) are 80% */
.map text{font-size:33px}
.map .sm{font-size:26px}
.map text.ref{font-size:21px} /* road numbers on contacto's map, 62%; their black box grows with them (an SVG filter) */
@media (min-width:480px){.map text{font-size:27px}.map .sm{font-size:22px}.map text.ref{font-size:17px}}
@media (min-width:768px){.map text{font-size:30px}.map .sm{font-size:24px}.map text.ref{font-size:19px}}
@media (min-width:1100px){.map text{font-size:24px}.map .sm{font-size:19px}.map text.ref{font-size:15px}}
/* "cómo llegar" top left: the corner is land outside the Garraf at every width (bottom left hid Cubelles) */
@media (min-width:768px){.map{border-radius:18px}.map__link{left:24px;top:24px}}
@media (min-width:1100px){.map{border-radius:24px}}

/* ---------- Light version of the form (contacto page) ---------- */
.form--light .field label{color:#666} /* #666: 5.5:1 on the cream (WCAG asks 4.5; #777 was 4.3) */
.form--light .field:has(input:not(:placeholder-shown),textarea:not(:placeholder-shown)) label{color:#555}
.form--light .field:has(input:focus,textarea:focus) label{color:var(--red)}
.form--light .field input,.form--light .field textarea{border-color:#888;color:var(--ink)} /* no fill: the page's own cream. #888: 3.4:1 on it (WCAG 3:1) */
.form--light .field input:hover,.form--light .field textarea:hover,.form--light .field input:focus,.form--light .field textarea:focus{border-color:#555}
.form--light .field-count{color:#666}
.form--light .field-count.full,.form--light .field-count.short{color:var(--red)}
.form--light .field-msg{color:var(--red)}
/* a field that doesn't check out (main.js): red line and label, both forms (the :has() makes it weigh as much as the
   "has text" label colours, and it comes after them, so it wins) */
.form .field.is-invalid input,.form .field.is-invalid textarea{border-color:var(--red)}
.form .field.is-invalid:has(input,textarea) label{color:var(--red)}
.contact .form .field.is-invalid:has(input,textarea) label{color:#ff7a80}
.form--light .check{color:#444}
.form--light .check a{color:var(--ink)}
.form--light .btn-send{border-color:var(--ink);background:var(--ink);color:#fff}
.form--light .btn-send:hover{background:var(--red);border-color:var(--red);color:#fff}
.form--light .btn-send[aria-disabled="true"]:hover{background:var(--ink);border-color:var(--ink);color:#fff}
.form--light .form-status{color:#444}
@media (min-width:768px){
  .form--light .btn-send{height:56px;border-radius:28px;background:transparent;color:var(--ink)}
  .form--light .btn-send:hover{background:var(--ink);border-color:var(--ink);color:#fff}
  .form--light .btn-send[aria-disabled="true"]:hover{background:transparent;border-color:var(--ink);color:var(--ink)}
}

/* ---------- Page ruler (desktop): stands in for the hidden scrollbar, like devouringdetails.com.
   Built by main.js: ticks down the left edge (a long one where each section starts); the ticks at the
   current position turn red, fading over 2-3 ticks. Click or drag the ticks to scroll. ---------- */
.ruler,.ruler-layer{display:none}
@media (min-width:1100px){
  .ruler,.ruler-layer{position:fixed;left:0;top:50%;transform:translateY(-50%)}
  /* difference blend keeps the grey ticks visible on the cream page, on photos and on the black block */
  .ruler{z-index:41;width:52px;padding:6px 0 6px 14px;display:flex;flex-direction:column;gap:8px;cursor:pointer;touch-action:none;user-select:none;mix-blend-mode:difference}
  /* --grow (main.js) stretches the ticks near the cursor on hover */
  .ruler i,.ruler-glow i,.ruler-photo i{display:block;flex:none;width:calc(21px + var(--grow,0px));height:1px;transition:width .15s var(--ease)}
  .ruler i{background:#888}
  .ruler i.long{background:#fff}
  .ruler i.long,.ruler-glow i.long,.ruler-photo i.long{width:min(calc(32px + var(--grow,0px) * 1.2),76px);height:1.15px}
  /* red copy of the ticks on top, not blended; main.js sets each tick's opacity and thickness (--t) from the scroll position */
  .ruler-layer{display:block;z-index:42;width:240px;height:var(--h,0px);pointer-events:none}
  .ruler-glow,.ruler-photo{position:absolute;left:14px;top:6px;display:flex;flex-direction:column;gap:8px}
  /* white copy, clipped by main.js to where the home hero photo is behind the ruler */
  .ruler-photo i{background:rgba(255,255,255,.72)}
  .ruler-photo i.long{background:#fff}
  /* solid, not see-through: each tick mixes from the grey the ticks show on the page to red by --pos (0-1), so it is one
     even colour along its length (a see-through red let the grey tick show under part of it) */
  /* Thicker by a shadow of the same colour above and below (--t, main.js), not by scaling the tick: a scaled tick is drawn
     at its exact in-between position while the grey one under it snaps to a whole screen row, so at zooms like 110-125%
     a red tick sat a row above its grey one. This way both are the same box, snapped the same way */
  .ruler-glow i{--c:color-mix(in srgb,var(--red) calc(var(--pos,0) * 100%),#73726F);background:var(--c);opacity:0;
    box-shadow:0 calc(var(--t,0px) * -1) 0 var(--c),0 var(--t,0px) 0 var(--c)}
  .ruler-glow i.long{--c:color-mix(in srgb,var(--red) calc(var(--pos,0) * 100%),#050508)}
  /* the red ticks are also up to 25% longer, by the same gradient (--pos, 0-1, from main.js); capped at 76px like the long ones */
  .ruler-glow i{width:min(calc((21px + var(--grow,0px)) * (1 + .25 * var(--pos,0))),76px)}
  .ruler-glow i.long{width:min(calc((32px + var(--grow,0px) * 1.2) * (1 + .25 * var(--pos,0))),76px)}
  .ruler-tip{position:absolute;left:98px;top:0;padding:6px 12px;border-radius:14px;color:#fff;font-size:14px;font-weight:500;line-height:1.2;white-space:nowrap;opacity:0;transform:translateY(calc(var(--ty,0px) - 50%));transition:opacity .2s}
  .ruler-layer.tip-on .ruler-tip{opacity:1}
  /* its box is an SVG shape main.js redraws as it moves (it bends, its middle pinches toward the cursor, its ends curl);
     the letters are one span each so they can follow it (inline-block: transforms don't apply to inline text) */
  .ruler-tip svg{position:absolute;left:0;top:0;overflow:visible;z-index:-1}
  .ruler-tip path{fill:var(--ink)}
  .ruler-tip span span{display:inline-block;white-space:pre}
}

/* ---------- Cursor (mouse only): a square that inverts whatever it passes over, like bybang.co. Its colour is
   the cream page minus the brand red (#FBFAF7 - #C8202F = #33DAC8), so on the page it shows as exactly red;
   elsewhere it inverts (teal on black, a negative on photos, still visible on red titles). Over anything
   clickable its two top corners slide together into one point and the triangle turns to point north-east
   (the head of ↗), same size; over text fields it becomes a thin caret. All with the same springy curve.
   The outer box moves and blends; the inner <i> is the shape (so it can rotate in place).
   main.js adds .has-cursor to <html> once it runs, so without JS the normal cursor stays. */
.cursor{display:none}
@media (hover:hover) and (pointer:fine){
  html.has-cursor:not(.vt-pointer),html.has-cursor:not(.vt-pointer) *{cursor:none!important}
  html.vt-pointer .cursor{visibility:hidden} /* during a page change: the normal pointer instead (see "Page change") */
  .cursor{display:block;position:fixed;left:0;top:0;z-index:200;width:16px;height:16px;mix-blend-mode:difference;pointer-events:none;opacity:0;
    transform:translate3d(-100px,-100px,0) translate(-50%,-50%);
    transition:opacity .18s,width .52s cubic-bezier(.68,-.48,.28,1.48),height .52s cubic-bezier(.68,-.48,.28,1.48)}
  .cursor.on{opacity:1}
  /* Leaving a link: turn back first, then the two top corners spread out again, just past the square (under 1px,
     the same bit of spring as the caret) and settle. The shape is drawn 4px bigger than the box on every side and
     clipped back to it, so that bit past the square shows (a clip-path can't paint outside its own element). */
  .cursor i{display:block;width:calc(100% + 8px);height:calc(100% + 8px);margin:-4px;background:#33DAC8;
    clip-path:polygon(4px 4px,calc(100% - 4px) 4px,calc(100% - 4px) calc(100% - 4px),4px calc(100% - 4px));
    transition:rotate .45s cubic-bezier(.68,-.48,.28,1.48),clip-path .5s cubic-bezier(.34,1.56,.64,1) .1s,background-color .25s}
  /* over a link: the top corners meet in the middle (a triangle pointing up), then it turns 45deg to point north-east */
  .cursor.is-link i{clip-path:polygon(50% 4px,50% 4px,calc(100% - 4px) calc(100% - 4px),4px calc(100% - 4px));rotate:45deg;
    transition:clip-path .45s cubic-bezier(.68,-.48,.28,1.48),rotate .55s cubic-bezier(.68,-.48,.28,1.48) .14s}
  .cursor.is-text{width:3px;height:24px}
  /* Over a button it fills it, like bybang.co: main.js glides it to the button's middle and gives it the button's size
     (the springy width/height transition above), solid (no inverting) in --cursor-c: red, WhatsApp green on the
     WhatsApp buttons. The button's text (.btn-label, main.js) sits above it: white, dark on the green. It stays put
     until the mouse leaves. */
  .cursor.is-block{mix-blend-mode:normal}
  .cursor.is-block i{background:var(--cursor-c,var(--red))}
  .btn-label{position:relative;display:inline-flex;align-items:center;gap:inherit;transition:color .2s}
  html.has-cursor .is-filled .btn-label{z-index:201;color:#fff}
  html.has-cursor .btn-wa.is-filled .btn-label{color:var(--ink)}
  /* so the cursor is their hover now: the buttons' own hover colours and lift are off (touch keeps them) */
  html.has-cursor .btn-wa:hover{background:#fff;color:var(--ink);transform:none}
  html.has-cursor .btn-wa.btn-wa--dark:hover{background:var(--ink);color:#fff}
  html.has-cursor .btn-dark:hover,html.has-cursor .map__link:hover{background:var(--ink);transform:none}
  html.has-cursor .map__link:hover .arrow{color:var(--red)}
  html.has-cursor .map__link.is-filled .arrow{color:#fff}
  html.has-cursor .btn-send:hover{background:transparent;color:#fff}
  html.has-cursor .form--light .btn-send:hover{background:var(--ink);border-color:var(--ink);color:#fff}
}
@media (hover:hover) and (pointer:fine) and (min-width:768px){
  html.has-cursor .form--light .btn-send:hover{background:transparent;border-color:var(--ink);color:var(--ink)}
}

/* ---------- Short buttons, like the menu's red pill (the owner's call; it overrides the heights written above):
   32px tall to the eye, still 44px to tap: an invisible ::after reaches 7px past the padding (6px past a 1px border)
   above and below. "Enviar mensaje" (both forms), "Escribir por WhatsApp" (both kinds) and "pedir presupuesto". */
.btn-wa,.btn-dark,.form .btn-send,.btn-wa.btn-wa--dark,.actions .row>*{height:32px;position:relative}
.btn-wa::after,.btn-dark::after,.btn-send::after{content:"";position:absolute;inset:-7px 0}

/* ---------- Text reveal (main.js, after bcgbuildingdesign.com.au): a block waiting to rise is transparent (.rv). When it
   goes (.rv-go), each word is in a box that masks its bottom edge (a little below it, for the descenders), its text
   starting a line plus .5em lower (accents and all out of sight) and sliding up 0.8s (about GSAP's power3.out), 50ms
   later per line (--rv-d). The lines stay as measured (nowrap; main.js puts a <br> at each line end). main.js unwraps
   the words when done. */
.rv{opacity:0}
.rv-go{white-space:nowrap}
.rv-go rv-word{display:inline-block;clip-path:inset(-1em -1em -.25em -1em)}
.rv-go rv-in{display:inline-block;transform:translateY(calc(100% + .5em));transition:transform .8s cubic-bezier(.215,.61,.355,1) var(--rv-d,0s)}
.rv-on rv-in{transform:none}
@media print{.rv{opacity:1}.rv-go rv-in{transform:none}}

/* ---------- Page change (after bcgbuildingdesign.com.au's Barba transition, rebuilt with the browser's own View
   Transitions: CSS only, every page opts in here). Following a link to another page of the site, the page being left
   shrinks toward the top (48px in from each side, 50px down; 1.35s, about power2.inOut) and darkens to 10% (0.6s, the
   space around it darkening alike, so its edges melt into it), while the new page rises from below the window, its
   clipped window (30% from the top, 15% from the sides) opening to the full page (1.35s, about power4.out). The header
   bar fades out (0.35s) and the new one back in at 0.81s. An open phone menu leaves with the page: captured on its
   own it lost its frosted backdrop, and its links showed over the page while fading. Chrome, Edge and Safari 18.2+;
   Firefox just changes page. Not with reduced motion.
   The switch itself (@view-transition{navigation:auto}) is not here but in a <style> in each page's <head>: Chrome
   checks it on the arriving page before this file has loaded, and with it only here the arriving page refused the
   transition ("ViewTransition opt-in disabled") whenever the file came over the network instead of from the cache. */
@media (prefers-reduced-motion:no-preference){
  .site-header{view-transition-name:vt-header}
  /* The custom cursor (main.js) sits out the page change: left in the pages, it shrank and darkened with the old one
     and rose clipped with the new one, so there was none to see, and Chrome won't draw it on a layer of its own that
     follows the mouse (the layer stays where the click was). Named, so it is cut out of both pictures; the normal
     pointer stands in until the new page is in place (html.vt-pointer, main.js). */
  .cursor{view-transition-name:vt-cursor}
  ::view-transition-group(vt-cursor){display:none}
  ::view-transition{background:#fbfaf7;animation:vt-bg .6s cubic-bezier(.25,.46,.45,.94) both}
  ::view-transition-old(root),::view-transition-new(root){mix-blend-mode:normal}
  ::view-transition-old(root){animation:vt-shrink 1.35s cubic-bezier(.455,.03,.515,.955) both,vt-dim .6s cubic-bezier(.25,.46,.45,.94) both}
  ::view-transition-new(root){animation:vt-rise 1.35s cubic-bezier(.23,1,.32,1) both}
  ::view-transition-old(vt-header){animation:vt-out .35s cubic-bezier(.215,.61,.355,1) both}
  ::view-transition-new(vt-header){animation:vt-in .3s cubic-bezier(.25,.46,.45,.94) .81s both}
}
@keyframes vt-bg{to{background:#191919}}
@keyframes vt-shrink{to{left:48px;width:calc(100% - 96px);transform:translateY(50px)}}
@keyframes vt-dim{to{filter:brightness(.1)}}
@keyframes vt-rise{from{transform:translateY(110%);clip-path:inset(30% 15% 0 15%)}to{transform:none;clip-path:inset(0)}}
@keyframes vt-out{to{opacity:0}}
@keyframes vt-in{from{opacity:0}}
