/* ============================================================
   WILL MALFELD — personal site
   Design language: field-notes / trail-map. A topographic
   contour line runs through the page as the connective thread
   between engineering, teaching, and mountains.
   ============================================================ */

:root {
  /* --- color --- */
  --ink:        #1F2B24;   /* deep pine — primary text */
  --ink-soft:   #48584B;   /* muted body text */
  --mist:       #EDF0E9;   /* page background */
  --paper:      #FAFAF6;   /* card / panel background */
  --line:       rgba(31, 43, 36, 0.14);
  --line-soft:  rgba(31, 43, 36, 0.08);
  --blaze:      #C1502E;   /* trail-blaze rust — primary accent */
  --blaze-dim:  #A8431F;
  --chalk:      #3E6E8E;   /* chalkboard blue — teaching accent */
  --contour:    #B08D4F;   /* elevation-line gold — tertiary accent */
  --cream:      #F7F5EE;

  /* --- type --- */
  --f-display: 'Big Shoulders Display', sans-serif;
  --f-body:    'Public Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --f-mono:    'JetBrains Mono', ui-monospace, monospace;

  --wrap: 1100px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

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

img { max-width: 100%; display: block; }
a { color: inherit; }

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 32px;
}

@media (max-width: 640px) {
  .wrap { padding: 0 20px; }
}

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ---------- eyebrow / section headers ---------- */
.eyebrow {
  font-family: var(--f-mono);
  font-size: 12.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blaze);
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
}
.eyebrow::before {
  content: '';
  width: 22px;
  height: 1px;
  background: var(--blaze);
  display: inline-block;
}

.section-title {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: clamp(30px, 4vw, 44px);
  letter-spacing: -0.01em;
  line-height: 1.05;
  margin: 0 0 34px;
  text-transform: uppercase;
}

section { padding: 84px 0; }
@media (max-width: 640px) { section { padding: 56px 0; } }

.hairline { border: none; border-top: 1px solid var(--line); margin: 0; }

/* ---------- nav ---------- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(237, 240, 233, 0.88);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-nav .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.brand {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 20px;
  letter-spacing: 0.01em;
  text-decoration: none;
  text-transform: uppercase;
}
.brand span { color: var(--blaze); }
.nav-links {
  display: flex;
  gap: 28px;
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: var(--f-mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.nav-links a {
  text-decoration: none;
  color: var(--ink-soft);
  padding-bottom: 4px;
  border-bottom: 1px solid transparent;
  transition: color .15s ease, border-color .15s ease;
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--blaze);
  border-color: var(--blaze);
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  padding: 76px 0 40px;
  overflow: hidden;
}
.contour-field {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0.55;
  pointer-events: none;
}
.hero .wrap { position: relative; z-index: 1; }

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 48px;
  align-items: end;
}
@media (max-width: 760px) {
  .hero-grid { grid-template-columns: 1fr; }
}

.hero-name {
  font-family: var(--f-display);
  font-weight: 900;
  font-size: clamp(48px, 9vw, 104px);
  line-height: 0.92;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  margin: 0 0 18px;
}

.hero-role {
  font-family: var(--f-mono);
  font-size: 15px;
  letter-spacing: 0.03em;
  color: var(--ink-soft);
  margin: 0 0 26px;
}
.hero-role .dot { color: var(--blaze); margin: 0 8px; }

.hero-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  font-family: var(--f-mono);
  font-size: 13.5px;
}
.hero-contact a {
  text-decoration: none;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  padding-bottom: 2px;
  transition: border-color .15s ease, color .15s ease;
}
.hero-contact a:hover { color: var(--blaze); border-color: var(--blaze); }

.portrait {
  width: 176px;
  height: 176px;
  border-radius: 50%;
  border: 2px solid var(--ink);
  background: var(--paper);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 44px;
  color: var(--ink);
  justify-self: end;
  position: relative;
}
.portrait::after {
  content: 'PHOTO';
  position: absolute;
  bottom: -22px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
  white-space: nowrap;
}
@media (max-width: 760px) { .portrait { justify-self: start; } }

/* ---------- bio + stats ---------- */
.bio-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 56px;
}
@media (max-width: 780px) {
  .bio-grid { grid-template-columns: 1fr; gap: 36px; }
}
.bio-grid p {
  font-size: 18px;
  color: var(--ink-soft);
  margin: 0 0 20px;
}
.bio-grid p:first-of-type {
  font-size: 21px;
  color: var(--ink);
  font-weight: 500;
}

.stat-panel {
  border: 1px solid var(--line);
  background: var(--paper);
  padding: 28px;
}
.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 14px 0;
  border-bottom: 1px solid var(--line-soft);
}
.stat-row:last-child { border-bottom: none; }
.stat-num {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 30px;
  color: var(--blaze);
}
.stat-label {
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  text-align: right;
  max-width: 130px;
}

/* ---------- experience timeline ---------- */
.elevation-strip { width: 100%; height: 64px; display: block; margin-bottom: 8px; }

.timeline { position: relative; }
.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 10px;
  bottom: 10px;
  width: 1px;
  background: repeating-linear-gradient(to bottom, var(--line) 0 6px, transparent 6px 12px);
}

.tl-entry {
  position: relative;
  padding: 0 0 52px 40px;
}
.tl-entry:last-child { padding-bottom: 0; }
.tl-entry::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--mist);
  border: 2px solid var(--blaze);
}

