/* ============================================================
   R3 JOB · layout — escenario de portada y armazón de la app
   ============================================================ */

.shell { width: var(--shell); margin-inline: auto; }
.shell.narrow { max-width: 780px; }

/* ============================ FONDO ============================ */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: var(--z-bg);
  pointer-events: none;
  overflow: clip;
}
.backdrop__halo {
  position: absolute;
  inset: -20% -10% auto -10%;
  height: 130vh;
  background: var(--halo);
}
.backdrop__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
  background-size: 68px 68px;
  mask-image: radial-gradient(130% 90% at 50% 0%, #000 0%, transparent 78%);
  -webkit-mask-image: radial-gradient(130% 90% at 50% 0%, #000 0%, transparent 78%);
}
.backdrop__noise {
  position: absolute;
  inset: 0;
  opacity: 0.5;
  mix-blend-mode: overlay;
}

/* ============================ NAV ============================ */
.nav {
  position: sticky;
  top: 0;
  z-index: var(--z-nav);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  background: var(--glass);
  border-bottom: 1px solid transparent;
  transition: border-color var(--d-sm) var(--ease-out), background-color var(--d-sm) var(--ease-out);
}
.nav.stuck { border-bottom-color: var(--glass-line); }
.nav__in {
  width: var(--shell);
  margin-inline: auto;
  height: 56px;
  display: flex;
  align-items: center;
  gap: var(--sp-4);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.0625rem;
  letter-spacing: -0.03em;
  color: var(--ink);
  text-decoration: none;
  flex: none;
}
.brand:hover { text-decoration: none; }
.brand__mark {
  /* El SVG ya trae su propia placa con degradado: aquí no se pinta
     ningún fondo, o quedaría un cuadrado dentro de otro. */
  width: 26px; height: 26px; flex: none;
  display: grid; place-items: center;
  border-radius: 8px;
  box-shadow: 0 2px 10px -4px var(--cobre-600);
}
.brand__mark svg { width: 26px; height: 26px; display: block; }
.nav__spacer { flex: 1; }
.nav__links { display: none; gap: 2px; }
@media (min-width: 900px) { .nav__links { display: flex; } }
.nav__links a {
  color: var(--ink-2); font-size: var(--t-xs); font-weight: 600;
  padding: 7px 12px; border-radius: var(--r-full);
  transition: color var(--d-xs) var(--ease-out), background-color var(--d-xs) var(--ease-out);
}
.nav__links a:hover { color: var(--ink); background: var(--surface-2); text-decoration: none; }

.icon-btn {
  width: 34px; height: 34px; flex: none;
  display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: var(--r-full);
  background: transparent; color: var(--ink-2); cursor: pointer;
  transition: color var(--d-xs) var(--ease-out), border-color var(--d-xs) var(--ease-out),
              background-color var(--d-xs) var(--ease-out), transform var(--d-xs) var(--ease-spring);
}
.icon-btn:hover { color: var(--ink); border-color: var(--line-2); background: var(--surface-2); }
.icon-btn:active { transform: scale(0.92); }
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn.avatar { position: relative; overflow: visible; padding: 0; text-decoration: none; }
.icon-btn.avatar.conectado { border-color: var(--acc); color: var(--acc); }
.icon-btn.avatar img { border-radius: 50%; }

/* ============================ HÉROE ============================ */
.hero {
  position: relative;
  z-index: var(--z-content);
  min-height: calc(100dvh - 56px);
  display: grid;
  align-content: center;
  padding: var(--sp-8) 0 var(--sp-7);
}
.hero__in { display: grid; gap: var(--sp-6); justify-items: center; text-align: center; }
.hero h1 {
  font-size: var(--t-mega);
  letter-spacing: -0.055em;
  font-weight: 700;
  line-height: 0.93;
}
.hero__sub {
  max-width: 34ch;
  font-size: clamp(1.05rem, 2.1vw, 1.45rem);
  color: var(--ink-2);
  letter-spacing: -0.016em;
  line-height: 1.4;
}
.hero__cta { display: flex; flex-wrap: wrap; gap: var(--sp-3); justify-content: center; }
.hero__meta {
  display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-5);
  justify-content: center; font-size: var(--t-xs); color: var(--ink-3);
}
.hero__meta span { display: inline-flex; align-items: center; gap: 7px; }
.hero__meta span::before {
  content: ""; width: 5px; height: 5px; border-radius: 50%;
  background: var(--data); flex: none;
}

