/* ─────────────────────────────────────────────────────────────
   chrissyford.com
   Modern portfolio structure in a dark-academia key: ink ground,
   parchment text, brass primary, oxblood secondary. Serif display,
   sans body, mono for anything machine-adjacent.
   ───────────────────────────────────────────────────────────── */

:root {
  --bg:        #0c0b10;
  --bg-2:      #0a090d;
  --panel:     #141219;
  --panel-2:   #1a1722;
  --border:    #262230;
  --border-2:  #383142;

  --text:      #ece5d8;
  --muted:     #a89e8e;
  --faint:     #746a5d;

  --brass:     #c9a227;
  --brass-lit: #e0bc45;
  --brass-dim: #7d6519;
  --oxblood:   #a8434f;
  --oxblood-lit: #c56472;
  --sage:      #7d9a86;
  --glow:      rgba(201, 162, 39, .28);

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --maxw: 1180px;
  --radius: 14px;
  --radius-sm: 10px;
  --nav-h: 66px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 18px);
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

.wrap { width: min(100% - 2.5rem, var(--maxw)); margin-inline: auto; }

a { color: var(--brass); text-underline-offset: .18em; }
a:hover { color: var(--brass-lit); }

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

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--panel); color: var(--text); padding: .8rem 1.2rem;
  border: 1px solid var(--brass); border-radius: 0 0 var(--radius-sm) 0;
}
.skip:focus { left: 0; }

h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -.01em; }

/* ── Nav ──────────────────────────────────────────────────── */

.topnav {
  position: sticky; top: 0; z-index: 100;
  height: var(--nav-h);
  background: rgba(12, 11, 16, .82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  width: min(100% - 2.5rem, var(--maxw));
  margin-inline: auto;
  height: 100%;
  display: flex; align-items: center; gap: 2rem;
}
.brand {
  font-family: var(--mono);
  font-size: .88rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -.01em;
  white-space: nowrap;
}
.brand-dot { color: var(--brass); }
.brand:hover { color: var(--brass); }

.nav-links {
  list-style: none; display: flex; gap: 1.6rem;
  margin: 0 0 0 auto; padding: 0;
  font-size: .875rem;
}
.nav-links a {
  color: var(--muted); text-decoration: none;
  padding: .35rem 0; position: relative;
  transition: color .18s;
}
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-links a.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -.1rem;
  height: 1px; background: var(--brass);
}
@media (max-width: 900px) { .nav-links { display: none; } .brand { margin-right: auto; } }

/* ── Buttons ──────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .78rem 1.5rem;
  border-radius: var(--radius-sm);
  font-family: var(--sans);
  font-size: .9rem;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .2s, border-color .2s, color .2s, transform .2s, box-shadow .2s;
}
.btn-sm { padding: .48rem 1.05rem; font-size: .84rem; }

.btn-primary {
  background: var(--brass);
  color: #17130a;
  font-weight: 600;
  border-color: var(--brass);
}
.btn-primary:hover {
  background: var(--brass-lit); color: #17130a;
  transform: translateY(-1px);
  box-shadow: 0 8px 24px var(--glow);
}

.btn-ghost, .btn-outline {
  background: var(--panel);
  color: var(--text);
  border-color: var(--border-2);
}
.btn-ghost:hover, .btn-outline:hover {
  color: var(--text);
  border-color: var(--brass);
  background: var(--panel-2);
  transform: translateY(-1px);
}

/* ── Hero ─────────────────────────────────────────────────── */

.hero { position: relative; padding: clamp(3rem, 7vw, 5.5rem) 0 clamp(2.5rem, 5vw, 4rem); overflow: hidden; }
.hero-bg {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 55% 60% at 18% 0%, rgba(201,162,39,.10), transparent 62%),
    radial-gradient(ellipse 45% 55% at 88% 12%, rgba(168,67,79,.10), transparent 65%),
    linear-gradient(to bottom, transparent 82%, var(--bg) 100%),
    repeating-linear-gradient(0deg, rgba(236,229,216,.022) 0 1px, transparent 1px 68px),
    repeating-linear-gradient(90deg, rgba(236,229,216,.022) 0 1px, transparent 1px 68px);
}

