/* ============================================================
   William Bourgeois - Personal Website
   Palette from color_palette.ipynb
   ============================================================ */

:root {
  --blue: #4476ff;
  --blue-hover: #2852c6;
  --ink: #06005a;          /* primary text */
  --ink-2: #1d1684;
  --paper-blue: #3533cd;
  --light-blue: #e5e9ff;
  --purple: #6137ca;
  --grey: #aaaaaa;
  --beige-light: #faf5ee;
  --beige: #f7ecde;
  --dark: #222222;

  --font-serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --max-w: 1100px;
  --radius: 14px;
  --shadow-sm: 0 1px 3px rgba(6, 0, 90, 0.08);
  --shadow-md: 0 6px 24px rgba(6, 0, 90, 0.10);
  --shadow-lg: 0 16px 48px rgba(6, 0, 90, 0.14);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--beige-light);
  line-height: 1.65;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .serif { font-family: var(--font-serif); font-weight: 600; line-height: 1.2; }

h1 { font-size: clamp(2.4rem, 5vw, 3.6rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.3rem); letter-spacing: -0.01em; }
h3 { font-size: 1.25rem; }

a { color: var(--blue); text-decoration: none; transition: color 0.15s ease; }
a:hover { color: var(--blue-hover); }

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

.container { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }

/* ---------- Header / Nav ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 245, 238, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(6, 0, 90, 0.08);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--ink);
}

.nav-brand img { width: 30px; height: 30px; border-radius: 6px; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
}

.nav-links a {
  color: var(--ink);
  font-size: 0.94rem;
  font-weight: 500;
  opacity: 0.75;
}

.nav-links a:hover { opacity: 1; color: var(--blue-hover); }
.nav-links a.active { opacity: 1; color: var(--blue); }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.6rem;
  color: var(--ink);
  line-height: 1;
}

@media (max-width: 720px) {
  .nav-toggle { display: block; }
  .nav-links {
    display: none;
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    background: var(--beige-light);
    flex-direction: column;
    padding: 18px 24px 24px;
    gap: 16px;
    border-bottom: 1px solid rgba(6, 0, 90, 0.08);
    box-shadow: var(--shadow-md);
  }
  .nav-links.open { display: flex; }
}

/* ---------- Hero ---------- */

.hero {
  padding: 90px 0 70px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 56px;
  align-items: center;
}

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero { padding: 56px 0 48px; }
}

.hero-kicker {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 18px;
}

.hero h1 { margin-bottom: 20px; }

.hero-sub {
  font-size: 1.15rem;
  color: rgba(6, 0, 90, 0.72);
  max-width: 34em;
  margin-bottom: 32px;
}

.hero-portrait {
  position: relative;
}

.hero-portrait img {
  width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  /* Never crop the head: show the full image, no forced aspect ratio */
  height: auto;
  object-fit: contain;
}

.hero-portrait::before {
  content: "";
  position: absolute;
  inset: 18px -18px -18px 18px;
  border-radius: var(--radius);
  background: var(--light-blue);
  z-index: -1;
}

/* ---------- Buttons ---------- */

.btn-row { display: flex; flex-wrap: wrap; gap: 14px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.15s ease;
  border: 1.5px solid transparent;
}

.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-hover); color: #fff; transform: translateY(-1px); }

.btn-outline { border-color: rgba(6, 0, 90, 0.25); color: var(--ink); background: transparent; }
.btn-outline:hover { border-color: var(--blue); color: var(--blue-hover); transform: translateY(-1px); }

/* ---------- Sections ---------- */

section { padding: 72px 0; }

.section-alt { background: #fff; }
.section-blue { background: var(--ink); color: #fff; }
.section-blue h2 { color: #fff; }

.section-head {
  margin-bottom: 44px;
  max-width: 42em;
}

.section-head .eyebrow {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 10px;
}

.section-head p {
  margin-top: 14px;
  color: rgba(6, 0, 90, 0.7);
}

.section-blue .section-head p { color: rgba(255, 255, 255, 0.75); }

/* ---------- Cards ---------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 28px;
}

.card {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(6, 0, 90, 0.07);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}

.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }

.card-thumb {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--light-blue);
}

.card-thumb img { width: 100%; height: 100%; object-fit: cover; }

.card-body { padding: 24px; display: flex; flex-direction: column; gap: 10px; flex: 1; }

.card-body h3 { color: var(--ink); }

.card-body p { font-size: 0.95rem; color: rgba(6, 0, 90, 0.7); flex: 1; }

.card-tags { display: flex; flex-wrap: wrap; gap: 8px; }

.tag {
  font-size: 0.74rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--light-blue);
  color: var(--ink-2);
}

.card-link { font-weight: 600; font-size: 0.92rem; }

/* ---------- Highlight strip ---------- */

.highlights {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
}

.highlight {
  background: #fff;
  border: 1px solid rgba(6, 0, 90, 0.07);
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: var(--shadow-sm);
}

.highlight .num {
  font-family: var(--font-serif);
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--blue);
  display: block;
  margin-bottom: 6px;
}

.highlight p { font-size: 0.92rem; color: rgba(6, 0, 90, 0.7); }

/* ---------- Feature split (image + text) ---------- */

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
}

@media (max-width: 860px) { .split { grid-template-columns: 1fr; gap: 36px; } }

.split img { border-radius: var(--radius); box-shadow: var(--shadow-md); }

.split h2 { margin-bottom: 16px; }
.split p { color: rgba(6, 0, 90, 0.72); margin-bottom: 14px; }

.section-blue .split p { color: rgba(255, 255, 255, 0.78); }

/* ---------- Timeline (About) ---------- */

.timeline { list-style: none; position: relative; padding-left: 28px; }

.timeline::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--light-blue);
}

