/* ===== Design Tokens — AMP Public Editorial Style ===== */
:root {
  --bg-primary: #fbfaf7;
  --text-primary: #1d1d1f;
  --text-secondary: #3a3a3c;
  --text-muted: #86868b;
  --accent: #3a3a3c;
  --accent-hover: #1d1d1f;
  --border: #e0e0e0;
  --tag-bg: #f0f0f0;
  --tag-text: #3a3a3c;
  --vignette-color: rgba(160, 140, 110, 0.08);

  --font-serif: 'EB Garamond', 'Georgia', 'Times New Roman', serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  --max-width: 820px;
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 2rem;
  --spacing-xl: 4rem;
  --spacing-2xl: 7rem;
}

/* ===== Reset & Base ===== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 20px;
}

body {
  font-family: var(--font-serif);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
  min-height: 100vh;
}

/* Soft blue vignette glow — AMP signature effect */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(ellipse at center,
      transparent 40%,
      var(--vignette-color) 100%);
}

/* Subtle grain overlay */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  opacity: 0.018;
  pointer-events: none;
  z-index: 1000;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

::selection {
  background-color: rgba(160, 140, 110, 0.2);
  color: var(--text-primary);
}

/* ===== Layout ===== */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--spacing-lg);
  position: relative;
  z-index: 1;
}

/* ===== Navigation ===== */
.nav {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  padding: 1.5rem 0;
}

.nav__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav__name {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: 0.04em;
}

.nav__name:hover {
  color: var(--text-primary);
}

.nav__links {
  display: flex;
  gap: var(--spacing-lg);
  font-family: var(--font-serif);
  font-size: 0.92rem;
  font-style: italic;
}

.nav__links a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
  letter-spacing: 0.02em;
}

.nav__links a:hover {
  color: var(--text-primary);
}

/* ===== Links ===== */
a {
  color: var(--accent);
  text-decoration: none;
  position: relative;
  transition: color 0.2s ease;
}

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

/* Animated underline for inline links */
.link-underline {
  background-image: linear-gradient(var(--text-muted), var(--text-muted));
  background-size: 0% 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size 0.35s ease, color 0.2s ease;
  padding-bottom: 2px;
}

.link-underline:hover {
  background-size: 100% 1px;
  color: var(--text-primary);
}

/* ===== Site Visual Background ===== */
.site-visual-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 95vh;
  z-index: 0;
  pointer-events: none;
  /* Massive feathered mask focused on top-left */
  -webkit-mask-image: radial-gradient(130% 130% at 0% 0%, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.3) 40%, rgba(0, 0, 0, 0) 75%);
  mask-image: radial-gradient(130% 130% at 0% 0%, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.3) 40%, rgba(0, 0, 0, 0) 75%);
}

.site-visual-bg canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.site__bg-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.85;
  /* Increased from 0.45 for more vibrancy */
  mix-blend-mode: multiply;
  /* Blends richly with the warm background */
  z-index: 0;
}

/* ===== Hero Content ===== */
.hero {
  position: relative;
  z-index: 2;
  padding: calc(var(--spacing-2xl) * 1.4) 0 var(--spacing-xl);
  /* Pulled text up closer to the top */
  border-bottom: 1px solid var(--border);
}

.hero__content-container {
  position: relative;
  z-index: 2;
  max-width: 580px;
}

.hero__content {
  font-family: var(--font-serif);
  font-size: 1.02rem;
  line-height: 1.9;
  color: var(--text-secondary);
  letter-spacing: 0.015em;
  opacity: 0;
  transform: translateX(-20px);
  transition: opacity 0.8s ease 0.3s, transform 0.8s ease 0.3s;
}

.hero__content.entered {
  opacity: 1;
  transform: translateX(0);
}

.hero__content.manifesto {
  font-size: 0.98rem;
  line-height: 2.0;
  letter-spacing: 0.03em;
  color: #5a5650;
  max-width: 560px;
  text-align: justify;
}

.hero__content.manifesto strong {
  font-weight: inherit;
  color: inherit;
}

.hero__content.manifesto p {
  margin-bottom: calc(var(--spacing-lg) * 1.5);
}

.hero__content.manifesto p:last-child {
  margin-bottom: 0;
}

.hero__pitch p {
  margin-bottom: var(--spacing-lg);
}

.hero__pitch p:last-child {
  margin-bottom: 0;
}

.hero__pitch strong {
  color: var(--text-primary);
  font-weight: 600;
}

.hero__links {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-sm) var(--spacing-md);
  margin-top: calc(var(--spacing-xl) * 1.2);
  /* Increased space between bio and links */
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-style: italic;
}

.hero__links a {
  color: var(--text-muted);
  transition: color 0.2s ease;
}

.hero__links a:hover {
  color: var(--text-primary);
}

.hero__links .separator {
  color: var(--border);
  user-select: none;
}

/* ===== Sections ===== */
.section {
  padding: var(--spacing-xl) 0;
  border-bottom: 1px solid var(--border);
}

.section:last-of-type {
  border-bottom: none;
}

.section__title {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--text-muted);
  margin-bottom: var(--spacing-lg);
  padding-bottom: var(--spacing-sm);
  border-bottom: 1px solid var(--border);
}

/* ===== Highlights ===== */
.highlights-list {
  list-style: none;
}

.highlight-item {
  margin-bottom: 0.9rem;
  font-family: var(--font-serif);
  font-size: 1.02rem;
  line-height: 1.75;
  color: var(--text-secondary);
  padding-left: 1.2rem;
  position: relative;
}

