@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display&family=DM+Sans:wght@400;500;600&display=swap');

:root {
  --navy: #0f172a;
  --navy-light: #1e293b;
  --white: #ffffff;
  --off-white: #f8fafc;
  --accent: #e2e8f0;
  --muted: #94a3b8;
  --blue: #3b82f6;
  --radius: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--navy);
  color: var(--white);
  min-height: 100vh;
}


/* ══════════════════════════════════
   HOME
   ══════════════════════════════════ */
.home { display: flex; align-items: center; justify-content: center; min-height: 100vh; }

.hero {
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 4rem 2rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

h1 {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(2.5rem, 5vw, 4rem);
  line-height: 1.1;
  margin-bottom: 1.25rem;
}

.sub {
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1.6;
  margin-bottom: 2rem;
  max-width: 420px;
}

.handle-check { margin-bottom: .75rem; }

.handle-row {
  display: flex;
  align-items: center;
  background: var(--navy-light);
  border: 1px solid #334155;
  border-radius: var(--radius);
  overflow: hidden;
}

.handle-prefix {
  padding: 0 .75rem;
  color: var(--muted);
  font-size: .95rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.handle-row input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--white);
  font-family: inherit;
  font-size: 1rem;
  padding: .85rem 0;
  min-width: 0;
}

.handle-row input::placeholder { color: #475569; }

#claim-btn {
  background: var(--white);
  color: var(--navy);
  border: none;
  padding: .85rem 1.5rem;
  font-family: inherit;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity .15s;
  flex-shrink: 0;
}
#claim-btn:hover { opacity: .85; }

#handle-status {
  font-size: .875rem;
  margin-top: .5rem;
  min-height: 1.2rem;
  padding-left: .25rem;
}
#handle-status.available { color: #4ade80; }
#handle-status.taken { color: #f87171; }

.price-note { color: var(--muted); font-size: .875rem; margin-top: .5rem; }

/* Sample card */
.hero-card { display: flex; justify-content: center; align-items: center; }

.sample-card {
  background: var(--white);
  color: var(--navy);
  border-radius: 16px;
  padding: 1.5rem;
  width: 260px;
  text-align: center;
  box-shadow: 0 40px 80px rgba(0,0,0,.4);
}

.sample-qr-img {
  width: 180px;
  height: 180px;
  border-radius: 8px;
  display: block;
  margin: 0 auto 1rem;
}

.sample-handle {
  font-family: 'DM Serif Display', serif;
  font-size: 1.2rem;
  margin-bottom: .75rem;
}

.sample-links { display: flex; gap: .5rem; justify-content: center; flex-wrap: wrap; }
.sample-links span {
  background: var(--navy);
  color: var(--white);
  font-size: .75rem;
  padding: .3rem .75rem;
  border-radius: 999px;
}

/* ══════════════════════════════════
   FORMS (customize, login, dashboard)
   ══════════════════════════════════ */
.form-wrap {
  max-width: 540px;
  margin: 0 auto;
  padding: 3rem 2rem;
}

.back { color: var(--muted); text-decoration: none; font-size: .9rem; display: inline-block; margin-bottom: 2rem; }
.back:hover { color: var(--white); }

h2 { font-family: 'DM Serif Display', serif; font-size: 2rem; margin-bottom: .5rem; }

.handle-display { color: var(--muted); margin-bottom: 2rem; }

.section-label {
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 1.5rem 0 .75rem;
}

.optional { font-weight: 400; text-transform: none; letter-spacing: 0; }

/* Emoji picker */
.emoji-grid {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: .75rem;
}

#emoji-grid {
  max-height: 320px;
  overflow-y: auto;
  padding-right: 4px;
}
#emoji-grid::-webkit-scrollbar { width: 4px; }
#emoji-grid::-webkit-scrollbar-track { background: transparent; }
#emoji-grid::-webkit-scrollbar-thumb { background: #334155; border-radius: 4px; }

