/* =========================================================================
   idea-library
   Art direction: a geological core sample. The library is built by digging
   through our own history in passes, so the page reads like sediment — banded,
   stratified, weighty. Warm ochre against cold slate; failures are the dark
   bands and they are given the same visual weight as the successes, because
   that is the entire argument of the project.
   ========================================================================= */

:root {
  --bg:        #0b0d10;
  --bg-2:      #101318;
  --bg-3:      #161a21;
  --line:      #242a33;
  --line-soft: #1b2027;
  --ink:       #e9ecf1;
  --ink-2:     #a8b0bd;
  --ink-3:     #6c7686;

  /* outcome palette — chosen to stay distinguishable in both themes and for
     the most common colour-vision deficiencies (no red/green-only pairing) */
  --revenue:      #e8c547;
  --shipped:      #4a9d7f;
  --partial:      #c98b3a;
  --failed:       #d9544d;
  --abandoned:    #6b7280;
  --inconclusive: #5b8dd9;
  --active:       #7c9ed9;
  --parked:       #8b7fa8;

  --accent:    #e8c547;
  --accent-dk: #b9992f;

  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans:  "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono:  "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --w: 1080px;
}

:root[data-theme="light"] {
  --bg: #f4f1ea; --bg-2: #ebe7de; --bg-3: #e2ddd2;
  --line: #d3ccbe; --line-soft: #e0dad0;
  --ink: #14171c; --ink-2: #454c58; --ink-3: #767f8d;
  --accent: #9a7c14; --accent-dk: #7a6210;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* fine film grain — keeps large dark fields from banding, and gives the page
   a printed rather than screen-native feel */
.grain {
  position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

img { max-width: 100%; }
a { color: inherit; }

/* ---------------------------------------------------------------- topbar */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  padding: 14px 28px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid var(--line-soft);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; letter-spacing: -.01em; }
.brand-mark { display: grid; gap: 2px; width: 16px; }
.brand-mark i { display: block; height: 2px; border-radius: 1px; }
.brand-mark i:nth-child(1) { background: var(--revenue); width: 100%; }
.brand-mark i:nth-child(2) { background: var(--abandoned); width: 72%; }
.brand-mark i:nth-child(3) { background: var(--failed); width: 100%; }
.brand-mark i:nth-child(4) { background: var(--shipped); width: 58%; }
.brand-text span { color: var(--accent); }
.topbar nav { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.topbar nav a { text-decoration: none; font-size: 13.5px; color: var(--ink-2); transition: color .15s; }
.topbar nav a:hover { color: var(--ink); }
.topbar nav a.ghost { color: var(--accent); }

/* ------------------------------------------------------------------ hero */
.hero {
  position: relative;
  min-height: min(88vh, 780px);
  display: grid; align-items: center;
  padding: 84px 28px 64px;
  overflow: hidden;
}
#core {
  position: absolute; inset: 0; width: 100%; height: 100%;
  z-index: 0;
  /* Feather the top and bottom so the column emerges from the page ground and
     sinks back into it, instead of being a rectangle of 3D pasted on a page. */
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 16%, #000 82%, transparent 100%);
          mask-image: linear-gradient(to bottom, transparent 0%, #000 16%, #000 82%, transparent 100%);
}
/* a soft pool of light behind the column, so it is lit BY the page */
.hero::after {
  content: ""; position: absolute; z-index: 0; pointer-events: none;
  right: -8%; top: 50%; width: 46%; aspect-ratio: 1; transform: translateY(-50%);
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 9%, transparent) 0%, transparent 62%);
}
.hero-copy {
  position: relative; z-index: 2;
  width: 100%; max-width: var(--w); margin: 0 auto;
  max-width: min(var(--w), 100%);
}
/* At the half-screen width this is most often read at (~960px) the copy gives up
   a little measure so the core sample has a margin of its own to live in. */
.hero-copy > * { max-width: 600px; }
@media (max-width: 1000px) { .hero-copy > * { max-width: 540px; } }
@media (max-width: 700px)  { .hero-copy > * { max-width: none; } }

.eyebrow {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .18em;
  text-transform: uppercase; color: var(--accent); margin: 0 0 18px;
}
h1 {
  font-family: var(--serif);
  font-size: clamp(2.5rem, 6.2vw, 4.4rem);
  font-weight: 900; line-height: .98; letter-spacing: -.03em;
  margin: 0 0 22px;
}
h1 em { font-style: italic; font-weight: 400; color: var(--accent); display: inline-block; }
.lede { font-size: 17.5px; color: var(--ink-2); margin: 0 0 28px; }
.lede em { color: var(--ink); font-style: italic; }

