/* From Uiverse.io by 00Kubi */ 
.theme-switch {
  --toggle-size: 30px;
  /* the size is adjusted using font-size,
     this is not transform scale,
     so you can choose any size */
  --container-width: 5.625em;
  --container-height: 2.5em;
  --container-radius: 6.25em;
  /* radius 0 - minecraft mode :) */
  --container-light-bg: #3d7eae;
  --container-night-bg: #1d1f2c;
  --circle-container-diameter: 3.375em;
  --sun-moon-diameter: 2.125em;
  --sun-bg: #ecca2f;
  --moon-bg: #c4c9d1;
  --spot-color: #959db1;
  --circle-container-offset: calc(
    (var(--circle-container-diameter) - var(--container-height)) / 2 * -1
  );
  --stars-color: #fff;
  --clouds-color: #f3fdff;
  --back-clouds-color: #aacadf;
  --transition: 0.5s cubic-bezier(0, -0.02, 0.4, 1.25);
  --circle-transition: 0.3s cubic-bezier(0, -0.02, 0.35, 1.17);
}

.theme-switch,
.theme-switch *,
.theme-switch *::before,
.theme-switch *::after {
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-size: var(--toggle-size);
}

.theme-switch__container {
  width: var(--container-width);
  height: var(--container-height);
  background-color: var(--container-light-bg);
  border-radius: var(--container-radius);
  overflow: hidden;
  cursor: pointer;
  -webkit-box-shadow:
    0em -0.062em 0.062em rgba(0, 0, 0, 0.25),
    0em 0.062em 0.125em rgba(255, 255, 255, 0.94);
  box-shadow:
    0em -0.062em 0.062em rgba(0, 0, 0, 0.25),
    0em 0.062em 0.125em rgba(255, 255, 255, 0.94);
  -webkit-transition: var(--transition);
  -o-transition: var(--transition);
  transition: var(--transition);
  position: relative;
  background-image: linear-gradient(
    to bottom,
    var(--container-light-bg) 0%,
    #5490c0 100%
  );
  transition: all var(--transition);
}

.theme-switch__container::before {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  -webkit-box-shadow:
    0em 0.05em 0.187em rgba(0, 0, 0, 0.25) inset,
    0em 0.05em 0.187em rgba(0, 0, 0, 0.25) inset;
  box-shadow:
    0em 0.05em 0.187em rgba(0, 0, 0, 0.25) inset,
    0em 0.05em 0.187em rgba(0, 0, 0, 0.25) inset;
  border-radius: var(--container-radius);
}

.theme-switch__checkbox {
  display: none;
}

.theme-switch__circle-container {
  width: var(--circle-container-diameter);
  height: var(--circle-container-diameter);
  background-color: rgba(255, 255, 255, 0.1);
  position: absolute;
  left: var(--circle-container-offset);
  top: var(--circle-container-offset);
  border-radius: var(--container-radius);
  -webkit-box-shadow:
    inset 0 0 0 3.375em rgba(255, 255, 255, 0.1),
    inset 0 0 0 3.375em rgba(255, 255, 255, 0.1),
    0 0 0 0.625em rgba(255, 255, 255, 0.1),
    0 0 0 1.25em rgba(255, 255, 255, 0.1);
  box-shadow:
    inset 0 0 0 3.375em rgba(255, 255, 255, 0.1),
    inset 0 0 0 3.375em rgba(255, 255, 255, 0.1),
    0 0 0 0.625em rgba(255, 255, 255, 0.1),
    0 0 0 1.25em rgba(255, 255, 255, 0.1);
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-transition: var(--circle-transition);
  -o-transition: var(--circle-transition);
  transition: var(--circle-transition);
  pointer-events: none;
}

