/* ===========================================================================
   SmugSearch homepage.
   Visual brief: hyper-clean, expensive, weightless. Near-white ground, one
   restrained violet accent, thin hairline rules, generous air. The comedy is
   entirely in the copy - the design plays it completely straight.
   =========================================================================== */

:root {
  --ink:        #16151a;
  --ink-soft:   #5c5a66;
  --ink-faint:  #9b98a6;
  --paper:      #fbfbfd;
  --card:       #ffffff;
  --line:       #e8e7ee;
  --accent:     #6d4aff;
  --accent-dim: #efeaff;
  --up:         #12a56c;
  --down:       #e2483d;
  --radius:     14px;
  --shadow:     0 1px 2px rgba(22,21,26,.04), 0 12px 32px -12px rgba(22,21,26,.10);
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  /* Barely-there grid, the kind every enterprise landing page has. */
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  background-position: -1px -1px;
  -webkit-font-smoothing: antialiased;
}

/* Vignette so the grid fades out toward the middle of the page. */
body::before {
  content: "";
  position: fixed; inset: 0;
  background: radial-gradient(ellipse 70% 60% at 50% 45%, var(--paper) 35%, transparent 100%);
  pointer-events: none;
  z-index: 0;
}

/* ── Centre stage ─────────────────────────────────────────────────────────── */

.stage {
  position: relative;
  z-index: 2;
  max-width: 680px;
  margin: 0 auto;
  padding: 21vh 24px 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.brand { text-align: center; margin-bottom: 34px; }

.wordmark {
  margin: 0;
  font-size: clamp(38px, 6vw, 58px);
  font-weight: 300;
  letter-spacing: -.035em;
  line-height: 1;
}
.wordmark span { font-weight: 600; color: var(--accent); }
.wordmark sup {
  font-size: .24em;
  font-weight: 500;
  color: var(--ink-faint);
  top: -1.6em;
  margin-left: .2em;
}

.tagline {
  margin: 12px 0 0;
  font-size: 14px;
  color: var(--ink-soft);
  letter-spacing: .01em;
}

/* ── Search bar ───────────────────────────────────────────────────────────── */

.searchbar {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 7px 7px 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow);
  transition: box-shadow .25s ease, border-color .25s ease, transform .25s ease;
}
.searchbar:focus-within {
  border-color: #cfc3ff;
  box-shadow: 0 0 0 4px var(--accent-dim), 0 16px 40px -16px rgba(109,74,255,.4);
}

.glass {
  width: 19px; height: 19px; flex: none;
  fill: none; stroke: var(--ink-faint); stroke-width: 1.8; stroke-linecap: round;
}

#q {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  padding: 12px 0;
}
#q::placeholder { color: var(--ink-faint); }

#go {
  flex: none;
  border: 0;
  border-radius: 999px;
  padding: 12px 22px;
  background: var(--ink);
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background .2s ease, transform .1s ease;
}
#go:hover { background: var(--accent); }
#go:active { transform: scale(.97); }
#go[disabled] { opacity: .55; cursor: progress; }

.assurance {
  margin: 18px 0 0;
  font-size: 12px;
  color: var(--ink-faint);
  display: flex; align-items: center; gap: 8px;
}
.assurance strong { color: var(--ink-soft); font-variant-numeric: tabular-nums; font-weight: 500; }
.dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--up);
  box-shadow: 0 0 0 3px rgba(18,165,108,.16);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: .35; } }

/* ── Answer surface ───────────────────────────────────────────────────────── */

.answer {
  width: 100%;
  margin-top: 34px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: rise .45s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

.answer-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 13px 20px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fdfcff, #fff);
}
.badge {
  font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 5px 10px; border-radius: 6px;
}
.confidence { font-size: 11px; color: var(--ink-faint); white-space: nowrap; }
.confidence strong { color: var(--up); font-weight: 600; }

.answer-body {
  padding: 22px 24px;
  font-size: 15.5px;
  line-height: 1.72;
  color: #2b2933;
}
.answer-body p { margin: 0 0 1em; }
.answer-body p:last-child { margin-bottom: 0; }

