/* TEIXIDÓ · teixido.co — sitio minimalista tipográfico (Board 16)
   Desktop 1440 → 6×4 · Tablet → 4×6 · Mobile 390 → 3×8 */

@font-face { font-family: "TypeXD"; font-weight: 300; font-style: normal; font-display: swap; src: url("../fonts/typexd-300.woff") format("woff"); }
@font-face { font-family: "TypeXD"; font-weight: 400; font-style: normal; font-display: swap; src: url("../fonts/typexd-400.woff") format("woff"); }
@font-face { font-family: "TypeXD"; font-weight: 500; font-style: normal; font-display: swap; src: url("../fonts/typexd-500.woff") format("woff"); }

:root {
  /* tokens (mismos nombres que el diseño: txd.*) */
  --txd-ink: #16171C;
  --txd-canvas: #F3F4F4;
  --txd-yellow: #F4FF75;
  --txd-lilac: #D1B5F7;
  --txd-ink-500: #4A4D57;
  --txd-ink-200: #A6AAB4;
  --muted: #5E6470;
  --hair: #16171C24;
  --hair-soft: #16171C1F;
  --hair-dark: #F3F4F41F;

  --font-family: "TypeXD", "TypeXD Text", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --w-light: 300; --w-regular: 400; --w-medium: 500;

  --expo: cubic-bezier(0.16, 1, 0.3, 1);
  --content: 1312px;
  --gutter: clamp(20px, 4.45vw, 64px);
  --pad-x: max(var(--gutter), calc((100% - var(--content)) / 2));
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--txd-ink); -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--txd-canvas); color: var(--txd-ink); font-family: var(--font-family); font-weight: var(--w-regular); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
p, h1, h2, ul { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
::selection { background: var(--txd-yellow); color: var(--txd-ink); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

.mono { font-family: var(--font-mono); font-size: 12px; line-height: 1.33; letter-spacing: 1.2px; text-transform: uppercase; }
.lbl { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -60px; z-index: 10; padding: 10px 14px; background: var(--txd-yellow); color: var(--txd-ink); font-size: 14px; }
.skip:focus { top: 12px; }

/* Fondos con grano */
.light { position: relative; background-color: var(--txd-canvas); background-image: url("../img/grain-light.png"); background-size: 320px 320px; }
.dark { position: relative; background-color: var(--txd-ink); color: var(--txd-canvas); isolation: isolate; }
.dark::before { content: ""; position: absolute; inset: 0; z-index: -1; background: url("../img/grain-dark.png") 0 0 / 320px 320px; opacity: .65; pointer-events: none; }

/* Variantes de contenido desktop / mobile (corte en 720 px) */
@media (min-width: 721px) { .only-narrow { display: none !important; } }
@media (max-width: 720px) { .only-wide { display: none !important; } }
.hero-m, .contact-m { display: flex; flex-direction: column; }

/* ── Botones ─────────────────────────────────────────── */
.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 0; height: 44px; padding: 0 22px; border-radius: 999px; background: var(--txd-ink); color: var(--txd-canvas); font: var(--w-medium) 14px/1 var(--font-family); white-space: nowrap; cursor: pointer;
  transition: background-color 150ms var(--expo), color 150ms var(--expo), transform 100ms var(--expo); }
.btn i { font-style: normal; display: inline-block; transition: transform 150ms var(--expo); }
.btn-lg { height: 52px; padding: 0 26px; }
.btn-block { display: flex; width: 100%; height: 46px; }
.pill { display: inline-flex; align-items: center; height: 36px; padding: 0 16px; border-radius: 999px; background: var(--txd-yellow); border: 1px solid var(--txd-ink); color: var(--txd-ink); font: var(--w-medium) 14px/1 var(--font-family); white-space: nowrap; transition: background-color 150ms var(--expo), color 150ms var(--expo); }
@media (hover: hover) {
  .btn:hover { background: var(--txd-yellow); color: var(--txd-ink); }
  .btn:hover i { transform: translateX(3px); }
  .pill:hover { background: var(--txd-ink); color: var(--txd-yellow); }
  .nav-link:hover, .contacto a:hover:not(.btn):not(.mail) { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
}
.btn:active { transform: scale(.98); }

/* Foco = caja de selección con 4 manijas */
:focus { outline: none; }
:focus-visible { outline: 1px solid currentColor; outline-offset: 4px; }
.btn, .pill, .mail { position: relative; }
.btn:focus-visible::after, .pill:focus-visible::after, .mail:focus-visible::after {
  content: ""; position: absolute; inset: -9px; pointer-events: none;
  --k: var(--txd-ink);
  background:
    linear-gradient(#fff, #fff) 1px 1px / 6px 6px, linear-gradient(#fff, #fff) calc(100% - 1px) 1px / 6px 6px,
    linear-gradient(#fff, #fff) 1px calc(100% - 1px) / 6px 6px, linear-gradient(#fff, #fff) calc(100% - 1px) calc(100% - 1px) / 6px 6px,
    linear-gradient(var(--k), var(--k)) 0 0 / 8px 8px, linear-gradient(var(--k), var(--k)) 100% 0 / 8px 8px,
    linear-gradient(var(--k), var(--k)) 0 100% / 8px 8px, linear-gradient(var(--k), var(--k)) 100% 100% / 8px 8px;
  background-repeat: no-repeat; }
.btn:focus-visible, .pill:focus-visible { outline-color: var(--txd-ink); }
.dark :focus-visible { outline-color: var(--txd-yellow); }

/* ── Header ──────────────────────────────────────────── */
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 24px; height: 80px; padding: 0 var(--pad-x); border-bottom: 1px solid var(--hair-soft); }
.brand { position: relative; display: block; width: 70px; height: 34px; color: var(--txd-ink); }
.brand svg { position: absolute; display: block; fill: currentColor; overflow: visible; }
.brand-letters { inset: 0; width: 100%; height: 100%; }
/* La corona ocupa su caja exacta dentro del monograma (viewBox 0 2.14 315.4 155.24) */
.brand-crown { left: 34.718%; top: 0; width: 30.564%; height: 25.509%; transform-origin: 50% 50%;
  animation: crownAxis 300s cubic-bezier(.4, 0, .2, 1) infinite; }
/* Spec 01: giro axial de 360° (efecto moneda) en 1,4 s, luego 298,6 s de reposo absoluto */
@keyframes crownAxis {
  0%, 99.53% { transform: perspective(200px) rotateY(0deg); }
  100% { transform: perspective(200px) rotateY(360deg); }
}
.header-meta { color: var(--muted); white-space: nowrap; }
.header-nav { display: flex; align-items: center; gap: 32px; }
.nav-link { font-size: 14px; line-height: 1.2; white-space: nowrap; }

/* ── Hero ────────────────────────────────────────────── */
.hero { display: flex; flex-direction: column; gap: 72px; padding: 112px var(--pad-x) 96px; }
.hero-claim { display: flex; flex-direction: column; gap: 28px; }
.claim { display: grid; row-gap: 8px; font-size: clamp(38px, 7.5vw, 108px); line-height: .96; letter-spacing: -0.04em; font-weight: var(--w-light); }
.claim b { font-weight: var(--w-medium); }
.claim > span { display: block; }
.claim .l2 { padding-left: 1.111em; }
.claim .l3 { padding-left: 2.074em; }
.hl { position: relative; isolation: isolate; display: inline-block; padding: 0 .167em .037em; font-weight: var(--w-medium); }
.hl::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--txd-yellow); }
.bajada { max-width: 820px; font-size: clamp(16px, 1.8vw, 26px); line-height: 1.38; letter-spacing: -0.023em; font-weight: var(--w-light); color: var(--txd-ink-500); }

.hero-bar { display: grid; grid-template-columns: 450fr 450fr 412fr; border-block: 1px solid var(--hair); }
.bar-col { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; padding: 28px 36px; border-right: 1px solid var(--hair-soft); }
.bar-col:first-child { padding-left: 0; }
.bar-col:last-child { padding-right: 0; border-right: 0; }
.bar-col p:not(.lbl) { font-size: 16px; line-height: 1.5; }
.bar-col .list { font-size: 16px; line-height: 1.6; }
.bar-cta { gap: 18px; }
.quiet { color: var(--txd-ink-500); }

/* ── Artefacto: caja de selección ─────────────────── */
.sel { position: absolute; left: 0; top: 0; width: 0; height: 0; pointer-events: none; --c: var(--txd-ink); --hf: #fff; --on: var(--txd-canvas); }
.sel.yellow { --c: var(--txd-yellow); --hf: var(--txd-canvas); --on: var(--txd-ink); }
.sel .e { position: absolute; background: var(--c); }
.sel .et { left: 0; right: 0; top: 0; height: 1px; transform-origin: left; }
.sel .el { top: 0; bottom: 0; left: 0; width: 1px; transform-origin: top; }
.sel .er { top: 0; bottom: 0; right: 0; width: 1px; transform-origin: top; }
.sel .eb { left: 0; right: 0; bottom: 0; height: 1px; transform-origin: left; }
.sel .h { position: absolute; width: 8px; height: 8px; background: var(--hf); border: 1px solid var(--c); }
.sel .h1 { left: -4px; top: -4px; } .sel .h2 { right: -4px; top: -4px; } .sel .h3 { left: -4px; bottom: -4px; } .sel .h4 { right: -4px; bottom: -4px; }
.sel-label { position: absolute; left: -4px; bottom: calc(100% + 8px); white-space: nowrap; font: var(--w-medium) 12px/16px var(--font-family); color: var(--c); }
.sel-size { position: absolute; left: 50%; top: calc(100% + 8px); transform: translateX(-50%); white-space: nowrap; padding: 2px 6px; font: var(--w-medium) 11px/1.2 var(--font-family); background: var(--c); color: var(--on); }
.sel-size:empty { display: none; }
.cursor { position: absolute; left: calc(100% - 3px); top: calc(100% - 3px); width: 56px; height: 36px; }
.cursor svg { position: absolute; left: 0; top: 0; width: 18px; height: 18px; fill: var(--c); }
.cursor b { position: absolute; left: 14px; top: 16px; padding: 3px 7px; font: var(--w-medium) 11px/1.2 var(--font-family); background: var(--c); color: var(--on); }
.cursor-txd { left: auto; right: 64px; top: 22px; }
.sel.on-cell .cursor-txd { left: calc(100% - 3px); right: auto; top: calc(100% - 3px); }
.cursor-txd svg { fill: var(--txd-lilac); }
.cursor-txd b { background: var(--txd-lilac); color: var(--txd-ink); }
.sel.travel { transition: transform 260ms var(--expo), width 260ms var(--expo), height 260ms var(--expo); }
@media (hover: none) { .cursor { display: none; } }

/* Entrada autoral del hero (Spec 04): 1,2 s, una vez por sesión */
.play .hero .sel .et, .play .hero .sel .eb { animation: trace 220ms var(--expo) 300ms both; }
.play .hero .sel .el, .play .hero .sel .er { --from: scaleY(0); animation: trace 220ms var(--expo) 300ms both; }
.play .hero .sel .er, .play .hero .sel .eb { animation-delay: 400ms; }
.play .hero .sel .h1 { animation: pop 120ms var(--expo) 300ms both; }
.play .hero .sel .h2, .play .hero .sel .h3 { animation: pop 120ms var(--expo) 480ms both; }
.play .hero .sel .h4 { animation: pop 120ms var(--expo) 600ms both; }
.play .hero .sel-label { animation: type 320ms steps(15, end) 540ms both; }
.play .hero .hl::before { animation: wipe 320ms var(--expo) 780ms both; }
.play .hero .sel-size { animation: rise 180ms var(--expo) 1000ms both; }
.play .hero .cursor { animation: arrive 600ms var(--expo) 600ms both; }
@keyframes trace { from { transform: var(--from, scaleX(0)); } }
@keyframes pop { from { opacity: 0; transform: scale(.4); } }
@keyframes type { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes wipe { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes rise { from { opacity: 0; transform: translate(-50%, -4px); } }
@keyframes arrive { from { opacity: 0; transform: translate(120px, 84px); } }
@keyframes fade { from { opacity: 0; } }

/* ── Section heads ───────────────────────────────────── */
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; }
.title { font-size: clamp(32px, 4.03vw, 58px); line-height: 1.2; letter-spacing: -0.04em; font-weight: var(--w-medium); }
.t-light { font-weight: var(--w-light); }

/* ── Marcas ──────────────────────────────────────────── */
.marcas { display: flex; flex-direction: column; gap: 48px; padding: 96px var(--pad-x); }
.marcas .title { color: var(--txd-canvas); }
.sectores { color: var(--txd-ink-200); line-height: 1.7; white-space: nowrap; }
.matrix-wrap { position: relative; }
.matrix { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); grid-auto-rows: 148px; border-top: 1px solid var(--hair-dark); border-left: 1px solid var(--hair-dark); }
.cell, .slot { border-right: 1px solid var(--hair-dark); border-bottom: 1px solid var(--hair-dark); }
.cell { display: grid; place-items: center; padding: 28px 30px; }
.cell img { width: 100%; max-width: 146px; height: 64px; object-fit: contain; opacity: .92; transition: opacity 150ms var(--expo); }
.cell:hover img, .cell:focus-visible img { opacity: 1; }
.cell:focus-visible { outline: 0; }
.slot { grid-column: span 2; display: flex; flex-direction: column; justify-content: space-between; gap: 12px; padding: 24px 30px; background: #F4FF7512; border-color: #F4FF7555; }
.slot .mono { color: var(--txd-yellow); }
.slot p:not(.mono) { font-size: 16px; line-height: 1.5; color: var(--txd-canvas); }
.matrix-note { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-top: -12px; color: var(--txd-ink-200); font-size: 14px; line-height: 1.4; }
.matrix-note .mono { white-space: nowrap; }

/* ── Contacto ────────────────────────────────────────── */
.contacto { display: flex; flex-direction: column; gap: 40px; padding: 112px var(--pad-x); }
.mailrow { position: relative; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 24px 28px; padding: 34px 0; border-block: 1.5px solid var(--txd-ink); }
.mail { font-size: clamp(34px, 6.12vw, 88px); line-height: 1.2; letter-spacing: -0.04em; font-weight: var(--w-light); }
.mail-side { display: flex; align-items: center; gap: 28px; font-size: 14px; color: var(--muted); }
.chip { pointer-events: auto; cursor: pointer; border: 0; font: var(--w-medium) 11px/1.2 var(--font-family); transition: background-color 150ms var(--expo), color 150ms var(--expo); }
.chip.ok { background: var(--txd-yellow); color: var(--txd-ink); outline: 1px solid var(--txd-ink); }
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; }
.contact-col { display: flex; flex-direction: column; gap: 10px; padding: 0 28px; }
.contact-col:first-child { border-right: 1px solid var(--hair-soft); }
.contact-col .big { font-size: 22px; line-height: 1.2; letter-spacing: -0.6px; font-weight: var(--w-medium); }
.contact-col .quiet { font-size: 14px; color: var(--muted); }

/* ── Footer ──────────────────────────────────────────── */
.site-footer { display: flex; flex-direction: column; gap: 44px; padding: 40px var(--pad-x) 48px; border-top: 3px solid var(--txd-yellow); }
.footer-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 24px; border-bottom: 1px solid var(--hair-dark); color: var(--txd-ink-200); }
.footer-top .up { color: var(--txd-yellow); }
.wordmark { position: relative; color: var(--txd-yellow); }
.wordmark-letters { display: block; width: 100%; height: auto; fill: var(--txd-canvas); }
/* Corona sobre la X: caja exacta 244.27..340.67 × 2.14..41.74 del viewBox 595.51 × 155.24 */
.wordmark txd-corona { position: absolute; left: 41.019%; top: 0; width: 16.188%; aspect-ratio: 96.4 / 39.6; display: block; line-height: 0; --corona-fondo: #16171C; }
.footer-legal { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 20px; border-top: 1px solid var(--hair-dark); color: var(--txd-ink-200); }

/* ── Tablet ──────────────────────────────────────────── */
@media (max-width: 1100px) {
  .header-meta { display: none; }
  .hero { gap: 56px; padding-top: 88px; padding-bottom: 80px; }
  .hero-bar { grid-template-columns: 1fr 1fr; }
  .bar-col:nth-child(2) { border-right: 0; padding-right: 0; }
  .bar-cta { grid-column: 1 / -1; padding: 28px 0; border-top: 1px solid var(--hair-soft); }
  .bar-cta .quiet { max-width: 60ch; }
  .section-head { flex-wrap: wrap; }
  .matrix { grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 132px; }
  .marcas { padding-top: 80px; padding-bottom: 80px; }
  .contacto { padding-top: 88px; padding-bottom: 88px; }
}

/* ── Mobile (diseño 390) ─────────────────────────────── */
@media (max-width: 720px) {

  .site-header { height: 64px; padding: 0 20px; }
  .brand { width: 56px; height: 28px; }
  .header-nav { gap: 8px; }
  .nav-link { display: inline-flex; align-items: center; height: 44px; padding: 0 8px; }
  .pill { height: 44px; }

  .hero { gap: 28px; padding: 48px 20px 44px; }
  .claim { row-gap: 6px; font-size: clamp(32px, 9.75vw, 44px); line-height: 1; }
  .claim .l2, .claim .l3 { padding-left: 0; }
  .hl { padding: .026em .21em .053em; }
  .bajada { font-size: 16px; line-height: 1.5; letter-spacing: 0; font-weight: var(--w-regular); }
  .hero-m { gap: 28px; }
  .disciplinas-m { display: flex; flex-direction: column; gap: 8px; padding: 16px 0; border-block: 1px solid var(--hair); }
  .disciplinas-m p:not(.lbl) { font-size: 14px; line-height: 1.5; }
  #selHero .sel-label, #selHero .sel-size, #selHero .cursor { display: none; }

  .title { font-size: 32px; line-height: 1.08; letter-spacing: -0.039em; }
  .t-light { font-weight: var(--w-medium); }

  .marcas { gap: 24px; padding: 48px 20px; }
  .matrix { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: 82px; }
  .cell { padding: 14px; }
  .cell img { max-width: 82px; height: 38px; }
  .slot { padding: 14px 16px; gap: 6px; }
  .slot p:not(.mono) { font-size: 14px; line-height: 1.35; }
  .matrix-note { margin-top: 0; }
  .cursor-txd { display: none; }

  .contacto { gap: 22px; padding: 48px 20px; }
  .mailrow { padding: 18px 0; }
  .mail { font-size: clamp(30px, 8.7vw, 40px); letter-spacing: -0.04em; }
  #selMail .sel-label, #selMail .sel-size { display: none; }
  .contact-m { gap: 4px; }
  .contact-m .quiet { font-size: 14px; line-height: 1.5; color: var(--muted); }
  .canales-m { display: flex; flex-wrap: wrap; column-gap: 20px; }
  .canales-m a { display: inline-flex; align-items: center; min-height: 44px; font-size: 14px; font-weight: var(--w-medium); }

  .site-footer { gap: 40px; padding: 28px 20px calc(32px + env(safe-area-inset-bottom)); }
  .footer-top { padding-bottom: 0; border-bottom: 0; }
  .footer-legal { display: block; padding-top: 0; border-top: 0; line-height: 1.6; }
  #selCrown .sel-size, #selCrown .cursor { display: none; }
  #selCrown .sel-label { font-size: 11px; }
}

/* ── Movimiento reducido: sin trazo, tipeo ni viaje; fade 150 ms; el hover solo cambia color ── */
@media (prefers-reduced-motion: reduce) {
  .play .hero .sel *, .play .hero .hl::before { animation: none !important; }
  .play .hero .sel { animation: fade 150ms linear both; }
  .sel.travel { transition: none; }
  .btn, .btn i, .pill { transition: background-color 150ms linear, color 150ms linear; }
  .btn:hover i, .btn:active { transform: none; }
  .brand-crown { animation: none; }
}
