:root {
  --paper: #ece8dd;
  --paper-2: #e3dece;
  --ink: #16150f;
  --ink-2: #57544a;
  --rule: #16150f;
  --hair: rgba(22, 21, 15, 0.18);
  --accent: #ff4f00;
  --ok: #1f9d4d;

  --display: "Big Shoulders Display", Impact, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --sans: "IBM Plex Sans", "Helvetica Neue", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #14130f;
    --paper-2: #1c1b16;
    --ink: #ece8dd;
    --ink-2: #a19d90;
    --rule: #ece8dd;
    --hair: rgba(236, 232, 221, 0.16);
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  min-height: 100vh;
  padding: 40px 16px 64px;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background-color: var(--paper);
  /* cuadrícula de papel técnico */
  background-image:
    linear-gradient(var(--hair) 1px, transparent 1px),
    linear-gradient(90deg, var(--hair) 1px, transparent 1px);
  background-size: 24px 24px;
  background-position: -1px -1px;
}

::selection { background: var(--accent); color: #fff; }

code {
  font-family: var(--mono);
  font-size: 0.88em;
  padding: 1px 5px;
  background: var(--paper-2);
  border: 1px solid var(--hair);
}

a { color: inherit; }

/* ---------- hoja ---------- */

.sheet {
  max-width: 920px;
  margin: 0 auto;
  background: var(--paper);
  border: 2px solid var(--rule);
  box-shadow: 10px 10px 0 var(--ink);
}

/* ---------- placa ---------- */

.plate {
  position: relative;
  padding: 28px 32px 32px;
  border-bottom: 2px solid var(--rule);
  overflow: hidden;
}

.plate::after {
  /* cinta de advertencia */
  content: "";
  position: absolute;
  top: 0; right: 0;
  width: 160px; height: 10px;
  background: repeating-linear-gradient(-45deg, var(--accent) 0 10px, transparent 10px 20px);
}

.plate__meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.plate__title {
  margin: 12px 0 20px;
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(4.5rem, 17vw, 10.5rem);
  line-height: 0.82;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}

.plate__title .dot { color: var(--accent); }

.plate__row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.plate__lead {
  max-width: 46ch;
  font-size: 1.05rem;
  color: var(--ink-2);
}

.status {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border: 2px solid var(--rule);
  font-family: var(--mono);
}

.status strong {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.status small { font-size: 0.75rem; color: var(--ink-2); }

.status__led {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--ok);
  animation: blink 2.4s ease-in-out infinite;
}

@keyframes blink {
  0%, 100% { box-shadow: 0 0 0 0 rgba(31, 157, 77, 0.55); }
  50% { box-shadow: 0 0 0 7px rgba(31, 157, 77, 0); }
}

/* ---------- bloques ---------- */

.block {
  padding: 28px 32px 32px;
  border-bottom: 2px solid var(--rule);
}

.label {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 20px;
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.6rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.label span {
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
}

.note {
  margin: -8px 0 20px;
  font-size: 0.9rem;
  color: var(--ink-2);
}

/* recursos */

.gauges {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--rule);
}

.gauge {
  display: flex;
  flex-direction: column;
  padding: 16px 18px 14px;
  border-right: 1px solid var(--rule);
}

.gauge:last-child { border-right: 0; }

.gauge__num {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(3rem, 8vw, 4.5rem);
  line-height: 0.9;
}

.gauge__unit {
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
}

/* stack */

.specs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  column-gap: 32px;
}

.specs div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--hair);
}

.specs dt {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.specs dd {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.92rem;
  text-align: right;
}

/* bitácora */

.log {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px 32px;
}

.log__group h3 {
  margin-bottom: 8px;
  padding-bottom: 6px;
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-bottom: 2px solid var(--rule);
}

.log__group ol { list-style: none; }

.log__group li {
  display: flex;
  gap: 12px;
  padding: 7px 0;
  font-size: 0.93rem;
  border-bottom: 1px dashed var(--hair);
  transition: padding-left 0.2s ease;
}

.log__group li:hover { padding-left: 6px; }

.log__group b {
  flex: none;
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  padding-top: 2px;
}

/* pie */

.foot {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 14px 32px;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--paper);
  background: var(--ink);
}

