/* =====================================================================
   Color Palette
   --navy     #053c5e  Yale Blue        text, site header
   --teal     #1f7a8c  Teal             links, nav tabs, dividers, tags
   --sky      #bfdbf7  Pale Sky         page background, light text on dark
   --mist     #e8f1fb  (Pale Sky tint)  page background, left edge
   --scarlet  #db222a  Primary Scarlet  accents, active tab, link hover
   --ruby     #a31621  Ruby Red         section headings
   ===================================================================== */

:root {
  --navy:    #053c5e;
  --teal:    #1f7a8c;
  --sky:     #bfdbf7;
  --mist:    #e8f1fb;
  --scarlet: #db222a;
  --ruby:    #a31621;
  --colorbar: linear-gradient(to right, var(--navy), var(--teal), var(--sky), var(--scarlet), var(--ruby));
}

* { box-sizing: border-box; }

html { height: 100%; }

body {
  min-height: 100%;
  margin: 0;
  font-family: Georgia, serif;
  font-size: 16px;
  color: var(--navy);
  background: linear-gradient(to right, var(--mist) 0%, var(--sky) 100%);
}

h1 { margin: 0; }
h2 { font-size: 1.6em; margin: 0.4em 0 0.3em; }
h3 { font-size: 1.25em; margin: 0.8em 0 0.3em; }
h4 { font-size: 1.05em; margin: 0 0 0.25em; }
h5 { font-size: 0.95em; }
p  { font-size: 0.9em; margin: 0.3em 0; }
a  { color: var(--teal); }
a:hover { color: var(--scarlet); }

/* ===================================================================
   SITE HEADER
   =================================================================== */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 2vw;
  background-color: var(--navy);
  color: var(--sky);
  flex-wrap: wrap;
  gap: 8px;
}

.header-name h1 {
  font-size: 3em;
  color: var(--sky);
}
.header-subtitle {
  font-size: 0.9em;
  color: var(--sky);
  margin: 2px 0 0;
}

.header-links {
  display: flex;
  align-items: center;
  gap: 20px;
}
.contact-info {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  font-size: 0.85em;
  color: var(--sky);
}
.social-links {
  display: flex;
  align-items: center;
  gap: 10px;
}
/* Palette colorbar stripe under the header */
.site-header + .navBar::before,
.headerRow + .navBar::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 0;
  right: 0;
  height: 6px;
  background: var(--colorbar);
}

.img11 {
  max-height: 44px;
  object-fit: scale-down;
  opacity: 0.9;
  transition: opacity 0.2s;
}
.img11:hover { opacity: 0.6; }

/* ===================================================================
   NAVIGATION BAR
   =================================================================== */
.navBar {
  position: relative;
  margin-top: 6px;
  display: flex;
  border-top: 2px solid var(--teal);
  border-bottom: 2px solid var(--teal);
  font-family: Georgia, serif;
}
.navBar .tablink {
  flex: 1;
  background-color: var(--teal);
  color: #ffffff;
  font-family: Georgia, serif;
  font-size: 1em;
  padding: 10px 6px;
  border: none;
  outline: none;
  cursor: pointer;
  transition: background-color 0.15s;
}
.navBar .tablink:hover { background-color: var(--sky); color: var(--navy); }

/* ===================================================================
   TAB CONTENT VISIBILITY
   =================================================================== */
.tabcontent { display: none; }

/* ===================================================================
   TAB BODY WRAPPER
   =================================================================== */
.tab-body {
  padding: 2vh 3vw;
  max-width: 980px;
  width: 100%;
}

/* ===================================================================
   HOME LAYOUT
   =================================================================== */
.home-layout {
  display: grid;
  grid-template-columns: minmax(180px, 18%) 1fr;
  grid-template-rows: auto 1fr;
  grid-template-areas: "photo bio" "video bio";
  column-gap: 2vw;
  max-width: 100%;
}
.home-photo-col {
  grid-area: photo;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1em 0.5em;
  border-right: 1px dashed var(--teal);
}
.home-bio-col {
  grid-area: bio;
  min-width: 0;
  padding: 1em 1em 1em 2em;
}
.home-layout .home-video-col {
  grid-area: video;
  margin: 0;
  padding: 0 0.5em 1em;
  border-right: 1px dashed var(--teal);
}
.home-video-col .sim-video { border: none; }
.profile-photo {
  width: 100%;
  max-width: 160px;
  border-radius: 50%;
  border: 3px solid var(--scarlet);
  object-fit: cover;
  aspect-ratio: 1 / 1;
}

/* ===================================================================
   SIMULATION VIDEOS
   =================================================================== */
