* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  overflow-wrap: break-word;
}

:root[data-color-mode="light"] {
  --bg: white;
  --bg-pattern-color: #eef0f3;
  --subtle: #686767;
  --text: #414243;
  --border-color: #b0aeae;
  --highlight: #D64933;
  --copied: #027769;
  --footer-bg: #cecdcd;
  --moon-display: none;
  --sun-display: block;
  --svg-filter: filter: brightness(0) saturate(100%) invert(26%) sepia(5%) saturate(155%) hue-rotate(169deg) brightness(94%) contrast(94%);
  --cursor-default: url("/images/cursors/light-mode/default.svg"), auto;
  --cursor-link: url("/images/cursors/light-mode/link.svg") 10 10, pointer;
  --cursor-external-link: url("/images/cursors/light-mode/external-link.svg") 10 10, pointer;
  --design-gradient: repeating-linear-gradient(90deg, #6366f1, #f59e0b, #ec4899, #6366f1);
}

:root[data-color-mode="dark"] {
  --bg: #050505;
  --bg-pattern-color: #1e1e1e;
  --subtle: #888888;
  --text: #ededed;
  --border-color: #2a2929;
  --highlight: #318CE7;
  --copied: #00A693;
  --footer-bg: #1e1c1c;
  --moon-display: block;
  --sun-display: none;
  --svg-filter: brightness(0) saturate(100%) invert(99%) sepia(49%) saturate(148%) hue-rotate(275deg) brightness(112%) contrast(86%);
  --cursor-default: url("/images/cursors/dark-mode/default.svg") 5 5, auto;
  --cursor-link: url("/images/cursors/dark-mode/link.svg") 10 10, pointer;
  --cursor-external-link: url("/images/cursors/dark-mode/external-link.svg") 10 10, pointer;
  --design-gradient: repeating-linear-gradient(90deg, #b3acf2, #f2c2b3, #f2b3c2, #b3acf2);
}

html {
  --font-sans: 'Raleway', sans-serif;
  --font-cursive: "Pacifico", cursive;
  --font-size: 1rem;
  --font-size-s: 0.8rem;  
  --font-size-xxs: 0.7rem;
  --font-size-l: 1.1rem;
  --font-size-h1: 2.25em;
  --padding: 20px;
  --padding-small: 10px;
  --padding-xs: 5px;
  --padding-xxs: 2.5px;
  --margin: 20px;
  --margin-large: 40px;
  --margin-xl: 50px;
  --margin-small: 10px;
  --margin-xs: 7.5px;
  --border-radius: 0.3rem;
  --footer-negative-margin: -1px;
  font-family: var(--font-sans);
  font-size: var(--font-size);
  line-height: 1.5;
  color: var(--text);
  min-height: 100%;
  position: relative;
  background: var(--bg);
}

html::before {
  /* This is the background checkerd pattern */
  --mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, #000 60%, transparent 100%);
  --pattern-size: 1.5rem;
  --line-width: 1px;

  content: "";
  position: absolute;
  inset: 0;
  height: 100dvh;
  width: 100%;
  z-index: 0;
  pointer-events: none;
   background-image:
    linear-gradient(to right, var(--bg-pattern-color) var(--line-width), transparent var(--line-width)),
    linear-gradient(to bottom, var(--bg-pattern-color) var(--line-width), transparent var(--line-width)); 
  background-size: var(--pattern-size) var(--pattern-size);
  -webkit-mask-image: var(--mask-image);
  mask-image: var(--mask-image);
  max-height: 100dvh;
  z-index: -1000;
}

body,
html {
  height: auto;
  cursor: var(--cursor-default);
  overscroll-behavior: none;
}

a {
  text-decoration: none;
  border-bottom: 1px solid rgba(125, 125, 125, .3);
  transition: border 0.3s ease-in-out;
  color: var(--text) !important;
  cursor: var(--cursor-link);
}

a[target="_blank"] {
  cursor: var(--cursor-external-link);
}

a:hover {
  border-bottom: 1px solid var(--text);
}

a .svg-icon {
  filter: var(--svg-filter);
}

s {
  text-decoration-color: var(--highlight);
}

.go-back-button {
  color: var(--subtle) !important;
  border: none !important; 
  transition: color 0.3s ease-in-out;
}

.go-back-button:hover {
  color: var(--text) !important;
}

.design-text {
  position: relative;
  font-family: var(--font-cursive);
  font-weight: 400;
  font-style: normal;
  color: var(--subtle) !important; 
  border: none;
  cursor: var(--cursor-link);
}

.design-text:hover {
  background-clip: text;
  background-image: var(--design-gradient);
  background-size: 50%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: designTextAnimation 4s linear infinite;
  border: none;
}

#micro-interactions {
  display: inline-block;
  transition: transform 0.3s ease, font-size 0.3s ease;
  cursor: var(--cursor-link);
}

.micro-interactions-text-micro {
  display: inline-block;
  transition: transform 0.3s ease-in-out, font-weight 0.3s ease-in-out;
}

#micro-interactions:hover .micro-interactions-text-micro {
  transform: scale(0.8);
  font-weight: 600;
  transition: transform 0.3s ease-in-out, font-weight 0.3s ease-in-out;
}

