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

/* ===== DARK MODE (default) ===== */
:root {
  --orange:        #FF8C42;
  --purple:        #6C3483;
  --purple-light:  #9B59B6;
  --msg-red:       #FF5A67;
  --msg-green:     #44D17C;
  --msg-yellow:    #F6CC47;
  --msg-blue:      #5A8CFF;
  --bg-0:          #0A0D14;
  --bg-1:          #0F1724;
  --bg-2:          #141D2B;
  --card:          #1A2234;
  --text-primary:  #E8ECF4;
  --text-muted:    #7A8399;
  --glass-bg:      rgba(255, 255, 255, 0.055);
  --glass-border:  rgba(255, 255, 255, 0.09);
  --badge-filter:  invert(1);
  --toggle-icon:   '☀️';
}

/* ===== LIGHT MODE ===== */
:root.light {
  --bg-0:          #F8F5F2;
  --bg-1:          #F2EDE8;
  --bg-2:          #EDE6DF;
  --card:          #FFFFFF;
  --text-primary:  #1A1014;
  --text-muted:    #7A6E6A;
  --glass-bg:      rgba(0, 0, 0, 0.04);
  --glass-border:  rgba(0, 0, 0, 0.08);
  --badge-filter:  invert(0);
  --toggle-icon:   '🌙';
}

html, body {
  min-height: 100%;
  width: 100%;
  overflow: hidden;
}

body {
  font-family: 'DM Sans', sans-serif;
  background-color: var(--bg-0);
  color: var(--text-primary);
  min-height: 100vh;
  height: 100vh;
  min-height: 100dvh;
  height: 100dvh;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  justify-items: center;
  align-items: stretch;
  overflow: hidden;
  overscroll-behavior: none;
  position: relative;
  transition: color 0.3s ease, background-color 0.3s ease;
}

/* ===== BACKGROUND ===== */
.bg-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 42% 34% at 14% 14%, rgba(255, 90, 103, 0.12) 0%, transparent 72%),
    radial-gradient(ellipse 44% 36% at 86% 18%, rgba(90, 140, 255, 0.11) 0%, transparent 72%),
    radial-gradient(ellipse 45% 38% at 20% 84%, rgba(68, 209, 124, 0.1) 0%, transparent 72%),
    radial-gradient(ellipse 40% 34% at 82% 82%, rgba(246, 204, 71, 0.09) 0%, transparent 70%),
    radial-gradient(ellipse 38% 28% at 52% 46%, rgba(255, 255, 255, 0.04) 0%, transparent 72%),
    linear-gradient(175deg, var(--bg-0) 0%, var(--bg-1) 45%, var(--bg-2) 100%);
  transition: background 0.4s ease;
}

:root.light .bg-layer {
  background:
    radial-gradient(ellipse 42% 34% at 14% 14%, rgba(255, 90, 103, 0.14) 0%, transparent 72%),
    radial-gradient(ellipse 44% 36% at 86% 18%, rgba(90, 140, 255, 0.13) 0%, transparent 72%),
    radial-gradient(ellipse 45% 38% at 20% 84%, rgba(68, 209, 124, 0.12) 0%, transparent 72%),
    radial-gradient(ellipse 40% 34% at 82% 82%, rgba(246, 204, 71, 0.12) 0%, transparent 70%),
    linear-gradient(175deg, #F8F5F2 0%, #F2EDE8 50%, #EDE6DF 100%);
}

/* ===== THEME TOGGLE ===== */
.theme-toggle {
  position: fixed;
  top: 1.2rem;
  right: 1.2rem;
  z-index: 100;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: transform 0.2s ease, background 0.3s ease, border-color 0.3s ease;
  color: var(--text-muted);
}
.theme-toggle:hover {
  transform: scale(1.1) rotate(15deg);
}

canvas#particles {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

/* ===== CONTENT ===== */
.container {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: min(100%, 580px);
  align-self: stretch;
  padding: clamp(0.9rem, 4vmin, 2.4rem) 1.75rem clamp(0.2rem, 1.2vmin, 0.7rem);
  max-width: 580px;
  text-align: center;
}

/* ===== LOGO ===== */
.logo-wrap {
  position: relative;
  margin-bottom: clamp(1.1rem, 3.8vmin, 2.35rem);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(-16px);
  transition: opacity 0.9s ease, transform 0.9s ease;
}

.logo-wrap.visible { opacity: 1; transform: translateY(0); }

/* Outer glow rings */
.ring {
  position: absolute;
  border-radius: 30%;
  border: 1px solid transparent;
  pointer-events: none;
}
.ring-1 {
  width: clamp(122px, 19vmin, 148px);
  height: clamp(122px, 19vmin, 148px);
  border-color: rgba(255, 140, 66, 0.18);
  animation: pulse-ring 3.5s ease-in-out infinite;
}
.ring-2 {
  width: clamp(148px, 23vmin, 178px);
  height: clamp(148px, 23vmin, 178px);
  border-color: rgba(108, 52, 131, 0.12);
  animation: pulse-ring 3.5s ease-in-out infinite 1s;
}

@keyframes pulse-ring {
  0%, 100% { transform: scale(1);    opacity: 0.7; }
  50%       { transform: scale(1.08); opacity: 0.25; }
}

.logo-img {
  width: clamp(96px, 15vmin, 120px);
  height: clamp(96px, 15vmin, 120px);
  border-radius: clamp(22px, 3.4vmin, 26px);
  animation: float 4.5s ease-in-out infinite;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.06),
    0 12px 40px rgba(108, 52, 131, 0.35),
    0 4px 16px  rgba(255, 140, 66, 0.2);
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-10px); }
}

