:root {
  color-scheme: dark;

  /* Core palette */
  --color-transparent: transparent;
  --color-black: #000;
  --color-selection-text: #050908;
  --color-background: rgb(10, 10, 10);
  --color-background-gradient: rgb(42, 42, 42);
  --color-media-background: rgb(29, 29, 29);
  --color-modal-surface: rgb(31, 31, 31);
  --color-modal-surface-hover: rgb(35, 35, 35);
  --color-close-control: rgb(45, 45, 45);
  --color-close-control-hover: rgb(60, 60, 60);

  /* Text */
  --color-text-white: #fff;
  --color-text-primary: #f5f5f5;
  --color-text-strong: #f0f0f0;
  --color-text-soft: #e0e0e0;
  --color-text-navigation: #ddd;
  --color-text-card: #d0d0d0;
  --color-text-secondary: #ccc;
  --color-text-button: #a0a0a0;
  --color-text-fallback: #999;
  --color-text-muted: #888;
  --color-text-subtle: #777;
  --color-text-body: rgba(255, 255, 255, 0.8);
  --color-text-body-strong: rgba(255, 255, 255, 0.85);
  --color-contact-heading: rgb(247, 247, 247);

  /* Surfaces and borders */
  --color-surface-section: rgba(255, 255, 255, 0.02);
  --color-surface-soft: rgba(255, 255, 255, 0.03);
  --color-surface-hover: rgba(255, 255, 255, 0.055);
  --color-surface-neutral-hover: rgba(100, 100, 100, 0.1);
  --color-border-subtle: rgba(255, 255, 255, 0.05);
  --color-border-control: rgba(70, 70, 70, 0.4);
  --color-border-control-strong: rgba(70, 70, 70, 0.6);
  --color-border-hover: rgba(90, 90, 90, 0.5);
  --color-border-timeline-hover: rgba(119, 119, 119, 0.2);
  --color-selection-background: rgba(206, 207, 208, 0.5);
  --color-gallery-selection: rgba(255, 255, 255, 0.75);

  /* Card gradients */
  --color-card-gradient-start: rgba(40, 40, 40, 0.4);
  --color-card-gradient-end: rgba(35, 35, 35, 0.6);
  --color-card-gradient-hover-start: rgba(45, 45, 45, 0.8);
  --color-card-gradient-hover-end: rgba(35, 35, 35, 0.9);

  /* Shared buttons */
  --button-background: var(--color-surface-soft);
  --button-background-hover: var(--color-surface-hover);
  --button-border: var(--color-border-subtle);
  --button-text: var(--color-text-button);
  --button-text-hover: var(--color-text-strong);

  /* Gallery and modal controls */
  --control-background: rgba(30, 30, 30, 0.7);
  --control-background-hover: rgba(40, 40, 40, 0.9);
  --control-background-strong: rgba(40, 40, 40, 0.85);
  --control-background-mobile: rgba(40, 40, 40, 0.95);
  --control-border: var(--color-border-control);
  --control-text: #aaa;
  --control-text-hover: var(--color-text-white);

  /* Shadows and decorative overlays */
  --color-modal-overlay: rgba(0, 0, 0, 0.85);
  --color-shadow-faint: rgba(0, 0, 0, 0.05);
  --color-shadow-soft: rgba(0, 0, 0, 0.1);
  --color-shadow-medium: rgba(0, 0, 0, 0.2);
  --color-shadow-control: rgba(0, 0, 0, 0.3);
  --color-shadow-modal: rgba(0, 0, 0, 0.5);
  --color-highlight-faint: rgba(255, 255, 255, 0.025);
  --color-highlight-soft: rgba(255, 255, 255, 0.03);
  --color-highlight: rgba(255, 255, 255, 0.1);
  --color-highlight-strong: rgba(255, 255, 255, 0.2);
  --color-project-cylinder: #252525;
  --color-contact-circle: #494949;
  --color-home-typewriter: #494949;

  /* About-page accents */
  --color-accent-bio: rgba(180, 180, 180, 0.7);
  --color-accent-tools: rgba(200, 200, 200, 0.7);
  --color-accent-education: rgba(170, 170, 172, 0.8);
  --color-accent-education-ring: rgba(140, 140, 140, 0.3);

  /* Brand colors */
  --color-brand-linkedin: #0092e0;
  --color-brand-itch: #fa5c5c;
  --color-brand-unity: rgb(144, 144, 144);
  --color-brand-photoshop: rgb(49 168 255);
  --color-brand-blender: rgb(245, 121, 42);
  --color-brand-figma: rgb(38 203 113);
  --color-brand-fmod: rgb(226, 226, 226);
  --color-language-csharp: rgb(155, 79, 150);
  --color-language-java: rgb(231, 111, 0);
  --color-language-python: rgb(69, 132, 182);
}

