/* ============================================================
   Dotto — coming soon landing
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  --bg: #05060a;
  --text: #f5f5f7;
  --text-2: #a1a7b3;
  --cyan: #37e6ff;
  --blue: #5b8cff;

  --glass-bg: rgba(13, 18, 28, 0.55);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-blur: blur(14px) saturate(140%);
  --radius: 22px;
  --radius-sm: 12px;

  --field-bg: rgba(255, 255, 255, 0.06);
  --field-bg-hover: rgba(255, 255, 255, 0.09);

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue",
          "Segoe UI", Roboto, sans-serif;
}

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

html { color-scheme: dark; font-size: 93.75%; } /* 15px base — slightly smaller type everywhere */

body {
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  /* layered fallback: soft cyan/blue glows even before/without WebGL */
  background:
    radial-gradient(1100px 700px at 72% 18%, rgba(55, 230, 255, 0.07), transparent 60%),
    radial-gradient(950px 640px at 22% 85%, rgba(91, 140, 255, 0.09), transparent 62%),
    radial-gradient(700px 500px at 50% 50%, rgba(91, 140, 255, 0.04), transparent 70%),
    var(--bg);
}

/* ---------- Background layers ---------- */
#bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  display: block;
}
html.no-webgl #bg { display: none; }

.vignette {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(3, 4, 8, 0.45), transparent 18%),
    radial-gradient(ellipse 62% 54% at 50% 46%, rgba(3, 4, 8, 0.52), transparent 72%),
    radial-gradient(ellipse at center, transparent 55%, rgba(3, 4, 8, 0.85));
}

/* content sits above canvas + vignette */
.site-header, .hero, .socials, .site-footer { position: relative; z-index: 1; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* honeypot: offscreen, still focusable-by-bots (not display:none) */
#website {
  position: absolute;
  left: -9999px;
  top: 0;
  width: 1px; height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* ---------- Focus ---------- */
:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

/* ---------- Header / logo ---------- */
.site-header {
  display: flex;
  justify-content: center;
  padding-top: clamp(20px, 4.5vh, 48px);
}

.logo {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-decoration: none;
  color: var(--text);
}

.logo-word {
  font-size: clamp(1.7rem, 3.2vw, 2.1rem);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1;
  display: inline-flex;
  align-items: baseline;
}

.logo-dot {
  width: 0.32em;
  height: 0.32em;
  margin-left: 0.14em;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #b5f8ff, var(--cyan) 60%);
  box-shadow:
    0 0 6px rgba(55, 230, 255, 0.9),
    0 0 18px rgba(55, 230, 255, 0.55),
    0 0 36px rgba(55, 230, 255, 0.3);
}

.logo-tag {
  font-size: 0.64rem;
  font-weight: 500;
  letter-spacing: 0.42em;
  text-indent: 0.42em; /* optically centers the tracked text */
  text-transform: uppercase;
  color: var(--text-2);
}

/* ---------- Hero ---------- */
.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: clamp(20px, 4vh, 44px) 20px clamp(88px, 12vh, 120px);
  gap: clamp(14px, 2.4vh, 24px);
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.25em;
  text-indent: 0.25em;
  text-transform: uppercase;
  color: var(--text-2);
}

.eyebrow-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 8px rgba(55, 230, 255, 0.9);
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.45; transform: scale(0.78); }
}