.tl-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 14px;
  margin-bottom: 6px;
}
.tl-role {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 23px;
  text-transform: uppercase;
  letter-spacing: 0.01em;
}
.tl-company { color: var(--blaze); font-weight: 700; }
.tl-meta {
  font-family: var(--f-mono);
  font-size: 12.5px;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
  margin-bottom: 14px;
}
.tl-entry ul {
  margin: 0;
  padding-left: 20px;
  color: var(--ink-soft);
}
.tl-entry li { margin-bottom: 7px; }
.tl-entry li:last-child { margin-bottom: 0; }
.tl-entry strong { color: var(--ink); }

/* ---------- highlight cards (leadership / resilience) ---------- */
.highlight-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
@media (max-width: 720px) { .highlight-grid { grid-template-columns: 1fr; } }

.h-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 3px solid var(--chalk);
  padding: 30px 28px;
}
.h-card.accent { border-left-color: var(--blaze); }
.h-card h3 {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 19px;
  text-transform: uppercase;
  margin: 0 0 10px;
}
.h-card p { margin: 0; color: var(--ink-soft); }

/* ---------- projects ---------- */
.project-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
@media (max-width: 860px) { .project-grid { grid-template-columns: 1fr; } }

.p-card {
  border: 1px solid var(--line);
  background: var(--paper);
  padding: 26px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.p-tag {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--contour);
}
.p-card h3 {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 20px;
  margin: 0;
  text-transform: uppercase;
}
.p-card p { margin: 0; color: var(--ink-soft); font-size: 15px; }

/* ---------- education & skills ---------- */
.ed-grid {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 48px;
}
@media (max-width: 780px) { .ed-grid { grid-template-columns: 1fr; gap: 32px; } }

.ed-item h3 {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 20px;
  text-transform: uppercase;
  margin: 0 0 4px;
}
.ed-item .tl-meta { margin-bottom: 0; }

.skill-group { margin-bottom: 20px; }
.skill-group:last-child { margin-bottom: 0; }
.skill-group h4 {
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 10px;
}
.pill-row { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  font-family: var(--f-mono);
  font-size: 12.5px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
}

/* ---------- footer CTA ---------- */
.footer-cta {
  background: var(--ink);
  color: var(--cream);
  padding: 80px 0 48px;
}
.footer-cta .eyebrow { color: var(--contour); }
.footer-cta .eyebrow::before { background: var(--contour); }
.footer-title {
  font-family: var(--f-display);
  font-weight: 900;
  font-size: clamp(34px, 6vw, 60px);
  text-transform: uppercase;
  line-height: 1;
  margin: 0 0 34px;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 24px 36px;
  font-family: var(--f-mono);
  font-size: 14px;
  margin-bottom: 40px;
}
.footer-links a {
  text-decoration: none;
  color: var(--cream);
  border-bottom: 1px solid rgba(247,245,238,0.3);
  padding-bottom: 2px;
}
.footer-links a:hover { border-color: var(--blaze); color: var(--blaze); }
.footer-bottom {
  border-top: 1px solid rgba(247,245,238,0.15);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-family: var(--f-mono);
  font-size: 12px;
  color: rgba(247,245,238,0.55);
}

/* ---------- scroll reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .6s ease, transform .6s ease;
}
.reveal.in { opacity: 1; transform: translateY(0); }

/* ============================================================
   BLOG
   ============================================================ */
.blog-hero { padding: 64px 0 20px; }
.blog-hero p {
  font-size: 19px;
  color: var(--ink-soft);
  max-width: 600px;
  margin: 0;
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 26px;
}
@media (max-width: 720px) { .post-grid { grid-template-columns: 1fr; } }

.post-card {
  border: 1px solid var(--line);
  background: var(--paper);
  text-decoration: none;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  transition: border-color .15s ease, transform .15s ease;
}
.post-card:hover { border-color: var(--blaze); transform: translateY(-2px); }
.post-thumb {
  height: 150px;
  background: var(--mist);
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.post-thumb svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.post-body { padding: 22px 24px 26px; }
.post-cat {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--blaze);
  margin-bottom: 10px;
}
.post-card h3 {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 22px;
  text-transform: uppercase;
  margin: 0 0 10px;
  line-height: 1.05;
}
.post-card p.excerpt {
  margin: 0 0 14px;
  color: var(--ink-soft);
  font-size: 14.5px;
}
.post-date {
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: auto;
}

/* single post page */
.post-header { padding: 60px 0 30px; }
.post-header .eyebrow { margin-bottom: 20px; }
.post-header h1 {
  font-family: var(--f-display);
  font-weight: 900;
  font-size: clamp(34px, 6vw, 58px);
  text-transform: uppercase;
  line-height: 1.02;
  margin: 0 0 20px;
}
.post-header .post-meta {
  font-family: var(--f-mono);
  font-size: 13px;
  color: var(--ink-soft);
}
.post-content {
  max-width: 720px;
  font-size: 18px;
  color: var(--ink-soft);
  padding-bottom: 40px;
}
.post-content p { margin: 0 0 22px; }
.post-content h2 {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 26px;
  text-transform: uppercase;
  color: var(--ink);
  margin: 40px 0 16px;
}
.post-content blockquote {
  margin: 32px 0;
  padding-left: 22px;
  border-left: 3px solid var(--blaze);
  font-size: 20px;
  color: var(--ink);
  font-style: italic;
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--f-mono);
  font-size: 13px;
  text-decoration: none;
  color: var(--ink-soft);
  margin-bottom: 8px;
}
.back-link:hover { color: var(--blaze); }
