/* portfolio47.com */

:root {
  --ink:        #0d0f0e;
  --ink-2:      #141817;
  --ink-3:      #1c2220;
  --rule:       #2a3230;
  --bone:       #e8e6df;
  --bone-dim:   #9aa19d;
  --bone-faint: #6b736f;
  --green:      #48c07e;
  --green-deep: #15803d;
  --amber:      #d9a441;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --measure: 34rem;
  --pad: clamp(1.25rem, 5vw, 4rem);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--bone);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
img { max-width: 100%; display: block; }

.wrap { max-width: 68rem; margin: 0 auto; padding: 0 var(--pad); }
.measure { max-width: var(--measure); }

/* ---------- skip link ---------- */
.skip {
  position: absolute; left: -9999px;
  background: var(--green); color: var(--ink);
  padding: .6rem 1rem; z-index: 100; border-radius: 0 0 4px 0;
}
.skip:focus { left: 0; top: 0; }

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

/* ---------- section scaffolding ---------- */
section { border-top: 1px solid var(--rule); padding: clamp(3.5rem, 9vw, 7rem) 0; }
/* no rule above the first section, so it needs far less padding —
   otherwise the hero's bottom padding and this one stack into a void */
section:first-of-type { border-top: 0; padding-top: clamp(1.25rem, 2.5vw, 2rem); }

.eyebrow {
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--green);
  margin: 0 0 1.1rem;
}
.eyebrow .num { color: var(--bone-faint); margin-right: .7rem; }

h1, h2, h3 { line-height: 1.15; letter-spacing: -.02em; font-weight: 600; }
h2 { font-size: clamp(1.9rem, 4.4vw, 3rem); margin: 0 0 .6rem; }
h3 { font-size: 1.12rem; margin: 0 0 .45rem; letter-spacing: -.01em; }

.dek {
  font-family: var(--serif);
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  line-height: 1.5;
  color: var(--bone-dim);
  max-width: var(--measure);
  margin: 0 0 2.6rem;
}
.dek em { color: var(--bone); font-style: italic; }

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

/* ---------- hero ---------- */
/* vertical only — the horizontal padding belongs to .wrap */
.hero { padding-top: clamp(4.5rem, 13vw, 9rem); padding-bottom: clamp(2.5rem, 5vw, 4rem); }
.hero h1 {
  font-size: clamp(2.6rem, 8.5vw, 5.6rem);
  margin: 0 0 1.6rem;
  letter-spacing: -.035em;
}
.hero .thesis {
  font-family: var(--serif);
  font-size: clamp(1.25rem, 3.1vw, 1.95rem);
  line-height: 1.4;
  color: var(--bone);
  max-width: 42rem;
  margin: 0 0 1.6rem;
}
.hero .thesis .and { color: var(--green); font-style: italic; }
.hero .sub { color: var(--bone-dim); max-width: 40rem; margin: 0 0 1rem; }
/* only the final paragraph pays the gap before the buttons */
.hero .sub:last-of-type { margin-bottom: 2.4rem; }

.status {
  display: inline-flex; align-items: center; gap: .6rem;
  font-family: var(--mono); font-size: .78rem; letter-spacing: .08em;
  text-transform: uppercase; color: var(--bone-dim);
  border: 1px solid var(--rule); border-radius: 999px;
  padding: .42rem .95rem; margin-bottom: 2.2rem;
}
.dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--green); box-shadow: 0 0 0 0 rgba(72,192,126,.6);
  animation: pulse 2.6s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(72,192,126,.55); }
  70%  { box-shadow: 0 0 0 9px rgba(72,192,126,0); }
  100% { box-shadow: 0 0 0 0 rgba(72,192,126,0); }
}