.theme-switch__sun-moon-container {
  pointer-events: auto;
  position: relative;
  z-index: 2;
  width: var(--sun-moon-diameter);
  height: var(--sun-moon-diameter);
  margin: auto;
  border-radius: var(--container-radius);
  background-color: var(--sun-bg);
  -webkit-box-shadow:
    0.062em 0.062em 0.062em 0em rgba(254, 255, 239, 0.61) inset,
    0em -0.062em 0.062em 0em #a1872a inset;
  box-shadow:
    0.062em 0.062em 0.062em 0em rgba(254, 255, 239, 0.61) inset,
    0em -0.062em 0.062em 0em #a1872a inset;
  -webkit-filter: drop-shadow(0.062em 0.125em 0.125em rgba(0, 0, 0, 0.25))
    drop-shadow(0em 0.062em 0.125em rgba(0, 0, 0, 0.25));
  filter: drop-shadow(0.062em 0.125em 0.125em rgba(0, 0, 0, 0.25))
    drop-shadow(0em 0.062em 0.125em rgba(0, 0, 0, 0.25));
  overflow: hidden;
  -webkit-transition: var(--transition);
  -o-transition: var(--transition);
  transition: var(--transition);
  transform: scale(1);
  transition: transform 0.3s ease;
}

.theme-switch__sun-moon-container:hover {
  transform: scale(1.1) rotate(5deg);
}

.theme-switch__moon {
  -webkit-transform: translateX(100%);
  -ms-transform: translateX(100%);
  transform: translateX(100%);
  width: 100%;
  height: 100%;
  background-color: var(--moon-bg);
  border-radius: inherit;
  -webkit-box-shadow:
    0.062em 0.062em 0.062em 0em rgba(254, 255, 239, 0.61) inset,
    0em -0.062em 0.062em 0em #969696 inset;
  box-shadow:
    0.062em 0.062em 0.062em 0em rgba(254, 255, 239, 0.61) inset,
    0em -0.062em 0.062em 0em #969696 inset;
  -webkit-transition: var(--transition);
  -o-transition: var(--transition);
  transition: var(--transition);
  position: relative;
  transition:
    all var(--transition),
    transform 0.3s ease;
}

.theme-switch__moon:hover {
  transform: rotate(15deg);
}

.theme-switch__spot {
  position: absolute;
  top: 0.75em;
  left: 0.312em;
  width: 0.75em;
  height: 0.75em;
  border-radius: var(--container-radius);
  background-color: var(--spot-color);
  -webkit-box-shadow: 0em 0.0312em 0.062em rgba(0, 0, 0, 0.25) inset;
  box-shadow: 0em 0.0312em 0.062em rgba(0, 0, 0, 0.25) inset;
  transition: background-color 0.3s ease;
}

.theme-switch__spot:nth-of-type(2) {
  width: 0.375em;
  height: 0.375em;
  top: 0.937em;
  left: 1.375em;
}

.theme-switch__spot:nth-last-of-type(3) {
  width: 0.25em;
  height: 0.25em;
  top: 0.312em;
  left: 0.812em;
}

.theme-switch__moon:hover .theme-switch__spot {
  background-color: #7a7f8c;
}

.theme-switch__clouds {
  width: 1.25em;
  height: 1.25em;
  background-color: var(--clouds-color);
  border-radius: var(--container-radius);
  position: absolute;
  bottom: -0.625em;
  left: 0.312em;
  -webkit-box-shadow:
    0.937em 0.312em var(--clouds-color),
    -0.312em -0.312em var(--back-clouds-color),
    1.437em 0.375em var(--clouds-color),
    0.5em -0.125em var(--back-clouds-color),
    2.187em 0 var(--clouds-color),
    1.25em -0.062em var(--back-clouds-color),
    2.937em 0.312em var(--clouds-color),
    2em -0.312em var(--back-clouds-color),
    3.625em -0.062em var(--clouds-color),
    2.625em 0em var(--back-clouds-color),
    4.5em -0.312em var(--clouds-color),
    3.375em -0.437em var(--back-clouds-color),
    4.625em -1.75em 0 0.437em var(--clouds-color),
    4em -0.625em var(--back-clouds-color),
    4.125em -2.125em 0 0.437em var(--back-clouds-color);
  box-shadow:
    0.937em 0.312em var(--clouds-color),
    -0.312em -0.312em var(--back-clouds-color),
    1.437em 0.375em var(--clouds-color),
    0.5em -0.125em var(--back-clouds-color),
    2.187em 0 var(--clouds-color),
    1.25em -0.062em var(--back-clouds-color),
    2.937em 0.312em var(--clouds-color),
    2em -0.312em var(--back-clouds-color),
    3.625em -0.062em var(--clouds-color),
    2.625em 0em var(--back-clouds-color),
    4.5em -0.312em var(--clouds-color),
    3.375em -0.437em var(--back-clouds-color),
    4.625em -1.75em 0 0.437em var(--clouds-color),
    4em -0.625em var(--back-clouds-color),
    4.125em -2.125em 0 0.437em var(--back-clouds-color);
  -webkit-transition: 0.5s cubic-bezier(0, -0.02, 0.4, 1.25);
  -o-transition: 0.5s cubic-bezier(0, -0.02, 0.4, 1.25);
  transition: 0.5s cubic-bezier(0, -0.02, 0.4, 1.25);
}

