/* Home page (index.html).

   Desktop (>= 992px): the intro sits on the left and a 3D "card" with a
   looping video floats on the right. Opening the card (About Me, or a
   #/about or #/resume link) moves the intro out, flattens the card and
   loads about.html or résumé.html into .card-content (see js/site.js,
   which toggles the html classes below):

     .is-card-open         card animating open / open
     .is-card-opened       open animation finished
     .is-ajax-page-active  card shows loaded page content
     .is-ajax-page-loaded  that content has arrived

   Phones and tablets (<= 991px): the card is hidden; About and Résumé
   expand inline under the intro (.mobile-expand-section).

   Loaded after base.css and before pages.css. Some rules here
   (.card-intro p) are deliberately overridden by pages.css when the
   about/résumé content is shown inside the intro on phones. */

@font-face {
  font-family: "ET Book";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../blog/et-book/et-book-roman-line-figures/et-book-roman-line-figures.woff") format("woff");
}

@keyframes fadeIn {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

body {
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Intro ------------------------------------------------------------------ */

.card-layout {
  position: relative;
  max-width: 1170px;
  margin: 0 auto;
  will-change: transform, opacity;
}

.card-intro {
  z-index: 10;
  padding: 30px;
  text-align: center;
}

/* The name, and the "Blog" title of the last blog card. */
.card-intro h1 {
  margin: 0 0 10px 0;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0;
}

@media only screen and (min-width: 992px) {
  .card-intro h1 {
    font-size: clamp(1.75rem, 3vw, 2.5rem);
  }
}

/* Every paragraph in the left column: intro, research summaries, blog
   cards and, on phones, the about/résumé sections. Later rules refine it,
   so keep it first. */
.card-intro p {
  max-width: 560px;
  margin: 20px auto;
  font-size: 1rem;
  font-weight: 300;
}

@media only screen and (min-width: 992px) {
  .card-intro p {
    margin: 0;
    padding: 10px 0 34px;
    font-size: 20px;
  }
}

.intro-text {
  max-width: 44rem;
  margin: 2rem auto;
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--text-primary);
}

.intro-text > p {
  margin: 0 0 1rem;
}

.intro-quote {
  position: relative;
  margin: 0;
  padding: 0 0 18px;
  font-family: 'Heebo', sans-serif;
  font-size: inherit;
  font-style: italic;
  font-weight: normal;
  line-height: 1.5;
  opacity: 0.75;
}

.intro-quote__source {
  display: block;
  margin-top: 6px;
  font-size: 0.8em;
  font-style: normal;
  line-height: 1.45;
}

.intro-quote__source a {
  color: var(--accent-primary);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
  transition: color 0.2s ease;
}

.intro-quote__source a:hover,
.intro-quote__source a:focus {
  color: var(--accent-hover);
}

/* Links in the intro text: double underline. */
.quote__link {
  position: relative;
  z-index: 999;
  white-space: nowrap;
  color: var(--accent-primary);
}

.quote__link:hover {
  color: var(--accent-hover);
}

.quote__link::after {
  content: '';
  position: absolute;
  top: calc(100% + 0.1rem);
  left: 0;
  width: 100%;
  height: 5px;
  border-width: 1px 0;
  border-style: solid;
  border-color: currentColor;
}

@media screen and (min-width: 992px) {
  .quote__link::after {
    top: calc(100% + 0.2vh);
  }
}

.projects-section {
  margin: 2rem 0;
}

.section-label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.project-links {
  font-size: 1.125rem;
  line-height: 1.6;
}

/* A project shown in its own mark and type (Hesiod: mark + ET Book, as on hesiod.ch). */
.project-lockup {
  display: inline-flex;
  align-items: center;
  gap: 0.42em;
  font: 400 1.75rem/1 "ET Book", Georgia, serif;
  letter-spacing: 0.01em;
  text-decoration: none;
  color: var(--accent-primary);
  transition: opacity 0.2s ease;
}

.project-lockup:hover,
.project-lockup:focus-visible {
  color: var(--accent-primary);
  opacity: 0.7;
}

.project-lockup__mark {
  display: block;
  flex: none;
  width: 1.04em;
  height: 1.04em;
}

.ha-index {
  margin: 1.5rem 0 2rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  opacity: 0.8;
}

.card-triggers {
  width: 150%;
  margin-top: 2.5rem;
}

.github-avatar {
  width: 1.2em;
  height: 1.2em;
  margin-right: 0.25em;
  vertical-align: -0.15em;
  border-radius: 50%;
}

/* Phones only: the About / Résumé buttons, the sections they open and the
   video behind the intro. */
.mobile-nav-btn,
.mobile-expand-section,
.mobile-video-bg,
.video-attribution-mobile {
  display: none;
}

/* Card ------------------------------------------------------------------- */

.card {
  position: relative;
  margin: 0 auto;
  background: #000000;
}

.card-3d-right-side,
.card-3d-bottom-side,
.close-card {
  display: none;
}

.cover {
  position: relative;
  overflow: hidden;
}

/* Dark wash over the video and the card's edges. */
.cover::after,
.card-3d-right-side::after,
.card-3d-bottom-side::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 5;
  background: #181a1e;
  opacity: 0.2;
}