.emoji-cat-label {
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #475569;
  margin: .75rem 0 .4rem;
  width: 100%;
}
.emoji-cat-label:first-child { margin-top: 0; }

.emoji-row {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  margin-bottom: .25rem;
}

.emoji-btn {
  width: 44px;
  height: 44px;
  background: var(--navy-light);
  border: 2px solid #334155;
  border-radius: 8px;
  font-size: 1.4rem;
  cursor: pointer;
  transition: border-color .15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.emoji-btn.selected { border-color: var(--white); }
.emoji-clear { background: none; border: none; color: var(--muted); cursor: pointer; font-size: .875rem; }
.emoji-clear:hover { color: var(--white); }

/* QR Preview */
.qr-preview-wrap { margin: 1.5rem 0; }
#qr-preview-container { width: 180px; height: 180px; position: relative; }
#qr-preview-img { width: 100%; height: 100%; border-radius: 8px; display: none; }
.qr-preview-spinner { color: var(--muted); font-size: .875rem; padding-top: .5rem; }

/* Inputs */
input[type="email"], input[type="text"], input[type="url"] {
  width: 100%;
  background: var(--navy-light);
  border: 1px solid #334155;
  border-radius: var(--radius);
  color: var(--white);
  font-family: inherit;
  font-size: 1rem;
  padding: .85rem 1rem;
  outline: none;
  transition: border-color .15s;
}
input:focus { border-color: var(--white); }
input::placeholder { color: #475569; }

.email-note { color: var(--muted); font-size: .8rem; margin-top: .5rem; }

/* Buttons */
.btn-primary {
  display: block;
  width: 100%;
  background: var(--white);
  color: var(--navy);
  border: none;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  padding: 1rem;
  cursor: pointer;
  margin-top: 1.5rem;
  transition: opacity .15s;
  text-align: center;
  text-decoration: none;
}
.btn-primary:hover { opacity: .85; }

.btn-secondary {
  display: inline-block;
  background: none;
  color: var(--white);
  border: 1px solid #334155;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: .9rem;
  padding: .6rem 1.25rem;
  cursor: pointer;
  text-decoration: none;
  transition: border-color .15s;
}
.btn-secondary:hover { border-color: var(--white); }

.fine-print { color: var(--muted); font-size: .8rem; text-align: center; margin-top: .75rem; }

/* ══════════════════════════════════
   SUCCESS
   ══════════════════════════════════ */
.success-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.success-wrap { text-align: center; padding: 4rem 2rem; max-width: 480px; }
.success-icon { font-size: 3rem; margin-bottom: 1.5rem; }
.success-wrap h1 { font-family: 'DM Serif Display', serif; font-size: 2.5rem; margin-bottom: 1rem; }
.success-wrap p { color: var(--muted); line-height: 1.6; margin-bottom: 1rem; }
.live-link { color: var(--white); font-weight: 600; }
.success-note { font-size: .875rem; }

/* ══════════════════════════════════
   DASHBOARD
   ══════════════════════════════════ */
.dash-wrap { max-width: 600px; margin: 0 auto; padding: 2rem; }
.dash-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem; }
.dash-handle { color: var(--muted); margin-bottom: 2rem; }
.view-link { color: var(--white); font-size: .9rem; }
.dash-qr { margin-bottom: 2rem; }
.dash-qr img { width: 160px; height: 160px; border-radius: 8px; display: block; margin-bottom: .75rem; }
.dash-wrap h3 { font-family: 'DM Serif Display', serif; font-size: 1.5rem; margin-bottom: 1rem; }

/* Link rows */
.link-platform-select { position: relative; width: 100%; }

.selected-platform {
  display: flex;
  align-items: center;
  gap: .5rem;
  background: var(--navy);
  border: 1px solid #334155;
  border-radius: 8px;
  padding: .6rem .75rem;
  cursor: pointer;
  font-size: .9rem;
  color: var(--white);
  user-select: none;
  width: 100%;
}
.selected-platform img { flex-shrink: 0; filter: brightness(0) invert(1); }

.platform-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  width: 220px;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 8px;
  max-height: 280px;
  overflow-y: auto;
  z-index: 100;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
}
.platform-dropdown.open { display: block; }

