/* Shared styles for index.html and portfolio.html */

@font-face { font-family: 'Barlow'; font-weight: 300; font-display: swap; src: url('fonts/barlow-latin-300-normal.woff2') format('woff2'); }
@font-face { font-family: 'Barlow'; font-weight: 400; font-display: swap; src: url('fonts/barlow-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Barlow'; font-weight: 500; font-display: swap; src: url('fonts/barlow-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Barlow'; font-weight: 600; font-display: swap; src: url('fonts/barlow-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Caudex'; font-weight: 400; font-display: swap; src: url('fonts/caudex-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Caudex'; font-weight: 700; font-display: swap; src: url('fonts/caudex-latin-700-normal.woff2') format('woff2'); }

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

:root {
  --black: #1A1A1A;
  --white: #FFFFFF;
  --accent: #1F6F8B;        /* sea blue: links, buttons */
  --accent-light: #E6F2F5;
  --seaweed: #3E7C4F;       /* seaweed green: labels, highlights */
  --seaweed-light: #EAF3EC;
  --mid: #6B7280;
  --border: #E5E7EB;
  --serif: 'Caudex', Georgia, serif;
  --sans: 'Barlow', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

html { scroll-behavior: smooth; scroll-padding-top: 72px; }

body {
  font-family: var(--sans);
  font-size: 17px;
  background: var(--white);
  color: var(--black);
  line-height: 1.6;
}

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

/* ── NAV ── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 48px;
}

.nav-logo {
  font-family: var(--serif);
  font-size: 1.15rem;
  color: var(--black);
  text-decoration: none;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.nav-links { display: flex; gap: 32px; list-style: none; }

.nav-links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--mid);
  text-decoration: none;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  position: relative;
  padding-bottom: 2px;
  transition: color 0.2s;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0;
  width: 0; height: 1.5px;
  background: var(--accent);
  transition: width 0.25s ease;
}

.nav-links a:hover { color: var(--accent); }
.nav-links a:hover::after { width: 100%; }
.nav-links a.active { color: var(--black); }
.nav-links a.active::after { width: 100%; background: var(--black); }

/* ── SECTIONS ── */
section { padding: 96px 48px; max-width: 900px; margin: 0 auto; }
section + section { border-top: 1px solid var(--border); }

/* ── HERO ── */
#home {
  padding-top: 140px;
  padding-bottom: 80px;
  text-align: center;
  animation: fadeUp 0.9s ease both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero-greeting {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(3rem, 7vw, 5.5rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin-bottom: 32px;
}

.hero-photo {
  width: 230px;
  height: 230px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 36px;
  display: block;
  border: 4px solid var(--seaweed-light);
  box-shadow: 0 0 0 1px var(--border);
  background: var(--accent-light);
}

.hero-bio {
  max-width: 620px;
  margin: 0 auto 48px;
  font-size: 1.05rem;
  color: var(--mid);
  font-weight: 400;
  line-height: 1.75;
}

.hero-link { display: inline-flex; gap: 6px; align-items: center; font-size: 0.95rem; font-weight: 500; color: var(--accent); text-decoration: none; border-bottom: 1.5px solid var(--seaweed-light); padding-bottom: 2px; }
.hero-link:hover { border-color: var(--accent); }

/* ── UPDATES / EYEBROW LABELS ── */
.updates-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--seaweed);
  margin-bottom: 16px;
}

.updates-list {
  list-style: none;
  max-width: 620px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.updates-list li {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  font-size: 0.9rem;
  text-align: left;
}

.update-date {
  font-size: 0.75rem;
  color: var(--mid);
  font-weight: 500;
  white-space: nowrap;
  padding-top: 2px;
  min-width: 72px;
}

/* ── SECTION HEADINGS ── */
.section-title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.section-subtitle {
  font-size: 0.9rem;
  color: var(--mid);
  margin-bottom: 32px;
  font-weight: 300;
}

.section-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 40px; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  border: 1px solid var(--accent);
  padding: 6px 14px;
  border-radius: 4px;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s;
}

.btn:hover { background: var(--accent); color: var(--white); }
.btn-solid { background: var(--accent); color: var(--white); }
.btn-solid:hover { background: #18586F; border-color: #18586F; }
.btn-sm { font-size: 0.75rem; padding: 4px 10px; }

/* ── PROJECT CARDS ── */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 28px;
}

.project-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s, transform 0.2s;
}

.project-card:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,0.07);
  transform: translateY(-2px);
}

.project-cover { position: relative; display: block; text-decoration: none; }

.project-cover-badge {
  position: absolute;
  right: 10px; bottom: 10px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--white);
  background: rgba(26,26,26,0.72);
  padding: 4px 9px;
  border-radius: 4px;
  opacity: 0;
  transition: opacity 0.2s;
}