/* Maqueta de dispositivo del héroe */
.stage { position: relative; width: min(340px, 78vw); margin-top: var(--sp-3); }
.stage__glow {
  position: absolute; inset: -18% -30%;
  background: radial-gradient(58% 46% at 50% 46%, var(--acc-soft), transparent 72%);
  filter: blur(14px);
}
.phone {
  position: relative;
  border-radius: 42px;
  padding: 9px;
  background: linear-gradient(168deg, #2B2F34, #0C0E10 42%, #23272B);
  box-shadow: var(--shadow-3), inset 0 0 0 1px rgba(255, 255, 255, 0.10);
}
.phone__screen {
  border-radius: 34px;
  overflow: hidden;
  background: var(--bg-deep);
  aspect-ratio: 9 / 18.6;
  position: relative;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07);
}
.phone__notch {
  position: absolute; top: 9px; left: 50%; transform: translateX(-50%);
  width: 78px; height: 19px; border-radius: 99px; background: #05070800;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.07);
  background-color: #050708;
  z-index: 4;
}
.phone__screen iframe, .phone__screen .fakeapp { width: 100%; height: 100%; border: 0; }

/* Contenido de la maqueta: una mini-app fingida y animada */
.fakeapp {
  display: flex; flex-direction: column; gap: 7px;
  padding: 34px 12px 14px;
  background: var(--bg-deep);
  color: var(--ink);
  font-size: 10px;
}
.fakeapp__bar {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 8.5px; color: var(--ink-3); letter-spacing: 0.09em; text-transform: uppercase;
}
.fakeapp__big {
  font-family: var(--mono); font-size: 27px; font-weight: 700; letter-spacing: -0.04em;
  color: var(--ink); line-height: 1;
}
.fakeapp__row {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 9px; padding: 6px 8px; font-size: 9px;
}
.fakeapp__row .n { font-family: var(--mono); color: var(--ink-2); }
.fakeapp__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 2px; }
.fakeapp__tile {
  background: var(--surface); border: 1px solid var(--line); border-radius: 9px;
  padding: 7px; display: grid; gap: 3px;
}
.fakeapp__tile b { font-size: 13px; font-family: var(--mono); letter-spacing: -0.03em; }
.fakeapp__tile span { font-size: 7.5px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.08em; }
.fakeapp__tile.acc { border-color: var(--acc); background: var(--acc-soft); }
.fakeapp__tile.acc b { color: var(--acc); }

.scroll-hint {
  display: grid; justify-items: center; gap: 6px;
  font-size: var(--t-2xs); letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--ink-3);
}
.scroll-hint i {
  width: 1px; height: 30px;
  background: linear-gradient(var(--ink-3), transparent);
}

/* ============================ SECCIONES DE PORTADA ============================ */
.band {
  position: relative;
  z-index: var(--z-content);
  padding: var(--sp-9) 0;
}
.band.tight { padding: var(--sp-8) 0; }
.band__head { display: grid; gap: var(--sp-3); max-width: 30ch; margin-bottom: var(--sp-7); }
.band__head.center { max-width: 40ch; margin-inline: auto; text-align: center; justify-items: center; }
.band__head h2 { font-size: var(--t-xxl); letter-spacing: -0.042em; }

.rule { height: 1px; background: var(--line); border: 0; }

/* Rejilla de herramientas de la portada */
.showcase {
  display: grid;
  gap: var(--sp-3);
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
}
.showcase__card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: var(--sp-4);
  display: grid;
  gap: 6px;
  align-content: start;
  text-align: left;
  color: inherit;
  cursor: pointer;
  overflow: hidden;
}
.showcase__card:hover { text-decoration: none; border-color: var(--line-2); }
.showcase__card .k {
  font-family: var(--mono); font-size: var(--t-2xs); color: var(--ink-3);
  letter-spacing: 0.08em;
}
.showcase__card h4 { font-size: 0.9375rem; letter-spacing: -0.018em; }
.showcase__card p { font-size: var(--t-xs); color: var(--ink-2); line-height: 1.42; }
.showcase__card .ico {
  width: 30px; height: 30px; border-radius: 9px;
  display: grid; place-items: center; margin-bottom: 2px;
  background: var(--acc-soft); color: var(--acc);
}
.showcase__card .ico svg { width: 16px; height: 16px; }
.showcase__card[data-fam="datos"] .ico { background: var(--data-soft); color: var(--data); }

