/* ===== Max MG — personal site =====
   "Ink" design: cream paper + deep ink + one red accent.
   Change --accent to retheme every highlight at once. */

:root {
  --paper: #efece2;
  --panel: #f7f5ee;
  --ink: #17153a;
  --accent: #17153a; /* monochrome: accent = ink (C1 "Ink" design) */
  --muted: #444163;
  --line: #c9c5b4;
  --mono: ui-monospace, "Cascadia Code", Consolas, "SF Mono", monospace;
  --sans: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Inter, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background-color: var(--paper);
  /* Subtle full-bleed texture so wide screens don't read as an empty
     margin either side of the content column — barely perceptible. */
  background-image: repeating-linear-gradient(
    135deg,
    rgba(23, 21, 58, 0.035) 0px,
    rgba(23, 21, 58, 0.035) 1px,
    transparent 1px,
    transparent 26px
  );
  color: var(--ink);
  line-height: 1.6;
  font-size: 16.5px;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 960px; margin: 0 auto; padding: 0 28px; }

a { color: var(--ink); }

.mono { font-family: var(--mono); }

/* ---- Nav ---- */
nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 22px 0;
  border-bottom: 2px solid var(--ink);
}

nav .brand { font-weight: 800; letter-spacing: 0.01em; text-decoration: none; font-size: 15px; }

.nav-left { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

.nav-icons { display: flex; gap: 8px; }

.icon-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 99px;
  border: 1.5px solid var(--ink);
  color: var(--ink);
  transition: all 0.12s ease;
}

.icon-pill:hover { background: var(--ink); color: var(--paper); }

a[href^="mailto:"] { position: relative; }

.copied-tip {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--paper);
  font-family: var(--mono);
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
}

nav .links { display: flex; gap: 10px; flex-wrap: wrap; }

nav .links a {
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.08em;
  color: var(--ink);
  text-decoration: none;
  border: 1.5px solid var(--ink);
  padding: 7px 14px;
  border-radius: 99px;
  transition: all 0.12s ease;
  white-space: nowrap;
}

nav .links a:hover { background: var(--ink); color: var(--paper); }
nav .links a.primary { background: var(--ink); color: var(--paper); }
nav .links a.primary:hover { background: transparent; color: var(--ink); }

/* ---- Hero ---- */
.hero {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 40px;
  align-items: center;
  padding: 68px 0 56px;
  border-bottom: 2px solid var(--ink);
}

.kicker {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  margin-bottom: 18px;
}

.kicker b { background: var(--ink); color: var(--paper); padding: 3px 8px; font-weight: 700; }

h1 {
  font-size: clamp(34px, 6vw, 56px);
  line-height: 1.03;
  letter-spacing: -0.025em;
  font-weight: 800;
}

h1 em { font-style: italic; font-weight: 400; }

.hero p.lede { max-width: 46ch; margin-top: 22px; font-size: 16px; color: var(--muted); }

.cta-row { display: flex; gap: 14px; margin-top: 30px; flex-wrap: wrap; }

.btn {
  display: inline-block;
  font-weight: 700;
  font-size: 14px;
  font-family: var(--sans);
  text-decoration: none;
  padding: 12px 22px;
  border-radius: 99px;
  border: 2px solid var(--ink);
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  transition: all 0.12s ease;
}

.btn:hover { background: var(--ink); color: var(--paper); }

