/* ============================================================
   LOVECRAFT APPS — splash styles
   palette: void black, pale bone, eldritch cyan, necrotic green
   ============================================================ */

:root {
  --void: #05040a;
  --void-2: #0a0812;
  --bone: #e5dfcf;
  --bone-dim: #a8a292;
  --cyan: #8ec9d6;
  --necro: #7dd3aa;
  --violet: #7b5fb0;
  --edge: rgba(142, 201, 214, 0.18);
  --glass: rgba(10, 10, 18, 0.38);
  --glass-strong: rgba(10, 10, 18, 0.62);
  --serif: 'Spectral', 'EB Garamond', Georgia, serif;
  --display: 'Cinzel', 'Trajan Pro', serif;
}

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

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--void);
  color: var(--bone);
  font-family: var(--serif);
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  position: relative;
  min-height: 100vh;
  cursor: crosshair;
}

/* ---------- background canvas layers ---------- */

#bg-canvas, #fx-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}

#bg-canvas { z-index: 0; }
#fx-canvas { z-index: 1; }

.vignette {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(ellipse at center,
      transparent 35%,
      rgba(5, 4, 10, 0.55) 75%,
      rgba(5, 4, 10, 0.92) 100%);
  mix-blend-mode: multiply;
}

.scanlines {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 2px,
    rgba(255, 255, 255, 0.012) 3px,
    transparent 4px
  );
  mix-blend-mode: overlay;
  opacity: 0.6;
}

/* ---------- stage ---------- */

.stage {
  position: relative;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  padding: clamp(2rem, 5vh, 4rem) clamp(1.25rem, 4vw, 3rem);
  gap: clamp(0.6rem, 2vh, 1.6rem);
  pointer-events: none;
}

.stage > * { pointer-events: auto; }

/* ---------- mark (logo area) ---------- */

.mark {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-top: clamp(0.5rem, 5vh, 3.5rem);
  gap: 1.1rem;
}

.mark-sigil {
  width: clamp(86px, 10vw, 120px);
  color: var(--cyan);
  opacity: 0.85;
  filter: drop-shadow(0 0 12px rgba(142, 201, 214, 0.38));
  animation: sigil-breathe 6s ease-in-out infinite;
}

.mark-sigil svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}

.mark-sigil .sigil-outer,
.mark-sigil .sigil-mid,
.mark-sigil .sigil-inner,
.mark-sigil .sigil-eye {
  transform-origin: 60px 60px;
  transform-box: view-box;
}

.mark-sigil .sigil-outer { animation: sigil-rotate-cw  44s linear infinite; }
.mark-sigil .sigil-mid   { animation: sigil-rotate-ccw 26s linear infinite; }
.mark-sigil .sigil-inner { animation: sigil-rotate-cw  14s linear infinite; }
.mark-sigil .sigil-eye   { animation: sigil-blink 7.3s steps(1, end) infinite; }

@keyframes sigil-rotate-cw  { to { transform: rotate(360deg);  } }
@keyframes sigil-rotate-ccw { to { transform: rotate(-360deg); } }

@keyframes sigil-breathe {
  0%, 100% { opacity: 0.7;  filter: drop-shadow(0 0 9px  rgba(142, 201, 214, 0.28)); }
  50%      { opacity: 1.0;  filter: drop-shadow(0 0 20px rgba(142, 201, 214, 0.6));  }
}

@keyframes sigil-blink {
  0%, 93%, 100% { opacity: 1; }
  95%           { opacity: 0.18; }
  97%           { opacity: 1; }
}

/* wordmark — the actual H1 text gets hidden visually but kept accessible;
   the particle canvas draws the visible wordmark aligned to this element's rect */
.wordmark {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: 0.24em;
  font-size: clamp(1.5rem, 4.4vw, 3.0rem);
  color: transparent;
  text-transform: uppercase;
  margin: 0.4rem 0 0;
  user-select: none;
  white-space: nowrap;
}

