/* Fallback nav height variable */
:root {
  --nav-height: 4rem;
  /* Percy Blue and Off White */
  --color-bg: #1b2b4c;
  --color-text: #e7ddde;
}

/* Reset and global base styles */
*,
body,
html {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body,
html {
  height: 100%;
  min-height: 100%;
}

html {
  font-size: 15px;
  height: -webkit-fill-available;
  height: -moz-available;
  height: fill-available;
}

body {
  width: 100vw;
  max-width: 100vw;
  min-height: -webkit-fill-available;
  min-height: -moz-available;
  min-height: fill-available;
  min-height: 100dvh;
  overflow-x: hidden;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 1rem;
  font-weight: bold;
  line-height: normal;
  text-rendering: optimizeLegibility;
  /*
  background: radial-gradient(circle at 30% 40%, #121c33 0%, transparent 60%),
    radial-gradient(circle at 70% 70%, #0c1527 0%, #050a14 100%);
  background-color: #1b2b4c;
  background-blend-mode: screen;
  */
  background: var(--color-bg);
  color: var(--color-text);
}

::-webkit-scrollbar {
  display: none;
}

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

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-size: inherit;
  font-weight: inherit;
}

p {
  font-size: inherit;
  letter-spacing: 1%;
}

a,
a:link,
a:hover,
a:visited {
  color: var(--color-text);
  text-decoration: none;
  border-bottom: 2px solid;
}

button {
  color: inherit;
  background: none;
  font-size: inherit;
}

/* Layout container: main, section, article */
main {
  width: 100%;
  display: flex;
  flex-direction: column;
  /*
  justify-content: flex-end;
  */
  padding: 1rem;
  padding-bottom: calc(1rem + var(--nav-height) + env(safe-area-inset-bottom));
}

main section {
  margin: 0.5rem 0;
}

main section p,
main article p {
  text-indent: 1rem;
  margin: 0.5rem 0;
}

/* Page-specific layout tweaks */
body#home main {
  background-color: var(--color-text);
  -webkit-mask-image: url("/assets/images/landing-design.svg");
  mask-image: url("/assets/images/landing-design.svg");
  -webkit-mask-size: 75%;
  mask-size: 75%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  min-height: calc(100dvh - var(--nav-height));
}

body#community main {
  min-height: auto !important;
}

body#community .tab-content article:first-of-type {
  margin: 0 0;
}

body#community .tab-content article {
  margin: 1rem 0;
}

/* Navigation */
nav {
  width: 100%;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  padding: 1rem;
  padding-bottom: calc(1rem + env(safe-area-inset-bottom));
  position: fixed;
  bottom: env(safe-area-inset-bottom);
  left: 0;
  right: 0;
  background: none;
  z-index: 11;
}

nav a,
nav a:link,
nav a:hover,
nav a:visited {
  color: inherit;
  text-decoration: none;
  position: relative;
  display: inline-block;
  padding: 0.25rem;
  background: var(--color-text);
  color: var(--color-bg);
  border: 0;
}

.menu-overlay a,
.menu-overlay a:link,
.menu-overlay a:hover,
.menu-overlay a:visited {
  text-decoration: none;
  border: none;
}

body#home nav a,
body#home nav a:link,
body#home nav a:hover,
body#home nav a:visited {
  color: inherit;
  text-decoration: none;
  position: relative;
  display: inline-block;
  padding: 0.25rem;
  background: none;
  color: inherit;
}

/* Added CSS mask-image icon for menu toggle */
.menu-toggle::after {
  content: "";
  display: block;
  width: 5rem;
  height: 5rem;
  background-color: var(--color-text);
  -webkit-mask-image: url("/assets/images/bullethole.svg");
  mask-image: url("/assets/images/bullethole.svg");
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 13;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* Show icon when the toggle has an explicit .active class */
.menu-toggle.active::after {
  opacity: 1;
}

/* Only enable hover reveal on devices that actually support hover */
@media (hover: hover) and (pointer: fine) {
  .menu-toggle:hover::after {
    opacity: 1;
  }
}

/* Menu overlay */
.menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100dvh;
  z-index: 10;
  padding: 1rem;
  padding-bottom: calc(1rem + var(--nav-height) + env(safe-area-inset-bottom));
  display: flex;
  justify-content: flex-end;
  flex-direction: column;
  transition: opacity 0.3s ease;
  background: var(--color-bg);
}

