/* BISV Hacks 2027
   Tokens come from the sponsorship prospectus: paper, ink, logo red, gold wash. */

:root {
  --paper: #F0EEE9;
  --ink: #1F1E1C;
  --muted: #6E6B64;
  --rule: #D6D2C9;
  --red: #EB463C;
  --gold: #EDE4CC;
  --gold-rule: #D9CCA6;

  --font: "Newsreader", "Iowan Old Style", "Times New Roman", serif;
  --measure: 40rem;
}

* { box-sizing: border-box; }

html { background: var(--paper); }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font);
  font-size: 1.125rem;
  line-height: 1.55;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--red); color: var(--paper); }

a { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.18em; text-decoration-color: var(--rule); }
a:hover { text-decoration-color: var(--red); }
a:focus-visible, .button:focus-visible, summary:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; border-radius: 2px; }

/* Layout: one narrow column, like a document */
header.top, main, footer {
  width: min(var(--measure), 100% - 2.5rem);
  margin-inline: auto;
}

header.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem 0;
}
.brand { display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; font-weight: 500; }
.brand img { display: block; height: 22px; width: auto; }
header.top nav { display: flex; gap: 1.25rem; flex-wrap: wrap; justify-content: flex-end; }
header.top nav a { text-decoration: none; color: var(--muted); }
header.top nav a:hover { color: var(--ink); }

/* Type scale: 1.125 base, display at ~3.4x */
h1, h2, h3 { font-weight: 500; line-height: 1.15; margin: 0; letter-spacing: -0.012em; }
h1 { font-size: clamp(2.75rem, 7vw, 4rem); font-optical-sizing: auto; }
h2 { font-size: 1.5rem; margin-bottom: 0.75rem; }
h3 { font-size: 1.125rem; margin-top: 2rem; margin-bottom: 0.25rem; }
p { margin: 0 0 1rem; }

section { padding: 3rem 0 0; }
section:last-of-type { padding-bottom: 2rem; }

/* Hero */
.hero { padding-top: 5rem; }
.tagline { font-style: italic; font-size: 1.375rem; margin: 0.75rem 0 0.25rem; }
.meta { color: var(--muted); margin: 0 0 1.75rem; }

.actions { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; margin: 0.5rem 0 1rem; }
.button {
  display: inline-block;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  padding: 0.6rem 1.15rem;
  border-radius: 999px;
  font-size: 1rem;
  line-height: 1.2;
  transition: background 120ms ease;
}
.button:hover { background: #000; }
.quiet { color: var(--muted); }
.quiet:hover { color: var(--ink); }

.photo { margin: 2.5rem 0 0; }
.photo img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
  border: 1px solid var(--rule);
  background: #E6E3DC;
  aspect-ratio: 2.25 / 1;
  object-fit: cover;
}
.photo figcaption { color: var(--muted); font-size: 0.9375rem; margin-top: 0.6rem; }

/* Tables: thin rules, bold header, same as the prospectus */
table { width: 100%; border-collapse: collapse; margin: 1.25rem 0 1.5rem; font-size: 1.0625rem; }
th, td { text-align: left; padding: 0.5rem 0.75rem 0.5rem 0; vertical-align: top; border-bottom: 1px solid var(--rule); }
th { font-weight: 600; border-bottom: 1px solid var(--ink); }
th:last-child, td:last-child { padding-right: 0; }
.facts td:first-child, .schedule td:first-child { width: 9rem; color: var(--muted); }
.schedule td:first-child { font-variant-numeric: tabular-nums; }
.note { color: var(--muted); font-style: italic; font-size: 0.9375rem; }