.tagline {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(0.95rem, 1.4vw, 1.15rem);
  color: var(--bone-dim);
  letter-spacing: 0.12em;
  text-align: center;
  margin: 0;
  padding-top: 0.6rem;
  opacity: 0;
  animation: fade-in 2.4s ease-out 1.4s forwards;
  text-shadow: 0 0 20px rgba(5, 4, 10, 0.9), 0 0 6px rgba(5, 4, 10, 0.8);
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 0.9; transform: translateY(0); }
}

/* ---------- panels ---------- */

.panels {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
  width: 100%;
  max-width: 820px;
  margin-top: auto;
  margin-bottom: 2rem;
}

@media (min-width: 780px) {
  .panels {
    grid-template-columns: 1.35fr 1fr;
    gap: 1.25rem;
    margin-top: clamp(3rem, 10vh, 6rem);
  }
}

.panel,
.links {
  background: var(--glass);
  backdrop-filter: blur(14px) saturate(130%);
  -webkit-backdrop-filter: blur(14px) saturate(130%);
  border: 1px solid var(--edge);
  border-radius: 14px;
  padding: 1.4rem 1.5rem;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.03) inset,
    0 20px 60px -30px rgba(0,0,0,0.85);
  opacity: 0;
  transform: translateY(14px);
  animation: panel-in 1.4s ease-out 1.0s forwards;
}

.panel { animation-delay: 0.9s; }
.links { animation-delay: 1.1s; }

@keyframes panel-in {
  to { opacity: 1; transform: translateY(0); }
}

.panel h2 {
  font-family: var(--display);
  font-weight: 500;
  font-size: 1.05rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 0.75rem;
}

.panel p {
  font-size: 0.98rem;
  line-height: 1.6;
  color: var(--bone);
  margin-bottom: 0.7rem;
}

.panel p:last-child { margin-bottom: 0; }

.panel .whisper {
  font-style: italic;
  color: var(--bone-dim);
  font-size: 0.88rem;
  letter-spacing: 0.04em;
  margin-top: 0.9rem;
  padding-top: 0.9rem;
  border-top: 1px dashed rgba(229, 223, 207, 0.12);
}

/* ---------- link list ---------- */

.links {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.65rem 0.75rem;
}

.links a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 0.85rem;
  color: var(--bone);
  text-decoration: none;
  border-radius: 9px;
  transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

.links a span {
  font-family: var(--display);
  font-size: 0.86rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cyan);
}

.links a em {
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.85rem;
  color: var(--bone-dim);
  text-align: right;
}

.links a:hover,
.links a:focus-visible {
  background: rgba(142, 201, 214, 0.08);
  color: var(--bone);
  outline: none;
  transform: translateX(2px);
}

.links a:hover span,
.links a:focus-visible span { color: var(--necro); }

/* ---------- colophon ---------- */

.colophon {
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--bone-dim);
  opacity: 0.55;
  display: flex;
  gap: 0.6rem;
  align-items: center;
  margin-top: 1rem;
}

.colophon .dot { opacity: 0.5; }

/* ---------- tablets & mobile ---------- */

@media (max-width: 779px) {
  html, body { overflow-y: auto; overflow-x: hidden; }
  body { cursor: default; } /* custom cursor feels weird on touch */
  .stage {
    min-height: 100vh;
    justify-content: flex-start;
    padding-bottom: 0.75rem;
  }
  .mark { margin-top: 1.5rem; gap: 0.9rem; }
  .mark-sigil { width: clamp(72px, 22vw, 100px); }
  .wordmark { font-size: clamp(1.4rem, 8vw, 2.2rem); letter-spacing: 0.2em; }
  .tagline  { font-size: 0.95rem; padding-top: 0.4rem; }
  /* push panels well below the wordmark so particles don't get covered */
  .panels { margin-top: clamp(2.75rem, 11vh, 7.5rem); margin-bottom: 0.75rem; }
  .colophon { margin-top: 0.25rem; font-size: 0.7rem; gap: 0.4rem; }
}

@media (max-width: 480px) {
  .mark { margin-top: 1rem; }
  .panels { margin-top: clamp(2.25rem, 9vh, 5.5rem); margin-bottom: 0.5rem; }
  .colophon { flex-direction: column; gap: 0.15rem; margin-top: 0.15rem; font-size: 0.68rem; }
  .colophon .dot { display: none; }
  .panel, .links { padding: 1.1rem 1.15rem; }
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .mark-sigil { animation: none; }
  .tagline, .panel, .links { animation: none; opacity: 1; transform: none; }
}

