/* shadcn/ui — clinical blueprint on frosted paper
   Achromatic by default: color is absence, not expression. The only chromatic
   hue is Ember red, reserved for destructive/error. Radius defines hierarchy —
   18px interactive, 24px containers, never anything in between. Elevation is
   whisper-quiet: a stacked 1px hairline plus faint 1px/2px offsets.          */

:root {
  --canvas: #f5f5f5;
  --paper: #ffffff;
  --surface-alt: #fafafa;
  --ink: #0a0a0a;
  --ink-soft: #171717;
  --mid-gray: #737373;
  --hairline: #e5e5e5;
  --ember: #e7000b;

  --font: "Geist", "Inter", ui-sans-serif, system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* radius: 18 interactive, 24 container, 10 nested, 6 small */
  --r-small: 6px;
  --r-nested: 10px;
  --r-pill: 18px;
  --r-card: 24px;

  --shadow-card: 0 0 0 1px rgba(23, 23, 23, 0.05), 0 1px 3px rgba(0, 0, 0, 0.1),
    0 1px 2px -1px rgba(0, 0, 0, 0.1);

  --page: 1280px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.43;
  letter-spacing: 0;
  font-feature-settings: "ss01" on, "cv11" on;
}

.wrap { max-width: var(--page); margin: 0 auto; padding: 0 24px; }

/* 12px uppercase caption, 0.6px tracking */
.caption {
  font-size: 12px;
  line-height: 1.33;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--mid-gray);
  font-weight: 400;
}

/* ---------- breadcrumb bar ---------- */
header {
  position: sticky; top: 0; z-index: 40;
  background: var(--surface-alt);
  border-bottom: 1px solid var(--hairline);
}
.nav { height: 56px; display: flex; align-items: center; gap: 16px; }
.crumbs {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; color: var(--mid-gray); white-space: nowrap;
}
.crumbs .sep { color: #a3a3a3; }
.crumbs .cur { color: var(--ink); }
.spacer { flex: 1; }
.mark {
  width: 22px; height: 22px; border-radius: var(--r-small); flex: none;
  background: var(--ink); display: flex; align-items: center;
  justify-content: center; gap: 2px;
}
/* single ember detail: the only chromatic mark in the system */
.mark::after {
  content: ""; width: 3px; height: 9px; border-radius: 1px; background: var(--ember);
}

/* ---------- buttons ---------- */
button {
  font-family: var(--font); font-size: 14px; font-weight: 500;
  letter-spacing: 0; cursor: pointer;
  border-radius: var(--r-pill); border: none;
  background: var(--canvas); color: var(--ink);
  height: 36px; padding: 0 12px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  white-space: nowrap;
  transition: background-color .2s ease, color .2s ease, box-shadow .2s ease;
}
button:hover { background: #ebebeb; }
button:focus-visible { outline: none; box-shadow: 0 0 0 1px var(--hairline); }
button.primary { background: var(--ink); color: var(--surface-alt); }
button.primary:hover { background: var(--ink-soft); }
button.primary:disabled { background: var(--ink); opacity: .6; cursor: default; }
button.outline {
  background: transparent; color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--hairline);
}
button.outline:hover { background: var(--surface-alt); }
button.big { height: 40px; padding: 0 16px; }

/* ---------- hero ---------- */
.hero { padding: 56px 0 40px; }
h1 {
  font-size: 48px; line-height: 1.1; letter-spacing: -2.4px;
  font-weight: 600; margin: 0 0 16px; max-width: 820px; color: var(--ink);
}
.lede {
  font-size: 16px; line-height: 1.5; color: var(--mid-gray);
  max-width: 620px; margin: 0 0 32px;
}
.lede b { color: var(--ink); font-weight: 500; font-variant-numeric: tabular-nums; }

/* stat block: typographic scale alone, no card chrome */
.stats { display: flex; gap: 48px; margin: 0 0 36px; flex-wrap: wrap; }
.stat .val {
  font-size: 36px; line-height: 1.11; letter-spacing: -0.9px;
  font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums;
}

/* ---------- command / search trigger ---------- */
.cmd {
  background: var(--paper);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  max-width: 880px;
  overflow: hidden;
}
.cmd-row {
  display: flex; align-items: flex-end; gap: 10px;
  padding: 16px 16px 16px 20px;
}
textarea#idea {
  flex: 1; background: transparent; border: 0; resize: none;
  font-family: var(--font); font-size: 15px; font-weight: 400; line-height: 1.5;
  color: var(--ink); padding: 0; min-height: 44px; letter-spacing: 0;
}
textarea#idea::placeholder { color: var(--mid-gray); }
textarea#idea:focus { outline: none; }
/* resting input fill matches canvas; focus replaces fill with a 1px ring */
.cmd-foot {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; border-top: 1px solid var(--hairline);
  background: var(--surface-alt);
  border-radius: 0 0 var(--r-card) var(--r-card);
}
kbd {
  font-family: var(--font); font-size: 11px; color: var(--mid-gray);
  border: 1px solid var(--hairline); border-radius: var(--r-small);
  padding: 1px 5px; background: var(--paper); line-height: 1.6;
}