/* home.jpg is the video's first frame, shown until the video plays. */
.cover-media {
  position: relative;
  overflow: hidden;
  padding-top: 70%;
  background-image: url(../images/home/home.jpg);
  background-size: cover;
  background-position: center center;
  transition: all 0.6s;
}

.cover-video {
  position: absolute;
  top: 50%;
  left: 50%;
  width: auto;
  height: auto;
  min-width: 100%;
  min-height: 100%;
  object-fit: cover;
  transform: translate(-50%, -50%);
}

.video-attribution {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 10;
  font-family: 'Heebo', sans-serif;
  font-size: 12px;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.6);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.is-card-opened .video-attribution {
  opacity: 1;
  visibility: visible;
}

/* About Me / Résumé icons over the video, shown once the card is open. */
.card-nav {
  position: absolute;
  bottom: 20px;
  left: 20px;
  z-index: 70;
  font-family: 'Heebo', sans-serif;
}

.card-nav ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.card-nav li {
  display: inline-block;
  margin: 0 11px;
  text-align: center;
  opacity: 0;
  visibility: hidden;
  transform: scale(0.7);
  transition: all 0.5s ease;
}

.is-card-opened .card-nav li {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
}

.is-card-opened .card-nav li:nth-child(1) {
  transition-delay: 0.5s;
}

.is-card-opened .card-nav li:nth-child(2) {
  transition-delay: 0.6s;
}

.card-nav a {
  display: block;
  position: relative;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #fff;
  transition: color 0.7s;
}

.card-nav i {
  display: block;
  font-size: 28px;
}

.card-nav .current_page_item a {
  color: #ffebc5;
}

/* Ripple when an item becomes current. */
.card-nav a::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 80px;
  height: 80px;
  margin: -50px 0 0 -40px;
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  box-shadow: inset 0 0 0 35px rgba(255, 255, 255, 0.1);
}

.card-nav .current_page_item a::after {
  animation: anim-effect-ripple 0.6s ease-out forwards;
}

@keyframes anim-effect-ripple {
  0% {
    opacity: 1;
    transform: scale3d(0.4, 0.4, 1);
  }
  80% {
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.6);
    opacity: 0.1;
  }
  100% {
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.6);
    opacity: 0;
    transform: scale3d(1.2, 1.2, 1);
  }
}

/* The loaded page below the video. */
.card-content {
  display: none;
  position: relative;
  min-height: 200px;
  padding: 20px 80px 120px;
  background-color: #fff;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.is-ajax-page-active .card-content {
  display: block;
}

.card-content:not(.is-loaded) {
  background-image: url(../images/bckg/loading.svg);
  background-position: center 60px;
  background-repeat: no-repeat;
  background-size: 64px 64px;
}

.card-content .page {
  margin: 0;
  padding: 0;
}

[data-theme="dark"] .card-content {
  color: var(--text-primary);
  background-color: var(--bg-primary);
}

[data-theme="dark"] .card-content h1,
[data-theme="dark"] .card-content h2,
[data-theme="dark"] .card-content h3,
[data-theme="dark"] .card-content h4 {
  color: var(--text-primary);
}

[data-theme="dark"] .card-content p,
[data-theme="dark"] .card-content li {
  color: var(--text-secondary);
}

/* Content rises in, title first, then the blocks one after another; it
   leaves in the reverse order. */
