/* Gachi stylesheet: home.css. Home screen / hero. */
/* Extracted verbatim from index.html. Load order is significant; see styles/README.md. */

/* ------------------------------ */
/* Home Screen */

.home-top-bar {
  position: absolute;
  top: max(14px, calc(var(--safe-top) + 2px));
  left: max(14px, calc(var(--safe-left) + 2px));
  right: max(14px, calc(var(--safe-right) + 2px));
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  pointer-events: none;
}

.home-top-bar > * {
  pointer-events: auto;
}

.user-presence-note {
  margin: 8px 0 0;
  color: rgba(190, 216, 212, 0.82);
  font-size: 0.76rem;
  line-height: 1.3;
  text-align: center;
  align-self: center;
}

[data-screen="home"] .user-presence-note {
  margin: 0;
  min-width: 0;
  max-width: min(48vw, 210px);
  color: var(--text-main);
  font-size: 0.82rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: right;
  align-self: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-presence-value {
  color: var(--accent);
  font-weight: 500;
}

button.user-presence-value {
  min-width: 0;
  max-width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  text-align: inherit;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: baseline;
}

button.user-presence-value:focus-visible {
  outline: 2px solid rgba(111, 224, 192, 0.82);
  outline-offset: 3px;
  border-radius: 8px;
}

.home-feedback-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-height: 32px;
  padding: 0 0.72rem;
  border-radius: 12px;
  border: 1px solid rgba(111, 224, 192, 0.28);
  background: transparent;
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.74rem;
  font-weight: 400;
  line-height: 1;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 0 10px rgba(111, 224, 192, 0.05);
}

.home-feedback-button:hover,
.home-feedback-button:focus-visible {
  color: var(--text-main);
  border-color: rgba(111, 224, 192, 0.48);
  background: rgba(111, 224, 192, 0.07);
  transform: translateY(-1px);
}
/* ------------------------------ */
.hero-card {
  align-items: center;
  justify-content: center;
  gap: 18px;
  text-align: center;
  padding: var(--hero-padding-y) var(--hero-padding-x);
  background:
    radial-gradient(ellipse 58% 30% at 50% var(--home-hero-halo-y), rgba(111, 224, 192, 0.3), rgba(111, 224, 192, 0.12) 44%, transparent 76%),
    radial-gradient(ellipse 112% 58% at 50% var(--home-hero-halo-y), rgba(82, 172, 160, 0.18), transparent 72%),
    radial-gradient(ellipse 100% 24% at 50% 104%, rgba(74, 135, 145, 0.13), transparent 72%),
    var(--surface-solid);
  --home-hero-top-space: clamp(56px, calc(5.6svh + 16px), 82px);
  --home-hero-bottom-space: clamp(14px, 2.4svh, 22px);
  --home-hero-halo-y: calc(34% - 50px);
}

.hero-main {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: clamp(4px, 0.8svh, 8px);
  --home-cta-width: min(100%, 288px);
  --home-logo-width: calc(var(--home-cta-width) * 1.0143);
  --home-logo-max-height: calc(var(--home-cta-width) * 1.344);
}

[data-screen="home"] > .hero-main {
  transform: translateY(-10px);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  max-width: 34ch;
  margin-top: clamp(8px, 1.2svh, 12px);
  margin-bottom: 0;
}

.logo-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  width: var(--home-logo-width);
  max-width: var(--home-logo-width);
}

.logo-mark {
  width: min(var(--home-logo-width), 100%);
  max-width: var(--home-logo-width);
  max-height: var(--home-logo-max-height);
  display: block;
  object-fit: contain;
  filter:
    drop-shadow(0 8px 5px rgba(4, 18, 22, 0.24))
    drop-shadow(0 18px 28px rgba(4, 18, 22, 0.24));
}

.logo-text {
  margin: 0;
  font-size: 2.15rem;
  line-height: 0.98;
}

.hero-text {
  margin: 0;
}

.hero-text {
  max-width: none;
  color: rgba(255, 248, 226, 0.9);
  font-size: 1.03rem;
  line-height: 1.42;
  letter-spacing: 0.01em;
  font-weight: 400;
  font-style: italic;
  text-align: center;
}

.hero-actions {
  width: var(--home-cta-width);
  max-width: var(--home-cta-width);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(16px, 2.2svh, 18px);
  margin-top: 0;
}

[data-screen="home"] .hero-copy + .hero-actions {
  margin-top: 8px;
}

.hero-button {
  width: var(--home-cta-width);
}

.friend-create-button {
  width: min(100%, 288px);
  white-space: nowrap;
}