.project-cover:hover .project-cover-badge,
.project-cover:focus-visible .project-cover-badge { opacity: 1; }

@media (hover: none) { .project-cover-badge { opacity: 1; } }

.project-img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  display: block;
  background: var(--accent-light);
}

.project-img-placeholder {
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
}

.project-img-placeholder span {
  font-family: var(--serif);
  font-size: 1.1rem;
  color: var(--accent);
}

.project-body { padding: 20px; display: flex; flex-direction: column; flex: 1; }

.project-tag {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--seaweed);
  margin-bottom: 6px;
}

.project-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.1rem;
  margin-bottom: 8px;
  line-height: 1.3;
}

.project-desc { font-size: 0.85rem; color: var(--mid); line-height: 1.6; }

.project-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 16px; }

.viz-grid { display: flex; flex-direction: column; gap: 28px; }
.viz-card { margin: 0; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.viz-card img { width: 100%; display: block; background: #fff; border-bottom: 1px solid var(--border); }
.viz-card figcaption { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.viz-card .project-title { margin-bottom: 0; }

.empty-note { font-size: 0.9rem; color: var(--mid); font-style: italic; }

/* ── PUBLICATIONS ── */
.pub-list { display: flex; flex-direction: column; gap: 24px; }

.pub-item {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  transition: box-shadow 0.2s;
}

.pub-item:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.06); }
.pub-meta { flex: 1; }

.pub-venue {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--seaweed);
  margin-bottom: 6px;
}

.pub-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.05rem;
  margin-bottom: 6px;
  line-height: 1.35;
}

.pub-authors { font-size: 0.82rem; color: var(--mid); }
.prep-list { display: flex; flex-direction: column; gap: 0; border-left: 2px solid var(--seaweed-light); }
.prep-item { padding: 14px 0 14px 22px; }
.prep-item + .prep-item { border-top: 1px solid var(--border); }
.prep-status { font-size: 0.78rem; color: var(--seaweed); font-style: italic; margin-top: 4px; }
.writing-summary { font-size: 0.85rem; color: var(--mid); line-height: 1.6; }
.pub-authors strong, .pf-team strong { color: var(--black); font-weight: 500; }

/* ── ABOUT ── */
.about-text p {
  font-size: 0.95rem;
  color: var(--mid);
  line-height: 1.8;
  margin-bottom: 16px;
}

.about-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }

.about-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--black);
  text-decoration: none;
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: 4px;
  transition: border-color 0.2s, color 0.2s;
}

.about-link:hover { border-color: var(--accent); color: var(--accent); }

/* ── PORTFOLIO PAGE ── */
.pf-header { padding-top: 130px; padding-bottom: 48px; }
.pf-header .section-title { font-size: clamp(2.4rem, 6vw, 3.6rem); }
.pf-updated { font-size: 0.78rem; color: var(--mid); margin-top: 12px; }
.print-only { display: none; }

.pf-item { padding-top: 64px; padding-bottom: 64px; }

.pf-meta {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--seaweed);
  margin-bottom: 8px;
}

.pf-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  line-height: 1.2;
  margin-bottom: 8px;
}

.pf-team { font-size: 0.85rem; color: var(--mid); margin-bottom: 20px; }

.pf-overview { font-size: 1rem; line-height: 1.75; color: #374151; margin-bottom: 28px; max-width: 760px; }

/* Big-number result tiles */
.pf-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.pf-metric {
  border: 1px solid var(--border);
  border-left: 3px solid var(--seaweed);
  border-radius: 6px;
  padding: 14px 16px;
  break-inside: avoid;
}

.pf-metric-value {
  display: block;
  font-family: var(--serif);
  font-size: 1.9rem;
  line-height: 1.1;
  color: var(--black);
}

.pf-metric-label { display: block; font-size: 0.78rem; color: var(--mid); margin-top: 4px; line-height: 1.4; }

.pf-subhead {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--black);
  margin: 4px 0 12px;
}