.card-content .entry-header,
.card-content .entry-content > * {
  opacity: 0;
  transform: translateY(40px);
}

.card-content.is-loaded .entry-header,
.card-content.is-loaded .entry-content > * {
  opacity: 1;
  transform: translateY(0);
}

.card-content .hentry > .entry-header {
  transition: transform 0.2s 0.3s, opacity 0.2s 0.3s;
}

.card-content .entry-content > *:nth-child(1) {
  transition: transform 0.2s 0.2s, opacity 0.2s 0.2s;
}

.card-content .entry-content > *:nth-child(2) {
  transition: transform 0.2s 0.1s, opacity 0.2s 0.1s;
}

.card-content .entry-content > *:nth-child(n+3) {
  transition: transform 0.2s 0s, opacity 0.2s 0s;
}

.card-content.is-loaded .entry-content > *:nth-child(1) {
  transition: transform 0.2s 0.5s, opacity 0.2s 0.5s;
}

.card-content.is-loaded .entry-content > *:nth-child(2) {
  transition: transform 0.2s 0.7s, opacity 0.2s 0.7s;
}

.card-content.is-loaded .entry-content > *:nth-child(n+3) {
  transition: transform 0.2s 0.8s, opacity 0.2s 0.8s;
}

/* "go to top" and the copyright line, shown below an open card. */
.card-footer {
  display: none;
  text-align: center;
}

.card-footer h1 {
  margin: 0;
  padding: 80px 0 50px;
}

.card-footer a {
  color: inherit;
  opacity: 0.3;
  transition: all 0.3s ease-out;
}

.card-footer a:hover {
  color: inherit;
  opacity: 0.4;
}

.card-footer + .site-footer {
  display: none;
  border: 0;
  opacity: 0.55;
}

.card-footer + .site-footer .site-info {
  letter-spacing: 3px;
}

.is-ajax-page-loaded .card-footer,
.is-ajax-page-loaded .card-footer + .site-footer {
  display: block;
}

/* Desktop: intro left, 3D card right ------------------------------------ */

@media only screen and (min-width: 992px) {
  html.one-page-layout {
    overflow-x: hidden;
  }

  .one-page-layout:not(.is-card-open),
  .one-page-layout:not(.is-card-open) body {
    height: 100%;
  }

  .card-layout {
    width: 90%;
    height: 100vh;
    padding-top: 100px;
    transition: all 0.7s;
  }

  .is-card-open .card-layout {
    height: auto;
  }

  .is-ajax-page-active .card-layout {
    padding-top: 0px;
  }

  .card-intro {
    position: absolute;
    top: 100px;
    left: 0;
    width: 50%;
    padding: 0;
    text-align: left;
    transform: translateZ(0);
    backface-visibility: hidden;
    will-change: transform, opacity;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .is-card-open .card-intro {
    opacity: 0;
    transform: translateX(-50%);
  }

  .is-card-opened .card-intro {
    display: none;
    will-change: auto;
  }

  .card-triggers .button {
    margin-right: 15px;
    padding: 22px 42px;
  }

  .card-triggers .button:last-child {
    margin-right: 0;
  }

  /* The card lies tilted in 3D until it is opened. */
  .card {
    max-width: 550px;
    margin-bottom: 0;
    transform: rotateX(-60deg) rotateZ(-40deg) translateX(50px) translateY(300px);
    transform-origin: center top;
    transform-style: preserve-3d;
    backface-visibility: hidden;
    will-change: transform, width;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1), max-width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .card:hover {
    transform: rotateX(-58deg) rotateZ(-40deg) translateX(60px) translateY(290px);
  }

  .is-card-open .card {
    z-index: 100;
    transform: translateX(0);
  }

  .is-card-open .card-layout .card {
    max-width: 700px;
  }

  .is-ajax-page-active .card-layout .card {
    max-width: 760px;
    transition: all 0.6s;
  }

  /* Shadow on the "table" below the card. */
  .shadowcard {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 97%;
    height: 99%;
    background: var(--card-shadow);
    box-shadow: 0 0 30px 20px var(--card-shadow);
    transform: translateZ(-300px) translateX(-87%) translateY(570px);
    transform-origin: center top;
    transition: background-color 0.5s ease 0.25s, box-shadow 0.5s ease 0.25s, transform 0.6s;
  }

  .is-card-open .shadowcard {
    transform: translateZ(-580px) translateX(10px) translateY(10px);
  }

  /* Right and bottom edges give the card its thickness. */
  .card-3d-right-side,
  .card-3d-bottom-side {
    display: block;
    position: absolute;
    left: 0;
    outline: 1px solid transparent; /* Firefox: smooths jagged 3D edges */
    background-image: url(../images/home/cover6.jpg);
  }

  .card-3d-right-side {
    top: -1px;
    width: 10px;
    height: 100%;
    background-size: auto 100%;
    transform: translateZ(-1px) translateY(1px) rotateY(-90deg);
    transform-origin: left center;
  }

  .card-3d-bottom-side {
    bottom: 0;
    width: 100%;
    height: 10px;
    background-position: bottom center;
    background-size: 100% auto;
    transform: translateZ(-1px) rotateX(-90deg);
    transform-origin: center bottom;
  }

  .card-3d-right-side::after,
  .card-3d-bottom-side::after {
    display: block;
    width: 100%;
    height: 100%;
  }

  /* Clicking anywhere on the closed card opens it. */
  .cover-link {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 200;
  }

  .is-card-opened .cover-link {
    display: none;
  }

  /* Close button (an X drawn with two bars). */
  .close-card {
    display: block;
    position: fixed;
    top: 40px;
    right: 40px;
    z-index: 200;
    width: 40px;
    height: 20px;
    opacity: 0;
    visibility: hidden;
    transform: scale(0);
    transition: all 0.4s;
  }

  .close-card::before,
  .close-card::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2px;
    height: 40px;
    background-color: #333;
  }

  .close-card::after {
    transform: translateX(-50%) translateY(-50%) rotate(45deg);
  }

  .close-card::before {
    transform: translateX(-50%) translateY(-50%) rotate(-45deg);
  }

  .close-card.is-visible {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
  }

}