.highlight-item::before {
  content: '\2726';
  /* ✦ Four pointed star/sparkle */
  position: absolute;
  left: 0;
  top: 0.15em;
  /* Minor tweak to align perfectly with text */
  font-size: 0.8em;
  color: var(--text-muted);
  opacity: 0.7;
}

.highlight-item:last-child {
  margin-bottom: 0;
}

.highlight-item strong {
  color: var(--text-primary);
  font-weight: 600;
}

.highlight-icon {
  flex-shrink: 0;
  font-size: 0.95rem;
  line-height: 1.75;
}

/* ===== Publications ===== */
.pub-list {
  list-style: none;
}

.pub-item {
  margin-bottom: var(--spacing-lg);
  padding-left: 0;
}

.pub-item:last-child {
  margin-bottom: 0;
}

.pub-item__title {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 400;
  line-height: 1.65;
  margin-bottom: var(--spacing-xs);
}

.pub-item__title a {
  color: var(--text-primary);
  transition: color 0.2s ease;
}

.pub-item__title a:hover {
  color: var(--text-muted);
}

.pub-item__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--spacing-sm);
  font-family: var(--font-serif);
  font-size: 0.82rem;
  font-style: italic;
}

.pub-tag {
  display: inline-block;
  background: var(--tag-bg);
  color: var(--tag-text);
  padding: 0.15em 0.6em;
  border-radius: 3px;
  font-weight: 400;
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  font-style: normal;
}

.pub-tag--award {
  background: #efe9da;
  color: #6b5b35;
}

.pub-item__links {
  font-family: var(--font-serif);
  font-size: 0.85rem;
  font-style: italic;
  color: var(--text-muted);
}

.pub-item__links a {
  color: var(--text-muted);
  margin-right: var(--spacing-sm);
  transition: color 0.2s ease;
}

.pub-item__links a:hover {
  color: var(--text-primary);
}

/* ===== Minimalist Industry Grid ===== */
.industry-grid {
  display: flex;
  flex-direction: column;
}

.industry-row {
  display: grid;
  grid-template-columns: 2fr 1.5fr 3.5fr 1fr;
  align-items: baseline;
  gap: var(--spacing-md);
  padding: 1.25rem 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.industry-row.entered {
  opacity: 1;
  transform: translateY(0);
}

.industry-row:last-child {
  border-bottom: none;
}

.industry-row__role {
  color: var(--text-primary);
  font-weight: 500;
}

.industry-row__company {
  color: var(--text-secondary);
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-style: italic;
}

.industry-row__desc {
  color: var(--text-muted);
}

.industry-row__date {
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  text-align: right;
  font-size: 0.85rem;
}

/* ===== Essays ===== */
.essay-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.essay-item {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: var(--spacing-lg);
  align-items: baseline;
}

.essay-item__date {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.essay-item__title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  color: var(--text-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.essay-item__title:hover {
  text-decoration: underline;
  text-decoration-color: var(--text-muted);
  text-underline-offset: 4px;
}

/* ===== Education ===== */
.edu-item {
  margin-bottom: var(--spacing-lg);
}

.edu-item:last-child {
  margin-bottom: 0;
}

.edu-item__school {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
}

.edu-item__degree {
  font-family: var(--font-serif);
  font-size: 0.92rem;
  color: var(--text-secondary);
}

.edu-item__details {
  font-family: var(--font-serif);
  font-size: 0.88rem;
  color: var(--text-muted);
  font-style: italic;
}

/* ===== Awards ===== */
.awards-list {
  list-style: none;
}

.award-item {
  margin-bottom: var(--spacing-md);
  font-family: var(--font-serif);
  font-size: 1rem;
  line-height: 1.75;
  color: var(--text-secondary);
}

.award-item:last-child {
  margin-bottom: 0;
}

.award-item strong {
  font-weight: 600;
  color: var(--text-primary);
}

/* ===== Footer ===== */
.footer {
  padding: var(--spacing-xl) 0 var(--spacing-2xl);
  font-family: var(--font-serif);
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
  letter-spacing: 0.04em;
}

/* ===== Scroll Animations ===== */
.fade-in {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

.stagger-children .fade-in-child {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.stagger-children .fade-in-child.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  html {
    font-size: 17px;
  }

  .container {
    padding: 0 var(--spacing-md);
  }

  .hero__content-container {
    max-width: 100%;
    margin-left: 0;
  }

  .site-visual-bg {
    height: 60vh;
    -webkit-mask-image: radial-gradient(130% 130% at 50% 0%, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0) 75%);
    mask-image: radial-gradient(130% 130% at 50% 0%, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0) 75%);
  }

  .hero {
    padding: calc(var(--spacing-2xl) * 1.5) 0 var(--spacing-lg);
  }

  .hero__content.manifesto {
    font-size: 1.06rem;
    text-align: left;
    /* Justified text looks bad on phones */
  }

  .section {
    padding: var(--spacing-lg) 0;
  }

  .exp-item__header {
    flex-direction: column;
    gap: 0;
  }

  .nav__links {
    gap: var(--spacing-sm);
    flex-wrap: wrap;
    justify-content: flex-end;
  }
}

@media (max-width: 480px) {
  html {
    font-size: 16px;
  }

  .hero__pitch {
    font-size: 1rem;
    line-height: 1.8;
  }

  .hero__links {
    gap: var(--spacing-xs) var(--spacing-sm);
    font-size: 0.9rem;
  }

  .nav__inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.8rem;
  }

  .nav__links {
    gap: var(--spacing-md);
    font-size: 0.85rem;
    flex-wrap: wrap;
    justify-content: flex-start;
  }
}