/* smoooch.bio app UI: landing, auth, editor, stats. */

:root {
  --paper: #fff4ef;
  --surface: #ffffff;
  --surface-2: #fff0ea;
  --ink: #1d1418;
  --ink-2: #5d4a52;
  --line: #f0dcd4;
  --accent: #ff2d6f;
  --accent-ink: #ffffff;
  --accent-soft: #ffe0ea;
  --danger: #c4183c;
  --ok: #138a52;
  --shadow: 0 1px 2px rgba(60, 20, 30, .06), 0 8px 24px rgba(60, 20, 30, .06);
  --radius: 18px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #170f14;
    --surface: #22181e;
    --surface-2: #2b1f26;
    --ink: #fbeff3;
    --ink-2: #c3aab4;
    --line: #3b2b33;
    --accent: #ff4d84;
    --accent-ink: #1a0b11;
    --accent-soft: #4a1d2d;
    --danger: #ff6b86;
    --ok: #4ad295;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Figtree', ui-sans-serif, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: 'Bricolage Grotesque', sans-serif; letter-spacing: -0.02em; line-height: 1.1; }
a { color: var(--accent); text-underline-offset: 3px; }
.muted { color: var(--ink-2); }
.small { font-size: 14px; }
.center { text-align: center; }
[hidden] { display: none !important; }

/* ---- buttons & forms ------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font: 700 16px/1 'Figtree', sans-serif;
  text-decoration: none;
  cursor: pointer;
  transition: transform .12s ease, filter .12s ease;
  white-space: nowrap;
}
.btn:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .6; cursor: default; transform: none; }
.btn-small { min-height: 38px; padding: 0 16px; font-size: 14.5px; }
.btn-block { width: 100%; }
.btn-ghost { background: var(--surface-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.linklike { background: none; border: 0; padding: 0; color: var(--ink-2); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.linklike:hover { color: var(--ink); }
.inline-form { display: inline; margin: 0; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.stack { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-weight: 650; font-size: 14.5px; display: flex; justify-content: space-between; }
input, textarea, select {
  width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}
textarea { resize: vertical; min-height: 80px; }
input:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.has-error input { border-color: var(--danger); }
.field-error, .form-error { color: var(--danger); font-size: 14px; margin: 0; }
.form-error:empty { display: none; }
.field-hint { color: var(--ink-2); font-size: 13.5px; }
.prefixed { display: flex; align-items: stretch; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface); overflow: hidden; }
.prefixed:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.prefixed > span { display: flex; align-items: center; padding-left: 14px; color: var(--ink-2); font-weight: 600; }
.prefixed input { border: 0; box-shadow: none !important; padding-left: 1px; }
.alert, .notice { margin: 0; padding: 12px 14px; border-radius: 12px; font-size: 15px; }
.alert { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); }
.notice { background: color-mix(in srgb, var(--ok) 12%, transparent); color: var(--ok); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.card h2 { margin: 0 0 14px; font-size: 20px; }

/* ---- top bar -------------------------------------------------------------- */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px clamp(16px, 4vw, 40px); }
.logo { display: inline-flex; align-items: baseline; text-decoration: none; color: var(--ink); font: 800 24px/1 'Bricolage Grotesque', sans-serif; letter-spacing: -0.03em; }
.logo-dot { width: 9px; height: 9px; margin: 0 2px; border-radius: 50%; background: var(--accent); align-self: center; transform: translateY(4px); }
.logo-tld { font-weight: 500; color: var(--ink-2); }
.topnav { display: flex; align-items: center; gap: 18px; font-weight: 600; }
.topnav > a:not(.btn) { color: var(--ink); text-decoration: none; }
.topnav > a:not(.btn):hover { color: var(--accent); }

