/* The marketing site's styles, for every page on tracc.app.
 *
 * One file rather than a <style> block per page, because the plan is to
 * generate a page per publicly listed item: inline styles would ship the same
 * CSS thousands of times over and make a restyle mean regenerating every page.
 *
 * Pages link it as /tracc.css?v=N. Hosting caches CSS for a day, so bump N on
 * every change or returning visitors get the new markup with the old styles.
 *
 * Colors and type are the brand tokens (docs/brand/tokens.css), copied rather
 * than imported — this directory is served as plain static files with no build
 * step. Tektur lives only inside the logo files, so headings use the system stack.
 */

:root {
  color-scheme: light dark;
  --ground: #EEF0EB;
  --surface: #FFFFFF;
  --text: #1B2530;
  --muted: #5A6571;
  --rule: #D5DAD3;
  --accent-text: #8A5E00;
  --found: #F2B42B;
  --on-found: #1B2530;
  --sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --radius-card: 12px;
  --radius-control: 8px;
  --gutter: 20px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: #11181F;
    --surface: #1B2530;
    --text: #EEF0EB;
    --muted: #A7B1BB;
    --rule: #3A4652;
    --accent-text: #F2B42B;
  }
}

@media (min-width: 48rem) { :root { --gutter: 32px; } }

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  padding: 0 var(--gutter);
}

img { max-width: 100%; }

/* Every section of the page shares this one width. */
.wrap { width: 100%; max-width: 70rem; margin-inline: auto; }

h1 {
  margin: 0 0 18px;
  font-size: clamp(2.3rem, 1.5rem + 3.2vw, 3.6rem);
  line-height: 1.04;
  letter-spacing: -0.03em;
  font-weight: 750;
  text-wrap: balance;
}

h2 {
  margin: 0 0 16px;
  font-size: clamp(1.6rem, 1.25rem + 1.4vw, 2.25rem);
  line-height: 1.12;
  letter-spacing: -0.022em;
  font-weight: 700;
  text-wrap: balance;
}

h3 { margin: 0 0 6px; font-size: 1.0625rem; line-height: 1.3; font-weight: 650; }

p { margin: 0 0 16px; max-width: 38rem; }
p:last-child { margin-bottom: 0; }
.muted { color: var(--muted); }

.eyebrow {
  margin: 0 0 10px;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-text);
}

/* ============ Buttons ============ */
.actions { display: flex; flex-wrap: wrap; gap: 14px 18px; align-items: center; margin-top: 30px; }

.cta {
  display: inline-block;
  padding: 14px 26px;
  border-radius: var(--radius-control);
  background: var(--found);
  color: var(--on-found);
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
}
.cta:hover { filter: brightness(0.94); }

a:focus-visible { outline: 3px solid currentColor; outline-offset: 3px; border-radius: 4px; }

/* ============ The stage ============
 *
 * The hero is dark whatever the rest of the page is doing: a lit bench the
 * part sits on. Its colours are literal rather than themed for that reason,
 * and the header lives inside it so the top of the page is one surface.
 */