[data-screen="home"] .hero-actions .hero-about-button,
[data-screen="home"] .hero-actions .hero-install-button {
  width: calc(var(--home-cta-width) * 0.82);
  min-height: 42px;
  padding: 10px 16px;
  border-color: rgba(111, 224, 192, 0.24);
  background: transparent;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.88rem;
  font-weight: 500;
  box-shadow: 0 0 12px rgba(111, 224, 192, 0.04);
}

[data-screen="home"] .hero-actions .hero-about-button:hover,
[data-screen="home"] .hero-actions .hero-about-button:focus-visible,
[data-screen="home"] .hero-actions .hero-install-button:hover,
[data-screen="home"] .hero-actions .hero-install-button:focus-visible {
  background: rgba(111, 224, 192, 0.07);
  border-color: rgba(111, 224, 192, 0.42);
  color: var(--text-main);
}

[data-screen="home"] .hero-actions .hero-about-button:active,
[data-screen="home"] .hero-actions .hero-install-button:active {
  background: rgba(111, 224, 192, 0.1);
  border-color: rgba(111, 224, 192, 0.48);
  box-shadow: 0 0 12px rgba(111, 224, 192, 0.08);
}

#home-create-button,
.primary-button.friend-create-button {
  --home-create-effect-cycle: 15s;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  box-shadow:
    var(--primary-button-shadow),
    0 7px 5px rgba(4, 18, 22, 0.2),
    0 15px 18px rgba(4, 18, 22, 0.17);
  animation: homeCreateButtonPulse var(--home-create-effect-cycle) ease-in-out infinite;
}

#home-create-button:hover,
#home-create-button:focus-visible,
.primary-button.friend-create-button:hover,
.primary-button.friend-create-button:focus-visible {
  box-shadow:
    var(--primary-button-shadow-hover),
    0 8px 6px rgba(4, 18, 22, 0.32),
    0 17px 20px rgba(4, 18, 22, 0.187);
}

#home-create-button:active,
.primary-button.friend-create-button:active {
  box-shadow:
    var(--primary-button-shadow-pressed),
    0 4px 4px rgba(4, 18, 22, 0.28),
    0 9px 12px rgba(4, 18, 22, 0.136);
}

#home-create-button::before,
#home-create-button::after,
.primary-button.friend-create-button::before,
.primary-button.friend-create-button::after {
  content: "";
  position: absolute;
  z-index: 0;
  pointer-events: none;
  filter: blur(1px);
  opacity: 0;
}

#home-create-button::before,
.primary-button.friend-create-button::before {
  inset: -44% -58%;
  background:
    linear-gradient(
      115deg,
      transparent 35%,
      rgba(255, 255, 255, 0.12) 44%,
      rgba(255, 255, 255, 0.58) 50%,
      rgba(255, 255, 255, 0.14) 56%,
      transparent 65%
  );
  transform: translateX(-58%) rotate(0.001deg);
  animation: homeCreateButtonShimmerPrimary var(--home-create-effect-cycle) ease-in-out infinite;
}

#home-create-button::after,
.primary-button.friend-create-button::after {
  inset: -50% -64%;
  background:
    linear-gradient(
      65deg,
      transparent 38%,
      rgba(255, 255, 255, 0.1) 46%,
      rgba(255, 255, 255, 0.44) 51%,
      rgba(255, 255, 255, 0.12) 57%,
      transparent 66%
  );
  transform: translateX(56%) rotate(0.001deg);
  animation: homeCreateButtonShimmerSecondary var(--home-create-effect-cycle) ease-in-out infinite;
}

#home-create-button > span,
.primary-button.friend-create-button > span {
  position: relative;
  z-index: 1;
}

@keyframes homeCreateButtonShimmerPrimary {
  0%, 20%, 100% {
    opacity: 0;
    transform: translateX(-58%) rotate(0.001deg);
  }
  4% {
    opacity: 0.72;
  }
  8% {
    opacity: 0.98;
  }
  14% {
    opacity: 0.72;
  }
  18% {
    opacity: 0;
    transform: translateX(58%) rotate(0.001deg);
  }
}

@keyframes homeCreateButtonShimmerSecondary {
  0%, 3%, 23%, 100% {
    opacity: 0;
    transform: translateX(56%) rotate(0.001deg);
  }
  7% {
    opacity: 0.52;
  }
  11% {
    opacity: 0.78;
  }
  17% {
    opacity: 0.48;
  }
  21% {
    opacity: 0;
    transform: translateX(-56%) rotate(0.001deg);
  }
}