@media only screen and (min-width: 992px) and (hover: hover) {
  .close-card:hover {
    transform: scale(1.2) rotate(540deg);
  }
}

/* Narrower desktops: a smaller card so it is not clipped. */
@media only screen and (min-width: 992px) and (max-width: 1399px) {
  .card {
    max-width: 420px;
  }

  .card-intro {
    width: 45%;
  }
}

@media only screen and (min-width: 1600px) {
  .is-ajax-page-active .card-layout .card {
    max-width: 860px;
  }
}

@media only screen and (min-width: 992px) and (min-height: 800px) {
  .card-intro {
    top: 130px;
  }

  .card-layout {
    padding-top: 130px;
  }
}

@media only screen and (min-width: 992px) and (min-height: 900px) {
  .card-intro {
    top: 160px;
  }

  .card-layout {
    padding-top: 200px;
  }
}

/* Research --------------------------------------------------------------- */

.container {
  margin-right: auto;
  margin-left: auto;
  padding-right: 15px;
  padding-left: 15px;
}

@media (min-width: 768px) {
  .container { width: 750px; }
}

@media (min-width: 992px) {
  .container { width: 970px; }
}

@media (min-width: 1200px) {
  .container { width: 1170px; }
}

.entry-header-blog {
  padding-top: 2em;
}

.entry-title-blog {
  font-family: 'Playfair Display', serif;
  font-size: 42px;
  font-weight: 400;
  text-align: left;
}

/* Entries on a vertical line with a dot each (the line and dots are hidden
   on phones). */
.cards-wrapper-blog-research {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
  max-width: 100%;
  margin: 0 0 0 7px;
  padding: 0 0 0 2rem;
  font-size: 1rem;
}

.cards-wrapper-blog-research::before {
  content: "";
  position: absolute;
  top: 2rem;
  bottom: 3rem;
  left: 0;
  width: 3px;
  background: #bcb1a6;
}

[data-theme="dark"] .cards-wrapper-blog-research::before {
  background: #5a5a5a;
}

.event-research {
  position: relative;
}

@media screen and (min-width: 768px) {
  .event-research {
    padding: 0 1em 3em 4em;
  }
}

.event-research::after {
  content: "";
  position: absolute;
  top: 2rem;
  left: -2rem;
  z-index: 1;
  width: 14px;
  height: 14px;
  margin-left: -5px;
  background: var(--bg-primary);
  border: 3px solid #9a8f84;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.event-research:hover::after {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
}