h1 {
  font-size: clamp(2.5rem, 5.5vw, 4.4rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.05;
  background: linear-gradient(180deg, #ffffff 20%, #b9c6dc 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: #fff; /* fallback if clip unsupported */
}

.sub {
  max-width: 34em;
  font-size: clamp(0.98rem, 1.4vw, 1.14rem);
  line-height: 1.6;
  color: var(--text-2);
  text-wrap: balance;
}

/* ---------- Countdown ---------- */
.countdown {
  display: flex;
  gap: clamp(10px, 1.8vw, 18px);
  justify-content: center;
  flex-wrap: wrap;
}

.cd-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: clamp(76px, 10vw, 118px);
  padding: clamp(12px, 2vh, 18px) clamp(10px, 1.6vw, 18px);
  border-radius: var(--radius);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
}

.cd-num {
  font-size: clamp(2rem, 3.7vw, 3.1rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  min-width: 2ch; /* grows naturally to 3 digits for days */
}

.cd-label {
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-indent: 0.22em;
  text-transform: uppercase;
  color: var(--text-2);
}

/* ---------- Waitlist card ---------- */
.card {
  width: min(100%, 660px);
  padding: clamp(22px, 3.4vh, 32px) clamp(18px, 3vw, 32px);
  border-radius: var(--radius);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  text-align: center;
}

.card h2 {
  font-size: clamp(1.2rem, 2vw, 1.45rem);
  font-weight: 600;
  letter-spacing: -0.015em;
}

.card-line {
  margin-top: 6px;
  font-size: 0.92rem;
  color: var(--text-2);
}

#waitlist-form { margin-top: clamp(14px, 2vh, 20px); }

.form-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.email-field { flex: 1 1 200px; display: flex; }

/* shared field look */
#country-btn,
#email {
  height: 48px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: var(--field-bg);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  transition: background-color 0.18s ease, border-color 0.18s ease;
}

#country-btn:hover,
#email:hover { background: var(--field-bg-hover); }

#email {
  width: 100%;
  padding: 0 14px;
}
#email::placeholder { color: color-mix(in srgb, var(--text-2) 75%, transparent); }

/* ---------- Country picker ---------- */
.country-picker {
  position: relative;
  flex: 0 1 205px;
  min-width: 158px;
  text-align: left;
}

.country-picker.shake { animation: shake 0.4s ease; }

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(3px); }
}

#country-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 12px;
  cursor: pointer;
}

.cb-value {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cb-value > span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.cb-placeholder { color: var(--text-2); }

.cb-chevron {
  flex: none;
  color: var(--text-2);
  transition: transform 0.18s ease;
}
#country-btn[aria-expanded="true"] .cb-chevron { transform: rotate(180deg); }

.flag {
  width: 20px;
  height: 20px;
  flex: none;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12);
}

#country-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: max(100%, 280px);
  z-index: 40;
  padding: 8px;
  border-radius: 16px;
  /* dense enough to skip backdrop-filter entirely (cheaper over WebGL) */
  background: rgba(13, 18, 28, 0.96);
  border: 1px solid var(--glass-border);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
}

#country-panel.open-up {
  top: auto;
  bottom: calc(100% + 8px);
}

#country-search {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--glass-border);
  background: var(--field-bg);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
}
#country-search::placeholder { color: color-mix(in srgb, var(--text-2) 75%, transparent); }

#country-list {
  list-style: none;
  margin-top: 8px;
  max-height: 300px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}
#country-list::-webkit-scrollbar { width: 6px; }
#country-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}
#country-list::-webkit-scrollbar-track { background: transparent; }

#country-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 9px;
  font-size: 0.92rem;
  cursor: pointer;
  white-space: nowrap;
}
#country-list li > span { overflow: hidden; text-overflow: ellipsis; }

#country-list li:hover,
#country-list li.active { background: rgba(255, 255, 255, 0.08); }

#country-list li[aria-selected="true"] {
  background: color-mix(in srgb, var(--cyan) 14%, transparent);
  color: #fff;
}

.no-results {
  padding: 12px 10px;
  font-size: 0.88rem;
  color: var(--text-2);
  cursor: default !important;
}
.no-results:hover { background: none !important; }

/* ---------- Submit button ---------- */
#submit-btn {
  position: relative;
  flex: none;
  height: 48px;
  padding: 0 24px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #2bd2ff, var(--blue));
  color: #04222e; /* dark ink on the bright gradient: WCAG AA on both ends */
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(43, 210, 255, 0.28);
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

#submit-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 30px rgba(43, 210, 255, 0.4);
}
#submit-btn:active { transform: translateY(0) scale(0.98); }
#submit-btn:disabled { cursor: default; opacity: 0.75; transform: none; }