.pf-text { font-size: 0.95rem; line-height: 1.75; color: #374151; margin-bottom: 14px; max-width: 760px; }

.pf-eq { margin: 6px 0 20px; padding: 14px 18px; background: #FAFAFA; border-left: 3px solid var(--border); overflow-x: auto; break-inside: avoid; }
.pf-eq img { display: block; max-width: 100%; height: auto; }

.pf-text + .pf-subhead, .pf-eq + .pf-subhead { margin-top: 28px; }

.pf-results { margin: 0 0 32px 20px; font-size: 0.95rem; color: #374151; line-height: 1.7; }
.pf-results li { margin-bottom: 8px; }
.pf-results li::marker { color: var(--seaweed); }

/* Figures pulled from the project document */
.pf-figures {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

.pf-figure { margin: 0; break-inside: avoid; }
.pf-figure.wide { grid-column: 1 / -1; }
.pf-figures.lead { grid-template-columns: 1fr; margin-bottom: 28px; }

.pf-figure img {
  width: 100%;
  max-height: 520px;
  object-fit: contain;
  background: #FAFAFA;
  border: 1px solid var(--border);
  border-radius: 8px;
  display: block;
}

.pf-figure figcaption { font-size: 0.8rem; color: var(--mid); margin-top: 8px; line-height: 1.5; }
.pf-figure figcaption b { color: var(--black); font-weight: 600; }

.pf-docs { display: flex; flex-wrap: wrap; gap: 8px; margin: -12px 0 28px; }

@media (max-width: 680px) {
  .pf-figures { grid-template-columns: 1fr; }
}

/* ── FOOTER ── */
footer {
  border-top: 1px solid var(--border);
  text-align: center;
  padding: 32px;
  font-size: 0.8rem;
  color: var(--mid);
}

/* ── RESPONSIVE ── */
@media (max-width: 680px) {
  nav { padding: 0 16px; }
  .nav-logo { font-size: 1rem; }
  .nav-links { gap: 14px; }
  .nav-links a { font-size: 0.68rem; letter-spacing: 0.02em; }
  section { padding: 72px 20px; }
  #home { padding-top: 110px; }
  .hero-photo { width: 190px; height: 190px; }
  .pf-header { padding-top: 100px; }
  .pub-item { flex-direction: column; }
}

@media (max-width: 400px) {
  .nav-logo { display: none; }
  nav { justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  #home { animation: none; }
  .project-card:hover { transform: none; }
}

/* ── PRINT (used to generate assets/portfolio.pdf) ── */
@page { size: Letter; margin: 0.6in 0.65in; }

@media print {
  nav, footer, .no-print { display: none !important; }
  .print-only { display: block; }
  body { font-size: 11pt; }
  section { padding: 0; max-width: none; }
  section + section { border-top: none; }
  .pf-header { padding: 0 0 18pt; border-bottom: 1px solid var(--border); margin-bottom: 18pt; }
  .pf-header .section-title { font-size: 28pt; }
  .pf-contact { font-size: 9.5pt; color: var(--mid); margin-top: 4pt; }
  .pf-contact a { color: var(--accent); text-decoration: none; }
  .pf-item { padding: 0; }
  .pf-item + .pf-item { break-before: page; }
  .pf-title { font-size: 20pt; }
  .pf-overview, .pf-results, .pf-text { font-size: 10.5pt; line-height: 1.55; }
  .pf-text { margin-bottom: 6pt; }
  .pf-eq { margin: 2pt 0 10pt; padding: 6pt 10pt; }
  .pf-eq img { max-height: 0.7in; width: auto; max-width: 100%; }
  .pf-metrics { gap: 8pt; margin-bottom: 16pt; }
  .pf-metric { padding: 8pt 10pt; }
  .pf-metric-value { font-size: 18pt; }
  .pf-figures { gap: 12pt; margin-bottom: 16pt; }
  .pf-figure img { max-height: 2.1in; border: none; background: none; }
  .pf-figures.lead { display: block; }
  .pf-figures.lead .pf-figure img { max-height: 2.3in; }
  .pf-figure figcaption { font-size: 8.5pt; }
  .pf-subhead { break-after: avoid; }
  .pf-metrics, .pf-results li { break-inside: avoid; }
  .pf-docs .btn { border: none; padding: 0; font-size: 9.5pt; text-decoration: underline; }
}
