/* ============================================================
   portfolio.eddiequinn.xyz — site-specific stylesheet
   ------------------------------------------------------------
   Direction: Weyland-Yutani chrome. Engineered sans, clinical
   dark, hazard amber as the working accent. The red // mark is
   the launcher handshake and appears in the header ONLY.

   This file is the site-specific layer of the relic design
   system. The shared base (reset, dark theme tokens, page
   frame, footer) lives in /shared/base.css. The shared header
   (// mark, name, handle, subhead, nav, glitch) lives in
   /shared/header.css. This file overrides only what makes
   the portfolio distinct.

   Restraint rules:
     - amber accent, max 4 uses:
         1. interactive hover/focus
         2. section rule + label tick
         3. project date / metadata highlights
         4. inline code
     - red is reserved for the // brand mark. Nowhere else.
     - no gradients, no glow, no ornament
     - one animation: caret blink.
   ============================================================ */

:root {
  /* site accent — overrides whatever base might declare */
  --accent:     #E8A200;   /* hazard amber — the working signal + the // mark */

  /* type — these names are owned by this site. Other sites may
     redefine them but they won't conflict because the shared
     header.css never references them; each site overrides
     font-family on .identity h1 / .handle / .subhead directly. */
  --display: "Saira SemiCondensed", "Arial Narrow", sans-serif;
  --label:   "Michroma", monospace;
  --sans:    "IBM Plex Sans", -apple-system, "Segoe UI", sans-serif;
  --mono:    "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* one chamfer, top-right — the Nostromo panel cue */
  --chamfer: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%);

  /* height of the graph-page header band — set by JS to match the
     actual rendered height, used to position the full-width hairline */
  --graph-head-height: 11rem;
}

html { scrollbar-gutter: stable; }

/* ---------- graph page overrides ----------
   graph.html is standalone: no .page wrapper, no footer. The header
   is absolutely positioned over the full-viewport graph canvas. */
body:has(.graph-head) {
  overflow: hidden;
}
.graph-head {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  /* Solid band — anything below it on the canvas is hidden by this block.
     The full-width hairline below lives in a separate fixed bar
     (.graph-head-rule) so it spans the entire viewport edge-to-edge,
     not just the centred header width. */
  background: var(--bg);
  border-bottom: none;
  /* Match .page rhythm on other pages. Same padding, same horizontal
     width — only position:fixed differs. */
  padding: clamp(2.5rem, 8vh, 5rem) var(--gutter) 4rem;
  width: 100%;
  max-width: calc(var(--measure) + var(--gutter) * 2);
}
/* Full-width hairline under the header — spans the viewport edge to
   edge so a node drifted left of the centred header is still visually
   contained. Sits between the header (z=100) and the canvas. */
.graph-head-rule {
  position: fixed;
  top: var(--graph-head-height, 10rem);
  left: 0;
  right: 0;
  height: 1px;
  background: var(--hairline);
  z-index: 99;
}
/* Match the shared .site-nav rhythm (margin + padding + border) so the
   nav lands at the same vertical position as on every other page. */
.graph-head .site-nav {
  margin-bottom: 0;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--hairline);
}

/* Bottom separator — solid band matching the header so nothing can
   render below the visible graph area. */
.graph-foot {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3.5rem;
  background: var(--bg);
  border-top: 1px solid var(--hairline);
  z-index: 40;
  /* Sits behind the legend so the legend can overlap the top edge */
}

#graph-viewport {
  position: fixed;
  top: var(--graph-head-height, 11rem);
  left: 0;
  right: 0;
  bottom: 3.5rem;
  background: var(--bg);
  overflow: hidden;
}
#graph-canvas {
  width: 100%;
  height: 100%;
}
#graph-canvas, #graph-canvas > svg { width: 100%; height: 100%; }
#graph-canvas > svg { display: block; overflow: hidden; }
.graph-empty,
.graph-error {
  color: var(--ink-faint);
  font-family: var(--mono);
  font-size: 0.875rem;
  text-align: center;
  margin: 0;
  padding: 2rem;
}