.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}
@media (max-width: 940px) { .hero-grid { grid-template-columns: 1fr; } }

.pill {
  display: inline-flex; align-items: center; gap: .55rem;
  margin: 0 0 1.5rem;
  padding: .42rem 1rem;
  background: var(--panel);
  border: 1px solid var(--border-2);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: .76rem;
  color: var(--muted);
  letter-spacing: .01em;
}
.pill-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--sage);
  box-shadow: 0 0 0 3px rgba(125,154,134,.16);
}

.hero h1 {
  margin: 0;
  font-size: clamp(3rem, 8.5vw, 5.4rem);
  line-height: 1;
  letter-spacing: -.025em;
  color: #f6f1e6;
}
.hero-affil {
  margin: .7rem 0 0;
  font-family: var(--mono);
  font-size: clamp(.76rem, 2vw, .84rem);
  letter-spacing: .07em;
  color: var(--brass);
}

.hero-lede {
  margin: 1.3rem 0 2rem;
  max-width: 52ch;
  color: var(--muted);
  font-size: 1.03rem;
}
.hero-lede strong { color: var(--text); font-weight: 600; }

.hero-cta { display: flex; flex-wrap: wrap; gap: .8rem; margin-bottom: 2.75rem; }

.stats {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--panel);
}
.stats li { padding: 1.05rem 1.15rem; border-right: 1px solid var(--border); }
.stats li:last-child { border-right: none; }
.stat-n {
  display: block;
  font-family: var(--serif);
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.1;
}
.stat-l {
  display: block; margin-top: .28rem;
  font-size: .76rem; color: var(--faint); line-height: 1.35;
}
@media (max-width: 620px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stats li:nth-child(2) { border-right: none; }
  .stats li:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
}

/* ── Terminal ─────────────────────────────────────────────── */

.hero-right { position: sticky; top: calc(var(--nav-h) + 1.5rem); }
@media (max-width: 940px) { .hero-right { position: static; } }

.terminal {
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 26px 70px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.03);
}
.terminal-bar {
  display: flex; align-items: center; gap: .45rem;
  padding: .62rem .9rem;
  background: var(--panel-2);
  border-bottom: 1px solid var(--border);
}
.dot { width: 10px; height: 10px; border-radius: 50%; opacity: .8; }
.dot-r { background: #a8434f; }
.dot-y { background: #b8912f; }
.dot-g { background: #5f8a6d; }
.terminal-title {
  margin-left: .7rem;
  font-family: var(--mono); font-size: .72rem; color: var(--faint);
}
.terminal-hint {
  margin-left: auto;
  font-family: var(--mono); font-size: .72rem; color: var(--faint);
}
.terminal-hint b { color: var(--brass); font-weight: 500; }

.terminal-body {
  padding: 1rem 1.1rem .3rem;
  font-family: var(--mono);
  font-size: .8rem;
  line-height: 1.7;
  /* Tall enough that the whoami + top boot output lands without scrolling. */
  height: 24.5rem;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-2) transparent;
}
.terminal-body::-webkit-scrollbar { width: 8px; }
.terminal-body::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 4px; }

.t-line { white-space: pre-wrap; word-break: break-word; margin: 0; }
/* Hanging indents so wrapped list items stay visually aligned under their marker. */
.t-bullet { padding-left: 2ch; text-indent: -2ch; }
.t-sub { padding-left: 4ch; text-indent: -2ch; }
.t-echo { color: var(--muted); }
.t-echo .t-prompt { color: var(--sage); }
.t-out { color: var(--text); }
.t-dim { color: var(--faint); }
.t-key { color: var(--brass); }
.t-err { color: var(--oxblood-lit); }
.t-ok  { color: var(--sage); }
.t-dir { color: var(--brass); }
.t-file { color: var(--muted); }
.t-head {
  color: var(--brass); font-size: .74rem;
  letter-spacing: .12em; text-transform: uppercase;
  margin-top: .5rem;
}
.t-gap { height: .5rem; }

.terminal-input-row {
  display: flex; align-items: center; gap: .55rem;
  padding: .5rem 1.1rem .85rem;
  font-family: var(--mono); font-size: .8rem;
  border-top: 1px solid var(--border);
}
.prompt { color: var(--sage); white-space: nowrap; }
#terminal-input {
  flex: 1; min-width: 0;
  background: transparent; border: none;
  color: var(--text); font-family: inherit; font-size: inherit;
  padding: .1rem 0;
  caret-color: var(--brass);
}
#terminal-input:focus { outline: none; }

