:root {
  --ink: #163247;
  --ink-soft: #4a6780;
  --bg: #dcecf5;
  --panel: rgba(255, 255, 255, 0.78);
  --line: rgba(46, 120, 160, 0.16);
  --line-strong: rgba(46, 120, 160, 0.28);
  --sea: #2aa8c8;
  --sea-deep: #1a7fa0;
  --foam: #e8f7fc;
  --sand: #fff8ef;
  --emerald: #1fbf7a;
  --emerald-deep: #12965c;
  --emerald-glow: rgba(31, 191, 122, 0.35);
  --gold: #d99a2b;
  --font: "Manrope", system-ui, sans-serif;
  --display: "Fraunces", 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(70% 50% at 15% -5%, rgba(120, 210, 235, 0.55), transparent 55%),
    radial-gradient(55% 45% at 95% 5%, rgba(255, 220, 170, 0.4), transparent 50%),
    radial-gradient(60% 40% at 50% 100%, rgba(90, 190, 210, 0.28), transparent 55%),
    linear-gradient(165deg, #eef8fc 0%, #d9ebf5 42%, #cfe3ef 100%);
}

.atmosphere::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.35) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.35) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, black 20%, transparent 75%);
  pointer-events: none;
}

.atmosphere::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.22;
  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.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.45'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
  pointer-events: none;
}

.header {
  max-width: 760px;
  margin: 0 auto;
  padding: 28px 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  animation: enter 0.7s ease both;
}

.wordmark {
  margin: 0;
  font-family: var(--display);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #13445c;
}

.langs {
  display: inline-flex;
  gap: 4px;
  padding: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--line-strong);
  box-shadow: 0 10px 28px rgba(40, 110, 150, 0.1);
  backdrop-filter: blur(10px);
}

.lang {
  appearance: none;
  border: 0;
  background: transparent;
  cursor: pointer;
  min-width: 46px;
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink-soft);
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.lang.is-active {
  background: linear-gradient(180deg, #4ec4df, var(--sea-deep));
  color: #fff;
  box-shadow: 0 6px 16px rgba(26, 127, 160, 0.28);
}

.lang:hover:not(.is-active) {
  color: var(--ink);
}

.stage {
  max-width: 760px;
  margin: 0 auto;
  padding: 28px 24px 64px;
  display: grid;
  gap: 16px;
}

.shell {
  position: relative;
  padding: 22px;
  border-radius: 24px;
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.88), rgba(240, 249, 252, 0.82));
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 16px 40px rgba(50, 120, 160, 0.12);
  animation: enter 0.8s ease both;
}

.shell::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  border: 1px solid rgba(80, 160, 190, 0.18);
}

.intro { animation-delay: 0.04s; }

.kicker {
  margin: 0 0 12px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--sea-deep);
}

.intro h1 {
  margin: 0 0 12px;
  font-family: var(--display);
  font-size: clamp(2.5rem, 7vw, 3.7rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 0.98;
  color: #12384c;
}

.dek {
  margin: 0;
  max-width: 34rem;
  color: var(--ink-soft);
  font-size: 1.05rem;
}

.action { animation-delay: 0.08s; }

.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: 66px;
  padding: 18px 24px;
  border-radius: 18px;
  font-family: var(--font);
  font-size: 1.12rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #04301a;
  background: linear-gradient(180deg, #5ef0a8 0%, var(--emerald) 48%, var(--emerald-deep) 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.45) inset,
    0 0 0 4px rgba(31, 191, 122, 0.12),
    0 16px 34px var(--emerald-glow);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.download svg {
  width: 22px;
  height: 22px;
  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.55), transparent 42%);
  animation: drift 4.5s ease-in-out infinite;
}

.download:hover {
  transform: translateY(-2px);
  filter: brightness(1.04);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.5) inset,
    0 0 0 5px rgba(31, 191, 122, 0.16),
    0 20px 42px rgba(31, 191, 122, 0.42);
}

.download:active {
  transform: translateY(0);
}

.fineprint {
  margin: 14px 0 0;
  text-align: center;
  color: #5f7f93;
  font-size: 0.9rem;
}

.secret {
  display: grid;
  gap: 16px;
  animation-delay: 0.12s;
}

.secret-copy h2 {
  margin: 0 0 4px;
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #14384c;
}

.secret-copy p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.secret-panel {
  display: flex;
  align-items: center;
  gap: 12px;
  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;
  text-shadow: none;
  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;
  background-image: none !important;
  -webkit-background-clip: border-box !important;
  background-clip: border-box !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: 56px;
  min-width: 112px;
  padding: 0 20px;
  border-radius: 14px;
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 700;
  color: #12384c;
  background: linear-gradient(180deg, #ffffff, #e7f4fa);
  box-shadow: 0 8px 18px rgba(40, 110, 150, 0.1);
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.copy:hover {
  border-color: rgba(42, 168, 200, 0.45);
  box-shadow: 0 0 18px rgba(42, 168, 200, 0.18);
}

.copy.is-done {
  background: linear-gradient(180deg, #5ef0a8, #12965c);
  border-color: transparent;
  color: #04301a;
}

.guide { animation-delay: 0.16s; }

.guide h2 {
  margin: 0 0 16px;
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #14384c;
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.step-card {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 10px;
  align-items: start;
  padding: 16px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(232, 245, 250, 0.9));
  border: 1px solid rgba(80, 160, 190, 0.22);
  box-shadow: 0 10px 24px rgba(50, 120, 160, 0.08);
}

.step-card.is-key {
  border-color: rgba(217, 154, 43, 0.55);
  background:
    linear-gradient(180deg, rgba(255, 244, 214, 0.95), rgba(255, 250, 236, 0.95));
  box-shadow:
    0 0 0 1px rgba(240, 184, 74, 0.2) inset,
    0 0 24px rgba(240, 184, 74, 0.18),
    0 12px 28px rgba(50, 120, 160, 0.08);
}

.index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #0f5f78;
  background: rgba(42, 168, 200, 0.14);
  border: 1px solid rgba(42, 168, 200, 0.35);
}

.step-card.is-key .index {
  color: #5a3400;
  background: linear-gradient(180deg, #ffe08a, #f0b84a);
  border-color: rgba(255, 220, 150, 0.8);
  box-shadow: 0 0 16px rgba(240, 184, 74, 0.35);
}

.step-body {
  min-width: 0;
}

.timeline p {
  margin: 0;
  padding-top: 5px;
  color: #23485c;
  font-size: 1rem;
  font-weight: 600;
}

.timeline em {
  font-style: normal;
  font-weight: 800;
  color: #0f5f78;
}

.footer {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 24px 40px;
  color: #6a889b;
  font-size: 0.85rem;
  font-family: var(--display);
}

@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%, 45% { transform: translateX(-130%); }
  100% { transform: translateX(130%); }
}

@keyframes drift {
  0%, 100% { transform: translateX(-8%) translateY(0); }
  50% { transform: translateX(12%) translateY(-6%); }
}

@keyframes enter {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 560px) {
  .stage {
    padding-top: 20px;
  }

  .secret-panel {
    flex-direction: column;
    align-items: stretch;
  }

  .copy {
    width: 100%;
  }

  .step-card {
    grid-template-columns: 48px 1fr;
  }
}