/* ---------- graph nodes & edges ---------- */
.graph-node { cursor: pointer; }
.graph-node .node-box {
  fill: var(--panel);
  stroke: var(--ink-faint);
  stroke-width: 1;
  transition: stroke 120ms ease, stroke-width 120ms ease;
}
.graph-node[data-status="live"] .node-box,
.graph-node[data-status="ongoing"] .node-box,
.graph-node[data-status="perpetual"] .node-box { stroke: var(--accent); }
.graph-node .node-id {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.1em;
  text-transform: lowercase;
  fill: var(--accent);
  pointer-events: none;
}
.graph-node .node-label {
  font-family: var(--display);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  fill: var(--ink-bright);
  pointer-events: none;
}
.graph-node .node-year {
  font-family: var(--mono);
  font-size: 7px;
  fill: var(--ink-faint);
  pointer-events: none;
}
.graph-node .node-tags { pointer-events: none; }
.graph-node .node-tag  { pointer-events: none; }
.graph-edge {
  stroke: #4A5260; /* slightly brighter than --hairline so edges read
                       clearly against the dark bg */
  stroke-width: 1;
  transition: stroke 120ms ease, stroke-width 120ms ease;
}

.graph-node.active .node-box,
.graph-node:hover .node-box {
  stroke: var(--accent);
  stroke-width: 1.5;
}
.graph-edge.active,
.graph-edge:hover {
  stroke: var(--accent);
  stroke-width: 2;
}
.graph-node.dim .node-box { stroke: var(--hairline); }
.graph-node.dim .node-id { fill: var(--ink-faint); }
.graph-node.dim .node-label { fill: var(--ink); }
.graph-node.dim .node-year { fill: var(--ink-faint); }
.graph-edge.dim { stroke: var(--hairline); }

/* small screens: tighten graph header */
@media (max-width: 44rem) {
  .graph-head { padding-top: 1.5rem; }
}

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  .graph-node .node-box,
  .graph-edge { transition: none !important; }
}

/* ---------- site body typography ---------- */
body {
  font-family: var(--sans);
}

/* ---------- shared header — font family overrides ----------
   The shared header.css declares layout, colour, and the // mark.
   This file assigns the type family. Header layout MUST stay
   identical to shared/header.css — only font-family overrides here. */
.identity h1 { font-family: var(--display); }
.identity h1 .handle { font-family: var(--mono); }
.identity .subhead { font-family: var(--mono); }
.site-nav { font-family: var(--label); }

/* ---------- site-specific link hover ----------
   The shared base sets `a { color: inherit }`. Each site picks
   its own accent for hover. Portfolio: amber. */
a:hover { color: var(--accent); }

/* ---------- section chrome ---------- */
.section-label {
  font-family: var(--label);
  font-size: 0.625rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 1rem;
  display: flex;
  align-items: center;
  gap: 0.9rem;
}
.section-label::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--hairline);
}
.section-label .tick { color: var(--accent); }            /* amber use #2 */

/* ---------- homepage ---------- */
.lede {
  font-family: var(--sans);
  font-size: clamp(1.25rem, 2.4vw, 1.5rem);
  font-weight: 400;
  line-height: 1.45;
  color: var(--ink-bright);
  max-width: 30em;
  margin: 0 0 3.5rem;
  text-wrap: pretty;
}
.lede em { font-style: normal; color: var(--ink); }

.project-list { list-style: none; margin: 0 0 3rem; padding: 0; }
.project-list li {
  display: grid;
  grid-template-columns: 5.5rem 1fr auto;
  gap: 0.4rem 1.75rem;
  align-items: baseline;
  padding: 1.35rem 0;
  border-bottom: 1px solid var(--hairline);
}
.project-list li:first-child { border-top: 1px solid var(--hairline); }
.project-id {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--ink-faint);
  letter-spacing: 0.05em;
}
.project-title {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.125rem;
  letter-spacing: 0.02em;
  color: var(--ink-bright);
  margin: 0;
}
.project-title a:hover { color: var(--accent); }
.project-desc {
  grid-column: 2;
  margin: 0.3rem 0 0;
  color: var(--ink);
  font-size: 0.9375rem;
  max-width: 34em;
}
.project-side {
  grid-row: 1 / span 2;
  grid-column: 3;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
}
.project-date {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--accent);                                     /* amber use #3 */
  letter-spacing: 0.05em;
}