.theme-switch__stars-container {
  position: absolute;
  color: var(--stars-color);
  top: -100%;
  left: 0.312em;
  width: 2.75em;
  height: auto;
  -webkit-transition: var(--transition);
  -o-transition: var(--transition);
  transition: var(--transition);
}

/* actions */

.theme-switch__checkbox:checked + .theme-switch__container {
  background-color: var(--container-night-bg);
  background-image: linear-gradient(
    to bottom,
    var(--container-night-bg) 0%,
    #2d3142 100%
  );
}

.theme-switch__checkbox:checked
  + .theme-switch__container
  .theme-switch__circle-container {
  left: calc(
    100% - var(--circle-container-offset) - var(--circle-container-diameter)
  );
}

.theme-switch__checkbox:checked
  + .theme-switch__container
  .theme-switch__circle-container:hover {
  left: calc(
    100% - var(--circle-container-offset) - var(--circle-container-diameter) -
      0.187em
  );
}

.theme-switch__circle-container:hover {
  left: calc(var(--circle-container-offset) + 0.187em);
}

.theme-switch__checkbox:checked + .theme-switch__container .theme-switch__moon {
  -webkit-transform: translate(0);
  -ms-transform: translate(0);
  transform: translate(0);
}

.theme-switch__checkbox:checked
  + .theme-switch__container
  .theme-switch__clouds {
  bottom: -4.062em;
}

.theme-switch__checkbox:checked
  + .theme-switch__container
  .theme-switch__stars-container {
  top: 50%;
  -webkit-transform: translateY(-50%);
  -ms-transform: translateY(-50%);
  transform: translateY(-50%);
}

.theme-switch__container:hover .theme-switch__clouds {
  transform: translateX(15px) scale(1.02);
}

.theme-switch__sun-moon-container::after {
  content: "";
  position: absolute;
  inset: -5px;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.2) 0%,
    transparent 70%
  );
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.theme-switch__sun-moon-container:hover::after {
  opacity: 1;
}