.tiers td:nth-child(1) { width: 8rem; font-weight: 500; }
.tiers td:nth-child(1) .note { display: block; font-weight: 400; line-height: 1.3; }
.tiers td:nth-child(2) { width: 7rem; font-variant-numeric: tabular-nums; }
.tiers .gold td { background: var(--gold); border-bottom-color: var(--gold-rule); }
.tiers tr.gold td, .tiers tr.partner td { padding-top: 0.6rem; padding-bottom: 0.6rem; }
.tiers .gold .note { color: #7A6A3A; }

/* Definition list (what to expect) */
.list { margin: 0; display: grid; gap: 0.75rem; }
.list div { display: grid; grid-template-columns: 5.5rem 1fr; gap: 1rem; }
.list dt { font-weight: 500; }
.list dd { margin: 0; }

/* Team */
.team { list-style: none; padding: 0; margin: 0.5rem 0 0; display: grid; gap: 0.6rem; font-size: 1rem; }
.team li { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 0.75rem; }
.team .name {
  font-size: 1.125rem;
  font-weight: 500;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  text-decoration-color: var(--ink);
}
.team .name:hover { text-decoration-color: var(--red); }
.role { color: var(--muted); }
.team .contact { color: var(--muted); }
a.contact:hover { color: var(--ink); }

/* Questions: an ASCII logo, one line to type on, answers printed below */
.desk { --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace; }

/* 52 characters wide. One mono character is 0.6em wide, so 100cqw / (52 * 0.6) fits the column. */
.glyph { container-type: inline-size; position: relative; margin: 2.5rem 0 2rem; user-select: none; }
.glyph pre { margin: 0; font-family: var(--mono); font-weight: 500; font-size: min(0.6875rem, 3.2cqw); line-height: 1; letter-spacing: 0; }
.glyph-red { position: absolute; inset: 0; color: var(--red); }

.ask { display: flex; align-items: baseline; gap: 0.75rem; border-bottom: 1px solid var(--ink); padding-bottom: 0.4rem; font-family: var(--mono); }
.ask label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.ask::before { content: ">"; color: var(--red); font-weight: 500; }
.ask input { flex: 1; min-width: 0; border: 0; background: none; color: var(--ink); font: inherit; font-size: 1rem; padding: 0.25rem 0; caret-color: var(--red); }
.ask input::placeholder { color: var(--muted); opacity: 0.7; }
.ask input:focus { outline: none; }
.ask:focus-within { border-bottom-color: var(--red); }
.ask button { border: 0; background: none; color: var(--muted); font: inherit; font-size: 0.875rem; cursor: pointer; padding: 0.25rem 0; }
.ask button:hover { color: var(--ink); }
.ask button:disabled { opacity: 0.4; cursor: default; }
.ask button:focus-visible, .tries button:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; border-radius: 2px; }

.status { font-family: var(--mono); font-size: 0.8125rem; color: var(--muted); min-height: 1.4em; margin: 0.4rem 0 0; }
.status:not(:empty)::after { content: "..."; }

.tries { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; color: var(--muted); font-size: 1rem; margin: 0.25rem 0 0; }
.tries button { border: 0; background: none; padding: 0; font: inherit; color: var(--ink); cursor: pointer; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.18em; text-decoration-color: var(--rule); }
.tries button:hover { text-decoration-color: var(--red); }

.slips { list-style: none; padding: 0; margin: 2rem 0 0; }
.slip { border-top: 1px solid var(--rule); padding: 1rem 0 0.25rem; }
.slip-q { font-family: var(--mono); font-size: 0.875rem; color: var(--muted); margin: 0 0 0.35rem; overflow-wrap: anywhere; }
.slip-q::before { content: "> "; color: var(--red); }
.slip-a { min-height: 1.55em; overflow-wrap: anywhere; }
.slip.unknown .slip-a { font-style: italic; }
/* The cursor: blinks while the answer is on its way, holds still while words land. */
.slip-a.waiting::after, .slip-a.streaming::after { content: ""; display: inline-block; width: 1.5px; height: 1.1em; margin-left: 1px; background: var(--red); vertical-align: -0.18em; }
.slip-a.waiting::after { animation: caret 1s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }
.slip-email { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.75rem; font-family: var(--mono); font-size: 0.875rem; margin: 0 0 1rem; }
.slip-email input { flex: 1; min-width: 12rem; border: 0; border-bottom: 1px solid var(--ink); background: none; color: var(--ink); font: inherit; padding: 0.25rem 0; caret-color: var(--red); }
.slip-email input:focus { outline: none; border-bottom-color: var(--red); }
.slip-email button { border: 0; background: none; padding: 0.25rem 0; font: inherit; color: var(--ink); cursor: pointer; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.18em; text-decoration-color: var(--rule); }
.slip-email button:hover { text-decoration-color: var(--red); }
.slip-email button:disabled { opacity: 0.4; cursor: default; }
.slip-email button:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; border-radius: 2px; }
.slip-note { font-family: var(--mono); font-size: 0.875rem; color: var(--muted); }

/* Links */
.links { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.5rem; }
.links li a, .links li .soon { font-weight: 500; margin-right: 0.35rem; }
.links .soon { color: var(--muted); }

.empty { color: var(--muted); font-style: italic; }

footer { padding: 3rem 0 4rem; border-top: 1px solid var(--rule); color: var(--muted); font-size: 0.9375rem; }
footer p { margin: 0 0 0.4rem; }

