/* ============================================================
   Henry Willis — Portfolio
   Design tokens + page styles
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

@font-face {
  font-family: 'Gelasio';
  src: url('fonts/Gelasio-VariableFont_wght.ttf') format('truetype-variations');
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Gelasio';
  src: url('fonts/Gelasio-Italic-VariableFont_wght.ttf') format('truetype-variations');
  font-weight: 300 700;
  font-style: italic;
  font-display: swap;
}

:root {
  --plum:      #6B4E71;
  --plum-ink:  #2A1F2E;
  --lilac:     #C8B8DB;
  --sage:      #BBC7A4;
  --terracotta:#E88D67;
  --cream:     #F9F4F5;
  --hairline:  #E6DCDE;
  --muted:     #7A6D75;

  --bg:           var(--cream);
  --bg-elevated:  #FFFDFD;
  --fg:           var(--plum-ink);
  --fg-muted:     var(--muted);
  --fg-subtle:    #A89BA1;
  --primary:      var(--plum);
  --secondary:    var(--lilac);
  --tertiary:     var(--sage);
  --accent:       var(--terracotta);
  --border:       var(--hairline);
  --link:         var(--plum);
  --link-hover:   var(--terracotta);
  --selection-bg: var(--lilac);
  --selection-fg: var(--plum-ink);

  --font-serif: 'Gelasio', 'Iowan Old Style', Georgia, serif;
  --font-sans:  'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono:  'JetBrains Mono', 'SF Mono', Menlo, monospace;

  --t-display:  56px;
  --t-h1:       40px;
  --t-h2:       28px;
  --t-h3:       20px;
  --t-body:     16px;
  --t-small:    14px;
  --t-eyebrow:  12px;
  --t-mono:     14px;

  --lh-tight:   1.1;
  --lh-snug:    1.3;
  --lh-body:    1.65;
  --lh-loose:   1.8;

  --s-1: 4px;  --s-2: 8px;   --s-3: 12px;  --s-4: 16px;
  --s-6: 24px; --s-8: 32px;  --s-12: 48px; --s-16: 64px; --s-24: 96px;

  --w-prose: 640px;
  --w-grid:  960px;
  --w-wide:  1120px;

  --r-button: 6px;
  --r-card:   10px;
  --r-image:  0px;
  --bw:       1px;

  --shadow-1: 0 1px 2px rgba(42, 31, 46, 0.04);
  --shadow-2: 0 8px 24px -12px rgba(42, 31, 46, 0.12);

  --ease:    cubic-bezier(0.22, 0.61, 0.36, 1);
  --t-fast:  150ms;
  --t-base:  250ms;
  --t-slow:  400ms;
}

/* ============================================================
   Base
   ============================================================ */

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

html, body { margin: 0; padding: 0; }
html { background: var(--bg); color: var(--fg); }

body {
  font-family: var(--font-sans);
  font-size: var(--t-body);
  line-height: var(--lh-body);
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

::selection { background: var(--selection-bg); color: var(--selection-fg); }

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  color: var(--primary);
  font-weight: 500;
  letter-spacing: -0.01em;
  margin: 0;
}

h1 { font-size: var(--t-h1); line-height: var(--lh-tight); }
h2 { font-size: var(--t-h2); line-height: var(--lh-snug); }
h3 { font-size: var(--t-h3); line-height: var(--lh-snug); font-weight: 600; }

p  { margin: 0 0 var(--s-4); max-width: var(--w-prose); text-wrap: pretty; }

a {
  color: var(--link);
  text-decoration: none;
  transition: color var(--t-fast) var(--ease);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
a:hover { color: var(--link-hover); text-decoration: underline; }
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

ul { padding-left: 1.1em; margin: 0 0 var(--s-4); }
li { margin-bottom: var(--s-2); }

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

hr {
  border: 0;
  border-top: var(--bw) solid var(--border);
  margin: var(--s-12) 0;
}

small { font-size: var(--t-small); color: var(--fg-muted); }

/* ============================================================
   Utility
   ============================================================ */

.eyebrow {
  font-family: var(--font-sans);
  font-size: var(--t-eyebrow);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-muted);
  font-weight: 500;
}
.muted { color: var(--fg-muted); }
.mono  { font-family: var(--font-mono); font-size: var(--t-mono); }
.serif { font-family: var(--font-serif); }

/* ============================================================
   Layout
   ============================================================ */

.app { display: flex; flex-direction: column; min-height: 100vh; background: var(--bg); }