/* ---- landing -------------------------------------------------------------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  align-items: center;
  gap: 40px;
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(24px, 6vw, 80px) clamp(16px, 4vw, 40px);
}
.eyebrow { display: inline-block; margin: 0 0 18px; padding: 6px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 14px; }
.hero h1 { margin: 0; font-size: clamp(42px, 7vw, 84px); font-weight: 800; letter-spacing: -0.04em; line-height: .98; }
.hero h1 em { font-style: normal; color: var(--accent); }
.lede { max-width: 52ch; margin: 22px 0 28px; font-size: clamp(17px, 1.6vw, 20px); color: var(--ink-2); }
.claim { display: flex; gap: 10px; max-width: 520px; padding: 6px; border-radius: 999px; background: var(--surface); border: 1.5px solid var(--line); box-shadow: var(--shadow); }
.claim-field { flex: 1; display: flex; align-items: center; min-width: 0; padding-left: 16px; font-weight: 650; color: var(--ink-2); }
.claim-field input { border: 0; min-height: 44px; padding: 0 4px 0 1px; background: transparent; box-shadow: none !important; font-weight: 650; color: var(--ink); min-width: 0; }
.hero-art { position: relative; height: 520px; }
.mini-phone {
  position: absolute;
  top: 10px;
  left: 50%;
  width: 250px;
  height: 500px;
  margin-left: -150px;
  border-radius: 40px;
  padding: 54px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  border: 8px solid var(--ink);
  box-shadow: 0 30px 60px rgba(60, 20, 30, .18);
  transform: rotate(-4deg);
  z-index: 2;
  background: linear-gradient(170deg, #ffe4ec 40%, #ffc2d6);
}
.mini-back { margin-left: -40px; top: 40px; transform: rotate(7deg); z-index: 1; background-color: #13122b; background-image: radial-gradient(rgba(255,255,255,.09) 1.6px, transparent 1.7px); background-size: 16px 16px; }
.mini-avatar { width: 70px; height: 70px; border-radius: 50%; background: #e8265e; box-shadow: 0 0 0 4px #ffe4ec, 0 0 0 6px #ff8fb2; }
.mini-name { width: 60%; height: 14px; border-radius: 7px; background: #3a0d1c; margin-top: 6px; }
.mini-bio { width: 80%; height: 9px; border-radius: 5px; background: rgba(58, 13, 28, .3); margin-bottom: 12px; }
.mini-link { width: 100%; height: 40px; border-radius: 999px; background: #e8265e; }
.mini-back .mini-avatar { background: #ff7aa8; box-shadow: 0 0 0 4px #13122b, 0 0 0 6px #ff7aa8; }
.mini-back .mini-name { background: #f6f1ff; }
.mini-back .mini-bio { background: rgba(246, 241, 255, .3); }
.mini-back .mini-link { background: transparent; border: 2px solid #f6f1ff; border-radius: 10px; }
.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; max-width: 1180px; margin: 0 auto; padding: 20px clamp(16px, 4vw, 40px) 60px; }
.features h2 { font-size: 22px; margin: 0 0 8px; }
.features p { margin: 0; color: var(--ink-2); }
.foot { text-align: center; color: var(--ink-2); padding: 30px 16px 40px; font-size: 14px; }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; }
  .hero-art { height: 360px; overflow: hidden; }
  .mini-phone { transform: scale(.7) rotate(-4deg); transform-origin: top center; }
  .mini-back { transform: scale(.7) rotate(7deg); }
  .features { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .claim { flex-direction: column; border-radius: 22px; }
  .claim .btn { width: 100%; }
  .topnav { gap: 12px; }
  .topnav > a:first-child:not(.btn) { display: none; }
}

/* ---- auth & messages ------------------------------------------------------ */
.auth { display: grid; place-items: start center; padding: clamp(16px, 6vh, 64px) 16px 60px; }
.auth-card { width: 100%; max-width: 440px; padding: clamp(22px, 5vw, 36px); }
.auth-card h1 { margin: 0 0 6px; font-size: 30px; }
.auth-card > .muted { margin: 0 0 22px; }
.big-status { margin: 0; font: 800 64px/1 'Bricolage Grotesque', sans-serif; color: var(--accent); }

