/* Mighty Bond — Small moments. Stronger connections.
   Mobile-first. Dark, warm, uncluttered. */

/* ---------- tokens ---------- */
:root {
  --bg:          #100C10;
  --bg-soft:     #161115;
  --surface:     #1B151A;
  --surface-2:   #221A20;
  --surface-3:   #2A2027;
  --line:        rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);

  --text:        #F7F1EE;
  --text-2:      #CDC1C6;
  --muted:       #9C8F95;

  --coral:       #F58C6F;
  --coral-soft:  #FFB49C;
  --lav:         #B79CF2;
  --rose:        #EE93A8;

  --accent:      var(--coral);
  --accent-2:    var(--lav);

  --grad: linear-gradient(135deg, #F58C6F 0%, #EE93A8 48%, #B79CF2 100%);
  --grad-soft: linear-gradient(135deg, rgba(245,140,111,.16) 0%, rgba(183,156,242,.16) 100%);

  --r-sm: 12px;
  --r:    18px;
  --r-lg: 24px;
  --r-xl: 30px;

  --shadow:   0 10px 30px rgba(0, 0, 0, .38);
  --shadow-lg:0 22px 60px rgba(0, 0, 0, .5);
  --glow:     0 0 0 1px rgba(245,140,111,.28), 0 12px 34px rgba(245,140,111,.16);

  --nav-h: 68px;
  --pad: 20px;
  --maxw: 720px;

  --ease: cubic-bezier(.22, .8, .3, 1);
}

/* ---------- reset ---------- */
* { box-sizing: border-box; }
html, body { height: 100%; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto,
               "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overscroll-behavior-y: none;
}
body::before {
  /* soft warm ambience, never distracting */
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(60% 40% at 12% -6%, rgba(245,140,111,.14), transparent 70%),
    radial-gradient(55% 40% at 92% 4%, rgba(183,156,242,.13), transparent 72%);
  z-index: 0;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
:focus-visible {
  outline: 2px solid var(--coral-soft);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---------- shell ---------- */
.app { position: relative; z-index: 1; min-height: 100%; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: max(10px, env(safe-area-inset-top)) var(--pad) 10px;
  background: linear-gradient(180deg, rgba(16,12,16,.94), rgba(16,12,16,.72));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand__mark {
  width: 30px; height: 30px; border-radius: 10px;
  background: var(--grad);
  display: grid; place-items: center;
  box-shadow: 0 6px 18px rgba(245,140,111,.28);
  flex: none;
}
.brand__mark svg { width: 17px; height: 17px; display: block; }
.brand__name {
  font-size: 16px; font-weight: 650; letter-spacing: -.01em;
}
.topbar__link {
  font-size: 13px; color: var(--muted); padding: 8px 12px;
  border-radius: 999px; border: 1px solid var(--line);
  transition: color .2s var(--ease), border-color .2s var(--ease);
}
.topbar__link:hover { color: var(--text); border-color: var(--line-strong); }

.main {
  padding: 22px var(--pad) calc(var(--nav-h) + 34px + env(safe-area-inset-bottom));
  max-width: var(--maxw);
  margin: 0 auto;
  width: 100%;
}

/* ---------- bottom nav (mobile) ---------- */
.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  background: rgba(20, 15, 19, .92);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid var(--line);
}
.tabbar__item {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 8px 4px 6px;
  min-height: 52px;
  border-radius: 14px;
  color: var(--muted);
  font-size: 11px; font-weight: 550; letter-spacing: .01em;
  transition: color .18s var(--ease), background .18s var(--ease);
}
.tabbar__item svg { width: 21px; height: 21px; }
.tabbar__item.is-active { color: var(--text); background: rgba(255,255,255,.05); }
.tabbar__item.is-active svg { color: var(--coral); }
.tabbar__item:active { transform: scale(.96); }

/* ---------- sidebar (desktop) ---------- */
.sidebar { display: none; }

/* ---------- typography ---------- */
.eyebrow {
  font-size: 11px; text-transform: uppercase; letter-spacing: .14em;
  color: var(--muted); font-weight: 650;
}
.h-hero {
  font-size: 27px; line-height: 1.18; font-weight: 680; letter-spacing: -.025em;
}
.h-page {
  font-size: 24px; line-height: 1.2; font-weight: 680; letter-spacing: -.022em;
}
.h-sec { font-size: 15px; font-weight: 640; letter-spacing: -.01em; }
.sub { color: var(--muted); font-size: 14px; }
.gradient-text {
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}

/* ---------- page transitions ---------- */
.view { animation: viewIn .34s var(--ease) both; }
@keyframes viewIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}
.stack > * + * { margin-top: 14px; }
.stack-lg > * + * { margin-top: 24px; }

/* ---------- cards ---------- */
.card {
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px;
  box-shadow: var(--shadow);
}
.card--flat { box-shadow: none; background: var(--surface); }

/* option grid: the primary tap target across the app */
.options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.options--single { grid-template-columns: 1fr; }
.option {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  min-height: 62px;
  padding: 14px 15px;
  text-align: left;
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font-size: 15px; font-weight: 570; letter-spacing: -.008em;
  transition: transform .16s var(--ease), border-color .2s var(--ease),
              background .2s var(--ease), box-shadow .2s var(--ease);
}
.option__ico {
  width: 34px; height: 34px; flex: none;
  border-radius: 11px;
  display: grid; place-items: center;
  background: var(--grad-soft);
  border: 1px solid var(--line);
  font-size: 16px;
}
.option__txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.option__hint { font-size: 12px; font-weight: 450; color: var(--muted); }
.option:hover { border-color: var(--line-strong); background: var(--surface-2); }
.option:active { transform: scale(.977); }
.option.is-selected {
  border-color: transparent;
  background: var(--surface-2);
  box-shadow: var(--glow);
}

/* ---------- hero / home ---------- */
.hero {
  border-radius: var(--r-xl);
  padding: 24px 22px 22px;
  border: 1px solid var(--line);
  background:
    radial-gradient(120% 100% at 0% 0%, rgba(245,140,111,.16), transparent 62%),
    radial-gradient(120% 110% at 100% 10%, rgba(183,156,242,.16), transparent 60%),
    linear-gradient(180deg, var(--surface-2), var(--surface));
  box-shadow: var(--shadow-lg);
}
.hero .eyebrow { margin-bottom: 10px; }
.hero__q { margin-bottom: 16px; }

.quickbond {
  display: flex; align-items: center; gap: 14px;
  width: 100%;
  padding: 16px 18px;
  border-radius: var(--r-lg);
  background: var(--grad);
  color: #1B0E10;
  font-weight: 700; letter-spacing: -.01em;
  box-shadow: 0 14px 34px rgba(245,140,111,.24);
  transition: transform .16s var(--ease), box-shadow .2s var(--ease);
}
.quickbond:hover { box-shadow: 0 18px 44px rgba(245,140,111,.32); }
.quickbond:active { transform: scale(.985); }
.quickbond__ico {
  width: 38px; height: 38px; flex: none; border-radius: 13px;
  background: rgba(27,14,16,.14);
  display: grid; place-items: center;
}
.quickbond__ico svg { width: 20px; height: 20px; }
.quickbond__txt { text-align: left; line-height: 1.25; }
.quickbond__txt small {
  display: block; font-weight: 550; font-size: 12.5px; opacity: .72;
}
.quickbond__arrow { margin-left: auto; opacity: .6; }

.today {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(183,156,242,.09), rgba(255,255,255,0)) ,
    var(--surface);
}
.today__head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 9px;
}
.today__text { font-size: 16.5px; line-height: 1.42; font-weight: 560; }

