:root {
  --content: hsl(67, 100%, 89%);
  --background: hsl(134, 77%, 9%);
  --background-alpha: hsla(126, 68%, 25%, 0.5);
  /* Home page dynamic gradient variables */
  --home-fade-end: 100svh; /* Point where gradient becomes fully opaque */
  --content-max-width: 650px; /* Max width for content columns */
}

* { box-sizing: border-box; }

/* Ensure no horizontal overflow for all elements */
img, video, canvas, iframe, table {
  max-width: 100%;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100%;
  overflow-x: hidden;
  max-width: 100vw;
}

body {
  background-color: var(--background);
  font-family: 'Lato', sans-serif;
  font-size: 1rem;
  color: var(--content);
  position: relative;
  overflow-x: hidden;
  width: 100%;
}

a,
a:visited,
a:hover,
a:active,
a:focus {
  color: inherit;
}

main {
  position: relative;
  width: 100%;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  overflow-y: auto;
  max-width: 100vw;
}

/* canvas {
  width: 100em;
  height: 50em;
} */

header, footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 0.4rem 2rem;
  box-sizing: border-box;
  position: fixed;
  left: 0;
  z-index: 1000;
  max-width: 100%;
  backdrop-filter: blur(5px);
}

header {
  font-family: "Krona One", sans-serif;
  font-size: 2rem;
  top: 0;
}

header {
  color: var(--content);
  text-decoration: none;
}

header a {
  text-decoration: none;
}

/* Menu */
.menu-button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 1rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  z-index: 1002;
  position: relative;
}

.menu-button span {
  display: block;
  width: 2rem;
  height: 0.2rem;
  background-color: var(--content);
  transition: all 0.3s ease;
}

.menu-button[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(0.6rem) rotate(45deg);
}

.menu-button[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
  visibility: hidden;
}

.menu-button[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-0.6rem) rotate(-45deg);
}

/* Navigation Overlay */
.nav-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--background);
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.nav-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.nav-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 1rem;
}

.nav-content a {
  font-family: "Lato", sans-serif;
  font-size: 1.8rem;
  color: var(--content);
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.nav-content a:hover {
  opacity: 0.7;
}

footer {
  position: relative;
  z-index: 3;
  font-size: 0.8rem;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 3rem 2rem;
  gap: 1.5rem;
}

footer a {
  color: var(--content);
  text-decoration: none;
}

.footer-nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-nav a {
  font-size: 1rem;
}

.page-links {
  position: absolute;
  top: 6rem;
  left: 1rem;

  display: flex;
  gap: 0.5rem;

  background: var(--background-alpha);
  backdrop-filter: blur(10px);
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  box-shadow: 0 0 10px hsla(0, 0%, 0%, 0.2);

  z-index: 100;
}

.page-links a {
  text-decoration: none;
  color: var(--content);
  font-size: 1rem;
  padding: 0.1rem 0.8rem;
}

.message {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: calc(100vh - 4rem);
}

.blog {
  display: flex;
  flex-direction: column;
  align-items: left;
  margin: 6rem 2rem;
  max-width: 40rem;
}
.blog h2 a {
  text-decoration: none;
}

.blog article {
  font-size: 1.3rem;
  padding-bottom: 2rem;
  margin-bottom: 2rem;
  border-bottom: 0.1rem solid var(--content);
}

.post-sub {
  font-size: 0.8rem;
  color: var(--content);
  display: flex;
  align-items: center;
  margin-top: 0.5rem;
}

.post-sub img.author {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  margin-right: 0.5rem;
  vertical-align: middle;
}

.blog video, .blog img {
  width: 100%;
  height: auto;
  display: block;
}

.pager {
  display: flex;
  justify-content: space-between;
}
.pager a {
  text-decoration: none;
}
.pager span {
  visibility: hidden;
}

/* Home page specific styles */
.home-content {
  position: relative;
  margin-top: 0;
  padding: 2rem;
  padding-top: 105vh;
  padding-top: 105svh;
  width: 100%;
  max-width: 2000px;
  margin-left: auto;
  margin-right: auto;
  min-height: 100vh;
  min-height: 100svh;
  scroll-margin-top: -95vh;
  scroll-margin-top: -95svh;
}

.home-content::before {
  content: "";
  position: absolute;
  top: 100vh;
  top: 100svh;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--background);
  z-index: 1;
}

.home-fade {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--home-fade-end);
  background-image: url("/images/home-fade.svg");
  background-size: 100% 100%;
  background-repeat: no-repeat;
  pointer-events: none;
  z-index: 2;
}

.home-content article {
  position: relative;
  z-index: 3;
  font-size: 1.3rem;
  max-width: var(--content-max-width);
  margin: 1rem auto;
}

.home-content h2 {
  margin-top: 0;
}

.home-quip {
  margin-bottom: 3rem;
}

.home-quip h3 {
  font-family: "Krona One", sans-serif;
  font-size: clamp(1.1rem, 3vw, 1.4rem);
  margin-bottom: 0.75rem;
}

.home-quip p {
  font-size: 1.1rem;
  line-height: 1.7;
  opacity: 0.85;
}

.home-video {
  display: block;
  width: 100%;
  border-radius: 0.5rem;
  margin: 3rem 0;
}

.built-credit {
  margin-top: 4rem;
  font-size: 0.8rem;
}

.built-credit a {
  text-decoration: none;
}

/* Stats display */
.stats-display {
  font-family: "Krona One", sans-serif;
  position: absolute;
  top: 20vh;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--content-max-width);
  padding: 0 2rem;
  text-align: center;
  font-size: clamp(1rem, 5vw, 1.7rem);
  z-index: 100;
}

.stats-text {
  display: inline;
  color: var(--content);
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}

.stats-display .lead {
  margin-bottom: 1rem;
  color: var(--content);
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.stats-text.visible {
  opacity: 1;
}

.stats-text.visible.fade-out {
  opacity: 0;
}

.stats-cta {
  position: absolute;
  top: 70vh;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  text-align: center;
}

.button a {
  display: inline-block;
  background-color: var(--content);
  font-size: 1rem;
  text-align: center;
  color: var(--background);
  border-radius: 0.5rem;
  padding: 0.5rem 1rem;
  margin: 0.5rem;
  margin-left: 0;
  text-decoration: none;
}

.button a.secondary {
  color: var(--content);
  font-weight: 900;
  background-color: transparent;
}
