/* ========================================
   Design Tokens
   ======================================== */
:root {
  --fg: #ffffff;
  --fg-muted: rgba(255, 255, 255, 0.65);
  --font-script: 'Borel', 'Dancing Script', 'Caveat', 'Marck Script', cursive;
  --font-serif: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
}

/* ========================================
   Reset
   ======================================== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

body {
  font-family: var(--font-sans);
  color: var(--fg);
  min-height: 100dvh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;

  /* iPhone Hello screen gradient:
     deep navy at top → medium blue → soft sky blue at bottom */
  background: linear-gradient(
    180deg,
    #0b1a3e 0%,
    #163d72 25%,
    #2a6cb5 50%,
    #5a9fd4 75%,
    #8dc4e8 100%
  );
  background-attachment: fixed;
}

/* ========================================
   Onboarding Layout
   ======================================== */
.onboarding {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  width: 100vw;
  padding: 2rem 1.5rem;
  text-align: center;
  position: relative;
  z-index: 1;
}

/* ========================================
   Hello Stage — Exact Apple SVG & Editorial Serif
   ======================================== */
.hello-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 90vw;
  height: clamp(80px, 14vw, 120px);
  padding: 0 1rem;
  pointer-events: none;
  white-space: nowrap;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

/* Exact Apple 'hello' SVG vector — sized to match text optical height */
.hello-svg {
  height: clamp(65px, 11vw, 100px);
  width: auto;
  max-width: 85vw;
  display: none;
  opacity: 0;
  margin: 0 auto;
  transition: opacity 0.22s ease;
}

.hello-svg.visible {
  opacity: 1;
}

.hello-path {
  fill: none;
  stroke: #ffffff;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-miterlimit: 10;
  stroke-width: 32px;
}

/* Multilingual greeting text: cursive connected script matching iPhone hello */
.hello-text {
  font-family: var(--font-script);
  font-size: clamp(3.2rem, 9vw, 5.2rem);
  font-weight: 400;
  font-style: normal;
  letter-spacing: 0.01em;
  line-height: 1.1;
  color: var(--fg);
  text-transform: lowercase;
  white-space: nowrap;
  display: none;
  opacity: 0;
  margin: 0 auto;
  transition: opacity 0.22s ease;
  user-select: none;
}

.hello-text.visible {
  opacity: 1;
}

.hello-container.exit {
  opacity: 0;
  transform: translate(-50%, calc(-50% - 16px));
  transition: opacity 0.45s ease, transform 0.45s ease;
}

/* ========================================
   Intro Stage — Typewriter
   ======================================== */
.intro-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) translateY(8px);
  width: 100%;
  max-width: 680px;
  padding: 0 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.intro-container.visible {
  opacity: 1;
  transform: translate(-50%, -50%) translateY(0);
  pointer-events: auto;
}

/* Profile Avatar at the top of typewriter */
.profile-avatar-wrap {
  width: 80px;
  height: 80px;
  margin: 0 auto 1.5rem auto;
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.45s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.intro-container.visible .profile-avatar-wrap {
  opacity: 1;
  transform: scale(1);
}

.profile-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, 0.65);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.32);
  display: block;
}

.typewriter-line {
  font-family: var(--font-sans);
  font-size: clamp(1.6rem, 4.5vw, 2.5rem);
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1.35;
  color: var(--fg);
  text-align: center;
}

.intro-plain {
  color: #ffffff;
  font-weight: 400;
}

/* Meaningful, bold, and ultra-readable font for linux */
.intro-name {
  font-family: var(--font-sans);
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.02em;
}

.intro-muted {
  color: var(--fg-muted);
  font-weight: 400;
}

/* ========================================
   CTA Button — Solid, High-Contrast & Readable
   ======================================== */
.cta-btn {
  position: absolute;
  bottom: 3.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(24px);
  width: auto;
  min-width: 210px;
  padding: 0.95rem 2.4rem;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-align: center;
  color: #0b1a3e; /* Deep navy text for maximum contrast on white */
  background: #ffffff; /* Solid crisp white for instant readability */
  text-decoration: none;
  border-radius: 6px; /* Crisp square / rectangular shape */
  border: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  opacity: 0;
  pointer-events: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;

  transition: opacity 0.4s ease,
              transform 0.25s ease,
              background-color 0.2s ease,
              box-shadow 0.2s ease;
}

.cta-btn.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.cta-btn:hover {
  background: #f0f5ff;
  color: #07132e;
  transform: translateX(-50%) translateY(-2px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

.cta-btn:active {
  transform: translateX(-50%) translateY(0) scale(0.98);
  background: #e2ecfc;
}

/* ========================================
   Responsive & Device Adjustments (Strict Single Line)
   ======================================== */
@media (max-width: 480px) {
  .hello-container {
    height: 75px;
  }
  .hello-svg {
    height: clamp(50px, 14vw, 68px);
    width: auto;
    max-width: 85vw;
  }
  .hello-text {
    font-size: clamp(2.2rem, 9.5vw, 3.4rem);
    white-space: nowrap;
  }
  .typewriter-line {
    font-size: 1.35rem;
  }
  .cta-btn {
    bottom: 2.2rem;
    padding: 0.85rem 1.6rem;
    font-size: 0.95rem;
  }
}

@media (min-width: 768px) {
  .hello-container { height: 130px; }
  .hello-svg { height: 110px; }
  .hello-text { font-size: 5rem; }
  .typewriter-line { font-size: 2.4rem; }
  .cta-btn { max-width: 340px; }
}

@media (max-height: 500px) and (orientation: landscape) {
  .hello-container { height: 60px; }
  .hello-svg { height: 48px; }
  .hello-text { font-size: 2.4rem; }
  .typewriter-line { font-size: 1.3rem; }
  .cta-btn {
    bottom: 1.2rem;
    padding: 0.65rem 1.4rem;
    font-size: 0.9rem;
  }
}

@supports (padding: env(safe-area-inset-bottom)) {
  .cta-btn {
    bottom: calc(2.8rem + env(safe-area-inset-bottom));
  }
  .onboarding {
    padding-top: calc(2rem + env(safe-area-inset-top));
  }
}

@media (prefers-reduced-motion: reduce) {
  .hello-text, .hello-svg { transition: none !important; opacity: 1 !important; transform: none !important; }
  .hello-container { transition: none !important; }
  .intro-container { transition: none !important; opacity: 1 !important; transform: translate(-50%, -50%) !important; }
  .cta-btn { transition: none !important; opacity: 1 !important; transform: translateX(-50%) !important; }
}