.counts { display: flex; flex-wrap: wrap; gap: 28px; margin: 0 0 30px; }
.counts div { display: flex; flex-direction: column; }
.counts b { font-family: var(--serif); font-size: 30px; font-weight: 600; line-height: 1; letter-spacing: -.02em; }
.counts span { font-family: var(--mono); font-size: 10.5px; letter-spacing: .13em; text-transform: uppercase; color: var(--ink-3); margin-top: 6px; }

.cta { display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
  display: inline-block; padding: 11px 20px; border-radius: 2px;
  border: 1px solid var(--line); text-decoration: none;
  font-size: 14px; font-weight: 500; color: var(--ink);
  background: color-mix(in srgb, var(--bg-2) 70%, transparent);
  transition: border-color .16s, transform .16s, background .16s;
}
.btn:hover { border-color: var(--accent); transform: translateY(-1px); }
.btn.primary { background: var(--accent); color: #14110a; border-color: var(--accent); font-weight: 600; }
.btn.primary:hover { background: var(--accent-dk); border-color: var(--accent-dk); }

.hero-hint {
  position: absolute; right: 28px; bottom: 22px; z-index: 2;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em;
  color: var(--ink-3); text-transform: uppercase;
}

/* -------------------------------------------------------------- sections */
section { position: relative; z-index: 2; padding: 72px 28px; }
.section-head { max-width: var(--w); margin: 0 auto 36px; }
.section-head h2 {
  font-family: var(--serif); font-size: clamp(1.7rem, 3.4vw, 2.5rem);
  font-weight: 600; letter-spacing: -.022em; margin: 0 0 12px; line-height: 1.08;
}
.section-head p { max-width: 660px; color: var(--ink-2); margin: 0; font-size: 16px; }

.strata { background: var(--bg-2); border-block: 1px solid var(--line-soft); }

.legend { max-width: var(--w); margin: 0 auto 20px; display: flex; flex-wrap: wrap; gap: 8px 18px; }
.legend span { display: inline-flex; align-items: center; gap: 7px; font-family: var(--mono); font-size: 11px; color: var(--ink-3); }
.legend i { width: 12px; height: 12px; border-radius: 2px; display: inline-block; }

/* the core column: each row is one idea, thickness = effort */
.column { max-width: var(--w); margin: 0 auto; border: 1px solid var(--line); border-radius: 3px; overflow: hidden; }
.band {
  display: grid; grid-template-columns: 6px 1fr auto; align-items: center;
  gap: 14px; padding: 0 16px 0 0;
  border-bottom: 1px solid var(--line-soft);
  text-decoration: none; color: inherit;
  background: var(--bg-3);
  transition: background .16s, padding-left .16s;
}
.band:last-child { border-bottom: 0; }
.band:hover { background: color-mix(in srgb, var(--accent) 9%, var(--bg-3)); }
.band .swatch { height: 100%; }
.band .band-body { padding: 13px 0; min-width: 0; }
.band .band-title { font-weight: 500; font-size: 15px; letter-spacing: -.01em; }
.band .band-verdict { font-size: 13.5px; color: var(--ink-2); margin-top: 3px; }
.band .band-meta { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.tag {
  font-family: var(--mono); font-size: 10px; letter-spacing: .06em;
  padding: 3px 7px; border-radius: 2px; border: 1px solid var(--line);
  color: var(--ink-3); white-space: nowrap; text-transform: uppercase;
}

/* --------------------------------------------------------------- mechanics */
.mech-grid { max-width: var(--w); margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(248px, 1fr)); gap: 1px; background: var(--line-soft); border: 1px solid var(--line-soft); }
.mech {
  background: var(--bg); padding: 20px 18px;
  display: flex; flex-direction: column; gap: 7px;
  transition: background .16s;
}
.mech:hover { background: var(--bg-2); }
.mech b { font-family: var(--mono); font-size: 12.5px; font-weight: 600; color: var(--accent); letter-spacing: -.01em; }
.mech p { margin: 0; font-size: 13.5px; color: var(--ink-2); line-height: 1.5; }
.mech .n { margin-top: auto; padding-top: 8px; font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); letter-spacing: .08em; text-transform: uppercase; }

/* ---------------------------------------------------------------- catalog */
.catalog { background: var(--bg-2); border-block: 1px solid var(--line-soft); }
.filters { max-width: var(--w); margin: 0 auto 18px; display: flex; flex-direction: column; gap: 12px; }
#q {
  width: 100%; padding: 12px 15px; font-size: 15px; font-family: var(--sans);
  background: var(--bg); border: 1px solid var(--line); border-radius: 2px; color: var(--ink);
}
#q:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  font-family: var(--mono); font-size: 11px; letter-spacing: .04em;
  padding: 5px 11px; border-radius: 2px; cursor: pointer;
  border: 1px solid var(--line); background: transparent; color: var(--ink-2);
  transition: border-color .14s, color .14s, background .14s;
}
.chip:hover { color: var(--ink); border-color: var(--ink-3); }
.chip[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.chip .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.chip.clear { color: var(--ink-3); align-self: flex-start; }
.result-count { max-width: var(--w); margin: 0 auto 16px; font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); letter-spacing: .08em; text-transform: uppercase; }

