:root {
  --paper: #F6F4FC;
  --paper-2: #EEEAF9;
  --card: #FFFFFF;
  --ink: #1F1D3D;
  --muted: #5E5B7D;
  --indigo: #33308A;
  --blue: #3E5FD6;
  --lilac: #E8E2FB;
  --sky: #E1E8FD;
  --line: #E3DEF3;
  --footer: #262368;

  --serif: "Newsreader", Georgia, serif;
  --sans: "Instrument Sans", system-ui, sans-serif;
  --gutter: clamp(16px, 5vw, 64px);
  --max: 1160px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html.modal-open { overflow: hidden; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--serif); color: var(--indigo); margin: 0; line-height: 1.1; }
button { font: inherit; color: inherit; }
img.media { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }

.eyebrow {
  display: block;
  margin: 0 0 6px;
  font: 600 13px/1.3 var(--sans);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--blue);
}

/* ---------- header ---------- */
.site-header {
  position: absolute; inset: 0 0 auto 0; z-index: 2;
  max-width: var(--max); margin: 0 auto;
  padding: 24px var(--gutter);
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
}
.wordmark {
  font: 700 24px/1 var(--serif); color: var(--indigo); text-decoration: none;
}
.wordmark span { color: var(--blue); font-weight: 400; margin: 0 1px; }
.header-tag { margin: 0; font-size: 14px; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--blue); margin-right: 8px; vertical-align: 1px; }

