/* PineLoop — palette lifted from the logo's own PNG palette. */
:root {
  --blue:       #0042CD;
  --blue-lift:  #0053E6;
  --blue-deep:  #0030A4;
  --red:        #EC000B;
  --red-deep:   #C6000E;

  --ground:     #EEF2FA;  /* cool porcelain, tinted toward the blue */
  --ink:        #0A1633;  /* navy-black, not a neutral grey */
  --ink-soft:   #5A6683;

  --step:       clamp(1.25rem, 6vw, 2rem);
  --ease:       cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--ground);
  color: var(--ink);
  font-family: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-weight: 500;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  overflow: hidden;
}

/* A single soft blue bloom behind the mark — the only decoration on the page. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(58% 42% at 50% 34%, rgba(0, 83, 230, 0.13), transparent 70%);
  pointer-events: none;
}

.stage {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--step);
  padding: calc(env(safe-area-inset-top) + var(--step)) var(--step) var(--step);
  text-align: center;
}

/* ---- The mark ------------------------------------------------------- */
/* One logo element for both phases. It rises on its own as the greeting
   opens beneath it, so the move is real layout, not a second copy. */
.mark__img {
  display: block;
  width: clamp(112px, 32vw, 156px);
  height: auto;
  transition: width 0.7s var(--ease);
}

[data-phase="welcome"] .mark__img { width: clamp(84px, 24vw, 116px); }

/* ---- Loading dots --------------------------------------------------- */
.loader {
  display: flex;
  gap: 0.65rem;
  height: 0.75rem;
  transition: opacity 0.35s var(--ease), height 0.7s var(--ease), margin 0.7s var(--ease);
}

.loader__dot {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  background: var(--blue);
  animation: pulse 1.35s var(--ease) infinite;
}

.loader__dot:nth-child(2) { background: var(--red); animation-delay: 0.18s; }
.loader__dot:nth-child(3) { background: var(--blue-lift); animation-delay: 0.36s; }

@keyframes pulse {
  0%, 70%, 100% { transform: scale(0.62); opacity: 0.35; }
  35%           { transform: scale(1);    opacity: 1; }
}

[data-phase="welcome"] .loader {
  opacity: 0;
  height: 0;
  margin-top: calc(var(--step) * -1);
}

/* ---- Greeting ------------------------------------------------------- */
.greeting {
  opacity: 0;
  transform: translateY(0.75rem);
  transition: opacity 0.55s var(--ease) 0.25s, transform 0.55s var(--ease) 0.25s;
  max-width: 22ch;
}

.greeting__title {
  margin: 0;
  font-size: clamp(2.5rem, 13vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1;
  color: var(--blue-deep);
}

.greeting__line {
  margin: 0.65rem 0 0;
  font-size: 1.0625rem;
  line-height: 1.5;
  color: var(--ink-soft);
}

[data-phase="welcome"] .greeting {
  opacity: 1;
  transform: translateY(0);
}

/* ---- Action dock ---------------------------------------------------- */
.dock {
  padding: 0 var(--step) calc(env(safe-area-inset-bottom) + var(--step));
  opacity: 0;
  transform: translateY(1.25rem);
  transition: opacity 0.5s var(--ease) 0.4s, transform 0.5s var(--ease) 0.4s;
  pointer-events: none;
}

[data-phase="welcome"] .dock {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 3.5rem;   /* comfortable thumb target */
  border-radius: 1.75rem;
  background: var(--red);
  color: #fff;
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
  box-shadow: 0 0.5rem 1.25rem rgba(236, 0, 11, 0.28);
  transition: transform 0.15s var(--ease), background-color 0.15s var(--ease);
}

.button:active {
  transform: scale(0.975);
  background: var(--red-deep);
}

.button:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}

/* ---- Placeholder next screen ---------------------------------------- */
.note {
  margin: 0;
  max-width: 26ch;
  font-size: 1.0625rem;
  line-height: 1.5;
  color: var(--ink-soft);
}

.back {
  color: var(--blue);
  font-weight: 700;
  text-decoration: none;
}

.back:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }

/* ---- Motion preferences --------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .loader__dot { animation-duration: 2.4s; }
  .mark__img,
  .loader,
  .greeting,
  .dock,
  .button { transition-duration: 0.01ms; }
}