.timeline li { position: relative; padding-bottom: 34px; }
.timeline li:last-child { padding-bottom: 0; }

.timeline li::before {
  content: "";
  position: absolute;
  left: -28px;
  top: 7px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--blue);
  border: 3px solid var(--beige-light);
}

.timeline .when {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--blue);
}

.timeline h3 { margin: 4px 0 2px; }
.timeline .where { font-size: 0.92rem; color: rgba(6, 0, 90, 0.6); margin-bottom: 8px; }
.timeline p { font-size: 0.95rem; color: rgba(6, 0, 90, 0.72); }
.timeline ul { margin: 8px 0 0 18px; font-size: 0.95rem; color: rgba(6, 0, 90, 0.72); }
.timeline ul li { padding-bottom: 6px; }
.timeline ul li::before { display: none; }

/* ---------- Quote / feature block ---------- */

.feature-quote {
  background: var(--ink);
  color: #fff;
  border-radius: var(--radius);
  padding: 48px;
  position: relative;
  overflow: hidden;
}

.feature-quote::after {
  content: "";
  position: absolute;
  top: -60px;
  right: -60px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(68, 118, 255, 0.35), transparent 70%);
}

.feature-quote blockquote {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  line-height: 1.5;
  max-width: 36em;
  margin-bottom: 20px;
}

.feature-quote .attribution { font-size: 0.9rem; color: rgba(255, 255, 255, 0.65); margin-bottom: 24px; }

@media (max-width: 640px) { .feature-quote { padding: 32px 24px; } }

/* ---------- Detail sections (projects/papers) ---------- */

.detail {
  background: #fff;
  border: 1px solid rgba(6, 0, 90, 0.07);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 40px;
  margin-bottom: 36px;
}

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

.detail-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 6px;
}

.detail .meta { font-size: 0.88rem; color: rgba(6, 0, 90, 0.55); margin-bottom: 18px; }

.detail p { color: rgba(6, 0, 90, 0.75); margin-bottom: 14px; }

.detail img { border-radius: 10px; margin: 18px 0; border: 1px solid rgba(6, 0, 90, 0.08); }

.detail ul { margin: 0 0 14px 20px; color: rgba(6, 0, 90, 0.75); }
.detail ul li { margin-bottom: 6px; }

.findings {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin: 20px 0;
}

.finding {
  background: var(--light-blue);
  border-radius: 10px;
  padding: 18px;
  font-size: 0.92rem;
  color: var(--ink-2);
}

.finding strong { display: block; margin-bottom: 4px; color: var(--ink); }

/* ---------- Footer ---------- */

.site-footer {
  background: var(--ink);
  color: rgba(255, 255, 255, 0.75);
  padding: 56px 0 36px;
  margin-top: 40px;
}

.footer-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 36px;
}

.footer-brand {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 8px;
}

.footer-tag { font-size: 0.9rem; max-width: 26em; }

.footer-links { display: flex; gap: 48px; flex-wrap: wrap; }

.footer-links h4 {
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 12px;
}

.footer-links ul { list-style: none; }
.footer-links li { margin-bottom: 8px; }
.footer-links a { color: rgba(255, 255, 255, 0.8); font-size: 0.92rem; }
.footer-links a:hover { color: #fff; }

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 24px;
  font-size: 0.84rem;
  color: rgba(255, 255, 255, 0.5);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
}

/* ---------- Page hero (inner pages) ---------- */

.page-hero { padding: 72px 0 20px; }

.page-hero .eyebrow {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 10px;
}

.page-hero p {
  margin-top: 16px;
  font-size: 1.1rem;
  color: rgba(6, 0, 90, 0.7);
  max-width: 40em;
}

/* ---------- Placeholder for missing images ---------- */

.img-placeholder {
  border: 2px dashed rgba(6, 0, 90, 0.25);
  border-radius: var(--radius);
  background: repeating-linear-gradient(45deg, rgba(229, 233, 255, 0.5), rgba(229, 233, 255, 0.5) 12px, transparent 12px, transparent 24px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(6, 0, 90, 0.5);
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
  padding: 16px;
}
