/* =========================================================
   Charlie Mackellar: modern site with a Renaissance twist
   Paper, ink, ultramarine, gold construction lines
   ========================================================= */
@font-face { font-family: "EB Garamond"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/eb-garamond-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "EB Garamond"; font-style: italic; font-weight: 400; font-display: swap; src: url("fonts/eb-garamond-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "EB Garamond"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/eb-garamond-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Instrument Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/instrument-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Instrument Sans"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/instrument-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Instrument Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/instrument-sans-latin-600-normal.woff2") format("woff2"); }

:root {
  --paper: #f6f2e9;
  --paper-2: #efe9dc;
  --ink: #1f1b16;
  --ink-2: #4b4438;
  --ink-3: #5a5245;
  --blue: #2a3f8f;
  --blue-dark: #1e2f6e;
  --gold: #a8822f;
  --rule: #d9cfba;

  --serif: "EB Garamond", Garamond, Georgia, serif;
  --sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --wrap: 1240px;
  --pad: clamp(20px, 5vw, 64px);

  --x: 75vw; --y: 30vh;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

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

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 400; margin: 0; }
p { margin: 0 0 1em; }
a { color: var(--ink); text-underline-offset: 5px; text-decoration-thickness: 1px; }
a:hover { color: var(--blue); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--pad); }
.muted { color: var(--ink-3); }

.skip { position: absolute; left: -999px; top: 0; z-index: 50; background: var(--ink); color: var(--paper); padding: 10px 16px; }
.skip:focus { left: 16px; top: 16px; }

/* ---------- drafting grid that follows the cursor ---------- */
.grid-reveal {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(168, 130, 47, 0.32) 1px, transparent 1px),
    linear-gradient(90deg, rgba(168, 130, 47, 0.32) 1px, transparent 1px),
    linear-gradient(rgba(168, 130, 47, 0.14) 1px, transparent 1px),
    linear-gradient(90deg, rgba(168, 130, 47, 0.14) 1px, transparent 1px);
  background-size: 96px 96px, 96px 96px, 24px 24px, 24px 24px;
  -webkit-mask-image: radial-gradient(circle 260px at var(--x) var(--y), #000 0%, rgba(0,0,0,0.35) 55%, transparent 100%);
          mask-image: radial-gradient(circle 260px at var(--x) var(--y), #000 0%, rgba(0,0,0,0.35) 55%, transparent 100%);
}
.site-header, main, .site-footer { position: relative; z-index: 1; }

/* ---------- buttons ---------- */
.btn {
  display: inline-block;
  padding: 15px 28px;
  background: var(--blue); color: var(--paper);
  font-weight: 600; font-size: 16px; text-decoration: none;
  transition: background-color 0.2s;
}
.btn:hover { background: var(--blue-dark); color: var(--paper); }
.btn-outline {
  display: inline-block;
  padding: 9px 20px;
  border: 1px solid var(--blue); color: var(--blue);
  text-decoration: none;
  transition: background-color 0.2s, color 0.2s;
}
.btn-outline:hover { background: var(--blue); color: var(--paper); }
.link-strong { font-weight: 600; font-size: 16px; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: rgba(246, 242, 233, 0.94);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--rule);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 24px;
  padding-top: 22px; padding-bottom: 22px;
}
.wordmark { font-family: var(--serif); font-size: 24px; text-decoration: none; }
.site-header nav { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 32px; font-size: 15px; font-weight: 500; }
.site-header nav a:not(.btn-outline) { text-decoration: none; padding: 4px 0; border-bottom: 1px solid transparent; }
.site-header nav a[aria-current="true"] { color: var(--blue); border-bottom-color: var(--gold); }

/* ---------- hero ---------- */
.hero { padding-top: 72px; }
.hero-grid { display: flex; flex-wrap: wrap; align-items: center; gap: 48px 80px; padding-bottom: 56px; }
.hero-text { flex: 1 1 520px; min-width: 0; }
.hero h1 { font-size: clamp(52px, 8vw, 104px); line-height: 0.98; letter-spacing: -0.015em; margin-bottom: 24px; }
.hero-lead { max-width: 46ch; font-size: 19px; color: var(--ink-2); margin-bottom: 36px; }

.vitruvian { flex: 0 1 420px; margin: 0 auto; }
.vitruvian svg { display: block; width: 100%; height: auto; }
.construct { fill: none; stroke: var(--gold); stroke-width: 1; }
.fields { fill: none; stroke: var(--blue); stroke-width: 1.5; }
.center-dot { fill: var(--blue); }
.labels { font-family: var(--serif); font-style: italic; font-size: 20px; fill: var(--ink); text-anchor: middle; }
.vitruvian figcaption { margin-top: 14px; font-family: var(--serif); font-style: italic; font-size: 17px; color: var(--ink-3); text-align: center; }

.status {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px 48px;
  margin: 0; padding: 28px 0 8px;
  border-top: 1px solid var(--rule);
}
.status dt { font-family: var(--serif); font-style: italic; font-size: 18px; color: var(--blue); margin-bottom: 6px; }
.status dd { margin: 0; font-size: 15px; line-height: 1.55; }

/* ---------- sections ---------- */
.section { padding-top: 120px; padding-bottom: 40px; }
.section h2 { font-size: clamp(40px, 5vw, 60px); line-height: 1.02; letter-spacing: -0.01em; }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 40px; padding-bottom: 28px; margin-bottom: 40px; border-bottom: 1px solid var(--rule); }
.section-head p { margin: 0; max-width: 46ch; color: var(--ink-2); }

