@import url('https://fonts.googleapis.com/css2?family=Instrument+Sans:wght@400;500;600;700&display=swap');

:root {
  --paper: #f7f3ea;
  --surface: #fffdf6;
  --ink: #1c1a14;
  --muted: #686257;
  --line: #e2d9c7;
  --accent: #9e4a2e;
  --accent-ink: #7a3620;
  --ui: "Instrument Sans", system-ui, sans-serif;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --dur-fast: 180ms;
  --dur-slow: 720ms;
}

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

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  background: var(--paper);
  color: var(--muted);
  font-family: var(--ui);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.gate {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(24px, 6vw, 56px) 20px;
}

.gate__card {
  width: min(440px, 100%);
  padding: 36px 28px 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 26px 60px -32px rgba(40, 32, 20, 0.32);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.gate__brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
}

.gate__mark {
  display: block;
  width: 36px;
  height: 36px;
}

.gate__word {
  display: block;
  width: min(168px, 52vw);
  height: auto;
}

.gate__headline {
  margin: 0 0 24px;
  font-size: clamp(1.7rem, 5vw, 2rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.gate__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.btn-yes,
.link-no,
.btn-leave {
  appearance: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  padding: 12px 20px;
  border-radius: 6px;
  font-family: var(--ui);
  font-size: 0.98rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition:
    background var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out),
    color var(--dur-fast) var(--ease-out);
}

.btn-yes {
  border: none;
  background: var(--accent);
  color: #fff;
}

.btn-yes:hover { background: var(--accent-ink); }

.link-no,
.btn-leave {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
}

.link-no:hover,
.btn-leave:hover {
  border-color: var(--ink);
}

.gate__denied {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 100%;
}

.gate__denied h2 {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.gate__denied p {
  margin: 0 0 4px;
  max-width: 28ch;
  font-size: 0.98rem;
  color: var(--muted);
}

.back-link {
  appearance: none;
  border: none;
  background: none;
  padding: 0;
  font-family: var(--ui);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

body.is-denied .gate__headline,
body.is-denied .gate__actions { display: none; }

body.is-denied .gate__denied { display: flex; }

.enter-veil {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--ink);
  color: var(--paper);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--dur-slow) var(--ease-out);
  pointer-events: none;
}

.enter-veil.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.enter-veil__text {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.enter-veil__sub {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #d78869;
}

@media (prefers-reduced-motion: reduce) {
  .enter-veil { transition: none; }
}

@media (prefers-reduced-motion: no-preference) {
  .reveal { animation: rise 560ms var(--ease-out) both; }
  .reveal.d1 { animation-delay: 40ms; }
  .reveal.d2 { animation-delay: 140ms; }
  .reveal.d3 { animation-delay: 240ms; }
  .reveal.d4 { animation-delay: 340ms; }

  @keyframes rise {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
  }
}