.examples { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 16px; }

/* ---------- result ---------- */
.result { margin-top: 48px; }
.hidden { display: none; }

@keyframes rise { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.result > * { animation: rise .28s ease both; }

.card {
  background: var(--paper);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--hairline);
}
.verdict { padding: 20px; }

.v-head {
  display: flex; gap: 32px; align-items: flex-start;
  padding-bottom: 20px; border-bottom: 1px solid var(--hairline);
}
.score-col { flex: none; width: 132px; }
.score-num {
  font-size: 48px; line-height: 1.1; letter-spacing: -2.4px;
  font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums;
}
.score-den { font-size: 16px; font-weight: 400; color: var(--mid-gray); letter-spacing: 0; margin-left: 2px; }
.score-track {
  height: 4px; background: var(--hairline); border-radius: var(--r-pill);
  margin-top: 10px; overflow: hidden;
}
.score-fill { height: 100%; border-radius: var(--r-pill); background: var(--ink); transition: width .4s ease; }

.v-body { flex: 1; min-width: 0; }
.chip {
  display: inline-flex; align-items: center;
  font-size: 12px; font-weight: 500; line-height: 1.33; letter-spacing: 0;
  padding: 2px 8px; border-radius: var(--r-pill);
  background: var(--ink-soft); color: var(--surface-alt);
}
.chip.adjacent { background: var(--canvas); color: var(--ink-soft); }
.chip.openv { background: var(--ink); color: var(--surface-alt); }
.chip.built, .chip.crowded, .chip.similar { background: var(--ink-soft); color: var(--surface-alt); }

.v-title {
  font-size: 24px; line-height: 1.33; letter-spacing: -0.6px;
  font-weight: 600; margin: 10px 0 6px; color: var(--ink);
}
.v-meta { font-size: 14px; color: var(--mid-gray); margin: 0; font-variant-numeric: tabular-nums; }