.btn-spinner {
  display: none;
  position: absolute;
  top: 50%; left: 50%;
  width: 18px; height: 18px;
  margin: -9px 0 0 -9px;
  border: 2px solid rgba(4, 34, 46, 0.3);
  border-top-color: #04222e;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

#submit-btn.is-loading .btn-label { visibility: hidden; }
#submit-btn.is-loading .btn-spinner { display: block; }

#form-msg {
  min-height: 1.2em;
  margin-top: 12px;
  font-size: 0.88rem;
  color: #ff9fb1;
}
#form-msg:empty { margin-top: 0; }

/* ---------- Success state ---------- */
#waitlist-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
}
#waitlist-success[hidden] { display: none; }

.success-check {
  color: var(--cyan);
  filter: drop-shadow(0 0 14px rgba(55, 230, 255, 0.5));
}

#success-msg {
  font-size: 0.94rem;
  color: var(--text-2);
  max-width: 30em;
}

/* ---------- Socials ---------- */
.socials {
  position: fixed;
  right: clamp(16px, 2.6vw, 32px);
  bottom: clamp(16px, 3vh, 28px);
  display: flex;
  gap: 10px;
  z-index: 2;
}

.socials a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px; height: 42px;
  border-radius: 50%;
  color: var(--text-2);
  /* small icons over an animating canvas: solid-ish bg beats backdrop-filter */
  background: rgba(13, 18, 28, 0.72);
  border: 1px solid var(--glass-border);
  transition: color 0.18s ease, border-color 0.18s ease,
              box-shadow 0.18s ease, transform 0.18s ease;
}

.socials a:hover {
  color: #fff;
  border-color: color-mix(in srgb, var(--cyan) 55%, transparent);
  box-shadow: 0 0 18px rgba(55, 230, 255, 0.28);
  transform: translateY(-2px);
}

/* ---------- Footer ---------- */
.site-footer {
  position: fixed;
  left: clamp(16px, 2.6vw, 32px);
  bottom: clamp(18px, 3vh, 30px);
  z-index: 2;
  font-size: 0.8rem;
  color: var(--text-2);
}

.site-footer a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid rgba(161, 167, 179, 0.35);
  transition: color 0.18s ease, border-color 0.18s ease;
}
.site-footer a:hover { color: var(--text); border-color: var(--text); }

/* ---------- Entrance ---------- */
@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

.site-header, .eyebrow, h1, .sub, .countdown-wrap, .card {
  animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.eyebrow         { animation-delay: 0.08s; }
h1               { animation-delay: 0.16s; }
.sub             { animation-delay: 0.24s; }
.countdown-wrap  { animation-delay: 0.32s; }
.card            { animation-delay: 0.40s; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ---------- Responsive ---------- */
/* Phones/tablets: backdrop-filter over a per-frame-animating WebGL canvas is
   a jank source — swap glass blur for denser fills. */
@media (max-width: 720px), (pointer: coarse) {
  .eyebrow, .cd-cell, .card {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    background: rgba(13, 18, 28, 0.82);
  }
}

@media (max-width: 720px) {
  .form-row { flex-direction: column; }
  .country-picker { flex: none; width: 100%; }
  #country-panel { width: 100%; }
  #submit-btn { width: 100%; }

  /* corners rejoin the flow: socials centered above footer */
  .hero { padding-bottom: clamp(20px, 4vh, 44px); }
  .socials {
    position: static;
    justify-content: center;
    padding: 8px 0 14px;
  }
  .site-footer {
    position: static;
    text-align: center;
    padding: 0 16px calc(20px + env(safe-area-inset-bottom, 0px));
  }
}

@media (max-width: 380px) {
  .cd-cell { min-width: 70px; padding: 10px 6px; }
  .cd-num { font-size: 1.9rem; }
}

/* keep everything on one screen for roomy desktop viewports */
@media (min-width: 721px) and (min-height: 760px) {
  body { height: 100vh; height: 100svh; height: 100dvh; overflow: hidden; }
}