/* Typewriter caret while the answer streams in. */
.answer-body.typing p:last-child::after {
  content: "";
  display: inline-block;
  width: 2px; height: 1.05em;
  vertical-align: -.18em;
  margin-left: 2px;
  background: var(--accent);
  animation: caret .9s steps(1) infinite;
}
@keyframes caret { 50% { opacity: 0; } }

.answer-foot {
  padding: 12px 24px;
  border-top: 1px solid var(--line);
  font-size: 11.5px;
  color: var(--ink-faint);
  display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center;
}
.answer-foot a { color: var(--ink-soft); text-decoration: none; border-bottom: 1px solid var(--line); }
.answer-foot a:hover { color: var(--accent); border-color: currentColor; }

/* Thinking skeleton */
.skeleton span {
  display: block; height: 11px; margin-bottom: 12px; border-radius: 5px;
  background: linear-gradient(90deg, #f1f0f6 25%, #e6e4f0 37%, #f1f0f6 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s ease infinite;
}
.skeleton span:nth-child(2) { width: 92%; }
.skeleton span:nth-child(3) { width: 78%; }
.skeleton span:last-child { margin-bottom: 0; width: 46%; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }

/* ── Live Counter Grid ────────────────────────────────────────────────────── */

.counters { position: fixed; inset: 0; z-index: 1; pointer-events: none; }

.counter {
  position: absolute;
  width: 212px;
  padding: 13px 15px;
  background: rgba(255,255,255,.72);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: 12px;
  animation: fade-in .8s ease both;
}
.counter:nth-child(1) { top: 24px; left: 24px; animation-delay: .05s; }
.counter:nth-child(2) { top: 24px; right: 24px; animation-delay: .15s; }
/* Sits above the doxxing module rather than underneath it. */
.counter:nth-child(3) { bottom: 312px; left: 24px; animation-delay: .25s; }
.counter:nth-child(4) { bottom: 100px; right: 24px; animation-delay: .35s; }
@keyframes fade-in { from { opacity: 0; transform: translateY(6px); } }

.counter .label {
  font-size: 9.5px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase;
  color: var(--ink-faint);
}
.counter .value {
  font-family: var(--mono);
  font-size: 21px;
  font-weight: 500;
  letter-spacing: -.02em;
  margin: 5px 0 3px;
  font-variant-numeric: tabular-nums;
  display: flex; align-items: baseline; gap: 2px;
}
/* Each digit is its own cell so it can flip independently. */
.counter .value .digit {
  display: inline-block;
  transition: transform .18s ease, color .18s ease;
}
.counter .value .digit.roll { animation: roll .28s cubic-bezier(.3,1.4,.5,1); color: var(--accent); }
@keyframes roll {
  0%   { transform: translateY(-.42em); opacity: .25; }
  100% { transform: translateY(0); opacity: 1; }
}
.counter .sub { font-size: 10.5px; line-height: 1.42; color: var(--ink-soft); }

/* ── Trending panel ───────────────────────────────────────────────────────── */

.panel {
  position: fixed;
  top: 50%; right: 24px;
  transform: translateY(-50%);
  z-index: 2;
  width: 250px;
  max-height: 62vh;
  overflow: auto;
  padding: 16px;
  background: rgba(255,255,255,.82);
  backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  scrollbar-width: thin;
}
.panel-head {
  font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-faint);
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 10px; border-bottom: 1px solid var(--line);
}
.live { color: var(--down); font-weight: 700; animation: pulse 1.6s ease-in-out infinite; }

.widget { padding: 14px 0; border-bottom: 1px solid var(--line); }
.widget:last-child { border-bottom: 0; padding-bottom: 0; }
.widget h2 {
  margin: 0 0 9px;
  font-size: 10px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-faint);
}