/* Cifras grandes */
.specs {
  display: grid;
  gap: var(--sp-5);
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  padding: var(--sp-6) 0;
  border-block: 1px solid var(--line);
}
.spec { display: grid; gap: 4px; }
.spec b {
  font-family: var(--display); font-size: clamp(2.4rem, 5.4vw, 3.9rem);
  font-weight: 700; letter-spacing: -0.05em; line-height: 1;
}
.spec span { font-size: var(--t-xs); color: var(--ink-3); letter-spacing: 0.03em; }

/* Cierre */
.closing { text-align: center; display: grid; gap: var(--sp-5); justify-items: center; }
.closing h2 { font-size: var(--t-mega); letter-spacing: -0.055em; line-height: 0.94; }

.foot {
  position: relative; z-index: var(--z-content);
  border-top: 1px solid var(--line);
  padding: var(--sp-6) 0 var(--sp-7);
  font-size: var(--t-xs); color: var(--ink-3);
  display: grid; gap: var(--sp-2);
}
.foot a { color: var(--ink-2); }

/* ============================ ARMAZÓN DE LA APP ============================ */
.app { display: none; position: relative; z-index: var(--z-content); }
body.is-app .app { display: block; }
body.is-app .stagewrap { display: none; }
body.is-app { overflow-x: hidden; }

.appbar {
  position: sticky; top: 0; z-index: var(--z-nav);
  background: var(--glass);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--glass-line);
}
.appbar__in {
  width: var(--shell); margin-inline: auto;
  min-height: 56px; display: flex; align-items: center; gap: var(--sp-3);
  padding-block: 8px;
}
.appbar__title { flex: 1; min-width: 0; display: grid; }
.appbar__title .k { font-size: var(--t-2xs); letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); }
.appbar__title h1 {
  font-size: 1.125rem; letter-spacing: -0.025em; line-height: 1.2;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.appbar__clock { font-family: var(--mono); font-size: var(--t-xs); color: var(--ink-2); flex: none; }
@media (max-width: 560px) { .appbar__clock { display: none; } }

.applayout {
  width: var(--shell); margin-inline: auto;
  display: grid; gap: var(--sp-5);
  padding: var(--sp-5) 0 var(--sp-9);
  align-items: start;
}
@media (min-width: 1040px) {
  .applayout { grid-template-columns: 232px minmax(0, 1fr); gap: var(--sp-6); }
}

/* Índice de herramientas */
.toolnav { display: none; }
@media (min-width: 1040px) {
  .toolnav {
    display: block; position: sticky; top: 72px;
    max-height: calc(100dvh - 92px); overflow-y: auto;
    padding-right: 4px;
  }
}
.toolnav__group { margin-bottom: var(--sp-4); }
.toolnav__group > h5 {
  font-size: var(--t-2xs); letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--ink-3); font-weight: 700; padding: 0 10px var(--sp-2);
}
.toolnav a {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 10px; border-radius: var(--r-sm);
  font-size: var(--t-sm); color: var(--ink-2); font-weight: 500;
  transition: background-color var(--d-xs) var(--ease-out), color var(--d-xs) var(--ease-out);
}
.toolnav a:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.toolnav a.on { background: var(--acc-soft); color: var(--acc); font-weight: 650; }
.toolnav a svg { width: 15px; height: 15px; flex: none; opacity: 0.85; }

/* Selector de herramienta en móvil */
.toolpick { display: grid; gap: var(--sp-2); }
@media (min-width: 1040px) { .toolpick { display: none; } }

.view { min-width: 0; display: grid; gap: var(--sp-4); }
.view__head { display: grid; gap: 5px; }
.view__head h2 { font-size: var(--t-xl); letter-spacing: -0.032em; }
.view__head p { color: var(--ink-2); font-size: var(--t-sm); max-width: 68ch; }
/* En móvil el nombre de la herramienta ya está en la barra superior:
   repetirlo en grande se come media pantalla útil. */
@media (max-width: 899px) {
  .view__head { display: none; }
  .applayout { padding-top: var(--sp-3); gap: var(--sp-3); }
  .toolpick select { padding: 7px 10px; font-size: var(--t-sm); }
}

/* Rejilla de inicio de la app */
.hub { display: grid; gap: var(--sp-3); grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); }
