/* ============================================================
   Chris Baker — Field Dossier
   Editorial print-dossier aesthetic: warm paper, ink, signal orange.
   ============================================================ */

:root {
  --paper:      #ECE7DC;
  --paper-2:    #E4DDCB;
  --paper-deep: #DBD3BE;
  --ink:        #1A1714;
  --ink-soft:   #4F4840;
  --ink-faint:  #645B4D;   /* ~5.4:1 on --paper — passes WCAG AA for small text */
  --signal:     #C8451E;
  --signal-deep:#9E3415;
  --rule:       rgba(26, 23, 20, 0.20);
  --rule-soft:  rgba(26, 23, 20, 0.10);

  --display: "Fraunces", Georgia, serif;
  --body:    "Newsreader", Georgia, serif;
  --mono:    "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --gutter: clamp(1.25rem, 5vw, 6rem);
  --maxw:   1240px;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  /* Keep anchored sections clear of the sticky topbar. */
  scroll-padding-top: 5.5rem;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: clamp(1.02rem, 0.55vw + 0.92rem, 1.18rem);
  line-height: 1.62;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  /* `clip` (not `hidden`) avoids making body a scroll container, which would
     break `position: sticky` on the topbar and section heads. */
  overflow-x: clip;
  position: relative;
}

/* paper grain overlay */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.42;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
}

::selection { background: var(--signal); color: var(--paper); }

a { color: inherit; }

/* ---------- crop marks ---------- */
.crop {
  position: fixed;
  width: 22px; height: 22px;
  z-index: 50;
  pointer-events: none;
  border: 0 solid var(--ink);
}
.crop--tl { top: 14px; left: 14px;  border-top-width: 1.5px; border-left-width: 1.5px; }
.crop--tr { top: 14px; right: 14px; border-top-width: 1.5px; border-right-width: 1.5px; }
.crop--bl { bottom: 14px; left: 14px;  border-bottom-width: 1.5px; border-left-width: 1.5px; }
.crop--br { bottom: 14px; right: 14px; border-bottom-width: 1.5px; border-right-width: 1.5px; }
@media (max-width: 640px) { .crop { display: none; } }

/* ---------- topbar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem var(--gutter);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}

.monogram {
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  transition: background 0.25s ease, transform 0.25s ease;
}
.monogram:hover { background: var(--signal); transform: rotate(-4deg); }

.topbar__status {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--ink-soft);
}
.dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--signal) 70%, transparent);
  animation: pulse 2.6s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--signal) 60%, transparent); }
  70%  { box-shadow: 0 0 0 9px color-mix(in srgb, var(--signal) 0%, transparent); }
  100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--signal) 0%, transparent); }
}

.topbar__nav {
  display: flex;
  gap: 1.4rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.topbar__nav a {
  text-decoration: none;
  color: var(--ink-soft);
  position: relative;
  padding-bottom: 2px;
}
.topbar__nav a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: var(--signal);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s ease;
}
.topbar__nav a:hover { color: var(--ink); }
.topbar__nav a:hover::after { transform: scaleX(1); transform-origin: left; }
@media (max-width: 540px) {
  .topbar__status { display: none; }
}

/* ---------- shared layout ---------- */
main { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- hero ---------- */
.hero {
  position: relative;
  padding: clamp(3.5rem, 9vw, 8rem) 0 clamp(2.5rem, 6vw, 5rem);
  border-bottom: 1.5px solid var(--ink);
}

.hero__kicker {
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--signal-deep);
  margin-bottom: clamp(1rem, 3vw, 2.2rem);
}

.hero__name {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(4rem, 18vw, 13rem);
  line-height: 0.84;
  letter-spacing: -0.025em;
  text-transform: none;
}
.hero__name .line { display: block; }
.hero__name .line:last-child {
  color: transparent;
  -webkit-text-stroke: 1.4px var(--ink);
  padding-left: 0.06em;
}

.hero__lower {
  margin-top: clamp(2rem, 5vw, 3.6rem);
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: clamp(1.5rem, 5vw, 4rem);
  align-items: end;
}
@media (max-width: 760px) {
  .hero__lower { grid-template-columns: 1fr; gap: 2rem; }
}

