/* =========================================================
   T-Control · Navigation + Hero (from UI Vault sections/hero/model-006)

   The model's split: a light copy column, the visual on the right and a
   black strip that crosses the seam between them. The visual is the
   current site's cover: the start image, then the cover video after 3s,
   in full colour. No slider (2026-09-25, on request: one image and one
   video, no back/forward arrows).
   Motion speaks the language of the process section: one curve, things
   uncover with clip-path and text arrives after its frame is in place.
   Texts and images: INVENTARIO_CONTENIDO_TCONTROL.md. Tokens: styles.css.
========================================================= */

.tc-hero,
.tc-nav { --tc-split: 46%; --tc-nav-h: 80px; }

/* ---------- Navigation ----------
   Fixed at the top, the full width of the window. Over the hero it has no
   background at all; as soon as you scroll it turns into liquid glass
   (a light frosted layer with a thin bright edge), still edge to edge
   (2026-09-25, on request). */

.tc-nav {
  position: fixed;
  z-index: 50;
  top: 0;
  right: 0;
  left: 0;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 44px;
  height: var(--tc-nav-h);
  padding: 0 clamp(24px, 3.6vw, 60px);
  border-bottom: 1px solid transparent;
  background: transparent;
  transition: background-color .5s ease, border-color .5s ease, box-shadow .5s ease, backdrop-filter .5s ease, -webkit-backdrop-filter .5s ease, height .5s var(--tc-ease);
}

.tc-nav.is-stuck {
  --tc-nav-h: 68px;
  border-bottom-color: color-mix(in srgb, var(--tc-grey-light) 55%, transparent);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--tc-surface) 55%, transparent), color-mix(in srgb, var(--tc-white) 30%, transparent)),
    color-mix(in srgb, var(--tc-white) 42%, transparent);
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, var(--tc-surface) 85%, transparent),
    0 14px 34px -26px color-mix(in srgb, var(--tc-black) 55%, transparent);
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
}

/* The logo in black, straight on the light bar (no block around it). A
   plain <img>, so it also shows when the page is opened from disk. */
.tc-nav__brand { display: block; transition: opacity .2s ease; }
.tc-nav__brand:hover { opacity: .65; }
.tc-mark { display: block; width: 118px; height: auto; }

.tc-nav__links { display: flex; align-items: center; justify-content: flex-start; gap: 28px; } /* over the light column, next to the logo */

.tc-nav__links a {
  position: relative;
  padding: 8px 0;
  color: var(--tc-grey);
  font-size: .9rem;
  font-weight: 500;
  white-space: nowrap;
  transition: color .2s ease;
}
.tc-nav__links a:hover { color: var(--tc-black); }

/* active section: a short rule that draws from the centre */
.tc-nav__links a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: var(--tc-black);
  transform: translateX(-50%) scaleX(0);
  transition: transform .45s var(--tc-ease);
}
.tc-nav__links a.is-active { color: var(--tc-black); font-weight: 600; }
.tc-nav__links a.is-active::after { transform: translateX(-50%) scaleX(1); }

.tc-nav__actions { display: flex; align-items: center; gap: 8px; }

.tc-nav__cta {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 12px;
  background: var(--tc-black);
  color: var(--tc-white);
  font-size: .85rem;
  font-weight: 600;
  transition: background-color .2s ease, transform .25s var(--tc-ease);
}
.tc-nav__cta:hover { background: var(--tc-black-hover); transform: translateY(-1px); }

.tc-nav__toggle {
  display: none;
  width: 44px;
  height: 44px;
  place-content: center;
  gap: 6px;
  border: 1px solid var(--tc-line);
  border-radius: 12px;
  background: var(--tc-surface);
  cursor: pointer;
}
.tc-nav__toggle span { display: block; width: 18px; height: 2px; border-radius: 2px; background: var(--tc-black); transition: transform .35s var(--tc-ease); }
.tc-nav__toggle[aria-expanded="true"] span:first-child { transform: translateY(4px) rotate(45deg); }
.tc-nav__toggle[aria-expanded="true"] span:last-child { transform: translateY(-4px) rotate(-45deg); }

/* ---------- Language switcher (scripts/i18n.js) ----------
   A quiet pill (globe · ES · chevron); the menu drops from it with the
   house curve. On the transparent bar and on the liquid glass alike. */