.actions { display: flex; flex-wrap: wrap; gap: .7rem; }
.btn {
  display: inline-block;
  font-family: var(--mono); font-size: .8rem; letter-spacing: .06em;
  padding: .72rem 1.25rem; border-radius: 3px;
  border: 1px solid var(--rule); color: var(--bone);
  transition: border-color .15s, color .15s, background .15s;
}
.btn:hover { border-color: var(--green); color: var(--green); text-decoration: none; }
.btn-primary { background: var(--green); border-color: var(--green); color: var(--ink); font-weight: 600; }
.btn-primary:hover { background: #5ad38f; border-color: #5ad38f; color: var(--ink); }

/* ---------- diagram ---------- */
.diagram-frame {
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--ink-2);
  padding: clamp(1rem, 3vw, 2rem);
  margin: 0 0 1.5rem;
  overflow-x: auto;
}
.diagram-frame svg { min-width: 640px; width: 100%; height: auto; display: block; }

.node-box { fill: var(--ink-3); stroke: var(--rule); stroke-width: 1; }
.node-core { fill: #17251f; stroke: var(--green-deep); stroke-width: 1.5; }
.node-label { fill: var(--bone); font-family: var(--sans); font-size: 13px; }
.node-sub { fill: var(--bone-faint); font-family: var(--mono); font-size: 10px; letter-spacing: .06em; }
.col-head { fill: var(--green); font-family: var(--mono); font-size: 10.5px; letter-spacing: .16em; }
.flow-label { fill: var(--bone-dim); font-family: var(--mono); font-size: 10px; letter-spacing: .08em; }
.flow-order  { stroke: var(--green); stroke-width: 1.6; fill: none; }
.flow-menu   { stroke: var(--amber); stroke-width: 1.6; fill: none; stroke-dasharray: 5 4; }
.flow-status { stroke: #6f9fd8; stroke-width: 1.6; fill: none; stroke-dasharray: 2 4; }

.hot { cursor: pointer; }
.hot .hot-ring { fill: var(--ink); stroke: var(--green); stroke-width: 1.5; transition: fill .15s; }
.hot .hot-num { fill: var(--green); font-family: var(--mono); font-size: 11px; font-weight: 700; }
.hot:hover .hot-ring, .hot[aria-expanded="true"] .hot-ring { fill: var(--green); }
.hot:hover .hot-num,  .hot[aria-expanded="true"] .hot-num  { fill: var(--ink); }

.legend {
  display: flex; flex-wrap: wrap; gap: 1.4rem;
  font-family: var(--mono); font-size: .72rem; letter-spacing: .06em;
  color: var(--bone-dim); margin: 0 0 2.6rem;
}
.legend span { display: inline-flex; align-items: center; gap: .5rem; }
.swatch { width: 22px; height: 0; border-top-width: 2px; border-top-style: solid; }
.sw-order  { border-color: var(--green); }
.sw-menu   { border-color: var(--amber); border-top-style: dashed; }
.sw-status { border-color: #6f9fd8; border-top-style: dotted; }

/* ---------- hard parts ---------- */
.hard-parts { display: grid; gap: 0; margin-top: 2.5rem; border-top: 1px solid var(--rule); }
.hard {
  border-bottom: 1px solid var(--rule);
  padding: 0;
}
.hard summary {
  list-style: none; cursor: pointer;
  display: flex; gap: 1rem; align-items: baseline;
  padding: 1.15rem .25rem;
  transition: color .15s;
}
.hard summary::-webkit-details-marker { display: none; }
.hard summary:hover { color: var(--green); }
.hard summary .idx {
  font-family: var(--mono); font-size: .72rem; color: var(--green);
  flex: 0 0 1.6rem;
}
.hard summary .ttl { font-weight: 600; flex: 1; letter-spacing: -.01em; }
.hard summary .chev { color: var(--bone-faint); font-size: .85rem; transition: transform .2s; }
.hard[open] summary .chev { transform: rotate(90deg); }
.hard[open] summary { color: var(--green); }
.hard .body { padding: 0 .25rem 1.5rem 2.6rem; color: var(--bone-dim); }
.hard .body p { margin: 0 0 .85rem; }
.hard .body p:last-child { margin-bottom: 0; }
.hard .body strong { color: var(--bone); font-weight: 600; }

/* ---------- stack chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin: 1.6rem 0 0; padding: 0; list-style: none; max-width: 46rem; }
.chips li {
  font-family: var(--mono); font-size: .73rem; letter-spacing: .04em;
  color: var(--bone-dim);
  border: 1px solid var(--rule); border-radius: 3px;
  padding: .3rem .6rem;
}

/* ---------- gallery ---------- */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: .75rem;
  margin: 2.2rem 0 0;
}
.shot {
  border: 1px solid var(--rule); border-radius: 4px;
  background: var(--ink-2); overflow: hidden; cursor: zoom-in;
  padding: 0; text-align: left; color: inherit; font: inherit;
  transition: border-color .15s, transform .15s;
}
.shot:hover { border-color: var(--green); transform: translateY(-2px); }
.shot img { aspect-ratio: 16/10; object-fit: cover; object-position: top center; width: 100%; }
.shot .cap {
  font-family: var(--mono); font-size: .68rem; letter-spacing: .05em;
  color: var(--bone-faint); padding: .55rem .65rem;
  border-top: 1px solid var(--rule);
}

dialog#lb {
  border: 0; padding: 0; background: transparent; max-width: 96vw; max-height: 96vh;
  color: var(--bone);
}
dialog#lb::backdrop { background: rgba(4,6,5,.93); }
#lb img { max-height: 84vh; width: auto; margin: 0 auto; border: 1px solid var(--rule); border-radius: 4px; }
#lb .lb-cap {
  font-family: var(--mono); font-size: .75rem; color: var(--bone-dim);
  text-align: center; padding: .9rem 1rem 0;
}
#lb-close {
  position: fixed; top: 1rem; right: 1rem;
  background: none; border: 1px solid var(--rule); color: var(--bone);
  font-size: 1.4rem; line-height: 1; width: 2.4rem; height: 2.4rem;
  border-radius: 50%; cursor: pointer;
}
#lb-close:hover { border-color: var(--green); color: var(--green); }

