/* ==========================================================================
   Home page (index.html). Mobile first; 768px = iPad, 1100px = desktop.
   ========================================================================== */

/* ---------- Hero ---------- */
.hero{position:relative;border-radius:0 0 24px 24px;overflow:hidden}
/* full screen: the photo fills the whole first screen (svh: the height with the phone's toolbars showing) */
.hero img{width:100%;height:100vh;height:100svh;object-fit:cover}
.hero__text{position:absolute;inset:auto 0 0 0;padding:72px var(--gutter) 24px;background:linear-gradient(to top,rgba(0,0,0,.65),rgba(0,0,0,0));color:#fff}
.hero h1{font-size:clamp(38px,12.3vw,64px);line-height:.95;font-weight:500;letter-spacing:-.05em}
.hero h1 span{color:var(--red)}
@media (min-width:768px){
  .hero__text{padding:120px var(--gutter) 32px;background:linear-gradient(to top,rgba(0,0,0,.7),rgba(0,0,0,0))}
  .hero h1{font-size:11.7vw;line-height:.92}
}
@media (min-width:1100px){
  .hero__text{padding:200px 104px 56px var(--gutter);background:linear-gradient(to top,rgba(0,0,0,.78),rgba(0,0,0,0))}
  .hero h1{font-size:min(11.9vw,200px);line-height:.9;letter-spacing:-.055em;white-space:nowrap}
  /* light shade on the left edge so the page ruler's white ticks (main.js) read over the bright parts; gone by 130px */
  .hero::before{content:"";position:absolute;inset:0;pointer-events:none;background:linear-gradient(to right,rgba(0,0,0,.34),rgba(0,0,0,.14) 60px,rgba(0,0,0,0) 130px)}
}

/* ---------- Section headings ---------- */
.sec-head{display:flex;justify-content:space-between;align-items:baseline}
.sec-head h2{font-size:14px;font-weight:500;color:var(--red)}
.sec-head .link{font-size:16px}
@media (min-width:768px){
  .sec-head h2{font-size:15px}
  .sec-head .link{font-size:18px}
}
@media (min-width:1100px){
  .sec-head{align-items:flex-end}
  .sec-head h2{font-size:96px;line-height:.88;letter-spacing:-.055em;color:var(--ink)}
  .sec-head .link{font-size:24px;gap:10px;min-height:52px;padding-bottom:8px}
  .sec-head .link .arrow{font-size:30px}
}

/* ---------- Projects: accordion ---------- */
.projects{padding-top:0}
.projects .sec-head{padding:24px var(--gutter) 12px}
/* phones and iPad: no accordion. The three projects are each an always-open carousel of their photos in a 4:3 frame
   (nearly all the carousel photos are landscape, mostly 3:2: 4:3 trims about a tenth of their width; a square cut a
   third. The odd portrait one shows its middle half).
   --still tells main.js not to make the list follow the scroll (desktop keeps it). Proyectos does the same (proyectos.css) */
@media (max-width:1099px){
  .projects .acc{--still:1;--gap:10px}
  .projects .acc .panel,.projects .acc>input:checked+.panel{height:auto;aspect-ratio:4/3} /* the first one starts open: beat accordion.css's open height */
  .projects .acc .slides{overflow-x:auto}
  .projects .acc .sub{opacity:.9;max-height:24px}
  /* top right, level with "ver proyecto" (centred, they met the wider Catalan button); main.js centres the long dot
     in the row's own width, which now hugs the dots */
  .projects .acc .dots{opacity:1;left:auto;right:14px;top:25px}
  .projects .acc .panel .more{display:flex;opacity:1;pointer-events:auto}
  .projects .acc:not(.scrubbed)>input+.panel .more{visibility:visible} /* beats accordion.css's hidden closed link (same weight, later) */
  .projects .acc .chev{display:none}
  .projects .acc .bar{pointer-events:none} /* nothing to open or close: swipes and taps go to the photos */
}
@media (min-width:768px) and (max-width:1099px){
  .projects .acc{--gap:14px}
  .projects .acc .dots{right:20px;top:32px} /* level with the bigger iPad "ver proyecto" (16px down, 40px tall) */
  .projects .acc .cap{right:28px} /* no chevron to leave room for */
}
@media (min-width:768px){
  .projects{padding:64px var(--gutter) 0}
  .projects .sec-head{padding:0 0 16px}
}
@media (min-width:1100px){
  .projects{padding-top:140px}
  .projects .sec-head{padding-bottom:36px}
  /* never wider than 1.8x the open project's height (--acc-w, main.js; 1260px = 1.8 x the CSS 700px without it), centred,
     its heading with it: a wide, short screen made a flat strip that cut away ~40% of each photo */
  .projects{max-width:calc(var(--acc-w,1260px) + 2 * var(--gutter));margin-inline:auto}
}

/* ---------- Services ---------- */
.services{padding:36px var(--gutter) 12px}
.services .sec-head{padding-bottom:12px}
.srv-list{list-style:none;margin:0;padding:0}
.srv{position:relative;overflow:hidden;display:flex;justify-content:space-between;align-items:center;min-height:56px;font-size:22px;letter-spacing:-.01em;text-decoration:none;transition:background .3s}
/* Hover, like the project side rows (accordion.css; the owner's ask): the name rolls up like the arrow links (main.js
   makes it a .link-txt) and the row's two lines move: each line is a strip three times as wide (line, gap, line) that
   slides two row-widths right, so it runs out to the right while a new one draws in from the left (0.8s). Each row
   draws its top line, the last one its bottom one too; a hovered row's bottom line is the next row's top one */
.srv::before,.srv-list li:last-child>.srv::after{content:"";position:absolute;left:0;width:300%;height:1px;
  background:linear-gradient(to right,var(--ink) 33.333%,transparent 33.333% 66.667%,var(--ink) 66.667%);
  transform:translateX(-66.667%);transition:transform .8s cubic-bezier(.25,.46,.45,.94)}
.srv::before{top:0}
.srv-list li:last-child>.srv::after{bottom:0}
.srv:hover::before,.srv:hover::after,.srv-list li:has(>.srv:hover)+li>.srv::before{transform:none}
@media (prefers-reduced-motion:reduce){.srv::before,.srv::after{transition:none}}
/* just the five names, no description beside them (the owner found them filler) */
@media (min-width:768px){
  .services{padding:72px var(--gutter) 0}
  .services .sec-head{padding-bottom:16px}
  .srv{min-height:84px}
  .srv .t{font-size:30px;letter-spacing:-.02em}
}
@media (min-width:1100px){
  .services{padding-top:128px}
  .services .sec-head{padding-bottom:32px}
  .srv{min-height:112px;padding:0 16px}
  .srv .t{font-size:52px;line-height:1;letter-spacing:-.03em}
  .srv:hover{background:var(--band)}
}
.srv .link-txt{line-height:1.3} /* its box clips the rolling text: room for the descenders */

/* ---------- About ---------- */
.about{padding:28px var(--gutter) 36px;display:flex;flex-direction:column;gap:14px}
.about .sec-head{padding:0}
.about__photo,.about__stat,.about__more{display:none}
.about__lead strong{display:block;font-size:24px;line-height:1.25;font-weight:400;letter-spacing:-.02em;color:var(--ink);margin-bottom:14px}
.about__lead span{color:var(--muted)}
@media (min-width:768px){
  .about{padding:72px var(--gutter) 0;display:block}
  .about .sec-head{padding-bottom:16px}
  .about__grid{display:grid;grid-template-columns:340px 1fr;gap:48px;align-items:stretch}
  .about__photo{display:flex;align-items:center;justify-content:center;border-radius:18px;background:var(--ph);color:var(--muted-2);font-size:14px;text-align:center;padding:0 24px;min-height:320px}
  .about__text{display:flex;flex-direction:column;gap:18px;color:var(--ink-2);font-size:18px;line-height:1.6}
  .about__lead strong{display:inline;font-size:inherit;line-height:inherit;font-weight:600;letter-spacing:0;margin:0}
  .about__lead span{color:inherit}
  .about__more{display:block}
}
@media (min-width:1100px){
  .about{padding-top:140px}
  .about .sec-head{padding-bottom:32px}
  .about__grid{grid-template-columns:480px 1fr;gap:80px}
  .about__photo{border-radius:24px}
  .about__text{gap:24px;font-size:21px;max-width:600px}
  .about__stat{display:flex;align-items:flex-end;gap:20px;line-height:.8}
  /* scales with the text column (100vw - gutters - photo 480 - gap 80): 236px / 36px when it is 640px wide */
  .about__stat .n{font-size:min(236px,(100vw - 2 * var(--gutter) - 560px)*.37);font-weight:500;letter-spacing:-.07em;color:var(--red)}
  .about__stat .t{font-size:min(36px,(100vw - 2 * var(--gutter) - 560px)*.056);line-height:1.05;letter-spacing:-.02em;color:var(--ink);padding-bottom:14px}
  .about__lead strong{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
  .about__lead{margin-top:8px}
}

/* ---------- Spacing before the contact block ---------- */
.contact{margin-top:0}
@media (min-width:768px){.contact{margin-top:72px}}
@media (min-width:1100px){.contact{margin-top:140px}}