.tc-lang { position: relative; }

.tc-lang__btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--tc-line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--tc-surface) 70%, transparent);
  color: var(--tc-black);
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .06em;
  cursor: pointer;
  transition: border-color .2s ease, background-color .2s ease;
}
.tc-lang__btn:hover { border-color: var(--tc-grey-light); background: var(--tc-surface); }
.tc-lang__btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tc-lang__chev { width: 14px !important; height: 14px !important; transition: rotate .35s var(--tc-ease); }
.tc-lang.is-open .tc-lang__chev { rotate: 180deg; }

.tc-lang__menu {
  position: absolute;
  z-index: 5;
  top: calc(100% + 8px);
  right: 0;
  min-width: 170px;
  margin: 0;
  padding: 6px;
  list-style: none;
  border: 1px solid var(--tc-line);
  border-radius: 14px;
  background: var(--tc-surface);
  box-shadow: 0 22px 44px -22px color-mix(in srgb, var(--tc-black) 50%, transparent);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px) scale(.98);
  transform-origin: top right;
  transition: opacity .2s ease, transform .35s var(--tc-ease), visibility 0s .35s;
}
.tc-lang.is-open .tc-lang__menu { opacity: 1; visibility: visible; transform: none; transition: opacity .2s ease, transform .35s var(--tc-ease), visibility 0s; }

.tc-lang__menu button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--tc-grey);
  text-align: left;
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease;
}
.tc-lang__menu button:hover { background: var(--tc-soft); color: var(--tc-black); }
.tc-lang__menu b { width: 24px; color: var(--tc-black); font-size: .8rem; letter-spacing: .06em; }
.tc-lang__menu span { font-size: .9rem; }
.tc-lang__menu [aria-selected="true"] { background: var(--tc-black); color: var(--tc-white); }
.tc-lang__menu [aria-selected="true"] b { color: var(--tc-white); }

/* ---------- Hero ---------- */

.tc-hero {
  position: relative;
  display: grid;
  grid-template-columns: var(--tc-split) 1fr;
  min-height: 100vh;
  min-height: 100svh;
  border-bottom: 1px solid var(--tc-line);
  background: var(--tc-white);
}

.tc-hero__copy {
  position: relative;
  display: flex;
  align-items: center;
  padding: 120px clamp(28px, 3.6vw, 60px) 150px;
}

.tc-hero__copy-inner { max-width: 560px; }

.tc-hero__eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 20px;
  color: var(--tc-graphite);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.tc-hero__eyebrow::before { content: ""; width: 28px; height: 2px; background: var(--tc-black); }

.tc-hero h1 {
  max-width: 560px;
  font-size: clamp(3.6rem, 5.6vw, 6.6rem);
  line-height: .9;
  letter-spacing: .005em;
}

.tc-hero__lead {
  max-width: 440px;
  margin: clamp(28px, 4.5vh, 48px) 0 0;
  padding-top: 24px;
  border-top: 1px solid var(--tc-line);
  color: var(--tc-grey);
  font-size: 1.02rem;
  line-height: 1.6;
}

.tc-hero__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 26px; margin-top: 34px; }

.tc-hero__cta {
  display: inline-flex;
  align-items: center;
  min-height: 52px;
  padding: 0 26px;
  border-radius: 14px;
  background: var(--tc-black);
  color: var(--tc-white);
  font-size: .92rem;
  font-weight: 600;
  transition: background-color .25s ease, transform .25s var(--tc-ease), box-shadow .25s ease;
}
.tc-hero__cta:hover { background: var(--tc-black-hover); box-shadow: 0 16px 30px -18px var(--tc-black); transform: translateY(-2px); }

.tc-hero__link { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--tc-black); font-size: .92rem; font-weight: 600; }
.tc-hero__link span { transition: transform .3s var(--tc-ease); }
.tc-hero__link:hover span { transform: translateX(4px); }

/* "Explorar": the current site's scroll cue, a line that keeps drawing down */
.tc-hero__explore {
  position: absolute;
  bottom: 38px;
  left: clamp(28px, 3.6vw, 60px);
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--tc-grey);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
  transition: color .2s ease;
}
.tc-hero__explore:hover { color: var(--tc-black); }
.tc-hero__explore i { position: relative; width: 1px; height: 38px; overflow: hidden; background: var(--tc-line); }
.tc-hero__explore i::after { content: ""; position: absolute; inset: 0; background: var(--tc-black); animation: tc-explore 2.2s var(--tc-ease) infinite; }
@keyframes tc-explore { 0% { transform: translateY(-100%); } 60%, 100% { transform: translateY(100%); } }