/* ===== APP NAME ===== */
.app-name {
  font-size: clamp(1.9rem, 5.2vh, 3.1rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.08;
  padding-bottom: 0.06em;
  background: linear-gradient(120deg, var(--orange) 0%, #C0735E 40%, var(--purple-light) 75%, var(--purple) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: clamp(0.45rem, 1.6vmin, 0.78rem);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.8s ease 0.2s, transform 0.8s ease 0.2s;
}
.app-name.visible { opacity: 1; transform: translateY(0); }

/* ===== TAGLINE ===== */
.tagline {
  font-size: clamp(0.88rem, 1.9vh, 1rem);
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: 0.01em;
  margin-bottom: clamp(1.05rem, 3.5vmin, 2.1rem);
  line-height: 1.55;
  max-width: 380px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.8s ease 0.38s, transform 0.8s ease 0.38s;
}
.tagline.visible { opacity: 1; transform: translateY(0); }

.tagline strong {
  color: var(--text-primary);
  font-weight: 500;
}

/* ===== DIVIDER ===== */
.divider {
  width: 40px;
  height: 2px;
  background: linear-gradient(90deg, var(--orange), var(--purple));
  border-radius: 99px;
  margin: 0 auto clamp(1.05rem, 3.5vmin, 2.1rem);
  opacity: 0;
  transition: opacity 0.8s ease 0.5s;
}
.divider.visible { opacity: 1; }

/* ===== BADGE ===== */
.badge-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.8s ease 0.6s, transform 0.8s ease 0.6s;
}
.badge-wrap.visible { opacity: 1; transform: translateY(0); }

.badge-card {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: not-allowed;
  transition: transform 0.25s ease, filter 0.25s ease;
}

.badge-card:hover {
  transform: translateY(-4px);
  filter:
    drop-shadow(0 0 18px rgba(255, 140, 66, 0.35))
    drop-shadow(0 0 40px rgba(108, 52, 131, 0.3));
}

/* "COMING SOON" pill */
.badge-cs {
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #fff;
  background: linear-gradient(90deg, var(--orange), var(--purple-light));
  padding: 3px 12px;
  border-radius: 99px;
}

/* Invert white→black for dark mode App Store look */
.appstore-badge {
  width: clamp(160px, 24vh, 210px);
  display: block;
  filter: var(--badge-filter);
  user-select: none;
  -webkit-user-drag: none;
  border-radius: 10px;
  transition: filter 0.3s ease;
}

/* ===== FOOTER ===== */
.footer {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(100%, 580px);
  gap: clamp(0.45rem, 1vmin, 0.7rem);
  padding: clamp(0.45rem, 1.6vmin, 1rem) 1rem clamp(0.6rem, 1.8vmin, 1rem);
  font-size: 0.72rem;
  color: rgba(122, 131, 153, 0.45);
  letter-spacing: 0.03em;
  opacity: 0;
  transition: opacity 0.8s ease 0.85s;
  text-align: center;
}
.footer.visible { opacity: 1; }

.social-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
}

.social-link {
  width: clamp(46px, 6vh, 56px);
  height: clamp(46px, 6vh, 56px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: clamp(0.58rem, 1.2vmin, 0.72rem);
  border-radius: clamp(16px, 2vmin, 20px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.14);
  box-shadow:
    0 10px 24px rgba(4, 10, 22, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  text-decoration: none;
  transition:
    transform 0.22s ease,
    box-shadow 0.22s ease,
    border-color 0.22s ease,
    background 0.22s ease;
}

.social-link:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 140, 66, 0.28);
  background: rgba(255, 255, 255, 0.18);
  box-shadow:
    0 14px 28px rgba(4, 10, 22, 0.22),
    0 0 20px rgba(255, 140, 66, 0.14);
}