/* ── Tech strip ───────────────────────────────────────────── */

.strip {
  border-block: 1px solid var(--border);
  background: var(--bg-2);
  padding: 1.1rem 0;
}
.strip-inner { display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; }
.strip-label {
  font-family: var(--mono); font-size: .7rem;
  letter-spacing: .2em; text-transform: uppercase; color: var(--faint);
}
.strip ul {
  list-style: none; display: flex; flex-wrap: wrap; gap: .4rem 1.5rem;
  margin: 0; padding: 0;
  font-family: var(--mono); font-size: .8rem; color: var(--muted);
}
.strip li::before { content: "› "; color: var(--brass-dim); }

/* ── Sections ─────────────────────────────────────────────── */

.section { padding: clamp(3.5rem, 8vw, 6rem) 0; }

.section-head {
  display: flex; align-items: baseline; gap: .85rem;
  margin: 0 0 2.5rem;
  font-size: clamp(1.85rem, 4.5vw, 2.6rem);
  color: #f6f1e6;
  position: relative;
  padding-bottom: .85rem;
}
.section-head::after {
  content: ""; position: absolute; left: 0; bottom: 0;
  width: 3.4rem; height: 2px;
  background: linear-gradient(90deg, var(--brass), var(--oxblood));
  border-radius: 2px;
}
.num {
  font-family: var(--mono);
  font-size: .8rem;
  font-weight: 400;
  color: var(--brass);
  letter-spacing: .06em;
}

/* ── About ────────────────────────────────────────────────── */

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr);
  gap: clamp(2rem, 4vw, 3.5rem);
  align-items: start;
}
@media (max-width: 880px) { .about-grid { grid-template-columns: 1fr; } }

.lede-lg {
  margin: 0 0 1.4rem;
  font-family: var(--serif);
  font-size: clamp(1.25rem, 2.6vw, 1.55rem);
  line-height: 1.45;
  color: #f6f1e6;
}
.about-prose p { margin: 0 0 1.1rem; color: var(--muted); max-width: 64ch; }
.about-prose p:last-child { margin-bottom: 0; }
.about-prose strong { color: var(--text); font-weight: 600; }

/* Placeholder while the about-me is being written. The dots reveal one at a
   time, so it reads as something still being typed. */
.pending { margin-bottom: .6rem; }
.pending-note { font-family: var(--mono); font-size: .84rem; color: var(--faint); }

.dots {
  display: inline-block;
  width: 3ch;
  overflow: hidden;
  vertical-align: bottom;
  white-space: nowrap;
  animation: typedots 2s infinite;
}
@keyframes typedots {
  0%,  24%  { width: 0ch; }
  25%, 49%  { width: 1ch; }
  50%, 74%  { width: 2ch; }
  75%, 100% { width: 3ch; }
}
@media (prefers-reduced-motion: reduce) {
  .dots { animation: none; width: 3ch; }
}