.main {
  flex: 1;
  width: 100%;
  max-width: var(--w-grid);
  margin: 0 auto;
  padding: var(--s-12) var(--s-6) var(--s-16);
}

/* ============================================================
   Header
   ============================================================ */

.header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  padding: 0 var(--s-8);
  background: rgba(249, 244, 245, 0.78);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.mark {
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 600;
  color: var(--primary);
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.mark:hover { color: var(--primary); text-decoration: none; }
.mark .dot { color: var(--accent); margin: 0 4px; }

.nav { display: flex; gap: 26px; }
.nav a {
  font-size: 14px;
  color: var(--fg);
  padding: 4px 0;
  border-bottom: 1px solid transparent;
  transition: color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.nav a:hover { color: var(--accent); text-decoration: none; }
.nav a.is-active { color: var(--primary); border-bottom-color: var(--accent); }

/* ============================================================
   Footer
   ============================================================ */

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--s-6) var(--s-8);
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--fg-muted);
  margin-top: var(--s-12);
  gap: var(--s-4);
  flex-wrap: wrap;
}
.foot-links { display: flex; gap: 18px; }
.foot-links a { color: var(--fg-muted); }
.foot-links a:hover { color: var(--accent); text-decoration: none; }

/* ============================================================
   Page header (per-page)
   ============================================================ */

.page-head {
  padding-top: var(--s-6);
  padding-bottom: var(--s-8);
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  max-width: var(--w-prose);
}
.page-head h1 { font-weight: 400; }
.page-head .lede { font-size: 17px; line-height: 1.6; color: var(--fg-muted); }

/* ============================================================
   Home — hero
   ============================================================ */

.hero {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: var(--s-12);
  align-items: start;
  padding-top: var(--s-8);
  padding-bottom: var(--s-16);
}
.hero-text { display: flex; flex-direction: column; gap: var(--s-4); }
.hero-display {
  font-family: var(--font-serif);
  font-size: 44px;
  line-height: 1.1;
  color: var(--primary);
  font-weight: 400;
  letter-spacing: -0.015em;
  margin: var(--s-2) 0 var(--s-2);
  max-width: 580px;
  text-wrap: balance;
}
.hero-display .name { font-style: italic; }
.hero-lede {
  font-size: 17px;
  line-height: 1.6;
  color: var(--fg);
  max-width: 540px;
}
.hero-aside {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  padding: 14px 14px 48px;
  position: relative;
}
.hero-aside::after {
  content: '';
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 18px;
  height: 1px;
  background: var(--secondary);
  opacity: 0.7;
}
.hero-aside img {
  width: 100%;
  aspect-ratio: 4/5;
  object-fit: cover;
  display: block;
  border: 1px solid var(--plum-ink);
  border-radius: 0;
  filter: saturate(0.92) contrast(0.97);
}

.now {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--fg-muted);
  margin-top: var(--s-2);
}
.now-dot {
  width: 8px;
  height: 8px;
  background: var(--tertiary);
  border-radius: 50%;
  flex-shrink: 0;
}

.cta-row {
  display: flex;
  gap: var(--s-6);
  align-items: center;
  margin-top: var(--s-4);
  flex-wrap: wrap;
}
.link-line {
  font-size: 14px;
  color: var(--primary);
  border-bottom: 1px solid var(--border);
  padding-bottom: 2px;
}
.link-line:hover { border-bottom-color: var(--accent); color: var(--accent); text-decoration: none; }

/* ============================================================
   Home — education
   ============================================================ */

.section { padding: var(--s-12) 0; }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: var(--s-6);
  gap: var(--s-6);
}
.section-head h2 { font-weight: 500; }

.edu-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--s-6);
  align-items: stretch;
}
.edu-item {
  border-top: 1px solid var(--border);
  padding-top: var(--s-4);
  display: grid;
  grid-template-columns: 44px 1fr;
  grid-template-rows: auto auto 1fr auto;
  column-gap: var(--s-4);
  row-gap: 4px;
  align-items: start;
}
.edu-crest {
  grid-row: 1 / -1;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}
