@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@300;400;500;600&family=IBM+Plex+Serif:wght@400;450;500;600&display=swap");

/* ACCEPT AT VUW WEBSITE STYLES */

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/JetBrainsMono-Regular.woff2") format("woff2");
}

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/JetBrainsMono-Medium.woff2") format("woff2");
}

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/JetBrainsMono-SemiBold.woff2") format("woff2");
}

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/JetBrainsMono-Bold.woff2") format("woff2");
}

/* ========== COLOUR PALETTE ========== */
/* light theme (catppuccin latte inspired) */
:root {
  /* greys */
  --header-dark: #4c4f69;
  --header-border: #e4e4ec;
  --text-dark: #1a1a2e;
  --text-body: #2c2c3a;
  --text-light: #6b6b80;
  --bg-light: #ffffff;
  --bg-white: #ffffff;
  --border: #e4e4ec;

  /* accent colours */
  --accent-primary: #5872f5;
  --accent-hover: #4660d9;
  --accent-presentations: #209fb5;
  --success: #40a02b;
  --warning: #fe640b;

  /* callouts */
  --callout-note-bg: #f0f4ff;
  --callout-tip-bg: #f0fff4;
  --callout-warning-bg: #fffaf0;

  /* spacing */
  --content-max-width: 820px;

  /* radius */
  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-pill: 999px;
}

/* dark theme (catppuccin mocha inspired) */
body.quarto-dark {
  --header-dark: #11111b;
  --header-border: #2e2e48;
  --text-dark: #e8e8f0;
  --text-body: #d4d4e0;
  --text-light: #9898ac;
  --bg-light: #1a1a2e;
  --bg-white: #222240;
  --border: #2e2e48;

  --accent-primary: #93bbfc;
  --accent-hover: #aeccfd;
  --accent-presentations: #94e2d5;
  --success: #a6e3a1;
  --warning: #fab387;

  --callout-note-bg: #313244;
  --callout-tip-bg: #45475a;
  --callout-warning-bg: #313244;
}

/* ========== GLOBAL STYLES ========== */
body {
  font-family: "IBM Plex Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text-body);
  line-height: 1.6;
  font-size: 17px;
  background-color: var(--bg-light);
  font-weight: 300;
}

p {
  hyphens: auto;
}

@media (min-width: 769px) {
  p {
    text-align: justify;
    text-justify: inter-word;
  }
}

/* monospace fonts for code */
pre, code, kbd, samp {
  font-family: "JetBrains Mono", "SF Mono", "Cascadia Code", "Roboto Mono", "Consolas", "Courier New", monospace;
}

/* ========== HEADER/NAVBAR ========== */
.navbar {
  background-color: var(--header-dark) !important;
  border-bottom: 3px solid var(--header-border);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.navbar-brand,
.navbar-nav .nav-link,
.navbar-nav .dropdown-toggle {
  color: #f7fafc !important;
  font-family: "IBM Plex Serif", Georgia, serif;
  font-size: 0.8125rem;
}

.navbar-nav .nav-link:hover,
.navbar-nav .dropdown-toggle:hover {
  color: #cbd5e0 !important;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  transition: all 0.2s ease;
}

/* prominent presentations button */
#nav-menu-presentations {
  background-color: var(--accent-presentations) !important;
  color: white !important;
  font-weight: 600;
  padding: 6px 18px;
  border-radius: 20px;
  margin: 0 8px;
  transition: all 0.2s ease;
}

#nav-menu-presentations:hover {
  background-color: #1a5ad7 !important;
  transform: translateY(-1px);
  box-shadow: 0 3px 6px rgba(0,0,0,0.2);
}

/* ========== MAIN CONTENT ========== */
.content {
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: 3rem 2rem;
}

/* ========== TYPOGRAPHY ========== */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-dark);
  font-family: "IBM Plex Serif", Georgia, serif;
  font-weight: 450;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  letter-spacing: 0.01em;
}

h1 {
  font-size: 2.25rem;
  margin-bottom: 2rem;
  padding-bottom: 0.75rem;
  position: relative;
  display: inline-block;
}

h1::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 6px;
  background: var(--accent-primary);
  border-radius: var(--radius-pill);
}

.home .quarto-title-block {
  display: none;
}

.hero {
  padding: 2.5rem 2rem;
  margin: 1.5rem 0 3rem;
  background: var(--bg-white);
  border: 1px solid var(--header-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 20px rgba(17, 17, 27, 0.08);
}

.hero-title {
  margin: 0 0 0.75rem;
  font-family: "IBM Plex Serif", Georgia, serif;
  font-size: 2.6rem;
  font-weight: 600;
  line-height: 1.1;
  color: var(--text-dark);
}

.hero-subtitle {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-light);
  font-family: "IBM Plex Serif", Georgia, serif;
}

body.quarto-dark .hero {
  box-shadow: none;
}

.quarto-title .subtitle,
.quarto-title-block .subtitle,
.subtitle.lead {
  margin-top: 0.5rem;
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-light);
  font-family: "IBM Plex Serif", Georgia, serif;
}