@keyframes designTextAnimation {
  0% {
    background-position: 0% 50%;
}

50% {
    background-position: 100% 100%;
}

100% {
    background-position: 0% 50%;
}
}

p {
  line-height: 1.75;
  margin: 1em 0;
}

h1 {
  margin: 1em 0 2em 0;
}

h2,
h3,
h4 {
  margin: 1.2em 0;
}

ul li {
  margin-left: 1.2em;
}

p:has(> img) {
  display: flex;
  width: 100%;
  justify-content: center;
}

p img {
  max-width: 100%;
}

mjx-container {
  padding: var(--padding) 0;
  height: min-content;
  overflow-x: scroll;
}


blockquote {
  font-size: 1.4em;
  margin: 2em auto;
  font-style: italic;
  padding: 1.2em 30px 1.2em 2.2em;
  border-left: 0.2em solid var(--highlight);
  line-height: 1.6;
  position: relative;

}

blockquote::before {
  content: "\201C";
  color: var(--highlight);
  font-size: 4em;
  position: absolute;
  left: 10px;
  top: -10px;
}

.main-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: var(--margin-large) 0;
  min-height: calc(100vh - 20px);
  overflow-x: visible;
  margin: 0 var(--margin);
}

.parent-container {
  min-height: 100vh;
  max-width: 750px;
  min-width: 280px;
  margin-bottom: var(--margin);
  overflow-x: visible;
}

#moon-button {
  display: var(--moon-display);
}

#sun-button {
  display: var(--sun-display);
}

#logo-box {
  width: 1.5em;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: var(--margin);
  border: none;  
  transition: transform 0.5s ease-in-out;
}

#logo-box:hover {
  transform: rotate(360deg) scale(1.2);
}

.title {
  margin-top: var(--margin-xl);
  margin-bottom: var(--margin-xs);
  font-weight: 500;
  font-size: var(--font-size-h1);
  line-height: 1.1111111;
}

.category-info {
  margin: 0;
  margin-bottom: var(--margin-large);
  color: var(--subtle);
}

.section-projects {
  display: flex;
  overflow-x: scroll;
  -ms-overflow-style: none;
  scrollbar-width: none;
  gap: var(--margin);
}

.projects-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: var(--margin-large);
}

.projects-header .category-info {
  margin-bottom: 0;
}

.scroll-buttons {
  display: flex;
  gap: var(--padding-xs);
}

.scroll-btn {
  width: 2.5rem;
  aspect-ratio: 1;
  border: 1px solid var(--border-color);
  border-radius: 50%;
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  opacity: 1;
  padding: 0;
}

.scroll-btn:hover {
  opacity: 1;
  background: rgba(174, 175, 176, 0.1);
  transform: scale(1.05);
  border-color: var(--highlight);
}

.scroll-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  transform: none;
}

.scroll-btn:disabled:hover {
  background: var(--bg);
  transform: none;
  border-color: var(--border-color);
}

.project-card:last-child {
  margin-right: var(--margin);
}

.section-projects::-webkit-scrollbar {
  display: none;
}

.card {
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  transition: background-color 0.3s ease-in;
}

.card:hover {
  background-color: rgba(174, 175, 176, 0.1);
  border: 1px solid var(--border-color);
}

.project-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 21em;
  width: 13.5em;
  min-width: 13.5em;
  padding: var(--padding);
  scroll-snap-align: center;
  position: relative;
  border-radius: var(--border-radius); 
  overflow: clip;
}