.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.tile {
  display: flex; flex-direction: column; gap: 4px;
  padding: 15px;
  min-height: 92px;
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: var(--surface);
  text-align: left;
  transition: transform .16s var(--ease), border-color .2s var(--ease), background .2s var(--ease);
}
.tile:hover { border-color: var(--line-strong); background: var(--surface-2); }
.tile:active { transform: scale(.977); }
.tile__ico { font-size: 18px; margin-bottom: 6px; line-height: 1; }
.tile__ico svg { width: 20px; height: 20px; color: var(--coral); display: block; }
.tile__name { font-weight: 600; font-size: 14.5px; }
.tile__hint { font-size: 12px; color: var(--muted); line-height: 1.35; }

/* ---------- step flow ---------- */
.steps {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 4px;
}
.step-dot {
  height: 4px; flex: 1; border-radius: 99px;
  background: rgba(255,255,255,.09);
  overflow: hidden;
}
.step-dot span {
  display: block; height: 100%; width: 0;
  background: var(--grad);
  transition: width .45s var(--ease);
}
.step-dot.is-done span, .step-dot.is-active span { width: 100%; }

.flowhead { display: flex; align-items: flex-start; gap: 12px; }
.backbtn {
  width: 38px; height: 38px; flex: none;
  border-radius: 12px; border: 1px solid var(--line);
  display: grid; place-items: center;
  color: var(--text-2);
  transition: background .2s var(--ease), color .2s var(--ease);
}
.backbtn:hover { background: var(--surface-2); color: var(--text); }

