@font-face {
    font-family: 'Liquid Galaxy';
    src: url('Liquidgalaxy-Regular.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}

.alt-letter-1 {
  font-feature-settings: "ss01" 1; 
}

.alt-letter-2 {
  font-feature-settings: "ss02" 1; 
}

.alt-letter-3 {
  font-feature-settings: "ss03" 1; 
}

.alt-letter-4 {
  font-feature-settings: "ss04" 1; 
}

.alt-letter-5 {
  font-feature-settings: "ss05" 1; 
}

.alt-letter-6 {
  font-feature-settings: "ss06" 1; 
}

.alt-letter-7 {
  font-feature-settings: "ss06" 1; 
}

/* === CSS Reset === */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  tab-size: 4;
}

body {
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
}

input, button, textarea, select {
  font: inherit;
}

p, h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
}

ul, ol {
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

/* === Custom Properties === */
:root {
  --color-bg: #0a1628;
  /*--color-text: #1a1a1a;*/
  --color-text: #e9edf2;
  --color-accent: #1B998B;
  /*--color-accent: #f5c30c;*/
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: ui-monospace, monospace;
  --font-accent: "DM Sans", sans-serif;
  --font-style: 'Liquid Galaxy', Helvetica, system-ui;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 2rem;
  --max-width: 1200px;
}

/* === Base Styles === */
body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--spacing-lg);
}

/* SELECTION */

::selection {
  background-color: #a9c1ff;
  color: var(--color-bg);
}

/* HEADER */

.sticky-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  height: 60px;
  background: var(--color-bg);
  border-bottom: 1px solid #102242;
  transform: translateY(-100%);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.sticky-nav.visible {
  transform: translateY(0);
  opacity: 1;
}

.sticky-nav-escape-hatch {
  font-family: var(--font-style);
  color: var(--color-accent);
  letter-spacing: 0.022em;
  font-size: clamp(1rem, 3vw, 1.6rem);
}

.sticky-nav-links {
  display: flex;
  gap: 30px;
  font-weight: 700;
}

/* HERO */