.project-image {
  position: absolute;
  bottom: -10%;
  left: var(--margin);
  height: 50%;
  width: auto;
  filter: drop-shadow(0 0 0.05rem var(--subtle));
  transition: bottom 0.3s ease-in-out, left 0.3s ease-in-out;
}

 .project-card:hover .project-image {
  position: absolute;
  bottom: 0;
  left: 0;
} 

.project-card .title {
  font-size: var(--font-size-l);
  margin: 0;
}

.project-card .brief {
  margin-top: var(--margin-small);
  color: var(--subtle);
  font-size: 0.8rem;
}

.nav-bar {
  display: flex;
  align-items: center;
  width: fit-content;
  height: 100%;
  margin-right: var(--margin);  
}

.nav-icon {
  width: 1.25em;
  aspect-ratio: 1;
  transition: scale 0.3s ease-in-out;
}

.nav-icon-bg {
  /* cursor: var(--link-cursor); */
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  border: none !important;
  border-radius: 50%;
  background-color: transparent;
  margin: 2px;
  transition: all 0.2s ease;
  padding: var(--padding-small);
}

.nav-icon-bg:hover > img {
  transform: scale(1.1);
}

#header-banner {
  border-radius: var(--border-radius);
  width: 100%;
}

header {
  margin-top: var(--margin);
  margin-bottom: var(--margin-small);
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 45px;
}

footer {
  margin-top: -3em;
  margin-left: auto;
  margin-right: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  border-top: 1px solid var(--border-color);
  width: fit-content;
  padding: var(--padding);
  border-radius: var(--border-radius);
  height: 40px;
  background-color: var(--footer-bg);
  overflow-y: visible;
  margin-bottom: var(--margin-small);
}

footer * {
  color: var(--subtle);
}

footer a:hover {
  color: var(--highlight);
}

#crowd-canvas {
  margin-top: var(--footer-negative-margin);
  position: relative;
  width: 100%;
  margin-bottom: -10px;
  pointer-events: none;
  z-index: -1;
}

hr {
  width: 100%;
  background-color: var(--highlight);
  border-color: var(--highlight);
}

.writings-card {
  position: relative;
  width: inherit;
  height: fit-content;
  margin: var(--margin) 0;
}

.writings-card .date {
  position: absolute;
  top: -1.2em;
  right: 0;
  font-size: var(--font-size-xxs);
  font-weight: 700;
  color: var(--highlight);
  border-radius: 16px;
  border: 1px solid var(--highlight);
  padding: var(--padding-xxs) var(--padding-small);
  background-color: var(--bg);
  width: fit-content;
}

.os-card {
  display: flex;
  flex-direction: column;
  position: relative;
  width: auto;
  height: fit-content;
  margin: var(--margin) 0;
}

.os-card a {
  border: none;
}

.languages {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding: var(--padding-small);
  padding-top: var(--padding-xs);
}

.tags {
  font-size: var(--font-size-xxs);
  font-weight: 700;
  color: var(--highlight);
  border-radius: 16px;
  padding: var(--padding-xxs) var(--padding-small);
  border: 1px solid var(--highlight);
  width: fit-content; 
}

.svg-icon {
  width: inherit;
  height: inherit;
}

.description {
  margin: var(--margin-small);
  color: var(--text);
}

.contact-parent {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100%;
  min-height: 80dvh;
  gap: 1rem;
  text-align: center;
  flex-wrap: wrap-reverse;
}

.contact-parent .brief {
  color: var(--subtle);
}

.contact-parent .email {
  font-size: 2.5rem;
  word-break: break-word;
  
}

.contact-parent .social {
  display: flex;
  gap: var(--padding);
}

.contact-parent .social > p {
  font-size: var(--font-size-s);
  background-color: var(--border-color);
  padding: var(--padding-xs) var(--padding);
  border-radius: var(--border-radius);
}

#copy-email {
  position: relative;
  min-width: 5.3rem;
}

#copy-email::before {
  content: '';
  position: absolute;
  display: block;
  width: 20px;
  top: -100%;
  aspect-ratio: 1;
  background-image: url(/images/curly-arrow.png);
  background-size: contain;
  background-repeat: no-repeat;
  transform: rotate(180deg);
}

