html, body {
  margin: 0;
  padding: 0;
  background: #020409;
  color: #e6ecf2;
  font-family: 'Oxanium', sans-serif;
  overflow: hidden;
}

/* Logo */
.logo {
  position: absolute;
  top: 28px;
  left: 40px;
  width: 48px;
  opacity: 0.8;
  z-index: 10;
  filter: drop-shadow(0 0 6px rgba(120,180,255,0.15));
}

/* Content */
.content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -48%);
  text-align: center;
  max-width: 680px;
  padding: 0 20px;
  z-index: 5;

  opacity: 0;

  transition: opacity 1.2s ease, transform 1.2s ease;
}

.content.visible {
  opacity: 1;
  transform: translate(-50%, -50%);
}

/* Hide content when modal opens */
body.modal-open .content {
  opacity: 0;
  transform: translate(-50%, -46%);
  pointer-events: none;
  transition: opacity 0.6s ease, transform 0.6s ease;
}

/* Headline */
h1 {
  font-family: 'Iceland', sans-serif;
  font-size: 42px;
  font-weight: 400;
  letter-spacing: 0.08em;
  margin-bottom: 20px;

  opacity: 0;
  transform: translateY(6px);

  transition: all 1s ease 1.7s;
}

.content.visible h1 {
  opacity: 1;
  transform: translateY(0);
}

/* Body Text */
p {
  font-family: 'Oxanium', sans-serif;
  font-size: 17.5px;
  font-weight: 300;
  letter-spacing: 0.035em;
  line-height: 1.7;

  opacity: 0;

  max-width: 520px;
  margin: 0 auto 14px;

  transition: opacity 1s ease 2.4s;
}

.content.visible p {
  opacity: 0.55;
}

/* Meta line */
.meta {
  font-family: 'Oxanium', sans-serif;
  font-size: 11px;
  letter-spacing: 0.25em;

  opacity: 0;

  margin-top: 24px;

  transition: opacity 1s ease 2.9s;
}

.content.visible .meta {
  opacity: 0.35;
}

/* Three.js container */
#bg {
  position: fixed;
  width: 100%;
  height: 100%;
  z-index: 0;
  transition: opacity 0.6s ease;
}

/* ✅ CRITICAL FIX: allow clicks through canvas */
#bg canvas {
  pointer-events: none;
}

/* ========= MODAL BUTTON ========= */

#contactBtn {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);

  padding: 10px 22px;

  font-family: 'Oxanium', sans-serif;
  font-size: 11px;
  letter-spacing: 0.2em;

  color: rgba(230,236,242,0.55);
  background: transparent;
  border: 1px solid rgba(140,200,255,0.18);

  cursor: pointer;
  z-index: 10;

  opacity: 0;
  transition: opacity 1s ease;
}

#contactBtn.visible {
  opacity: 1;
}

#contactBtn:hover {
  color: rgba(230,236,242,1);
  border-color: rgba(140,200,255,0.5);
}

/* ========= MODAL ========= */

#contactModal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;

  background: rgba(2,4,9,0.97);

  justify-content: center;
  align-items: center;

  display: none;        /* ✅ fully removed when inactive */
  opacity: 0;           /* ✅ needed for smooth fade */

  transition: opacity 0.8s ease;

  z-index: 999;
}

#contactModal.active {
  display: flex;        /* ✅ only becomes flex when active */
  opacity: 1;
}

/* Modal content */
.modal-content {
  width: 320px;
  text-align: center;

  opacity: 0;
  transform: translateY(10px);

  transition: all 1s ease;

  pointer-events: none;
}

#contactModal.active .modal-content {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* Modal title */
.modal-content h2 {
  font-family: 'Iceland', sans-serif;
  letter-spacing: 0.08em;
  margin-bottom: 20px;

  opacity: 0;
  transform: translateY(6px);

  transition: all 0.8s ease 0.4s;
}

#contactModal.active h2 {
  opacity: 1;
  transform: translateY(0);
}

/* Inputs */
.modal-content input,
.modal-content textarea {
  width: 100%;
  padding: 10px;
  margin-bottom: 12px;

  background: transparent;
  border: 1px solid rgba(255,255,255,0.15);
  color: #e6ecf2;

  font-family: 'Oxanium', sans-serif;
  font-size: 13px;

  opacity: 0;

  transition: opacity 0.8s ease 0.8s;
}

#contactModal.active input,
#contactModal.active textarea {
  opacity: 1;
}

textarea {
  min-height: 110px;
  resize: none;
}

/* Submit button */
.modal-content button {
  margin-top: 10px;
  padding: 10px;

  border: 1px solid rgba(140,200,255,0.3);
  background: transparent;
  color: white;

  letter-spacing: 0.15em;
  font-size: 12px;

  cursor: pointer;

  opacity: 0;

  transition: opacity 0.8s ease 1.2s;
}

#contactModal.active button {
  opacity: 1;
}

/* Success message */
#successView p {
  font-size: 14px;
  line-height: 1.6;
  opacity: 0.55;
  letter-spacing: 0.03em;
}

/* ========= MODAL FOCUS EFFECT ========= */

body.modal-open #bg {
  opacity: 0.25;
}

body.modal-open #bg canvas {
  filter: blur(4px);
  transition: filter 0.6s ease;
}