.btn.accent { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn.accent:hover { background: transparent; color: var(--ink); filter: none; }

.btn.fill { background: var(--ink); color: var(--paper); }
.btn.fill:hover { background: transparent; color: var(--ink); }

/* ---- Photo frame ---- */
.photo {
  justify-self: end;
  transform: rotate(2.5deg);
  border: 2.5px solid var(--ink);
  background: #e6e2d3;
  padding: 10px 10px 14px;
  width: min(240px, 100%);
}

.photo .img {
  aspect-ratio: 4 / 5;
  background: repeating-linear-gradient(45deg, #dbd6c5, #dbd6c5 8px, #d1ccb9 8px, #d1ccb9 16px);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.photo .img img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.05); }

.photo .cap {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-align: center;
  margin-top: 10px;
  font-weight: 700;
}

/* ---- Full-bleed panel band: stats strip + work index sit on a
   continuous edge-to-edge panel so wide screens get rhythm instead of
   a column floating in empty margins. Text itself stays column-width. ---- */
.bleed { background: var(--panel); }

/* ---- Stats strip: quiet mono line under the hero ---- */
.band {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  padding: 14px 0;
  border-bottom: 1.5px solid var(--line);
}

.band .wrap { display: flex; gap: 8px 30px; flex-wrap: wrap; justify-content: space-between; }
.band span { white-space: nowrap; }
.band b { color: var(--ink); font-weight: 700; }

/* ---- Section labels ---- */
section { padding: 44px 0 10px; }

.index-head {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  margin-bottom: 8px;
  color: var(--muted);
}

/* ---- Work index rows ---- */
.row {
  display: grid;
  grid-template-columns: 40px 1fr 200px 60px 30px;
  gap: 14px;
  align-items: baseline;
  padding: 17px 8px;
  border-bottom: 1.5px solid var(--line);
  text-decoration: none;
  color: var(--ink);
  transition: all 0.1s ease;
}

.row:hover { background: var(--ink); color: var(--paper); }
.bleed .row { background: var(--panel); }
.bleed .row:hover { background: var(--ink); }

.row .no, .row .tag, .row .yr { font-family: var(--mono); font-size: 12.5px; }
.row .tag { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.ico { flex-shrink: 0; }
.row .no { color: var(--muted); font-weight: 700; }
.row:hover .no { color: var(--paper); opacity: 0.7; }
.row .name { font-size: 19px; font-weight: 700; letter-spacing: -0.01em; }
.row .yr { text-align: right; }
.row .go { font-weight: 800; font-size: 18px; text-align: right; }

/* ---- Category filter pills (Work page) ---- */
.filter-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 8px 0 30px; }

.filter-pill {
  font: 700 13px var(--sans);
  padding: 9px 18px;
  border-radius: 99px;
  border: 2px solid var(--ink);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.12s ease;
}

.filter-pill:hover:not(.active) { background: rgba(23, 21, 58, 0.06); }
.filter-pill.active { background: var(--ink); color: var(--paper); }

/* ---- Prose / about ---- */
.prose { max-width: 62ch; color: var(--muted); font-size: 15.5px; }
.prose a { color: var(--ink); font-weight: 600; }

.sec-label {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 16px;
}

/* ---- Embed cards (projects page) ---- */
.embed-card {
  border: 2px solid var(--ink);
  background: var(--panel);
  margin-bottom: 26px;
  scroll-margin-top: 24px;
}

.embed-card.flash { animation: card-flash 1.8s ease-out; }

@keyframes card-flash {
  0% { box-shadow: 0 0 0 5px var(--ink); }
  100% { box-shadow: 0 0 0 5px transparent; }
}

.embed-card .embed-head {
  padding: 20px 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
}

.embed-card .tagline {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.14em;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 6px;
}

.embed-card h3 { font-size: 18px; letter-spacing: -0.01em; }
.embed-card .embed-head p { color: var(--muted); font-size: 14px; margin-top: 5px; max-width: 58ch; }

.embed-actions { display: flex; gap: 10px; flex-shrink: 0; flex-wrap: wrap; }
.embed-actions .btn { padding: 9px 16px; font-size: 13px; }

/* Sized so the report area is exactly 16:9 after Power BI's ~36px
   bottom toolbar — otherwise the embed letterboxes at an odd zoom. */
.embed-frame { display: none; border-top: 2px solid var(--ink); }
.embed-frame.open { display: block; position: relative; padding-top: calc(56.25% + 36px); }
.embed-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #fff; }

/* ---- Repo cards ---- */
.card-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }

.card {
  display: block;
  border: 2px solid var(--ink);
  padding: 18px 20px;
  background: var(--panel);
  color: var(--ink);
  text-decoration: none;
  transition: all 0.1s ease;
}

.card:hover { background: var(--ink); color: var(--paper); }
.card .meta { display: flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 11.5px; color: var(--muted); font-weight: 700; letter-spacing: 0.12em; margin-bottom: 6px; }
.card:hover .meta { color: var(--paper); opacity: 0.7; }
.card h3 { font-size: 16.5px; }
.card p { font-size: 13.5px; margin-top: 6px; opacity: 0.75; }

.card-links { display: flex; gap: 14px; margin-top: 12px; }
.card-links a { font-family: var(--mono); font-size: 12px; font-weight: 700; letter-spacing: 0.06em; color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.card-links a:hover { opacity: 0.7; }

/* ---- Footer ---- */
footer { margin-top: 60px; border-top: 2px solid var(--ink); }

footer .foot {
  padding: 34px 0 60px;
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  flex-wrap: wrap;
}

footer .big { font-size: clamp(24px, 4vw, 34px); font-weight: 800; letter-spacing: -0.02em; }
footer .big a { color: var(--ink); text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 2.5px; }
footer .big a:hover { background: var(--ink); color: var(--paper); text-decoration: none; }

footer .small {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  text-align: right;
  line-height: 1.9;
}
footer .small a { color: var(--muted); text-decoration: none; }
footer .small a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

/* ---- Page intro (subpages) ---- */
.page-intro { padding: 52px 0 34px; }
.page-intro h1 { font-size: clamp(28px, 4.5vw, 40px); }
.page-intro p.lede { max-width: 56ch; margin-top: 16px; font-size: 16px; color: var(--muted); }

/* ---- CV page ---- */
.cv-actions { display: flex; gap: 12px; margin: 0 0 12px; flex-wrap: wrap; align-items: center; }

.cv-toggle {
  display: inline-flex;
  border: 2px solid var(--ink);
  border-radius: 99px;
  padding: 3px;
  gap: 2px;
}

.cv-toggle button {
  font: 700 12.5px var(--sans);
  text-transform: none;
  letter-spacing: normal;
  padding: 7px 16px;
  border-radius: 99px;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

/* Experience section header doubles as the detail-level switcher —
   sticky so it stays reachable while scrolling through a long job list. */
.cv-section-head-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  background: var(--panel);
  z-index: 5;
}

.cv-toggle button.active { background: var(--ink); color: var(--paper); }

.dl-note { display: block; font-family: var(--mono); font-size: 12px; color: var(--muted); margin: 0 0 22px; }

/* Compact mode: positions only, no bullet detail */
.cv-compact .cv-job ul { display: none; }
.cv-compact .cv-job { margin-bottom: 10px; }

#cv {
  border: 2px solid var(--ink);
  background: var(--panel);
  padding: 44px 48px;
  margin-bottom: 10px;
}

#cv header.cv-head { margin-bottom: 28px; }
#cv h1.cv-name { font-size: 30px; letter-spacing: -0.02em; }
#cv .cv-title-line { color: var(--muted); margin-top: 4px; font-size: 15px; }
#cv .cv-contact { font-size: 13.5px; color: var(--muted); margin-top: 10px; }
#cv .cv-contact a { color: var(--ink); font-weight: 600; }
#cv .cv-contact span + span::before { content: "  ·  "; color: var(--line); }

.cv-section { margin-top: 26px; }

.cv-section > h2 {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
  border-bottom: 1.5px solid var(--line);
  padding-bottom: 6px;
  margin-bottom: 14px;
  font-weight: 700;
}

.cv-job { margin-bottom: 18px; }
.cv-job .cv-job-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.cv-job h3 { font-size: 16px; font-weight: 700; }
.cv-job .cv-dates { font-family: var(--mono); font-size: 12px; color: var(--muted); white-space: nowrap; padding-top: 3px; }
.cv-job .cv-company { color: var(--muted); font-size: 14px; }
.cv-job ul { margin: 8px 0 0 18px; }
.cv-job ul li { font-size: 14px; margin-bottom: 5px; }

.cv-inline-list { font-size: 14px; }
.cv-inline-list strong { font-weight: 700; }
.cv-inline-list li { margin-bottom: 6px; list-style: none; }

.cv-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 0 32px; }

/* ---- Responsive ---- */
@media (max-width: 720px) {
  .hero { grid-template-columns: 1fr; gap: 34px; }
  .photo { justify-self: start; transform: rotate(-2deg); }
  .cv-two-col { grid-template-columns: 1fr; }
  #cv { padding: 30px 24px; }
  #cv h1.cv-name { font-size: 24px; }
}

@media (max-width: 620px) {
  .row { grid-template-columns: 34px 1fr 26px; }
  .row .tag, .row .yr { display: none; }
  footer .foot { flex-direction: column; align-items: start; }
  footer .small { text-align: left; }
}

/* ---- Print: the CV page prints as a clean A4 resume ---- */
@media print {
  @page { margin: 11mm 13mm; }
  body { background: #fff; color: #111; font-size: 12px; line-height: 1.45; }
  nav, footer, .cv-actions, .page-intro { display: none !important; }
  .wrap { max-width: none; padding: 0; }
  #cv { border: 0; padding: 0; margin: 0; background: #fff; }
  #cv .cv-section > h2 { color: #17153a; margin-bottom: 8px; padding-bottom: 4px; border-color: #ddd; }
  a { color: #17153a; }
  .cv-job ul li, .cv-inline-list { font-size: 11.5px; margin-bottom: 3px; }
  .cv-job ul { margin-top: 5px; }
  .cv-job { margin-bottom: 12px; break-inside: avoid; }
  .cv-section { margin-top: 16px; }
  #cv header.cv-head { margin-bottom: 18px; }
  #cv h1.cv-name { font-size: 23px; }
  #cv .cv-title-line, .cv-job .cv-company { font-size: 12.5px; }
  #cv .cv-contact { font-size: 11.5px; margin-top: 6px; }
  .cv-job h3 { font-size: 14px; }
  .cv-job .cv-dates { font-size: 11px; }
  .cv-two-col { grid-template-columns: 1fr 1fr; }
}