.tickers { list-style: none; margin: 0; padding: 0; }
.tickers li {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  padding: 5px 0;
  font-size: 12px;
}
.tickers .sym { font-weight: 600; letter-spacing: .02em; }
.tickers .px { font-family: var(--mono); font-size: 11.5px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.tickers .chg { font-family: var(--mono); font-size: 11px; font-weight: 600; min-width: 58px; text-align: right; }
.chg.up { color: var(--up); } .chg.down { color: var(--down); }
.tickers li.flash { animation: flash .6s ease; }
@keyframes flash { from { background: var(--accent-dim); } }

.weather { display: flex; align-items: center; gap: 12px; }
.wx-icon { font-size: 30px; line-height: 1; animation: bob 3.4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-4px) rotate(-6deg); } }
.wx-main { font-size: 13px; font-weight: 600; }
.wx-sub { font-size: 11px; color: var(--ink-soft); line-height: 1.4; margin-top: 2px; }

.trend-list { list-style: none; margin: 0; padding: 0; counter-reset: t; }
.trend-list li {
  counter-increment: t;
  font-size: 11.5px; line-height: 1.45;
  padding: 5px 0 5px 20px;
  position: relative;
  color: var(--ink-soft);
  animation: fade-in .5s ease both;
}
.trend-list li::before {
  content: counter(t);
  position: absolute; left: 0; top: 5px;
  font-family: var(--mono); font-size: 10px; color: var(--ink-faint);
}

/* ── Doxxing module ───────────────────────────────────────────────────────── */

.dox {
  position: fixed;
  left: 24px; bottom: 24px;
  z-index: 2;
  width: 268px;
  background: rgba(255,255,255,.86);
  backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: fade-in .8s .45s ease both;
}
.dox-head {
  display: flex; align-items: center; gap: 7px;
  padding: 11px 14px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--line);
}
.eye { font-size: 13px; filter: grayscale(1); }
.dox-toggle {
  margin-left: auto;
  border: 0; background: none; cursor: pointer;
  color: var(--ink-faint); font-size: 15px; line-height: 1; padding: 0 2px;
}
.dox-body {
  margin: 0; padding: 10px 14px;
  display: grid; grid-template-columns: auto 1fr; gap: 5px 12px;
  font-size: 11px;
  max-height: 232px; overflow: auto;
  transition: max-height .3s ease, padding .3s ease, opacity .2s ease;
}
.dox.collapsed .dox-body,
.dox.collapsed .dox-foot { max-height: 0; padding-top: 0; padding-bottom: 0; opacity: 0; overflow: hidden; }
.dox-body dt { color: var(--ink-faint); white-space: nowrap; }
.dox-body dd {
  margin: 0; font-family: var(--mono); font-size: 10.5px; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dox-foot {
  margin: 0; padding: 9px 14px;
  border-top: 1px solid var(--line);
  font-size: 10px; color: var(--ink-faint);
  transition: max-height .3s ease, padding .3s ease, opacity .2s ease;
}
.dox-foot em { color: var(--accent); font-style: italic; }

/* ── SmugAI link ──────────────────────────────────────────────────────────── */

.ai-link {
  position: fixed; right: 24px; bottom: 24px; z-index: 3;
  padding: 10px 16px;
  font-size: 12px; font-weight: 500;
  color: var(--ink); text-decoration: none;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow);
  transition: transform .2s ease, color .2s ease, border-color .2s ease;
}
.ai-link:hover { transform: translateX(3px); color: var(--accent); border-color: #cfc3ff; }

/* ── Responsive: below 1180px the furniture stops being fixed and stacks ──── */

@media (max-width: 1180px) {
  .counters { position: static; display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
              gap: 10px; padding: 16px 16px 0; }
  .counter { position: static; width: auto; }
  .panel, .dox { position: static; width: auto; max-width: 680px; margin: 16px auto 0; transform: none; max-height: none; }
  .stage { padding-top: 8vh; padding-bottom: 24px; }
  .ai-link { position: static; display: block; width: max-content; margin: 20px auto 40px; }
  body { background-attachment: local; }
}

@media (max-width: 520px) {
  .searchbar { flex-wrap: wrap; border-radius: var(--radius); padding: 12px; }
  #q { flex-basis: 100%; padding: 4px 0 10px; }
  #go { width: 100%; }
  .glass { display: none; }
}

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