.platform-option {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .6rem .75rem;
  cursor: pointer;
  font-size: .875rem;
  color: var(--white);
  transition: background .1s;
}
.platform-option:hover { background: #273548; }
.platform-option img { flex-shrink: 0; filter: brightness(0) invert(1); }

.link-row {
  position: relative;
  background: var(--navy-light);
  border: 1px solid #334155;
  border-radius: var(--radius);
  padding: .85rem 2.5rem .85rem .85rem;
  margin-bottom: .6rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.link-row .remove-link {
  position: absolute;
  top: .5rem;
  right: .5rem;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: .9rem;
  padding: .25rem;
  line-height: 1;
}
.link-row .remove-link:hover { color: #f87171; }

.link-field {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.link-field-label {
  font-size: .8rem;
  color: var(--muted);
  width: 50px;
  flex-shrink: 0;
}

.link-field .link-platform-select,
.link-field input[type="url"],
.link-field input[type="text"] {
  flex: 1;
  min-width: 0;
  width: 100%;
}

#save-status { margin-top: .75rem; font-size: .875rem; color: #4ade80; }

/* ══════════════════════════════════
   LOGIN
   ══════════════════════════════════ */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
#login-status { margin-top: 1rem; font-size: .875rem; color: #4ade80; }

/* ══════════════════════════════════
   PROFILE SVG ICONS
   ══════════════════════════════════ */
.link-icon-img {
  filter: brightness(0) invert(1);
  flex-shrink: 0;
}

/* ══════════════════════════════════
   MOBILE
   ══════════════════════════════════ */
@media (max-width: 768px) {

  /* Home */
  .home { align-items: flex-start; }

  .hero {
    grid-template-columns: 1fr;
    padding: 3rem 1.25rem 2rem;
    gap: 2rem;
  }

  h1 { font-size: 2.6rem; }

  .sub { font-size: 1rem; max-width: 100%; }

  .handle-row { flex-wrap: wrap; border-radius: var(--radius); }

  .handle-prefix {
    width: 100%;
    padding: .75rem .85rem .25rem;
    font-size: .85rem;
  }

  .handle-row input {
    width: 100%;
    padding: .25rem .85rem .75rem;
    font-size: 1.1rem;
  }

  #claim-btn {
    width: 100%;
    border-radius: 0 0 var(--radius) var(--radius);
    padding: 1rem;
    font-size: 1rem;
  }

  /* Show a simplified card on mobile */
  .hero-card { display: flex; }

  .sample-card {
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
    padding: 1.25rem;
  }

  .sample-qr-img { width: 140px; height: 140px; }

  /* Customize */
  .form-wrap { padding: 2rem 1.25rem; }

  #qr-preview-container {
    width: 200px;
    height: 200px;
    margin: 0 auto;
  }

  #qr-preview-img { display: block; }

  .emoji-btn { width: 40px; height: 40px; }

  /* Dashboard */
  .dash-wrap { padding: 1.25rem; }

  .dash-qr img { width: 120px; height: 120px; }

  .link-field-label { width: 42px; font-size: .75rem; }

  .platform-dropdown { width: 100%; }

  .btn-secondary { width: 100%; text-align: center; display: block; margin-bottom: .5rem; }

  /* Success */
  .success-wrap { padding: 3rem 1.25rem; }
  .success-wrap h1 { font-size: 2rem; }
}

/* Landscape mobile */
@media (max-width: 900px) and (orientation: landscape) {
  .hero {
    grid-template-columns: 1fr 1fr;
    padding: 2rem 1.5rem;
    gap: 2rem;
    align-items: center;
  }

  h1 { font-size: 2rem; }
  .sub { font-size: .9rem; margin-bottom: 1rem; }

  .handle-row { flex-wrap: nowrap; }
  .handle-prefix { width: auto; padding: 0 .75rem; }
  .handle-row input { padding: .75rem 0; font-size: .95rem; }
  #claim-btn { width: auto; border-radius: 0; padding: .75rem 1.25rem; }

  .sample-card { width: 200px; padding: 1rem; }
  .sample-qr-img { width: 120px; height: 120px; }
}

/* ══════════════════════════════════
   HERO DEMO
   ══════════════════════════════════ */
.hero-demo {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.demo-qr img {
  width: 160px;
  height: 160px;
  border-radius: 12px;
  display: block;
  box-shadow: 0 20px 40px rgba(0,0,0,.4);
}

.demo-arrow {
  font-size: 2rem;
  color: var(--muted);
  flex-shrink: 0;
}

.demo-page {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 16px;
  padding: 1rem;
  min-width: 170px;
}

.demo-handle {
  font-family: 'DM Serif Display', serif;
  font-size: 1.1rem;
  margin-bottom: .75rem;
  text-align: center;
}

.demo-link {
  display: flex;
  align-items: center;
  gap: .6rem;
  background: #273548;
  border-radius: 8px;
  padding: .5rem .75rem;
  font-size: .85rem;
  margin-bottom: .4rem;
}
.demo-link:last-child { margin-bottom: 0; }

.demo-icon { font-size: 1rem; }

@media (max-width: 768px) {
  .hero-demo {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
  }

  .demo-arrow {
    transform: rotate(90deg);
    font-size: 1.5rem;
  }

  .demo-qr img { width: 130px; height: 130px; }

  .demo-page { min-width: 220px; width: 100%; max-width: 280px; }
}

@media (max-width: 900px) and (orientation: landscape) {
  .hero-demo { flex-direction: row; }
  .demo-arrow { transform: none; }
  .demo-qr img { width: 110px; height: 110px; }
}

/* Demo QR white wrapper */
.demo-qr {
  background: #ffffff;
  border-radius: 16px;
  padding: 24px;
  display: inline-flex;
  box-shadow: 0 20px 40px rgba(0,0,0,.4);
}

.demo-qr img {
  width: 160px;
  height: 160px;
  border-radius: 0;
  display: block;
  box-shadow: none;
}

.demo-link-icon {
  filter: brightness(0) invert(1);
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .demo-qr { padding: 18px; }
  .demo-qr img { width: 120px; height: 120px; }
}

/* ── Hero blurb ── */
.blurb {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.6;
  margin-bottom: 1.75rem;
  max-width: 420px;
}

.emph {
  color: #60ECBD;
  display: block;
  margin-bottom: .75rem;
  font-size: 1.05rem;
}

.emph-arrow {
  font-size: .525rem;
  position: relative;
  top: -.25em;
  margin-right: .2em;
}

@media (max-width: 768px) {
  .handle-prefix {
    display: flex;
    align-items: center;
    padding: .75rem .85rem;
    width: 100%;
    border-bottom: 1px solid #334155;
  }

  .handle-row input {
    padding: .75rem .85rem;
  }
}

@media (max-width: 768px) {
  .handle-prefix { border-bottom: none; }
}

/* ── Home nav ── */
.home-nav {
  position: absolute;
  top: 1.5rem;
  right: 2rem;
}

.home-login {
  color: var(--muted);
  text-decoration: none;
  font-size: .9rem;
  transition: color .15s;
}
.home-login:hover { color: var(--white); }

@media (max-width: 768px) {
  .home-nav { top: 1rem; right: 1.25rem; }
}

.login-page .form-wrap h2 { margin-bottom: 1rem; }
.login-page .form-wrap p { margin-bottom: 1.25rem; }