/* ---------- writing ---------- */
.pieces { display: grid; gap: 1rem; margin-top: 2.4rem; }
.piece {
  border: 1px solid var(--rule); border-radius: 5px;
  background: var(--ink-2); padding: clamp(1.3rem, 3.4vw, 2.2rem);
}
.piece .meta {
  font-family: var(--mono); font-size: .7rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--bone-faint); margin: 0 0 .7rem;
}
.piece h3 { font-family: var(--serif); font-size: 1.4rem; font-weight: 600; margin: 0 0 1rem; }
.piece blockquote {
  margin: 0 0 1.2rem; padding: 0 0 0 1.1rem;
  border-left: 2px solid var(--green-deep);
  font-family: var(--serif); font-size: 1.05rem; line-height: 1.62;
  color: var(--bone-dim); max-width: 40rem;
}
.piece blockquote p { max-width: none; margin: 0 0 .9rem; }
.piece blockquote p:last-child { margin: 0; }
.piece .note { font-size: .88rem; color: var(--bone-faint); max-width: 40rem; margin: 0 0 1rem; }
.piece .note strong { color: var(--bone-dim); font-weight: 600; }

.filelinks { display: flex; flex-wrap: wrap; gap: .45rem; list-style: none; padding: 0; margin: 0; }
.filelinks a {
  display: inline-block;
  font-family: var(--mono); font-size: .72rem; letter-spacing: .04em;
  border: 1px solid var(--rule); border-radius: 3px; padding: .35rem .7rem;
  color: var(--bone-dim);
}
.filelinks a:hover { border-color: var(--green); color: var(--green); text-decoration: none; }

