/* ── Fonts ───────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400;1,600&family=DM+Sans:ital,wght@0,300;0,400;0,500;1,300&display=swap');

/* ── Variables ──────────────────────────────────────────────────── */
:root {
  --teal-deep: #1b3a4b;
  --teal-mid: #2d5f6f;
  --teal-light: #4a8fa3;
  --gold: #c9a84c;
  --gold-light: #e2c97e;
  --coral: #c96b42;
  --cream: #fdf8f2;
  --cream-dark: #f5ede0;
  --ink: #1a1a1a;
  --ink-mid: #3a3a3a;
  --ink-light: #6a6a6a;
  --rule: rgba(27, 58, 75, 0.15);
}

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

html {
  font-size: 15px;
}

body {
  background: var(--cream);
  color: var(--ink);
  font-family: 'DM Sans', sans-serif;
  font-weight: 300;
  line-height: 1.7;
}

/* ── Page wrapper ───────────────────────────────────────────────── */
.cv-wrapper {
  position: relative;
  max-width: 920px;
  margin: 0 auto;
  padding: 0 2rem 4rem;
}

/* ── Header ─────────────────────────────────────────────────────── */
.cv-header {
  position: relative;
  padding: 4rem 0 3rem;
  overflow: hidden;
}

.header-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--teal-deep) 0%, #0f2535 60%, #1b3a4b 100%);
  border-radius: 0 0 2px 2px;
  z-index: 0;
}

.header-helix {
  position: absolute;
  right: -20px;
  top: -20px;
  opacity: 0.12;
  z-index: 1;
}

.header-hex {
  position: absolute;
  left: -40px;
  bottom: -40px;
  opacity: 0.08;
  z-index: 1;
}

.header-content {
  position: relative;
  z-index: 2;
  padding: 0 3rem;
}

.header-eyebrow {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--gold-light);
  margin-bottom: 0.75rem;
}

h1.name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 4.2rem;
  font-weight: 300;
  line-height: 1.05;
  color: #ffffff;
  letter-spacing: 0.02em;
}

h1.name em {
  font-style: italic;
  color: var(--gold-light);
}

.header-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem;
  font-weight: 400;
  font-style: italic;
  color: rgba(255, 255, 255, 0.75);
  margin-top: 0.4rem;
  letter-spacing: 0.05em;
}

.header-institution {
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 0.3rem;
}

.header-divider {
  width: 60px;
  height: 2px;
  background: var(--gold);
  margin: 1.5rem 0;
}

.header-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.8rem;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 300;
}

.header-contact a {
  color: var(--gold-light);
  text-decoration: none;
}

.header-contact span::before {
  content: attr(data-icon);
  margin-right: 0.4em;
  opacity: 0.7;
}

/* ── Back to website button ─────────────────────────────────────── */
.btn-home {
  position: absolute;
  top: 2.5rem;
  right: 3rem;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  padding: 0.55rem 1.1rem;
  border-radius: 99px;
  border: 1px solid rgba(201, 168, 76, 0.4);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--gold-light);
  background: rgba(201, 168, 76, 0.08);
  text-decoration: none;
  transition: transform 160ms, background 160ms, border-color 160ms;
  overflow: hidden;
}

.btn-home.border-beam-host::after {
  z-index: 1;
}

.btn-home:hover {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(226, 201, 126, 0.035)),
    rgba(201, 168, 76, 0.12);
  border-color: rgba(201, 168, 76, 0.6);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transform: translateY(-2px);
}

/* ── Body ───────────────────────────────────────────────────────── */
.cv-body {
  padding: 3rem 0 0;
}

.cv-section {
  margin-bottom: 3.5rem;
}

/* ── Section header ─────────────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.8rem;
}

.section-marker {
  width: 4px;
  height: 2rem;
  background: linear-gradient(180deg, var(--gold) 0%, var(--coral) 100%);
  border-radius: 2px;
  flex-shrink: 0;
}

h2.section-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.9rem;
  font-weight: 600;
  color: var(--teal-deep);
  letter-spacing: 0.01em;
}

.section-rule {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--rule) 0%, transparent 100%);
}

/* ── Academic Positions ─────────────────────────────────────────── */
/* Each .position-row has 3 children: year | institution | role */
.positions-list {
  display: flex;
  flex-direction: column;
}

.position-row {
  display: grid;
  grid-template-columns: 110px 1fr 140px;
  gap: 0 1.5rem;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--rule);
  align-items: start;
}

.position-row:first-child {
  border-top: 1px solid var(--rule);
}

.position-year {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--teal-mid);
  letter-spacing: 0.05em;
  padding-top: 0.15rem;
}

.position-org {
  font-weight: 400;
  font-size: 0.9rem;
  color: var(--ink);
}

