/* ════════════════════════════════════════════════════════════════
   inmyhead.me — landing page styles
   Brand palette · typography · launch animation · constellation
   ════════════════════════════════════════════════════════════════ */

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

:root {
  --blue: #1B4DE0;
  --blue-lt: #4D8BFF;
  --cyan: #22E0D6;
  --gold: #FFC93C;
  --white: #EAF1FF;
}

html,
body {
  height: 100%;
}

html {
  background: #060D22;
}

body {
  background: transparent;
  font-family: 'Syne', sans-serif;
  color: var(--white);
  overflow-x: hidden;
  min-height: 100vh;
}

/* one fixed full-viewport gradient — no seam regardless of page height */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background: radial-gradient(120% 90% at 50% 0%, #0E2150 0%, #081634 40%, #060D22 75%, #060D22 100%);
}

/* drifting starfield */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background-image:
    radial-gradient(1px 1px at 20% 30%, rgba(180, 200, 255, .5), transparent),
    radial-gradient(1px 1px at 70% 60%, rgba(120, 160, 255, .4), transparent),
    radial-gradient(1px 1px at 40% 80%, rgba(180, 200, 255, .35), transparent),
    radial-gradient(1px 1px at 85% 20%, rgba(160, 190, 255, .45), transparent),
    radial-gradient(1px 1px at 55% 15%, rgba(140, 180, 255, .3), transparent);
  background-repeat: repeat;
  background-size: 600px 600px;
  opacity: .6;
  animation: drift 90s linear infinite;
}

@keyframes drift {
  from { background-position: 0 0; }
  to   { background-position: 600px 600px; }
}

/* ════════════════════════════════════════════════════════════════
   LAUNCH SEQUENCE
   ════════════════════════════════════════════════════════════════ */

#launch {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(120% 90% at 50% 0%, #0E2150 0%, #081634 40%, #060D22 75%, #060D22 100%);
  transition: opacity 1.1s ease, visibility 1.1s ease;
}

#launch.done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

#launchMark {
  width: min(78vw, 560px);
  height: auto;
  transform-origin: center;
  animation: markIntro 1.1s cubic-bezier(.2, .8, .2, 1) both;
}

@keyframes markIntro {
  0%   { opacity: 0; transform: scale(.78); }
  100% { opacity: 1; transform: scale(1); }
}

#launch.shrink #launchMark {
  animation: markShrink 1.1s cubic-bezier(.6, 0, .2, 1) forwards;
}

@keyframes markShrink {
  0%   { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(.34) translateY(-22vh); }
}

.skip {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 51;
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  letter-spacing: 3px;
  color: rgba(180, 200, 255, .45);
  background: none;
  border: 1px solid rgba(93, 155, 255, .25);
  padding: 8px 18px;
  border-radius: 30px;
  cursor: pointer;
  text-transform: uppercase;
  transition: .3s;
}

.skip:hover {
  color: var(--cyan);
  border-color: rgba(34, 224, 214, .5);
}

#launch.done .skip {
  display: none;
}

/* ════════════════════════════════════════════════════════════════
   SHELL — main app surface revealed after the launch
   ════════════════════════════════════════════════════════════════ */

#shell {
  position: relative;
  z-index: 1;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 1s ease .3s, transform 1s ease .3s;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

#shell.in {
  opacity: 1;
  transform: none;
}

header {
  display: none;
}

/* ════════════════════════════════════════════════════════════════
   HERO
   ════════════════════════════════════════════════════════════════ */

.hero {
  text-align: center;
  padding: clamp(2px, 1vh, 10px) 20px 4px;
}

.hero-logo {
  width: clamp(190px, 24vw, 300px);
  height: auto;
  display: block;
  margin: 0 auto 10px;
  overflow: visible;
}

.hero-wordmark {
  font-weight: 800;
  font-size: clamp(28px, 4.2vw, 46px);
  letter-spacing: 1px;
  cursor: pointer;
  margin-bottom: 10px;
}

.hero-wordmark .dot {
  color: var(--gold);
}

.hero .kicker {
  font-family: 'Space Mono', monospace;
  font-size: clamp(9px, 1vw, 11px);
  letter-spacing: 6px;
  color: rgba(180, 200, 255, .45);
  text-transform: uppercase;
  margin-bottom: clamp(24px, 4.5vh, 48px);
}