.conf { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.conf-track {
  width: 96px; height: 4px; background: var(--hairline);
  border-radius: var(--r-pill); flex: none; overflow: hidden;
}
.conf-fill { display: block; height: 100%; border-radius: var(--r-pill); background: var(--ink-soft); transition: width .4s ease; }
.conf.low .conf-fill { background: var(--mid-gray); }
.conf-txt { font-size: 13px; color: var(--mid-gray); }

.reasons { margin: 0; padding: 18px 0 0; list-style: none; }
.reasons li {
  display: flex; gap: 10px; padding: 5px 0;
  font-size: 14px; line-height: 1.43; color: var(--ink-soft);
}
.reasons li svg { flex: none; margin-top: 3px; color: var(--mid-gray); }

/* ---------- section heading ---------- */
.sec-h { display: flex; align-items: baseline; gap: 12px; margin: 48px 0 16px; }
.sec-h h2 { font-size: 24px; line-height: 1.33; letter-spacing: -0.6px; font-weight: 600; margin: 0; }
.sec-h .rule { flex: 1; height: 1px; background: var(--hairline); }

/* ---------- project cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; }
.p-card {
  background: var(--paper); border-radius: var(--r-card);
  border: 1px solid var(--hairline); box-shadow: var(--shadow-card);
  padding: 20px; display: flex; gap: 12px;
  transition: box-shadow .2s ease;
}
.p-card:hover { box-shadow: 0 0 0 1px rgba(23,23,23,.10), 0 2px 6px rgba(0,0,0,.1), 0 1px 2px -1px rgba(0,0,0,.1); }
.p-card img, .p-card .ph {
  width: 32px; height: 32px; border-radius: var(--r-nested); flex: none;
  object-fit: cover; background: var(--canvas); border: 1px solid var(--hairline);
}
.p-card .ph {
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: var(--mid-gray); text-transform: uppercase;
}
.p-body { min-width: 0; flex: 1; }
.p-name { font-size: 15px; line-height: 1.4; font-weight: 500; letter-spacing: -0.1px; }
.p-name a { color: var(--ink); text-decoration: none; }
.p-name a:hover { text-decoration: underline; text-underline-offset: 2px; }
.p-tag {
  font-size: 13px; color: var(--mid-gray); margin-top: 4px; line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.p-meta {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  margin-top: 10px; font-size: 12px; color: var(--mid-gray);
  font-variant-numeric: tabular-nums;
}
.p-meta .sim {
  background: var(--canvas); color: var(--ink-soft); font-weight: 500;
  border-radius: var(--r-pill); padding: 2px 8px; font-size: 12px;
}
.p-meta .won {
  background: var(--ink-soft); color: var(--surface-alt);
  border-radius: var(--r-pill); padding: 2px 8px; font-size: 12px; font-weight: 500;
}
.matched {
  margin-top: 8px; font-size: 11px; color: var(--mid-gray);
  display: flex; gap: 4px; flex-wrap: wrap; align-items: center;
}
.matched code {
  font-family: var(--font); font-size: 11px; color: var(--ink-soft);
  background: var(--canvas); padding: 2px 7px; border-radius: var(--r-pill);
}
.prizes-line { font-size: 12px; color: var(--mid-gray); margin-top: 8px; }

/* ---------- inverted-ish band: uses sidebar tone, not a dark block ---------- */
.band {
  background: var(--surface-alt);
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  margin-top: 64px; padding: 48px 0;
}
.band h2 {
  font-size: 30px; line-height: 1.2; letter-spacing: -0.75px;
  font-weight: 600; margin: 0 0 8px;
}
.band .sub { font-size: 14px; line-height: 1.5; color: var(--mid-gray); max-width: 700px; margin: 0 0 24px; }
.band .sub b { color: var(--ink); font-weight: 500; }

.themegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(272px, 1fr)); gap: 12px; }
.theme-row {
  background: var(--paper); border: 1px solid var(--hairline);
  border-radius: var(--r-card); box-shadow: var(--shadow-card);
  padding: 16px 20px;
}
.theme-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.theme-top span:first-child { font-size: 14px; font-weight: 500; color: var(--ink); }
.theme-lift { font-size: 14px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.theme-lift.sig {
  background: var(--ink-soft); color: var(--surface-alt);
  padding: 2px 8px; border-radius: var(--r-pill); font-weight: 500; font-size: 12px;
}
.theme-bar { position: relative; height: 4px; background: var(--hairline); border-radius: var(--r-pill); margin: 12px 0 10px; }
.theme-bar i { position: absolute; top: 0; height: 100%; background: var(--ink-soft); border-radius: var(--r-pill); }
.theme-bar b { position: absolute; top: -3px; width: 1px; height: 10px; background: var(--mid-gray); }
.theme-meta { font-size: 12px; color: var(--mid-gray); font-variant-numeric: tabular-nums; }
.band-note {
  font-size: 13px; line-height: 1.5; color: var(--mid-gray);
  margin-top: 20px; max-width: 760px;
  background: var(--paper); border: 1px solid var(--hairline);
  border-radius: var(--r-pill); padding: 10px 16px;
}
.band-note b { color: var(--ink); font-weight: 500; }

/* ---------- browse ---------- */
.browse { margin-top: 64px; }
.browse-head {
  display: flex; justify-content: space-between; gap: 16px;
  align-items: flex-end; flex-wrap: wrap; margin-bottom: 16px;
}
.browse-head h2 { margin: 0; font-size: 30px; line-height: 1.2; letter-spacing: -0.75px; font-weight: 600; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
input[type="search"], select {
  font-family: var(--font); font-weight: 400; font-size: 14px;
  background: var(--paper); color: var(--ink); border: 1px solid var(--hairline);
  border-radius: var(--r-pill); padding: 0 14px; height: 36px;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
  transition: box-shadow .2s ease, border-color .2s ease;
}
input[type="search"] { width: 220px; }
input[type="search"]::placeholder { color: var(--mid-gray); }
input[type="search"]:focus, select:focus {
  outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(23,23,23,.06);
}
select { cursor: pointer; padding-right: 12px; }
.chk {
  display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink);
  height: 36px; padding: 0 14px; cursor: pointer;
  background: var(--paper); border-radius: var(--r-pill);
  border: 1px solid var(--hairline); box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.chk:hover { border-color: #d4d4d4; }
.chk input { accent-color: var(--ink); margin: 0; width: 15px; height: 15px; }

.pager {
  display: flex; gap: 12px; justify-content: center; align-items: center;
  margin-top: 28px; font-size: 13px; color: var(--mid-gray);
  font-variant-numeric: tabular-nums;
}

footer {
  background: var(--surface-alt); border-top: 1px solid var(--hairline);
  margin-top: 64px; padding: 28px 24px 36px;
  font-size: 13px; line-height: 1.5; color: var(--mid-gray);
}
footer .fwrap { max-width: var(--page); margin: 0 auto; display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
footer b { color: var(--ink); font-weight: 500; }

::selection { background: var(--hairline); color: var(--ink); }

@media (max-width: 900px) {
  h1 { font-size: 36px; line-height: 1.11; letter-spacing: -0.9px; }
  .lede { font-size: 15px; }
  .stats { gap: 32px; }
}

@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  h1 { font-size: 30px; letter-spacing: -0.75px; }
  .hero { padding: 36px 0 28px; }
  .stat .val { font-size: 30px; letter-spacing: -0.75px; }
  .stats { gap: 24px; margin-bottom: 28px; }
  .nav { gap: 10px; }
  .nav button.primary { height: 32px; padding: 0 10px; font-size: 13px; }
  .crumbs { font-size: 13px; min-width: 0; overflow: hidden; }
  .crumbs .cur { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .crumbs .hide-sm { display: none; }
  .cmd-row { flex-direction: column; align-items: stretch; padding: 12px; gap: 10px; }
  textarea#idea { min-height: 52px; font-size: 15px; }
  .cmd-row button.primary { width: 100%; height: 40px; }
  .cmd-foot { padding: 10px 12px; }
  .cmd-foot .hint-long { display: none; }
  .v-head { flex-direction: column; gap: 16px; }
  .score-col { width: 100%; }
  .v-title { font-size: 20px; letter-spacing: -0.5px; }
  .grid { grid-template-columns: 1fr; }
  .filters { width: 100%; }
  input[type="search"], select { width: 100%; min-width: 0; max-width: 100%; }
  .chk { width: 100%; justify-content: flex-start; }
  .examples .ex { width: 100%; justify-content: flex-start; height: 34px; }
  .band { padding: 36px 0; }
  .browse-head h2, .band h2 { font-size: 24px; letter-spacing: -0.6px; }
  footer { padding: 24px 16px 32px; }
}