.meta-cards { list-style: none; margin: 0; padding: 0; display: grid; gap: .7rem; }
.meta-cards li {
  display: flex; align-items: flex-start; gap: .85rem;
  padding: .95rem 1.1rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .89rem;
  color: var(--muted);
  transition: border-color .2s, background .2s;
}
.meta-cards li:hover { border-color: var(--border-2); background: var(--panel-2); }
.tag {
  flex: none;
  min-width: 3.4rem;
  text-align: center;
  padding: .16rem .45rem;
  background: rgba(201,162,39,.1);
  border: 1px solid rgba(201,162,39,.28);
  border-radius: 5px;
  font-family: var(--mono);
  font-size: .62rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--brass);
}

/* ── Cards ────────────────────────────────────────────────── */

.cards {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 1.1rem;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
}
.cards-2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }

.card {
  padding: 1.6rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color .22s, transform .22s, background .22s;
}
.card:hover { border-color: var(--border-2); background: var(--panel-2); transform: translateY(-2px); }
.card h3 { margin: 0 0 .6rem; font-size: 1.1rem; color: #f6f1e6; }
.card p { margin: 0; color: var(--muted); font-size: .92rem; }

.card-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px;
  margin-bottom: 1.1rem;
  background: rgba(201,162,39,.09);
  border: 1px solid rgba(201,162,39,.24);
  border-radius: var(--radius-sm);
  color: var(--brass);
}
.card-icon svg { width: 20px; height: 20px; stroke-linecap: round; stroke-linejoin: round; }

.card-tag {
  display: inline-block;
  margin-bottom: .9rem;
  padding: .18rem .55rem;
  background: rgba(168,67,79,.12);
  border: 1px solid rgba(168,67,79,.3);
  border-radius: 5px;
  font-family: var(--mono);
  font-size: .64rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--oxblood-lit);
}

/* ── Timeline ─────────────────────────────────────────────── */

.timeline { list-style: none; margin: 0; padding: 0 0 0 1.75rem; position: relative; }
.timeline::before {
  content: ""; position: absolute; left: 0; top: .6rem; bottom: .6rem;
  width: 1px; background: linear-gradient(to bottom, var(--brass-dim), var(--border), transparent);
}
.timeline > li { position: relative; margin-bottom: 1.2rem; }
.timeline > li::before {
  content: ""; position: absolute; left: calc(-1.75rem - 4.5px); top: 1.6rem;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--brass);
}
.tl-card {
  padding: 1.5rem 1.7rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.tl-head {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 1.5rem; flex-wrap: wrap; margin-bottom: 1.1rem;
}
.tl-head h3 { margin: 0; font-size: 1.18rem; color: #f6f1e6; }
.tl-org { margin: .22rem 0 0; font-size: .87rem; color: var(--faint); }
.tl-date {
  margin: 0; white-space: nowrap;
  font-family: var(--mono); font-size: .78rem; color: var(--brass);
}

.bullets { list-style: none; margin: 0; padding: 0; }
.bullets li {
  position: relative; padding-left: 1.3rem; margin-bottom: .8rem;
  color: var(--muted); font-size: .93rem;
}
.bullets li:last-child { margin-bottom: 0; }
.bullets li::before {
  content: "▹"; position: absolute; left: 0; top: 0;
  color: var(--brass); font-size: .9em;
}
.bullets strong { color: var(--text); font-weight: 600; }

/* ── Skills ───────────────────────────────────────────────── */

.skill-groups {
  display: grid; gap: 1.1rem;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}
.skill-group {
  padding: 1.4rem 1.5rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.skill-group h3 {
  margin: 0 0 1rem;
  font-family: var(--mono);
  font-size: .7rem;
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--oxblood-lit);
}
.skill-group ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .45rem; }
.skill-group li {
  padding: .34rem .75rem;
  background: rgba(236,229,216,.035);
  border: 1px solid var(--border-2);
  border-radius: 6px;
  font-size: .82rem;
  color: var(--muted);
  transition: color .18s, border-color .18s;
}
.skill-group li:hover { color: var(--text); border-color: var(--brass-dim); }

/* ── Credentials ──────────────────────────────────────────── */

.cred-grid {
  display: grid; gap: clamp(1.5rem, 4vw, 3rem);
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}
.col-label {
  margin: 0 0 1rem;
  font-family: var(--mono);
  font-size: .7rem;
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--faint);
}
.cred-col .col-label:not(:first-child) { margin-top: 2rem; }

