:root {
  --bg: #f4f8ff;
  --bg-card: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #dbe4f0;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-soft: #dbeafe;
  --gold: #93c5fd;
  --radius: 18px;
  --shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
  --cta-shadow: 0 14px 30px rgba(37, 99, 235, 0.28);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

html,
body {
  margin: 0;
  padding: 0;
  max-width: 100%;
}

html {
  background: var(--bg);
}

body {
  min-height: 100dvh;
  font-family: Manrope, system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(900px 420px at 50% -80px, #dbeafe 0%, transparent 68%),
    radial-gradient(520px 280px at 110% 88%, #bfdbfe 0%, transparent 70%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
svg {
  max-width: 100%;
  height: auto;
  display: block;
}

.view {
  width: 100%;
  min-height: 100dvh;
  max-width: 100%;
}

html[data-view="instruction"] #view-main,
html[data-view="main"] #view-instruction,
.view[hidden] {
  display: none !important;
}

html[data-view="instruction"] #view-instruction {
  display: flex !important;
  flex-direction: column;
}

html[data-view="main"] #view-main {
  display: flex;
}

html[data-view="main"],
html[data-view="main"] body {
  background: #06210f;
  color: #e7f6ec;
}

.view-main {
  --grove: #06210f;
  --grove-deep: #03150a;
  --moss: #0d3b22;
  --leaf: #1f8a4d;
  --leaf-hover: #167a42;
  --mist: #c5e6d0;
  --fog: #8fb89c;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(720px 380px at 50% -40px, #0f4a28 0%, transparent 64%),
    radial-gradient(420px 260px at 100% 100%, #0a331c 0%, transparent 70%),
    var(--grove);
  padding: calc(20px + var(--safe-top)) 22px calc(28px + var(--safe-bottom));
  font-family: Sora, Manrope, system-ui, sans-serif;
  color: #e7f6ec;
}

.grove-figure {
  position: absolute;
  left: 50%;
  top: -4%;
  z-index: 0;
  width: min(640px, 150%);
  max-width: none;
  height: auto;
  transform: translateX(-50%);
  pointer-events: none;
  -webkit-mask-image: linear-gradient(180deg, #000 42%, transparent 88%);
  mask-image: linear-gradient(180deg, #000 42%, transparent 88%);
}

.grove-veil {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(6, 33, 15, 0.18) 0%, rgba(6, 33, 15, 0.42) 38%, #06210f 78%),
    radial-gradient(circle at 50% 28%, rgba(46, 168, 98, 0.22), transparent 58%);
}

.intake {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  max-width: 390px;
  margin: 0 auto;
  width: 100%;
}

.intake-head {
  width: 100%;
}

.intake-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 0 14px;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(31, 138, 77, 0.22);
  border: 1px solid rgba(125, 255, 178, 0.18);
  color: #b8f0cc;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.intake-title {
  margin: 0;
  font-family: Sora, Manrope, system-ui, sans-serif;
  font-size: clamp(28px, 7vw, 36px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: #f3fff7;
}

.intake-lead {
  margin: 12px 0 0;
  font-size: 16px;
  line-height: 1.4;
  font-weight: 600;
  color: var(--mist);
}

.intake-hint {
  margin: 6px 0 0;
  font-size: 14px;
  line-height: 1.4;
  color: var(--fog);
}

.intake-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  margin-top: 28px;
}

.intake-note {
  margin: 28px 0 0;
  font-size: 13px;
  color: #7ea88a;
}

.action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 56px;
  padding: 14px 18px;
  border: 1.5px solid transparent;
  border-radius: 16px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
  cursor: pointer;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.action:active {
  transform: scale(0.98);
}

.action::before {
  content: "";
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  background-color: currentColor;
  -webkit-mask: url("assets/telegram.svg") center / 22px 22px no-repeat;
  mask: url("assets/telegram.svg") center / 22px 22px no-repeat;
}

.action-fill {
  background: linear-gradient(180deg, #2aa35c 0%, #167a42 100%);
  color: #f4fff8;
  box-shadow: 0 10px 22px rgba(22, 122, 66, 0.38);
}

.action-fill:hover,
.action-fill:focus-visible {
  background: #167a42;
}

.action-line {
  background: rgba(6, 33, 15, 0.55);
  color: #e7f6ec;
  border-color: #3d8f5c;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.22);
}

.action-line:hover,
.action-line:focus-visible {
  background: rgba(13, 59, 34, 0.85);
  border-color: #7dffb2;
}

@media (prefers-reduced-motion: reduce) {
  .hint-arrow {
    animation: none;
  }
}

.view-instruction {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: calc(24px + var(--safe-top)) 20px calc(28px + var(--safe-bottom));
}

.hint-arrow {
  position: fixed;
  top: 8px;
  right: 10px;
  z-index: 90;
  width: 36px;
  height: 54px;
  pointer-events: none;
  filter: drop-shadow(0 2px 2px rgba(15, 23, 42, 0.2));
  animation: hint-point 1.1s ease-in-out infinite;
}

@keyframes hint-point {
  0%, 100% {
    transform: translateY(6px);
  }
  50% {
    transform: translateY(-4px);
  }
}

.instruction-card {
  width: 100%;
  max-width: 390px;
  padding: 28px 20px 24px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
  text-align: center;
  overflow: visible;
}

.instruction-title {
  margin: 0;
  font-family: Fraunces, Georgia, serif;
  font-size: clamp(28px, 8vw, 36px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.instruction-lead {
  margin: 16px 0 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
}

.instruction-steps {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
  text-align: left;
  counter-reset: step;
}

.instruction-steps li {
  position: relative;
  padding: 8px 0 8px 36px;
}

.instruction-steps li::before {
  content: counter(step);
  counter-increment: step;
  position: absolute;
  left: 0;
  top: 8px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  line-height: 24px;
  text-align: center;
}

.menu-dots {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0 2px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1;
  vertical-align: middle;
}

.instruction-art {
  margin: 16px auto 0;
  max-width: 300px;
  overflow: visible;
  display: flex;
  justify-content: center;
}

.instruction-art img {
  margin: 0 auto;
  width: 100%;
  height: auto;
}

@media (max-width: 320px) {
  .view-main,
  .view-instruction {
    padding-left: 16px;
    padding-right: 16px;
  }

  .instruction-card {
    padding: 22px 14px 18px;
    border-radius: 22px;
  }

  .intake {
    padding: 0;
  }

  .instruction-art {
    max-width: 260px;
  }

  .instruction-title {
    font-size: 28px;
  }
}

@media (min-width: 430px) {
  .view-main {
    padding-top: calc(32px + var(--safe-top));
  }
}
