/* Train · Daletrain. Negro cálido, crema, naranja Daletrain; líneas finas y esquinas rectas. */
:root {
  color-scheme: dark;
  --bg: #0c0c0b;
  --surface: #131311;
  --line: #2c2a26;
  --line-strong: #46423b;
  --text: #f1efe8;
  --muted: #a9a59c;
  --faint: #77736b;
  --brand: #ff5f1f;
  --brand-hover: #ff7a42;
  --brand-ink: #140600;
  --brand-tint: #2a1208;
  --datadog-ink: #b79cf0;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --condensed: "Roboto Condensed", "Arial Narrow", "Helvetica Neue Condensed", "Liberation Sans Narrow", Bahnschrift, "DIN Condensed", "Segoe UI", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-family: var(--sans);
}
* { box-sizing: border-box }
html { -webkit-text-size-adjust: 100% }
body { margin: 0; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; background: var(--bg); color: var(--text); line-height: 1.5 }
.bg-field { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none }
a { color: var(--text) }
button, a { touch-action: manipulation }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px }
.skip { position: absolute; left: 12px; top: -60px; z-index: 5; padding: 10px 14px; background: var(--brand); color: var(--brand-ink); font-weight: 700; text-decoration: none }
.skip:focus { top: 12px }

/* Cabecera */
.t-header, main, .t-footer { width: 100%; max-width: 960px; margin-inline: auto; padding-inline: clamp(18px, 5vw, 40px) }
.t-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: calc(16px + env(safe-area-inset-top)); padding-bottom: 16px; border-bottom: 1px solid var(--line) }
.t-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; min-height: 44px }
.t-brand img { display: block; width: 32px; height: 32px }
.t-brand-name { display: grid; line-height: 1 }
.t-brand-name strong { font-family: var(--condensed); font-stretch: condensed; font-size: 1.45rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase }
.t-brand-name small { display: inline-flex; align-items: center; gap: 5px; margin-top: 4px; font-family: var(--mono); font-size: .66rem; letter-spacing: .08em; text-transform: uppercase; color: var(--brand) }
.t-brand-name small::before, .t-dot { content: ""; display: inline-block; width: 7px; height: 7px; flex: none; background: var(--brand) }
.t-actions { display: flex; align-items: center; gap: 4px }
.t-link { min-height: 44px; padding: 8px 10px; border: 0; background: none; color: var(--text); font: inherit; font-weight: 650; cursor: pointer; text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 4px; white-space: nowrap }
.t-link:hover { text-decoration-color: currentColor }
#session-button { border: 1px solid var(--line-strong); padding-inline: 14px; text-decoration: none }
#session-button:hover { border-color: var(--brand); color: var(--brand) }
body[data-session="out"] #session-button { border-color: var(--brand); color: var(--brand) }

/* Contenido */
main { flex: 1; padding-top: clamp(28px, 6vw, 56px); padding-bottom: 48px; outline: none }
.t-loading { color: var(--muted); font-family: var(--mono); font-size: .875rem }
.t-kicker { margin: 0 0 12px; font-family: var(--mono); font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted) }
.t-kicker::before { content: "▸ "; color: var(--brand) }
h1, h2 { font-family: var(--condensed); font-stretch: condensed; text-transform: uppercase; font-weight: 800; margin: 0 }
.t-hero h1, .t-hello h1 { font-size: clamp(1.7rem, 6.6vw, 4.6rem); line-height: .98; letter-spacing: -.01em; max-width: 16ch; overflow-wrap: break-word }
@media (min-width: 720px) { .t-hero h1, .t-hello h1 { font-size: clamp(3rem, 6.4vw, 4.6rem) } }
.t-hero h1 { color: var(--brand) }
.t-hero-sep { color: var(--brand) }
.t-hero-line { display: block; color: var(--text) }
.t-sub { margin: 18px 0 0; max-width: 54ch; color: var(--muted); font-size: 1.02rem }
.t-mono, code { font-family: var(--mono); font-size: .86em }
.t-hero-actions { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-top: 26px }
.t-sign { font-family: var(--mono); font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted) }
.t-sign b { color: var(--brand); font-weight: 700 }
.t-notice { margin: 16px 0 0; padding: 10px 12px; border-left: 2px solid var(--brand); background: var(--surface); color: var(--text) }

/* Botones */
.t-primary { min-height: 48px; padding: 12px 22px; border: 1px solid var(--brand); border-radius: 0; background: var(--brand); color: var(--brand-ink); font: inherit; font-weight: 750; letter-spacing: .02em; cursor: pointer }
.t-primary:hover { background: var(--brand-hover); border-color: var(--brand-hover) }
.t-primary:active { transform: translateY(1px) }
.t-full { width: 100% }
.t-text { min-height: 44px; padding: 8px 0; border: 0; background: none; color: var(--text); font: inherit; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--line-strong); cursor: pointer }
.t-text:hover { text-decoration-color: var(--brand) }
.t-back { min-height: 44px; margin: -6px 0 18px; padding: 8px 0; border: 0; background: none; color: var(--muted); font: inherit; cursor: pointer }
.t-back:hover { color: var(--text) }