@keyframes homeCreateButtonPulse {
  0%, 3%, 21%, 100% {
    translate: 0 0;
  }
  6%, 12%, 18% {
    translate: 0.7px 0;
  }
  9%, 15% {
    translate: -0.7px 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  #home-create-button,
  #home-create-button::after,
  #home-create-button::before,
  .primary-button.friend-create-button,
  .primary-button.friend-create-button::after,
  .primary-button.friend-create-button::before {
    animation: none;
  }
}

.hero-actions.is-install-visible {
  margin-top: clamp(12px, 2.2svh, 20px);
}

.hero-install-button[hidden] {
  display: none !important;
}

.progress-block {
  flex: 0 0 auto;
  margin-bottom: 14px;
}

.screen[data-screen="step-1"] > .progress-block,
.screen[data-screen="step-2"] > .progress-block,
.screen[data-screen="step-3"] > .progress-block,
.screen[data-screen="step-5"] > .progress-block,
.screen[data-screen="step-6"] > .progress-block,
.screen[data-screen="official-challenges"] > .progress-block {
  padding-bottom: 14px;
  margin-bottom: 0;
  background:
    radial-gradient(ellipse 110% 72% at 28% 0%, rgba(111, 224, 192, 0.12), transparent 62%),
    linear-gradient(180deg, rgba(42, 95, 112, 0.9), var(--surface-solid) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.045),
    inset 0 -22px 28px rgba(4, 18, 22, 0.035);
}

.screen[data-screen="step-1"] > .progress-block,
.screen[data-screen="step-2"] > .progress-block,
.screen[data-screen="step-3"] > .progress-block,
.screen[data-screen="step-5"] > .progress-block,
.screen[data-screen="official-challenges"] > .progress-block {
  --create-progress-top-inset: var(--screen-padding-y);
  position: sticky;
  top: calc(-1 * var(--create-progress-top-inset));
  z-index: 30;
  margin-top: calc(-1 * var(--create-progress-top-inset));
  margin-inline: calc(-1 * (var(--screen-padding-x) + var(--safe-left))) calc(-1 * (var(--screen-padding-x) + var(--safe-right)));
  padding:
    var(--create-progress-top-inset)
    calc(var(--screen-padding-x) + var(--safe-right))
    14px
    calc(var(--screen-padding-x) + var(--safe-left));
}

.screen[data-screen="step-6"] > .progress-block {
  --step-6-progress-top-inset: max(var(--screen-padding-y), calc(var(--safe-top) + 8px));
  margin-top: calc(-1 * var(--step-6-progress-top-inset));
  margin-inline: calc(-1 * (var(--screen-padding-x) + var(--safe-left))) calc(-1 * (var(--screen-padding-x) + var(--safe-right)));
  padding:
    var(--step-6-progress-top-inset)
    calc(var(--screen-padding-x) + var(--safe-right))
    14px
    calc(var(--screen-padding-x) + var(--safe-left));
}

.progress-copy {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-bottom: 8px;
}

.progress-count {
  color: var(--accent);
  font-size: 0.95rem;
  font-weight: 600;
}

.progress-track {
  width: 100%;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #6fe0c0, #43c39e);
  width: 0;
  transition: width 180ms ease;
}

.section-heading h1 {
  margin: 0;
  font-size: 1.65rem;
}

.section-heading-centered {
  text-align: center;
}

.section-intro {
  margin: 8px 0 0;
  color: var(--text-soft);
  font-size: 0.815rem;
  line-height: 1.42;
}

.step-1-heading,
.step-2-heading,
.step-3-heading {
  margin-top: 0;
}

.create-top-family {
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.create-top-family .section-intro {
  margin: 0;
  color: var(--text-main);
  font-size: clamp(1.02rem, 3.8vw, 1.22rem);
  font-weight: 400;
  line-height: 1.25;
}

.step-1-brand {
  color: var(--accent);
}

.step-3-heading {
  text-align: center;
  gap: 12px;
}

.step-5-heading {
  text-align: center;
  gap: 12px;
}

.step-3-heading .section-intro {
  margin: 0;
}

.step-5-heading .section-intro {
  margin: 0;
}

#step-5-screen > .question-form {
  margin-top: 18px;
}

.step-6-heading {
  text-align: center;
  gap: 12px;
}

.step-6-heading .section-intro {
  margin: 0;
}

.stake-section-title {
  margin: 0;
  color: var(--text-main);
  font-size: clamp(1.02rem, 3.8vw, 1.22rem);
  font-weight: 400;
  line-height: 1.25;
  text-align: center;
}

.step-3-form-actions {
  margin-top: auto;
}

.step-3-form {
  margin-top: 18px;
}

#step-3-note {
  min-height: 0;
  margin: 0;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

