/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
  height: 100vh;
  height: 100dvh;
}
a { color: inherit; text-decoration: none; }

/* FOUT prevention */
.fonts-loading * { visibility: hidden; }
.fonts-loaded * { visibility: visible; }

/* Text selection */
::selection {
  background: rgba(0, 85, 255, 0.3);
  color: var(--text);
}

/* Film grain overlay */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

/* Page loader */
.page-loader {
  position: fixed;
  inset: 0;
  background: #0A0A0A;
  z-index: var(--z-loader);
  display: grid;
  place-items: center;
}

.loader-monogram {
  font-family: 'DM Mono', monospace;
  font-weight: 500;
  font-size: 48px;
  letter-spacing: 0.3em;
  color: var(--blue);
  display: inline-flex;
  align-items: baseline;
}

.loader-z {
  opacity: 0;
  transform: translateX(-40px);
}

.loader-k {
  opacity: 0;
  transform: translateX(40px);
}

/* Canvas — full viewport */
#node-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
}

.canvas-fallback {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(0,85,255,0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 30%, rgba(201,168,76,0.05) 0%, transparent 50%),
    #0A0A0A;
}

/* ZK mark — top left */
.holding-mark {
  position: fixed;
  top: 28px;
  left: var(--content-pad, 40px);
  z-index: 10;
  font-family: 'DM Mono', monospace;
  font-weight: 500;
  font-size: 20px;
  color: var(--blue);
  letter-spacing: 0.1em;
  opacity: 0;
  transition: letter-spacing 0.3s ease, text-shadow 0.3s ease;
}

.holding-mark:hover {
  letter-spacing: 0.2em;
  text-shadow: 0 0 20px rgba(0, 85, 255, 0.5);
}

/* Center content */
.holding-content {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  text-align: center;
  pointer-events: none;
}

.holding-name {
  font-family: 'Instrument Serif', Georgia, serif;
  font-weight: 400;
  font-style: italic;
  font-size: clamp(52px, 11vw, 152px);
  letter-spacing: -0.02em;
  line-height: 0.88;
  color: var(--text);
}

.name-line {
  display: inline-block;
  overflow: hidden;
  line-height: 1;
  padding: 0 0.08em;
  margin: 0 -0.08em;
}

.name-inner {
  display: inline-block;
  transform: translateY(110%);
}

.holding-title {
  font-family: var(--font-body);
  font-size: clamp(11px, 1.2vw, 14px);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 28px;
  opacity: 0;
}

/* Bottom contact */
.holding-contact {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 24px;
  opacity: 0;
}

.holding-contact a {
  color: var(--muted);
  transition: color 0.3s ease, transform 0.3s ease;
  display: flex;
  align-items: center;
  padding: 8px;
}

.holding-contact a:hover {
  color: var(--text);
  transform: translateY(-2px);
}

/* Focus states */
:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .name-inner {
    transform: none !important;
  }

  .holding-title,
  .holding-contact,
  .holding-mark {
    opacity: 1 !important;
  }
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .holding-mark {
    left: 24px;
  }

  .holding-contact {
    bottom: 32px;
  }
}

/* Print */
@media print {
  .page-loader, #node-canvas { display: none !important; }
  body { background: white; color: black; overflow: visible; height: auto; }
  .holding-content { position: static; transform: none; }
  .holding-name { color: black; }
}