/* About: heading column + body */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 3fr); gap: 32px 64px; }
.split h2 { padding-top: 6px; }
.statement { font-family: var(--serif); font-size: clamp(28px, 3.2vw, 40px); line-height: 1.2; margin-bottom: 36px; max-width: 28ch; }
.two-col { columns: 2 22rem; column-gap: 48px; color: var(--ink-2); }
.two-col p { break-inside: avoid; }
.note { margin-top: 12px; padding-top: 20px; border-top: 1px solid var(--rule); color: var(--ink-2); }
.note em { font-family: var(--serif); font-size: 19px; color: var(--blue); }

/* Skills */
.skills { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.skills > div { padding: 0 28px; border-left: 1px solid var(--rule); }
.skills > div:first-child { padding-left: 0; border-left: 0; }
.skills h3 { font-size: 26px; margin-bottom: 14px; }
.skills ul { list-style: none; margin: 0; padding: 0; }
.skills li { padding: 6px 0; font-size: 16px; line-height: 1.45; }
.table-title { font-size: 30px; margin: 80px 0 16px; }
.certs { width: 100%; border-collapse: collapse; font-size: 16px; }
.certs th { text-align: left; font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 17px; color: var(--ink-3); padding: 10px 16px 10px 0; border-bottom: 1px solid var(--ink); }
.certs td { padding: 14px 16px 14px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.certs td:nth-child(2) { color: var(--ink-2); }
.certs td:last-child, .certs th:last-child { text-align: right; padding-right: 0; white-space: nowrap; }

/* Projects: full-width rows on a tinted band */
.projects-band { background: var(--paper-2); padding-bottom: 96px; margin-top: 80px; border-block: 1px solid var(--rule); }
.project {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.5fr) minmax(0, 1.2fr); gap: 20px 48px;
  padding: 36px 0; border-bottom: 1px solid var(--rule);
}
.project:last-child { border-bottom: 0; }
.project-meta h3 { font-size: 30px; line-height: 1.1; margin-bottom: 8px; }
.project-meta p { margin: 0; font-size: 15px; color: var(--ink-3); }
.project-desc { margin: 0; font-size: 17px; }
.project-side p { font-size: 15px; color: var(--ink-2); margin-bottom: 12px; }
.project-side p:last-child { margin-bottom: 0; }
.project-side em { display: block; font-family: var(--serif); font-size: 17px; color: var(--blue); }

/* Experience */
.timeline-group { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 3fr); gap: 16px 64px; margin-bottom: 56px; }
.group-title { font-size: 28px; font-style: italic; color: var(--blue); padding-top: 2px; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline > li { display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: 8px 32px; padding: 0 0 32px; margin-bottom: 32px; border-bottom: 1px solid var(--rule); }
.timeline > li:last-child { margin-bottom: 0; }
.when { margin: 0; font-size: 15px; color: var(--ink-3); line-height: 1.5; padding-top: 4px; }
.when span { display: block; }
.timeline h4 { font-size: 24px; line-height: 1.2; margin-bottom: 4px; }
.role { font-family: var(--serif); font-style: italic; font-size: 18px; color: var(--ink-2); margin-bottom: 10px; }
.timeline ul { margin: 0; padding-left: 1.1rem; }
.timeline ul li { margin-bottom: 6px; }
.timeline ul li::marker { color: var(--gold); }
.timeline p:last-child { margin-bottom: 0; }

/* Contact */
.contact { padding-bottom: 120px; }
.contact h2 { font-size: clamp(48px, 7vw, 88px); margin-bottom: 20px; }
.contact-lead { max-width: 46ch; font-size: 19px; color: var(--ink-2); margin-bottom: 32px; }

/* Footer */
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding-top: 24px; padding-bottom: 40px; border-top: 1px solid var(--rule); font-size: 14px; color: var(--ink-3); }
.footer-inner p { margin: 0; }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .skills { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 40px; }
  .skills > div:nth-child(3) { padding-left: 0; border-left: 0; }
  .project { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); }
  .project-side { grid-column: 2; }
}
@media (max-width: 760px) {
  body { font-size: 16px; }
  .header-inner { padding-top: 14px; padding-bottom: 14px; }
  .site-header nav { gap: 6px 18px; }
  .hero { padding-top: 48px; }
  .status { grid-template-columns: 1fr; gap: 18px; }
  .section { padding-top: 80px; }
  .split, .timeline-group { grid-template-columns: 1fr; }
  .skills { grid-template-columns: 1fr; row-gap: 28px; }
  .skills > div { padding: 0; border-left: 0; }
  .certs thead { display: none; }
  .certs tr { display: block; padding: 12px 0; border-bottom: 1px solid var(--rule); }
  .certs td { display: inline; padding: 0; border: 0; }
  .certs td:first-child { display: block; }
  .certs td:nth-child(2):not(:empty)::after { content: ""; }
  .certs td:last-child:not(:empty)::before { content: ", "; }
  .certs td:last-child { text-align: left; color: var(--ink-2); }
  .project { grid-template-columns: 1fr; }
  .project-side { grid-column: auto; }
  .timeline > li { grid-template-columns: 1fr; }
  .when span { display: inline; }
  .when span::before { content: ", "; }
}