[data-theme="dark"] .event-research::after {
  border-color: #7a7a7a;
}

a.research {
  color: #2f2e2b;
}

a.research:hover,
a.research:focus {
  color: #837b74;
}

.cards-wrapper-blog-research .research {
  display: block;
  padding: 2rem 0;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.cards-wrapper-blog-research .research:hover {
  opacity: 0.8;
}

/* Clears the floated figures. */
.cards-wrapper-blog-research .research > div {
  overflow: hidden;
}

/* Separator between entries. */
.cards-wrapper-blog-research .research::after {
  content: "";
  display: block;
  height: 1px;
  margin-top: 2rem;
  background: #c8c0b8;
}

[data-theme="dark"] .cards-wrapper-blog-research .research::after {
  background: #4a4a4a;
}

.cards-wrapper-blog-research .card-grid-space:last-child .research::after {
  display: none;
}

.event-research h5 {
  margin: 0;
  padding: 0 0 0.3em 0;
  font-family: 'Heebo', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
}

.cards-wrapper-blog-research h2.card-blog-h1 {
  margin: 0 0 0.75rem;
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.cards-wrapper-blog-research p.card-blog-p {
  margin-top: 0;
  margin-bottom: 0;
  font-family: 'Heebo', sans-serif;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

.research .tags-blog {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
  font-family: 'Heebo', sans-serif;
}

.research .tag-blog {
  margin-right: 0;
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid #a9a096;
  border-radius: 2px;
  transition: all 0.2s ease;
}

[data-theme="dark"] .research .tag-blog {
  color: #a0a0a0;
  border-color: #5a5a5a;
}

/* Single figure, floated right of the text from 768px. */
.research-figure {
  float: none;
  max-width: 280px;
  margin: 1.5rem auto;
  text-align: center;
}

.research-figure img {
  width: 100%;
  margin-bottom: 0.5rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
}

/* Two figures side by side, floated right from 992px. */
.research-media-gallery {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  float: none;
  max-width: 100%;
  margin: 1.5rem auto;
  text-align: center;
}

.research-media-gallery .media-item {
  max-width: 280px;
  margin: 0 auto;
}

.research-media-gallery img,
.research-media-gallery video {
  width: 100%;
  border: 1px solid var(--border-color);
  border-radius: 4px;
}

.research-figure figcaption,
.research-media-gallery figcaption {
  font-family: 'Heebo', sans-serif;
  font-size: 0.8125rem;
  font-style: italic;
  line-height: 1.4;
  text-align: center;
  color: var(--text-muted);
}

.research-media-gallery figcaption {
  margin-top: 0.5rem;
}

@media screen and (min-width: 768px) {
  .research-figure {
    float: right;
    max-width: 220px;
    margin: 0 0 1rem 2rem;
  }

  .research-figure figcaption {
    text-align: left;
  }
}

.research-figure--wide {
  max-width: 420px;
}

@media screen and (min-width: 992px) {
  .research-media-gallery {
    float: right;
    flex-direction: row;
    gap: 0.75rem;
    max-width: 460px;
    margin: 0 0 1rem 2rem;
  }

  .research-media-gallery .media-item {
    flex: 1;
    max-width: none;
    margin: 0;
  }

  .research-media-gallery figcaption {
    text-align: left;
  }
}

/* Blog archive cards ---------------------------------------------------- */

/* First card spans the row, the other two share the next one. */
.cards-wrapper-blog {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-gap: 1.5rem;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding-bottom: 4rem;
}

.cards-wrapper-blog .card-grid-space:nth-child(1) {
  grid-column: 1 / -1;
}

/* --bg-img is set per card in the markup. */
.card-blog {
  display: flex;
  align-items: flex-end;
  position: relative;
  overflow: hidden;
  width: 100%;
  max-width: 100%;
  height: 280px;
  margin: 0;
  padding: 1em;
  font-family: 'Heebo';
  font-size: 1.1em;
  text-decoration: none;
  color: white;
  background-image: linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.3)), var(--bg-img);
  background-size: cover;
  background-position: center;
  border: 0px solid #bcb1a7;
  border-radius: 0.4em;
  box-shadow: 0 2px 20px 0 rgba(0, 0, 0, 0.05);
  transition: box-shadow 0.3s ease-out, transform 0.3s ease-out, opacity 0.2s ease-out;
}

.card-blog:hover {
  z-index: 999;
  color: #fff;
  background-image: linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2)), var(--bg-img);
  box-shadow: rgba(45, 45, 45, 0.05) 0px 2px 2px, rgba(49, 49, 49, 0.05) 0px 4px 4px, rgba(42, 42, 42, 0.05) 0px 8px 8px, rgba(32, 32, 32, 0.05) 0px 16px 16px, rgba(49, 49, 49, 0.05) 0px 32px 32px, rgba(35, 35, 35, 0.05) 0px 64px 64px;
  transform: translate(0, -4px);
}