.cards { max-width: var(--w); margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 16px; }
.card {
  display: flex; flex-direction: column; gap: 10px;
  padding: 20px; text-decoration: none; color: inherit;
  background: var(--bg); border: 1px solid var(--line); border-radius: 3px;
  border-top: 3px solid var(--oc, var(--line));
  transition: transform .16s, border-color .16s, box-shadow .16s;
}
.card:hover { transform: translateY(-2px); border-color: var(--line); box-shadow: 0 10px 30px -12px rgba(0,0,0,.6); }
.card .card-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.card .outcome { font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--oc); }
.card .effort { font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); }
.card h3 { margin: 0; font-family: var(--serif); font-size: 19px; font-weight: 600; line-height: 1.22; letter-spacing: -.018em; }
.card .verdict { margin: 0; font-size: 14px; color: var(--ink-2); line-height: 1.55; }
.card .card-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: auto; padding-top: 4px; }

/* ------------------------------------------------------------------ open */
.questions { max-width: var(--w); margin: 0 auto; display: grid; gap: 14px; }
.question {
  padding: 22px 24px; border: 1px solid var(--line); border-radius: 3px;
  background: var(--bg-2);
  border-left: 3px solid var(--inconclusive);
}
.question h3 { margin: 0 0 8px; font-family: var(--serif); font-size: 20px; font-weight: 600; letter-spacing: -.018em; }
.question h3 a { text-decoration: none; }
.question h3 a:hover { color: var(--accent); }
.question p { margin: 0 0 12px; color: var(--ink-2); font-size: 14.5px; }
.question .settle {
  font-size: 14.5px; padding: 12px 14px; border-radius: 2px;
  background: var(--bg); border: 1px dashed var(--line);
}
.question .settle b { font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--inconclusive); display: block; margin-bottom: 5px; }

/* ----------------------------------------------------------------- board */
.board { background: var(--bg-2); border-top: 1px solid var(--line-soft); }
.board-rows { max-width: var(--w); margin: 0 auto; display: grid; gap: 6px; }
.brow {
  display: grid; grid-template-columns: 34px 1fr auto; gap: 14px; align-items: center;
  padding: 13px 16px; background: var(--bg); border: 1px solid var(--line); border-radius: 3px;
  text-decoration: none; color: inherit;
}
.brow:hover { border-color: var(--accent); }
.brow .rank { font-family: var(--serif); font-size: 20px; color: var(--ink-3); text-align: right; }
.brow .bt { font-size: 14.5px; font-weight: 500; letter-spacing: -.01em; }
.brow .bars { display: flex; gap: 2px; margin-top: 6px; height: 5px; border-radius: 3px; overflow: hidden; max-width: 320px; }
.brow .bars i { display: block; height: 100%; }
.brow .total { font-family: var(--serif); font-size: 22px; font-weight: 600; }
.brow .parts { font-family: var(--mono); font-size: 10px; color: var(--ink-3); letter-spacing: .06em; margin-top: 5px; }

/* ---------------------------------------------------------------- footer */
footer { padding: 56px 28px 40px; border-top: 1px solid var(--line); background: var(--bg); position: relative; z-index: 2; }
.foot-grid { max-width: var(--w); margin: 0 auto 34px; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 32px; }
.foot-grid h3 { font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin: 0 0 10px; }
.foot-grid p { margin: 0 0 12px; font-size: 14px; color: var(--ink-2); }
.foot-grid a { display: block; font-size: 14px; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line); padding: 6px 0; }
.foot-grid a:hover { color: var(--accent); border-color: var(--accent); }
.colophon { max-width: var(--w); margin: 0 auto; font-size: 13px; color: var(--ink-3); }
.colophon a { color: var(--ink-2); }

/* ------------------------------------------------------------ responsive */
@media (max-width: 820px) {
  .topbar { padding: 12px 16px; }
  .topbar nav { gap: 14px; }
  .topbar nav a:not(.ghost) { display: none; }
  section, .hero, footer { padding-left: 16px; padding-right: 16px; }
  .hero { min-height: auto; padding-top: 56px; }
  .hero-hint { display: none; }
  .band { grid-template-columns: 5px 1fr; padding-right: 12px; }
  .band .band-meta { display: none; }
  .counts { gap: 20px; }
  .brow { grid-template-columns: 26px 1fr auto; padding: 11px 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .card, .btn, .band { transition: none; }
}
