/* card doctor. one input, one verdict, a list of war stories. nothing else. */

@font-face {
  font-family: 'Space Grotesk';
  src: url('fonts/space-grotesk-vf.woff2') format('woff2-variations');
  font-weight: 300 700;
  font-display: swap;
}

:root {
  --bg: #0a0a0b;
  --ink: #f4f4f0;
  --dim: #82828c;
  --card: #131316;
  --line: #232329;
  --line-soft: #1a1a1f;
  --lime: #c8f542;
  --lime-hi: #d9ff5c;
  --on-lime: #131600;
  --danger: #ff6b6b;
  --warn: #ffb224;

  --display: 'Space Grotesk', -apple-system, 'Segoe UI', sans-serif;
  --mono: ui-monospace, 'Cascadia Code', 'SF Mono', Consolas, monospace;

  --r: 14px;
  --r-sm: 8px;
  --pad: clamp(20px, 5vw, 56px);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; margin: 0; }
[hidden] { display: none !important; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--display);
  font-weight: 400;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--lime); color: var(--on-lime); }
:focus-visible { outline: 2px solid var(--lime); outline-offset: 3px; border-radius: 4px; }

/* ---------- top ---------- */
.top {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px var(--pad);
}
.brand {
  display: inline-flex; align-items: center; gap: 9px;
  font-weight: 700; font-size: 15px; letter-spacing: -0.01em;
  color: var(--ink); text-decoration: none;
}
.brand em { color: var(--lime); font-style: normal; }
.mark { width: 22px; height: 22px; flex: none; color: var(--ink); }
.mark .mark-lime { color: var(--lime); }
.brand:hover .mark { color: var(--lime); }

/* ---------- buttons ---------- */
.btn {
  font-family: var(--display); font-weight: 600; font-size: 15px;
  padding: 12px 24px; border-radius: var(--r-sm);
  border: 1px solid transparent; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: background .15s var(--ease), border-color .15s var(--ease),
              color .15s var(--ease), transform .12s var(--ease);
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-lime { background: var(--lime); color: var(--on-lime); }
.btn-lime:hover { background: var(--lime-hi); }
.btn-big { padding: 15px 34px; font-size: 16.5px; }

/* ---------- hero ---------- */
.hero {
  padding: clamp(48px, 11vh, 110px) var(--pad) clamp(40px, 7vh, 64px);
  text-align: center;
}
.hero h1 {
  font-size: clamp(2.2rem, 5.6vw, 4.2rem);
  font-weight: 700; line-height: 1.05; letter-spacing: -0.035em;
  text-wrap: balance;
}
.hero h1 em { color: var(--lime); font-style: normal; }
.deal {
  margin: 18px auto 0; max-width: 52ch;
  color: var(--dim); font-size: clamp(1rem, 1.35vw, 1.1rem);
  line-height: 1.5;
}
/* inline-block sentences break between each other, never mid-sentence */
.deal span { display: inline-block; }

.check-row {
  margin: clamp(28px, 4vh, 44px) auto 0;
  width: 100%; max-width: 640px;
  display: flex; gap: 8px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r); padding: 8px 8px 8px 16px;
  transition: border-color .15s var(--ease);
}
.check-row:focus-within { border-color: var(--lime); }
.check-row input {
  flex: 1; min-width: 0; background: none; border: none; color: var(--ink);
  font-family: var(--mono); font-size: 16px; padding: 8px 0;
}
.check-row input:focus { outline: none; }
.check-row input::placeholder { color: #55555e; }

.chip {
  margin-top: 14px;
  background: none; border: 1px solid var(--line); border-radius: 99px;
  color: var(--dim); font-family: var(--mono); font-size: 12.5px;
  padding: 6px 14px; cursor: pointer;
  transition: all .15s var(--ease);
}
.chip:hover { border-color: var(--lime); color: var(--lime); }

/* ---------- results ---------- */
.results { padding: 0 var(--pad) clamp(64px, 12vh, 120px); max-width: 760px; margin: 0 auto; }
.section-label {
  font-family: var(--mono); font-size: 12px; color: var(--dim);
  letter-spacing: .04em; margin-bottom: 10px;
}

/* verdict banner */
.verdict {
  border-radius: var(--r); padding: 18px 22px;
  border: 1px solid var(--line);
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
  margin-bottom: 28px;
}
.verdict .v-word { font-weight: 700; font-size: 22px; letter-spacing: -0.02em; }
.verdict .v-sub { color: var(--dim); font-size: 14.5px; }
.verdict.healthy { border-color: color-mix(in srgb, var(--lime) 45%, var(--line)); background: color-mix(in srgb, var(--lime) 7%, var(--card)); }
.verdict.healthy .v-word { color: var(--lime); }
.verdict.issues { border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); background: color-mix(in srgb, var(--warn) 6%, var(--card)); }
.verdict.issues .v-word { color: var(--warn); }
.verdict.broken { border-color: color-mix(in srgb, var(--danger) 50%, var(--line)); background: color-mix(in srgb, var(--danger) 7%, var(--card)); }
.verdict.broken .v-word { color: var(--danger); }

/* the X card preview, summary_large_image geometry: big image on top,
   title/description/domain below, one rounded bordered unit. */
