/* The public side of brandonkessinger.com.
   The dashboard at /dashboard is deliberately NOT styled from this file: it is
   private, it predates the brand, and its GitHub-dark palette is tuned for
   reading numbers on a phone at 6am. Leave it alone. */

:root {
  --ground: #F4F2ED;
  --surface: #FFFFFF;
  --raised: #EAE7DF;
  --line: #DEDACF;
  --line-soft: #E9E5DC;
  --ink: #1A1815;
  --ink-2: #45403A;
  --muted: #6E6A5F;
  --accent: #855A18;
  --accent-soft: #F1E7D3;
  --shadow: 0 1px 2px rgba(26,24,21,.05), 0 8px 24px -14px rgba(26,24,21,.25);

  --grid-dot: rgba(26,24,21,.055);

  /* The rarity ladder. Stage is information, so it gets the colour budget:
     common grey for in build, rare blue for in beta, epic purple for in
     review, and the brand amber is legendary, reserved for live. */
  --tier-beta: #3E6E96;
  --tier-review: #7B5FA8;
  --ok: #5E7A34;

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;

  --measure: 68ch;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #131210;
    --surface: #1B1A16;
    --raised: #232119;
    --line: #302D25;
    --line-soft: #272419;
    --ink: #EDE9DF;
    --ink-2: #C4BFB1;
    --muted: #8C8779;
    --accent: #C79549;
    --accent-soft: #2B2415;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 10px 28px -16px rgba(0,0,0,.8);
    --grid-dot: rgba(237,233,223,.05);
    --tier-beta: #6FA3CC;
    --tier-review: #A98BD8;
    --ok: #9BB05F;
  }
}

:root[data-theme="dark"] {
  --ground: #131210;
  --surface: #1B1A16;
  --raised: #232119;
  --line: #302D25;
  --line-soft: #272419;
  --ink: #EDE9DF;
  --ink-2: #C4BFB1;
  --muted: #8C8779;
  --accent: #C79549;
  --accent-soft: #2B2415;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 10px 28px -16px rgba(0,0,0,.8);
  --grid-dot: rgba(237,233,223,.05);
  --tier-beta: #6FA3CC;
  --tier-review: #A98BD8;
  --ok: #9BB05F;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

/* The ground is a drafting table: a faint dot grid over the warm base, the
   register of graph paper under a technical drawing. Quiet enough to sit
   under body text, present enough that bare stretches of page never read
   as empty. */
body {
  margin: 0;
  background-color: var(--ground);
  background-image: radial-gradient(var(--grid-dot) 1px, transparent 1px);
  background-size: 26px 26px;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 940px;
  margin: 0 auto;
  padding: 0 1.5rem 6rem;
}

/* ---- masthead ---- */

.masthead {
  display: flex;
  align-items: baseline;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding: 1.75rem 0;
  border-bottom: 1px solid var(--line);
  margin-bottom: 3.5rem;
}

/* His name in the serif, like a signature on the corner of a drawing. */
.wordmark {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0;
  font-size: 1.28rem;
  color: var(--ink);
  text-decoration: none;
}

.masthead nav {
  display: flex;
  gap: 1.4rem;
  margin-left: auto;
  flex-wrap: wrap;
}

.masthead nav a {
  font-family: var(--mono);
  font-size: .76rem;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  padding: .2rem 0;
  border-bottom: 1px solid transparent;
}

.masthead nav a:hover,
.masthead nav a[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

/* ---- type ---- */

/* Display type is the serif; readouts are mono; body is quiet sans. The
   pairing is the whole personality: a library face over instrument panels.
   Instrument Serif only ships one weight, so scale does the hierarchy. */
h1 {
  font-family: var(--serif);
  font-size: clamp(2.4rem, 6vw, 3.5rem);
  line-height: 1.04;
  letter-spacing: -.01em;
  font-weight: 400;
  margin: 0;
  text-wrap: balance;
}

/* House style: the load-bearing word in a heading goes italic. */
h1 em, h2 em { font-style: italic; color: var(--accent); }

h2 {
  font-family: var(--serif);
  font-size: 1.62rem;
  letter-spacing: 0;
  font-weight: 400;
  margin: 0;
  text-wrap: balance;
}

h3 {
  font-size: 1rem;
  letter-spacing: -.012em;
  font-weight: 640;
  margin: 0;
}

p { margin: 0; max-width: var(--measure); }

a { color: var(--accent); text-underline-offset: 3px; }

.lede {
  font-size: 1.14rem;
  color: var(--ink-2);
  margin-top: 1.1rem;
  max-width: 58ch;
}

.eyebrow {
  font-family: var(--mono);
  font-size: .7rem;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--muted);
}

section {
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
  margin-bottom: 4.5rem;
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
  padding-bottom: .65rem;
  border-bottom: 1px solid var(--line);
}
.section-head .eyebrow { margin-left: auto; }

/* ---- cards ---- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  padding: 1.3rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: .6rem;
  box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease;
}

/* Picking an item up off the shelf. */
.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 2px 4px rgba(26,24,21,.06), 0 16px 32px -16px rgba(26,24,21,.32);
}

