/*
 * Portfolio site for Gauge Hartwell
 * Terminal-inspired dark styling, mirroring the current live site's aesthetic
 */

 :root {
  /* palette — GitHub-dark inspired terminal */
  --bg: #0d1117;
  --bg-elev: #161b22;
  --fg: #c9d1d9;
  --fg-muted: #8b949e;
  --fg-subtle: #6e7681;
  --rule: #21262d;
  --rule-soft: #1c2128;
  --prompt: #7ee787;
  --link: #79c0ff;
  --link-hover: #a5d6ff;
  --accent: #f0b429;

  /* type */
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', 'SFMono-Regular', Menlo, Consolas, monospace;

  /* scale */
  --fs-body: 1rem;
  --fs-small: 0.875rem;
  --fs-hero: 1.75rem;
  --fs-h2: 1.125rem;
  --fs-h3: 1.125rem;
  --fs-h4: 1rem;

  /* rhythm */
  --lh-body: 1.65;
  --lh-tight: 1.35;

  /* layout */
  --wrap-max: 52rem;
  --wrap-pad: 1.5rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-weight: 400;
  font-feature-settings: 'liga' 0, 'calt' 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.wrap {
  max-width: var(--wrap-max);
  margin: 0 auto;
  padding: 0 var(--wrap-pad);
}

/* ── topbar ────────────────────────────────────────────── */

.topbar {
  border-bottom: 1px solid var(--rule);
  padding: 1.25rem 0;
  position: sticky;
  top: 0;
  background: rgba(13, 17, 23, 0.92);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 10;
}

.topbar .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.brand {
  color: var(--fg);
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
}

.brand:hover {
  color: var(--link);
}

.topbar nav {
  display: flex;
  gap: 1.5rem;
  font-size: var(--fs-small);
}

.topbar nav a {
  color: var(--fg-muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.topbar nav a:hover {
  color: var(--link);
  border-bottom-color: var(--link);
}

/* ── main content ──────────────────────────────────────── */

main.wrap {
  padding-top: 3rem;
  padding-bottom: 4rem;
}

.section {
  margin-bottom: 4rem;
}

.section:last-of-type {
  margin-bottom: 2rem;
}

/* section header — the `$ command` prompt */

.prompt {
  color: var(--fg-muted);
  font-size: var(--fs-h2);
  font-weight: 500;
  margin: 0 0 1.75rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--rule);
  letter-spacing: 0;
}

.prompt::first-letter {
  color: var(--prompt);
  font-weight: 700;
}

/* ── hero ──────────────────────────────────────────────── */

.hero h1 {
  font-size: var(--fs-hero);
  line-height: 1.35;
  font-weight: 600;
  color: var(--fg);
  margin: 0 0 1.5rem;
  max-width: 34ch;
}

.lede {
  color: var(--fg-muted);
  margin: 0 0 1.75rem;
  max-width: 62ch;
}

.hero-contact {
  font-size: var(--fs-small);
  color: var(--fg-subtle);
  margin: 0;
  word-spacing: 0.15em;
}

.sep {
  color: var(--fg-subtle);
  padding: 0 0.15rem;
}

/* ── role entries (work + lab) ─────────────────────────── */

.role {
  margin-bottom: 2.75rem;
}

.role:last-child {
  margin-bottom: 0;
}

.dates {
  color: var(--fg-subtle);
  font-size: var(--fs-small);
  margin: 0 0 0.5rem;
}

.role h3 {
  font-size: var(--fs-h3);
  color: var(--fg);
  font-weight: 600;
  margin: 0 0 0.35rem;
  line-height: var(--lh-tight);
}

.employer {
  color: var(--fg-muted);
  margin: 0 0 1rem;
  font-size: var(--fs-body);
}

.role ul {
  margin: 0;
  padding-left: 1.25rem;
  color: var(--fg);
}

.role li {
  margin-bottom: 0.6rem;
  padding-left: 0.25rem;
}

.role li::marker {
  color: var(--fg-subtle);
}

.role li:last-child {
  margin-bottom: 0;
}

/* ── lab stack line ────────────────────────────────────── */

.stack-label {
  color: var(--prompt);
  font-size: var(--fs-small);
  margin: 1.5rem 0 0.5rem;
  font-weight: 500;
}

.stack {
  color: var(--fg-muted);
  font-size: var(--fs-small);
  margin: 0;
  line-height: 1.7;
}

/* ── credentials ───────────────────────────────────────── */

.creds {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
  gap: 2.5rem;
}

.creds h4 {
  font-size: var(--fs-h4);
  color: var(--fg);
  font-weight: 600;
  margin: 0 0 1rem;
}

.cred-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.cred-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--rule-soft);
  font-size: var(--fs-small);
  flex-wrap: wrap;
}

.cred-list li:last-child {
  border-bottom: none;
}

.cred-list li.school {
  color: var(--fg-muted);
}

