/* La pantalla es el frente de una camisa: canesú arriba con la marquilla,
   y la tapeta con cuatro botones, uno por rol. */

@font-face {
  font-family: "Barlow Semi Condensed";
  src: url("fuentes/barlow-semi-condensed-600.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}

:root {
  color-scheme: light;
  --tela: #8fb9ee;
  --tapeta: #a9caf4;
  --canesu: #5f94d8;
  --costura: #2f62a6;
  --tinta: #0f2342;
  --blanco: #ffffff;
  --ancho-tapeta: 112px;
}

* { box-sizing: border-box; min-width: 0; }
html, body { height: 100%; }

body {
  margin: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  background: var(--tela);
  color: var(--tinta);
  font: 600 16px/1.3 "Barlow Semi Condensed", "Arial Narrow", Arial, sans-serif;
}

/* Canesú y marquilla */
.canesu {
  display: grid;
  place-items: center;
  padding: calc(24px + env(safe-area-inset-top, 0px)) 16px 24px;
  background: var(--canesu);
  border-bottom: 2px dashed var(--costura);
}

.marquilla {
  margin: 0;
  padding: 12px 30px;
  background: var(--blanco);
  font-size: 28px;
  line-height: 1.1;
  /* puntadas que sujetan la marquilla a cada lado */
  background-image:
    repeating-linear-gradient(var(--costura) 0 5px, transparent 5px 9px),
    repeating-linear-gradient(var(--costura) 0 5px, transparent 5px 9px);
  background-size: 2px calc(100% - 12px);
  background-position: 8px 6px, calc(100% - 8px) 6px;
  background-repeat: no-repeat;
}

.version {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--tinta);
  opacity: 0.75;
}

/* Tapeta */
.tapeta {
  position: relative;
  display: grid;
  grid-template-rows: repeat(4, minmax(92px, 1fr));
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.tapeta::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--ancho-tapeta);
  background: var(--tapeta);
  border-right: 2px dashed var(--costura);
}

/* Los cuatro botones */
.rol {
  position: relative;
  display: grid;
  grid-template-columns: var(--ancho-tapeta) 1fr;
  align-items: center;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.rol svg {
  justify-self: center;
  width: 66px;
  height: 90px;
  transition: transform .12s;
}

.rol .texto {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 16px 0 20px;
  font-size: clamp(26px, 8vw, 34px);
  line-height: 1.1;
}

.rol + .rol .texto { border-top: 1px solid var(--canesu); }
.rol small { font-size: 16px; }
.rol small:not(:empty) { margin-top: 4px; }

.rol:active .texto { background: var(--tapeta); }
.rol:active svg { transform: scale(.9); }
.rol:focus-visible { outline: 3px solid var(--tinta); outline-offset: -5px; }
@media (hover: hover) { .rol:hover .texto { background: var(--tapeta); } }

[data-rol="supervisor"] svg { color: #d43d2c; }
[data-rol="operario"] svg { color: #f4b922; }
[data-rol="patinador"] svg { color: #16855a; }
[data-rol="administrador"] svg { color: #1c3157; }

.ojal { fill: var(--costura); }
.sombra { fill: #0f2342; opacity: .28; }
.borde { fill: none; stroke: #fff; stroke-width: 3; opacity: .35; }
.fondo { fill: #000; opacity: .14; }
.agujeros { fill: #0f2342; }
.hilo { stroke: #fff; stroke-width: 5; stroke-linecap: round; }

/* PC, tablet y celular acostado: la tapeta pasa a horizontal */
@media (min-width: 640px) {
  .tapeta {
    --ancho-tapeta: clamp(120px, 50vh, 460px);
    grid-template-rows: 1fr;
    grid-template-columns: repeat(4, 1fr);
  }
  .tapeta::before {
    inset: 0 0 auto 0;
    width: auto;
    height: var(--ancho-tapeta);
    border-right: 0;
    border-bottom: 2px dashed var(--costura);
  }
  .rol {
    grid-template-columns: 1fr;
    grid-template-rows: var(--ancho-tapeta) 1fr;
    text-align: center;
  }
  .rol svg {
    width: calc(var(--ancho-tapeta) * .55);
    height: calc(var(--ancho-tapeta) * .75);
  }
  .rol .texto {
    justify-content: flex-start;
    padding: clamp(16px, 5vh, 44px) 8px 16px;
    font-size: clamp(20px, 2.8vw, 38px);
  }
  .rol + .rol .texto { border-top: 0; border-left: 1px solid var(--canesu); }
}

@media (max-height: 480px) {
  .canesu { padding-block: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .rol svg { transition: none; }
}