.position-org strong {
  font-weight: 500;
}

.position-role {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 0.92rem;
  color: var(--coral);
  text-align: right;
  padding-top: 0.1rem;
}

/* ── Education ──────────────────────────────────────────────────── */
/* Each .edu-entry has 2 children: left block | right date */
.education-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.edu-entry {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0 2rem;
  padding-left: 1rem;
  border-left: 2px solid var(--cream-dark);
}

.edu-degree {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--teal-deep);
}

.edu-field {
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal-mid);
  margin-top: 0.1rem;
}

.edu-institution {
  font-size: 0.88rem;
  color: var(--ink-mid);
  margin-top: 0.3rem;
}

.edu-honours {
  font-size: 0.78rem;
  color: var(--coral);
  font-style: italic;
  margin-top: 0.25rem;
}

.edu-meta {
  text-align: right;
  font-size: 0.78rem;
  color: var(--ink-light);
  line-height: 1.6;
}

/* ── Awards & Fellowships ───────────────────────────────────────── */
/* Each .award-row has 3 children: year | name | country */
.awards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-top: 1px solid var(--rule);
}

.award-row {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  gap: 0 0.75rem;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--rule);
  align-items: start;
}

.awards-grid .award-row:nth-child(odd) {
  border-right: 1px solid var(--rule);
}

.award-year {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--gold);
  letter-spacing: 0.05em;
  padding-top: 0.1rem;
}

.award-name {
  font-size: 0.83rem;
  color: var(--ink);
  font-weight: 400;
  line-height: 1.4;
}

.award-country {
  font-size: 0.7rem;
  color: var(--teal-mid);
  font-style: italic;
  white-space: nowrap;
  padding-top: 0.1rem;
}

/* ── Recognition ────────────────────────────────────────────────── */
.recognition-block {
  margin-bottom: 2rem;
}

h3.sub-heading {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--teal-mid);
  margin-bottom: 1rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--rule);
}

/* Each .recog-item has 2 children: year | name */
.recog-list {
  list-style: none;
  display: flex;
  flex-direction: column;
}

.recog-item {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 0 1rem;
  padding: 0.6rem 0.5rem;
  border-bottom: 1px solid rgba(27, 58, 75, 0.07);
  font-size: 0.84rem;
}

.recog-year {
  color: var(--teal-mid);
  font-weight: 500;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  padding-top: 0.05rem;
}

.recog-name strong {
  font-weight: 500;
}

.plenary-text {
  font-size: 0.86rem;
  color: var(--ink-mid);
  line-height: 1.7;
  background: rgba(27, 58, 75, 0.04);
  border-left: 3px solid var(--teal-light);
  padding: 0.9rem 1.2rem;
  border-radius: 0 4px 4px 0;
}

/* ── Contribution to Academia ───────────────────────────────────── */
.contrib-block {
  margin-bottom: 1.5rem;
}

.contrib-label {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.5rem;
}

.contrib-text {
  font-size: 0.86rem;
  color: var(--ink-mid);
  line-height: 1.75;
}

/* ── Research Funding ───────────────────────────────────────────── */
.funding-total {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--teal-deep);
  color: #fff;
  padding: 0.5rem 1.4rem;
  border-radius: 2px;
  margin-bottom: 1.5rem;
  font-size: 0.82rem;
  letter-spacing: 0.05em;
}

.funding-total strong {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--gold-light);
}

.funding-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.funding-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.funding-table thead tr {
  background: var(--teal-deep);
  color: rgba(255, 255, 255, 0.85);
}

.funding-table thead th {
  padding: 0.7rem 0.9rem;
  text-align: left;
  font-weight: 400;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.funding-table tbody tr {
  border-bottom: 1px solid var(--rule);
}

.funding-table td {
  padding: 0.65rem 0.9rem;
  vertical-align: top;
  line-height: 1.5;
  color: var(--ink-mid);
}

.funding-table td:first-child {
  color: var(--teal-mid);
  font-weight: 500;
  font-size: 0.78rem;
  white-space: nowrap;
}

.funding-table .grant-name {
  font-weight: 400;
  color: var(--ink);
}

.funding-table .funder {
  font-size: 0.75rem;
  color: var(--ink-light);
  margin-top: 0.2rem;
}

.funding-table .amount {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--teal-mid);
  white-space: nowrap;
}