@media (prefers-reduced-motion: reduce) {
  .card { transition: none; }
  .card:hover { transform: none; }
}

.card p { font-size: .93rem; color: var(--ink-2); }

/* Tool names are code names, so they are set in the code face. */
.card-top h3 {
  font-family: var(--mono);
  font-size: .92rem;
  font-weight: 600;
  letter-spacing: -.01em;
}

.card-top {
  display: flex;
  align-items: baseline;
  gap: .7rem;
  flex-wrap: wrap;
}

.price {
  font-family: var(--mono);
  font-size: .8rem;
  color: var(--accent);
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}

.chip {
  display: inline-block;
  font-family: var(--mono);
  font-size: .64rem;
  letter-spacing: .09em;
  text-transform: uppercase;
  padding: .18rem .45rem;
  border-radius: 2px;
  background: var(--raised);
  color: var(--muted);
  white-space: nowrap;
}
.chip.free { background: var(--accent-soft); color: var(--accent); }

.card-links {
  display: flex;
  gap: 1.1rem;
  flex-wrap: wrap;
  margin-top: .25rem;
  font-family: var(--mono);
  font-size: .76rem;
  letter-spacing: .04em;
}

/* ---- shipped list ---- */

.ships { display: flex; flex-direction: column; gap: .5rem; }

.ship {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: .3rem .85rem;
  align-items: baseline;
  padding: .95rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 4px;
}

.ship .what { grid-column: 2 / -1; font-size: .9rem; color: var(--ink-2); }

/* The tier gem. One small badge in a fixed position carrying one variable,
   the way a card game marks rarity without touching the frame. Filled and
   glowing is reserved for live; glow is a scarce resource, so only the
   things that made it all the way out get any. */
.gem {
  width: 12px;
  height: 12px;
  transform: rotate(45deg);
  border: 1px solid var(--muted);
  border-radius: 2px;
  align-self: center;
}
/* A gem is a cut stone, so it gets a facet ramp and a specular edge, not a
   flat fill. The glow stays reserved for live; the hollow outline is
   deliberately flat because it reads as "not earned yet". */
.gem[data-tier="live"] {
  border-color: color-mix(in oklab, var(--accent) 75%, black);
  background: linear-gradient(135deg,
    color-mix(in oklab, var(--accent) 55%, white) 0%,
    var(--accent) 48%,
    color-mix(in oklab, var(--accent) 55%, black) 100%);
  box-shadow:
    inset 1px 1px 1px rgba(255,255,255,.4),
    0 0 8px color-mix(in oklab, var(--accent) 55%, transparent);
}
.gem[data-tier="beta"] {
  border-color: var(--tier-beta);
  background: linear-gradient(135deg,
    color-mix(in oklab, var(--tier-beta) 55%, white) 0%,
    var(--tier-beta) 30%,
    color-mix(in oklab, var(--tier-beta) 50%, black) 50%,
    transparent 50%);
}
.gem[data-tier="review"] {
  border-color: var(--tier-review);
  background: linear-gradient(135deg,
    color-mix(in oklab, var(--tier-review) 55%, white) 0%,
    var(--tier-review) 40%,
    color-mix(in oklab, var(--tier-review) 50%, black) 100%);
}

/* Tier chips, not bare text: the rarity ladder should read from across the
   room, the way a colored item border does in a stash tab. */
.ship-state {
  font-family: var(--mono);
  font-size: .66rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  padding: .2rem .55rem;
  border-radius: 2px;
  background: var(--raised);
  border: 1px solid var(--line);
}
.ship-state.live {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: color-mix(in oklab, var(--accent) 40%, transparent);
}
.ship-state.beta {
  color: var(--tier-beta);
  background: color-mix(in oklab, var(--tier-beta) 13%, transparent);
  border-color: color-mix(in oklab, var(--tier-beta) 45%, transparent);
}

