:root {
  --brand: #526aa3;
  --brand-dark: #405784;
  --brand-soft: #e9eefb;
  --violet: #7c5fc8;
  --ink: #1f2533;
  --muted: #687083;
  --line: #e4e7ef;
  --surface: #ffffff;
  --canvas: #f7f8fc;
  --danger: #c43d4b;
  --danger-soft: #fff1f2;
  --warning-soft: #fff8e8;
  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 30px;
  --shadow-sm: 0 10px 30px rgba(35, 44, 68, .08);
  --shadow-lg: 0 28px 70px rgba(42, 52, 80, .14);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--surface);
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
button, a { font: inherit; }
a { color: inherit; }
img { display: block; max-width: 100%; }
svg { width: 1.35em; height: 1.35em; fill: currentColor; }
.shell { width: min(1120px, calc(100% - 40px)); margin-inline: auto; }

.site-header {
  position: relative;
  z-index: 10;
  min-height: 76px;
  border-bottom: 1px solid rgba(82, 106, 163, .1);
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(16px);
}
.header-inner { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; font-size: 1.2rem; font-weight: 800; letter-spacing: -.02em; }
.brand img { border-radius: 50%; box-shadow: 0 5px 14px rgba(42, 52, 80, .14); }
.header-actions { display: flex; align-items: center; gap: 26px; }
.text-link, .back-link { color: var(--muted); text-decoration: none; font-weight: 600; transition: color .2s ease; }
.text-link:hover, .back-link:hover { color: var(--brand); }
.back-link { display: inline-flex; align-items: center; gap: 6px; font-size: .94rem; }
.back-link svg { width: 18px; height: 18px; }