.copied {
  color: var(--copied) !important;
  border: none !important;
}

.copied:hover {
  color: var(--copied) !important;
}

@media print {
  .no-print {
    display: none !important;
  }
}

@media only screen and (max-width: 600px) {
  .parent-container {
    max-width: 95vw;
  }
}

@media only screen and (max-width: 800px) {
  .scroll-buttons {
    display: none;
  }
  
  .section-projects {
    margin: 0 calc(-1* var(--margin));
  }

  .project-card:first-of-type {
    margin-left: var(--margin);
  }
}

@keyframes slide-enter {
  0% {
    transform: translateY(10px);
    opacity: 0
  }

  to {
    transform: translateY(0);
    opacity: 100
  }
}

@media (prefers-reduced-motion:no-preference) {

  html:not(.no-sliding) [slide-enter],
  html:not(.no-sliding) .slide-enter,
  html:not(.no-sliding) .slide-enter-content>*:not(:has(.table-of-contents)) {
    --enter-stage: 0;
    --enter-step: 90ms;
    --enter-initial: 0ms;
    animation: slide-enter 1s both 1;
    animation-delay: calc(var(--enter-initial) + var(--enter-stage) * var(--enter-step));
  }

  .slide-enter-content>*:nth-child(1) {
    --enter-stage: 1 !important;
  }

  .slide-enter-content>*:nth-child(2) {
    --enter-stage: 2 !important;
  }

  .slide-enter-content>*:nth-child(3) {
    --enter-stage: 3 !important;
  }

  .slide-enter-content>*:nth-child(4) {
    --enter-stage: 4 !important;
  }

  .slide-enter-content>*:nth-child(5) {
    --enter-stage: 5 !important;
  }

  .slide-enter-content>*:nth-child(6) {
    --enter-stage: 6 !important;
  }

  .slide-enter-content>*:nth-child(7) {
    --enter-stage: 7 !important;
  }

  .slide-enter-content>*:nth-child(8) {
    --enter-stage: 8 !important;
  }

  .slide-enter-content>*:nth-child(9) {
    --enter-stage: 9 !important;
  }

  .slide-enter-content>*:nth-child(10) {
    --enter-stage: 10 !important;
  }

  .slide-enter-content>*:nth-child(11) {
    --enter-stage: 11 !important;
  }

  .slide-enter-content>*:nth-child(12) {
    --enter-stage: 12 !important;
  }

  .slide-enter-content>*:nth-child(13) {
    --enter-stage: 13 !important;
  }

  .slide-enter-content>*:nth-child(14) {
    --enter-stage: 14 !important;
  }

  .slide-enter-content>*:nth-child(15) {
    --enter-stage: 15 !important;
  }

  .slide-enter-content>*:nth-child(16) {
    --enter-stage: 16 !important;
  }

  .slide-enter-content>*:nth-child(17) {
    --enter-stage: 17 !important;
  }

  .slide-enter-content>*:nth-child(18) {
    --enter-stage: 18 !important;
  }

  .slide-enter-content>*:nth-child(19) {
    --enter-stage: 19 !important;
  }

  .slide-enter-content>*:nth-child(20) {
    --enter-stage: 20 !important;
  }
}

/* Tooltip styling */
[data-tooltip] {
  --arrow-size: 5px;
  position: relative;
  z-index: 10;
}

/* Positioning and visibility settings of the tooltip */
[data-tooltip]:before,
[data-tooltip]:after {
  position: absolute;
  visibility: hidden;
  opacity: 0;
  left: 50%;
  bottom: calc(100% + var(--arrow-size));
  pointer-events: none;
  transition: 0.2s;
  will-change: transform;
}

/* The actual tooltip with a dynamic width */
[data-tooltip]:before {
  content: attr(data-tooltip);
  padding: 5px 10px;
  min-width: 50px;
  max-width: 300px;
  width: max-content;
  width: -moz-max-content;
  border-radius: var(--border-radius);
  font-size: 14px;
  background-color: rgba(59, 72, 80, 0.9);
  background-image: linear-gradient(30deg,
      rgba(59, 72, 80, 0.44),
      rgba(59, 68, 75, 0.44),
      rgba(60, 82, 88, 0.44));
  box-shadow: 0px 0px 24px rgba(0, 0, 0, 0.2);
  color: #fff;
  text-align: center;
  white-space: pre-wrap;
  transform: translate(-50%, calc(0px - var(--arrow-size))) scale(0.5);
}