.stage {
  position: relative;
  margin: 0 calc(var(--gutter) * -1);
  padding: 0 var(--gutter) 48px;
  background:
    radial-gradient(70% 80% at 75% 35%, rgba(119, 132, 145, 0.28), transparent 70%),
    linear-gradient(180deg, #151E28 0%, #0E151C 100%);
  color: #EEF0EB;
  overflow: hidden;
}

header.site {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 0;
}
.home { display: inline-block; }
.logo { display: block; height: 36px; width: auto; }
.nav-link { color: #EEF0EB; font-weight: 600; font-size: 0.9375rem; text-decoration: none; opacity: 0.85; }
.nav-link:hover { opacity: 1; text-decoration: underline; text-underline-offset: 4px; }

.hero {
  display: grid;
  gap: 16px;
  align-items: center;
  padding: 24px 0 8px;
}
@media (min-width: 56rem) {
  .hero { grid-template-columns: 1fr 1.1fr; gap: 40px; padding: 40px 0 16px; }
}

.stage .eyebrow { color: #A7B1BB; }
.stage .lead { font-size: 1.1875rem; color: #A7B1BB; max-width: 32rem; }
.aside { font-size: 0.875rem; color: #A7B1BB; }

.rig { position: relative; margin: 0; }

model-viewer {
  display: block;
  width: 100%;
  height: clamp(300px, 42vw, 500px);
  background: transparent;
  --poster-color: transparent;
  touch-action: pan-y;
}
model-viewer::part(default-progress-bar) { display: none; }

.chip {
  position: absolute;
  z-index: 2;
  display: grid;
  gap: 2px;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(12, 18, 25, 0.78);
  border: 1px solid rgba(167, 177, 187, 0.22);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-size: 0.8125rem;
  line-height: 1.35;
  pointer-events: none;
}
.chip .k { color: #A7B1BB; font-size: 0.75rem; }
.chip .v { font-weight: 600; }
.chip-left { left: 0; top: 10%; }
.chip-right { right: 0; bottom: 14%; }

.hint { margin: 4px 0 0; text-align: center; font-size: 0.8125rem; color: #778491; }

/* At phone width the cards stop floating over the part and sit under it. */
@media (max-width: 34rem) {
  .rig { display: grid; gap: 8px; }
  .chip { position: static; }
  .hint { order: -1; }
}

/* The counts sit on the stage floor, under the part. */
.proof { margin-top: 36px; padding-top: 28px; border-top: 1px solid rgba(167, 177, 187, 0.18); }
.proof-lede {
  margin: 0 0 18px;
  max-width: none;
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #778491;
}
.figures { display: grid; gap: 20px; margin: 0; grid-template-columns: 1fr; }
@media (min-width: 40rem) { .figures { grid-template-columns: repeat(3, 1fr); } }
.figure { display: flex; flex-direction: column-reverse; gap: 4px; }
.figure dd {
  margin: 0;
  font-size: clamp(2rem, 1.5rem + 2vw, 2.9rem);
  font-weight: 750;
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.figure dt { font-size: 0.9375rem; color: #A7B1BB; }

/* ============ The tape ============
 *
 * Twenty real parts out of the inventory, running past under the counts:
 * mostly renders of the 3D models attached to them (/parts, made from each
 * item's STEP file), with a few of the cleanest listing photos between. The
 * strip is duplicated and the track slides exactly one strip's width, so the
 * loop has no seam.
 */
.tape {
  margin: 0 calc(var(--gutter) * -1);
  padding: 20px 0;
  background: var(--surface);
  border-bottom: 1px solid var(--rule);
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.track { display: flex; width: max-content; animation: roll 80s linear infinite; }
.strip { display: flex; gap: 14px; padding-right: 14px; }
.strip a { display: block; flex: none; border-radius: 10px; }
.strip a:focus-visible { outline: 3px solid var(--text); outline-offset: 2px; }
.strip a:hover img { transform: translateY(-3px); box-shadow: 0 8px 18px -8px rgba(17, 24, 31, 0.45); }
/* Hold still while someone is choosing one. */
.tape:hover .track,
.tape:focus-within .track { animation-play-state: paused; }
.strip img {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  width: 112px;
  height: 112px;
  object-fit: cover;
  border-radius: 10px;
  /* White in both themes: the renders and product photos are shot on white. */
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--rule);
  flex: none;
}
@keyframes roll {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-50%, 0, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .track { animation: none; }
  model-viewer { --auto-rotate-speed: 0deg; }
}

/* ============ Sections ============ */
main section { padding: 56px 0; border-top: 1px solid var(--rule); }
@media (min-width: 56rem) { main section { padding: 80px 0; } }
main section:first-child { border-top: 0; }

/* Copy on one side, the thing it describes on the other; alternate sides. */
.split { display: grid; gap: 32px; align-items: center; }
@media (min-width: 56rem) {
  .split { grid-template-columns: 1fr 1fr; gap: 64px; }
  .split.flip .copy { order: 2; }
}

.points { list-style: none; margin: 24px 0 0; padding: 0; display: grid; gap: 12px; max-width: 34rem; }
.points li { position: relative; padding-left: 20px; color: var(--muted); font-size: 0.9375rem; }
.points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 8px;
  height: 2px;
  background: var(--muted);
}
.points b { color: var(--text); font-weight: 600; }

.panel {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 1px 2px rgba(17, 24, 31, 0.04), 0 12px 32px -12px rgba(17, 24, 31, 0.18);
}
@media (min-width: 40rem) { .panel { padding: 28px; } }

/* The conversation, drawn as Claude draws it: its own warm ground, its mark
 * and wordmark, serif replies and collapsed tool calls. These are Claude's
 * colours rather than Tracc's, so they are literal here. */
.claude {
  --c-bg: #FAF9F5; --c-text: #3D3929; --c-muted: #83827D; --c-bubble: #F0EEE6;
  --c-line: #E5E2D8; --c-input: #FFFFFF;
  background: var(--c-bg);
  color: var(--c-text);
  border: 1px solid var(--c-line);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(17, 24, 31, 0.04), 0 16px 40px -16px rgba(17, 24, 31, 0.25);
}
@media (prefers-color-scheme: dark) {
  .claude {
    --c-bg: #262624; --c-text: #EEEDE8; --c-muted: #A6A39A; --c-bubble: #141413;
    --c-line: #3A3935; --c-input: #30302E;
  }
}
.claude-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 20px; border-bottom: 1px solid var(--c-line);
}
.claude-brand { display: flex; align-items: center; gap: 8px; }
.claude-mark { width: 22px; height: 22px; }
.claude-word { height: 18px; width: auto; }
.claude-conn { display: flex; align-items: center; gap: 6px; font-size: 0.75rem; color: var(--c-muted); }
.claude-conn .dot { width: 7px; height: 7px; border-radius: 50%; background: #5FA36B; }

.claude-thread { display: grid; gap: 18px; padding: 22px 20px 8px; }
.c-you {
  justify-self: end; max-width: 85%; margin: 0;
  padding: 10px 14px; border-radius: 14px;
  background: var(--c-bubble); font-size: 0.9375rem;
}
.c-bot { display: grid; grid-template-columns: 22px 1fr; gap: 12px; align-items: start; }
.c-avatar { width: 20px; height: 20px; margin-top: 3px; }
.c-bot p {
  margin: 0; max-width: none;
  font-family: ui-serif, "Tiempos Text", Georgia, Cambria, "Times New Roman", serif;
  font-size: 1.0313rem; line-height: 1.6;
}
.c-bot strong { font-weight: 600; }
.c-tool {
  display: inline-flex; align-items: center; gap: 6px; margin-bottom: 8px;
  padding: 5px 10px 5px 6px; border: 1px solid var(--c-line); border-radius: 8px;
  font-family: var(--mono); font-size: 0.75rem; color: var(--c-muted);
}
.c-tool span { font-family: var(--sans); font-weight: 600; color: var(--c-text); }
.c-tool .chev { width: 14px; height: 14px; }

.claude-input {
  display: flex; align-items: center; justify-content: space-between;
  margin: 12px 16px 16px; padding: 10px 10px 10px 16px;
  background: var(--c-input); border: 1px solid var(--c-line); border-radius: 14px;
  font-size: 0.9375rem; color: var(--c-muted);
}
.claude-input .send {
  display: grid; place-items: center; width: 30px; height: 30px;
  border-radius: 8px; background: #C6613F;
}
.claude-input .send svg { width: 14px; height: 14px; }

/* File formats. */
.formats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.fmt {
  display: grid;
  place-items: center;
  aspect-ratio: 5 / 3;
  border-radius: 10px;
  background: var(--ground);
  font-family: var(--mono);
  font-weight: 600;
  font-size: clamp(0.8125rem, 0.7rem + 0.5vw, 1rem);
  letter-spacing: 0.02em;
}

/* A measured item's ledger. */
.ledger-head { display: grid; gap: 2px; margin-bottom: 20px; }
.ledger .v, .listing .v { font-weight: 650; }
.ledger .k, .listing .k { font-size: 0.875rem; color: var(--muted); }
.bar { display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: var(--ground); margin-bottom: 20px; }
.bar .left { background: var(--text); }
.bar .cut {
  background: repeating-linear-gradient(135deg, var(--rule) 0 6px, transparent 6px 12px);
}
.ledger-rows { display: grid; font-size: 0.9375rem; font-variant-numeric: tabular-nums; }
.ledger-rows div { display: flex; justify-content: space-between; padding: 10px 0; border-top: 1px solid var(--rule); color: var(--muted); }
.ledger-rows .total { color: var(--text); font-weight: 650; }

/* Nearby listings. */
.listings { display: grid; gap: 4px; padding: 12px; }
.listing { display: flex; gap: 14px; align-items: center; padding: 10px; border-radius: 10px; }
.listing + .listing { border-top: 1px solid var(--rule); border-radius: 0; }
.listing img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; flex: none; }
.listing div { display: grid; gap: 2px; }

/* Numbered steps as three cards. */
.steps { list-style: none; margin: 28px 0 0; padding: 0; display: grid; gap: 16px; counter-reset: step; }
@media (min-width: 48rem) { .steps { grid-template-columns: repeat(3, 1fr); } }
.steps li {
  counter-increment: step;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-card);
  padding: 22px;
}
.steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-bottom: 14px;
  border-radius: 50%;
  background: var(--ground);
  font-weight: 700;
  font-size: 0.9375rem;
  font-variant-numeric: tabular-nums;
}
.steps p { margin: 0; color: var(--muted); font-size: 0.9375rem; }

/* The closing call to action. */
main section.closer {
  display: grid;
  gap: 24px;
  align-items: center;
  margin-bottom: 56px;
  padding: 40px;
  border: 0;
  border-radius: 20px;
  background: linear-gradient(180deg, #151E28 0%, #0E151C 100%);
  color: #EEF0EB;
}
.closer .muted { color: #A7B1BB; }
@media (min-width: 48rem) { main section.closer { grid-template-columns: 1fr auto; padding: 48px 56px; } }
@media (max-width: 30rem) { main section.closer { padding: 28px 22px; } }

footer.site {
  padding: 28px 0 40px;
  border-top: 1px solid var(--rule);
  font-size: 0.875rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}
footer.site span { margin-right: auto; }
footer.site a { color: var(--muted); text-underline-offset: 3px; }
footer.site a:hover { color: var(--text); }

/* ============ Long-form pages ============ */
.prose { max-width: 44rem; padding: 32px 0 48px; }
.prose h1 { margin-top: 40px; font-size: clamp(1.75rem, 1.4rem + 1.6vw, 2.25rem); }
.prose h2 { margin-top: 32px; font-size: 1.1875rem; }
.prose ul { margin: 0 0 16px; padding-left: 22px; }
.prose li { margin-bottom: 8px; }
.prose p,
.prose li { color: var(--muted); }
.prose a { color: var(--text); text-underline-offset: 3px; }
.prose .updated { font-size: 0.875rem; }
.prose .home img { display: block; height: 40px; width: auto; }
.prose strong { font-weight: 600; }
.prose footer {
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
  font-size: 0.875rem;
  color: var(--muted);
}

/* Grid children default to min-width: auto, so one long tool name could
 * push a panel wider than a phone. */
.split > *, .hero > * { min-width: 0; }
.c-tool { max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* ============ The conversation, playing ============
 *
 * The script in index.html adds .playing and reveals each part in turn. Only
 * opacity and transform change, so the panel holds its final height and the
 * page never jumps under the reader.
 */
.claude.playing .c-you,
.claude.playing .c-bot,
.claude.playing .c-tool,
.claude.playing .w { opacity: 0; }
.claude.playing .c-you { transform: translateY(6px); }

.claude .c-you,
.claude .c-bot,
.claude .c-tool { transition: opacity 0.25s ease, transform 0.25s ease; }
.claude .w { transition: opacity 0.18s ease; }

.claude.playing .c-you.shown,
.claude.playing .c-bot.shown,
.claude.playing .tool-shown .c-tool,
.claude.playing .w.on { opacity: 1; transform: none; }

/* Claude's spark turns while it works. */
.c-bot.thinking .c-avatar { animation: spark 1.6s ease-in-out infinite; }
@keyframes spark {
  0% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(90deg) scale(0.82); }
  100% { transform: rotate(180deg) scale(1); }
}

/* The tool call shimmers until the reply starts. */
.c-bot.thinking.tool-shown .c-tool {
  background: linear-gradient(90deg, transparent 0%, rgba(217, 119, 87, 0.14) 50%, transparent 100%) 0 0 / 200% 100%;
  animation: shimmer 1.2s linear infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* A caret while a question is being typed. */
.c-draft.typing { color: var(--c-text); }
.c-draft.typing::after {
  content: "";
  display: inline-block;
  width: 1.5px;
  height: 1.1em;
  margin-left: 1px;
  vertical-align: text-bottom;
  background: var(--c-text);
  animation: caret 1s steps(1) infinite;
}
@keyframes caret { 50% { opacity: 0; } }
.claude-input { min-width: 0; }
.c-draft { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; margin-right: 10px; }

/* ============ Near pages ============
 *
 * What is listed near a place: /near/{place}/{thing}, rendered by the
 * nearPages function (functions/ts/src/nearRender.ts) with this stylesheet.
 */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.near-stage { padding-bottom: 36px; }
.near-stage h1 { font-size: clamp(1.9rem, 1.3rem + 2.4vw, 2.9rem); margin-top: 8px; }
.near-crumbs { font-size: 0.875rem; color: #A7B1BB; padding-top: 12px; }
.near-crumbs a { color: #A7B1BB; text-underline-offset: 3px; }
.near-crumbs a:hover { color: #EEF0EB; }

.near-search {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr;
  margin-top: 26px;
  max-width: 46rem;
}
@media (min-width: 40rem) { .near-search { grid-template-columns: 1.4fr 1fr auto; } }
.near-search input {
  width: 100%;
  padding: 13px 14px;
  border-radius: var(--radius-control);
  border: 1px solid #3A4652;
  background: #0C1219;
  color: #EEF0EB;
  font: inherit;
}
.near-search input::placeholder { color: #778491; }
.near-search input:focus-visible { outline: 2px solid #A7B1BB; outline-offset: 1px; }
.near-search button {
  padding: 13px 22px;
  border: 0;
  border-radius: var(--radius-control);
  background: #EEF0EB;
  color: #1B2530;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}
.near-search button:hover { background: #FFFFFF; }
.near-signin { margin-top: 10px; font-size: 0.8125rem; color: #778491; }

.near-main { padding-top: 32px; }
.near-grid { display: grid; gap: 28px; align-items: start; }
@media (min-width: 56rem) {
  .near-grid { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 40px; }
  .near-side { position: sticky; top: 20px; }
}

.near-results { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.near-result {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-card);
  scroll-margin: 20px;
}
@media (min-width: 34rem) { .near-result { grid-template-columns: 88px minmax(0, 1fr) auto; } }
.near-result img,
.near-nophoto {
  width: 88px;
  height: 88px;
  object-fit: cover;
  border-radius: 10px;
  background: var(--ground);
  display: block;
}
.near-body { min-width: 0; }
.near-body h3 { margin: 0 0 4px; font-size: 1.0625rem; }
.near-body h3 a { color: var(--text); text-decoration: none; }
.near-body h3 a:hover { text-decoration: underline; text-underline-offset: 3px; }
.near-body p { margin: 0; font-size: 0.875rem; color: var(--muted); }
.near-facts:empty { display: none; }
.near-offer { color: var(--text); font-weight: 600; }
.near-request {
  grid-column: 1 / -1;
  justify-self: stretch;
  text-align: center;
  padding: 10px 16px;
  border-radius: var(--radius-control);
  border: 1px solid var(--rule);
  color: var(--text);
  font-weight: 650;
  font-size: 0.9375rem;
  text-decoration: none;
  white-space: nowrap;
}
@media (min-width: 34rem) { .near-request { grid-column: auto; justify-self: end; } }
.near-request:hover { border-color: var(--muted); }
.near-dialog-request.is-added { background: var(--ground); color: var(--text); }

/* Your list, once something is on it: a bar along the bottom, like a basket. */
.near-basket {
  position: fixed;
  left: 50%;
  bottom: max(16px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 16px;
  width: max-content;
  max-width: calc(100vw - 32px);
  padding: 10px 10px 10px 18px;
  border-radius: 999px;
  background: var(--text);
  color: var(--surface);
  box-shadow: 0 12px 30px -10px rgba(17, 24, 31, 0.5);
  font-weight: 600;
}
.near-basket[hidden] { display: none; }
/* Room under the last result for the bar. */
body:has(.near-basket:not([hidden])) { padding-bottom: 88px; }
.near-basket .cta { padding: 8px 16px; background: var(--surface); color: var(--text); }
/* The nearest result is the one found thing on the page, so it alone gets Bin Yellow. */
.near-result:first-child .near-request { background: var(--found); color: var(--on-found); border-color: var(--found); }
/* Once added, it's done: plain again, even on the nearest result. */
.near-result .near-request.is-added { background: var(--ground); border-color: var(--rule); color: var(--muted); }

.near-more {
  display: block;
  margin-top: 14px;
  padding: 12px;
  text-align: center;
  border: 1px dashed var(--rule);
  border-radius: var(--radius-card);
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}
.near-more:hover { border-color: var(--muted); }

.near-empty {
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-card);
}

.near-map {
  display: block;
  border-radius: var(--radius-card);
  border: 1px solid var(--rule);
  background: var(--surface);
  overflow: hidden;
  z-index: 0;
}
.near-map-note { margin: 8px 0 0; font-size: 0.8125rem; color: var(--muted); }

.near-links { padding: 36px 0 0; }
.near-links h2 { font-size: 1.25rem; margin-bottom: 12px; }
.near-links ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.near-links a {
  display: inline-block;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--rule);
  color: var(--text);
  font-size: 0.875rem;
  text-decoration: none;
}
.near-links a:hover { border-color: var(--muted); }
.near-main .closer { margin-top: 48px; }

/* ============ Not found ============ */
.lost { min-height: calc(100vh - 90px); display: flex; flex-direction: column; }
.lost .wrap { flex: 1; display: flex; flex-direction: column; }
.lost-body {
  flex: 1;
  display: grid;
  gap: 40px;
  align-items: center;
  align-content: center;
  padding: 40px 0 64px;
}
@media (min-width: 48rem) { .lost-body { grid-template-columns: auto 1fr; gap: 64px; } }
.lost h1 { max-width: 16ch; }
.lost .lead { max-width: 30rem; }
/* An empty bin with its label: the page that isn't here. */
.lost-bin {
  position: relative;
  width: 200px;
  height: 150px;
  border: 3px solid #3A4652;
  border-top: 0;
  border-radius: 0 0 18px 18px;
  background: linear-gradient(180deg, rgba(58, 70, 82, 0) 0%, rgba(58, 70, 82, 0.35) 100%);
}
.lost-bin::before {
  content: "";
  position: absolute;
  left: -12px;
  right: -12px;
  top: -3px;
  height: 3px;
  border-radius: 3px;
  background: #3A4652;
}
.lost-label {
  position: absolute;
  left: 50%;
  top: 36px;
  transform: translateX(-50%);
  padding: 6px 16px;
  border-radius: 6px;
  background: #F2B42B;
  color: #1B2530;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: 0.08em;
}
.lost-link { color: #EEF0EB; font-weight: 600; text-underline-offset: 4px; }
.lost-link:hover { color: #FFFFFF; }

/* ============ AI setup (/ai) ============ */
.ai-hero { padding: 32px 0 24px; max-width: 46rem; }
.ai-url {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-top: 28px;
  padding: 12px 12px 12px 18px;
  border-radius: 12px;
  border: 1px solid #3A4652;
  background: #0C1219;
  max-width: 36rem;
}
.ai-url-label { width: 100%; font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; color: #778491; }
.ai-url code { flex: 1; min-width: 0; font-family: var(--mono); font-size: 1rem; color: #EEF0EB; overflow-wrap: anywhere; }
.ai-copy {
  padding: 8px 14px;
  border: 0;
  border-radius: var(--radius-control);
  background: #F2B42B;
  color: #1B2530;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 650;
  cursor: pointer;
}
.ai-code .ai-copy { background: transparent; color: var(--text); border: 1px solid var(--rule); padding: 5px 12px; }
.ai-code {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 14px;
  overflow: hidden;
  min-width: 0;
}
.ai-code-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--rule);
  font-size: 0.8125rem;
  color: var(--muted);
}
.ai-code pre {
  margin: 0;
  padding: 18px;
  font-family: var(--mono);
  font-size: 0.875rem;
  line-height: 1.6;
  overflow-x: auto;
}
main code { font-family: var(--mono); font-size: 0.875em; padding: 1px 5px; border-radius: 4px; background: var(--ground); }
.ai-code pre, .ai-url code { background: none; }
.steps a { color: var(--text); }
.ai-asks { list-style: none; margin: 24px 0 0; padding: 0; display: grid; gap: 12px; }
@media (min-width: 48rem) { .ai-asks { grid-template-columns: repeat(3, 1fr); } }
.ai-asks li {
  padding: 18px;
  border-radius: var(--radius-card);
  background: var(--surface);
  border: 1px solid var(--rule);
  font-family: ui-serif, Georgia, Cambria, "Times New Roman", serif;
  font-size: 1.0625rem;
}

/* The way into /ai from the Claude example on the home page. */
.ai-start { margin-top: 24px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.ai-start .cta-dark {
  display: inline-block;
  padding: 12px 20px;
  border-radius: var(--radius-control);
  background: var(--text);
  color: var(--ground);
  font-weight: 650;
  text-decoration: none;
}
.ai-start .cta-dark:hover { opacity: 0.9; }
.ai-start span { font-size: 0.875rem; color: var(--muted); }


/* ============ Free for robotics teams ============
 * Dark like the stage, so the one yellow here is FREE and its button. */
.robotics {
  margin: 0 calc(var(--gutter) * -1);
  padding: 72px var(--gutter);
  background: linear-gradient(180deg, #151E28 0%, #0E151C 100%);
  color: #EEF0EB;
}
.robotics .wrap { display: grid; gap: 40px; align-items: center; }
@media (min-width: 56rem) { .robotics .wrap { grid-template-columns: 1fr 1.1fr; gap: 64px; } }
.free-mark {
  display: inline-block;
  margin: 0 0 18px;
  padding: 6px 18px 4px;
  border-radius: 10px;
  background: #F2B42B;
  color: #1B2530;
  font-size: clamp(2.6rem, 1.8rem + 3.6vw, 4.5rem);
  font-weight: 850;
  letter-spacing: 0.04em;
  line-height: 1;
}
.robotics h2 { font-size: clamp(2rem, 1.4rem + 2.6vw, 3.2rem); line-height: 1.05; letter-spacing: -0.03em; margin-bottom: 18px; }
.robotics-copy p:not(.free-mark) { color: #A7B1BB; font-size: 1.125rem; margin-bottom: 28px; }
.programs { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 40rem) { .programs { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.programs li {
  display: grid;
  gap: 6px;
  align-content: start;
  padding: 18px;
  border-radius: 14px;
  background: rgba(238, 240, 235, 0.05);
  border: 1px solid rgba(167, 177, 187, 0.2);
}
.programs li:last-child { grid-column: 1 / -1; }
.prog-mark { font-size: 1.75rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.prog-name { font-size: 0.875rem; color: #A7B1BB; line-height: 1.35; }

/* The home page's own search, into the public near pages. */
.home-search { display: grid; gap: 8px; grid-template-columns: 1fr; margin-top: 24px; max-width: 34rem; }
@media (min-width: 40rem) { .home-search { grid-template-columns: 1.3fr 1fr auto; } }
.home-search input {
  width: 100%;
  padding: 11px 12px;
  border-radius: var(--radius-control);
  border: 1px solid var(--rule);
  background: var(--surface);
  color: var(--text);
  font: inherit;
}
.home-search button {
  padding: 11px 18px;
  border: 0;
  border-radius: var(--radius-control);
  background: var(--text);
  color: var(--ground);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}
.ai-code pre { white-space: pre-wrap; overflow-wrap: anywhere; }

a.listing { color: var(--text); text-decoration: none; }
a.listing:hover .v { text-decoration: underline; text-underline-offset: 3px; }
.listings-more { display: block; padding: 12px 10px 4px; font-size: 0.875rem; font-weight: 600; color: var(--text); text-underline-offset: 3px; }

.near-map img { display: block; width: 100%; height: auto; aspect-ratio: 640 / 440; object-fit: cover; }

/* ============ A result, opened ============ */
.near-result[data-listing] { cursor: pointer; transition: border-color 0.15s ease, box-shadow 0.15s ease; }
.near-result[data-listing]:hover { border-color: var(--muted); box-shadow: 0 8px 22px -14px rgba(17, 24, 31, 0.35); }
.near-result[data-listing]:focus-visible { outline: 3px solid var(--text); outline-offset: 2px; }

.near-dialog {
  width: min(880px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: 18px;
  background: var(--surface);
  color: var(--text);
  overflow: auto;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.5);
}
.near-dialog::backdrop { background: rgba(12, 18, 25, 0.62); backdrop-filter: blur(3px); }
.near-dialog[open] { display: grid; grid-template-columns: 1fr; }
@media (min-width: 48rem) { .near-dialog[open] { grid-template-columns: 1.15fr 1fr; } }
.near-dialog-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: rgba(12, 18, 25, 0.6);
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}
.near-dialog-photo { background: var(--ground); display: grid; place-items: center; min-height: 260px; }
.near-dialog-photo img { width: 100%; height: 100%; max-height: 70vh; object-fit: contain; display: block; }
.near-dialog-body { padding: 26px 26px 24px; display: flex; flex-direction: column; gap: 14px; }
.near-dialog-body h2 { margin: 0; font-size: 1.5rem; }
.near-dialog-facts { margin: 0; color: var(--muted); }
.near-dialog-facts:empty { display: none; }
.near-dialog-list { margin: 0; display: grid; gap: 10px; }
.near-dialog-list div { display: grid; grid-template-columns: 5.5rem 1fr; gap: 12px; padding-top: 10px; border-top: 1px solid var(--rule); }
.near-dialog-list dt { color: var(--muted); font-size: 0.875rem; }
.near-dialog-list dd { margin: 0; font-weight: 600; }
.near-dialog-note { margin: 0; font-size: 0.8125rem; color: var(--muted); }
.near-dialog-actions { margin-top: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.near-dialog-more { color: var(--text); font-weight: 600; text-underline-offset: 3px; }
.near-dialog-list div[hidden] { display: none; }
.near-dialog-ask { margin-top: auto; padding: 16px; border-radius: 12px; background: var(--ground); display: grid; gap: 12px; }
.near-dialog-ask p { margin: 0; font-size: 0.9375rem; color: var(--muted); }
.near-dialog-ask strong { color: var(--text); }
.near-dialog-ask .near-dialog-actions { margin-top: 0; }