/* ---------- elsewhere ---------- */
.links { display: grid; grid-template-columns: repeat(auto-fit, minmax(255px, 1fr)); gap: .8rem; margin-top: 2.4rem; }
.link-card {
  display: block; border: 1px solid var(--rule); border-radius: 5px;
  padding: 1.3rem; background: var(--ink-2); color: var(--bone);
  transition: border-color .15s, transform .15s;
}
.link-card:hover { border-color: var(--green); transform: translateY(-2px); text-decoration: none; }
.link-card .kind {
  font-family: var(--mono); font-size: .66rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--green); margin: 0 0 .55rem;
}
.link-card h3 { margin: 0 0 .4rem; }
.link-card p { font-size: .9rem; color: var(--bone-dim); margin: 0; max-width: none; }

/* ---------- footer ---------- */
footer { border-top: 1px solid var(--rule); padding: 3rem 0 4rem; }
footer .cols { display: flex; flex-wrap: wrap; gap: 2.5rem; justify-content: space-between; align-items: flex-start; }
footer p { font-size: .88rem; color: var(--bone-faint); margin: 0 0 .4rem; max-width: 30rem; }
footer a { color: var(--bone-dim); }
footer a:hover { color: var(--green); }
.colophon { font-family: var(--mono); font-size: .7rem; letter-spacing: .05em; color: var(--bone-faint); }

/* ---------- résumé viewer ---------- */
dialog#cv {
  border: 1px solid var(--rule); border-radius: 6px; padding: 0;
  background: var(--ink-2); color: var(--bone);
  width: min(60rem, 94vw); height: min(92vh, 60rem);
  max-width: 94vw; max-height: 94vh;
  overflow: hidden;
}
dialog#cv::backdrop { background: rgba(4,6,5,.93); }

.cv-bar {
  display: flex; flex-wrap: wrap; gap: .75rem 1rem;
  align-items: center; justify-content: space-between;
  padding: .85rem 1rem; border-bottom: 1px solid var(--rule);
  background: var(--ink-3);
}
.cv-title {
  margin: 0; max-width: none;
  font-family: var(--mono); font-size: .74rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--bone-dim);
}
.cv-tools { display: flex; flex-wrap: wrap; gap: .45rem; }
.cv-btn { padding: .42rem .85rem; font-size: .73rem; cursor: pointer; background: none; }

.cv-body { position: relative; height: calc(100% - 3.6rem); background: var(--ink); }
#cv-frame { width: 100%; height: 100%; border: 0; display: block; position: relative; z-index: 1; }
.cv-fallback {
  position: absolute; inset: 0; z-index: 0; margin: 0; max-width: none;
  display: flex; align-items: center; justify-content: center; text-align: center;
  padding: 2rem; color: var(--bone-dim); font-size: .95rem;
}
.cv-fallback strong { color: var(--bone); }

/* ---------- inline case note ---------- */
.case {
  border: 1px solid var(--rule); border-left: 2px solid var(--green-deep);
  border-radius: 5px; background: var(--ink-2);
  padding: clamp(1.3rem, 3.4vw, 2.2rem); margin: 2.6rem 0 0;
}
.case .meta {
  font-family: var(--mono); font-size: .7rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--bone-faint); margin: 0 0 .55rem;
}
.case h3 { font-size: 1.32rem; margin: 0 0 1rem; letter-spacing: -.015em; }
.case p { color: var(--bone-dim); margin: 0 0 .9rem; }
.case p:last-child { margin-bottom: 0; }
.case strong { color: var(--bone); font-weight: 600; }
.case .kicker { color: var(--bone); }

/* ---------- doc cards with screenshots ---------- */
.links.docs .link-card { padding: 0; overflow: hidden; }
.links.docs .link-card img {
  width: 100%; aspect-ratio: 16 / 10;
  object-fit: cover; object-position: top center;
  border-bottom: 1px solid var(--rule);
  filter: saturate(.85) brightness(.94);
  transition: filter .15s;
}
.links.docs .link-card:hover img { filter: none; }
.links.docs .lc-body { padding: 1.15rem 1.2rem 1.3rem; }