.sim-figure { margin: 1.2em 0; }
.sim-video {
  width: 100%;
  max-width: 640px;
  display: block;
  border: 1px solid var(--teal);
  border-top: 4px solid var(--scarlet);
}
.sim-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.sim-row .sim-figure { margin: 0; }
.sim-row .sim-video { aspect-ratio: 944 / 790; object-fit: contain; }
@media only screen and (max-width: 680px) {
  .sim-row { grid-template-columns: 1fr; }
}
.sim-figure figcaption {
  font-size: 0.85em;
  color: var(--teal);
  margin-top: 0.3em;
}

/* ===================================================================
   TWO-COLUMN LAYOUT (Education & Experience)
   =================================================================== */
.two-col-layout {
  display: flex;
  gap: 0;
  flex-wrap: wrap;
  max-width: 100%;
  padding: 0;
}
.two-col-left {
  flex: 1;
  min-width: 260px;
  padding: 2vh 2vw;
  border-right: 1px dashed var(--teal);
}
.two-col-right {
  flex: 1;
  min-width: 260px;
  padding: 2vh 2vw;
}

/* ===================================================================
   SECTION HEADERS
   =================================================================== */
.section-header {
  font-size: 1.5em;
  color: var(--ruby);
  border-bottom: 2px solid var(--scarlet);
  padding-bottom: 4px;
  margin-bottom: 0.8em;
}
.subsection-header {
  font-size: 1.1em;
  color: var(--teal);
  margin: 1.2em 0 0.4em;
}

/* ===================================================================
   CARDS (Research entries)
   =================================================================== */
.card {
  background-color: rgba(255, 255, 255, 0.65);
  border-left: 4px solid var(--scarlet);
  border-radius: 4px;
  padding: 14px 16px;
  margin-bottom: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}
.card-title {
  font-weight: bold;
  font-size: 1em;
  color: var(--navy);
}
.card-date {
  font-size: 0.8em;
  color: var(--teal);
  white-space: nowrap;
}

/* ===================================================================
   TIMELINE (Education & Experience)
   =================================================================== */
.timeline-item {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  position: relative;
}
.timeline-dot {
  width: 12px;
  height: 12px;
  background-color: var(--scarlet);
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 5px;
}
.timeline-content {
  flex: 1;
  border-left: 2px solid var(--teal);
  padding-left: 12px;
}
.timeline-meta {
  font-size: 0.82em;
  color: var(--teal);
  margin: 2px 0 4px;
}
.course-list {
  padding-left: 18px;
  margin: 6px 0 0;
}
.course-list li {
  font-size: 0.87em;
  margin-bottom: 3px;
}
.award-item {
  margin-bottom: 12px;
  padding-left: 14px;
  border-left: 3px solid var(--scarlet);
}

/* ===================================================================
   TAGS
   =================================================================== */
.tag-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0;
}
.tag {
  background-color: var(--teal);
  color: #ffffff;
  font-size: 0.75em;
  padding: 3px 9px;
  border-radius: 12px;
  white-space: nowrap;
}
.tag-alt {
  background-color: var(--sky);
  color: var(--ruby);
}

/* ===================================================================
   PROJECT CARDS GRID
   =================================================================== */
.project-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 16px;
}
.project-card {
  text-decoration: none;
  color: inherit;
  flex: 1;
  min-width: 220px;
  max-width: 320px;
  background-color: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--teal);
  border-top: 4px solid var(--scarlet);
  border-radius: 6px;
  transition: box-shadow 0.2s, transform 0.15s;
  box-shadow: 0 2px 6px rgba(0,0,0,0.07);
}
@media (hover: hover) {
  .project-card:hover {
    box-shadow: 0 4px 14px rgba(0,0,0,0.14);
    transform: translateY(-2px);
  }
}
.project-card-inner {
  padding: 16px;
}
.project-card-inner h3 {
  margin: 0 0 8px;
  color: var(--navy);
  font-size: 1.05em;
}

/* ===================================================================
   CV EMBED
   =================================================================== */
.cv-embed {
  display: block;
  width: 100%;
  height: 80vh;
  min-height: 500px;
  border: 1px solid var(--teal);
  border-radius: 4px;
  margin-top: 12px;
}
.dl-link {
  font-weight: bold;
  font-size: 0.95em;
}

/* ===================================================================
   MISC HELPERS
   =================================================================== */
.muted-text {
  color: var(--teal);
  font-size: 0.85em;
}
.quote {
  border-left: 3px solid var(--scarlet);
  margin: 1.5em 0 0.5em 0;
  padding: 8px 16px;
  font-style: italic;
  color: var(--teal);
  font-size: 0.9em;
  background-color: rgba(255,255,255,0.35);
  border-radius: 0 4px 4px 0;
}
.tab { text-indent: 16px; }