.hero__headline {
  font-family: var(--display);
  font-size: clamp(1.3rem, 2.4vw, 2rem);
  line-height: 1.3;
  font-weight: 500;
  max-width: 22ch;
}
.hero__headline .tags {
  display: block;
  margin-top: 0.7rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: var(--signal-deep);
}

.dossier {
  border-top: 1px solid var(--ink);
}
.dossier > div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.62rem 0;
  border-bottom: 1px solid var(--rule);
}
.dossier dt {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
  align-self: center;
}
.dossier dd {
  font-family: var(--body);
  font-size: 0.98rem;
  text-align: right;
}
.dossier .dd--signal { color: var(--signal-deep); font-style: italic; }

/* rotating stamp — SVG textPath keeps the type locked to the ring */
.stamp {
  position: absolute;
  top: clamp(2.5rem, 7vw, 6rem);
  right: 0;
  width: clamp(106px, 13vw, 158px);
  aspect-ratio: 1;
  transform: rotate(-13deg);
}
.stamp__svg { display: block; width: 100%; height: 100%; overflow: visible; }
.stamp__ring {
  fill: none;
  stroke: var(--signal);
  stroke-width: 1.5;
}
.stamp__rotor {
  animation: spin 28s linear infinite;
  transform-box: view-box;
  transform-origin: 100px 100px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.stamp__text {
  fill: var(--signal);
  font-family: var(--mono);
  font-size: 12.6px;
  font-weight: 600;
}
.stamp__star {
  fill: var(--signal);
}
@media (max-width: 760px) { .stamp { display: none; } }
@media (prefers-reduced-motion: reduce) {
  .stamp__rotor, .dot { animation: none; }
}

/* ---------- content blocks ---------- */
.block {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: clamp(1.5rem, 5vw, 4.5rem);
  padding: clamp(3rem, 7vw, 6rem) 0;
  border-bottom: 1px solid var(--rule);
}
@media (max-width: 860px) {
  .block { grid-template-columns: 1fr; gap: 1.6rem; }
}

.block__head {
  position: relative;
}
@media (min-width: 861px) {
  .block__head { position: sticky; top: 84px; align-self: start; }
}
.block__num {
  display: block;
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  color: var(--signal-deep);
  margin-bottom: 0.5rem;
}
.block__title {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.7rem, 3vw, 2.6rem);
  line-height: 1.05;
  letter-spacing: -0.015em;
}
.block__title::after {
  content: "";
  display: block;
  width: 46px; height: 3px;
  background: var(--signal);
  margin-top: 0.9rem;
}

.block__body > * + * { margin-top: 1.1rem; }

/* ---------- profile ---------- */
.lede {
  font-family: var(--display);
  font-size: clamp(1.25rem, 1.8vw, 1.65rem);
  font-weight: 500;
  line-height: 1.4;
}
.lede strong { color: var(--signal-deep); font-weight: 600; }
#profile p:not(.lede) { color: var(--ink-soft); max-width: 64ch; }

.pullquote {
  font-family: var(--display);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.32rem, 2.2vw, 1.9rem);
  line-height: 1.36;
  margin-top: 2rem;
  padding-left: 1.4rem;
  border-left: 3px solid var(--signal);
  max-width: 56ch;
}
.pullquote::before {
  content: "\201C";
  color: var(--signal);
  margin-right: 0.04em;
}
.pullquote::after { content: "\201D"; color: var(--signal); }