.menu-overlay ul {
  list-style: none;
  padding: 0;
  margin: 0;
  text-align: left;
}

.menu-overlay li {
  margin: 0.5rem 0;
}

.menu-overlay a {
  font-size: inherit;
  color: inherit;
  text-transform: uppercase;
  text-decoration: none;
}

.menu-overlay.hidden {
  display: none;
}

/* Tabs and tab-content */
.tabs {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 0.5rem 0;
  min-height: 60svh;
}

.tab-buttons {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.tab-buttons .tab-btn {
  border: none;
  padding: 0.5rem 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: border 0.3s ease, color 0.3s ease;
}

.tab-buttons .tab-btn.active p {
  border-bottom: 2px solid var(--color-text);
}

.tab-content {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.tab-content.hidden {
  opacity: 0;
  display: none;
  pointer-events: none;
}

/* Map container */
.map-container {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  height: 0;
  overflow: hidden;
}

.map-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Lightweight placeholder for map until iframe is injected */
.map-container .map-embed {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
  background: #d6d6d0; /* neutral placeholder close to off-white */
  overflow: hidden;
}

/* Shimmer skeleton while map loads */
.map-container .map-embed.skeleton {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0,0,0,0.06) 25%, rgba(0,0,0,0.12) 37%, rgba(0,0,0,0.06) 63%);
  background-size: 400% 100%;
  animation: mapShimmer 1.2s infinite;
}

@keyframes mapShimmer {
  0% { background-position: 100% 0; }
  100% { background-position: 0 0; }
}

.video-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100dvh;
  overflow: hidden;
  z-index: -1;
}

/* Cover the viewport on all devices without pillarboxing */
.video-background .blurred-video,
.video-background .foreground-video,
.video-background iframe {
  position: absolute;
  top: 50%;
  left: 50%;
  min-width: 100vw;
  min-height: 100vh;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

/* --- Restored global blurred background layer --- */
.video-background .video-blur {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100dvh;
  overflow: hidden;
  z-index: -1; /* sits above container bg but below foreground */
}

.video-background .video-blur .blurred-video {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(2);
  min-width: 100vw;
  min-height: 100vh;
  filter: blur(30px);
  opacity: 0.5;
  pointer-events: none;
}

/* random icon */
.random-icon {
  position: absolute;
  width: 10rem;
  height: 10rem;
  color: var(--color-text);
  pointer-events: none;
  z-index: 999;
  opacity: 0.9;
  transition: opacity 0.3s ease;
}

body#home .random-icon {
  opacity: 0;
}

body#home.menu-open .random-icon {
  opacity: 0.9;
}

.random-icon svg {
  width: 100%;
  height: 100%;
  display: block;
  fill: currentColor !important;
}

/* effects */
h1,
h2,
p {
  filter: url(#smearEffect);
}

#noise {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100dvh;
  z-index: 9999;
  pointer-events: none;
  mix-blend-mode: overlay;
  opacity: 0.3;
}

/* desktop browsers */
@media (min-width: 768px) {
  main {
    max-width: 50vw;
    font-size: 1.5rem;
  }
  body#home main {
    max-width: 50vw;
    margin-left: auto;
    margin-right: auto;
  }
  main section,
  .tab-content {
    max-width: 100%;
  }
  /* Blurred background effect */
  .video-background .video-blur {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100dvh;
    overflow: hidden;
  }
  .video-background .video-blur .blurred-video {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(2);
    min-width: 100vw;
    min-height: 100vh;
    filter: blur(30px);
    opacity: 0.5;
    pointer-events: none;
  }
  /* Foreground portrait layer */
  .video-background .video-foreground {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100dvh;
    overflow: hidden;
  }
  .video-background .video-foreground .foreground-video {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    min-width: 100vw;
    min-height: 100vh;
    pointer-events: none;
  }
}