/* Catálogo: tabla de estado */
.t-catalog { margin-top: clamp(40px, 8vw, 72px) }
.t-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line-strong) }
.t-section-head h2 { font-size: 1.35rem; letter-spacing: .04em }
.t-meta { font-family: var(--mono); font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--faint) }
.t-rows { list-style: none; margin: 0; padding: 0 }
.t-rows li { border-bottom: 1px solid var(--line) }
.t-row { display: grid; grid-template-columns: 2.2rem 1fr; grid-template-areas: "index main" "index status"; gap: 4px 12px; padding: 18px 0; color: inherit; text-decoration: none }
.t-row-index { grid-area: index; padding-top: 3px; font-family: var(--mono); font-size: .75rem; color: var(--faint) }
.t-row-main { grid-area: main; display: grid; gap: 2px }
.t-row-vendor { font-family: var(--mono); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted) }
.t-datadog { color: var(--datadog-ink) }
.t-row-name { font-family: var(--condensed); font-stretch: condensed; font-size: 1.75rem; font-weight: 800; line-height: 1.05; text-transform: uppercase }
.t-row-title { font-weight: 650 }
.t-row-detail { color: var(--muted); font-size: .92rem }
.t-row-status { grid-area: status; margin-top: 8px; font-family: var(--mono); font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap }
.t-row-status[data-status="active"] { color: var(--brand) }
.t-row-status[data-status="soon"] { color: var(--faint) }
.t-row-status[data-status="soon"]::before { content: "○ " }
.t-row-status[data-status="active"]::before { content: "● " }
a.t-row:hover .t-row-name { color: var(--brand) }
a.t-row:hover { background: linear-gradient(90deg, var(--brand-tint), transparent 70%) }
.t-row.is-soon .t-row-name { color: var(--muted) }
@media (min-width: 720px) {
  .t-row { grid-template-columns: 3rem 1fr 11rem; grid-template-areas: "index main status"; align-items: center; padding: 22px 0 }
  .t-row-main { grid-template-columns: 10rem 1fr; grid-template-areas: "vendor title" "name detail"; column-gap: 24px }
  .t-row-vendor { grid-area: vendor }
  .t-row-name { grid-area: name }
  .t-row-title { grid-area: title }
  .t-row-detail { grid-area: detail }
  .t-row-status { margin-top: 0; text-align: right; padding-right: 8px }
}

/* Acceso */
.t-access { max-width: 460px }
.t-access h1 { font-size: clamp(2rem, 8vw, 3rem); line-height: .98 }
.t-alert { margin: 16px 0 0; padding: 10px 12px; border: 1px solid var(--brand); background: var(--brand-tint); color: var(--text) }
.t-panel { margin-top: 22px; padding: 18px; border: 1px solid var(--line-strong); background: color-mix(in srgb, var(--surface) 92%, transparent) }
.t-panel > p:first-child { margin-top: 0 }
.t-note { margin: 10px 0 0; color: var(--muted); font-size: .875rem }
.t-status { min-height: 1.5em; margin: 8px 0 0; color: var(--muted); font-size: .9rem }
.t-status:empty { min-height: 0 }
.t-form { display: grid; gap: 14px }
.t-form label { display: grid; gap: 6px; font-weight: 600; font-size: .92rem }
.t-form input { min-height: 48px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 0; background: var(--bg); color: var(--text); font: inherit; font-size: 1rem }
.t-form input:focus { border-color: var(--brand); outline: none; box-shadow: inset 0 -2px 0 var(--brand) }
.t-secondary { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap }
.t-demo { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px }
.t-demo button { width: 100%; min-height: 56px; display: grid; gap: 2px; padding: 10px 14px; border: 1px solid var(--line-strong); border-radius: 0; background: var(--bg); color: var(--text); font: inherit; text-align: left; cursor: pointer }
.t-demo button:hover { border-color: var(--brand) }
.t-demo .t-mono { color: var(--muted); font-size: .8rem }
.t-oauth { display: grid; gap: 8px; margin-top: 22px }
.t-oauth-button { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 10px 14px; border: 1px solid var(--line-strong); background: var(--text); color: #141413; font-weight: 650; text-decoration: none }
.t-oauth-button:hover { border-color: var(--brand); box-shadow: inset 0 -2px 0 var(--brand) }
.t-divider { display: flex; align-items: center; gap: 12px; margin: 20px 0 0; font-family: var(--mono); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--faint) }
.t-divider::before, .t-divider::after { content: ""; flex: 1; height: 1px; background: var(--line) }
.t-divider + .t-panel { margin-top: 14px }
.t-steps { margin: 0; padding-left: 1.3em; display: grid; gap: 12px }
.t-qr { margin: 12px 0; line-height: 0 }
.t-qr svg { width: 200px; height: 200px }

