/* Sections, top to bottom: header, hero, cómo trabajamos, líneas, grupo, contacto, footer. */

/* Header: solid, no blur. */
.top { position: sticky; top: 0; z-index: 10; background: hsl(var(--background) / .96); border-bottom: 1px solid hsl(var(--border) / .4); }
.top .wrap { display: flex; align-items: center; gap: 2rem; padding-block: .75rem; }
.logo { display: inline-flex; flex-direction: column; gap: .15rem; text-decoration: none; }
.top .logo { transform-origin: left center; transition: transform .3s cubic-bezier(.2, .7, .2, 1); }
.top.s .logo { transform: scale(.82); }
.logo img { display: block; height: 2.25rem; width: auto; }
/* "Technology" is plain text under the wordmark, not part of the logo; --brand-to (green) so it harmonizes with the brand gradient without reading as part of the logo. */
.logo span { margin-left: 24%; font-size: .7rem; font-weight: 500; letter-spacing: .2em; text-transform: uppercase; color: hsl(var(--muted-foreground)); line-height: 1; }
.lang { position: relative; font-size: .85rem; }
.lang summary { list-style: none; display: inline-flex; align-items: center; gap: .4rem; height: 2.25rem; padding: 0 .7rem; cursor: pointer; color: hsl(var(--muted-foreground)); border: 1px solid hsl(var(--border) / .6); border-radius: 999px; transition: color .2s, border-color .2s; }
.lang summary::-webkit-details-marker { display: none; }
.lang summary:hover, .lang[open] summary { color: hsl(var(--foreground)); border-color: hsl(var(--border)); }
.lang .chev { transition: transform .2s; }
.lang[open] .chev { transform: rotate(180deg); }
.lang-menu { position: absolute; right: 0; top: calc(100% + .5rem); min-width: 10rem; padding: .3rem; border: 1px solid hsl(var(--border) / .6); border-radius: .75rem; background: hsl(var(--background)); box-shadow: 0 12px 32px hsl(0 0% 0% / .45); z-index: 20; }
.lang-menu a { display: flex; align-items: center; gap: .6rem; padding: .5rem .65rem; border-radius: .5rem; text-decoration: none; color: hsl(var(--muted-foreground)); }
.lang-menu b { width: 1.6rem; font-weight: 600; letter-spacing: .04em; }
.lang-menu a:hover { background: hsl(var(--border) / .35); color: hsl(var(--foreground)); }
.lang-menu a[aria-current] { color: hsl(var(--foreground)); }
.lang-menu a[aria-current]::after { content: ""; margin-left: auto; width: .45rem; height: .45rem; border-radius: 50%; background: var(--brand-gradient); }
.top nav { display: flex; gap: 1.75rem; margin-inline: auto; font-size: .95rem; }
.top nav a { position: relative; padding-block: .25rem; text-decoration: none; color: hsl(var(--muted-foreground)); }
.top nav a:hover, .top nav a[aria-current] { color: hsl(var(--foreground)); }

/* Hero */
.hero {
  min-height: min(46rem, calc(100svh - 4.5rem)); padding-block: clamp(3rem, 7vw, 6rem); display: flex; align-items: center;
}
/* Isometric brand pattern in the brand gradient, drifting against the pointer (js/interact.js sets --px/--py). */
.hero { position: relative; overflow: clip; }
.hero-art { position: absolute; inset: -6%; background: var(--brand-gradient); opacity: .15; pointer-events: none;
  -webkit-mask: url("../assets/pattern.svg") center / cover no-repeat, linear-gradient(#000 55%, transparent);
  mask: url("../assets/pattern.svg") center / cover no-repeat, linear-gradient(#000 55%, transparent);
  -webkit-mask-composite: source-in; mask-composite: intersect;
  transform: translate3d(calc(var(--px, 0) * -24px), calc(var(--py, 0) * -24px), 0); transition: transform .4s cubic-bezier(.2, .7, .2, 1); }
/* Slogans share one grid cell (height = the tallest, no jump); js/slogan.js switches .on, by timer or by click. */
.slogan { display: grid; margin-bottom: 1.25rem; font-size: clamp(2.5rem, 6.5vw, 5.5rem); }
.slogan span { grid-area: 1 / 1; padding-bottom: .1em; justify-self: start; color: transparent; background: var(--brand-gradient); -webkit-background-clip: text; background-clip: text; opacity: 0; }
.slogan span:first-child { opacity: 1; }
.js .slogan span { opacity: 0; transform: translateY(.4em); transition: opacity .5s cubic-bezier(.2, .7, .2, 1), transform .5s cubic-bezier(.2, .7, .2, 1); }
.js .slogan span.on { opacity: 1; transform: none; }
.slogan-nav { display: flex; gap: .5rem; margin-bottom: 2rem; }
.slogan-nav button { position: relative; width: 3.25rem; height: 1.75rem; padding: 0; border: 0; background: none; cursor: pointer; }
.slogan-nav button::before, .slogan-nav button::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 3px; margin-top: -1.5px; border-radius: 2px; }
.slogan-nav button::before { background: hsl(var(--border) / .6); }
.slogan-nav button::after { background: var(--brand-gradient); transform: scaleX(0); transform-origin: left; }
.slogan-nav button.on::after { animation: tick var(--slogan-ms, 4000ms) linear forwards; }
.slogan-nav.paused button.on::after, .slogan-nav.manual button.on::after { animation: none; transform: scaleX(1); }
.slogan-nav button:hover::before { background: hsl(var(--muted-foreground)); }
@keyframes tick { to { transform: scaleX(1); } }
@media (prefers-reduced-motion: reduce) { .js .slogan span { transition: none; transform: none; } .hero-art { transition: none; } }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; }