/* ---------- Visual: the cover image, then the video ---------- */

.tc-hero__visual {
  position: relative;
  margin: 0;
  overflow: hidden;
  background: var(--tc-grey-light);
}

.tc-hero__visual > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 30% 50%;
  translate: var(--tc-px, 0px) var(--tc-py, 0px);
  scale: 1.04;
  transition: translate .8s var(--tc-ease);
}

/* the cover video, small (as in the model): the start image, then the
   video fades in over it once it is really playing */
.tc-hero__video {
  position: absolute;
  z-index: 4;
  right: 34px;
  bottom: 142px;
  width: clamp(240px, 21vw, 320px);
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border: 4px solid var(--tc-surface);
  border-radius: 16px;
  background: var(--tc-grey-light);
  box-shadow: 0 26px 50px -22px color-mix(in srgb, var(--tc-black) 70%, transparent);
}
.tc-hero__video img,
.tc-hero__video video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tc-hero__video video { opacity: 0; transition: opacity 1s ease; }
.tc-hero__video.is-playing video { opacity: 1; }

/* pause / play in the card (an autoplaying video must be stoppable) */
.tc-hero__play {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  display: grid;
  width: 50px;
  height: 50px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: color-mix(in srgb, var(--tc-white) 92%, transparent);
  color: var(--tc-black);
  cursor: pointer;
  translate: -50% -50%;
  transition: opacity .3s ease, scale .3s var(--tc-ease);
}
.tc-hero__play:hover { scale: 1.08; }
.tc-hero__video.is-playing .tc-hero__play { opacity: 0; }
.tc-hero__video.is-playing:hover .tc-hero__play,
.tc-hero__video.is-playing .tc-hero__play:focus-visible { opacity: 1; }
.tc-hero__play svg { width: 18px; height: 18px; fill: currentColor; }
.tc-hero__play .tc-icon-pause { display: none; }
.tc-hero__video.is-playing .tc-icon-play { display: none; }
.tc-hero__video.is-playing .tc-icon-pause { display: block; }