/* Pie */
.t-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 20px; padding-top: 18px; padding-bottom: calc(22px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); color: var(--faint); font-size: .8rem }
.t-footer a { color: var(--muted) }
.t-dot { margin-right: 8px; vertical-align: 1px }

/* Instalar app (install.js) */
.install-link[hidden], #session-button[hidden] { display: none }
.install-link.install-pulse { animation: install-pulse 1.6s ease-in-out 3 }
@keyframes install-pulse { 50% { color: var(--brand) } }
.install-help { width: min(440px, calc(100vw - 32px)); padding: 22px; border: 1px solid var(--line-strong); border-radius: 0; background: var(--surface); color: var(--text) }
.install-help::backdrop { background: #080807cc }
.install-help h2 { margin: 0 0 6px; font-size: 1.5rem }
.install-help p { color: var(--muted) }
.install-help ol { margin: 12px 0 18px; padding-left: 1.3em; display: grid; gap: 10px; line-height: 1.45 }
.install-glyph { color: var(--brand) }

@media (max-width: 420px) {
  .install-word { display: none }
  .t-link { padding-inline: 8px }
}
@media (prefers-reduced-motion: reduce) {
  .install-link.install-pulse { animation: none }
  .t-primary:active { transform: none }
}

/* Páginas legales (aviso-legal.html, privacidad.html) */
.t-legal { max-width: 760px }
.t-legal h1 { font-size: clamp(2rem, 7vw, 3.4rem); line-height: 1 }
.t-legal .t-sub { margin-top: 10px; font-family: var(--mono); font-size: .8rem; letter-spacing: .04em }
.t-legal section { margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--line) }
.t-legal h2 { font-size: 1.3rem; letter-spacing: .03em; margin-bottom: 8px }
.t-legal p, .t-legal li { color: #d6d3ca; max-width: 68ch }
.t-legal ul { padding-left: 1.2em }
.t-legal li { margin: .5rem 0 }
.t-legal a { text-underline-offset: 3px; text-decoration-color: var(--brand) }
.t-footer a[aria-current="page"] { color: var(--text) }

/* Banner: mensajes rotativos (train.js, pitches) */
.t-pitch { margin-top: 22px; max-width: 46rem; padding-left: 16px; border-left: 2px solid var(--brand) }
.t-pitch-stage { display: grid }
.t-pitch-stage > p { grid-area: 1 / 1; margin: 0; font-family: var(--condensed); font-stretch: condensed; font-weight: 800; text-transform: uppercase; font-size: clamp(1.15rem, 4.6vw, 1.9rem); line-height: 1.12; letter-spacing: .005em; color: var(--text); text-wrap: balance }
.t-pitch-sizer { visibility: hidden }
.t-pitch-text { transition: opacity .26s ease, transform .26s ease }
.t-pitch-text.is-leaving { opacity: 0; transform: translateY(6px) }
.t-pitch em { font-style: normal; color: var(--brand) }
.t-pitch-bar { display: flex; align-items: center; gap: 12px; margin-top: 10px }
.t-pitch-count { font-family: var(--mono); font-size: .72rem; letter-spacing: .08em; color: var(--faint); min-width: 7ch }
.t-pitch-progress { flex: 1; max-width: 160px; height: 1px; background: var(--line-strong); overflow: hidden }
.t-pitch-progress > span { display: block; height: 100%; width: 100%; background: var(--brand); transform-origin: left; animation: t-pitch-progress 5.5s linear forwards }
.t-pitch[data-state="paused"] .t-pitch-progress > span { animation-play-state: paused }
@keyframes t-pitch-progress { from { transform: scaleX(0) } to { transform: scaleX(1) } }
.t-pitch-toggle { min-height: 44px; padding: 8px 4px; border: 0; background: none; color: var(--muted); font-family: var(--mono); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; cursor: pointer; text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 4px }
.t-pitch-toggle:hover { color: var(--text); text-decoration-color: var(--brand) }
.t-pitch-toggle[aria-pressed="true"] { color: var(--brand) }
.t-hello-sign { margin: 16px 0 0 }
@media (prefers-reduced-motion: reduce) {
  .t-pitch-text { transition: none }
  .t-pitch-progress > span { animation: none; transform: scaleX(1); opacity: .35 }
}
