/* Sistema de diseño Atelier (Sa-Payroll docs/16-diseno-atelier.md), con detalles textiles:
   trama de tela en el fondo, hilo en el encabezado y costuras en las tarjetas. Solo tema claro. */
:root {
  --paper: #f6f4ef; --paper2: #efebe2; --card: #fffefb;
  --line: #e0dace; --line2: #cec6b6;
  --ink: #1a1714; --ink-soft: #6b645c; --ink-faint: #a39b90;
  --clay: #b8553a; --clay-deep: #93422c; --clay-wash: #f3e6df;
  --serif: 'Newsreader', Georgia, serif;
  --sans: 'Archivo', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  background-color: var(--paper);
  /* Trama de tela: hilos finos en ambos sentidos. */
  background-image:
    repeating-linear-gradient(0deg, rgba(26, 23, 20, .022) 0 1px, transparent 1px 5px),
    repeating-linear-gradient(90deg, rgba(26, 23, 20, .022) 0 1px, transparent 1px 5px);
}
main { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 32px; }
:focus-visible { outline: 2px solid var(--clay); outline-offset: 3px; }

.label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
kbd {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border: 1px solid var(--line2);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--card);
  font: 500 11px/1 var(--sans);
  color: var(--ink-soft);
}

/* ── Barra superior ─────────────────────────────── */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 22px 32px;
}
.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand-logo { display: block; height: 40px; width: auto; }
.now { display: flex; align-items: baseline; gap: 14px; color: var(--ink-soft); }
.now-date { font-size: 13px; }
.now-time {
  font: 400 22px/1 var(--serif);
  color: var(--ink);
  letter-spacing: -.01em;
  font-variant-numeric: tabular-nums;
}
.now-time:not(:empty)::before {
  content: '';
  display: inline-block;
  width: 6px; height: 6px;
  margin: 0 10px 4px 0;
  border-radius: 50%;
  background: var(--clay);
  animation: pulse 2.4s ease-in-out infinite;
}

/* ── Encabezado ─────────────────────────────────── */
.hero { position: relative; padding: 56px 0 64px; }
.thread {
  position: absolute;
  inset: 10px -32px auto;
  width: calc(100% + 64px);
  height: 220px;
  pointer-events: none;
}
.thread path {
  fill: none;
  stroke: var(--clay);
  stroke-width: 1.2;
  stroke-dasharray: 7 7;
  opacity: .35;
  vector-effect: non-scaling-stroke;
  animation: sew 30s linear infinite;
}
.hero-inner { position: relative; }
.hero-kicker { display: flex; align-items: center; gap: 12px; margin: 0 0 22px; }
.hero-kicker::before { content: ''; width: 28px; height: 1px; background: var(--clay); }
h1 {
  margin: 0;
  font: 300 clamp(44px, 7.2vw, 92px)/1 var(--serif);
  letter-spacing: -.035em;
}
h1 span, h1 em { display: block; }
h1 em { font-style: italic; color: var(--clay); margin-top: .08em; }

/* ── Tarjetas ───────────────────────────────────── */
.apps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 22px;
}
.app {
  --fg: var(--ink);
  --fg-soft: var(--ink-soft);
  --fg-faint: var(--ink-faint);
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  padding: 26px 28px 24px;
  min-height: 440px;
  overflow: hidden;
  color: var(--fg);
  text-decoration: none;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 1px 0 rgba(26, 23, 20, .03);
  transition: transform .45s var(--ease), box-shadow .45s var(--ease), border-color .3s, color .3s;
  animation: rise .8s var(--ease) both;
}
.app:nth-child(2) { animation-delay: .08s; }
.app:nth-child(3) { animation-delay: .16s; }
/* Al pasar el mouse la tarjeta se tiñe de tinta desde abajo. */
.app::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--ink);
  clip-path: inset(100% 0 0 0);
  transition: clip-path .55s var(--ease);
}
.seam {
  position: absolute;
  inset: 9px;
  border: 1px dashed var(--line2);
  border-radius: 3px;
  pointer-events: none;
  transition: border-color .3s, inset .45s var(--ease);
}
.app-head { display: flex; align-items: center; justify-content: space-between; }
.num { font: 400 15px/1 var(--serif); color: var(--clay); letter-spacing: .02em; }
.app kbd { transition: opacity .3s; }

