/* Shared rules for the static build (page-specific styles live in each page's <style>). */
[data-if][hidden] { display: none !important; }
.fm-hp { position: absolute !important; left: -9999px !important; width: 1px !important; height: 1px !important; opacity: 0 !important; }
.fm-err { margin: 0; padding: 12px 14px; border-radius: 12px; background: rgba(255, 94, 87, .12); color: #FFB3AE; font-size: 14px; }
.fm-err a { color: #FFD7D4; }
.fm-send[disabled] { opacity: .6; cursor: progress; }
.fm label.fm-ok a { color: inherit; text-decoration: underline; }

.ck { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 90; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; max-width: 760px; margin: 0 auto; box-sizing: border-box; padding: 18px 20px; border: 1px solid rgba(255, 255, 255, .16); border-radius: 20px; background: rgba(11, 14, 38, .94); color: #E3E6F5; font: 15px/1.45 "Golos Text", system-ui, sans-serif; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.ck p { flex: 1 1 320px; margin: 0; }
.ck a { color: #FFC36A; }
.ck-b { display: flex; flex-wrap: wrap; gap: 10px; }
.ck button { min-height: 44px; padding: 0 20px; border-radius: 999px; font: inherit; font-weight: 600; cursor: pointer; }
.ck .ck-yes { border: 0; background: #FFC36A; color: #0A0D24; }
.ck .ck-no { border: 1px solid #4A5296; background: transparent; color: #F2F3FA; }
.ck button:focus-visible { outline: 2px solid #FFC36A; outline-offset: 3px; }
body.has-ck .snd { bottom: 120px; }
@media (max-width: 640px) { body.has-ck .snd { bottom: 190px; } }

/* ---- Safari / iPhone fixes */
/* WebKit drops the round clip when the clipped element animates a filter, so the sun turned square. Clip with clip-path and keep the glow on the parent. */
.sun-ball { clip-path: circle(50%); -webkit-clip-path: circle(50%); -webkit-mask-image: -webkit-radial-gradient(white, black); isolation: isolate; box-shadow: none !important; animation: none !important; }
.sun { border-radius: 50%; box-shadow: 0 0 2cqw .3cqw rgba(255, 220, 130, .95), 0 0 7cqw 1.6cqw rgba(255, 140, 40, .55); animation: simmer 5s ease-in-out infinite; }
.ball { clip-path: circle(50%); -webkit-clip-path: circle(50%); }
/* On touch screens :hover sticks after a tap and froze the orbits; pause on hover only where a real pointer exists. */
@media (hover: none) { .sys:hover .sat, .sys:hover .sat-y, .sys:hover .sat-d { animation-play-state: running !important; } }
/* Orbits, planet rotation and the sun are slow ambient motion: keep them on with "Reduce motion", only slowed down. Fast effects (comets, rockets) stay paused. */
@media (prefers-reduced-motion: reduce) {
  .sat, .sat-y, .sat-d, .skin, .sun, .sun-halo { animation-play-state: running !important; }
}

/* ---- Phone layout */
@media (max-width: 640px) {
  header { position: relative; padding: 12px 0 4px !important; gap: 0 !important; }
  header nav { width: 100%; justify-content: space-between; gap: 0 12px !important; }
  header nav a { font-size: 15px; }
  header nav a[href="#contact"] { position: absolute; top: 12px; right: 0; min-height: 40px !important; padding: 0 16px !important; font-size: 15px; }
  /* Moon captions overlap on a narrow screen: keep only the highlighted "your …" ones. */
  .mlbl:not(.lime):not(.cyan) { display: none; }
}

/* ---- Home: the planets must be visible on the first screen */
[data-page="index"] header + div { gap: 8px !important; padding-top: 4px !important; }
[data-page="index"] header + div h1 { font-size: clamp(30px, min(4.6vw, 7svh), 64px) !important; }
[data-page="index"] header + div p { font-size: clamp(15px, 1.25vw, 18px) !important; line-height: 1.45; }
[data-page="index"] .sys { margin-top: clamp(-90px, -6vw, -24px); }
@media (min-width: 641px) {
  [data-page="index"] .sys { width: min(100%, 860px, calc((100svh - 190px) * 1.5)) !important; }
}
@media (min-width: 641px) and (max-height: 820px) {
  header { padding: 10px 0 !important; }
  [data-page="index"] header + div > div:first-child { display: none; }
  [data-page="index"] header + div h1 { font-size: clamp(30px, 3.8vw, 52px) !important; }
}
@media (max-width: 640px) {
  [data-page="index"] header + div > div:first-child { font-size: 11px !important; letter-spacing: .06em !important; }
  [data-page="index"] header + div h1 { font-size: 34px !important; }
}

/* ---- Skipper photo */
.skipper-photo { flex: 0 0 auto; width: clamp(220px, 26vw, 340px); aspect-ratio: 4 / 5; margin: 0 auto; border-radius: 28px; overflow: hidden; border: 1px solid rgba(141, 235, 255, .35); box-shadow: 0 0 100px rgba(70, 194, 255, .25); background: #0E1233; }
.skipper-photo img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; }

/* ---- Home: bigger sun, planets and moons; less empty space under the system */
[data-page="index"] .tilt.green > .pl { width: max(16cqw, 74px) !important; }
[data-page="index"] .tilt.violet > .pl { width: max(11.7cqw, 56px) !important; }
[data-page="index"] .tilt.blue > .pl { width: max(14.3cqw, 66px) !important; }
[data-page="index"] .moon { width: max(2.9cqw, 13px); margin: calc(max(2.9cqw, 13px) / -2) 0 0 calc(max(2.9cqw, 13px) / -2); }
[data-page="index"] .yacht { width: max(4.6cqw, 22px); height: max(4.6cqw, 22px); margin: calc(max(4.6cqw, 22px) / -2) 0 0 calc(max(4.6cqw, 22px) / -2); }
[data-page="index"] .m1 { --a: 10.9cqw; --b: 3.5cqw; }
[data-page="index"] .m2 { --a: 13.5cqw; --b: 4.4cqw; }
[data-page="index"] .m3 { --a: 16.1cqw; --b: 5.3cqw; }
[data-page="index"] .n1 { --a: 8.6cqw; --b: 2.8cqw; }
[data-page="index"] .n2 { --a: 10.4cqw; --b: 3.4cqw; }
[data-page="index"] .y1 { --a: 9.4cqw; --b: 3.1cqw; }
[data-page="index"] .y2 { --a: 12.2cqw; --b: 4.1cqw; }
@media (min-width: 641px) { [data-page="index"] .sun { width: 14.5cqw !important; } }
[data-page="index"] [style*="clamp(120px, 14vw, 210px)"] { padding-bottom: clamp(24px, 4vw, 56px) !important; }
@media (max-width: 640px) {
  [data-page="index"] .sun { width: max(17cqw, 66px) !important; }
  [data-page="index"] .m1 { --a: 14cqw; --b: 4.5cqw; }
  [data-page="index"] .m2 { --a: 17cqw; --b: 5.5cqw; }
  [data-page="index"] .m3 { --a: 20cqw; --b: 6.5cqw; }
  [data-page="index"] .n1 { --a: 12.5cqw; --b: 4cqw; }
  [data-page="index"] .n2 { --a: 15cqw; --b: 4.8cqw; }
  [data-page="index"] .y1 { --a: 13cqw; --b: 4.2cqw; }
  [data-page="index"] .y2 { --a: 16.5cqw; --b: 5.3cqw; }
}

/* ---- Planet pages: keep the planet in view */
@media (min-width: 861px) {
  .stage-s { align-self: start !important; position: sticky; top: 12px; }
}
@media (max-width: 860px) {
  .stage { display: flex !important; flex-direction: column; gap: 16px !important; }
  .stage-t { display: contents !important; }
  .stage-t > * { order: 3; }
  .stage-t > h1, .stage-t > *:has(~ h1) { order: 1; }
  .stage-s { order: 2; margin: -8px 0; width: 100%; align-self: stretch !important; }
  .stage-p { order: 4; }
  .stage-t > h1 { font-size: 28px !important; }
}
@media (max-width: 640px) {
  header nav a[href="index.html"] { display: none !important; }
}

/* ---- Satellite panel pager */
.sp-pager { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 20px; font: 500 13px/1 "JetBrains Mono", monospace; color: #A9AFD0; }
.sp-pager button { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border: 1px solid rgba(255, 255, 255, .22); border-radius: 50%; background: rgba(10, 13, 36, .6); color: #F2F3FA; font: 400 20px/1 system-ui, sans-serif; cursor: pointer; }
.sp-pager button:hover { border-color: currentColor; }
.sp-pager button:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
@media (max-width: 640px) { .stage-t > div:first-child { display: none !important; } }