.button {
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 12px 22px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  font-weight: 750;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease;
}
.button:hover { transform: translateY(-2px); }
.button-primary { color: white; background: var(--brand); box-shadow: 0 10px 24px rgba(82, 106, 163, .25); }
.button-primary:hover { background: var(--brand-dark); box-shadow: 0 14px 28px rgba(82, 106, 163, .3); }
.button-quiet { color: var(--brand-dark); border-color: #cfd6e8; background: var(--surface); }
.button-quiet:hover { border-color: var(--brand); background: var(--brand-soft); }
.button-light { color: var(--brand-dark); background: white; box-shadow: 0 12px 28px rgba(24, 31, 49, .16); }
.button-danger { color: white; background: var(--danger); }
.button-danger:hover { background: #a92f3c; }
.button-small { min-height: 42px; padding: 9px 17px; border-radius: 11px; font-size: .92rem; }
.button-full { width: 100%; }
.google-play-mark { width: 24px; height: 24px; flex: 0 0 24px; filter: drop-shadow(0 1px 1px rgba(17, 24, 39, .18)); }

.hero { overflow: hidden; background: linear-gradient(155deg, #fbfcff 0%, #eef2fb 72%, #f8f4ff 100%); }
.hero-grid { min-height: 680px; display: grid; grid-template-columns: 1.04fr .96fr; align-items: center; gap: 60px; padding-block: 70px 76px; }
.hero-copy { position: relative; z-index: 2; }
.eyebrow { display: inline-block; color: var(--brand); font-size: .86rem; font-weight: 800; letter-spacing: .04em; }
.hero h1 { max-width: 680px; margin: 14px 0 20px; font-size: clamp(2.35rem, 5vw, 4.25rem); line-height: 1.16; letter-spacing: -.055em; }
.hero-copy > p { max-width: 620px; margin: 0; color: var(--muted); font-size: 1.16rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.hero-note { margin-top: 14px !important; font-size: .85rem !important; }
.hero-visual { position: relative; min-height: 500px; display: grid; place-items: center; }
.orbit { position: absolute; border-radius: 50%; border: 1px solid rgba(82, 106, 163, .14); }
.orbit-one { width: 430px; height: 430px; }
.orbit-two { width: 540px; height: 540px; }
.phone-card { position: relative; z-index: 2; width: min(352px, 88vw); padding: 15px 20px 26px; border: 8px solid #252c3c; border-radius: 42px; background: #fafbff; box-shadow: var(--shadow-lg); transform: rotate(-2deg); }
.phone-top { display: flex; justify-content: center; margin-bottom: 20px; }
.phone-top span { width: 94px; height: 6px; border-radius: 99px; background: #252c3c; }
.app-heading { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.app-heading img { border-radius: 15px; }
.app-heading div { display: grid; }
.app-heading strong { font-size: 1.1rem; }
.app-heading small, .friend-chip small { color: var(--muted); }
.chat-preview { display: flex; align-items: flex-end; gap: 8px; margin: 14px 0; }
.chat-preview p { max-width: 75%; margin: 0; padding: 12px 14px; border-radius: 17px; font-size: .88rem; }
.chat-preview-left { justify-content: flex-start; }
.chat-preview-left p { background: white; border: 1px solid var(--line); border-bottom-right-radius: 4px; }
.chat-preview-right { justify-content: flex-start; direction: ltr; }
.chat-preview-right p { color: white; background: var(--brand); border-bottom-left-radius: 4px; direction: rtl; }
.avatar { width: 34px; height: 34px; flex: 0 0 34px; display: grid; place-items: center; border-radius: 50%; color: white; font-weight: 800; }
.avatar-blue { background: #7dcef0; }
.friend-chip { display: flex; align-items: center; gap: 11px; margin-top: 28px; padding: 14px; border: 1px solid #dce4f6; border-radius: 16px; background: #f0f4ff; }
.friend-chip div { display: grid; font-size: .85rem; }
.friend-chip small { font-size: .72rem; }
.status-dot { width: 12px; height: 12px; flex: 0 0 12px; border-radius: 50%; background: #52b788; box-shadow: 0 0 0 5px rgba(82, 183, 136, .14); }

.section { padding-block: 96px; }
.section-soft { background: var(--canvas); }
.section-heading { max-width: 680px; margin-inline: auto; margin-bottom: 44px; text-align: center; }
.section-heading h2, .split-card h2, .cta-card h2 { margin: 9px 0 12px; font-size: clamp(1.8rem, 3.4vw, 2.65rem); line-height: 1.25; letter-spacing: -.035em; }
.section-heading p, .split-card p, .cta-card p { margin: 0; color: var(--muted); }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feature-card { padding: 28px; border: 1px solid var(--line); border-radius: var(--radius-md); background: white; box-shadow: 0 8px 30px rgba(35, 44, 68, .04); }
.feature-card h3 { margin: 20px 0 8px; font-size: 1.22rem; }
.feature-card p { margin: 0; color: var(--muted); }
.feature-icon { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 15px; }
.feature-icon svg { width: 27px; height: 27px; }
.feature-icon.blue { color: var(--brand); background: var(--brand-soft); }
.feature-icon.violet { color: var(--violet); background: #f1edfb; }
.feature-icon.amber { color: #af7b17; background: #fff5d9; }
.split-card { display: grid; grid-template-columns: 1fr .9fr; align-items: center; gap: 70px; }
.identity-demo { display: grid; gap: 12px; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius-md); background: white; box-shadow: var(--shadow-sm); direction: ltr; }
.identity-row { display: grid; grid-template-columns: 84px 1fr auto; align-items: center; gap: 12px; padding: 14px; border-radius: 13px; background: var(--canvas); }
.identity-row span { color: var(--muted); font-size: .72rem; font-weight: 800; }
.identity-row strong { color: var(--brand-dark); letter-spacing: .08em; }
.identity-row i { padding: 4px 8px; border-radius: 99px; color: var(--muted); background: white; font-size: .7rem; font-style: normal; }
.cta-section { padding-block: 72px; }
.cta-card { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 24px; padding: 40px; border-radius: var(--radius-lg); color: white; background: linear-gradient(135deg, var(--brand-dark), var(--brand) 60%, var(--violet)); box-shadow: var(--shadow-lg); }
.cta-card img { border-radius: 24px; }
.cta-card h2 { margin-top: 0; }
.cta-card p { color: rgba(255,255,255,.78); }

.site-footer { padding: 62px 0 24px; border-top: 1px solid var(--line); background: #fbfcfe; }
.footer-grid { display: grid; grid-template-columns: 1.4fr .6fr; gap: 40px; }
.footer-brand p { max-width: 360px; color: var(--muted); }
.footer-grid nav { display: grid; align-content: start; gap: 9px; }
.footer-grid nav strong { margin-bottom: 5px; }
.footer-grid nav a { color: var(--muted); text-decoration: none; }
.footer-grid nav a:hover { color: var(--brand); }
.footer-bottom { display: flex; justify-content: space-between; gap: 20px; margin-top: 44px; padding-top: 20px; border-top: 1px solid var(--line); color: #8a91a2; font-size: .82rem; }

.utility-page { min-height: 100vh; background: radial-gradient(circle at 90% 10%, #e8eefc 0, transparent 28%), var(--canvas); }
.utility-header { background: rgba(255,255,255,.75); }
.utility-main { width: min(calc(100% - 32px), 620px); min-height: calc(100vh - 76px); display: grid; place-items: center; margin-inline: auto; padding-block: 54px; }
.account-card, .invite-card, .not-found-card { width: 100%; padding: clamp(26px, 6vw, 46px); border: 1px solid rgba(82,106,163,.13); border-radius: var(--radius-lg); background: rgba(255,255,255,.96); box-shadow: var(--shadow-lg); }
.utility-icon { width: 58px; height: 58px; display: grid; place-items: center; margin-bottom: 22px; border-radius: 18px; color: var(--brand); background: var(--brand-soft); }
.utility-icon svg { width: 28px; height: 28px; }
.utility-heading h1, .invite-card h1, .not-found-card h1 { margin: 8px 0 10px; font-size: clamp(1.8rem, 5vw, 2.45rem); line-height: 1.28; letter-spacing: -.035em; }
.utility-heading p, .invite-description, .not-found-card p { margin: 0; color: var(--muted); }
.login-section { min-height: 90px; margin-top: 26px; }
.firebaseui-container { max-width: none !important; box-shadow: none !important; }
.firebaseui-idp-button { max-width: none !important; min-height: 52px !important; border-radius: 12px !important; box-shadow: none !important; border: 1px solid var(--line) !important; }
.firebaseui-card-content { padding: 0 !important; }
.firebaseui-card-footer { display: none !important; }
.notice { display: grid; gap: 2px; margin-top: 24px; padding: 14px 16px; border-radius: 13px; font-size: .9rem; }
.notice[hidden] { display: none; }
.notice-warning { color: #74520e; border: 1px solid #f3dca6; background: var(--warning-soft); }
.notice-error { color: #962c38; border: 1px solid #f1c5ca; background: var(--danger-soft); }
.manage-section { display: grid; gap: 18px; margin-top: 28px; }
.manage-section[hidden] { display: none; }
.signed-user { display: flex; align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 15px; background: var(--canvas); }
.signed-user div { min-width: 0; display: grid; }
.signed-user small { color: var(--muted); }
.signed-user strong { overflow: hidden; text-overflow: ellipsis; }
.signed-avatar { width: 43px; height: 43px; flex: 0 0 43px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--brand); font-weight: 800; }
.danger-zone { display: grid; gap: 16px; padding: 20px; border: 1px solid #f0c9cd; border-radius: 16px; background: var(--danger-soft); }
.danger-zone h2 { margin: 0; color: #962c38; font-size: 1.08rem; }
.danger-zone p { margin: 4px 0 0; color: #80545a; font-size: .9rem; }
.utility-footnote { margin: 26px 0 0; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); text-align: center; font-size: .82rem; }
.utility-footnote a, .store-link { color: var(--brand); }

.invite-card { text-align: center; }
.invite-logo-wrap { width: 116px; height: 116px; display: grid; place-items: center; margin: -4px auto 20px; border-radius: 32px; background: linear-gradient(145deg, #edf4ff, #f4edff); }
.invite-logo-wrap img { border-radius: 50%; box-shadow: var(--shadow-sm); }
.invite-description { max-width: 470px; margin-inline: auto; }
.code-panel { position: relative; display: grid; gap: 4px; margin: 28px 0 0; padding: 18px 54px; border: 1px dashed #aebbd9; border-radius: 16px; background: #f7f9ff; }
.code-panel > span { color: var(--muted); font-size: .78rem; font-weight: 750; }
.code-panel strong { color: var(--brand-dark); font-size: clamp(1.2rem, 5vw, 1.65rem); letter-spacing: .09em; }
.code-panel.invalid { border-color: #e4b9be; background: var(--danger-soft); }
.icon-button { position: absolute; inset-inline-end: 12px; top: 50%; width: 38px; height: 38px; display: grid; place-items: center; padding: 0; transform: translateY(-50%); border: 0; border-radius: 10px; color: var(--brand); background: var(--brand-soft); cursor: pointer; }
.icon-button:hover { background: #dce5fa; }
.inline-message { min-height: 24px; margin: 8px 0 0; color: var(--muted); font-size: .82rem; }
.inline-message.error { color: var(--danger); }
.invite-actions { display: grid; gap: 11px; margin-top: 22px; }
.store-link { margin-top: 4px; font-size: .88rem; text-underline-offset: 3px; }
.button.is-disabled { pointer-events: none; opacity: .5; box-shadow: none; }
.not-found-card { text-align: center; }
.not-found-card img { margin-inline: auto; border-radius: 50%; }
.error-code { display: block; margin-top: 18px; color: var(--brand); font-size: .9rem; font-weight: 900; letter-spacing: .18em; }
.not-found-card .button { margin-top: 24px; }

@media (max-width: 900px) {
  .hero-grid { min-height: auto; grid-template-columns: 1fr; gap: 22px; padding-top: 58px; text-align: center; }
  .hero-copy > p { margin-inline: auto; }
  .hero-actions { justify-content: center; }
  .hero-visual { min-height: 480px; }
  .feature-grid { grid-template-columns: 1fr; }
  .feature-card { display: grid; grid-template-columns: auto 1fr; column-gap: 16px; }
  .feature-card h3 { align-self: end; margin: 0 0 2px; }
  .feature-card p { grid-column: 2; }
  .split-card { grid-template-columns: 1fr; gap: 32px; }
  .cta-card { grid-template-columns: auto 1fr; }
  .cta-card .button { grid-column: 1 / -1; }
}

@media (max-width: 620px) {
  .shell { width: min(calc(100% - 28px), 1120px); }
  .desktop-link { display: none; }
  .site-header, .header-inner { min-height: 68px; }
  .brand { font-size: 1.05rem; }
  .brand img { width: 40px; height: 40px; }
  .header-actions { gap: 10px; }
  .button-small { min-height: 40px; padding: 8px 12px; font-size: .82rem; }
  .hero-grid { padding-block: 48px 58px; }
  .hero h1 { font-size: clamp(2.15rem, 12vw, 3.2rem); }
  .hero-copy > p { font-size: 1rem; }
  .hero-actions .button { width: 100%; }
  .hero-visual { min-height: 420px; }
  .orbit-one { width: 330px; height: 330px; }
  .orbit-two { width: 410px; height: 410px; }
  .phone-card { width: 300px; }
  .section { padding-block: 70px; }
  .feature-card { display: block; padding: 23px; }
  .feature-card h3 { margin-top: 17px; }
  .feature-card p { margin-top: 5px; }
  .identity-demo { padding: 12px; }
  .identity-row { grid-template-columns: 1fr auto; gap: 5px 10px; }
  .identity-row strong { grid-column: 1 / -1; grid-row: 2; }
  .identity-row i { grid-column: 2; grid-row: 1; }
  .cta-card { grid-template-columns: 1fr; text-align: center; padding: 30px 22px; }
  .cta-card img { margin-inline: auto; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; gap: 4px; }
  .utility-main { min-height: calc(100vh - 68px); padding-block: 24px 38px; }
  .account-card, .invite-card, .not-found-card { padding: 26px 20px; border-radius: 24px; }
  .back-link { font-size: .8rem; }
  .code-panel { padding-inline: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