/* ---------- bond result ---------- */
.result {
  border-radius: var(--r-xl);
  padding: 26px 22px 22px;
  border: 1px solid var(--line-strong);
  background:
    radial-gradient(130% 90% at 8% 0%, rgba(245,140,111,.15), transparent 60%),
    radial-gradient(120% 100% at 100% 100%, rgba(183,156,242,.15), transparent 60%),
    linear-gradient(180deg, var(--surface-2), var(--surface));
  box-shadow: var(--shadow-lg);
  animation: resultIn .42s var(--ease) both;
}
@keyframes resultIn {
  from { opacity: 0; transform: translateY(12px) scale(.985); }
  to   { opacity: 1; transform: none; }
}
.result__meta {
  display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px;
}
.pill {
  font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  padding: 5px 10px; border-radius: 999px;
  color: var(--text-2);
  background: rgba(255,255,255,.05);
  border: 1px solid var(--line);
}
.pill--accent {
  color: #2A1512;
  background: linear-gradient(135deg, var(--coral), var(--rose));
  border-color: transparent;
}
.result__text {
  font-size: 21px; line-height: 1.38; font-weight: 590; letter-spacing: -.018em;
}
.result__sub {
  margin-top: 14px;
  padding: 14px 16px;
  border-left: 2px solid var(--coral);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  background: rgba(255,255,255,.045);
  font-size: 15.5px; line-height: 1.5; color: var(--text-2);
}
.result__acts {
  display: grid; grid-template-columns: 1fr auto auto; gap: 8px;
  margin-top: 20px;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 15px;
  font-size: 15px; font-weight: 620; letter-spacing: -.008em;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  transition: transform .16s var(--ease), background .2s var(--ease),
              border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.btn:hover { background: var(--surface-3); border-color: var(--line-strong); }
.btn:active { transform: scale(.975); }
.btn--primary {
  background: var(--grad); color: #1B0E10; border-color: transparent;
  box-shadow: 0 10px 26px rgba(245,140,111,.2);
}
.btn--primary:hover { box-shadow: 0 14px 32px rgba(245,140,111,.28); background: var(--grad); }
.btn--icon { padding: 0 14px; }
.btn--wide { width: 100%; }
.btn--ghost { background: transparent; }
.btn.is-saved {
  color: var(--coral-soft);
  border-color: rgba(245,140,111,.4);
  background: rgba(245,140,111,.1);
}
.btn svg { width: 18px; height: 18px; }

.linkrow {
  display: flex; justify-content: center; gap: 18px; flex-wrap: wrap;
  margin-top: 4px;
}
.linkbtn {
  font-size: 13.5px; color: var(--muted); padding: 8px 4px;
  transition: color .2s var(--ease);
}
.linkbtn:hover { color: var(--text); }

/* ---------- conversations ---------- */
.deckhead {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 10px; flex-wrap: wrap;
}
.deckhead .sub { flex: 1 1 220px; }
.counter { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.qcard {
  min-height: 210px;
  display: flex; flex-direction: column; justify-content: center;
  border-radius: var(--r-xl);
  padding: 28px 24px;
  border: 1px solid var(--line-strong);
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(183,156,242,.15), transparent 62%),
    linear-gradient(180deg, var(--surface-2), var(--surface));
  box-shadow: var(--shadow-lg);
}
.qcard__text {
  font-size: 22px; line-height: 1.36; font-weight: 590; letter-spacing: -.02em;
}
.qcard.is-swapping { animation: swap .34s var(--ease) both; }
@keyframes swap {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
.segment {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  gap: 4px; padding: 4px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 15px;
}
.segment button {
  min-height: 40px; border-radius: 11px;
  font-size: 13.5px; font-weight: 580; color: var(--muted);
  transition: background .2s var(--ease), color .2s var(--ease);
}
.segment button.is-active { background: var(--surface-3); color: var(--text); }

/* ---------- saved ---------- */
.filters { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
.filters::-webkit-scrollbar { display: none; }
.filters--wrap { flex-wrap: wrap; overflow: visible; }
.chip {
  flex: none;
  padding: 9px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface);
  font-size: 13.5px; font-weight: 570; color: var(--muted);
  transition: all .2s var(--ease);
}
.chip.is-active { color: #2A1512; background: linear-gradient(135deg, var(--coral), var(--rose)); border-color: transparent; }

.saveditem {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 16px;
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: var(--surface);
}
.saveditem__body { flex: 1; min-width: 0; }
.saveditem__text { font-size: 15.5px; line-height: 1.45; }
.saveditem__sub { font-size: 14px; color: var(--text-2); margin-top: 6px; }
.saveditem__meta { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 6px; font-weight: 620; }
.iconbtn {
  width: 36px; height: 36px; flex: none; border-radius: 11px;
  display: grid; place-items: center; color: var(--muted);
  border: 1px solid transparent;
  transition: all .2s var(--ease);
}
.iconbtn:hover { color: var(--text); background: var(--surface-2); border-color: var(--line); }
.iconbtn svg { width: 17px; height: 17px; }

.empty {
  text-align: center; padding: 46px 20px;
  border: 1px dashed var(--line-strong); border-radius: var(--r-lg);
  color: var(--muted);
}
.empty__ico { font-size: 26px; margin-bottom: 10px; }
.empty p { font-size: 14.5px; max-width: 34ch; margin: 0 auto; }

/* ---------- about ---------- */
.alink { color: var(--coral-soft); border-bottom: 1px solid rgba(255,180,156,.35); }
.alink:hover { border-bottom-color: var(--coral-soft); }
.about__lead { font-size: 16.5px; line-height: 1.55; color: var(--text-2); }
.about h3 { font-size: 15px; font-weight: 640; margin-bottom: 8px; }
.about p + p { margin-top: 12px; }
.eco {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 12px;
}
.eco__item {
  padding: 12px 14px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--surface);
  font-size: 13.5px; font-weight: 560; color: var(--text-2);
}
.eco__item span { display: block; font-size: 11.5px; color: var(--muted); font-weight: 450; margin-top: 2px; }
.byline {
  text-align: center; color: var(--muted); font-size: 12.5px;
  letter-spacing: .04em; padding: 26px 0 6px;
}
.byline strong { color: var(--text-2); font-weight: 600; }

/* ---------- toast ---------- */
.toast {
  position: fixed;
  left: 50%; transform: translateX(-50%) translateY(20px);
  bottom: calc(var(--nav-h) + 20px + env(safe-area-inset-bottom));
  z-index: 60;
  padding: 11px 18px; border-radius: 999px;
  background: rgba(42, 32, 39, .96);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
  font-size: 14px; font-weight: 560;
  opacity: 0; pointer-events: none;
  transition: opacity .25s var(--ease), transform .25s var(--ease);
  backdrop-filter: blur(12px);
}
.toast.is-on { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- desktop ---------- */
@media (min-width: 900px) {
  :root { --pad: 32px; }
  .app {
    display: grid;
    grid-template-columns: 268px minmax(0, 1fr);
    min-height: 100vh;
  }
  .topbar { display: none; }
  .tabbar { display: none; }

  .sidebar {
    display: flex; flex-direction: column;
    position: sticky; top: 0; height: 100vh;
    padding: 26px 18px 20px;
    border-right: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(27,21,26,.7), rgba(16,12,16,.7));
    backdrop-filter: blur(10px);
  }
  .sidebar .brand { padding: 0 10px 4px; }
  .sidebar .brand__mark { width: 34px; height: 34px; border-radius: 11px; }
  .sidebar .brand__name { font-size: 17px; }
  .sidebar__tag {
    padding: 2px 10px 22px; font-size: 12.5px; color: var(--muted);
  }
  .navlist { display: flex; flex-direction: column; gap: 2px; }
  .navlist a {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 12px; border-radius: 13px;
    font-size: 14.5px; font-weight: 560; color: var(--text-2);
    transition: background .18s var(--ease), color .18s var(--ease);
  }
  .navlist a svg { width: 19px; height: 19px; color: var(--muted); transition: color .18s var(--ease); }
  .navlist a:hover { background: rgba(255,255,255,.045); color: var(--text); }
  .navlist a.is-active { background: rgba(255,255,255,.07); color: var(--text); }
  .navlist a.is-active svg { color: var(--coral); }

  .sidebar__foot { margin-top: auto; padding-top: 18px; border-top: 1px solid var(--line); }
  .sidebar__foot a {
    display: block; padding: 8px 12px; font-size: 13.5px; color: var(--muted);
    border-radius: 10px;
  }
  .sidebar__foot a:hover { color: var(--text); background: rgba(255,255,255,.04); }
  .sidebar__cred {
    padding: 12px 12px 0; font-size: 10.5px; letter-spacing: .14em;
    text-transform: uppercase; color: rgba(156,143,149,.7);
  }

  .main { padding: 42px var(--pad) 72px; max-width: 780px; }
  .h-hero { font-size: 32px; }
  .h-page { font-size: 28px; }
  .options { grid-template-columns: repeat(3, 1fr); }
  .options--single { grid-template-columns: repeat(2, 1fr); }
  .option { min-height: 74px; }
  .tiles { grid-template-columns: repeat(3, 1fr); }
  .result__text { font-size: 24px; }
  .result__acts { grid-template-columns: max-content max-content max-content; justify-content: start; }
  .result { padding: 30px 28px 26px; }
  .qcard { padding: 34px 30px; }
  .qcard__text { font-size: 25px; }
  .qcard { min-height: 250px; }
  .toast { bottom: 32px; }
  .eco { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1240px) {
  .main { max-width: 860px; }
}

/* ---------- motion preference ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