/* status chip — bordered, never filled */
.status-chip {
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border: 1px solid var(--ink-faint);
  color: var(--ink-faint);
  white-space: nowrap;
}
.status-chip.live      { border-color: var(--accent); color: var(--accent); }
.status-chip.ongoing   { border-color: var(--accent); color: var(--accent); }
.status-chip.perpetual { border-color: var(--accent); color: var(--accent); }
/* finished and plain (work-scope) chips stay hairline-faint: the
   lifecycle is over, the record stands. */
.status-chip.finished,
.status-chip.work      { border-color: var(--hairline); color: var(--ink-faint); }
.status-chip.abandoned{
  border-color: var(--hairline);
  color: var(--ink-faint);
  text-decoration: line-through;
  text-decoration-color: var(--ink-faint);
}

/* ---------- article pages ---------- */
.article-head { margin-bottom: 2.5rem; }
.article-kicker {
  font-family: var(--label);
  font-size: 0.625rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 1rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}

/* AI-assisted draft disclosure chip.
   Sits inline with the kicker on the dossier header. Closed by
   default; <details>/<summary> gives keyboard + tap + click on the
   same element with no JS. Hover opens it too, so the behaviour
   matches the user's mental model of "hover for a bubble" without
   requiring JS. The panel opens downward and stays above subsequent
   prose (position:absolute on the bubble keeps it out of the flow). */
.article-kicker .ai-tag {
  letter-spacing: 0.18em;
  font-size: 0.625rem;
}
.article-kicker .ai-tag details {
  position: relative;
}
.article-kicker .ai-tag summary {
  list-style: none;
  cursor: pointer;
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border: 1px solid var(--hairline);
  color: var(--ink-faint);
  white-space: nowrap;
  transition: none;
}
.article-kicker .ai-tag summary::-webkit-details-marker { display: none; }
/* Inline marker for the chip - a small leading glyph that's
   readable on dark bg without competing with the accent colour. */
.article-kicker .ai-tag summary::before {
  content: "*";
  margin-right: 0.45em;
  color: var(--ink-faint);
}
.article-kicker .ai-tag summary:hover,
.article-kicker .ai-tag details[open] > summary {
  color: var(--ink);
  border-color: var(--ink-faint);
}
/* Disclosure bubble - sits below the chip, above the prose. The
   max-width keeps it from sprawling on wide viewports; the hairline
   border + panel bg match the rest of the design system. */
.article-kicker .ai-tag details > p {
  position: absolute;
  top: calc(100% + 0.4rem);
  left: 0;
  z-index: 10;
  margin: 0;
  padding: 0.7rem 0.9rem;
  width: max-content;
  max-width: min(28rem, 80vw);
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink);
  background: var(--panel, var(--bg));
  border: 1px solid var(--hairline);
  line-height: 1.5;
}
/* Mobile: stack the chip under the kicker label rather than beside
   it, so the disclosure still opens above the title cleanly. */
@media (max-width: 480px) {
  .article-kicker .ai-tag details > p {
    left: 0;
    right: auto;
  }
}
.article-title {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.5rem, 3.2vw, 2rem);
  letter-spacing: 0.02em;
  line-height: 1.15;
  color: var(--ink-bright);
  margin: 0;
  text-wrap: balance;
}

/* spec block — the WY register: label everything */
.spec-block {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 1px;
  background: var(--hairline);
  border: 1px solid var(--hairline);
  margin: 2rem 0 3rem;
  clip-path: var(--chamfer);
}
.spec-block .cell {
  background: var(--bg);
  padding: 0.8rem 1rem;
}
.spec-block .k {
  font-family: var(--label);
  font-size: 0.5625rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 0.35rem;
}
.spec-block .v {
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--ink);
  margin: 0;
  /* Long mono values (repo paths, stack lists) must wrap inside the
     chamfered cell, not overflow it. anywhere lets the break fall
     between any two characters of an unbroken string. */
  overflow-wrap: anywhere;
  word-break: break-word;
}
.spec-block .v.amber { color: var(--accent); }