.card-blog:visited {
  color: #fff;
}

.card-blog-large {
  width: 100%;
  max-width: 100%;
  height: 380px;
  background-image: linear-gradient(rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.15)), var(--bg-img);
}

.card-blog-large:hover {
  background-image: linear-gradient(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.1)), var(--bg-img) !important;
}

.card-blog-medium {
  width: 100%;
  max-width: 100%;
}

h2.card-blog-h1 {
  margin: 0;
  font-family: 'Heebo', sans-serif;
  font-size: 1.3em;
  font-weight: 600;
  line-height: 1.2em;
}

p.card-blog-p {
  margin-top: 0.5em;
  margin-bottom: 0.7em;
  padding: 0px;
  font-size: 0.75em;
  line-height: 1.5em;
}

.card-blog .tags-blog {
  display: flex;
  font-family: 'Heebo';
}

.card-blog .tag-blog {
  margin-right: 0.5em;
  padding: 0 0.7em;
  font-size: 0.55em;
  line-height: 1.5em;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 0.3rem;
}

.card-blog .date-blog {
  position: absolute;
  top: 0;
  right: 0;
  padding: 1em;
  font-family: 'Heebo';
  font-size: 0.65em;
  line-height: 1em;
  opacity: 0.8;
}

/* Card with a looping video instead of an image. */
.card-video-bg {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-blog:has(.card-video-bg)::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.3);
}

.card-blog:has(.card-video-bg):hover::before {
  background: rgba(0, 0, 0, 0.2);
}

.card-blog:has(.card-video-bg) > div {
  position: relative;
  z-index: 2;
}

@media screen and (min-width: 992px) {
  .card-blog p.card-blog-p {
    font-size: 20px;
  }
}

@media screen and (max-width: 1185px) {
  .cards-wrapper-blog {
    grid-gap: 1.25rem;
  }

  .card-blog {
    font-size: 1.41em;
  }
}

/* Footer ----------------------------------------------------------------- */

.home-footer {
  padding: 1rem;
  font-family: 'Source Sans Pro', sans-serif;
  color: #6c757d;
  border-top: 1px solid #d7d1cc;
}

.home-footer__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  margin-right: -15px;
  margin-left: -15px;
}

.home-footer__heart {
  color: #e37b66;
}

.footer-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.back-to-top,
.back-to-top:hover {
  color: inherit;
  opacity: 0.7;
}

.footer-attribution {
  margin-top: 0.75rem;
  margin-left: -15px;
  font-size: 0.85em;
  opacity: 0.6;
}

/* Art tooltip on project links (js/art-tooltip.js) ------------------------ */

.art-tooltip {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 10000;
  background: var(--bg-primary);
  border: 1px solid rgba(0, 0, 0, 0.12);
  opacity: 0;
  pointer-events: none;
  will-change: transform, opacity;
}

