/* landing: the KTK emblem is the sun, each page is a planet in orbit */
body.home { height: 100svh; overflow: hidden; display: grid; grid-template-rows: auto 1fr auto; }
@media (max-height: 560px) { body.home { height: auto; min-height: 100svh; overflow: auto; } }

.home-top, .home-bottom { position: relative; z-index: 40; display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: clamp(16px, 3vw, 36px) var(--m); }
.home-bottom { align-items: flex-end; }
.home-id h1 { font-size: clamp(34px, 6.2vw, 92px); font-weight: 800; letter-spacing: -.045em; line-height: .9; }
.home-id p { margin-top: 12px; color: var(--ice); font-size: clamp(14px, 13px + .4vw, 18px); max-width: 34ch; }

.discord-ico { width: 18px; height: 18px; flex: none; fill: currentColor; }
.hint { color: var(--muted); font-size: 14px; display: flex; align-items: center; gap: 10px; }
.hint::before { content: ""; width: 28px; height: 1px; background: var(--stroke-2); }

/* ---------- the system ---------- */
.system { position: relative; z-index: 10; min-height: 0; --ps: clamp(44px, 7.4vmin, 86px); }
.orbits { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.orbits ellipse { fill: none; stroke: rgba(170, 210, 255, .16); stroke-width: 1; transition: stroke .4s, stroke-width .4s; }
.orbits ellipse.is-hot { stroke: rgba(190, 225, 255, .6); stroke-width: 1.5; }
.orbits ellipse.trail { stroke-dasharray: 2 7; stroke: rgba(170, 210, 255, .12); }

.sun { position: absolute; left: 50%; top: 50%; width: clamp(120px, 31vmin, 340px); aspect-ratio: 1; transform: translate(-50%, -50%); z-index: 50; pointer-events: none; }
.sun img { position: relative; z-index: 2; width: 100%; height: 100%; border-radius: 50%; animation: sun-bob 9s ease-in-out infinite; }
.sun::before { /* rotating corona rays */
  content: ""; position: absolute; inset: -42%; border-radius: 50%; z-index: 0;
  background: repeating-conic-gradient(from 0deg, rgba(120, 190, 255, .20) 0deg 3deg, rgba(120, 190, 255, 0) 3deg 15deg);
  -webkit-mask: radial-gradient(closest-side, transparent 52%, #000 60%, transparent 100%);
          mask: radial-gradient(closest-side, transparent 52%, #000 60%, transparent 100%);
  animation: corona 90s linear infinite;
}
.sun::after { /* breathing halo */
  content: ""; position: absolute; inset: -18%; border-radius: 50%; z-index: 1;
  background: radial-gradient(closest-side, rgba(110, 185, 255, .55), rgba(31, 111, 178, .25) 55%, rgba(31, 111, 178, 0) 75%);
  animation: halo 5s ease-in-out infinite;
}
@keyframes corona { to { transform: rotate(360deg); } }
@keyframes halo { 50% { transform: scale(1.08); opacity: .75; } }
@keyframes sun-bob { 50% { transform: translateY(-6px) rotate(1.5deg); } }

.planet {
  position: absolute; left: 0; top: 0; z-index: 60; display: flex; flex-direction: column; align-items: center; gap: 8px;
  text-decoration: none; will-change: transform; -webkit-tap-highlight-color: transparent;
}
.planet .pl { --s: var(--ps); transition: transform .45s var(--ease), filter .45s; }
.planet__label { display: grid; justify-items: center; text-align: center; line-height: 1.15; padding: 6px 12px; border-radius: 14px; transition: background-color .3s; }
.planet__label b { font-family: var(--display); font-size: clamp(12px, 1.25vmin + 5px, 17px); font-weight: 700; letter-spacing: -.01em; }
.planet__label small { font-size: 12px; color: var(--muted); max-height: 0; overflow: hidden; opacity: 0; transition: max-height .35s var(--ease), opacity .3s; }
.planet:hover .pl, .planet:focus-visible .pl { transform: scale(1.3); filter: brightness(1.15); }
.planet:hover .planet__label, .planet:focus-visible .planet__label { background: rgba(8, 22, 56, .78); }
.planet:hover small, .planet:focus-visible small { max-height: 20px; opacity: 1; margin-top: 4px; }
.planet:focus-visible { outline: none; }
.planet:focus-visible .pl { outline: 3px solid var(--sky); outline-offset: 5px; }
.planet--models .pl-wrap { --rw: 2px; }

/* no script: planets sit in a row under the sun */
html:not(.js) .planets { position: absolute; left: 0; right: 0; bottom: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 18px; }
html:not(.js) .planet { position: static; }

/* cursor stardust */
.dust { position: fixed; z-index: 70; width: 6px; height: 6px; pointer-events: none; border-radius: 50%; background: #e8f3ff;
  box-shadow: 0 0 8px #9fd0ff; animation: dust .9s ease-out forwards; }
@keyframes dust { to { transform: translate(var(--dx), var(--dy)) scale(0); opacity: 0; } }

@media (max-width: 640px) {
  .system { --ps: 40px; }
  .sun { width: 27vmin; }
  .home-top { flex-direction: column; gap: 14px; }
  .home-bottom { flex-direction: column-reverse; align-items: stretch; gap: 10px; }
  .home-bottom .pill { justify-content: center; }
  .hint { justify-content: center; }
  .planet__label { padding: 4px 8px; }
}

/* a planet lifted out from behind the sun gets a scanner frame, so seeing it "through" the sun reads as deliberate */
.planet::before { /* a porthole cut through the sun: dark window, bright rim, spinning dashed outer ring */
  content: ""; position: absolute; left: 50%; top: calc(var(--ps) / 2); width: calc(var(--ps) * 1.7); aspect-ratio: 1; z-index: -1;
  border-radius: 50%; background: radial-gradient(closest-side, #04102b 62%, rgba(2, 6, 18, .96) 100%);
  border: 2px solid #8fd0ff; outline: 2px dashed rgba(170, 220, 255, .85); outline-offset: 7px;
  box-shadow: 0 0 0 4px rgba(2, 6, 18, .7), 0 0 30px rgba(90, 180, 255, .7);
  transform: translate(-50%, -50%) scale(.6); opacity: 0; pointer-events: none; transition: opacity .3s, transform .4s var(--ease);
}
.planet::after { /* four corner ticks, like a lock-on reticle */
  content: ""; position: absolute; left: 50%; top: calc(var(--ps) / 2); width: calc(var(--ps) * 2.15); aspect-ratio: 1;
  transform: translate(-50%, -50%) scale(.7); opacity: 0; pointer-events: none; transition: opacity .3s, transform .4s var(--ease);
  background:
    linear-gradient(#e6f4ff, #e6f4ff) left top / 14px 2px no-repeat, linear-gradient(#e6f4ff, #e6f4ff) left top / 2px 14px no-repeat,
    linear-gradient(#e6f4ff, #e6f4ff) right top / 14px 2px no-repeat, linear-gradient(#e6f4ff, #e6f4ff) right top / 2px 14px no-repeat,
    linear-gradient(#e6f4ff, #e6f4ff) left bottom / 14px 2px no-repeat, linear-gradient(#e6f4ff, #e6f4ff) left bottom / 2px 14px no-repeat,
    linear-gradient(#e6f4ff, #e6f4ff) right bottom / 14px 2px no-repeat, linear-gradient(#e6f4ff, #e6f4ff) right bottom / 2px 14px no-repeat;
}
.planet.is-xray::before { opacity: 1; transform: translate(-50%, -50%) scale(1); animation: scan-spin 6s linear infinite; }
.planet.is-xray::after { opacity: 1; transform: translate(-50%, -50%) scale(1); }
@keyframes scan-spin { to { transform: translate(-50%, -50%) rotate(360deg); } }
.planet.is-xray .planet__label {
  background: rgba(4, 16, 43, .9); border: 1px solid rgba(140, 210, 255, .7); box-shadow: 0 0 22px rgba(90, 180, 255, .45);
  margin-top: calc(var(--ps) * .3);
}
.planet.is-xray .planet__label small::before { content: "Behind the sun · "; color: var(--sky); }
