@font-face {
  font-family: 'DMSerifItalic';
  src: url('./DMSerifDisplay-Italic.ttf') format('truetype');
  font-style: italic;
  font-weight: 400;
}

:root {
  --bg: #050505;
  --text: #efe6d2;
  --muted: rgba(239, 230, 210, 0.55);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif;
  user-select: none;
  -webkit-user-select: none;
}

.grain {
  position: fixed;
  inset: -200%;
  background-image: radial-gradient(circle, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 3px 3px;
  opacity: 0.08;
  animation: grainMove 8s steps(10) infinite;
  pointer-events: none;
  z-index: 1;
}

.vignette {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at center, transparent 35%, rgba(0,0,0,0.5) 100%);
  pointer-events: none;
  z-index: 2;
}

.cursor-glow {
  position: fixed;
  top: 0;
  left: 0;
  width: 450px;
  height: 450px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(239, 230, 210, 0.035) 0%, transparent 70%);
  pointer-events: none;
  z-index: 3;
  will-change: transform;
}

.scene {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1000px;
  z-index: 4;
}

/* FIXED BOX MODEL MODEL: Absolute centering overlay with explicit zero anchors */
.layer {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: auto;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  will-change: transform;
  transform-style: preserve-3d;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.id-title {
  top: 12vh;
  transform: translate(-50%, 0);
}

h1 {
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.5rem;
  text-transform: uppercase;
  text-indent: 0.5rem;
  white-space: nowrap;
  opacity: 0;
  animation: appleFadeIn 1.5s cubic-bezier(0.25, 1, 0.5, 1) forwards;
  animation-delay: 0.2s;
}

.id-soon {
  top: 50%;
  transform: translate(-50%, -50%);
}

h2 {
  font-family: 'DMSerifItalic', serif;
  font-size: clamp(4.5rem, 11vw, 7.5rem);
  font-style: italic;
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: -0.01em;
  text-align: center;
  max-width: 100vw;
  padding-inline: 48px;
  opacity: 0;
  animation: appleFadeIn 1.8s cubic-bezier(0.25, 1, 0.5, 1) forwards;
  animation-delay: 0.5s;
}

.bottom-ui {
  position: absolute;
  bottom: 8vh;
  left: 50%;
  transform: translate(-50%, 0);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  will-change: transform;
  pointer-events: none;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text);
  box-shadow: 0 0 14px rgba(239, 230, 210, 0.6);
  opacity: 0;
  cursor: pointer;
  pointer-events: auto;
  animation: 
    appleFadeIn 1.5s cubic-bezier(0.25, 1, 0.5, 1) forwards,
    pulseGlow 4s ease-in-out infinite;
  animation-delay: 1s, 2.5s;
}

.email {
  font-size: 0.75rem;
  letter-spacing: 0.12rem;
  color: var(--muted);
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transform: translateY(5px);
  transition: opacity 0.6s cubic-bezier(0.25, 1, 0.5, 1), 
              transform 0.6s cubic-bezier(0.25, 1, 0.5, 1),
              visibility 0.6s;
}

.email.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.motion-gate {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.8s cubic-bezier(0.25, 1, 0.5, 1), visibility 0.8s;
}

.motion-gate button {
  background: transparent;
  border: 1px solid rgba(239, 230, 210, 0.15);
  color: var(--text);
  font-size: 0.75rem;
  letter-spacing: 0.15rem;
  text-transform: uppercase;
  padding: 14px 28px;
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.3s, background-color 0.3s;
}

.motion-gate button:active {
  background: rgba(239, 230, 210, 0.04);
  border-color: rgba(239, 230, 210, 0.5);
}

.motion-gate.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

@keyframes appleFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 12px rgba(239, 230, 210, 0.5); }
  50% { box-shadow: 0 0 22px rgba(239, 230, 210, 0.95); }
}

@keyframes grainMove {
  0% { transform: translate(0,0); }
  25% { transform: translate(-1%, 2%); }
  50% { transform: translate(2%, -1%); }
  75% { transform: translate(-2%, 1%); }
  100% { transform: translate(0,0); }
}

@media (max-width: 768px) {
  h1 { font-size: 0.72rem; letter-spacing: 0.38rem; text-indent: 0.38rem; }
  h2 { font-size: clamp(3.5rem, 15vw, 5.5rem); padding-inline: 24px; }
  .bottom-ui { bottom: 7vh; }
  .email { font-size: 0.68rem; }
  .cursor-glow { display: none !important; }
}

/* Precise Link Styling Overrides */
a.email {
  color: var(--muted);
  text-decoration: none;
  pointer-events: auto; /* CRITICAL: Allows the link to be tapped/clicked */
  transition: color 0.4s cubic-bezier(0.25, 1, 0.5, 1),
              opacity 0.6s cubic-bezier(0.25, 1, 0.5, 1), 
              transform 0.6s cubic-bezier(0.25, 1, 0.5, 1),
              visibility 0.6s;
}

a.email:hover {
  color: var(--text); /* Gently highlights to full cream-gold on mouse hover */
}