.hero {
  position: relative;
  width: 100%;
  overflow: visible;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  flex-direction: column;

  /* grid paper */
  background-color: var(--color-bg, #0a1628);
  background-image:
    linear-gradient(rgba(40, 80, 160, 0.18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(40, 80, 160, 0.18) 1px, transparent 1px),
    linear-gradient(rgba(40, 80, 160, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(40, 80, 160, 0.07) 1px, transparent 1px);
  background-size:
    80px 80px,
    80px 80px,
    16px 16px,
    16px 16px;
  background-position: -0.5px -0.5px, -0.5px -0.5px, -0.5px -0.5px, -0.5px -0.5px;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60%;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    var(--color-bg, #0a1628) 100%
  );
  pointer-events: none;
  z-index: 1;
}

.hero > * {
  position: relative;
}

h1 {
  font-family: var(--font-style);
  font-weight: 500;
  font-style: normal;
  font-size: clamp(2.8rem, 8vw, 6rem);
  line-height: 1.2em;
  letter-spacing: 0.022em;
  color: var(--color-accent);
  text-shadow: 0 1px 0 #142d52, 0 2px 0 #142d52, 0 3px 0 #142d52, 0 4px 0 #142d52, 0 5px 0 #142d52;
}

.kicker {
  font-family: var(--font-accent);
  text-transform: uppercase;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-shadow: 0 1px 0 #142d52, 0 2px 0 #142d52, 0 3px 0 #142d52, 0 4px 0 #142d52, 0 5px 0 #142d52;
}

/* MAIN */


main section, main section.projects, main section.about, main section.contact {
  margin-bottom: 150px;
}

main > section:last-of-type {
  margin-bottom: 100px;
}

main #projects, main #about, main #contact {
  scroll-margin-top: 80px;
}

/* PROJECTS */

.projects {
  max-width: 900px;
  margin: 0 auto;
}

.projects-header, .about-header, .contact-header {
  padding: 5px 0;
  /* border-bottom: 1px dashed rgba(233, 237, 242, 0.2); */
  margin-bottom: 50px;
}

.projects h2, .about h2, .contact h2 {
  font-weight: 500;
  font-size: clamp(1.7rem, 5vw, 3.5rem);
  font-family: var(--font-style);
  text-align: center;
  color: var(--color-accent);
  
  font-variant-ligatures: common-ligatures discretionary-ligatures;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.projects-project-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 80px;
  flex-direction: row;
}
/*
.project {
  flex: 0 1 calc(50% - 40px);

  padding: 20px;
  border-radius: 20px;
  transition: background-color 0.9s ease-in-out; 
}

.project:hover {
  background-color: #0d1e38;
}
*/

.project {
  flex: 0 1 calc(50% - 40px);
  position: relative;
  overflow: hidden;
  padding: 20px;
  border-radius: 20px;
  border: 1px solid transparent;
  transition: background-color 1s ease, border-color 1s ease;
}

.project:hover {
  background-color: #07081a;
  border-color: #1e2050;
}

.project > * {
  position: relative;
  z-index: 1;
}

.project::before,
.project::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transform: scale(0);
  will-change: transform, opacity;
  transition: opacity 0.6s ease, transform 0s ease 0.6s;
}

.project::before {
  background-image:
    radial-gradient(1px 1px at 8% 15%, #fff 100%, transparent),
    radial-gradient(1.5px 1.5px at 22% 42%, #c9d3ff 100%, transparent),
    radial-gradient(1px 1px at 38% 8%, #fff 100%, transparent),
    radial-gradient(1px 1px at 51% 58%, #e8e0ff 100%, transparent),
    radial-gradient(1.5px 1.5px at 64% 25%, #fff 100%, transparent),
    radial-gradient(1px 1px at 79% 72%, #c9d3ff 100%, transparent),
    radial-gradient(1px 1px at 91% 12%, #fff 100%, transparent),
    radial-gradient(1px 1px at 73% 48%, #fff 100%, transparent),
    radial-gradient(1.5px 1.5px at 17% 78%, #e8e0ff 100%, transparent),
    radial-gradient(1px 1px at 43% 85%, #fff 100%, transparent),
    radial-gradient(1px 1px at 56% 33%, #c9d3ff 100%, transparent),
    radial-gradient(1px 1px at 93% 55%, #fff 100%, transparent),
    radial-gradient(1px 1px at 4% 62%, #fff 100%, transparent),
    radial-gradient(1.5px 1.5px at 31% 27%, #c9d3ff 100%, transparent),
    radial-gradient(1px 1px at 77% 90%, #e8e0ff 100%, transparent),
    radial-gradient(1px 1px at 14% 94%, #fff 100%, transparent),
    radial-gradient(1px 1px at 62% 67%, #fff 100%, transparent),
    radial-gradient(1.5px 1.5px at 46% 50%, #e8e0ff 100%, transparent),
    radial-gradient(1px 1px at 84% 32%, #c9d3ff 100%, transparent),
    radial-gradient(1px 1px at 27% 57%, #fff 100%, transparent);
}

.project::after {
  background-image:
    radial-gradient(1px 1px at 7% 35%, #fff 100%, transparent),
    radial-gradient(1.5px 1.5px at 21% 19%, #c9d3ff 100%, transparent),
    radial-gradient(1px 1px at 40% 74%, #fff 100%, transparent),
    radial-gradient(1px 1px at 58% 11%, #e8e0ff 100%, transparent),
    radial-gradient(1.5px 1.5px at 71% 60%, #fff 100%, transparent),
    radial-gradient(1px 1px at 86% 28%, #c9d3ff 100%, transparent),
    radial-gradient(1px 1px at 96% 80%, #fff 100%, transparent),
    radial-gradient(1px 1px at 2% 88%, #e8e0ff 100%, transparent),
    radial-gradient(1.5px 1.5px at 34% 97%, #fff 100%, transparent),
    radial-gradient(1px 1px at 61% 89%, #c9d3ff 100%, transparent),
    radial-gradient(1px 1px at 76% 4%, #fff 100%, transparent),
    radial-gradient(1px 1px at 49% 22%, #e8e0ff 100%, transparent),
    radial-gradient(1.5px 1.5px at 11% 46%, #fff 100%, transparent),
    radial-gradient(1px 1px at 89% 44%, #c9d3ff 100%, transparent),
    radial-gradient(1px 1px at 19% 68%, #fff 100%, transparent);
  transition: opacity 0.6s ease 0.15s, transform 0s ease 0.75s;
}

@media (hover: hover) and (pointer: fine) {
  @media (prefers-reduced-motion: no-preference) {
    .project:hover::before {
      opacity: 0.75;
      transform: scale(1);
      transition: opacity 0.6s ease, transform 0s ease;
      animation: twinkle-a 2.4s ease-in-out infinite;
    }

    .project:hover::after {
      opacity: 0.5;
      transform: scale(1);
      transition: opacity 0.6s ease 0.15s, transform 0s ease;
      animation: twinkle-b 3.2s ease-in-out infinite 0.8s;
    }
  }
}

@keyframes twinkle-a {
  0%, 100% { opacity: 0.75 }
  25%       { opacity: 1 }
  55%       { opacity: 0.35 }
  80%       { opacity: 0.85 }
}

@keyframes twinkle-b {
  0%, 100% { opacity: 0.5 }
  20%       { opacity: 0.9 }
  50%       { opacity: 0.25 }
  78%       { opacity: 0.75 }
}

.project h3 {
  text-align: center;
  font-size: 1.65em;
  color: var(--color-accent);
  font-weight: 800;
  margin-bottom: 10px;
}

.project p {
  text-wrap: pretty;
  font-size: 0.9rem;
}

.project-tags {
  margin: 15px 0 25px;
}

.project-tags span {
  font-family: var(--font-mono);
  font-size: 0.8em;
  padding: 2px 5px;
  border-radius: 3px;
  font-weight: 600;
  color: var(--color-bg);
  background-color: var(--color-accent);

}

.project-links {
  margin: 15px 0 25px;
}

.project-links li a {
  color: var(--color-accent);
  font-weight: 600;
}

.project-pictures {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.project-picture {
  border-radius: 20px;
  border: 3px solid #fff;
  overflow: hidden;
  max-height: 120px;
}

/* ABOUT */

.about .about-info {
  width: 50%;
  margin: 0 auto;
}

.about .about-info p {
  font-size: 1.25em;
}

.about-info-1, .about-info-2, .about-info-3 {
  display: inline-block;
  padding: 0 7px;
  border-radius: 5px;
  background-color: #a9c1ff;
  /*color: #ffe7a6;*/
  color: var(--color-bg);
  font-weight: 600;
}



/* CONTACT */

.contact-email-card {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

.contact-email-card a {
  background-color: var(--color-accent);
  margin: 0 auto;
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex-direction: row;
  padding: 5px 25px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.contact-email-card-icon {
  max-width: 35px;
  fill: var(--color-bg);
}

.contact-email-card a span {
  color: var(--color-bg);
  font-weight: 600;
}

.contact-email-card a:hover {
  background-color: #142d52;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.contact-email-card a:hover .contact-email-card-icon {
  /*fill: var(--color-accent);*/
  fill: var(--color-text);
}

.contact-email-card a:hover span {
  /*color: var(--color-accent);*/
  color: var(--color-text);
}

/* FOOTER */

footer {
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding-top: 100px;
  padding-bottom: 80px;
  
}

.footer-icon-container {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.footer-icon {
  font-family: var(--font-style);
  font-variant-ligatures: common-ligatures discretionary-ligatures;
  font-size: 4em;
  /*animation: spin 2s linear infinite;*/
  fill: var(--color-text);
  max-width: 50px;
}

.footer-escape-hatch-container {
  text-align: center;
}

.footer-escape-hatch {
  font-weight: 500;
  font-size: clamp(1.8rem, 5vw, 3.5rem);
  font-family: var(--font-style);
  text-align: center;
  text-transform: uppercase;
  font-variant-ligatures: common-ligatures discretionary-ligatures;
}

.footer-info {
  font-size: 0.8em;
  opacity: 0.6;
}

footer {
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding-top: 100px;
  padding-bottom: 80px;
  position: relative;
  overflow: hidden;
}

footer > * {
  position: relative;
  z-index: 1;
}

footer::before,
footer::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to top, black 0%, transparent 100%);
  mask-image: linear-gradient(to top, black 0%, transparent 100%);
}

footer::before {
  background-image:
    radial-gradient(1px 1px at 8% 15%, #fff 100%, transparent),
    radial-gradient(1.5px 1.5px at 22% 42%, #c9d3ff 100%, transparent),
    radial-gradient(1px 1px at 38% 8%, #fff 100%, transparent),
    radial-gradient(1px 1px at 51% 58%, #e8e0ff 100%, transparent),
    radial-gradient(1.5px 1.5px at 64% 25%, #fff 100%, transparent),
    radial-gradient(1px 1px at 79% 72%, #c9d3ff 100%, transparent),
    radial-gradient(1px 1px at 91% 12%, #fff 100%, transparent),
    radial-gradient(1px 1px at 73% 48%, #fff 100%, transparent),
    radial-gradient(1.5px 1.5px at 17% 78%, #e8e0ff 100%, transparent),
    radial-gradient(1px 1px at 43% 85%, #fff 100%, transparent),
    radial-gradient(1px 1px at 56% 33%, #c9d3ff 100%, transparent),
    radial-gradient(1px 1px at 93% 55%, #fff 100%, transparent),
    radial-gradient(1px 1px at 4% 62%, #fff 100%, transparent),
    radial-gradient(1.5px 1.5px at 31% 27%, #c9d3ff 100%, transparent),
    radial-gradient(1px 1px at 77% 90%, #e8e0ff 100%, transparent),
    radial-gradient(1px 1px at 14% 94%, #fff 100%, transparent),
    radial-gradient(1px 1px at 62% 67%, #fff 100%, transparent),
    radial-gradient(1.5px 1.5px at 46% 50%, #e8e0ff 100%, transparent),
    radial-gradient(1px 1px at 84% 32%, #c9d3ff 100%, transparent),
    radial-gradient(1px 1px at 27% 57%, #fff 100%, transparent);
  opacity: 0.75;
  animation: twinkle-a 2.4s ease-in-out infinite;
}

footer::after {
  background-image:
    radial-gradient(1px 1px at 7% 35%, #fff 100%, transparent),
    radial-gradient(1.5px 1.5px at 21% 19%, #c9d3ff 100%, transparent),
    radial-gradient(1px 1px at 40% 74%, #fff 100%, transparent),
    radial-gradient(1px 1px at 58% 11%, #e8e0ff 100%, transparent),
    radial-gradient(1.5px 1.5px at 71% 60%, #fff 100%, transparent),
    radial-gradient(1px 1px at 86% 28%, #c9d3ff 100%, transparent),
    radial-gradient(1px 1px at 96% 80%, #fff 100%, transparent),
    radial-gradient(1px 1px at 2% 88%, #e8e0ff 100%, transparent),
    radial-gradient(1.5px 1.5px at 34% 97%, #fff 100%, transparent),
    radial-gradient(1px 1px at 61% 89%, #c9d3ff 100%, transparent),
    radial-gradient(1px 1px at 76% 4%, #fff 100%, transparent),
    radial-gradient(1px 1px at 49% 22%, #e8e0ff 100%, transparent),
    radial-gradient(1.5px 1.5px at 11% 46%, #fff 100%, transparent),
    radial-gradient(1px 1px at 89% 44%, #c9d3ff 100%, transparent),
    radial-gradient(1px 1px at 19% 68%, #fff 100%, transparent);
  opacity: 0.5;
  animation: twinkle-b 3.2s ease-in-out infinite 0.8s;
}

@media (prefers-reduced-motion: no-preference) {
  footer::before {
    animation: twinkle-a 2.4s ease-in-out infinite;
  }

  footer::after {
    animation: twinkle-b 3.2s ease-in-out infinite 0.8s;
  }
}

@media (prefers-reduced-motion: reduce) {
  footer::before,
  footer::after {
    animation: none;
  }
}

/* IMAGES */

.lb-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 999;
  align-items: center;
  justify-content: center;
}

.lb-overlay.open { display: flex; }

.lb-overlay img {
  max-width: 90vw;
  max-height: 85vh;
  border-radius: 8px;
}

#lb-close {
  position: fixed;
  top: 20px; right: 24px;
  color: white;
  font-size: 28px;
  background: none;
  border: none;
  cursor: pointer;
}

/* MOBILE / TABLET */

/* Tablet */
@media screen and (max-width: 768px) {
  .projects-project-container {
    flex-direction: column;
  }
  
  .about .about-info {
    width: 100%;
  }
}

/* Mobile */
@media screen and (max-width: 430px) {
  .container {
    padding: 1rem;
  }

  .hero {
    background-size:
    40px 40px,
    40px 40px,
    8px 8px,
    8px 8px;
  }
}

/* MOBILE MENU */

.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  z-index: 101;
}

.nav-hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background-color: var(--color-text);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

/* X state */
.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile dropdown panel */
.sticky-nav-mobile-menu {
  display: none;
  position: fixed;
  top: 60px; /* matches nav height */
  left: 0;
  right: 0;
  background: var(--color-bg);
  border-bottom: 1px solid #102242;
  padding: 1rem 2rem;
  flex-direction: column;
  gap: 1rem;
  z-index: 99;
}

.sticky-nav-mobile-menu.open {
  display: flex;
}

.sticky-nav-mobile-menu a {
  font-weight: 700;
  font-size: 1.1rem;
}

@media screen and (max-width: 600px) {
  .sticky-nav-links {
    display: none;
  }

  .nav-hamburger {
    display: flex;
  }
}

@media screen and (max-width: 600px) {
  .sticky-nav:not(.visible) .nav-hamburger {
    display: none;
  }

  .sticky-nav:not(.visible) ~ .sticky-nav-mobile-menu {
    display: none !important;
  }
}