/* Cómo trabajamos: four steps on a line. */
.path { list-style: none; margin: 4rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 2rem; position: relative; }
.path::before { content: ""; position: absolute; left: 0; right: 0; top: .6rem; height: 2px; background: var(--brand-gradient); transform-origin: left; }
.path li { position: relative; padding-top: 2.75rem; }
.path li::before { content: ""; position: absolute; top: 0; left: 0; width: 1.25rem; height: 1.25rem; border-radius: 50%; background: hsl(var(--background)); border: 2px solid hsl(var(--brand-from)); }
.path li::after { content: ""; border: 2px solid transparent; position: absolute; top: 0; left: 0; width: 1.25rem; height: 1.25rem; border-radius: 50%; background: var(--brand-gradient); opacity: 0; transition: opacity .4s; }
.path li.in::after { opacity: 1; }
.n { font-family: var(--font-mono); font-size: .85rem; color: hsl(var(--brand-from)); }
.path h3 { font-size: 1.5rem; }
.path p { margin: 0; color: hsl(var(--muted-foreground)); }

/* Líneas de trabajo */
.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; margin-top: 3rem; }
.card { position: relative; overflow: hidden; display: grid; grid-template-columns: 1fr; grid-template-areas: "ill" "title" "text"; align-content: start; padding: 2rem; background: hsl(var(--card)); color: hsl(var(--card-foreground)); border: 1px solid hsl(var(--border) / .4); border-radius: calc(var(--radius) * 2); transition: transform .3s, border-color .3s; }
.card > * { position: relative; z-index: 1; }
.card:nth-child(3) { grid-column: 1 / -1; }
.card h3 { grid-area: title; margin: .25rem 0 .75rem; font-size: clamp(1.6rem, 2.6vw, 2.2rem); font-weight: 700; line-height: 1.1; letter-spacing: -.025em; max-width: 16ch; }
.card p { grid-area: text; margin: 0; max-width: 28rem; color: hsl(var(--muted-foreground)); font-size: 1.05rem; }
.sub { margin: 0 0 2rem; max-width: 40rem; font-size: clamp(1.05rem, 1.6vw, 1.3rem); color: hsl(var(--muted-foreground)); }
.lead { margin: -.5rem 0 2rem; max-width: 40rem; font-size: 1.15rem; color: hsl(var(--muted-foreground)); }
/* Isometric illustration of each line (same strokes/gradient as the brand pattern). It has its own grid cell,
   top right next to the number, so it can never sit under the title. */