/* ---------- legal page shared styles ---------- */

body.legal {
  overflow-y: auto;
  overflow-x: hidden;
  cursor: default;
  /* static cosmic gradient in lieu of live shader — no distraction behind legal text */
  background:
    radial-gradient(ellipse 1200px 700px at 20% 10%, rgba(123, 95, 176, 0.16), transparent 60%),
    radial-gradient(ellipse 1000px 600px at 85% 30%, rgba(142, 201, 214, 0.10), transparent 55%),
    radial-gradient(ellipse 900px  900px at 60% 90%, rgba(125, 211, 170, 0.08), transparent 60%),
    linear-gradient(180deg, #06050c 0%, #090712 50%, #05040a 100%);
  background-attachment: fixed;
}

/* legal pages have no canvases — hide rules still apply defensively */
body.legal #bg-canvas,
body.legal #fx-canvas { display: none; }

body.legal .stage {
  min-height: auto;
  align-items: stretch;
  max-width: 780px;
  margin: 0 auto;
  padding: 3rem 1.5rem 6rem;
}

body.legal .mark {
  margin-top: 1rem;
  flex-direction: row;
  gap: 1rem;
  align-items: center;
  justify-content: center;
}
body.legal .mark-sigil { width: 56px; }
body.legal .wordmark {
  color: var(--bone);
  font-size: 1.3rem;
  letter-spacing: 0.22em;
  margin: 0;
}

body.legal .legal-content {
  background: var(--glass-strong);
  backdrop-filter: blur(18px) saturate(130%);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
  border: 1px solid var(--edge);
  border-radius: 14px;
  padding: 2.25rem clamp(1.25rem, 4vw, 2.5rem);
  margin-top: 2rem;
  line-height: 1.7;
}

body.legal .legal-content h1 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.6rem, 3.4vw, 2.2rem);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cyan);
  text-align: center;
  margin-bottom: 0.5rem;
}

body.legal .legal-content .subtitle {
  text-align: center;
  color: var(--bone-dim);
  font-style: italic;
  font-size: 0.92rem;
  margin-bottom: 2rem;
}

body.legal .legal-content h2 {
  font-family: var(--display);
  font-weight: 500;
  font-size: 1rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--necro);
  margin: 2rem 0 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid rgba(125, 211, 170, 0.18);
}

body.legal .legal-content h3 {
  font-family: var(--display);
  font-weight: 500;
  font-size: 0.88rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cyan);
  margin: 1.3rem 0 0.5rem;
}

body.legal .legal-content p,
body.legal .legal-content li {
  font-size: 0.96rem;
  color: var(--bone);
  margin-bottom: 0.85rem;
}

body.legal .legal-content ul { padding-left: 1.25rem; margin-bottom: 1rem; }
body.legal .legal-content li { margin-bottom: 0.4rem; }

body.legal .legal-content a {
  color: var(--cyan);
  text-decoration: none;
  border-bottom: 1px dotted rgba(142, 201, 214, 0.4);
  transition: color 0.2s, border-color 0.2s;
}

body.legal .legal-content a:hover {
  color: var(--necro);
  border-bottom-color: var(--necro);
}

body.legal .legal-content .highlight {
  background: rgba(142, 201, 214, 0.06);
  border-left: 3px solid var(--cyan);
  padding: 0.9rem 1.1rem;
  margin: 1rem 0;
  border-radius: 0 8px 8px 0;
  font-size: 0.93rem;
}

body.legal .legal-content .contact {
  background: rgba(125, 211, 170, 0.06);
  border: 1px solid rgba(125, 211, 170, 0.22);
  padding: 1rem 1.2rem;
  border-radius: 10px;
  margin-top: 2rem;
  font-size: 0.92rem;
}

body.legal .back-link {
  display: inline-block;
  margin-top: 1.5rem;
  color: var(--bone-dim);
  font-family: var(--display);
  font-size: 0.78rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  text-decoration: none;
  transition: color 0.2s;
}

body.legal .back-link:hover { color: var(--cyan); }