/* /work/ closing note under the featured list */
.work-note {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--ink-faint);
  margin: 2.5rem 0 0;
}
.work-note a { color: var(--ink); }

/* prose */
.prose h2 {
  font-family: var(--label);
  font-size: 0.625rem;
  font-weight: 400;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 3rem 0 1rem;
  display: flex;
  align-items: center;
  gap: 0.9rem;
}
.prose h2::after { content: ""; flex: 1; border-top: 1px solid var(--hairline); }
.prose p { margin: 0 0 1.35rem; max-width: var(--measure); text-wrap: pretty; }
.prose ul { margin: 0 0 1.35rem; padding-left: 1.25rem; }
.prose li { margin-bottom: 0.4rem; }
.prose strong { color: var(--ink-bright); font-weight: 600; }
.prose em { font-style: italic; }

.prose code {
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--accent);                                     /* amber use #4 */
}
.prose pre {
  font-family: var(--mono);
  font-size: 0.8125rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--hairline);
  padding: 1.1rem 1.25rem;
  overflow-x: auto;
  margin: 0 0 1.75rem;
  clip-path: var(--chamfer);
}
.prose pre code { color: inherit; }

.prose figure { margin: 2.5rem 0; }
.prose figcaption, .fig-caption {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-top: 0.85rem;
}
.fig-caption .fig-id { color: var(--accent); }

.back-link {
  display: inline-block;
  margin-top: 3.5rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  color: var(--ink-faint);
}
.back-link:hover { color: var(--accent); }

/* ---------- network diagram ---------- */
.net-diagram {
  margin: 0 0 3rem;
  padding: 1.5rem;
  background: var(--panel);
  border: 1px solid var(--hairline);
  clip-path: var(--chamfer);
}
.net-diagram .node-box {
  fill: var(--bg);
  stroke: var(--ink-faint);
  stroke-width: 1;
  transition: stroke 120ms ease;
}
.net-diagram .node-label {
  font-family: var(--display);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  fill: var(--ink-bright);
}
.net-diagram .node-sub {
  font-family: var(--mono);
  font-size: 9px;
  fill: var(--ink-faint);
  letter-spacing: 0.04em;
}
.net-diagram .node-id {
  font-family: var(--mono);
  font-size: 8px;
  fill: var(--accent);
  letter-spacing: 0.1em;
}
.net-diagram .edge { stroke: var(--hairline); stroke-width: 1; fill: none; transition: stroke 120ms ease; }
.net-diagram .edge-label {
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.06em;
  fill: var(--ink-faint);
  opacity: 0;
  transition: opacity 120ms ease;
}
.net-diagram g.node:hover .node-box { stroke: var(--accent); stroke-width: 1.5; }
.net-diagram g.node:hover .node-id { fill: var(--accent); }
.net-diagram g.edgegroup:hover .edge { stroke: var(--accent); }
.net-diagram g.edgegroup:hover .edge-label { opacity: 1; }
.net-diagram .fig-tag {
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.15em;
  fill: var(--ink-faint);
}

/* ---------- contact ---------- */
.contact-list { list-style: none; margin: 0; padding: 0; }
.contact-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 2rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--hairline);
}
.contact-list li:first-child { border-top: 1px solid var(--hairline); }
.contact-key {
  font-family: var(--label);
  font-size: 0.625rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.contact-val { font-family: var(--mono); font-size: 0.875rem; }
.contact-val a:hover { color: var(--accent); }

/* ---------- caret — the one permitted animation ---------- */
.caret {
  display: inline-block;
  width: 0.55em;
  height: 1em;
  background: var(--accent);
  vertical-align: -0.12em;
  margin-left: 0.25em;
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ---------- small screens ---------- */
@media (max-width: 44rem) {
  body { font-size: 1rem; }
  .identity h1 { white-space: normal; }
  .project-list li { grid-template-columns: 1fr; gap: 0.35rem; }
  .project-side { grid-row: auto; grid-column: 1; flex-direction: row; align-items: baseline; gap: 1rem; }
  .project-desc { grid-column: 1; }
  .contact-list li { flex-direction: column; gap: 0.25rem; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .caret { animation: none; }
  .net-diagram * { transition: none !important; }
}