.ill { grid-area: ill; justify-self: start; width: clamp(7.5rem, 26vw, 10.5rem); height: auto; pointer-events: none; overflow: visible; margin-bottom: .75rem; }
/* Wide screens: three equal columns. In between (2 columns) the third card spans the full row. */
@media (min-width: 72rem) {
  .cards { grid-template-columns: repeat(3, 1fr); }
  .card:nth-child(3) { grid-column: auto; }
}
.ill g { transition: transform .45s cubic-bezier(.2, .7, .2, 1); }
.ill .f { fill: hsl(var(--brand-from) / .10); stroke: url(#ig); stroke-width: 1.5; stroke-linejoin: round; }
.ill .f2 { fill: hsl(var(--brand-to) / .10); stroke: url(#ig); stroke-width: 1.5; stroke-linejoin: round; }
.ill .l { fill: none; stroke: hsl(var(--brand-from) / .7); stroke-width: 1.2; stroke-dasharray: 3 4; }
.ill .n { fill: hsl(var(--brand-to)); }

/* El grupo */
.lead { margin: 0; max-width: 40rem; font-size: 1.25rem; color: hsl(var(--muted-foreground)); }
.figures { display: flex; gap: clamp(2rem, 7vw, 6rem); margin: 3.5rem 0; }
.figures div { margin: 0; }
.figures dt { font-variant-numeric: tabular-nums; font-size: clamp(3rem, 7vw, 5.5rem); font-weight: 700; line-height: .95; letter-spacing: -.03em; }
.figures dd { margin: .75rem 0 0; color: hsl(var(--muted-foreground)); }
.values { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2rem; list-style: none; margin: 0; padding: 2.5rem 0 0; border-top: 1px solid hsl(var(--border) / .5); }
/* assets/values.svg paints with these two custom properties (they inherit into <use>). */
.vi { --vi-g: hsl(var(--muted-foreground)); --vi-a: hsl(var(--brand-from)); display: block; margin-bottom: 1rem; }
.values h3 { font-size: 1.1rem; }
.values p { margin: 0; font-size: .95rem; color: hsl(var(--muted-foreground)); }

/* Contacto */
.contact-mail { align-self: center; }
.contact-mail p { margin: 0 0 .5rem; color: hsl(var(--muted-foreground)); }
.contact-mail a { font-size: clamp(1.35rem, 3.4vw, 2.4rem); font-weight: 600; letter-spacing: -.02em; overflow-wrap: anywhere; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .3em; text-decoration-color: hsl(var(--brand-from)); transition: text-decoration-color .2s; }
.contact-mail a:hover { text-decoration-color: hsl(var(--brand-to)); }
.contact { padding-bottom: clamp(3rem, 6vw, 5rem); border-top: 1px solid hsl(var(--border) / .3); }
.contact .wrap { display: grid; grid-template-columns: 1fr 1.4fr; gap: 3rem; }
.contact-intro p { margin: 0; color: hsl(var(--muted-foreground)); font-size: 1.1rem; }
form { display: grid; gap: 1rem; padding: 2rem; background: hsl(var(--card)); border: 1px solid hsl(var(--border) / .4); border-radius: calc(var(--radius) * 2); }
label { display: grid; gap: .35rem; font-size: .9rem; font-weight: 500; }
.opt { font-weight: 400; color: hsl(var(--muted-foreground)); }
label { transition: color .2s; }
label:focus-within { color: hsl(var(--brand-from)); }
input:not([type=checkbox]), textarea {
  transition: border-color .2s, box-shadow .2s;
  font: inherit; color: hsl(var(--foreground)); padding: .7rem .85rem;
  background: hsl(var(--background)); border: 1px solid hsl(var(--input) / .6); border-radius: calc(var(--radius) / 1.5);
}
textarea { resize: vertical; }
input:not([type=checkbox]):focus, textarea:focus { outline: none; border-color: hsl(var(--brand-from)); box-shadow: 0 0 0 3px hsl(var(--brand-from) / .25); }
input:not([type=checkbox]):focus-visible, textarea:focus-visible { outline: none; }
.consent { display: flex; gap: .6rem; align-items: flex-start; font-weight: 400; }
.consent input { margin-top: .3rem; }
form .btn { justify-self: start; }
.contact form .btn-primary { position: relative; overflow: hidden; }
.contact form .btn-primary::after { content: ""; -webkit-mask: none; mask: none; margin: 0; width: auto; vertical-align: baseline; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: hsl(var(--background) / .55); transform: translateX(-100%); }
.contact form .btn-primary[data-state="sending"]::after { animation: send 1.1s ease-in-out infinite; }
.contact form .btn-primary[data-state="ok"] { animation: pop .5s cubic-bezier(.2, .7, .2, 1); }
.contact form .btn-primary[data-state="err"] { animation: shake .4s; }
@keyframes send { to { transform: translateX(100%); } }
@keyframes pop { 40% { transform: scale(1.06); } }
@keyframes shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
@media (prefers-reduced-motion: reduce) {
  .contact form .btn-primary[data-state="sending"]::after { animation: none; transform: none; }
  .contact form .btn-primary[data-state="ok"], .contact form .btn-primary[data-state="err"] { animation: none; }
}
#status { min-height: 1.5em; margin: 0; font-size: .9rem; }
#status.ok { color: hsl(var(--success)); }
#status.err { color: hsl(var(--danger)); }
.hp { position: absolute; left: -9999px; }

/* Footer */
.foot { padding-block: 1.25rem; font-size: .85rem; color: hsl(var(--muted-foreground)); }
.foot .wrap { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1rem 2rem; }
.foot .logo { justify-self: start; }
.foot .logo img { height: 1.75rem; }
.foot .legal { margin: 0; font-size: .8rem; }
.foot .mail { justify-self: end; }

@media (max-width: 56rem) {
  .values { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 48rem) {
  .top nav { display: none; }
  .top .btn { margin-left: auto; padding: .5rem 1rem; font-size: .9rem; }
  .top .wrap { gap: 1rem; }
  .hero { min-height: 0; }
  .path { grid-template-columns: 1fr; gap: 2rem; padding-left: 2.5rem; }
  .path::before { left: .6rem; right: auto; top: 0; bottom: 0; width: 2px; height: auto; transform-origin: top; }
  .path li { padding-top: 0; }
  .path li::before, .path li::after { left: -2.5rem; top: .2rem; }
  .cards, .contact .wrap { grid-template-columns: 1fr; }
  .contact .wrap { gap: 1.5rem; }
  .foot .wrap { grid-template-columns: 1fr; gap: .75rem; }
  .foot .mail { justify-self: start; }
  form { padding: 1.25rem; }
}