/* ---------- 404 ---------- */

.plate--error::after {
  width: 100%;
  background: repeating-linear-gradient(-45deg, var(--accent) 0 10px, transparent 10px 20px);
}

.code404 {
  position: relative;
  display: flex;
  margin: 16px 0 20px;
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(7rem, 34vw, 17rem);
  line-height: 0.8;
  letter-spacing: -0.02em;
}

.code404__zero {
  color: transparent;
  -webkit-text-stroke: 3px var(--accent);
  animation: flicker 4s steps(1) infinite 1.2s;
}

@keyframes flicker {
  0%, 100% { opacity: 1; }
  91% { opacity: 0.25; }
  93% { opacity: 1; }
  95% { opacity: 0.4; }
}

.stamp {
  position: absolute;
  right: 0;
  top: 50%;
  padding: 6px 14px 4px;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(1.1rem, 3.6vw, 2rem);
  letter-spacing: 0.06em;
  line-height: 1;
  text-transform: uppercase;
  color: var(--accent);
  border: 3px solid var(--accent);
  background: var(--paper);
  transform: translateY(-50%) rotate(-8deg) scale(1.6);
  opacity: 0;
  animation: stamp 0.35s cubic-bezier(0.3, 1.6, 0.5, 1) forwards 0.7s;
}

@keyframes stamp {
  to { opacity: 1; transform: translateY(-50%) rotate(-8deg) scale(1); }
}

.status--err .status__led {
  background: var(--accent);
  animation-name: blink-err;
  animation-duration: 1.2s;
}

@keyframes blink-err {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 79, 0, 0.6); }
  50% { box-shadow: 0 0 0 7px rgba(255, 79, 0, 0); }
}

.specs--single { grid-template-columns: 1fr; }

.specs dd code { word-break: break-all; }

.recovery {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px 32px;
  flex-wrap: wrap;
}

.steps {
  flex: 1 1 320px;
  list-style: none;
}

.steps li {
  display: flex;
  gap: 12px;
  padding: 7px 0;
  font-size: 0.93rem;
  border-bottom: 1px dashed var(--hair);
}

.steps b {
  flex: none;
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  padding-top: 2px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--paper);
  background: var(--ink);
  border: 2px solid var(--rule);
  box-shadow: 5px 5px 0 var(--accent);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover {
  transform: translate(-2px, -2px);
  box-shadow: 7px 7px 0 var(--accent);
}

.btn:active {
  transform: translate(5px, 5px);
  box-shadow: 0 0 0 var(--accent);
}

.btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

.btn__arrow { font-size: 1.1rem; transition: transform 0.15s ease; }
.btn:hover .btn__arrow { transform: translateX(4px); }

/* ---------- entrada ---------- */

.reveal {
  opacity: 0;
  transform: translateY(12px);
  animation: in 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
  animation-delay: calc(var(--d, 0) * 90ms + 80ms);
}

@keyframes in {
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .reveal { animation: none; opacity: 1; transform: none; }
  .status__led { animation: none; }
  .code404__zero { animation: none; }
  .stamp { animation: none; opacity: 1; transform: translateY(-50%) rotate(-8deg); }
}

/* ---------- móvil ---------- */

@media (max-width: 680px) {
  body { padding: 16px 16px 40px; }
  .sheet { box-shadow: 6px 6px 0 var(--ink); }
  .plate, .block { padding: 22px 18px 24px; }
  .foot { padding: 14px 18px; }
  .gauges { grid-template-columns: repeat(2, 1fr); }
  .gauge:nth-child(2) { border-right: 0; }
  .gauge:nth-child(-n + 2) { border-bottom: 1px solid var(--rule); }
  .specs, .log { grid-template-columns: 1fr; }
  .plate::after { width: 96px; }
  .plate--error::after { width: 100%; }
  .code404__zero { -webkit-text-stroke-width: 2px; }
  .btn { width: 100%; justify-content: space-between; }
}