/* ---- editor --------------------------------------------------------------- */
.editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 400px;
  gap: 32px;
  max-width: 1240px;
  margin: 0 auto;
  padding: 8px clamp(16px, 3vw, 40px) 60px;
  align-items: start;
}
.editor-main { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.editor-preview { position: sticky; top: 20px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.phone {
  width: 360px;
  height: min(740px, calc(100vh - 90px));
  border: 10px solid var(--ink);
  border-radius: 46px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: 0 24px 50px rgba(60, 20, 30, .16);
}
.phone iframe { width: 100%; height: 100%; border: 0; display: block; }
.save-state { margin: 0; font-size: 14px; color: var(--ink-2); }
.save-state.is-saving { color: var(--ink-2); }
.save-state.is-error { color: var(--danger); }

.share { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 16px 20px; background: var(--accent-soft); border-color: transparent; }
.share-label { margin: 0; font-size: 13.5px; color: var(--ink-2); font-weight: 600; }
.share-url { font: 700 19px/1.2 'Bricolage Grotesque', sans-serif; color: var(--ink); text-decoration: none; word-break: break-all; }
.share-url:hover { color: var(--accent); }

.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.card-head h2 { margin: 0; }
.grip-inline { font-weight: 700; }

.profile-edit { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px 22px; }
.profile-edit .field:last-child { grid-column: 1 / -1; }
.avatar-edit { grid-row: span 1; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.avatar-preview { width: 84px; height: 84px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font: 800 34px/1 'Bricolage Grotesque', sans-serif; overflow: hidden; }
.avatar-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-actions { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.file-btn { cursor: pointer; }
.counter { font-weight: 500; color: var(--ink-2); font-size: 13px; }

.add-link { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) auto; gap: 10px; }
.link-list { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.empty-hint { margin: 16px 0 0; }
.link-item {
  display: grid;
  grid-template-columns: 34px 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px 10px 4px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}
.link-item.is-hidden { background: var(--surface-2); }
.link-item.is-hidden .link-fields { opacity: .55; }
.link-item.sortable-ghost { opacity: .35; }
.link-item.sortable-chosen { box-shadow: var(--shadow); border-color: var(--accent); }
.grip { display: grid; place-items: center; height: 100%; min-height: 44px; cursor: grab; color: var(--ink-2); font-size: 20px; border: 0; background: none; touch-action: none; }
.grip:active { cursor: grabbing; }
.thumb-btn { position: relative; width: 52px; height: 52px; border-radius: 10px; border: 1.5px dashed var(--line); background: var(--surface-2); color: var(--ink-2); display: grid; place-items: center; cursor: pointer; overflow: hidden; padding: 0; font-size: 11px; font-weight: 700; }
.thumb-btn img { width: 100%; height: 100%; object-fit: cover; }
.thumb-btn.has-thumb { border-style: solid; }
.link-fields { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.link-fields input { min-height: 34px; padding: 4px 8px; border: 1.5px solid transparent; border-radius: 8px; background: transparent; }
.link-fields input:hover { border-color: var(--line); }
.link-fields input:focus { border-color: var(--accent); background: var(--surface); }
.link-fields .in-title { font-weight: 700; }
.link-fields .in-url { font-size: 14px; color: var(--ink-2); }
.link-fields .form-error { padding: 0 8px; font-size: 13px; }
.link-actions { display: flex; align-items: center; gap: 4px; }
.icon-btn { width: 40px; height: 40px; border-radius: 10px; border: 0; background: none; color: var(--ink-2); display: grid; place-items: center; cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn.danger:hover { color: var(--danger); }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.switch { position: relative; width: 44px; height: 26px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; min-height: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--line); transition: background .15s; pointer-events: none; }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .15s; }
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }

.socials-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; margin-top: 12px; }
.social-field { display: grid; grid-template-columns: 40px minmax(0, 1fr); align-items: center; gap: 8px; }
.social-field svg { width: 22px; height: 22px; fill: var(--ink); justify-self: center; }
.social-field input { min-height: 42px; }
.social-field .form-error { grid-column: 2; }

.theme-editor { display: flex; flex-direction: column; gap: 18px; }
.theme-group h3 { margin: 0 0 10px; font-size: 15px; font-family: 'Figtree', sans-serif; letter-spacing: 0; color: var(--ink-2); }
.options { display: flex; flex-wrap: wrap; gap: 10px; }
.option { position: relative; }
.option input { position: absolute; opacity: 0; inset: 0; margin: 0; min-height: 0; cursor: pointer; }
.option span { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 16px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); font-weight: 650; cursor: pointer; }
.option input:checked + span { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.option input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.swatch { display: inline-flex; width: 26px; height: 26px; border-radius: 50%; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); }
.swatch i { flex: 1; }

@media (max-width: 1080px) {
  .editor { grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; }
  .phone { width: 320px; }
}
@media (max-width: 900px) {
  .editor { grid-template-columns: 1fr; }
  .editor-preview { position: static; order: -1; }
  .phone { width: min(340px, 100%); height: 560px; }
}
@media (max-width: 600px) {
  .card { padding: 16px; }
  .add-link { grid-template-columns: 1fr; }
  .socials-grid { grid-template-columns: 1fr; }
  .profile-edit { grid-template-columns: 1fr; }
  .link-item { grid-template-columns: 28px 44px minmax(0, 1fr); }
  .thumb-btn { width: 44px; height: 44px; }
  .link-actions { grid-column: 2 / -1; justify-content: flex-end; }
}

/* ---- stats ---------------------------------------------------------------- */
.stats-page { max-width: 1000px; margin: 0 auto; padding: 8px clamp(16px, 3vw, 40px) 60px; display: flex; flex-direction: column; gap: 20px; }
.stats-head h1 { margin: 10px 0 6px; font-size: 36px; }
.stats-head p { margin: 0; }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.tile { display: flex; flex-direction: column; gap: 4px; padding: 18px; }
.tile-label { color: var(--ink-2); font-weight: 600; font-size: 14px; }
.tile-value { font: 800 34px/1 'Bricolage Grotesque', sans-serif; letter-spacing: -0.02em; }
.chart { display: block; width: 100%; height: 160px; }
.chart .bar { fill: var(--accent); }
.chart .bar-bg { fill: var(--surface-2); }
.chart-axis { display: flex; justify-content: space-between; margin-top: 8px; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.table th { font-size: 13.5px; color: var(--ink-2); font-weight: 650; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table tr.is-hidden td { opacity: .55; }
.t-title { display: block; font-weight: 650; }
.t-url { display: block; font-size: 13.5px; color: var(--ink-2); word-break: break-all; }
@media (max-width: 700px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---- sign in with Google -------------------------------------------------- */
.btn-google { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); gap: 10px; }
.btn-google:hover { filter: none; box-shadow: inset 0 0 0 1.5px var(--ink-2); }
.or { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--ink-2); font-size: 14px; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* ---- legal pages ---------------------------------------------------------- */
.legal { max-width: 760px; margin: 0 auto; padding: 24px 16px 40px; }
.legal-head h1 { font-size: clamp(32px, 5vw, 46px); margin: 0 0 6px; }
.legal section { margin-top: 28px; }
.legal h2 { font-size: 21px; margin: 0 0 10px; }
.legal p, .legal li { line-height: 1.65; }
.legal ul { padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