h2 {
  font-size: 1.75rem;
  margin-top: 3rem;
}

h3 {
  font-size: 1.375rem;
}

/* ========== LINKS ========== */
a {
  color: var(--accent-primary);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  transition: color 0.2s ease;
}

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

.contact-email {
  color: var(--accent-primary);
  font-weight: 600;
}

.contact-email:hover,
.contact-email:focus {
  color: var(--accent-hover);
}

/* ========== CODE BLOCKS ========== */
pre {
  background-color: var(--bg-white);
  border: 1px solid var(--header-border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  overflow-x: auto;
}

code:not(pre code) {
  background-color: var(--bg-light);
  padding: 0.125rem 0.375rem;
  border-radius: 3px;
  font-size: 0.875em;
  color: var(--accent-primary);
}

/* ========== TABLES ========== */
table {
  width: 100%;
  margin: 2rem 0;
  border-collapse: collapse;
}

/* tighten CV table year columns to a consistent width */
#work table,
#education table,
#awards table,
#serviceappointments table {
  table-layout: fixed;
}

#work table th:first-child,
#work table td:first-child,
#education table th:first-child,
#education table td:first-child,
#awards table th:first-child,
#awards table td:first-child,
#serviceappointments table th:first-child,
#serviceappointments table td:first-child {
  width: 10ch;
  max-width: 10ch;
  min-width: 10ch;
  white-space: nowrap;
}

#work table colgroup col:first-child,
#education table colgroup col:first-child,
#awards table colgroup col:first-child,
#serviceappointments table colgroup col:first-child {
  width: 10ch !important;
}

#work table colgroup col:last-child,
#education table colgroup col:last-child,
#awards table colgroup col:last-child,
#serviceappointments table colgroup col:last-child {
  width: auto !important;
}

th {
  background-color: var(--header-dark);
  color: white;
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
}

td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--header-border);
}

tr:hover {
  background-color: var(--bg-white);
}

/* ========== CV PAGE ========== */
.cv-page {
  max-width: 980px;
  margin: 1.5rem auto 3rem;
  padding: 2rem 2.2rem 2.4rem;
  border: 1px solid var(--header-border);
  border-radius: var(--radius-lg);
  background: var(--bg-white);
  box-shadow: 0 10px 24px rgba(17, 17, 27, 0.08);
}

.cv-page p {
  text-align: left;
  hyphens: none;
}

.cv-intro {
  position: relative;
  margin: 0 0 1.6rem;
  padding: 1.4rem 1.4rem 1.2rem 1.7rem;
  border: 1px solid var(--header-border);
  border-radius: var(--radius-md);
  background: linear-gradient(
    130deg,
    rgba(88, 114, 245, 0.1),
    rgba(88, 114, 245, 0.02) 62%
  );
}

.cv-intro::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.5rem;
  bottom: 0.5rem;
  width: 4px;
  border-radius: var(--radius-pill);
  background: var(--accent-primary);
}

.cv-intro > p {
  margin: 0;
  font-family: "IBM Plex Serif", Georgia, serif;
  font-size: 1.16rem;
  line-height: 1.45;
  color: var(--text-dark);
}

.cv-links {
  margin-top: 1rem;
}

.cv-links p {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.cv-links a {
  padding: 0.28rem 0.7rem;
  border: 1px solid var(--header-border);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.cv-page h2 {
  margin-top: 2.2rem;
  padding-bottom: 0.45rem;
  border-bottom: 2px solid var(--header-border);
  font-size: 1.28rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cv-page h2::after {
  content: none;
}

.cv-page table {
  margin: 1rem 0 1.5rem;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--header-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  font-size: 0.95rem;
}

.cv-page th {
  font-size: 0.83rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.cv-page td {
  vertical-align: top;
}

.cv-page #software + ol {
  margin: 0.8rem 0 0;
  padding-left: 1.4rem;
}

.cv-page #software + ol li {
  margin: 0 0 0.7rem;
  padding: 0.5rem 0.6rem;
  border-left: 3px solid rgba(88, 114, 245, 0.35);
  background: rgba(88, 114, 245, 0.08);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.cv-chips {
  margin-top: 0.5rem;
}

.cv-chips code {
  margin: 0 0.35rem 0.35rem 0;
  display: inline-block;
  padding: 0.22rem 0.65rem;
  border: 1px solid var(--header-border);
  border-radius: var(--radius-pill);
  background: var(--bg-light);
  color: var(--text-dark);
  font-size: 0.86rem;
}

.cv-page #refs {
  margin-top: 0.8rem;
}

.cv-page #refs .csl-entry {
  margin: 0 0 0.5rem;
  padding: 0.25rem 0 0.25rem 0.9rem;
  border-left: 3px solid transparent;
  transition: border-color 0.2s ease;
}

.cv-page #refs .csl-entry:hover {
  border-left-color: var(--accent-primary);
}

/* ========== CALLOUT BOXES ========== */
.callout {
  margin: 2rem 0;
  padding: 1rem 1.5rem;
  border-radius: var(--radius-sm);
  border-left: 4px solid;
}

.callout-note {
  background-color: var(--callout-note-bg);
  border-left-color: var(--accent-primary);
}

