:root {
  --ink: #2b1c22;
  --ink-soft: #7a5f68;
  --bg: #f1e6d8;
  --panel: rgba(255, 250, 244, 0.86);
  --line: rgba(90, 48, 42, 0.12);
  --line-strong: rgba(90, 48, 42, 0.22);
  --plum: #7a3b52;
  --plum-deep: #5a2438;
  --copper: #d56a3c;
  --copper-deep: #b04828;
  --copper-glow: rgba(213, 106, 60, 0.36);
  --rose: #f4d6c8;
  --font: "Nunito", system-ui, sans-serif;
  --display: "Newsreader", Georgia, serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(60% 45% at 8% 0%, rgba(244, 196, 168, 0.7), transparent 58%),
    radial-gradient(50% 40% at 100% 8%, rgba(180, 120, 140, 0.28), transparent 52%),
    radial-gradient(70% 50% at 50% 110%, rgba(90, 36, 56, 0.12), transparent 58%),
    linear-gradient(180deg, #f7ece0 0%, #efe0cf 48%, #e7d3c2 100%);
}

.atmosphere::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    -18deg,
    rgba(90, 36, 56, 0.035) 0 1px,
    transparent 1px 22px
  );
  mask-image: linear-gradient(180deg, transparent, black 18%, black 78%, transparent);
  pointer-events: none;
}

.atmosphere::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.18;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
  pointer-events: none;
}

.header {
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.wordmark {
  margin: 0;
  font-family: var(--display);
  font-size: 1.7rem;
  font-weight: 700;
  font-style: italic;
  letter-spacing: -0.02em;
  color: var(--plum-deep);
}

.langs {
  display: inline-flex;
  gap: 0;
  padding: 3px;
  border-radius: 8px;
  background: rgba(255, 248, 240, 0.8);
  border: 1px solid var(--line-strong);
  box-shadow: 0 8px 20px rgba(90, 36, 56, 0.06);
}

.lang {
  appearance: none;
  border: 0;
  background: transparent;
  cursor: pointer;
  min-width: 44px;
  height: 32px;
  padding: 0 11px;
  border-radius: 6px;
  font-family: var(--font);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  transition: background 0.2s ease, color 0.2s ease;
}

.lang.is-active {
  background: var(--plum-deep);
  color: #f7ece0;
}

.lang:hover:not(.is-active) {
  color: var(--ink);
  background: rgba(90, 36, 56, 0.06);
}

.stage {
  max-width: 720px;
  margin: 0 auto;
  padding: 36px 24px 72px;
  display: grid;
  gap: 14px;
}

.shell {
  position: relative;
  padding: 24px 26px;
  border-radius: 12px;
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 18px 36px rgba(90, 36, 56, 0.07);
}

.intro h1 {
  margin: 0 0 10px;
  font-family: var(--display);
  font-size: clamp(2.6rem, 7vw, 4rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--plum-deep);
}

.kicker {
  margin: 0 0 14px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--plum);
}

.dek {
  margin: 0;
  max-width: 32rem;
  color: var(--ink-soft);
  font-size: 1.02rem;
}

.download {
  position: relative;
  width: 100%;
  appearance: none;
  border: 1px solid rgba(180, 255, 210, 0.55);
  cursor: pointer;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 68px;
  padding: 18px 24px;
  border-radius: 16px;
  font-family: var(--font);
  font-size: 1.14rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #04301a;
  background: linear-gradient(180deg, #5ef0a8 0%, #1fbf7a 48%, #12965c 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.5) inset,
    0 0 0 5px rgba(31, 191, 122, 0.16),
    0 16px 36px rgba(31, 191, 122, 0.42);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.download svg {
  width: 20px;
  height: 20px;
  position: relative;
  z-index: 1;
}

.download > span:not(.download-glow) {
  position: relative;
  z-index: 1;
}

.download-glow {
  position: absolute;
  inset: -40% -20%;
  background: radial-gradient(circle at 30% 40%, rgba(255, 255, 255, 0.6), transparent 42%);
  animation: drift 4.5s ease-in-out infinite;
}

.download:hover {
  transform: translateY(-2px);
  filter: brightness(1.06);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.55) inset,
    0 0 0 6px rgba(31, 191, 122, 0.2),
    0 22px 44px rgba(18, 150, 92, 0.48);
}

.download:active {
  transform: translateY(0);
}

.fineprint {
  margin: 14px 0 0;
  text-align: center;
  color: #8a6e74;
  font-size: 0.88rem;
}

.secret {
  display: grid;
  gap: 16px;
}

.secret-copy h2,
.guide h2 {
  margin: 0 0 4px;
  font-family: var(--display);
  font-size: 1.55rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--plum-deep);
}