.art-tooltip-chrome {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.art-tooltip-line {
  flex: 1;
  height: 0;
  border-top: 1px dashed rgba(0, 0, 0, 0.1);
}

.art-tooltip-label {
  flex-shrink: 0;
  font-family: 'Courier New', monospace;
  font-size: 8px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
  color: rgba(0, 0, 0, 0.35);
}

.art-tooltip-canvas {
  display: block;
}

[data-theme="dark"] .art-tooltip {
  background: #1e1e1e;
  border-color: rgba(255, 255, 255, 0.12);
}

[data-theme="dark"] .art-tooltip-chrome {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .art-tooltip-line {
  border-top-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .art-tooltip-label {
  color: rgba(255, 255, 255, 0.35);
}

/* Phones and tablets ----------------------------------------------------- */

@media screen and (max-width: 991px) {
  .card,
  #card-open {
    display: none;
  }

  .card-layout {
    max-width: 100%;
    overflow-x: hidden;
  }

  .card-intro {
    display: block;
    position: relative;
    z-index: 10;
    padding: 0 20px;
  }

  /* Full-height hero over a faded copy of the card video. */
  .intro {
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    min-height: 100vh;
    padding: 80px 0 40px 0;
  }

  .mobile-video-bg {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    z-index: -1;
    overflow: hidden;
    width: 100%;
    height: 100vh;
  }

  .mobile-video-bg video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.2;
    filter: brightness(0.7);
  }

  .video-attribution-mobile {
    display: block;
    position: fixed;
    right: 10px;
    bottom: 10px;
    z-index: 100;
    font-family: 'Heebo', sans-serif;
    font-size: 11px;
    letter-spacing: 0.02em;
    color: rgba(0, 0, 0, 0.4);
  }

  .card-intro .name-title {
    margin-bottom: 0.5rem;
    font-size: 2.5rem;
    letter-spacing: -1px;
  }

  .card-intro .intro-text {
    margin-bottom: 1.5rem;
    font-size: 1rem;
    line-height: 1.6;
  }

  .card-intro .projects-section {
    margin-bottom: 1rem;
  }

  .card-intro .ha-index {
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
  }

  .card-intro .card-triggers {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    width: 100%;
    padding: 0 10px;
  }

  .card-intro .card-triggers .button {
    flex-shrink: 0;
    margin: 0;
    padding: 12px 18px;
    font-size: 0.875rem;
  }

  .mobile-nav-btn {
    display: inline-block;
  }

  .mobile-nav-btn.active {
    color: #fff !important;
    background: var(--accent-primary) !important;
  }

  /* About and Résumé, loaded under the intro. */
  .mobile-expand-section.is-open {
    display: block;
    margin-top: 1rem;
    padding: 2rem 0;
    color: var(--text-primary);
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
    animation: fadeIn 0.3s ease;
  }

  .mobile-expand-title {
    margin-bottom: 1rem;
    font-family: 'Playfair Display', serif;
  }

  .mobile-expand-section .section-title {
    text-align: center;
  }

  .mobile-expand-section .skill-category {
    margin-bottom: 1.5rem;
    text-align: center;
  }

  .mobile-expand-section .skill-category h4 {
    text-align: center;
  }

  .mobile-expand-section .skill-chips,
  .mobile-expand-section .timeline-tags {
    justify-content: center;
  }

  .mobile-expand-section .work-experience-grid {
    grid-template-columns: repeat(2, 1fr);
    max-width: 100%;
  }

  [data-theme="dark"] .mobile-expand-section h2,
  [data-theme="dark"] .mobile-expand-section h3,
  [data-theme="dark"] .mobile-expand-section h4,
  [data-theme="dark"] .mobile-expand-section h5 {
    color: var(--text-primary);
  }

  [data-theme="dark"] .mobile-expand-section p {
    color: var(--text-secondary);
  }

  /* Research: centred, without the line and dots. */
  .entry-header-blog {
    padding: 1rem 0;
    text-align: center;
  }

  .cards-wrapper-blog-research::before,
  .event-research::after {
    display: none;
  }

  .event-research .research > div,
  .event-research h2.card-blog-h1 {
    text-align: center;
  }

  .event-research p.card-blog-p {
    text-align: left;
  }

  .cards-wrapper-blog-research .tags-blog {
    justify-content: center;
  }

  /* Blog cards in one column. */
  .cards-wrapper-blog {
    grid-template-columns: 1fr;
    gap: 1rem;
    width: 100%;
    padding: 0 0 2rem 0;
  }

  .cards-wrapper-blog .card-grid-space {
    min-height: auto;
  }

  .cards-wrapper-blog .card-grid-space:nth-child(1) {
    grid-column: auto;
  }

  .card-blog,
  .card-blog-large,
  .card-blog-medium {
    width: 100%;
    height: auto;
    min-height: 200px;
    font-size: 1.1em;
  }

  .card-blog h2.card-blog-h1 {
    font-size: 1.2em;
  }

  .card-blog p.card-blog-p {
    font-size: 0.85em;
  }
}