.art {
  width: 100%;
  max-width: 230px;
  height: auto;
  margin: 26px auto 30px;
  overflow: visible;
}
.art * {
  fill: none;
  stroke: var(--fg);
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  transition: stroke .3s;
}
.art .fill { fill: var(--clay-wash); stroke: none; transition: fill .3s; }
.art .accent { stroke: var(--clay); stroke-width: 1.8; }
.art .dot { fill: var(--clay); }
.art .stitch { stroke-dasharray: 4 4; stroke-width: 1.2; }

.app .label { color: var(--fg-faint); transition: color .3s; }
.name {
  margin: 8px 0 10px;
  font: 400 40px/1 var(--serif);
  letter-spacing: -.025em;
}
.desc { flex: 1; line-height: 1.55; color: var(--fg-soft); max-width: 32ch; transition: color .3s; }
.app-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  transition: border-color .3s;
}
.url { font-size: 12.5px; color: var(--fg-soft); overflow-wrap: anywhere; transition: color .3s; }
.go {
  flex: none;
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border: 1px solid var(--line2);
  border-radius: 50%;
  transition: background .3s, border-color .3s, transform .45s var(--ease);
}
.go svg {
  width: 18px; height: 18px;
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke .3s, transform .45s var(--ease);
}

.app:hover, .app:focus-visible, .app.is-opening {
  --fg: var(--paper);
  --fg-soft: #cfc8bd;
  --fg-faint: #8f877c;
  transform: translateY(-6px);
  border-color: var(--ink);
  box-shadow: 0 30px 50px -28px rgba(26, 23, 20, .55);
}
.app:hover::before, .app:focus-visible::before, .app.is-opening::before { clip-path: inset(0 0 0 0); }
.app:hover .seam, .app:focus-visible .seam, .app.is-opening .seam { border-color: rgba(246, 244, 239, .22); inset: 7px; }
.app:hover .art .fill, .app:focus-visible .art .fill, .app.is-opening .art .fill { fill: rgba(184, 85, 58, .22); }
.app:hover .app-foot, .app:focus-visible .app-foot, .app.is-opening .app-foot { border-color: rgba(246, 244, 239, .16); }
.app:hover kbd, .app:focus-visible kbd { opacity: 0; }
.app:hover .go, .app:focus-visible .go, .app.is-opening .go { background: var(--clay); border-color: var(--clay); transform: rotate(-45deg); }
.app:hover .go svg, .app:focus-visible .go svg, .app.is-opening .go svg { stroke: #fff; }

.hint {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 24px;
  margin: 28px 0 72px;
  color: var(--ink-faint);
  font-size: 12.5px;
}
.hint-keys { display: inline-flex; align-items: center; gap: 6px; }

/* ── Pie ────────────────────────────────────────── */
.foot {
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 18px 24px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--ink-faint);
}

/* ── Movimiento ─────────────────────────────────── */
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes sew { to { stroke-dashoffset: -280; } }
@keyframes pulse { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before { animation: none !important; transition: none !important; }
}

/* ── Pantallas chicas ───────────────────────────── */
@media (hover: none) {
  .app kbd, .hint-keys { display: none; }
}
@media (max-width: 720px) {
  main { padding: 0 16px; }
  .top { padding: 16px; }
  .now-date { display: none; }
  .brand-logo { height: 32px; }
  .now-time { font-size: 18px; }
  .hero { padding: 36px 0 40px; }
  .thread { height: 160px; inset: 20px -16px auto; width: calc(100% + 32px); }
  .apps { grid-template-columns: 1fr; gap: 14px; }
  .app { min-height: 0; padding: 22px 22px 20px; }
  .art { max-width: 170px; margin: 16px auto 22px; }
  .name { font-size: 34px; }
  .hint { margin-bottom: 48px; }
}