/* ===================================================================
   MOBILE HELPERS (shown/hidden by the responsive block below)
   =================================================================== */
.contact-info a { color: var(--sky); text-decoration: none; }
.contact-info a:hover { color: #ffffff; text-decoration: underline; }
.tablink .short { display: none; }
.pdf-open { display: none; }
.sim-play {
  display: block;
  float: none;
  height: auto;
  margin: 0.5em 0;
  padding: 10px 16px;
  border: none;
  border-radius: 6px;
  font-family: Georgia, serif;
  font-size: 1em;
  background-color: var(--scarlet);
  color: #ffffff;
}

/* ===================================================================
   CV & RESUME
   =================================================================== */
.cv-page { max-width: 1400px; }
.doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 24px;
}
.doc-panel {
  display: flex;
  flex-direction: column;
  background-color: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--teal);
  border-top: 4px solid var(--scarlet);
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.07);
  overflow: hidden;
}
.doc-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
}
.doc-icon {
  flex: 0 0 auto;
  width: 44px;
  height: 54px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 6px;
  box-sizing: border-box;
  background: linear-gradient(135deg, var(--scarlet), var(--ruby));
  /* folded top-right corner */
  clip-path: polygon(0 0, 70% 0, 100% 22%, 100% 100%, 0 100%);
  border-radius: 3px;
  color: #ffffff;
  font-size: 0.7em;
  font-weight: bold;
  letter-spacing: 0.05em;
}
.doc-info { flex: 1; min-width: 0; }
.doc-info h3 { margin: 0; color: var(--navy); }
.doc-info p { margin: 2px 0 0; }
.doc-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.doc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border: 2px solid var(--teal);
  border-radius: 6px;
  color: var(--teal);
  font-size: 0.9em;
  font-weight: bold;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}