.hero h1 {
  font-size: clamp(26px, 4.4vw, 50px);
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -1px;
  padding-bottom: .12em;
}

.hero h1 .grad {
  background: linear-gradient(90deg, var(--blue-lt), var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ════════════════════════════════════════════════════════════════
   ORBS / CONSTELLATION
   ════════════════════════════════════════════════════════════════ */

.constellation {
  position: relative;
  width: 100%;
  max-width: 1040px;
  margin: clamp(16px, 3vh, 40px) auto auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(14px, 2.5vw, 40px);
  padding: 0 clamp(16px, 5vw, 48px) clamp(20px, 4vh, 48px);
}

.synapse {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: visible;
}

.synapse path {
  stroke: url(#synGrad);
  stroke-width: 1.4;
  fill: none;
  stroke-dasharray: 6 8;
  opacity: .4;
  animation: flow 9s linear infinite;
}

@keyframes flow {
  to { stroke-dashoffset: -140; }
}

.node {
  position: relative;
  z-index: 1;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 18px 18px;
  border-radius: 24px;
  transition: transform .45s cubic-bezier(.2, .8, .2, 1);
  -webkit-tap-highlight-color: transparent;
}

.node:hover {
  transform: translateY(-10px);
}

.node-orb {
  position: relative;
  width: clamp(120px, 15vw, 160px);
  height: clamp(120px, 15vw, 160px);
}

.node-orb svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.orb-ring {
  transform-origin: center;
  animation: spin 24s linear infinite;
}

.node:nth-child(3) .orb-ring {
  animation-direction: reverse;
  animation-duration: 30s;
}

.node:nth-child(4) .orb-ring {
  animation-duration: 20s;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.orb-skull {
  transform-origin: center;
  animation: pulse 4.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: .82; }
  50%      { opacity: 1; }
}

.node-orb::after {
  content: "";
  position: absolute;
  inset: -16%;
  border-radius: 50%;
  background: radial-gradient(circle, var(--halo, rgba(27, 77, 224, .5)) 0%, transparent 65%);
  opacity: .3;
  transition: opacity .45s, transform .45s;
  z-index: -1;
}

.node:hover .node-orb::after {
  opacity: .9;
  transform: scale(1.1);
}

.orb-solve {
  stroke-dasharray: 300;
  stroke-dashoffset: 300;
  opacity: 0;
  transition: opacity .3s;
}

.node:hover .orb-solve {
  opacity: 1;
  animation: orbSolve 2.4s ease-in-out forwards;
}

@keyframes orbSolve {
  0%   { stroke-dashoffset: 300; }
  100% { stroke-dashoffset: 0; }
}

.node h3 {
  font-size: clamp(18px, 2.4vw, 24px);
  font-weight: 800;
  letter-spacing: .5px;
}

.node-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.node .meta {
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  letter-spacing: 2px;
  color: rgba(180, 200, 255, .45);
  text-transform: uppercase;
}

.node .count {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  color: var(--accent);
  margin-top: -10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.node .count .lk {
  font-size: 10px;
}

#shell.in .node {
  animation: nodeUp .8s cubic-bezier(.2, .8, .2, 1) both;
}

#shell.in .node:nth-child(2) { animation-delay: .15s; }
#shell.in .node:nth-child(3) { animation-delay: .3s; }
#shell.in .node:nth-child(4) { animation-delay: .45s; }

@keyframes nodeUp {
  0%   { opacity: 0; transform: translateY(34px) scale(.92); }
  100% { opacity: 1; transform: none; }
}

/* ════════════════════════════════════════════════════════════════
   MODAL — content panel + login overlay
   ════════════════════════════════════════════════════════════════ */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(2, 5, 20, .72);
  backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .5s ease, visibility .5s ease;
}

.overlay.open {
  opacity: 1;
  visibility: visible;
}

.card {
  position: relative;
  width: min(680px, 94vw);
  max-height: 84vh;
  overflow: auto;
  background: linear-gradient(160deg, rgba(13, 28, 68, .94), rgba(6, 12, 33, .96));
  border: 1px solid rgba(93, 155, 255, .22);
  border-radius: 28px;
  padding: clamp(28px, 4vw, 46px);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(140, 180, 255, .15);
  transform: translateY(24px) scale(.97);
  transition: transform .5s cubic-bezier(.2, .8, .2, 1);
}

.overlay.open .card {
  transform: none;
}

.close {
  position: absolute;
  top: 18px;
  right: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(93, 155, 255, .25);
  background: rgba(2, 5, 20, .4);
  color: var(--white);
  font-size: 18px;
  cursor: pointer;
  transition: .3s;
  font-family: 'Space Mono', monospace;
}

.close:hover {
  border-color: var(--cyan);
  color: var(--cyan);
  transform: rotate(90deg);
}

.panel-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 8px;
}

.panel-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.card h2 {
  font-size: clamp(26px, 4vw, 40px);
  font-weight: 800;
  letter-spacing: -.5px;
}

.card .sub {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  letter-spacing: 3px;
  color: rgba(180, 200, 255, .5);
  text-transform: uppercase;
  margin-bottom: 26px;
}

.items {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 16px;
  background: rgba(93, 155, 255, .06);
  border: 1px solid rgba(93, 155, 255, .12);
  transition: .3s;
  cursor: pointer;
}

.item:hover {
  background: rgba(93, 155, 255, .12);
  border-color: rgba(34, 224, 214, .4);
  transform: translateX(6px);
}

.item .t {
  font-weight: 700;
  font-size: 15px;
}

.item .d {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  color: rgba(180, 200, 255, .5);
  margin-top: 3px;
}

.item .badge {
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  letter-spacing: 1px;
  padding: 4px 10px;
  border-radius: 20px;
  white-space: nowrap;
}

/* ── LOGIN ── */
.card.login-wrap {
  width: min(420px, 92vw);
  padding: clamp(26px, 3.5vw, 38px);
  max-height: none;
  overflow: visible;
}

.login-wrap {
  text-align: center;
}

#loginSkullWrap {
  width: 78px;
  height: 78px;
  margin: 2px auto 12px;
}