/* ---- writing list ---- */

.posts { display: flex; flex-direction: column; gap: 0; }

.post {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 1.05rem .2rem;
  border-bottom: 1px solid var(--line-soft);
  text-decoration: none;
  color: inherit;
  flex-wrap: wrap;
}
.post:hover .post-title { color: var(--accent); }
.post-title { font-weight: 600; letter-spacing: -.012em; }
.post-date {
  font-family: var(--mono);
  font-size: .74rem;
  color: var(--muted);
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.post-note { flex-basis: 100%; font-size: .9rem; color: var(--muted); }

.empty {
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1.4rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: .7rem;
}

/* ---- footer ---- */

footer {
  border-top: 1px solid var(--line);
  padding-top: 1.5rem;
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: .76rem;
  letter-spacing: .04em;
  color: var(--muted);
}
footer a { color: var(--muted); text-decoration: none; }
footer a:hover { color: var(--ink); }
footer .sig { margin-left: auto; }

:where(a, button):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

@media (max-width: 560px) {
  .masthead { gap: .8rem; padding: 1.25rem 0; margin-bottom: 2.5rem; }
  .masthead nav { margin-left: 0; gap: 1.1rem; }
  .post-date { margin-left: 0; }
  section { margin-bottom: 3.25rem; }
}

/* ---- the bench ------------------------------------------------------- */

/* The stage commits to its own dark world in both themes. A workshop lit from
   above is the whole point, and a light-mode version of it is a different
   object. Everything inside is painted explicitly so it holds on either
   ground. */

.bench-stage {
  position: relative;
  height: 260px;
  border: 1px solid #2C2921;
  border-radius: 5px;
  overflow: hidden;
  background: #0F0E0C;
}

.bench-stage canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* Real buttons over the art: the canvas is decorative, these carry the
   semantics and the keyboard. They sit in the upper band so the objects
   underneath stay visible. */
.bench-items {
  position: relative;
  z-index: 1;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  height: 100%;
}

.bench-item {
  appearance: none;
  background: transparent;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: .2rem;
  padding: 0 .4rem .9rem;
  color: #8A8375;
  transition: color .2s ease;
}
.bench-item:hover,
.bench-item[aria-selected="true"] { color: #F3EFE4; }

.bi-name {
  font-size: .84rem;
  font-weight: 620;
  letter-spacing: -.01em;
  text-align: center;
  line-height: 1.2;
}
/* The stage is always dark, so these are painted literally rather than from
   theme tokens. Same rarity ladder as everywhere else. */
.bi-state {
  font-family: var(--mono);
  font-size: .66rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #9A9384;
}
.bi-state[data-state="live"] { color: #D9A552; }
.bi-state[data-state="in beta"] { color: #8FC1E8; }
.bi-state[data-state="in review"] { color: #C0A5EE; }

.bench-item:focus-visible {
  outline: 2px solid #C79549;
  outline-offset: -3px;
  border-radius: 3px;
}

/* The readout. Monospace and tabular because it is an instrument panel, and
   because these are numbers and states rather than prose. */
.bench-readout {
  --tick: color-mix(in oklab, var(--accent) 60%, transparent);
  margin-top: 1rem;
  background-color: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  padding: 1.25rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: .7rem;
  min-height: 190px;
  position: relative;
  /* Inspection brackets on all four corners, the way a game frames the item
     you are holding. Half-committed corners read as a decorative sidebar;
     four ticks read as an instrument. Painted as background strokes so no
     extra elements are needed. */
  background-image:
    linear-gradient(var(--tick), var(--tick)), linear-gradient(var(--tick), var(--tick)),
    linear-gradient(var(--tick), var(--tick)), linear-gradient(var(--tick), var(--tick)),
    linear-gradient(var(--tick), var(--tick)), linear-gradient(var(--tick), var(--tick)),
    linear-gradient(var(--tick), var(--tick)), linear-gradient(var(--tick), var(--tick));
  background-repeat: no-repeat;
  background-size:
    11px 1px, 1px 11px,
    11px 1px, 1px 11px,
    11px 1px, 1px 11px,
    11px 1px, 1px 11px;
  background-position:
    6px 6px, 6px 6px,
    calc(100% - 6px) 6px, calc(100% - 6px) 6px,
    6px calc(100% - 6px), 6px calc(100% - 6px),
    calc(100% - 6px) calc(100% - 6px), calc(100% - 6px) calc(100% - 6px);
}

.bench-r-head { display: flex; align-items: baseline; gap: .8rem; flex-wrap: wrap; }
.bench-r-head h3 { font-family: var(--serif); font-weight: 400; font-size: 1.5rem; }

.bench-chip {
  font-family: var(--mono);
  font-size: .62rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: .18rem .45rem;
  border-radius: 2px;
  background: var(--raised);
  color: var(--muted);
}
.bench-chip[data-state="live"] { background: var(--accent-soft); color: var(--accent); }
.bench-chip[data-state="in beta"] {
  background: color-mix(in oklab, var(--tier-beta) 14%, transparent);
  color: var(--tier-beta);
}
.bench-chip[data-state="in review"] {
  background: color-mix(in oklab, var(--tier-review) 14%, transparent);
  color: var(--tier-review);
}

.bench-kind {
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: -.35rem;
}
.bench-r-line { font-size: .95rem; color: var(--ink-2); }

.bench-stats {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: .6rem 1.4rem;
  align-items: start;
  border-top: 1px solid var(--line-soft);
  padding-top: .8rem;
}
.bench-stats > div { display: flex; align-items: baseline; gap: .6rem; }
.bench-stats dt {
  font-family: var(--mono);
  font-size: .64rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.bench-stats dd {
  margin: 0;
  font-family: var(--mono);
  font-size: .8rem;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.bench-go {
  font-family: var(--mono);
  font-size: .74rem;
  letter-spacing: .06em;
  margin-top: auto;
  padding-top: .5rem;
}
.bench-go.muted { color: var(--muted); }

@media (max-width: 640px) {
  .bench-stage { height: 220px; }
  .bi-name { font-size: .68rem; }
  .bi-state { display: none; }
}

/* Names of one and two words wrapped differently, so the labels under the
   bench sat on a ragged baseline. A fixed two-line box makes every slot
   align whether the name wraps or not. */
.bi-name {
  min-height: 2.4em;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

/* ---- spec strip ------------------------------------------------------ */

/* An instrument-panel nameplate under the hero. The rest of the page has
   depth and the hero had none; this gives it a readout without a decorative
   flourish, and every value is a fact. */

.specs {
  margin: 1.6rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
  background: var(--raised);
  max-width: var(--measure);
}

.specs > div {
  flex: 1 1 auto;
  min-width: 132px;
  padding: .7rem 1rem .75rem;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: .15rem;
}
.specs > div:last-child { border-right: 0; }

.specs dt {
  font-family: var(--mono);
  font-size: .6rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}
.specs dd {
  margin: 0;
  font-family: var(--mono);
  font-size: .95rem;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.01em;
}

/* The card grid sat flat on the page. A hairline of the accent along the top
   edge gives each card a lit lip, matching the lighting the bench establishes
   two sections below. */
.card { position: relative; }
.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  border-radius: 4px 4px 0 0;
  background: linear-gradient(90deg,
    color-mix(in oklab, var(--accent) 55%, transparent),
    color-mix(in oklab, var(--accent) 12%, transparent));
}

/* Queued posts are not links yet, so they should not invite a click. */
.post:not(a) { cursor: default; }
.post:not(a) .post-title { color: var(--ink-2); }

@media (max-width: 560px) {
  .specs > div { min-width: 50%; border-bottom: 1px solid var(--line); }
}

/* ---- queued posts ---------------------------------------------------- */

/* The writing page was the one surface using none of the site's own devices:
   no accent lip, no mono status, no depth. Next to the bench and the cost
   table it read like a different product. Queued posts now carry the same
   vocabulary, with a status tag that is honest about the post not existing
   yet. */

.posts { gap: .5rem; }

.post {
  padding: 1rem 1.15rem;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-left: 2px solid color-mix(in oklab, var(--accent) 40%, transparent);
  border-radius: 4px;
  align-items: flex-start;
  gap: .5rem .9rem;
}
.post:not(a):hover { border-left-color: var(--accent); }

.post-title { flex: 1 1 20ch; }

/* Not a link yet, so it gets a state rather than a date. */
.post-tag {
  font-family: var(--mono);
  font-size: .6rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--raised);
  padding: .18rem .42rem;
  border-radius: 2px;
  margin-left: auto;
  white-space: nowrap;
}