.secret-copy p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.secret-panel {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.secret-panel.compact {
  margin-top: 12px;
}

.password {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  min-width: min(100%, 220px);
  margin: 0;
  padding: 18px 20px;
  border-radius: 16px;
  font-family: var(--mono);
  font-size: clamp(1.55rem, 4.5vw, 2rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-align: center;
  border: 2px solid #e08900;
  background: #fff4d6;
  color: #111;
  -webkit-text-fill-color: #111;
  box-shadow:
    0 0 0 5px rgba(224, 137, 0, 0.2),
    0 10px 24px rgba(180, 100, 0, 0.16);
  overflow: hidden;
}

.password.shimmer {
  color: #111 !important;
  -webkit-text-fill-color: #111 !important;
  background: #fff4d6 !important;
  animation: passwordPulse 1.8s ease-in-out infinite;
}

.password.shimmer::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(
    110deg,
    transparent 30%,
    rgba(255, 255, 255, 0.55) 50%,
    transparent 70%
  );
  transform: translateX(-130%);
  animation: sheen 2.4s ease-in-out infinite;
  mix-blend-mode: soft-light;
}

.copy {
  appearance: none;
  border: 1px solid var(--line-strong);
  cursor: pointer;
  min-height: 52px;
  min-width: 104px;
  padding: 0 18px;
  border-radius: 8px;
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--plum-deep);
  background: #fffaf4;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.copy:hover {
  border-color: rgba(122, 59, 82, 0.4);
  background: #fff;
}

.copy.is-done {
  background: var(--plum-deep);
  border-color: transparent;
  color: #f7ece0;
}

.guide h2 {
  margin-bottom: 16px;
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.step-card {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 12px;
  align-items: start;
  padding: 14px 12px;
  border-radius: 8px;
  background: rgba(255, 248, 240, 0.7);
  border: 1px solid rgba(90, 36, 56, 0.08);
}

.step-card.is-key {
  border-color: rgba(217, 154, 43, 0.55);
  background: linear-gradient(180deg, rgba(255, 244, 214, 0.96), rgba(255, 250, 236, 0.96));
  box-shadow:
    0 0 0 1px rgba(240, 184, 74, 0.2) inset,
    0 0 24px rgba(240, 184, 74, 0.18);
}

.index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 8px;
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--plum);
  background: rgba(122, 59, 82, 0.08);
}

.step-card.is-key .index {
  color: #5a3400;
  background: linear-gradient(180deg, #ffe08a, #f0b84a);
  border: 1px solid rgba(255, 220, 150, 0.8);
}

.step-body {
  min-width: 0;
}

.timeline p {
  margin: 0;
  padding-top: 6px;
  color: #3a2438;
  font-size: 0.98rem;
  font-weight: 600;
}

.timeline em {
  font-style: italic;
  font-family: var(--display);
  font-weight: 700;
  color: var(--plum);
}

@keyframes passwordPulse {
  0%, 100% {
    color: #111;
    -webkit-text-fill-color: #111;
    box-shadow:
      0 0 0 5px rgba(232, 154, 18, 0.22),
      0 12px 28px rgba(200, 120, 20, 0.18);
  }
  50% {
    color: #000;
    -webkit-text-fill-color: #000;
    box-shadow:
      0 0 0 7px rgba(232, 154, 18, 0.32),
      0 14px 32px rgba(200, 120, 20, 0.28);
  }
}

@keyframes sheen {
  0%, 50% { transform: translateX(-130%); }
  100% { transform: translateX(130%); }
}

@keyframes drift {
  0%, 100% { transform: translateX(-6%) translateY(0); }
  50% { transform: translateX(10%) translateY(-4%); }
}

@media (max-width: 560px) {
  .stage {
    padding-top: 24px;
  }

  .secret-panel {
    flex-direction: column;
    align-items: stretch;
  }

  .copy {
    width: 100%;
  }

  .step-card {
    grid-template-columns: 40px 1fr;
  }
}