/* ---------- skills ---------- */
.skills {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
}
.skills > * + * { margin-top: 0; }
.skillgroup {
  background: var(--paper);
  padding: 1.25rem 1.3rem 1.45rem;
}
.skillgroup h3 {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--signal-deep);
  margin-bottom: 0.9rem;
}
.skillgroup ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.skillgroup li {
  font-family: var(--body);
  font-size: 0.86rem;
  line-height: 1.2;
  padding: 0.28rem 0.55rem;
  border: 1px solid var(--rule);
  background: var(--paper-2);
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.skillgroup li:hover {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

/* ---------- experience timeline ---------- */
.timeline {
  position: relative;
}
.role {
  display: grid;
  grid-template-columns: 168px 1fr;
  gap: 1.6rem;
  padding: 1.8rem 0;
  border-top: 1px solid var(--rule);
  position: relative;
}
.role:first-child { border-top: 1.5px solid var(--ink); }
.role::before {
  content: "";
  position: absolute;
  left: 168px;
  top: 1.8rem;
  width: 9px; height: 9px;
  background: var(--paper);
  border: 1.5px solid var(--signal);
  border-radius: 50%;
  transform: translateX(-50%);
}
.role__dates {
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
  padding-top: 0.15rem;
}
.role__main { padding-left: 1.4rem; border-left: 1px solid var(--rule); }
.role__title {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.12rem, 1.7vw, 1.42rem);
  line-height: 1.25;
}
.role__org {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--signal-deep);
  margin: 0.35rem 0 0.85rem;
}
.role__org span { color: var(--ink-faint); }
.role__points {
  list-style: none;
  display: grid;
  gap: 0.5rem;
}
.role__points li {
  position: relative;
  padding-left: 1.15rem;
  color: var(--ink-soft);
  font-size: 0.97rem;
  line-height: 1.5;
}
.role__points li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--signal);
  font-family: var(--mono);
  font-size: 0.8rem;
  top: 0.18rem;
}
@media (max-width: 560px) {
  .role { grid-template-columns: 1fr; gap: 0.6rem; }
  .role::before { display: none; }
  .role__main { padding-left: 1rem; border-left: 2px solid var(--signal); }
}

/* ---------- open source ---------- */
.repos__note {
  font-family: var(--mono);
  font-size: 0.76rem;
  letter-spacing: 0.03em;
  color: var(--ink-faint);
}

/* ---------- credentials ---------- */
.credentials {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(1.5rem, 4vw, 3rem);
}
.credentials > * + * { margin-top: 0; }
@media (max-width: 680px) {
  .credentials { grid-template-columns: 1fr; gap: 2rem; }
}
.credentials h3 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.2rem;
  margin-bottom: 0.7rem;
}
.education__org {
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--signal-deep);
  margin-bottom: 0.7rem;
  letter-spacing: 0.03em;
}
.education__note { color: var(--ink-soft); font-size: 0.95rem; }
.certs ul {
  list-style: none;
  display: grid;
  gap: 0;
}
.certs li {
  font-family: var(--body);
  font-size: 0.94rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--rule);
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
}
.certs li::before {
  content: "▸";
  color: var(--signal);
  font-size: 0.7rem;
}

/* ---------- contact ---------- */
.contact {
  background: var(--ink);
  color: var(--paper);
  padding: clamp(3.5rem, 9vw, 7rem) var(--gutter) clamp(2rem, 4vw, 3rem);
  margin-top: 0;
  /* Faint labels need a lighter tone on the dark section to stay legible. */
  --ink-faint: #A99F8E;
}
.contact > * { max-width: var(--maxw); margin-left: auto; margin-right: auto; }
.contact__kicker {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--signal);
  margin-bottom: 1.4rem;
}
.contact__title {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(2.2rem, 6vw, 5rem);
  line-height: 1.0;
  letter-spacing: -0.02em;
  margin-bottom: clamp(2rem, 5vw, 3.5rem);
}
.contact__links {
  list-style: none;
  border-top: 1px solid rgba(236, 231, 220, 0.25);
}
.contact__links li {
  display: flex;
  align-items: baseline;
  gap: clamp(1rem, 4vw, 3rem);
  padding: 1.05rem 0;
  border-bottom: 1px solid rgba(236, 231, 220, 0.18);
}
.contact__label {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
  width: 92px;
  flex-shrink: 0;
}
.contact__links a {
  font-family: var(--display);
  font-size: clamp(1.15rem, 2.6vw, 1.9rem);
  font-weight: 500;
  text-decoration: none;
  color: var(--paper);
  position: relative;
  transition: color 0.25s ease;
}
.contact__links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -2px;
  width: 100%; height: 1.5px;
  background: var(--signal);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.32s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.contact__links a:hover { color: var(--signal); }
.contact__links a:hover::after { transform: scaleX(1); }

.contact__foot {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: clamp(2rem, 5vw, 3.5rem);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  text-transform: uppercase;
}

/* ---------- reveal animation ---------- */
/* Scoped to `.js`: without JavaScript the class is never set, so content is
   never hidden in the first place. See the bootstrap script in index.html. */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s cubic-bezier(0.2, 0.7, 0.2, 1),
              transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.js [data-reveal].is-in {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .js [data-reveal] { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* focus visibility */
a:focus-visible, .monogram:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 3px;
}