@media (max-width: 600px) {
  header.top { flex-direction: column; align-items: flex-start; }
  header.top nav { justify-content: flex-start; gap: 1rem; }
  .list div { grid-template-columns: 1fr; gap: 0.1rem; }
  .facts td:first-child, .schedule td:first-child { width: 6.5rem; }
  /* Stack each tier: name + price on one line, highlights below */
  .tiers thead { display: none; }
  .tiers tbody { display: block; border-top: 1px solid var(--ink); }
  .tiers tr { display: grid; grid-template-columns: 1fr auto; border-bottom: 1px solid var(--rule); padding: 0.6rem 0; }
  .tiers td { border: 0; padding: 0; width: auto; }
  .tiers td:nth-child(3) { grid-column: 1 / -1; font-size: 1rem; color: var(--muted); margin-top: 0.15rem; }
  .tiers tr.gold { background: var(--gold); border-bottom-color: var(--gold-rule); padding-inline: 0.5rem; margin-inline: -0.5rem; }
  .tiers tr.gold td { background: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  .slip-a.waiting::after { animation: none; }
}

/* Sub-pages: smaller title, less top space than the home hero */
header.top nav a[aria-current="page"] { color: var(--ink); text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 0.25em; }
.page section:first-child { padding-top: 3rem; }
.page h1 { font-size: 2.25rem; margin-bottom: 0.75rem; }
.page h1 + p, .page h1 + table, .page h1 + ul, .page h1 + details { margin-top: 0.5rem; }

/* Sponsors: agent line, prospectus request, partner places */
.agent { --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace; font-family: var(--mono); font-size: min(1rem, (100vw - 2.5rem) / 23.5); white-space: nowrap; margin: 0.25rem 0 1.75rem; min-height: 1.55em; }
/* 38 characters max ("> build what didn't exist this morning"), 0.6em each, so width / 23.5 always fits. */
.agent::before { content: "> "; color: var(--red); font-weight: 500; }
.agent-q { color: var(--muted); }
.agent-verb::after { content: ""; display: inline-block; width: 0.55em; height: 1.05em; margin-left: 0.08em; vertical-align: -0.15em; background: var(--red); animation: caret 1s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }

.request { background: var(--gold); border: 1px solid var(--gold-rule); border-radius: 6px; padding: 1.25rem 1.25rem 0.5rem; margin: 1.75rem 0 0; }
.request p { margin-bottom: 0.75rem; }
.request-title { font-weight: 600; }
.request .quiet { color: #7A6A3A; }

.muted { color: var(--muted); }
.slots { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--ink); border-left: 1px solid var(--rule); }
.slots li { aspect-ratio: 3 / 2; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); position: relative; }
.slots span { position: absolute; top: 0.6rem; left: 0.75rem; font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 0.75rem; color: var(--muted); opacity: 0.6; }

@media (max-width: 600px) {
  .slots { grid-template-columns: repeat(2, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .agent-verb::after { animation: none; }
}

/* Footer links to the trust pages */
.footer-links a { color: inherit; }

/* Humans | Agents switch. Agents mode shows the page's Markdown. */
.viewswitch {
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  position: absolute; right: 1.25rem; top: 1.3rem; z-index: 10;
  display: flex; padding: 3px; gap: 2px;
  background: var(--paper); border: 1px solid var(--ink); border-radius: 999px;
  font-family: var(--mono); font-size: 0.8125rem;
}
.viewswitch button {
  border: 0; background: none; color: var(--muted); font: inherit; cursor: pointer;
  padding: 0.35rem 0.8rem; border-radius: 999px; transition: background 120ms ease, color 120ms ease;
}
.viewswitch button:hover { color: var(--ink); }
.viewswitch button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.viewswitch button[value="agents"][aria-pressed="true"] { background: var(--red); }
.viewswitch button:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

.agent-view { --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace; }
.agent-cmd { font-family: var(--mono); font-size: 0.875rem; color: var(--muted); margin: 0 0 0.75rem; }
.agent-cmd span { color: var(--red); font-weight: 500; }
.agent-view pre {
  margin: 0; padding: 1.25rem; border: 1px solid var(--rule); border-top: 1px solid var(--ink);
  background: #F7F6F2; font-family: var(--mono); font-size: 0.8125rem; line-height: 1.6;
  white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink);
}
.agent-view pre:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.agent-note { color: var(--muted); font-size: 0.9375rem; margin-top: 0.75rem; }
/* Mid widths: the nav reaches the right edge, so the header drops below the switch. */
@media (min-width: 601px) and (max-width: 1020px) {
  .viewswitch { top: 0.75rem; }
  html.has-switch header.top { padding-top: 3.25rem; }
}
/* Smallest phones: a compact switch so it clears the wordmark. */
@media (max-width: 360px) {
  .viewswitch { font-size: 0.75rem; right: 0.75rem; }
  .viewswitch button { padding: 0.3rem 0.55rem; }
}