.theme-switch__shooting-star {
  position: absolute;
  width: 2px;
  height: 2px;
  background: white;
  top: 20%;
  left: -10%;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.theme-switch__shooting-star-2 {
  position: absolute;
  width: 1px;
  height: 1px;
  background: white;
  top: 35%;
  left: -10%;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.theme-switch__meteor {
  position: absolute;
  width: 3px;
  height: 3px;
  background: #ffd700;
  border-radius: 50%;
  top: -10%;
  left: 50%;
  opacity: 0;
  filter: blur(1px);
  transition: opacity 0.3s ease;
}

.theme-switch__checkbox:checked
  + .theme-switch__container
  .theme-switch__shooting-star {
  animation: shootingStar 2s linear infinite;
  opacity: 1;
}

.theme-switch__checkbox:checked
  + .theme-switch__container
  .theme-switch__shooting-star-2 {
  animation: shootingStar 3s linear infinite 1s;
  opacity: 1;
}

.theme-switch__checkbox:checked
  + .theme-switch__container
  .theme-switch__meteor {
  animation: meteor 4s linear infinite 2s;
  opacity: 1;
}

@keyframes shootingStar {
  0% {
    transform: translateX(0) translateY(0) rotate(45deg);
    opacity: 1;
  }
  100% {
    transform: translateX(150px) translateY(150px) rotate(45deg);
    opacity: 0;
  }
}

@keyframes meteor {
  0% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
  100% {
    transform: translateY(150px) scale(0.3);
    opacity: 0;
  }
}

.theme-switch__stars-cluster {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.theme-switch__stars-cluster .star {
  position: absolute;
  width: 2px;
  height: 2px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 0 4px 1px white;
}

.theme-switch__stars-cluster .star:nth-child(1) {
  top: 20%;
  left: 20%;
  animation: twinkle 1s infinite ease-in-out;
}
.theme-switch__stars-cluster .star:nth-child(2) {
  top: 30%;
  left: 55%;
  animation: twinkle 1s infinite ease-in-out 0.3s;
}
.theme-switch__stars-cluster .star:nth-child(3) {
  top: 40%;
  left: 80%;
  animation: twinkle 1s infinite ease-in-out 0.6s;
}
.theme-switch__stars-cluster .star:nth-child(4) {
  top: 60%;
  left: 30%;
  animation: twinkle 1s infinite ease-in-out 0.9s;
}
.theme-switch__stars-cluster .star:nth-child(5) {
  top: 70%;
  left: 65%;
  animation: twinkle 1s infinite ease-in-out 1.2s;
}

.theme-switch__aurora {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 20px;
  background: linear-gradient(
    90deg,
    rgba(0, 255, 255, 0) 0%,
    rgba(0, 255, 255, 0.2) 25%,
    rgba(128, 0, 255, 0.2) 50%,
    rgba(0, 255, 255, 0.2) 75%,
    rgba(0, 255, 255, 0) 100%
  );
  opacity: 0;
  filter: blur(4px);
  transform: translateY(-100%);
  transition: opacity 0.3s ease;
}

.theme-switch__comets {
  position: absolute;
  inset: 0;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.theme-switch__comets .comet {
  position: absolute;
  width: 2px;
  height: 2px;
  background: linear-gradient(90deg, white 0%, transparent 90%);
  border-radius: 50%;
  filter: blur(1px);
}

.theme-switch__comets .comet:nth-child(1) {
  top: 30%;
  left: -10%;
  animation: cometMove 4s linear infinite;
}

.theme-switch__comets .comet:nth-child(2) {
  top: 50%;
  left: -10%;
  animation: cometMove 6s linear infinite 2s;
}

@keyframes twinkle {
  0%,
  100% {
    opacity: 0.3;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.2);
  }
}

@keyframes cometMove {
  0% {
    transform: translateX(0) translateY(0) rotate(-45deg) scale(1);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateX(200px) translateY(200px) rotate(-45deg) scale(0.2);
    opacity: 0;
  }
}

.theme-switch__checkbox:checked
  + .theme-switch__container
  .theme-switch__stars-cluster {
  opacity: 1;
}

.theme-switch__checkbox:checked
  + .theme-switch__container
  .theme-switch__aurora {
  opacity: 1;
  animation: auroraWave 8s linear infinite;
}

.theme-switch__checkbox:checked
  + .theme-switch__container
  .theme-switch__comets {
  opacity: 1;
}

@keyframes auroraWave {
  0% {
    transform: translateY(-100%) translateX(-50%);
  }
  100% {
    transform: translateY(-100%) translateX(50%);
  }
}


/* Portfolio theme switch integration. The original sun/moon, clouds, depth and motion are preserved. */
.theme-switch {
  --toggle-size: 16px;
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  margin: 0 2px;
  vertical-align: middle;
  line-height: 1;
  isolation: isolate;
}
.theme-switch__checkbox {
  display: block;
  position: absolute;
  inset: 0;
  z-index: 5;
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  clip: auto;
  clip-path: none;
  white-space: nowrap;
  opacity: 0;
  cursor: pointer;
  appearance: none;
  pointer-events: none;
}
.theme-switch__container {
  flex: 0 0 auto;
  outline: none;
}
.theme-switch:focus-within .theme-switch__container {
  outline: 2px solid var(--mint, #01f7b6);
  outline-offset: 4px;
}
.theme-switch__container:hover { filter: saturate(1.06); }
.theme-switch__checkbox:focus-visible + .theme-switch__container {
  outline: 2px solid var(--mint, #01f7b6);
  outline-offset: 4px;
}
.theme-switch__container,
.theme-switch__circle-container,
.theme-switch__sun-moon-container,
.theme-switch__moon,
.theme-switch__clouds,
.theme-switch__stars-container,
.theme-switch__stars-cluster,
.theme-switch__shooting-star,
.theme-switch__shooting-star-2,
.theme-switch__meteor,
.theme-switch__aurora,
.theme-switch__comets { pointer-events: none; }
.theme-switch__container { pointer-events: auto; }
.theme-switch__sun-moon-container,
.theme-switch__moon { pointer-events: auto; }
.theme-switch__container::before { pointer-events: none; }

/* Keep the existing light appearance as the default, but make the whole site use a coherent dark palette. */
html[data-theme="dark"] {
  color-scheme: dark;
  --ink: #edf4f2;
  --paper: #111719;
  --paper-2: #0d1214;
  --muted: #a3aeaf;
  --line: rgba(237, 244, 242, .14);
  --dark-line: rgba(237, 244, 242, .13);
  --neo-light: #161e21;
  --neo-light-edge: rgba(255, 255, 255, .06);
  --neo-light-shadow: 7px 7px 16px rgba(0,0,0,.34), -4px -4px 12px rgba(255,255,255,.018);
  --neo-light-inset: inset 4px 4px 9px rgba(0,0,0,.30), inset -3px -3px 8px rgba(255,255,255,.018);
}
html[data-theme="light"] { color-scheme: light; }
html[data-theme="dark"] body {
  background: var(--paper);
  color: var(--ink);
}
html[data-theme="dark"] .section-light,
html[data-theme="dark"] .projects-section,
html[data-theme="dark"] .collaboration-section,
html[data-theme="dark"] .detail-light,
html[data-theme="dark"] .reference-project {
  background-color: var(--paper);
  color: var(--ink);
}
html[data-theme="dark"] .projects-section { background-color: var(--paper-2); }
html[data-theme="dark"] .experience-strip article,
html[data-theme="dark"] .about-meta,
html[data-theme="dark"] .about-meta .meta-row,
html[data-theme="dark"] .project-card:not(.project-card--open),
html[data-theme="dark"] .collab-card,
html[data-theme="dark"] .publication-item,
html[data-theme="dark"] .reference-block {
  background-color: #151d20;
  color: var(--ink);
  border-color: rgba(237,244,242,.12);
}
html[data-theme="dark"] .project-body { background: #151d20 !important; color: var(--ink); }
html[data-theme="dark"] .project-card--open .project-body { background: #101719 !important; }
html[data-theme="dark"] .project-body p,
html[data-theme="dark"] .about-lead p,
html[data-theme="dark"] .about-meta .meta-row span,
html[data-theme="dark"] .experience-strip p,
html[data-theme="dark"] .collab-card small,
html[data-theme="dark"] .project-label,
html[data-theme="dark"] .detail-copy p,
html[data-theme="dark"] .reference-block p,
html[data-theme="dark"] .publication-item small {
  color: #a8b3b4;
}
html[data-theme="dark"] .project-label { color: #9ba8a8; }
html[data-theme="dark"] .project-detail { border-color: rgba(237,244,242,.12); }
html[data-theme="dark"] .project-meta span { border-color: rgba(237,244,242,.18); }
html[data-theme="dark"] .outline-button,
html[data-theme="dark"] .project-details-button,
html[data-theme="dark"] .coverage-more {
  background: #151d20;
  color: var(--ink);
  border-color: rgba(237,244,242,.2);
}
html[data-theme="dark"] .outline-button:hover,
html[data-theme="dark"] .project-details-button:hover,
html[data-theme="dark"] .coverage-more:hover {
  background: #202a2d;
  color: #fff;
  border-color: var(--mint);
}
html[data-theme="dark"] .project-more { color: #07110e; }
html[data-theme="dark"] .section-heading .kicker,
html[data-theme="dark"] .kicker { color: #a7b2b2; }
html[data-theme="dark"] .site-navbar .nav-links,
html[data-theme="dark"] .menu-button {
  background: rgba(17,22,25,.94);
  border-color: rgba(237,244,242,.1);
}
html[data-theme="dark"] .navigation-drawer {
  background: #101719;
  border-color: rgba(237,244,242,.1);
}
html[data-theme="dark"] .navigation-drawer li a:hover,
html[data-theme="dark"] .navigation-drawer li a:focus-visible { background: #1b2528; }
html[data-theme="dark"] .contact-page { background: #111719; color: var(--ink); }
html[data-theme="dark"] .contact-card,
html[data-theme="dark"] .contact-direct { background-color: #151d20; border-color: rgba(237,244,242,.12); color: var(--ink); }
html[data-theme="dark"] .contact-card p,
html[data-theme="dark"] .contact-heading p { color: #a8b3b4; }
html[data-theme="dark"] .recognition-page,
html[data-theme="dark"] .recognition-main { background-color: #111719; color: var(--ink); }
html[data-theme="dark"] .recognition-card,
html[data-theme="dark"] .recognition-band-item,
html[data-theme="dark"] .recognition-filter,
html[data-theme="dark"] .recognition-toolbar { background-color: #151d20; color: var(--ink); border-color: rgba(237,244,242,.12); }
html[data-theme="dark"] .recognition-card p,
html[data-theme="dark"] .recognition-card small { color: #a8b3b4; }
html[data-theme="dark"] .moneylog-showcase,
html[data-theme="dark"] .foolscap-preview { box-shadow: 0 20px 50px rgba(0,0,0,.32); }
html[data-theme="dark"] .foolscap-project { background: #111719; color: var(--ink); }
html[data-theme="dark"] .foolscap-preview { border-color: rgba(237,244,242,.12); }
html[data-theme="dark"] .foolscap-paper { background: #f8f8f5; color: #172023; }
html[data-theme="dark"] .site-navbar .theme-switch { filter: none; }

/* New Foolscap PDF Editor project card / project detail treatment. */
.foolscap-card-visual {
  position: relative;
  min-height: 250px;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  padding: 20px;
  color: #eef4f2;
  background: radial-gradient(circle at 78% 15%, rgba(1,247,182,.17), transparent 26%), linear-gradient(135deg,#0b1114,#172328 62%,#0d1718);
  isolation: isolate;
}
.foolscap-card-visual::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(255,255,255,.11);
  pointer-events: none;
}
.foolscap-card-topline,.foolscap-card-footer { display:flex; justify-content:space-between; align-items:center; gap:12px; position:relative; z-index:2; font:9px "Fjalla One",sans-serif; letter-spacing:.16em; text-transform:uppercase; color:rgba(238,244,242,.68); }
.foolscap-card-topline strong { color:var(--mint); font-size:11px; }
.foolscap-papers { position:absolute; inset:45px 30px 32px; display:flex; justify-content:center; align-items:center; }
.foolscap-paper { position:relative; width:39%; height:86%; min-height:120px; padding:12px; color:#152023; background:#f7f7f2; border-radius:2px; box-shadow:0 12px 28px rgba(0,0,0,.3); transform:rotate(-7deg) translateX(18%); }
.foolscap-paper::before { content:""; position:absolute; width:100%; height:100%; inset:0; background:repeating-linear-gradient(to bottom, transparent 0 13px, rgba(19,42,44,.11) 13px 14px); }
.foolscap-paper--back { transform:rotate(8deg) translateX(-25%) translateY(3%); background:#dce7e3; }
.foolscap-paper b,.foolscap-paper span,.foolscap-paper i { position:relative; display:block; }
.foolscap-paper b { font: bold 9px Poppins,sans-serif; margin-bottom:10px; }
.foolscap-paper span { width:75%; height:3px; margin:6px 0; background:rgba(14,32,35,.38); }
.foolscap-paper span:nth-of-type(2) { width:58%; }
.foolscap-paper i { position:absolute; right:9px; bottom:12px; width:28px; height:28px; border:2px solid #01bd8d; border-radius:50%; }
.foolscap-card-footer { position:absolute; left:25px; right:25px; bottom:20px; }
.foolscap-card-footer strong { color:#fff; font-size:13px; letter-spacing:.1em; }
.foolscap-card-footer span { color:var(--mint); }
.foolscap-project .detail-copy p { max-width: 560px; }
.foolscap-preview {
  position:relative; overflow:hidden; padding:24px; min-height:440px;
  color:#edf4f2; background:radial-gradient(circle at 90% 5%,rgba(1,247,182,.15),transparent 28%),linear-gradient(145deg,#0b1114,#172126 60%,#0e1719);
  border:1px solid rgba(255,255,255,.09); box-shadow:0 22px 58px rgba(11,13,15,.16);
}
.foolscap-preview-top { display:flex; align-items:center; justify-content:space-between; gap:12px; padding-bottom:18px; border-bottom:1px solid rgba(255,255,255,.12); font:10px "Fjalla One",sans-serif; letter-spacing:.16em; }
.foolscap-preview-top strong { color:var(--mint); }
.foolscap-preview-top span { color:rgba(237,244,242,.52); }
.foolscap-editor { display:grid; grid-template-columns:62px minmax(0,1fr); gap:15px; padding-top:20px; }
.foolscap-tools { display:flex; flex-direction:column; align-items:center; gap:9px; padding:10px 6px; border:1px solid rgba(255,255,255,.09); background:rgba(255,255,255,.025); }
.foolscap-tools span { display:grid; place-items:center; width:30px; height:30px; border:1px solid rgba(255,255,255,.1); color:rgba(237,244,242,.75); font:10px Poppins,sans-serif; }
.foolscap-tools span:first-child { color:#07110e; background:var(--mint); border-color:var(--mint); }
.foolscap-document-stage { min-width:0; display:flex; align-items:center; justify-content:center; gap:12px; padding:14px; background:rgba(0,0,0,.14); }
.foolscap-page { width:min(44%,180px); min-height:270px; padding:16px 12px; background:#f8f8f5; color:#172023; box-shadow:0 10px 25px rgba(0,0,0,.23); }
.foolscap-page--two { background:#dfeae5; transform:translateY(10px) rotate(2deg); }
.foolscap-page b { display:block; font-size:9px; margin-bottom:15px; }
.foolscap-page i { display:block; height:3px; margin:9px 0; background:rgba(20,39,41,.24); }
.foolscap-page i:nth-of-type(2n) { width:72%; }
.foolscap-page .foolscap-highlight { height:9px; width:85%; background:rgba(1,247,182,.38); border-left:2px solid #00a879; }
.foolscap-preview-stats { display:flex; flex-wrap:wrap; gap:8px; margin-top:18px; }
.foolscap-preview-stats span { padding:7px 9px; border:1px solid rgba(255,255,255,.12); color:rgba(237,244,242,.7); font:8px "Fjalla One",sans-serif; letter-spacing:.13em; }
.foolscap-project .project-meta span { border-color:rgba(11,13,14,.15); }
.foolscap-project .open-source-links a { border-color:rgba(11,13,14,.2); color:var(--ink); }
.foolscap-project .open-source-links a:first-child { background:var(--mint); border-color:var(--mint); color:#07110e; }
html[data-theme="dark"] .foolscap-project .project-meta span { border-color:rgba(237,244,242,.18); }
html[data-theme="dark"] .foolscap-project .open-source-links a { border-color:rgba(237,244,242,.2); color:var(--ink); }
html[data-theme="dark"] .foolscap-project .open-source-links a:first-child { color:#07110e; }

@media (max-width: 1100px) {
  .theme-switch { --toggle-size: 14px; }
}
@media (max-width: 760px) {
  .theme-switch { --toggle-size: 12px; margin:0; }
  .site-navbar .nav-right { gap:10px; }
  .site-navbar .nav-links { display:none; }
  .foolscap-preview { min-height:360px; padding:16px; }
  .foolscap-editor { grid-template-columns:42px minmax(0,1fr); gap:9px; }
  .foolscap-tools span { width:25px; height:25px; }
  .foolscap-document-stage { gap:6px; padding:8px; }
  .foolscap-page { min-height:225px; padding:12px 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .theme-switch *, .theme-switch *::before, .theme-switch *::after { animation-duration:.01ms !important; animation-iteration-count:1 !important; transition-duration:.01ms !important; }
  html { scroll-behavior:auto; }
}

.foolscap-heading-subtitle { display:block; color:var(--mint); font-size:.58em; letter-spacing:-.025em; margin-top:8px; }