#loginSkullWrap svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.login-wrap h2 {
  margin-bottom: 4px;
  font-size: clamp(24px, 4vw, 32px);
}

.login-wrap .lsub {
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  letter-spacing: 2.5px;
  color: rgba(180, 200, 255, .5);
  text-transform: uppercase;
  margin-bottom: 22px;
}

.field {
  text-align: left;
  margin-bottom: 12px;
}

.field label {
  display: block;
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  letter-spacing: 2px;
  color: rgba(180, 200, 255, .55);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.field input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(93, 155, 255, .22);
  background: rgba(2, 5, 20, .5);
  color: var(--white);
  font-family: 'Space Mono', monospace;
  font-size: 13px;
  outline: none;
  transition: .3s;
}

.field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accentSoft);
}

.signin {
  width: 100%;
  margin-top: 8px;
  padding: 13px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 1px;
  color: #031026;
  background: linear-gradient(90deg, var(--accent), #fff);
  transition: .3s;
}

.signin:hover {
  filter: brightness(1.08);
  transform: translateY(-2px);
}

.lnote {
  margin-top: 14px;
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  letter-spacing: 1px;
  color: rgba(180, 200, 255, .35);
  line-height: 1.6;
}

.lnote a {
  color: var(--accent);
  text-decoration: none;
}

/* ════════════════════════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════════════════════════ */

/* tablet */
@media (max-width: 860px) {
  .hero-logo { width: clamp(170px, 30vw, 230px); }
  .constellation { gap: clamp(10px, 2vw, 24px); }
  .node-orb {
    width: clamp(108px, 16vw, 140px);
    height: clamp(108px, 16vw, 140px);
  }
}

/* mobile */
@media (max-width: 600px) {
  #shell { min-height: auto; }
  .synapse { display: none; }
  nav.top { display: none; }

  .hero { padding: 18px 18px 4px; }
  .hero-logo {
    width: min(58vw, 200px);
    margin-bottom: 12px;
  }
  .hero-wordmark { font-size: clamp(26px, 8vw, 34px); }
  .hero .kicker { margin-bottom: 24px; }
  .hero h1 {
    font-size: clamp(26px, 8vw, 38px);
    max-width: 18ch;
    margin: 0 auto;
  }

  .constellation {
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: 24px;
    padding-bottom: 36px;
  }

  .node {
    flex-direction: row;
    gap: 18px;
    justify-content: flex-start;
    text-align: left;
    padding: 12px 16px;
    background: rgba(93, 155, 255, .04);
    border: 1px solid rgba(93, 155, 255, .1);
  }

  .node:hover { transform: none; }

  .node-orb {
    width: 74px;
    height: 74px;
    flex: 0 0 auto;
  }

  .node h3 { font-size: 20px; }

  .node-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: flex-start;
  }

  .node .count { margin-top: 0; }

  .card { padding: 26px 22px; }
  .card.login-wrap { width: 94vw; }
}

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