.social-link:focus-visible {
  outline: 2px solid rgba(255, 140, 66, 0.65);
  outline-offset: 3px;
  border-color: rgba(255, 140, 66, 0.34);
  background: rgba(255, 255, 255, 0.2);
}

.social-icon {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

.social-icon-instagram {
  width: 100%;
  height: 100%;
}

.social-icon-x {
  width: 45%;
  height: 45%;
}

.social-icon-tiktok {
  width: 100%;
  height: 100%;
}

.footer-copy {
  margin: 0;
}

:root.light .social-link {
  border-color: rgba(26, 16, 20, 0.08);
  background: rgba(255, 255, 255, 0.76);
  box-shadow:
    0 10px 24px rgba(26, 16, 20, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

:root.light .social-link:hover {
  border-color: rgba(255, 140, 66, 0.24);
  background: rgba(255, 255, 255, 0.92);
  box-shadow:
    0 14px 28px rgba(26, 16, 20, 0.11),
    0 0 20px rgba(255, 140, 66, 0.12);
}

/* ===== RESPONSIVE ===== */

/* Tablet */
@media (max-width: 640px) {
  .container {
    padding: 1.3rem 1.35rem 0.3rem;
  }

  .logo-wrap {
    margin-bottom: 1.15rem;
  }

  .app-name {
    margin-bottom: 0.45rem;
  }

  .tagline {
    margin-bottom: 1.15rem;
    font-size: 0.9rem;
  }

  .divider {
    margin-bottom: 1.15rem;
  }

  .footer {
    padding-top: 0.55rem;
    padding-bottom: 0.8rem;
  }
}

/* Mobile */
@media (max-width: 480px) {
  .container {
    padding: 1rem 1.1rem 0.2rem;
    justify-content: center;
  }

  .logo-img {
    width: 96px;
    height: 96px;
    border-radius: 22px;
  }

  .ring-1 { width: 122px; height: 122px; }
  .ring-2 { width: 148px; height: 148px; }

  .logo-wrap {
    margin-bottom: 1rem;
  }

  .app-name {
    font-size: clamp(1.65rem, 6.3vh, 2.2rem);
    margin-bottom: 0.42rem;
  }

  .tagline {
    font-size: 0.84rem;
    margin-bottom: 1rem;
    max-width: 300px;
    line-height: 1.45;
  }

  .divider {
    margin-bottom: 1rem;
  }

  .appstore-badge {
    width: 154px;
  }

  .badge-cs {
    font-size: 0.48rem;
  }

  .footer {
    gap: 0.4rem;
    padding-top: 0.45rem;
    padding-bottom: 0.7rem;
  }

  .social-links {
    gap: 0.6rem;
  }

  .social-link {
    width: 44px;
    height: 44px;
    border-radius: 15px;
    padding: 0.56rem;
  }
}

/* Small mobile */
@media (max-width: 360px) {
  .logo-img {
    width: 82px;
    height: 82px;
    border-radius: 18px;
  }

  .ring-1 { width: 106px; height: 106px; }
  .ring-2 { width: 128px; height: 128px; }

  .app-name {
    font-size: 1.6rem;
  }

  .tagline {
    font-size: 0.85rem;
  }

  .appstore-badge {
    width: 158px;
  }
}

@media (max-height: 780px) {
  .container {
    padding-top: 0.75rem;
    padding-bottom: 0.1rem;
  }

  .logo-wrap {
    margin-bottom: 0.88rem;
  }

  .tagline {
    margin-bottom: 0.88rem;
    max-width: 320px;
    line-height: 1.42;
  }

  .divider {
    margin-bottom: 0.88rem;
  }

  .footer {
    gap: 0.36rem;
    padding-top: 0.35rem;
    padding-bottom: 0.6rem;
  }

  .social-link {
    width: 42px;
    height: 42px;
    padding: 0.52rem;
  }

  .appstore-badge {
    width: 146px;
  }
}

@media (max-height: 780px) and (max-width: 480px) {
  .container {
    padding: 0.7rem 1rem 0.1rem;
  }

  .logo-wrap {
    margin-bottom: 0.72rem;
  }

  .tagline,
  .divider {
    margin-bottom: 0.72rem;
  }

  .footer {
    padding-top: 0.3rem;
    padding-bottom: 0.55rem;
  }

  .social-link {
    width: 40px;
    height: 40px;
    border-radius: 14px;
    padding: 0.48rem;
  }
}