.funding-table .role-pi {
  display: inline-block;
  font-size: 0.68rem;
  background: var(--teal-deep);
  color: #fff;
  padding: 0.15rem 0.5rem;
  border-radius: 2px;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.funding-table .role-co {
  display: inline-block;
  font-size: 0.68rem;
  background: var(--teal-mid);
  color: #fff;
  padding: 0.15rem 0.5rem;
  border-radius: 2px;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

/* ── Publications ───────────────────────────────────────────────── */
.pub-stats {
  display: flex;
  gap: 1px;
  margin-bottom: 1.8rem;
  border: 1px solid var(--rule);
  overflow: hidden;
  border-radius: 4px;
  width: fit-content;
}

.pub-stat {
  padding: 0.8rem 1.8rem;
  text-align: center;
  background: #fff;
}

.pub-stat+.pub-stat {
  border-left: 1px solid var(--rule);
}

.pub-stat-num {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2rem;
  font-weight: 600;
  color: var(--teal-deep);
  line-height: 1;
}

.pub-stat-label {
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-light);
  margin-top: 0.2rem;
}

.pub-legend {
  font-size: 0.78rem;
  color: var(--ink-light);
  margin-bottom: 1.5rem;
  font-style: italic;
}

.pub-legend strong {
  color: var(--teal-mid);
  font-weight: 500;
  font-style: normal;
}

/* Each .pub-entry has 2 children: number | body block */
.pub-list {
  display: flex;
  flex-direction: column;
}

.pub-entry {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 0 1rem;
  padding: 1rem 0.5rem;
  border-bottom: 1px solid var(--rule);
}

.pub-num {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--gold);
  text-align: right;
  padding-top: 0.05rem;
  line-height: 1.4;
}

.pub-body {
  line-height: 1.55;
}

.pub-authors {
  font-size: 0.82rem;
  color: var(--ink-light);
  margin-bottom: 0.25rem;
}

.pub-authors strong {
  color: var(--teal-deep);
  font-weight: 500;
}

.pub-title {
  font-size: 0.88rem;
  color: var(--ink);
  font-weight: 400;
  margin-bottom: 0.3rem;
}

.pub-venue {
  font-size: 0.78rem;
  color: var(--ink-light);
}

.pub-venue strong {
  font-style: italic;
  font-weight: 400;
  color: var(--teal-mid);
}

.pub-if {
  display: inline-block;
  font-size: 0.68rem;
  background: rgba(27, 58, 75, 0.08);
  color: var(--teal-deep);
  padding: 0.1rem 0.45rem;
  border-radius: 2px;
  margin-left: 0.4rem;
  letter-spacing: 0.04em;
  font-weight: 500;
}

.pub-cover {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  font-size: 0.66rem;
  background: var(--gold);
  color: #fff;
  padding: 0.12rem 0.5rem;
  border-radius: 2px;
  margin-left: 0.4rem;
  letter-spacing: 0.05em;
  font-weight: 500;
  text-transform: uppercase;
}

.pub-cover::before {
  content: "★";
  font-size: 0.6em;
}

/* ── Footer ─────────────────────────────────────────────────────── */
.cv-footer {
  margin-top: 3rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  color: var(--ink-light);
  letter-spacing: 0.05em;
  position: relative;
}

.footer-logo {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 0.95rem;
  color: var(--teal-mid);
}

/* ── Mobile ─────────────────────────────────────────────────────── */
@media (max-width: 700px) {
  .cv-wrapper {
    padding: 0 1rem 3rem;
  }

  .header-content {
    padding: 0 1.25rem;
  }

  h1.name {
    font-size: 2.8rem;
  }

  .btn-home {
    top: 1.5rem;
    right: 1.25rem;
    font-size: 0.78rem;
    padding: 0.45rem 0.85rem;
  }

  /* Positions: stack year above institution, role below */
  .position-row {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
  }

  .position-year {
    grid-column: 1;
    grid-row: 1;
  }

  .position-org {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .position-role {
    grid-column: 2;
    grid-row: 1;
    text-align: right;
  }

  /* Education: stack date below */
  .edu-entry {
    grid-template-columns: 1fr;
    gap: 0.2rem 0;
  }

  .edu-meta {
    text-align: left;
  }

  /* Awards: single column */
  .awards-grid {
    grid-template-columns: 1fr;
  }

  .awards-grid .award-row:nth-child(odd) {
    border-right: none;
  }

  /* Recognition: stack year above */
  .recog-item {
    grid-template-columns: 1fr;
    gap: 0.1rem 0;
  }

  .recog-year {
    font-size: 0.7rem;
  }

  /* Funding table: horizontal scroll */
  .funding-table-wrap {
    margin: 0 -1rem;
    padding: 0 1rem;
  }

  /* Publication number: smaller */
  .pub-num {
    font-size: 0.95rem;
  }

  .cv-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
  }
}

@media print {
  .btn-home {
    display: none;
  }

  body {
    background: #fff;
  }

  .cv-wrapper {
    padding: 0;
    max-width: none;
  }

  .header-bg {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
}