/* the black strip, crossing the seam into the copy column */
.tc-hero__stats {
  position: absolute;
  z-index: 5;
  bottom: 0;
  left: calc(var(--tc-split) - 96px);
  display: grid;
  grid-template-columns: 1fr 1.6fr .9fr;
  align-items: center;
  width: calc((100% - var(--tc-split)) * .74 + 96px);
  min-height: 112px;
  margin: 0;
  padding: 20px 44px;
  background: var(--tc-black);
  color: var(--tc-white);
}
.tc-hero__stats div { display: grid; gap: 8px; min-width: 0; padding-right: 16px; }
.tc-hero__stats div + div { padding-left: 20px; border-left: 1px solid color-mix(in srgb, var(--tc-white) 14%, transparent); }
.tc-hero__stats dt { color: var(--tc-grey-light); font-size: .7rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.tc-hero__stats dd { margin: 0; overflow: hidden; color: var(--tc-white); font-size: .92rem; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.tc-hero__stats a { transition: opacity .2s ease; }
.tc-hero__stats a:hover { opacity: .7; }

/* ---------- Entrance (once, after load): the process language ---------- */

.tc-hero.is-armed .tc-hero__copy-inner > *,
.tc-hero.is-armed .tc-hero__explore { opacity: 0; translate: 0 48px; filter: blur(6px); }
/* from the bottom up, as in MIRA: the photo is uncovered upwards, the strip
   rises from its edge */
.tc-hero.is-armed .tc-hero__visual { clip-path: inset(100% 0 0 0); }
.tc-hero.is-armed .tc-hero__visual > img { scale: 1.16; }
.tc-hero.is-armed .tc-hero__video { opacity: 0; translate: 0 40px; }
.tc-hero.is-armed .tc-hero__stats { clip-path: inset(100% 0 0 0); }

.tc-hero.is-in .tc-hero__copy-inner > *,
.tc-hero.is-in .tc-hero__explore { transition: opacity .9s var(--tc-ease), translate 1s var(--tc-ease), filter .9s var(--tc-ease); }
.tc-hero.is-in .tc-hero__visual { clip-path: inset(0); transition: clip-path 1.3s cubic-bezier(.65, 0, .35, 1); }
.tc-hero.is-in .tc-hero__visual > img { transition: scale 2.2s var(--tc-ease), translate .8s var(--tc-ease); }
.tc-hero.is-in .tc-hero__video { transition: opacity .9s var(--tc-ease) 1s, translate 1s var(--tc-ease) 1s; }
.tc-hero.is-in .tc-hero__stats { clip-path: inset(0); transition: clip-path 1s cubic-bezier(.65, 0, .35, 1) .8s; }
.tc-hero.is-in .tc-hero__copy-inner > :nth-child(1) { transition-delay: .2s; }
.tc-hero.is-in .tc-hero__copy-inner > :nth-child(2) { transition-delay: .32s; }
.tc-hero.is-in .tc-hero__copy-inner > :nth-child(3) { transition-delay: .5s; }
.tc-hero.is-in .tc-hero__copy-inner > :nth-child(4) { transition-delay: .62s; }
.tc-hero.is-in .tc-hero__explore { transition-delay: 1.1s; }

/* ---------- Responsive ---------- */

@media (max-width: 1280px) {
  .tc-nav { gap: 24px; }
  .tc-nav__links { gap: 22px; }
  .tc-hero, .tc-nav { --tc-split: 50%; }
  .tc-hero__stats { width: calc((100% - var(--tc-split)) + 96px - 34px); padding: 18px 30px; }
}

/* the links move into a panel behind the menu button */
@media (max-width: 1023.98px) {
  .tc-nav__toggle { display: grid; }
  .tc-nav__actions { grid-column: 3; justify-self: end; }
  .tc-nav__links {
    position: absolute;
    top: calc(100% + 8px);
    right: clamp(12px, 3vw, 24px);
    left: clamp(12px, 3vw, 24px);
    display: grid;
    gap: 2px;
    padding: 10px;
    border: 1px solid var(--tc-line);
    border-radius: 18px;
    background: var(--tc-surface);
    box-shadow: 0 24px 50px -24px color-mix(in srgb, var(--tc-black) 50%, transparent);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity .25s ease, transform .35s var(--tc-ease), visibility 0s .35s;
  }
  .tc-nav__links.is-open { opacity: 1; visibility: visible; transform: none; transition: opacity .25s ease, transform .35s var(--tc-ease), visibility 0s; }
  .tc-nav__links a { padding: 14px; border-radius: 12px; font-size: 1rem; }
  .tc-nav__links a::after { display: none; }
  .tc-nav__links a.is-active { background: var(--tc-soft); }
}

@media (max-width: 760px) {
  .tc-nav { --tc-nav-h: 68px; gap: 10px; padding: 0 16px; }
  .tc-nav.is-stuck { --tc-nav-h: 64px; }
  .tc-mark { width: 96px; }
  .tc-nav__cta { min-height: 40px; padding: 0 14px; font-size: .8rem; }
  .tc-lang__btn { min-height: 40px; padding: 0 9px; }
  .tc-lang__globe { display: none; }

  .tc-hero { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto; }
  .tc-hero__copy { padding: 124px 22px 48px; }
  /* "AUTOMATIZACIÓN" is the longest word: 14vw keeps it inside 320px screens */
  .tc-hero h1 { font-size: clamp(2.8rem, 14vw, 4.6rem); }
  .tc-hero__explore { display: none; }
  .tc-hero__visual { min-height: 440px; }
  .tc-hero__video { right: 16px; bottom: 150px; width: 190px; border-width: 3px; }
  .tc-hero__stats { left: 0; width: 100%; grid-template-columns: 1fr 1fr; gap: 12px 0; padding: 18px 22px; }
  .tc-hero__stats div:nth-child(2) { grid-column: 1 / -1; grid-row: 1; padding: 0; border: 0; }
  .tc-hero__stats div:first-child { padding-left: 0; }
  .tc-hero__stats div:last-child { padding-left: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .tc-hero.is-in *, .tc-hero__visual > img, .tc-hero__video video { transition: none !important; }
  .tc-hero__explore i::after { animation: none; }
}