.preview-wrap { margin-bottom: 32px; }
.xcard {
  border: 1px solid var(--line); border-radius: 16px; overflow: hidden;
  background: var(--card);
}
.xcard-img {
  aspect-ratio: 1.91 / 1;
  background: linear-gradient(135deg, #191920, #121216);
  border-bottom: 1px solid var(--line-soft);
  display: flex; align-items: center; justify-content: center;
}
.xcard-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.xcard-img .img-broken {
  font-family: var(--mono); font-size: 12.5px; color: var(--danger);
  text-align: center; padding: 20px; line-height: 1.6;
}
.xcard-img .img-broken small { display: block; color: var(--dim); margin-top: 6px; }
.xcard-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 3px; }
.xcard-title {
  font-weight: 700; font-size: 15.5px; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.xcard-desc {
  color: var(--dim); font-size: 14px; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.xcard-domain { font-family: var(--mono); font-size: 12px; color: #6b6b75; margin-top: 4px; }
.checked-url {
  font-family: var(--mono); font-size: 12px; color: #6b6b75;
  margin-top: 10px; overflow-wrap: anywhere;
}

/* ---------- checks ---------- */
.checks { display: flex; flex-direction: column; gap: 26px; }
.check-group-label {
  font-family: var(--mono); font-size: 12px; letter-spacing: .04em;
  margin-bottom: 10px;
}
.check-group-label.fail { color: var(--danger); }
.check-group-label.warn { color: var(--warn); }
.check-group-label.pass { color: var(--dim); }
.check-list {
  display: flex; flex-direction: column;
  border: 1px solid var(--line-soft); border-radius: var(--r); overflow: hidden;
}
.check {
  display: flex; gap: 12px; padding: 13px 16px;
  background: var(--card);
  border-bottom: 1px solid var(--line-soft);
}
.check:last-child { border-bottom: none; }
.dot {
  flex: none; width: 9px; height: 9px; border-radius: 50%; margin-top: 7px;
}
.dot.fail { background: var(--danger); }
.dot.warn { background: var(--warn); }
.dot.pass { background: color-mix(in srgb, var(--lime) 65%, var(--bg)); }
.check-main { min-width: 0; flex: 1; }
.check-title { font-weight: 600; font-size: 14.5px; }
.check-detail {
  color: var(--dim); font-size: 13.5px; line-height: 1.5;
  margin-top: 2px; overflow-wrap: anywhere;
}
.check-fix {
  font-family: var(--mono); font-size: 12px; color: var(--lime);
  margin-top: 6px; overflow-wrap: anywhere;
}
.check-fix::before { content: 'fix → '; opacity: .65; }

/* ---------- nuclear option ---------- */
.nuclear {
  margin-top: 34px;
  border: 1px dashed color-mix(in srgb, var(--lime) 45%, var(--line));
  border-radius: var(--r); padding: 18px 22px;
  color: var(--dim); font-size: 14.5px; line-height: 1.6;
  background: color-mix(in srgb, var(--lime) 4%, var(--card));
}
.nuclear-title {
  color: var(--lime); font-weight: 700; font-size: 15px;
  letter-spacing: -0.01em; margin-bottom: 6px;
}
.mono { font-family: var(--mono); font-size: .92em; color: var(--ink); }

/* ---------- loading ---------- */
.loading { padding-top: 8px; }
.skel-banner {
  height: 74px; border-radius: var(--r); background: #15151a;
  animation: pulse 1.4s ease-in-out infinite; margin-bottom: 28px;
}
.skel-card {
  height: 300px; border-radius: 16px; background: #15151a;
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: .45; } 50% { opacity: .9; } }
.stage {
  font-family: var(--mono); font-size: 13px; color: var(--dim);
  text-align: center; margin-top: 22px;
}
.stage::after {
  content: ''; animation: dots 1.2s steps(4) infinite;
}
@keyframes dots { 0% { content: ''; } 25% { content: '.'; } 50% { content: '..'; } 75% { content: '...'; } }

/* ---------- toast ---------- */
.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  z-index: 50; background: var(--card); color: var(--ink);
  border: 1px solid var(--line); border-left: 3px solid var(--lime);
  border-radius: var(--r-sm); padding: 12px 18px;
  font-family: var(--mono); font-size: 13px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .5);
  animation: toast-in .25s var(--ease);
  max-width: min(440px, calc(100vw - 32px));
}
.toast.err { border-left-color: var(--danger); }
@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* reveal */
.reveal { opacity: 0; transform: translateY(14px); }
.reveal.in {
  opacity: 1; transform: none;
  transition: opacity .5s var(--ease), transform .5s var(--ease);
}

/* ---------- phones ---------- */
@media (max-width: 640px) {
  .top { padding: 12px var(--pad); }
  .hero { padding: 26px var(--pad) 30px; }
  .hero h1 { font-size: clamp(2rem, 8.4vw, 2.5rem); }
  .deal { margin-top: 14px; font-size: 1rem; }

  /* an input and a button side by side at 375px leaves neither usable */
  .check-row { flex-direction: column; padding: 12px; gap: 10px; }
  .check-row .btn { width: 100%; min-height: 46px; }

  .toast { left: 16px; right: 16px; transform: none; max-width: none; }
  @keyframes toast-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
  }
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