.exp {
  color: var(--fg-subtle);
  font-size: var(--fs-small);
  flex-shrink: 0;
}

/* ── contact ───────────────────────────────────────────── */

.contact-section p {
  font-size: var(--fs-small);
  color: var(--fg-muted);
  margin: 0;
}

/* ── links (in content) ────────────────────────────────── */

a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-color: rgba(121, 192, 255, 0.35);
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

a:hover {
  color: var(--link-hover);
  text-decoration-color: var(--link-hover);
}

a:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ── colophon ──────────────────────────────────────────── */

.colophon {
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
}

.colophon p {
  margin: 0;
  color: var(--fg-subtle);
  font-size: var(--fs-small);
}

/* ── responsive ────────────────────────────────────────── */

@media (max-width: 640px) {
  :root {
    --fs-hero: 1.375rem;
    --wrap-pad: 1.25rem;
  }

  main.wrap {
    padding-top: 2rem;
  }

  .section {
    margin-bottom: 3rem;
  }

  .topbar .wrap {
    gap: 1rem;
  }

  .topbar nav {
    gap: 1rem;
  }

  .hero-contact {
    line-height: 1.9;
    word-spacing: 0;
  }

  .hero-contact .sep {
    display: none;
  }

  .hero-contact a {
    display: block;
  }

  .creds {
    gap: 2rem;
  }

  .cred-list li {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
  }
}

/* ── reduced motion ────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}

/* ── selection ────────────────────────────────────────── */

::selection {
  background: rgba(126, 231, 135, 0.25);
  color: var(--fg);
}

/* ── write-ups teaser (homepage) ───────────────────────────── */

.writeups-teaser p {
  color: var(--fg-muted);
  margin: 0;
  max-width: 62ch;
}

/* ── write-ups index page ──────────────────────────────────── */

.writeup-entry {
  margin-bottom: 2.75rem;
  padding-bottom: 2.75rem;
  border-bottom: 1px solid var(--rule-soft);
}

.writeup-entry:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.writeup-style {
  color: var(--prompt);
  font-size: var(--fs-small);
  margin: 0 0 0.5rem;
  font-weight: 500;
}

.writeup-entry h3 {
  font-size: var(--fs-h3);
  margin: 0 0 0.5rem;
  line-height: var(--lh-tight);
}

.writeup-entry h3 a {
  color: var(--fg);
  text-decoration: none;
}

.writeup-entry h3 a:hover {
  color: var(--link);
}

.writeup-entry p {
  color: var(--fg-muted);
  margin: 0;
  max-width: 62ch;
}

/* ── write-up article page ─────────────────────────────────── */

.back-link {
  display: inline-block;
  margin-bottom: 2.5rem;
  font-size: var(--fs-small);
}

.writeup-header {
  margin-bottom: 2.5rem;
}

.writeup-header h1 {
  font-size: var(--fs-hero);
  line-height: 1.35;
  font-weight: 600;
  color: var(--fg);
  margin: 0 0 0.75rem;
  max-width: 40ch;
}

.writeup-meta {
  color: var(--fg-subtle);
  font-size: var(--fs-small);
  margin: 0;
}

.writeup-body {
  max-width: 68ch;
  color: var(--fg);
}

.writeup-body h2 {
  font-size: var(--fs-h3);
  color: var(--fg);
  font-weight: 600;
  margin: 2.5rem 0 1rem;
  line-height: var(--lh-tight);
}

.writeup-body h2:first-child {
  margin-top: 0;
}

.writeup-body p {
  margin: 0 0 1.25rem;
}

.writeup-body ul,
.writeup-body ol {
  margin: 0 0 1.25rem;
  padding-left: 1.25rem;
}

.writeup-body li {
  margin-bottom: 0.5rem;
}

.writeup-body li::marker {
  color: var(--fg-subtle);
}

.writeup-body strong {
  color: var(--fg);
  font-weight: 600;
}

.writeup-body code {
  background: var(--bg-elev);
  padding: 0.15em 0.4em;
  border-radius: 3px;
  font-size: 0.9em;
}

.writeup-body pre {
  background: var(--bg-elev);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  margin: 0 0 1.5rem;
  font-size: var(--fs-small);
  line-height: 1.6;
}

.writeup-body pre code {
  background: none;
  padding: 0;
}

.writeup-body blockquote {
  margin: 0 0 1.5rem;
  padding: 0.25rem 0 0.25rem 1.25rem;
  border-left: 2px solid var(--prompt);
  color: var(--fg-muted);
}

.writeup-body blockquote p:last-child {
  margin-bottom: 0;
}

.writeup-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.5rem;
  font-size: var(--fs-small);
}

.writeup-body th,
.writeup-body td {
  text-align: left;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--rule-soft);
}

.writeup-body th {
  color: var(--fg-muted);
  font-weight: 600;
}

.writeup-footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
}

@media (max-width: 640px) {
  .writeup-header h1 {
    max-width: none;
  }
}
