:root {
  --red: #ec0b0b;
  --red-deep: #b80000;
  --ink: #140000;
  --paper: #fff4ef;
  --display: "League Spartan", "Arial Black", system-ui, sans-serif;
  --serif: "Cormorant Garamond", "Times New Roman", serif;
}

*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; }

body {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--red);
  color: var(--ink);
  font-family: var(--display);
  -webkit-font-smoothing: antialiased;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

a { color: inherit; text-decoration: none; }

:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 6px;
}

/* ---------- Layout ---------- */

.page {
  min-height: 100vh;
  min-height: 100dvh;
  max-width: 1280px;
  margin: 0 auto;
  padding: clamp(20px, 4vw, 48px) clamp(16px, 6vw, 96px);
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: clamp(32px, 5vw, 56px);
}

/* ---------- Nav ---------- */

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.nav__item {
  font-weight: 800;
  font-size: clamp(0.95rem, 2.2vw, 1.5rem);
  letter-spacing: -0.01em;
  white-space: nowrap;
  padding-block: 4px;
  background-image: linear-gradient(var(--ink), var(--ink));
  background-size: 0 2px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size 0.2s ease;
}

.nav__item:hover { background-size: 100% 2px; }

/* ---------- Hero ---------- */

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.brand {
  margin: 0;
  font-weight: 900;
  font-size: clamp(3.5rem, 15vw, 11rem);
  line-height: 0.85;
  letter-spacing: -0.02em;
  padding-left: 0.18em; /* balances the TM so the word sits centred */
}

.brand__tm {
  font-size: 0.16em;
  font-weight: 800;
  vertical-align: top;
  margin-left: 0.15em;
  position: relative;
  top: -0.35em;
}

.tagline {
  margin: 0.6em 0 0;
  font-weight: 800;
  font-size: clamp(1rem, 2.4vw, 1.6rem);
  letter-spacing: -0.01em;
}

.doors {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  margin-top: clamp(48px, 9vw, 110px);
  padding-inline: clamp(0px, 4vw, 64px);
}

.door {
  font-weight: 900;
  font-size: clamp(2.2rem, 7.5vw, 5.5rem);
  line-height: 1;
  letter-spacing: -0.01em;
  transition: transform 0.15s ease;
}

.door:first-child { justify-self: start; }
.door:last-child { justify-self: end; }

.coin {
  width: clamp(90px, 16.5vw, 210px);
}

.coin { transition: transform 0.15s ease; }
.coin:hover { transform: scale(1.06) rotate(-6deg); }
.coin:active { transform: scale(0.95); }

.coin img {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 10px 18px rgba(20, 0, 0, 0.45));
}

.door:hover { transform: scale(1.04); }
.door:active { transform: scale(0.97); }

/* ---------- Footer ---------- */

.footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(12px, 2vw, 24px);
}

.footer__stamp {
  width: clamp(84px, 13vw, 150px);
  height: auto;
  transform: rotate(-4deg);
}

.footer__line {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(0.95rem, 1.8vw, 1.3rem);
  display: flex;
  align-items: center;
  gap: 16px;
}

.footer__arrow {
  width: clamp(28px, 5vw, 64px);
  height: 2px;
  background: var(--ink);
  position: relative;
  flex: none;
}

.footer__arrow::after {
  content: "";
  position: absolute;
  right: -1px;
  top: -4px;
  border-left: 9px solid var(--ink);
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
}

/* ---------- "System failure" dialog ---------- */

.failure {
  border: 0;
  padding: 0;
  background: none;
  color: var(--ink);
  overflow: visible;
  text-align: center;
}

.failure::backdrop {
  background: rgba(20, 0, 0, 0.8);
}

.failure__stamp {
  background: var(--red-deep);
  border: 6px solid var(--paper);
  outline: 2px solid var(--paper);
  outline-offset: 6px;
  color: var(--paper);
  padding: 28px clamp(24px, 6vw, 56px) 24px;
  transform: rotate(-6deg);
  animation: slam 0.35s cubic-bezier(.2, 1.6, .4, 1) both;
}

.failure__title {
  margin: 0;
  font-weight: 900;
  font-size: clamp(2.2rem, 9vw, 4.5rem);
  line-height: 0.95;
  letter-spacing: -0.02em;
}

.failure__text {
  margin: 10px 0 0;
  font-family: var(--serif);
  font-size: clamp(1.2rem, 3.5vw, 1.8rem);
}

.failure__image {
  display: block;
  width: auto;
  height: auto;
  max-width: min(86vw, 520px);
  max-height: 72vh;
  border: 6px solid var(--paper);
  outline: 2px solid var(--paper);
  outline-offset: 6px;
  transform: rotate(-3deg);
  animation: slam-image 0.35s cubic-bezier(.2, 1.6, .4, 1) both;
}

.failure__image--wide { max-width: min(86vw, 680px); }

.failure__close {
  margin-top: 40px;
  padding: 10px 28px;
  background: var(--paper);
  color: var(--ink);
  font-weight: 800;
  font-size: 1rem;
}

.failure__close:hover { background: #fff; }
.failure__close:focus-visible { outline-color: var(--paper); }

@keyframes slam {
  from { opacity: 0; transform: rotate(-6deg) scale(1.8); }
  to   { opacity: 1; transform: rotate(-6deg) scale(1); }
}

@keyframes slam-image {
  from { opacity: 0; transform: rotate(-3deg) scale(1.6); }
  to   { opacity: 1; transform: rotate(-3deg) scale(1); }
}

/* ---------- Small screens ---------- */

@media (max-width: 560px) {
  .nav { flex-wrap: wrap; justify-content: center; column-gap: 20px; }
  .doors { grid-template-columns: 1fr; justify-items: center; gap: 20px; }
  .door:first-child, .door:last-child { justify-self: center; }
  .footer { flex-direction: column; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