.edu-crest img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.edu-item h3 {
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 600;
  margin: 0;
  align-self: start;
  letter-spacing: -0.005em;
}
.edu-item.hls h3 { color: #B81E30; }
.edu-item.bu  h3 { color: #CC0000; }
.edu-meta { font-size: 14px; color: var(--fg); margin: 0; grid-column: 2; }
.edu-detail {
  font-size: 13px;
  color: var(--fg-muted);
  display: flex;
  gap: var(--s-3);
  align-items: baseline;
  flex-wrap: wrap;
  grid-column: 2;
}
.edu-detail .sep { color: var(--fg-subtle); }
.edu-item.hls .edu-detail a:hover { color: #B81E30; }
.edu-item.bu  .edu-detail a:hover { color: #CC0000; }
.edu-dates {
  grid-column: 2;
  grid-row: 4;
  align-self: end;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--fg-muted);
  margin-top: 4px;
}

/* ============================================================
   Projects list
   ============================================================ */

.proj-list {
  display: flex;
  flex-direction: column;
}
.proj {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: var(--s-6);
  align-items: baseline;
  padding: var(--s-6) 0;
  border-top: 1px solid var(--border);
}
.proj:last-child { border-bottom: 1px solid var(--border); }
.proj-kind {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-muted);
  letter-spacing: 0.04em;
  text-transform: lowercase;
}
.proj-body { display: flex; flex-direction: column; gap: var(--s-3); }
.proj-body h3 {
  font-family: var(--font-serif);
  font-size: 22px;
  color: var(--primary);
  margin: 0;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.005em;
}
.proj-body p {
  font-size: 15px;
  line-height: 1.6;
  color: var(--fg);
  margin: 0;
  max-width: 640px;
}
.tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: var(--s-2);
}
.tag {
  display: inline-block;
  background: var(--secondary);
  color: var(--plum-ink);
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
}
.tag.sage { background: var(--tertiary); }

/* ============================================================
   Work timeline
   ============================================================ */

.work-list {
  display: flex;
  flex-direction: column;
}
.work-item {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: var(--s-6);
  padding: var(--s-6) 0;
  border-top: 1px solid var(--border);
  align-items: baseline;
}
.work-item:last-child { border-bottom: 1px solid var(--border); }
.work-period {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-muted);
  letter-spacing: 0.04em;
}
.work-body { display: flex; flex-direction: column; gap: var(--s-2); }
.work-body h3 {
  font-family: var(--font-serif);
  font-size: 22px;
  color: var(--primary);
  margin: 0;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.005em;
}
.work-org {
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--fg);
  margin: 0;
}
.work-org .sep { color: var(--fg-subtle); margin: 0 6px; }
.work-org .loc { color: var(--fg-muted); }
.work-list-items {
  list-style: none;
  padding: 0;
  margin: var(--s-2) 0 0;
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}
.work-list-items li {
  font-size: 15px;
  line-height: 1.55;
  color: var(--fg);
  padding-left: var(--s-4);
  position: relative;
  max-width: 640px;
  margin: 0;
}
.work-list-items li::before {
  content: '·';
  position: absolute;
  left: 0;
  top: -2px;
  color: var(--accent);
  font-size: 18px;
}

/* ============================================================
   Contact
   ============================================================ */

.contact-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: var(--s-12);
  align-items: start;
}
.contact-prose p {
  font-size: 16px;
  line-height: 1.7;
  max-width: 560px;
}
.contact-card {
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: var(--s-6);
  background: var(--bg-elevated);
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}
.contact-card h3 {
  font-family: var(--font-serif);
  font-size: 22px;
  color: var(--primary);
  margin: 0;
  font-weight: 500;
}
.contact-row {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: var(--s-4);
  align-items: baseline;
  padding: var(--s-3) 0;
  border-top: 1px solid var(--border);
  font-size: 14px;
}
.contact-row:first-of-type { border-top: 0; padding-top: 0; }
.contact-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-muted);
}
.contact-value { color: var(--fg); word-break: break-word; }
.contact-value a { color: var(--primary); border-bottom: 1px solid var(--border); padding-bottom: 1px; }
.contact-value a:hover { color: var(--accent); border-bottom-color: var(--accent); text-decoration: none; }

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 760px) {
  .header { padding: 0 var(--s-4); }
  .nav { gap: 18px; }
  .main { padding: var(--s-8) var(--s-4) var(--s-12); }
  .hero { grid-template-columns: 1fr; gap: var(--s-8); }
  .hero-display { font-size: 32px; }
  .hero-aside { max-width: 320px; }
  .edu-list { grid-template-columns: 1fr; }
  .proj { grid-template-columns: 1fr; gap: var(--s-2); }
  .proj-kind { font-size: 11px; }
  .work-item { grid-template-columns: 1fr; gap: var(--s-2); }
  .work-period { font-size: 11px; }
  .contact-grid { grid-template-columns: 1fr; gap: var(--s-8); }
  .footer { padding: var(--s-4); }
}
