:root {
  --ink: #f5f5f0;
  --ink-soft: rgba(245, 245, 240, 0.8);
  --panel: rgba(10, 10, 10, 0.9);
  --line: rgba(245, 245, 240, 0.35);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: 'Cormorant Garamond', Georgia, serif;
  color: var(--ink);
  background: url('background2.gif') center/cover no-repeat;
  background-color: #000;
  background-attachment: fixed;
  overflow-x: hidden;
  overscroll-behavior-y: none;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 1;
  background: rgba(0, 0, 0, 0.884);
  pointer-events: none;
}

body.menu-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
}

.topbar-hover-area {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 4.5rem;
  z-index: 20;
}

.menu-toggle {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 0.9rem);
  left: calc(env(safe-area-inset-left, 0px) + 0.9rem);
  z-index: 40;
  width: 46px;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(10, 10, 10, 0.92);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.22rem;
  cursor: pointer;
  touch-action: manipulation;
}

.menu-toggle span {
  width: 18px;
  height: 1px;
  background: var(--ink);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.menu-toggle.active span:nth-child(1) {
  transform: translateY(5px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
  transform: translateY(-5px) rotate(-45deg);
}

.mobile-menu {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 4.2rem);
  left: calc(env(safe-area-inset-left, 0px) + 0.8rem);
  right: calc(env(safe-area-inset-right, 0px) + 0.8rem);
  z-index: 39;
  display: none;
  flex-direction: column;
  gap: 0.6rem;
  padding: 0.85rem;
  border-radius: 18px;
  background: rgba(8, 8, 8, 0.96);
  border: 1px solid var(--line);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.28);
  transform: translateY(-10px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.2s ease, opacity 0.2s ease;
  max-height: calc(100dvh - 6rem);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.mobile-menu.open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.mobile-link,
.mobile-copy {
  color: var(--ink);
  text-decoration: none;
  font-size: 1.05rem;
  letter-spacing: 0.16em;
  text-transform: lowercase;
  padding: 0.75rem 0.4rem;
  border-bottom: 1px solid rgba(245, 245, 240, 0.2);
  background: transparent;
  border-left: 0;
  border-right: 0;
  border-top: 0;
  text-align: left;
  cursor: pointer;
  font: inherit;
  min-height: 44px;
  display: flex;
  align-items: center;
  touch-action: manipulation;
}

.mobile-copy {
  margin-top: 0.25rem;
  padding-bottom: 0.6rem;
  border-bottom: 0;
}

.topbar {
  position: fixed;
  top: 1rem;
  left: 50%;
  z-index: 25;
  display: flex;
  gap: 0.8rem;
  padding: 0.7rem 1rem;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(8px);
  transform: translateX(-50%) translateY(-140%);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.topbar-hover-area:hover ~ .topbar,
.topbar:hover {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.topbar a {
  position: relative;
  color: var(--ink);
  text-decoration: none;
  font-size: 0.95rem;
  letter-spacing: 0.16em;
  text-transform: lowercase;
  padding-bottom: 0.2rem;
  transition: color 0.25s ease, text-shadow 0.25s ease;
}

.topbar a::after {
  content: '';
  position: absolute;
  left: 0;
  right: 100%;
  bottom: 0;
  height: 1px;
  background: var(--ink);
  transition: right 0.25s ease;
}

.topbar a:hover {
  color: #ffffff;
  text-shadow: 0 0 8px rgba(245, 245, 240, 0.9), 0 0 16px rgba(245, 245, 240, 0.5);
}

.topbar a:hover::after {
  right: 0;
}

.profile-bubble {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 1rem);
  right: calc(env(safe-area-inset-right, 0px) + 1rem);
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.55rem 0.8rem;
  border-radius: 999px;
  background: rgba(10, 10, 10, 0.92);
  border: 1px solid var(--line);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(8px);
  cursor: pointer;
  color: var(--ink);
  touch-action: manipulation;
}

.profile-bubble img {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--line);
}

.profile-bubble span {
  font-size: 0.95rem;
  letter-spacing: 0.1em;
}

.discord-popup {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 4.7rem);
  right: calc(env(safe-area-inset-right, 0px) + 1rem);
  z-index: 35;
  min-width: 240px;
  padding: 0.95rem 1rem;
  border-radius: 18px;
  background: rgba(8, 8, 8, 0.95);
  border: 1px solid var(--line);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  transform: translateY(-12px) scale(0.94);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.discord-popup.active {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}

.popup-label {
  margin: 0 0 0.4rem;
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.75;
}

.popup-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
}

.popup-row span {
  font-size: 0.98rem;
  letter-spacing: 0.08em;
}

.popup-row button {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  padding: 0.5rem 0.75rem;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  touch-action: manipulation;
  min-height: 40px;
}

.popup-note {
  margin: 0.45rem 0 0;
  font-size: 0.9rem;
  opacity: 0.7;
}

.site-shell {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6rem 1.2rem 3rem;
  padding-top: calc(env(safe-area-inset-top, 0px) + 6rem);
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 3rem);
}