/* ════════════════════════════════════════════════════════════════
   LAUNCH TRANSITION — skull grows from orb, maze traces, dissolves
   Inline-style driven (JS sets initial left/top/size), keyframes
   only animate transform + opacity to avoid layout fights.
   ════════════════════════════════════════════════════════════════ */

#launch-warp {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s ease, visibility .3s ease;
}

#launch-warp.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Dark veil fades in behind the skull */
#launch-warp .veil {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 50%, rgba(14, 33, 80, .85) 0%, rgba(6, 13, 34, .98) 70%);
  opacity: 0;
  z-index: 1;
}

#launch-warp.active .veil {
  animation: warpVeil 2.2s ease-out forwards;
}

@keyframes warpVeil {
  0%   { opacity: 0; }
  40%  { opacity: .5; }
  80%  { opacity: .85; }
  100% { opacity: 1; }
}

/* Halo pulses outward from launch point */
#launch-warp .halo {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, var(--warp-color, #22E0D6) 0%, transparent 60%);
  opacity: 0;
  z-index: 2;
  mix-blend-mode: screen;
  transform-origin: center center;
}

#launch-warp.active .halo {
  animation: warpHalo 2.2s ease-out forwards;
}

@keyframes warpHalo {
  0%   { opacity: 0; transform: scale(.8); }
  20%  { opacity: .85; }
  100% { opacity: 0; transform: scale(11); }
}

/* The growing skull — JS sets left/top/width/height inline.
   We ONLY animate transform + opacity to avoid clobbering JS-set positions. */
#launch-warp .grow {
  position: absolute;
  transform: translate(-50%, -50%) scale(1);
  transform-origin: center center;
  opacity: 1;
  z-index: 3;
}

#launch-warp.active .grow {
  animation: warpGrow 2.2s cubic-bezier(.4, .05, .25, 1) forwards;
}

@keyframes warpGrow {
  0%   { transform: translate(-50%, -50%) scale(1);    opacity: 1; filter: drop-shadow(0 0 6px var(--warp-color, #22E0D6)); }
  30%  { transform: translate(-50%, -50%) scale(2.5);  opacity: 1; filter: drop-shadow(0 0 14px var(--warp-color, #22E0D6)); }
  55%  { transform: translate(-50%, -50%) scale(4.5);  opacity: 1; filter: drop-shadow(0 0 22px var(--warp-color, #22E0D6)); }
  75%  { transform: translate(-50%, -50%) scale(7);    opacity: .9; filter: drop-shadow(0 0 30px var(--warp-color, #22E0D6)); }
  100% { transform: translate(-50%, -50%) scale(12);   opacity: 0; filter: blur(10px); }
}

#launch-warp .grow svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  display: block;
}

#launch-warp .grow .solve-trace {
  stroke-dasharray: 260;
  stroke-dashoffset: 260;
}

#launch-warp.active .grow .solve-trace {
  animation: solveTrace 1.4s cubic-bezier(.4, .1, .25, 1) .15s forwards;
}

@keyframes solveTrace {
  to { stroke-dashoffset: 0; }
}

/* Dim landing page underneath while warping */
body.warping #shell {
  filter: blur(3px) brightness(.4);
  transition: filter .5s ease;
}

@media (prefers-reduced-motion: reduce) {
  #launch-warp.active .veil,
  #launch-warp.active .grow,
  #launch-warp.active .halo,
  #launch-warp.active .grow .solve-trace {
    animation-duration: .01ms !important;
  }
}
