/* Outer master frame */
.page-frame {
  width: min(1150px, calc(100% - 2rem));
  margin: 2rem auto;
  padding: 1.5rem;
  background: #161022;
  border: 8px ridge #646BD9;
  position: relative;
}

/* Header Panel */
.header-panel {
  display: grid;
  grid-template-columns: 120px 1fr;
  overflow: hidden;
  background-image: url('../images/stars.gif');
  border: 8px ridge #646BD9;
  box-shadow: inset 0 0 0 6px #161022;
}

.logo{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border: 8px solid #161022;
}

.logo-box{
  width: 120px;
  height: 100%;
  background: #000;
  border: 8px ridge #646BD9;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 0 6px #161022;
}

.logo-title{
  margin: 0;
  letter-spacing: 0.03em;
  text-shadow: none;
}

.logo-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 1rem 1.25rem;
  text-align: left;
}

.logo-title .citybar {
  color: #646BD9;
}

/* Stack layout */
.home-stack{
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

/* 2-up on desktop, stack on mobile */
.nav-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 800px) {
  .nav-row {
    grid-template-columns: 1fr;
  }
}

/* Dropdown button */
.drop-btn {
  width: 100%;
  background-image: url('../images/stars.gif');
  border: 2px solid #646BD9;
  color: white;
  font-family: inherit;
  font-size: 2rem;
  padding: 0.75rem 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  box-shadow: inset 0 0 0 6px #161022;
}

.drop-btn:active {
  transform: translateY(1px);
}

.drop-btn:hover {
  border-color: #FF2FCB;
  color: #FF2FCB;
}

.drop-btn:hover .drop-caret {
  color: #FF2FCB;
}

.drop-btn:focus {
  outline: none;
}

.drop-btn:focus-visible {
  outline: 3px solid #FF2FCB;
  outline-offset: 2px;
}

.drop-caret {
  font-size: 1.5rem;
  line-height: 1;
}

/* Dropdown menu */
.drop-menu {
  height: 0;
  overflow: hidden;
  opacity: 0;
  transform: none;
  transition: height 220ms ease, opacity 160ms ease, transform 200ms ease;
  will-change: height;
}

.drop-menu.is-open {
  opacity: 1;
  transform: translateY(0);
}

.drop-menu-inner {
  margin-top: 0.5rem;
  padding: 0.75rem;
  display: grid;
  gap: 0.75rem;
  box-shadow: inset 0 0 0 6px #161022;
  transform: translateZ(0);
  -webkit-font-smoothing: none;
  text-rendering: geometricPrecision;
}

/* Links */
.drop-menu a {
  display: block;
  text-decoration: none;
  color: white;
  padding: 0.75rem 1rem;
  border: 2px solid #646BD9;
  background-image: url('../images/stars.gif');
  text-align: center;
  font-size: 1.7rem;
}

.drop-menu a:focus {
  outline: none;
}

/* Keyboard-only focus style */
.drop-menu a:focus-visible {
  outline: 3px solid #FF2FCB;
  outline-offset: 2px;
}

/* Hover state */
.drop-menu a:hover {
  border-color: #FF2FCB;
  color: #FF2FCB;
}

/* Settings buttons */
.drop-item {
  display: block;
  width: 100%;
  background: transparent;
  border: none;
  color: white;
  font: inherit;
  font-size: 2rem;
  padding: 0.6rem 1rem;
  text-align: center;
  cursor: pointer;
  appearance: none;
}

/* Remove default button focus */
.drop-item:focus {
  outline: none;
}

.drop-item[data-state="on"] {
  color: #FF2FCB;
}

#bouncyBall {
  position: fixed;
  left: 40px;
  top: 60%;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: url("../images/basketball.gif") center/cover no-repeat;
  cursor: grab;
  z-index: 9500;
  user-select: none;
}

/* Rain layer */
.rain-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9000;
  overflow: hidden;
}

.raindrop {
  position: absolute;
  top: -30px;
  width: 2px;
  height: 18px;
  background: rgba(255, 255, 255, 0.65);
  transform: rotate(20deg);
  animation: rain-fall linear forwards;
}

@keyframes rain-fall {
  to { transform: rotate(20deg) translateY(120vh); }
}

/* CRT Scanlines */
body.crt-on::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  mix-blend-mode: overlay;
  opacity: 0.65;

  background:
  radial-gradient(ellipse at center,
    rgba(0,0,0,0) 60%,
    rgba(0,0,0,0.25) 100%
  ),
  repeating-linear-gradient(
    0deg,
    rgba(0,0,0,0.30) 0px,
    rgba(0,0,0,0.30) 2px,
    rgba(0,0,0,0.0) 2px,
    rgba(0,0,0,0.0) 4px
  );
}

/* Contact form styles */
.contact-panel {
  background: #161022;
  border: 8px ridge #646BD9;
  padding: 1.25rem 1.5rem;
  display: grid;
  gap: 1rem;
}

.contact-panel h2 {
  margin: 0 0 0.5rem 0;
  color: #fff;
  text-align: left;
}

#contact-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 1.25rem;
  align-items: start;
}

.form-row {
  display: flex;
  flex-direction: column;
}

.form-row label {
  font-size: 1rem;
  color: #fff;
  margin-bottom: 0.35rem;
}

.form-row input[type="text"],
.form-row input[type="email"],
.form-row input[type="tel"],
.form-row textarea {
  background-image: url('../images/stars.gif');
  background-color: rgba(0,0,0,0.55);
  border: 2px solid #646BD9;
  color: #fff;
  padding: 0.6rem 0.8rem;
  font-size: 1rem;
  border-radius: 4px;
  box-shadow: inset 0 0 0 6px #161022;
  resize: vertical;
}

.form-row textarea {
  min-height: 140px;
  grid-column: 1 / -1;
}

.form-row button[type="submit"] {
  background-image: url('../images/stars.gif');
  border: 2px solid #646BD9;
  color: white;
  padding: 0.75rem 1rem;
  font-size: 1.1rem;
  cursor: pointer;
  justify-self: start;
}

.form-row button[type="submit"]:hover {
  border-color: #FF2FCB;
  color: #FF2FCB;
}

/* Focus styles for accessibility */
#contact-form input:focus,
#contact-form textarea:focus,
#contact-form button:focus {
  outline: none;
}

#contact-form input:focus-visible,
#contact-form textarea:focus-visible,
#contact-form button:focus-visible {
  outline: 3px solid #FF2FCB;
  outline-offset: 2px;
}

/* Make form single-column on small screens */
@media (max-width: 800px) {
  #contact-form {
    grid-template-columns: 1fr;
  }

  .form-row textarea {
    grid-column: auto;
  }
}

/* Small utility spacing */
.contact-panel .full-width {
  grid-column: 1 / -1;
}