.hero {
  max-width: 720px;
  text-align: center;
}

.eyebrow {
  margin: 0 0 0.6rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  font-size: 0.78rem;
  opacity: 0.8;
}

.hero h1 {
  margin: 0;
  font-family: 'Cinzel Decorative', serif;
  font-size: clamp(2.6rem, 12vw, 6.2rem);
  line-height: 0.95;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  color: #ffffff;
  text-shadow: 0 0 10px rgb(255, 255, 255);
  word-break: break-word;
}

.bio {
  margin: 1.1rem auto 1.5rem;
  max-width: 540px;
  font-size: 1.15rem;
  line-height: 1.7;
  opacity: 0.95;
}

.arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  margin-bottom: 1.2rem;
  border-radius: 50%;
  border: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
  font-size: 1.3rem;
  animation: bob 1.8s ease-in-out infinite;
  transition: transform 0.2s ease;
}

.arrow:hover {
  transform: translateY(-3px);
}

@keyframes bob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

.action-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.4rem;
  margin-top: 0.8rem;
}

.link-btn {
  position: relative;
  color: var(--ink);
  text-decoration: none;
  font-size: 1rem;
  letter-spacing: 0.16em;
  text-transform: lowercase;
  padding: 0.5rem 0.2rem;
  border-bottom: 1px solid rgba(245, 245, 240, 0.7);
  transition: transform 0.2s ease, opacity 0.2s ease;
  touch-action: manipulation;
  display: inline-block;
}

.link-btn:hover {
  transform: translateY(-2px);
  opacity: 0.95;
}

@media (max-width: 700px) {
  .topbar-hover-area {
    display: none;
  }

  .menu-toggle {
    display: flex;
  }

  .mobile-menu {
    display: flex;
  }

  .topbar {
    display: none;
  }

  .profile-bubble {
    display: none;
  }

  .discord-popup {
    top: calc(env(safe-area-inset-top, 0px) + 4.1rem);
    right: calc(env(safe-area-inset-right, 0px) + 0.7rem);
    left: calc(env(safe-area-inset-left, 0px) + 0.7rem);
    min-width: unset;
  }

  .site-shell {
    padding-top: calc(env(safe-area-inset-top, 0px) + 5rem);
  }

  .action-row {
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
  }

  .link-btn {
    padding: 0.7rem 0.4rem;
    font-size: 1.05rem;
  }

  .bio {
    font-size: 1rem;
  }

  /* background-attachment: fixed causes jank/repaint issues on
     mobile browsers (especially iOS Safari), so it's disabled here */
  body {
    background-attachment: scroll;
  }
}

@media (max-width: 380px) {
  .hero h1 {
    font-size: clamp(2.2rem, 14vw, 4.5rem);
  }

  .bio {
    font-size: 0.92rem;
  }

  .site-shell {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

@media (max-height: 500px) and (orientation: landscape) {
  .site-shell {
    padding-top: calc(env(safe-area-inset-top, 0px) + 3.5rem);
    padding-bottom: 1.5rem;
  }

  .hero h1 {
    font-size: clamp(2.2rem, 8vw, 4rem);
  }

  .arrow {
    display: none;
  }
}