/* ---------- hero ---------- */
.hero {
  position: relative; overflow: hidden;
  padding: 120px var(--gutter) 80px;
  background:
    radial-gradient(60% 70% at 0% 20%, #DCD3FB 0%, transparent 60%),
    radial-gradient(50% 60% at 100% 0%, #D6E1FD 0%, transparent 60%),
    linear-gradient(180deg, #F3F0FC, var(--paper));
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 48px; align-items: center;
}
/* line the hero up with the centred header column on wide screens */
.hero { padding-inline: max(var(--gutter), calc((100% - var(--max)) / 2 + var(--gutter))); }
.hero-rings {
  position: absolute; width: 520px; left: -260px; top: 120px; pointer-events: none;
  fill: none; stroke: var(--indigo); stroke-opacity: .12; stroke-width: 1;
}
.hero-text { position: relative; }
.hero h1 {
  font-size: clamp(44px, 7vw, 84px); font-weight: 700; letter-spacing: -.02em;
  margin: 4px 0 20px;
}
.lede { max-width: 34em; margin: 0 0 28px; color: var(--muted); font-size: 18px; }
.hero-actions { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; margin-bottom: 22px; }
.contact { margin: 0; color: var(--muted); font-size: 15px; }
.contact span { margin: 0 8px; }
.contact a { color: inherit; text-decoration: none; }
.contact a:hover { color: var(--blue); text-decoration: underline; }

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 28px; border-radius: 999px; border: 0; cursor: pointer;
  font-weight: 600; text-decoration: none; transition: transform .15s, box-shadow .15s, background .15s;
}
.btn-primary { background: var(--indigo); color: #fff; box-shadow: 0 10px 24px -10px rgba(51, 48, 138, .6); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 28px -10px rgba(51, 48, 138, .7); }
.btn-soft { background: var(--lilac); color: var(--indigo); padding: 12px 24px; }
.btn-soft:hover { background: #DDD4FA; }
.link { color: var(--blue); font-weight: 600; text-decoration: none; border-bottom: 2px solid currentColor; padding-bottom: 2px; }
.link:hover { color: var(--indigo); }

/* arch-topped photo frame */
.hero-photo { justify-self: end; width: 100%; max-width: 380px; }
.portrait { overflow: hidden; background: var(--lilac); }
/* zoomed in so the arch frames head down to mid-chest */
.portrait img { display: block; width: 100%; height: 100%; object-fit: cover; transform: scale(1.3); transform-origin: 50% 62%; }
.hero-photo .portrait { aspect-ratio: 4 / 5; border-radius: 50% 50% 7% 7% / 40% 40% 5.6% 5.6%; border: 6px solid #fff; box-shadow: 0 30px 60px -30px rgba(38, 35, 104, .45); }

/* ---------- placeholders ---------- */
.ph {
  position: relative; display: grid; place-items: center; min-height: 140px;
  background: repeating-linear-gradient(135deg, #ECE7FA 0 14px, #F4F1FD 14px 28px);
  border-radius: 18px; color: var(--muted);
}
.ph::after {
  content: "▢  " attr(data-label);
  font: 500 13px/1.3 var(--sans); padding: 6px 12px; border-radius: 999px;
  background: rgba(255, 255, 255, .8); text-align: center; max-width: 85%;
}

/* ---------- projects ---------- */
.work { max-width: var(--max); margin: 0 auto; padding: 72px var(--gutter) 96px; }
.section-title { font-size: clamp(38px, 5vw, 56px); font-weight: 700; letter-spacing: -.015em; }
.section-sub { margin: 10px 0 40px; color: var(--muted); font-size: 18px; }

.cards { display: grid; grid-template-columns: repeat(6, 1fr); gap: 24px; }
.card {
  grid-column: span 2;
  display: flex; flex-direction: column; text-align: left; padding: 0; cursor: pointer;
  background: var(--card); border: 1px solid var(--line); border-radius: 24px; overflow: hidden;
  box-shadow: 0 18px 40px -28px rgba(38, 35, 104, .35);
  transition: transform .2s, box-shadow .2s;
}
.card-wide { grid-column: span 3; }
.card:hover, .card:focus-visible { transform: translateY(-4px); box-shadow: 0 26px 50px -28px rgba(38, 35, 104, .5); outline: none; }
.card:focus-visible { box-shadow: 0 0 0 3px var(--blue); }
.card-media { position: relative; height: 180px; border-radius: 0; overflow: hidden; }
.card-media:not(.ph) { background: var(--lilac); }
.card-media .cover-crop { object-position: 50% 2%; }
.card-media .board-crop { object-position: 50% 62%; }
/* the cover's wave artwork, below its title (the card already names it) */
.card-media .resume-crop { object-position: 40% 45%; }
.card-media .toolkit-crop { object-position: 50% 85%; }
.card-media .dd-crop { transform: scale(1.7); transform-origin: 50% 50%; }
.card-wide .card-media { height: 220px; }
.card-media::after { opacity: .9; }
.card-tag {
  position: absolute; left: 16px; bottom: 14px; z-index: 1;
  font: 600 11px/1 var(--sans); letter-spacing: .12em; text-transform: uppercase;
  color: #fff; background: rgba(38, 35, 104, .72); padding: 8px 12px; border-radius: 8px;
}
.card-body { display: flex; align-items: center; gap: 16px; padding: 22px 22px 26px; flex: 1; }
.card-num { font: italic 400 38px/1 var(--serif); color: #C3BCE6; align-self: flex-end; }
.card-body > div { flex: 1; }
.card-body .eyebrow { font-size: 12px; }
.card h3 { font-size: 24px; font-weight: 600; }
.card-arrow {
  flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  background: var(--sky); color: var(--indigo); font-size: 18px; transition: background .2s, color .2s;
}
.card:hover .card-arrow { background: var(--indigo); color: #fff; }

.site-footer { background: var(--footer); color: #D9D5F5; text-align: center; padding: 28px 16px; font-size: 15px; }

/* ---------- modals ---------- */
.modal {
  width: min(1040px, calc(100% - 32px)); max-height: calc(100dvh - 48px);
  padding: clamp(28px, 5vw, 56px); border: 0; border-radius: 28px;
  background: linear-gradient(160deg, #FBFAFF, #F1EEFB); color: var(--ink);
  box-shadow: 0 40px 80px -30px rgba(20, 18, 60, .5);
}
.modal:focus { outline: none; }
.modal[open] { animation: rise .25s ease-out; }
.modal::backdrop { background: rgba(30, 27, 70, .45); backdrop-filter: blur(6px); }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }
.modal-close {
  position: sticky; top: 0; float: right; margin: -12px -12px 0 16px;
  width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--line);
  background: #fff; font-size: 26px; line-height: 1; cursor: pointer; color: var(--indigo);
}
.modal-close:hover { background: var(--lilac); }
.modal h2 { font-size: clamp(34px, 5vw, 56px); font-weight: 700; letter-spacing: -.015em; margin-bottom: 14px; }
.modal-lede { font-size: 19px; color: var(--muted); max-width: 44em; margin: 0 0 32px; }
.block-title { font-size: 28px; font-weight: 600; margin: 40px 0 18px; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 0 0 32px; }
.stats-2 { grid-template-columns: repeat(2, 1fr); max-width: 560px; }
.stats-3 { grid-template-columns: repeat(3, 1fr); max-width: 780px; }
.stats div { background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 20px 22px; }
.stats dt { font: 700 clamp(28px, 3.4vw, 38px)/1.1 var(--serif); color: var(--indigo); }
.stats dd { margin: 6px 0 0; color: var(--muted); font-size: 15px; line-height: 1.4; }

.split { display: grid; grid-template-columns: 1.1fr 1fr; gap: 32px; align-items: start; margin-bottom: 24px; }
.ph-wide { aspect-ratio: 4 / 3; }
.split-cover { grid-template-columns: minmax(0, 300px) 1fr; gap: 40px; }
.cover-link img { display: block; width: 100%; border-radius: 8px; box-shadow: 0 24px 44px -22px rgba(38, 35, 104, .6); transition: transform .2s; }
.cover-link:hover img { transform: translateY(-4px); }
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { position: relative; padding: 0 0 14px 30px; }
.checklist li::before { content: "✓"; position: absolute; left: 0; top: 0; color: var(--blue); font-weight: 700; }
.prose h3 { font-size: 24px; font-weight: 600; margin: 0 0 8px; }
.prose p { margin: 0 0 24px; }
.prose p:last-child { margin-bottom: 0; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 20px; }

.covers { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.covers figure { margin: 0; }
.covers img { display: block; width: 100%; aspect-ratio: 658 / 930; object-fit: cover; border-radius: 12px; box-shadow: 0 18px 36px -20px rgba(38, 35, 104, .55); }
.covers figcaption { margin-top: 10px; font-size: 14px; font-weight: 600; color: var(--muted); }

.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.gallery .ph { aspect-ratio: 4 / 3; }
.photo-main { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 18px; }
.prose a:not(.btn) { color: var(--blue); font-weight: 600; }

.gallery-4 { grid-template-columns: repeat(4, 1fr); }
.gallery figure { margin: 0; }
.gallery figure img { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 16px; }
.gallery-2 { grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 32px; }
.gallery-2 figure img { aspect-ratio: 2 / 1; object-position: 50% 0; border: 1px solid var(--line); box-shadow: 0 18px 36px -24px rgba(38, 35, 104, .45); }
.prose-narrow { max-width: 44em; }
.gallery figcaption { margin-top: 10px; font-size: 14px; line-height: 1.4; color: var(--muted); }

.panel { background: #fff; border: 1px solid var(--line); border-radius: 24px; padding: 24px; max-width: 520px; }
.ph-doc { aspect-ratio: 8.5 / 11; }

.quotes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.quote { margin: 0; background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 24px; display: flex; flex-direction: column; gap: 18px; overflow: hidden; }
.quote img { display: block; width: calc(100% + 48px); margin: -24px -24px 0; aspect-ratio: 4 / 3; object-fit: cover; }
.quote blockquote { margin: 0; font: italic 400 19px/1.5 var(--serif); color: var(--ink); flex: 1; }
.quote figcaption { display: flex; flex-direction: column; font-size: 14px; color: var(--muted); }
.quote figcaption strong { color: var(--indigo); font-size: 15px; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding-top: 104px; }
  .hero-photo { justify-self: start; max-width: 300px; order: -1; }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .card, .card-wide { grid-column: span 1; }
  .card:last-child { grid-column: span 2; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .split { grid-template-columns: 1fr; }
  .quotes { grid-template-columns: 1fr; }
  .gallery-4 { grid-template-columns: repeat(2, 1fr); }
  .gallery-2 { grid-template-columns: 1fr; }
  .split-cover { grid-template-columns: 1fr; }
  .cover-link { max-width: 260px; }
}
@media (max-width: 600px) {
  .stats-3 { grid-template-columns: 1fr 1fr; }
  .stats-3 div:last-child { grid-column: span 2; }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  .header-tag { display: none; }
  .hero-photo { max-width: 240px; }
  .cards { grid-template-columns: 1fr; }
  .card:last-child { grid-column: span 1; }
  .gallery { grid-template-columns: 1fr 1fr; }
  .gallery .ph:last-child { grid-column: span 2; }
  .gallery-4 { gap: 12px; }
  .stats dd { font-size: 14px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .stats div { padding: 16px; }
  .stats dt { font-size: 25px; }
  .modal { width: calc(100% - 16px); max-height: calc(100dvh - 16px); border-radius: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
