/* ==========================================================================
   legendonthisone.com

   The frame is a terminal. The reading is not.

   Everything structural is monospace on a character grid, and colour is
   only ever functional: green passed, red refused, amber needs a human.
   Nothing decorative, no gradients, no glow, no rounded cards. But the
   prose inside a case is set in a proper reading face at a comfortable
   size, because a recruiter skimming this on a phone should not have to
   fight the aesthetic to find out what you built.
   ========================================================================== */

:root {
  /* Ground */
  --bg:        #0A0A0B;
  --panel:     #101012;
  --panel-2:   #16161A;
  --line:      #232327;
  --line-soft: #1A1A1E;

  /* Text */
  --text:      #D7D7DB;
  --dim:       #6E6E76;
  --bright:    #F4F4F6;

  /* Functional colour. These four mean something. Nothing else is coloured. */
  --ok:        #3FB950;   /* passed, allowed, done */
  --no:        #F85149;   /* refused, denied, absent */
  --warn:      #D29922;   /* the model, a human gate, in progress */
  --link:      #58A6FF;   /* somewhere else to go */

  --mono:      'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans:      'IBM Plex Sans', system-ui, -apple-system, sans-serif;

  --rail:      224px;
  --pad:       clamp(18px, 3.4vw, 40px);
  --ease:      cubic-bezier(.22, 1, .36, 1);
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 14px/1.7 var(--mono);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
::selection { background: var(--ok); color: var(--bg); }

:focus-visible { outline: 2px solid var(--ok); outline-offset: 2px; }

.skip {
  position: fixed; left: -9999px; top: 0; z-index: 100;
  background: var(--panel); color: var(--bright); padding: 12px 18px;
  border: 1px solid var(--line);
}
.skip:focus { left: 10px; top: 10px; }

/* --------------------------------------------------------------------------
   Shell
   -------------------------------------------------------------------------- */

.shell { display: grid; grid-template-columns: var(--rail) 1fr; min-height: 100vh; }

/* ---- Rail ---- */

.rail {
  border-right: 1px solid var(--line);
  position: sticky; top: 0; align-self: start;
  height: 100vh;
  display: flex; flex-direction: column;
  padding: 24px 0 18px;
}

.rail .who { padding: 0 18px 18px; border-bottom: 1px solid var(--line); }

.rail .who img {
  width: 36px; height: 36px; margin-bottom: 11px;
  filter: grayscale(1) contrast(1.06);
  border: 1px solid var(--line);
}

.rail .who b { display: block; color: var(--bright); font-weight: 500; font-size: 12.5px; }
.rail .who span { display: block; color: var(--dim); font-size: 11px; line-height: 1.6; margin-top: 4px; }

.rail nav { padding: 14px 0; overflow-y: auto; flex: 1; }

.rail nav .grp {
  padding: 12px 18px 5px;
  font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: #4A4A52;
}

.rail nav a {
  display: block; padding: 5px 18px;
  font-size: 12.5px; color: var(--dim);
  border-left: 2px solid transparent;
  transition: color 160ms var(--ease), background 160ms var(--ease);
}
.rail nav a::before { content: '  '; white-space: pre; }
.rail nav a:hover { color: var(--bright); background: var(--panel); }
.rail nav a[aria-current="page"] { color: var(--bright); border-left-color: var(--ok); background: var(--panel); }
.rail nav a[aria-current="page"]::before { content: '> '; color: var(--ok); }

.rail .foot {
  padding: 14px 18px 0; border-top: 1px solid var(--line);
  font-size: 11px; color: var(--dim); line-height: 1.65;
}
.rail .foot em { font-style: normal; color: var(--ok); }
.rail .foot a { color: var(--link); }

/* ---- Main ---- */

.main { min-width: 0; }

.blk { padding: 26px var(--pad); border-bottom: 1px solid var(--line); }

/* The command line that titles every block. This is the page's spine. */
.cmd { font-size: 12.5px; color: var(--dim); margin: 0; }
.cmd em { font-style: normal; color: var(--ok); }
.cmd b { color: var(--bright); font-weight: 400; }
.cmd i { font-style: normal; color: var(--dim); }

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

h1 {
  font: 500 clamp(21px, 3.3vw, 40px)/1.3 var(--mono);
  letter-spacing: -.02em;
  color: var(--bright);
  margin: 18px 0 0;
  max-width: 27ch;
}
h1 mark { background: none; color: var(--ok); }

.lede {
  margin: 14px 0 0; max-width: 74ch;
  font-size: 13.5px; color: var(--dim);
}

/* ---- The prompt ---- */

.prompt {
  margin-top: 26px; max-width: 860px;
  border: 1px solid var(--line); background: var(--panel);
}

.prompt form { display: flex; align-items: center; gap: 10px; padding: 0 14px; height: 56px; }
.prompt .q { color: var(--ok); flex: none; }

.prompt input {
  flex: 1; min-width: 0; height: 100%;
  background: none; border: 0; outline: none;
  color: var(--bright); font: inherit; font-size: 13.5px;
}
.prompt input::placeholder { color: var(--dim); }

.prompt button {
  flex: none; background: none; border: 1px solid var(--line); color: var(--dim);
  font: inherit; font-size: 11px; padding: 7px 11px; cursor: pointer;
  transition: color 160ms var(--ease), border-color 160ms var(--ease);
}
.prompt button:hover { color: var(--ok); border-color: var(--ok); }

.caret { width: 8px; height: 16px; background: var(--ok); display: inline-block; animation: bl 1.05s steps(1) infinite; }
@keyframes bl { 50% { opacity: 0; } }

.sug { display: flex; flex-wrap: wrap; border-top: 1px solid var(--line); }
.sug button {
  font: inherit; font-size: 12px; color: var(--dim);
  background: none; border: 0; border-right: 1px solid var(--line);
  padding: 10px 14px; cursor: pointer; text-align: left;
  transition: color 160ms var(--ease), background 160ms var(--ease);
}
.sug button:hover { color: var(--bright); background: var(--panel-2); }
.sug button[data-miss] { color: var(--warn); }

/* ---- The answer ---- */

.answer { margin-top: 16px; max-width: 860px; border: 1px solid var(--line); background: var(--panel); }
.answer .hd {
  padding: 8px 14px; border-bottom: 1px solid var(--line);
  font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--ok);
}
.answer[data-v="none"] .hd { color: var(--no); }
.answer[data-v="soon"] .hd { color: var(--warn); }
.answer .bd { padding: 14px; font-family: var(--sans); font-size: 14.5px; line-height: 1.7; color: #B9B9C0; }
.answer .bd p { margin: 0; }
.answer .go {
  display: block; padding: 10px 14px; border-top: 1px solid var(--line);
  font-size: 12px; color: var(--link);
}
.answer .go:hover { background: var(--panel-2); }
.answer .think { padding: 14px; color: var(--dim); font-size: 12.5px; }

/* --------------------------------------------------------------------------
   The directory listing. This is the project index and the navigation.
   -------------------------------------------------------------------------- */

.ls { width: 100%; border-collapse: collapse; margin-top: 14px; }

.ls tr { cursor: pointer; }
.ls td { padding: 12px 0; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.ls tr:hover td { background: var(--panel); }
.ls tr:hover .nm { color: var(--ok); }

.ls .nm {
  color: var(--bright); width: 1%; white-space: nowrap;
  padding-right: 30px; padding-left: 10px; font-size: 13px;
  transition: color 160ms var(--ease);
}
.ls .nm::before { content: './'; color: var(--dim); }

.ls .ds { color: var(--dim); font-size: 12.5px; padding-right: 24px; }
.ls .sz { color: #4A4A52; text-align: right; white-space: nowrap; font-size: 11px; width: 1%; padding-right: 10px; }

/* --------------------------------------------------------------------------
   A case. Reached by clicking a row, or by its own URL.
   -------------------------------------------------------------------------- */

.js .view { display: none; }
.js .view.on { display: block; }

.case-hd { padding: 26px var(--pad) 0; }

.case-hd h2 {
  font: 500 clamp(19px, 2.8vw, 30px)/1.3 var(--mono);
  letter-spacing: -.02em; color: var(--bright); margin: 16px 0 0;
}
.case-hd .meta { color: var(--dim); font-size: 12px; margin: 6px 0 0; }

.back {
  display: inline-block; margin-top: 22px;
  font-size: 12.5px; color: var(--dim);
}
.back:hover { color: var(--ok); }
.back::before { content: '$ '; color: var(--ok); }

/* Prose. The one place the terminal steps aside. */
.prose {
  font-family: var(--sans);
  font-size: 15.5px; line-height: 1.75; color: #B9B9C0;
  max-width: 74ch; margin-top: 20px;
}
.prose p { margin: 0 0 1.05em; }
.prose p:last-child { margin-bottom: 0; }
.prose em { color: var(--bright); font-style: italic; }
.prose strong { color: var(--bright); font-weight: 600; }

/* --------------------------------------------------------------------------
   Architecture. Boxes on a character grid, so a running scenario has
   something to light up. Square corners, hairlines, functional colour.
   -------------------------------------------------------------------------- */

.arch {
  display: flex; align-items: stretch; margin-top: 22px;
  border: 1px solid var(--line); background: var(--panel);
  padding: 14px;
}

.nd {
  flex: 1 1 0; min-width: 0; padding: 13px 12px;
  border: 1px solid var(--line);
  background: var(--bg);
  transition: background 260ms var(--ease), border-color 260ms var(--ease);
}

.nd .k { display: block; font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); margin-bottom: 7px; }
.nd .t { display: block; font-size: 13px; color: var(--bright); line-height: 1.3; margin-bottom: 5px; }
.nd .d { display: block; font-size: 11.5px; line-height: 1.45; color: var(--dim); }

.nd[data-k="code"]  .k { color: var(--ok); }
.nd[data-k="model"] .k { color: var(--warn); }
.nd[data-k="model"] { background: #131109; }
.nd[data-k="human"] .k { color: var(--warn); }

/* Connector: a hairline with a functional pulse travelling it. No gradient. */
.wire { flex: 0 0 auto; align-self: center; width: clamp(14px, 2.2vw, 30px); height: 2px; background: #33333B; position: relative; overflow: hidden; }
.wire::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, var(--ok), transparent);
  background-size: 60% 100%; background-repeat: no-repeat; background-position: -70% 0;
  opacity: 0;
}
.arch.live .wire::after, .wire.on::after { opacity: 1; animation: wx 1.2s linear infinite; }
@keyframes wx { from { background-position: -70% 0; } to { background-position: 170% 0; } }

/* Simulation states */
.nd.act  { background: var(--panel-2); border-color: #2E4A33; }
.nd.act .t { color: var(--ok); }
.nd.deny { background: #1B1011; border-color: #4A2A2C; }
.nd.deny .t { color: var(--no); }
.nd.fin  { border-color: #2E4A33; }

.arch-note { margin-top: 11px; font-size: 11.5px; color: var(--dim); line-height: 1.7; }
.arch-note b { color: var(--ok); font-weight: 400; }
.arch-note i { color: var(--warn); font-style: normal; }

/* --------------------------------------------------------------------------
   Decisions. The part a case view exists for.
   -------------------------------------------------------------------------- */

.dec { margin-top: 26px; border-top: 1px solid var(--line); }

.dec .row { display: grid; grid-template-columns: 190px 1fr; gap: 22px; padding: 16px 0; border-bottom: 1px solid var(--line-soft); }
.dec .row .h { font-size: 12.5px; color: var(--bright); line-height: 1.5; }
.dec .row .b { font-family: var(--sans); font-size: 14.5px; line-height: 1.7; color: #A8A8B0; max-width: 68ch; }
.dec .row .b em { color: var(--bright); font-style: italic; }

/* --------------------------------------------------------------------------
   Results, as key value output
   -------------------------------------------------------------------------- */

.kv { margin-top: 24px; border: 1px solid var(--line); background: var(--panel); padding: 12px 14px; }
.kv div { display: flex; justify-content: space-between; gap: 20px; padding: 5px 0; border-bottom: 1px dotted #1E1E22; }
.kv div:last-child { border-bottom: 0; }
.kv span { color: var(--dim); font-size: 12.5px; }
.kv b { font-weight: 500; font-size: 13px; color: var(--ok); font-variant-numeric: tabular-nums; }
.kv b.plain { color: var(--text); }

/* Stack line and links */
.stack { margin-top: 20px; font-size: 12px; color: var(--dim); line-height: 1.9; }
.stack em { font-style: normal; color: var(--text); }

.out { display: inline-flex; align-items: center; gap: 8px; margin-top: 18px; margin-right: 22px; font-size: 12.5px; color: var(--link); }
.out:hover { text-decoration: underline; }
.out.none { color: var(--dim); }

/* --------------------------------------------------------------------------
   Simulation controls
   -------------------------------------------------------------------------- */

.runs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.run {
  font: inherit; font-size: 12px; color: var(--text);
  background: var(--panel); border: 1px solid var(--line);
  padding: 10px 13px; cursor: pointer;
  transition: color 160ms var(--ease), border-color 160ms var(--ease);
}
.run:hover:not(:disabled) { color: var(--ok); border-color: var(--ok); }
.run[data-tone="deny"]:hover:not(:disabled) { color: var(--no); border-color: var(--no); }
.run:disabled { opacity: .4; cursor: default; }

.term { margin-top: 16px; border: 1px solid var(--line); background: #050506; }
.term .bar {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 9px 13px; border-bottom: 1px solid var(--line);
  font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--dim);
}
.term .bar .dot { width: 6px; height: 6px; background: var(--dim); display: inline-block; margin-right: 8px; vertical-align: middle; }
.term.busy .bar .dot { background: var(--ok); }
.term pre {
  margin: 0; padding: 13px; font: 400 12px/1.85 var(--mono);
  color: var(--text); max-height: 240px; overflow-y: auto; white-space: pre-wrap; word-break: break-word;
}
.term .ln { display: block; }
.term .ts { color: #45454C; }
.term .ok { color: var(--ok); }
.term .no { color: var(--no); }
.term .wn { color: var(--warn); }
.term .idle { color: var(--dim); }

/* --------------------------------------------------------------------------
   Learning track and closing
   -------------------------------------------------------------------------- */

.track { margin-top: 14px; border: 1px solid var(--line); background: var(--panel); }
.track div { display: flex; align-items: baseline; gap: 14px; padding: 10px 14px; border-bottom: 1px solid var(--line-soft); font-size: 12.5px; }
.track div:last-child { border-bottom: 0; }
.track .s { color: var(--warn); width: 108px; flex: none; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.track .n { color: var(--bright); }
.track .w { color: var(--dim); margin-left: auto; font-size: 11.5px; }

.cols { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,320px); gap: clamp(24px,4vw,52px); align-items: start; }

.card { border: 1px solid var(--line); background: var(--panel); }
.card .hd { padding: 9px 14px; border-bottom: 1px solid var(--line); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); }
.card a.li { display: flex; justify-content: space-between; gap: 14px; padding: 11px 14px; border-bottom: 1px solid var(--line-soft); font-size: 12.5px; }
.card a.li:last-child { border-bottom: 0; }
.card a.li span { color: var(--dim); }
.card a.li b { font-weight: 400; color: var(--text); }
.card a.li:hover { background: var(--panel-2); }
.card a.li:hover b { color: var(--ok); }

.chipset { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.chipset span { font-size: 11px; color: var(--dim); border: 1px solid var(--line); padding: 6px 8px; }

/* --------------------------------------------------------------------------
   Small screens
   -------------------------------------------------------------------------- */

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .rail { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .rail nav { display: flex; flex-wrap: wrap; gap: 0 4px; padding: 10px 12px; }
  .rail nav .grp { display: none; }
  .rail nav a { padding: 6px 8px; border-left: 0; }
  .rail nav a[aria-current="page"] { border-left: 0; text-decoration: underline; text-underline-offset: 4px; }
  .rail .foot { padding-top: 12px; }

  /* The architecture folds. Boxes stay boxes so scenarios can still
     light them; only the axis changes. */
  .arch { flex-direction: column; }
  .wire { width: 2px; height: 18px; align-self: center; }
  .wire::after { background: linear-gradient(180deg, transparent, var(--ok), transparent); background-size: 100% 60%; background-position: 0 -70%; }
  .arch.live .wire::after, .wire.on::after { animation: wy 1.2s linear infinite; }

  .dec .row { grid-template-columns: 1fr; gap: 6px; }
  .cols { grid-template-columns: 1fr; }
}

@keyframes wy { from { background-position: 0 -70%; } to { background-position: 0 170%; } }

@media (max-width: 900px) {
  .ls, .ls tbody, .ls tr, .ls td { display: block; width: auto; }
  .ls tr { border-bottom: 1px solid var(--line-soft); padding: 11px 0; }
  .ls td { border: 0; padding: 2px 0; }
  .ls .nm { white-space: normal; padding: 0; }
  .ls .ds { padding-right: 0; }
  .ls .sz { text-align: left; padding: 4px 0 0; }
  .sug button { border-right: 0; border-bottom: 1px solid var(--line); width: 100%; }
  .track div { flex-wrap: wrap; }
  .track .w { margin-left: 0; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .caret { animation: none; }
  .arch.live .wire::after, .wire.on::after { animation: none; opacity: 1; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Certification badges. Desaturated so they sit inside the console frame
   rather than shouting over it, and full colour on hover for anyone who
   actually wants to look at one. */
.badges { display: flex; gap: 14px; flex-wrap: wrap; margin: 14px 0 4px; }

.badges img {
  width: 54px; height: 54px;
  filter: grayscale(1) opacity(.6);
  transition: filter 220ms var(--ease);
}
.badges img:hover { filter: none; }