.cred-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .7rem; }
.cred-list li {
  padding: 1rem 1.2rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  border-left: 2px solid var(--brass);
}
.cred-list li.pending { border-left-color: var(--sage); }
.cred-name { display: block; color: var(--text); font-size: .95rem; }
.cred-org {
  display: block; margin-top: .22rem;
  font-family: var(--mono); font-size: .76rem; color: var(--faint);
}
.cred-list li.pending .cred-org { color: var(--sage); }

.cred-dl {
  display: inline-block;
  font-family: var(--mono); font-size: .84rem;
  text-decoration: none;
  border-bottom: 1px solid rgba(201,162,39,.35);
  padding-bottom: .12rem;
}
.cred-dl:hover { border-bottom-color: var(--brass); }

/* ── Contact ──────────────────────────────────────────────── */

.contact .section-head { justify-content: flex-start; }
.contact-lede { max-width: 54ch; margin: 0 0 2rem; color: var(--muted); }
.contact-email { margin: 0 0 2rem; }
.contact-email a {
  font-family: var(--serif);
  font-size: clamp(1.35rem, 4vw, 2.1rem);
  text-decoration: none;
  border-bottom: 1px solid rgba(201,162,39,.3);
  padding-bottom: .1rem;
}
.contact-email a:hover { border-bottom-color: var(--brass); }
.contact-links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .7rem; }
.contact-links a {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .6rem 1.15rem;
  background: var(--panel);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  color: var(--text);
  text-decoration: none;
  font-size: .88rem;
  transition: border-color .2s, background .2s;
}
.contact-links a:hover { border-color: var(--brass); background: var(--panel-2); }

/* ── Footer ───────────────────────────────────────────────── */

.site-footer { border-top: 1px solid var(--border); padding: 2rem 0 2.5rem; }
.footer-inner {
  display: flex; justify-content: space-between; align-items: center;
  gap: 1rem; flex-wrap: wrap;
  font-family: var(--mono); font-size: .75rem; color: var(--faint);
}
.footer-inner p { margin: 0; }
.footer-note { color: #574f47; }

/* ── Section flash (terminal `cd`) ────────────────────────── */

.section.flash > .wrap { animation: flash 1.4s ease-out; }
@keyframes flash {
  0%   { background: rgba(201,162,39,.07); box-shadow: 0 0 0 14px rgba(201,162,39,.07); border-radius: 8px; }
  100% { background: transparent; box-shadow: 0 0 0 14px transparent; border-radius: 8px; }
}

/* ── Small screens ────────────────────────────────────────── */

@media (max-width: 620px) {
  .hero-cta .btn { flex: 1 1 100%; }
  .terminal-body { height: 19rem; font-size: .75rem; }
  .tl-card, .card, .skill-group { padding: 1.2rem; }
  .footer-inner { justify-content: center; text-align: center; }
}

/* ── Print ────────────────────────────────────────────────── */

@media print {
  .topnav, .hero-bg, .terminal, .hero-cta, .strip,
  .contact-links, .site-footer, .skip { display: none !important; }
  body { background: #fff; color: #111; font-size: 11pt; }
  .hero { padding: 0; }
  .hero h1, .section-head, .card h3, .tl-head h3, .lede-lg, .cred-name { color: #000; }
  .hero-lede, .about-prose p, .card p, .bullets li, .contact-lede { color: #222; }
  .card, .tl-card, .skill-group, .cred-list li, .meta-cards li, .stats {
    border-color: #bbb; background: #fff; break-inside: avoid;
  }
  .section { padding: 1rem 0; }
  a { color: #000; }
}