html {
  min-height: 100%;
  position: relative;
  isolation: isolate;
  background: var(--color-background);
}

html::before {
  content: "";
  position: fixed;
  inset: -300px;
  z-index: 0;
  pointer-events: none;

  background-image: linear-gradient(
    to bottom right,
    var(--color-background-gradient) 425px,
    var(--color-background) calc(100% - 425px)
  );

  background-repeat: no-repeat;
  background-size: cover;
}

html::after {
  content: "";
  position: fixed;
  inset: -300px;
  z-index: 0;
  pointer-events: none;
  background: var(--color-black);
  opacity: var(--scroll-darkness, 0);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

::selection {
  background: var(--color-selection-background);
  color: var(--color-selection-text);
}

body {
  --noise-texture: url("../assets/noise_static.webp");
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  color: var(--color-text-white);
  background-repeat: no-repeat;
  background-size: cover;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: var(--noise-texture);
  background-repeat: repeat;
  background-size: 120px;
  opacity: 0.4;
  mix-blend-mode: multiply;
}

body.noise-animated {
  --noise-texture: url("../assets/noise.webp");
}

/* Put grain over project-card surfaces without covering their content. */
.featured-project,
.project-card {
  position: relative;
  isolation: isolate;
}

.featured-project::before,
.project-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  pointer-events: none;
  background-image: var(--noise-texture);
  background-repeat: repeat;
  background-size: 120px;
  opacity: 0.4;
  mix-blend-mode: multiply;
}

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

header {
  height: 50px;
  display: flex;
  align-items: center;
}

.header-container {
  --header-link-gap: clamp(12px, 4vw, 20px);
  --header-home-gap: clamp(
    var(--header-link-gap),
    calc(40vw - 287px),
    400px
  );
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--header-home-gap);
  margin-top: clamp(0px, calc(80px - 10.4167vw), 40px);
}

.logo,
nav a {
  position: relative;
  display: inline-block;
  color: var(--color-text-navigation);
  font-size: clamp(1.1rem, calc(1.9rem - 1.6667vw), 1.3rem);
  font-weight: 500;
  text-decoration: none;
  user-select: none;
}

.logo::after,
nav a::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--color-text-navigation);
  transition: width 0.3s ease;
}

.logo:hover::after,
nav a:hover::after,
.logo.active::after,
nav a.active::after {
  width: 100%;
}

.logo.active::after,
nav a.active::after {
  transition: none;
}

nav ul {
  display: flex;
  gap: var(--header-link-gap);
  list-style: none;
}

main {
  position: relative;
  z-index: 10;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

footer {
  position: relative;
  z-index: 100;
  padding: 10px 0;
  text-align: center;
  user-select: none;
}

footer .roller {
  width: 100%;
  max-width: 600px;
  height: 1rem;
  margin: 0 auto;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  font-size: 0.9rem;
  line-height: 1rem;
}

footer .roller-text {
  position: absolute;
  top: 0;
  text-align: center;
  
}

@keyframes footer-slide {
  0%,
  100% {
    top: 0;
  }

  25% {
    top: -1rem;
  }

  50% {
    top: -2rem;
  }
}
