@font-face { font-family: "IBM Plex Sans"; src: url("./assets/fonts/IBMPlexSans-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("./assets/fonts/IBMPlexSans-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("./assets/fonts/IBMPlexSans-SemiBold.woff2") format("woff2"); font-weight: 600 800; font-display: swap; }
@font-face { font-family: "IBM Plex Sans Condensed"; src: url("./assets/fonts/IBMPlexSansCondensed-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "IBM Plex Sans Condensed"; src: url("./assets/fonts/IBMPlexSansCondensed-Bold.woff2") format("woff2"); font-weight: 700 800; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("./assets/fonts/IBMPlexMono-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("./assets/fonts/IBMPlexMono-SemiBold.woff2") format("woff2"); font-weight: 600 800; font-display: swap; }

:root {
  --ink: #2b2a29;
  --muted: #615f5a;
  --line: #deddd8;
  --paper: #f6f6f4;
  --card: #fbfbfa;
  --accent: #363688;
  --accent-dark: #303172;
  --accent-pressed: #2a2b6b;
  --accent-tint: #f1f1f8;
  --blue: #363688;
  font-family: "IBM Plex Sans", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
button, input, textarea { font: inherit; }
button, .secondary-action { cursor: pointer; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 0 5vw;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 254, 250, .92);
}

.home, .site-link { color: inherit; text-decoration: none; }
.home { display: flex; align-items: center; gap: 14px; font-weight: 600; }
.isham-logo { display: block; width: 142px; height: auto; }
.divider { width: 1px; height: 28px; background: var(--line); }
.site-link { color: var(--muted); font-size: 14px; }

main { width: min(1480px, 94vw); margin: 0 auto; padding: 72px 0 120px; }
.hero { max-width: 880px; }
.eyebrow, .brand-label, .result-brand {
  margin: 0 0 12px;
  color: var(--accent-dark);
  font-size: 13px;
  font-family: "IBM Plex Mono", monospace;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
}
h1 { margin: 0; font-family: "IBM Plex Sans Condensed", sans-serif; font-size: clamp(42px, 6vw, 82px); font-weight: 700; line-height: .98; letter-spacing: -.03em; }
h2 { margin: 0; font-family: "IBM Plex Sans Condensed", sans-serif; font-size: clamp(30px, 4vw, 48px); font-weight: 700; letter-spacing: -.02em; }

.search-form { margin-top: 52px; padding: 28px; background: var(--card); border: 1px solid var(--line); border-radius: 8px; }
.search-form label { display: block; margin-bottom: 10px; font-weight: 700; }
.search-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.search-row input { min-width: 0; padding: 18px 20px; border: 1px solid #a6a49d; border-radius: 3px; font-size: 18px; }
.search-row button, .secondary-action, .primary-action { padding: 15px 22px; border: 0; border-radius: 3px; color: white; background: var(--accent); font-weight: 600; }
.search-row button:hover { background: var(--accent-dark); }
.search-form p, .filename, .result-file, figcaption { color: var(--muted); }
.search-form p { margin: 12px 0 0; font-size: 14px; }

.status { margin: 34px 0; padding: 18px 20px; border-left: 4px solid var(--accent); background: var(--card); }
.status[data-kind="error"] { border-color: #a82020; }
.results-section, .showcase, .workspace { margin-top: 86px; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 28px; }
.count { color: var(--muted); }
.search-workbench { display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); gap: 24px; align-items: start; }
.results-pane { position: sticky; top: 88px; max-height: calc(100dvh - 112px); overflow: auto; border: 1px solid var(--line); border-radius: 5px; background: var(--card); }
.results { display: grid; }
.result-card { display: block; width: 100%; padding: 17px 18px; border: 0; border-bottom: 1px solid var(--line); border-left: 4px solid transparent; border-radius: 0; background: transparent; color: var(--ink); text-align: left; }
.result-card:last-child { border-bottom: 0; }
.result-card:hover { background: #f1f1f8; }
.result-card.is-active { border-left-color: var(--accent); background: #e1e1f0; }
.result-line { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.result-brand { margin: 0; }
.result-title { margin: 4px 0 0; font-size: 17px; line-height: 1.25; }
.result-file { margin: 5px 0 0; font-family: "IBM Plex Mono", monospace; font-size: 11px; overflow-wrap: anywhere; }
.result-page { flex: 0 0 auto; color: var(--muted); font-size: 12px; font-weight: 700; }
.result-snippets { display: grid; gap: 4px; margin-top: 12px; color: #4d4b46; font-size: 13px; }
.result-snippets span::before { content: "↳ "; color: var(--accent-dark); }
.result-snippets .result-more { color: var(--muted); font-size: 11px; }
.result-snippets .result-more::before { content: ""; }

.evidence { min-width: 0; }
.evidence:not([hidden]) { display: grid; gap: 14px; }
.evidence-copy { padding: 18px 20px; border: 1px solid var(--line); border-radius: 5px; background: var(--card); }
.evidence-heading { display: flex; justify-content: space-between; gap: 20px; align-items: start; }
.evidence-heading h2 { font-size: clamp(22px, 2.4vw, 32px); }
.evidence-page { flex: 0 0 auto; padding-top: 2px; font-weight: 800; }
.back { display: none; margin-bottom: 18px; padding: 0; border: 0; background: none; color: var(--muted); }
.filename { font-family: "IBM Plex Mono", monospace; overflow-wrap: anywhere; }
.evidence-snippets { display: flex; flex-wrap: wrap; gap: 7px; margin: 16px 0; }
mark { padding: 7px 9px; background: #e1e1f0; border-radius: 3px; font-size: 14px; font-weight: 600; }
.secondary-action { display: inline-block; text-decoration: none; }
.evidence-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.primary-action { background: var(--blue); }
.page-preview { margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: 5px; background: var(--card); }
.page-preview img { display: block; width: 100%; height: auto; background: white; }
.page-preview figcaption { margin: 12px 4px 2px; font-size: 13px; }
.page-canvas { position: relative; }
.page-interactions { position: absolute; inset: 0; }
.page-hit { position: absolute; min-width: 3px; min-height: 3px; padding: 0; border: 1px solid transparent; border-radius: 2px; background: transparent; }
.page-hit:hover, .page-hit:focus-visible { border-color: var(--accent); background: rgba(54, 54, 136, .14); }

.context-search { margin-top: 28px; padding: 18px; border: 1px solid var(--line); border-radius: 5px; background: var(--card); }
.context-head { display: flex; justify-content: space-between; gap: 14px; }
.context-head h3 { margin: 0; font-size: 22px; overflow-wrap: anywhere; }
.icon-button, .text-action { border: 0; background: transparent; color: var(--blue); }
.icon-button { align-self: start; font-size: 24px; }
.text-action { padding: 8px 0; text-decoration: underline; text-underline-offset: 3px; }
.context-scope, .context-empty { color: var(--muted); font-size: 14px; }
.context-results { display: grid; gap: 8px; margin: 16px 0; }
.context-result { display: grid; gap: 5px; width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 3px; background: white; text-align: left; }
.context-result:hover { border-color: var(--blue); }
.context-result span { color: var(--muted); font-size: 13px; }

.workspace-empty { padding: 22px; border: 1px dashed #a6a49d; border-radius: 5px; color: var(--muted); }
.workspace-list { display: grid; gap: 14px; }
.workspace-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; padding: 22px; border: 1px solid var(--line); border-radius: 5px; background: var(--card); }
.workspace-brand { margin: 0 0 8px; color: var(--accent-dark); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.workspace-title { margin: 0; font-size: 22px; }
.workspace-file, .workspace-context { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.workspace-snippet { margin: 14px 0; font-weight: 700; }
.workspace-card label { display: grid; gap: 7px; color: var(--muted); font-size: 13px; }
.workspace-note { width: 100%; resize: vertical; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: white; color: var(--ink); }
.workspace-card-actions { display: grid; align-content: start; justify-items: end; gap: 10px; }
.workspace-open, .secondary-button, .danger-button { padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px; background: white; font-weight: 700; }
.workspace-page { font-weight: 800; }
.workspace-actions { display: flex; gap: 10px; margin-top: 18px; }
.danger-button { color: #8f1d1d; }

.brand-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.brand-card { overflow: hidden; border: 1px solid var(--line); border-radius: 5px; background: var(--card); }
.brand-toggle { display: grid; grid-template-columns: 128px minmax(0, 1fr) 28px; align-items: center; gap: 20px; width: 100%; padding: 18px 20px; border: 0; background: transparent; color: var(--ink); text-align: left; }
.brand-toggle:hover { background: var(--accent-tint); }
.brand-logo-box { display: grid; place-items: center; width: 128px; height: 64px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: white; }
.brand-logo-box--canela { background: #172334; }
.brand-logo { display: block; max-width: 100%; max-height: 100%; object-fit: contain; }
.brand-logo-fallback { color: var(--accent-dark); font-weight: 800; letter-spacing: .02em; }
.brand-identity { display: grid; gap: 5px; min-width: 0; }
.brand-card h3 { margin: 0; font-size: 22px; }
.brand-catalog-count { color: var(--muted); font-size: 13px; }
.brand-toggle-indicator::before { content: "+"; display: block; color: var(--accent-dark); font-size: 26px; font-weight: 400; line-height: 1; text-align: center; }
.brand-toggle[aria-expanded="true"] .brand-toggle-indicator::before { content: "−"; }
.brand-catalogs { margin: 0; padding: 0 20px 16px; border-top: 1px solid var(--line); list-style: none; }
.brand-catalogs li { display: grid; gap: 4px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.brand-catalogs li:last-child { border-bottom: 0; }
.brand-catalogs li span { color: var(--muted); font-family: "IBM Plex Mono", monospace; font-size: 12px; overflow-wrap: anywhere; }

[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }

@media (max-width: 900px) {
  main { padding-top: 44px; }
  .search-row, .search-workbench, .brand-list, .workspace-card { grid-template-columns: 1fr; }
  .results-pane { position: static; max-height: 46dvh; }
  .back { display: inline-block; }
  .evidence-heading { display: grid; gap: 6px; }
  .workspace-card-actions { justify-items: stretch; }
  .brand-toggle { grid-template-columns: 96px minmax(0, 1fr) 24px; gap: 14px; padding: 14px; }
  .brand-logo-box { width: 96px; height: 54px; }
  .brand-card h3 { font-size: 19px; }
  .brand-catalogs { padding-inline: 14px; }
  .topbar { padding-inline: 4vw; }
  .site-link { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}