.doc-btn:hover { background-color: var(--teal); color: #ffffff; }
.doc-btn-primary { background-color: var(--teal); color: #ffffff; }
.doc-btn-primary:hover { background-color: var(--scarlet); border-color: var(--scarlet); color: #ffffff; }
.doc-embed {
  display: block;
  width: 100%;
  height: 85vh;
  min-height: 600px;
  border: none;
  border-top: 1px solid var(--teal);
}

/* ===================================================================
   TEACHING
   =================================================================== */
.teaching-page { max-width: 1100px; }
.teaching-page .doc-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
  gap: 16px;
}
.course-block { margin-bottom: 2em; }

/* ===================================================================
   PROJECT PAGES
   =================================================================== */
/* Static version of the highlight openPage() applies to the active tab */
.navBar .tablink.active {
  background-color: var(--scarlet);
  color: #ffffff;
  border-left: 2px solid var(--navy);
  border-right: 2px solid var(--navy);
}
.project-page {
  display: block;
  max-width: 1200px;
}
.back-link {
  display: inline-block;
  font-size: 0.9em;
  margin-bottom: 0.5em;
}
.project-page .two-col-layout { margin-top: 1em; }
.project-page .cv-embed {
  height: 70vh;
  min-height: 400px;
  margin-top: 1em;
}
.project-pager {
  display: flex;
  justify-content: space-between;
  margin-top: 2em;
  padding-top: 0.8em;
  border-top: 2px solid var(--teal);
}

/* ===================================================================
   LEGACY CLASSES (used by positions page)
   =================================================================== */
.colCont {
  display: flex;
  justify-content: start;
}
.specCont {
  display: flex;
  justify-content: start;
}
.rowCont {
  display: flex;
  flex-direction: column;
  align-content: flex-start;
  justify-content: flex-start;
}
.colDec       { padding: 5%; text-align: center; }
.leftColDec   { padding: 1%; text-align: left; }
.colBord + .colBord {
  border-left-style: dashed;
  border-width: 0.5px;
  border-color: var(--teal);
}
.col-1  { flex: 8.33%; }
.col-2  { flex: 16.66%; }
.col-3  { flex: 25%; }
.col-4  { flex: 33.33%; }
.col-5  { flex: 41.66%; }
.col-6  { flex: 50%; }
.col-7  { flex: 58.33%; }
.col-8  { flex: 66.66%; }
.col-9  { flex: 75%; }
.col-10 { flex: 83.33%; }
.col-11 { flex: 91.66%; }
.col-12 { flex: 100%; }
.spec-3 { flex: 25%; height: 100%; }
.spec-4 { flex: 33.33%; }

.presentation {
  flex: 100%;
  min-height: 400px;
}
.img34 {
  width: 60%;
  height: auto;
}
.gs {
  width: 95%;
  margin: 0 auto;
}

div button {
  background-color: var(--teal);
  color: #ffffff;
  font-family: inherit;
  float: left;
  outline: none;
  cursor: pointer;
  height: 100%;
}
button p { font-size: 2em; margin: 5px; }

.sidenav button {
  transition: 0.3s;
  text-decoration: none;
  text-align: left;
  border-radius: 0 5px 5px 0;
}
.hoverButton {
  position: relative;
  height: 8vh;
  max-height: 75px;
  left: -50%;
  width: 100%;
  flex: 100%;
  font-family: Georgia, serif;
  color: #ffffff;
  background-color: var(--teal);
  margin: auto;
}
.hoverButton + .hoverButton { margin-top: 2px; }
.hoverButton:hover { background-color: var(--sky); color: var(--navy); }

.pageContent { padding: 2vh 2vw; }
.headerRow {
  display: flex;
  vertical-align: middle;
  color: var(--sky);
  margin: 0;
}
.headerRow div:first-child {
  text-align: center;
  color: var(--navy);
}
.headerRow div:last-child {
  text-align: left;
  padding: 10px;
  margin: 0;
  color: var(--sky);
  display: flex;
}
.headerRow div:last-child div {
  background-color: var(--teal);
  color: #ffffff;
  min-height: 100%;
  margin: 0;
}
.headerRow div div a {
  flex: 33%;
  text-align: center;
  margin: auto;
}
.headerRow div h1 { font-size: 4.5em; }

/* ===================================================================
   RESPONSIVE
   =================================================================== */
@media only screen and (max-width: 680px) {
  .site-header { flex-direction: column; align-items: flex-start; }
  .header-name h1 { font-size: 2em; }
  .contact-info { align-items: flex-start; }
  .home-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    grid-template-areas: "photo" "bio" "video";
  }
  .home-layout .home-video-col { border-right: none; padding: 0 0 1em; }
  .home-photo-col {
    width: 100%;
    border-right: none;
    border-bottom: 1px dashed var(--teal);
    padding-bottom: 1em;
  }
  .home-bio-col { padding: 1em 0; }
  .two-col-layout { flex-direction: column; flex-wrap: nowrap; }
  .two-col-left { border-right: none; border-bottom: 1px dashed var(--teal); }
  .project-card { max-width: 100%; }
  [class*="col-"] { flex: 100%; }
  .colCont { flex-direction: column; flex-wrap: nowrap; }
  .colBord { border-left-style: none; border-top-style: dashed; }
  .hoverButton { left: 0; }

  /* Header: name and icons on one row, contact underneath */
  .site-header {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    padding: 8px 16px;
  }
  .header-subtitle { font-size: 0.8em; }
  .header-links { width: 100%; justify-content: space-between; gap: 12px; }
  .contact-info { flex-direction: row; flex-wrap: wrap; gap: 4px 14px; }
  .img11 { max-height: 36px; }

  /* Nav: one sideways-scrolling row instead of wrapped labels */
  .navBar {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .navBar::-webkit-scrollbar { display: none; }
  .navBar .tablink {
    flex: 1 0 auto;
    white-space: nowrap;
    padding: 12px 14px;
    min-height: 44px;
  }
  .tablink .long { display: none; }
  .tablink .short { display: inline; }

  /* Readable text and phone-width gutters */
  p, li { font-size: 1em; }
  .tab-body { padding: 16px; border-radius: 0; }
  .two-col-left, .two-col-right { padding: 12px 0; }

  /* PDFs: phones can't scroll embedded PDFs, so link to the native viewer */
  .cv-embed, .project-page .cv-embed { display: none; }
  .pdf-open {
    display: inline-block;
    margin: 0.6em 0;
    padding: 12px 18px;
    background-color: var(--teal);
    color: #ffffff;
    border-radius: 6px;
    text-decoration: none;
  }
  .pdf-open:hover { background-color: var(--scarlet); color: #ffffff; }

  /* CV & Resume: no embedded viewer, just two download cards */
  .doc-grid { grid-template-columns: 1fr; gap: 16px; }
  .doc-embed { display: none; }
  .doc-head { flex-wrap: wrap; padding: 18px 16px; }
  .doc-actions { width: 100%; }
  .doc-btn { flex: 1; min-height: 48px; font-size: 1em; }

  /* Bigger tap targets */
  .back-link, .project-pager a { display: inline-block; padding: 10px 0; }
  .project-pager { gap: 12px; }
}