/* Tooltip arrow */
[data-tooltip]:after {
  content: '';
  border-style: solid;
  border-width: var(--arrow-size) var(--arrow-size) 0px var(--arrow-size);
  /* CSS triangle */
  border-color: rgba(55, 64, 70, 0.9) transparent transparent transparent;
  transition-duration: 0s;
  /* If the mouse leaves the element, 
                                the transition effects for the 
                                tooltip arrow are "turned off" */
  transform-origin: top;
  /* Orientation setting for the
                                slide-down effect */
  transform: translateX(-50%) scaleY(0);
}

/* Tooltip becomes visible at hover */
[data-tooltip]:hover:before,
[data-tooltip]:hover:after {
  visibility: visible;
  opacity: 1;
}

/* Scales from 0.5 to 1 -> grow effect */
[data-tooltip]:hover:before {
  transition-delay: 0.3s;
  transform: translate(-50%, calc(0px - var(--arrow-size))) scale(1);
}

/* 
    Arrow slide down effect only on mouseenter (NOT on mouseleave)
  */
[data-tooltip]:hover:after {
  transition-delay: 0.5s;
  /* Starting after the grow effect */
  transition-duration: 0.2s;
  transform: translateX(-50%) scaleY(1);
}

/*
    That's it for the basic tooltip.
  
    If you want some adjustability
    here are some orientation settings you can use:
  */

/* LEFT */
/* Tooltip + arrow */
[data-tooltip-location="left"]:before,
[data-tooltip-location="left"]:after {
  left: auto;
  right: calc(100% + var(--arrow-size));
  bottom: 50%;
}

/* Tooltip */
[data-tooltip-location="left"]:before {
  transform: translate(calc(0px - var(--arrow-size)), 50%) scale(0.5);
}

[data-tooltip-location="left"]:hover:before {
  transform: translate(calc(0px - var(--arrow-size)), 50%) scale(1);
}

/* Arrow */
[data-tooltip-location="left"]:after {
  border-width: var(--arrow-size) 0px var(--arrow-size) var(--arrow-size);
  border-color: transparent transparent transparent rgba(55, 64, 70, 0.9);
  transform-origin: left;
  transform: translateY(50%) scaleX(0);
}

[data-tooltip-location="left"]:hover:after {
  transform: translateY(50%) scaleX(1);
}



/* RIGHT */
[data-tooltip-location="right"]:before,
[data-tooltip-location="right"]:after {
  left: calc(100% + var(--arrow-size));
  bottom: 50%;
}

[data-tooltip-location="right"]:before {
  transform: translate(var(--arrow-size), 50%) scale(0.5);
}

[data-tooltip-location="right"]:hover:before {
  transform: translate(var(--arrow-size), 50%) scale(1);
}

[data-tooltip-location="right"]:after {
  border-width: var(--arrow-size) var(--arrow-size) var(--arrow-size) 0px;
  border-color: transparent rgba(55, 64, 70, 0.9) transparent transparent;
  transform-origin: right;
  transform: translateY(50%) scaleX(0);
}

[data-tooltip-location="right"]:hover:after {
  transform: translateY(50%) scaleX(1);
}

/* BOTTOM */
[data-tooltip-location="bottom"]:before,
[data-tooltip-location="bottom"]:after {
  top: calc(100% + var(--arrow-size));
  bottom: auto;
}

[data-tooltip-location="bottom"]:before {
  transform: translate(-50%, var(--arrow-size)) scale(0.5);
}

[data-tooltip-location="bottom"]:hover:before {
  transform: translate(-50%, var(--arrow-size)) scale(1);
}

[data-tooltip-location="bottom"]:after {
  border-width: 0px var(--arrow-size) var(--arrow-size) var(--arrow-size);
  border-color: transparent transparent rgba(55, 64, 70, 0.9) transparent;
  transform-origin: bottom;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}

::view-transition-old(root) {
  z-index: 1;
}

::view-transition-new(root) {
  z-index: 9999;
}

:root[data-color-mode="dark"]::view-transition-old(root) {
  z-index: 9999;
}

:root[data-color-mode="dark"]::view-transition-new(root) {
  z-index: 1;
}