.callout-tip {
  background-color: var(--callout-tip-bg);
  border-left-color: var(--success);
}

.callout-warning {
  background-color: var(--callout-warning-bg);
  border-left-color: var(--warning);
}

/* ========== CARDS/BOXES ========== */
.card {
  background: var(--bg-white);
  border: 1px solid var(--header-border);
  border-left: 3px solid var(--accent-primary);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin: 1.5rem 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  transition: box-shadow 0.2s ease;
}

.card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

/* ========== PRESENTATION EMBED ========== */
.presentation-container {
  background: var(--bg-white);
  border: 1px solid var(--header-border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin: 2rem 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.presentation-header {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--header-border);
}

.presentation-meta {
  font-size: 0.875rem;
  color: var(--text-light);
  margin-bottom: 0.5rem;
}

.presentation-embed {
  position: relative;
  width: 100%;
  height: 600px;
  border: 1px solid var(--header-border);
  border-radius: 4px;
  overflow: hidden;
}

.presentation-embed iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* ========== VIDEO EMBEDS ========== */
.video-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin: 1rem 0 2.5rem;
  background-color: var(--bg-white);
  border: 1px solid var(--header-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.video-embed iframe,
.video-embed embed,
.video-embed object {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ========== SIDEBAR TOC ========== */
.sidebar nav[role="doc-toc"] {
  background-color: var(--bg-white);
  border-radius: var(--radius-md);
  padding: 1rem;
  border: 1px solid var(--header-border);
}

.sidebar nav[role="doc-toc"] > ul {
  font-size: 0.875rem;
}

.sidebar nav[role="doc-toc"] a,
.sidebar nav[role="doc-toc"] a.nav-link {
  color: var(--accent-primary) !important;
}

.sidebar nav[role="doc-toc"] a:hover,
.sidebar nav[role="doc-toc"] a.nav-link:hover,
.sidebar nav[role="doc-toc"] a.active,
.sidebar nav[role="doc-toc"] a.nav-link.active {
  color: var(--accent-hover) !important;
  font-weight: 600;
}

/* ========== BUTTONS ========== */
.btn {
  padding: 0.5rem 1.5rem;
  border-radius: var(--radius-pill);
  font-weight: 500;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-block;
}

.btn-primary {
  background-color: var(--accent-primary);
  color: white;
  border: 1px solid rgba(88, 114, 245, 0.55);
}

.btn-primary:hover {
  background-color: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* ========== PRESENTATION STYLES ========== */
.embed-notice {
  text-align: center;
  padding: 2rem;
  background-color: var(--bg-light);
  border-radius: var(--radius-md);
}

.presentation-link {
  margin-top: 1.5rem;
}

.presentation-link .btn {
  font-size: 1.1rem;
  padding: 0.75rem 2rem;
}

/* ========== LOGOS ========== */
.logos-section {
  margin-top: 3rem;
  text-align: center;
}

.logos-section img {
  max-height: 120px;
  width: auto;
  margin: 1rem;
  opacity: 0.8;
  transition: opacity 0.3s ease;
}

.logos-section img:hover {
  opacity: 1;
}

/* ========== TEAM PHOTOS ========== */
.team-member {
  margin-bottom: 3rem;
}

.team-photo {
  width: 150px;
  height: 150px;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid var(--border);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: all 0.3s ease;
}

.team-photo:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  border-color: var(--accent-primary);
}

/* Placeholder styling */
.team-photo-placeholder {
  width: 150px;
  height: 150px;
  background-color: var(--bg-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid var(--border);
  color: var(--text-light);
  font-size: 3rem;
  font-weight: 300;
}

/* ========== DARK MODE TWEAKS ========== */
body.quarto-dark .cv-page {
  box-shadow: none;
}

body.quarto-dark .cv-intro {
  background: linear-gradient(
    130deg,
    rgba(137, 180, 250, 0.14),
    rgba(137, 180, 250, 0.03) 62%
  );
}

body.quarto-dark .cv-links a {
  background: rgba(24, 24, 37, 0.72);
}

body.quarto-dark .cv-page #software + ol li {
  background: rgba(137, 180, 250, 0.08);
  border-left-color: rgba(137, 180, 250, 0.42);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
  .content {
    padding: 2rem 1rem;
  }

  h1 {
    font-size: 1.75rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  .presentation-embed {
    height: 400px;
  }

  .team-photo,
  .team-photo-placeholder {
    width: 120px;
    height: 120px;
  }

  .team-member .columns {
    flex-direction: column;
    text-align: center;
  }

  .team-member .column {
    width: 100% !important;
  }

  .cv-page {
    margin: 0.9rem 0 2.4rem;
    padding: 1.2rem 1rem 1.5rem;
  }

  .cv-intro {
    padding: 1rem 1rem 0.9rem 1.2rem;
  }

  .cv-intro > p {
    font-size: 1.02rem;
  }

  .cv-page table {
    font-size: 0.9rem;
  }

  .cv-links p {
    gap: 0.45rem;
  }
}

/* ========== ACCESSIBILITY ========== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
