/* ============================================================================
 * Ganymede — stylesheet
 * Dark Jovian theme. No external fonts or assets: everything is CSS.
 * ========================================================================== */

:root {
  --bg:          #06090f;
  --bg-glow:     #0d1b2c;
  --surface:     #0d131d;
  --surface-2:   #121a26;
  --line:        #1e2836;
  --line-bright: #2c3a4d;

  --text:        #dde5ef;
  --muted:       #8593a6;
  --dim:         #5d6b7d;

  --ice:         #7fd4ff;   /* Ganymede — cold blue */
  --ice-dim:     #4a9cc4;
  --jove:        #e3a765;   /* Jupiter — warm band */
  --green:       #5fd39a;
  --amber:       #e5b45c;

  --radius:      14px;
  --radius-sm:   8px;
  --maxw:        1080px;

  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px -12px rgba(0,0,0,.7);

  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "Cascadia Mono", Menlo, Consolas,
          "Liberation Mono", monospace;
}

/* --- reset ---------------------------------------------------------------- */

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg { max-width: 100%; display: block; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0; font-weight: 650; letter-spacing: -.02em; }
p { margin: 0; }
a { color: var(--ice); text-decoration: none; }
a:hover { color: #a8e4ff; }

:focus-visible {
  outline: 2px solid var(--ice);
  outline-offset: 3px;
  border-radius: 4px;
}

/* --- background: starfield + Jovian glow ---------------------------------- */

body::before,
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
}

/* Soft light from the gas giant, top-right. */
body::before {
  background:
    radial-gradient(900px 620px at 88% -12%, rgba(227,167,101,.13), transparent 62%),
    radial-gradient(760px 560px at 10% 4%,   rgba(74,156,196,.12), transparent 60%),
    linear-gradient(180deg, var(--bg-glow) 0%, var(--bg) 46%);
}

/* Hand-placed stars. Cheap, no images, no JS. */
body::after {
  background-image:
    radial-gradient(1.4px 1.4px at 12% 18%,  rgba(255,255,255,.75), transparent),
    radial-gradient(1.1px 1.1px at 27% 62%,  rgba(255,255,255,.5),  transparent),
    radial-gradient(1.6px 1.6px at 41% 9%,   rgba(190,225,255,.7),  transparent),
    radial-gradient(1px   1px   at 55% 44%,  rgba(255,255,255,.45), transparent),
    radial-gradient(1.5px 1.5px at 68% 22%,  rgba(255,255,255,.6),  transparent),
    radial-gradient(1.1px 1.1px at 79% 72%,  rgba(210,235,255,.5),  transparent),
    radial-gradient(1.7px 1.7px at 91% 33%,  rgba(255,255,255,.65), transparent),
    radial-gradient(1px   1px   at 6%  81%,  rgba(255,255,255,.4),  transparent),
    radial-gradient(1.3px 1.3px at 34% 88%,  rgba(255,255,255,.5),  transparent),
    radial-gradient(1.2px 1.2px at 62% 95%,  rgba(200,230,255,.45), transparent),
    radial-gradient(1.4px 1.4px at 84% 55%,  rgba(255,255,255,.55), transparent),
    radial-gradient(1px   1px   at 47% 30%,  rgba(255,255,255,.35), transparent);
  opacity: .8;
}

/* --- layout --------------------------------------------------------------- */

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 24px;
}

main { padding-bottom: 96px; }

.section { margin-top: 72px; }
.section-head { margin-bottom: 24px; }
.section-head h2 {
  font-size: clamp(1.35rem, 1.1rem + 1vw, 1.7rem);
  display: flex;
  align-items: center;
  gap: 12px;
}
.section-head h2::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--line-bright), transparent);
}
.section-head p { color: var(--muted); margin-top: 8px; max-width: 62ch; }

/* --- header --------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(6, 9, 15, .72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  letter-spacing: -.01em;
  font-size: 1.05rem;
  margin-right: auto;
  white-space: nowrap;   /* keep multi-word names on one line */
}
.brand:hover { color: var(--text); }
.brand .mark { flex: none; filter: drop-shadow(0 0 8px rgba(127,212,255,.35)); }

.nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.nav a {
  color: var(--muted);
  font-size: .92rem;
  font-weight: 500;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.nav a:hover { color: var(--text); background: var(--surface-2); }
.nav a[aria-current='page'] {
  color: var(--ice);
  background: rgba(127,212,255,.08);
  border-color: rgba(127,212,255,.22);
}

/* --- hero ----------------------------------------------------------------- */

/* padding-block only — the shorthand would clobber .wrap's inline padding. */
.hero { padding-block: 84px 8px; }

.hero h1 {
  font-size: clamp(2.6rem, 1.6rem + 4.4vw, 4.6rem);
  font-weight: 700;
  letter-spacing: -.04em;
  background: linear-gradient(160deg, #ffffff 8%, #b9d7ea 52%, var(--ice-dim) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero .lede {
  margin-top: 20px;
  max-width: 58ch;
  font-size: clamp(1rem, .95rem + .3vw, 1.15rem);
  color: var(--muted);
}

.hero-actions {
  margin-top: 32px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* --- buttons -------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--line-bright);
  background: var(--surface-2);
  color: var(--text);
  font-size: .92rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease,
              transform .15s ease, color .15s ease;
}
.btn:hover {
  color: var(--text);
  background: #17212f;
  border-color: #3a4c63;
  transform: translateY(-1px);
}
.btn:active { transform: translateY(0); }

.btn-primary {
  background: linear-gradient(180deg, #8fdcff, var(--ice));
  border-color: #a5e3ff;
  color: #05202e;
}
.btn-primary:hover {
  background: linear-gradient(180deg, #a5e4ff, #92dbff);
  border-color: #c2edff;
  color: #05202e;
}

.btn-ghost { background: transparent; }
.btn-ghost:hover { background: var(--surface-2); }

.btn[aria-disabled='true'] {
  opacity: .45;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-sm { padding: 7px 14px; font-size: .85rem; }

/* --- category tiles (home) ------------------------------------------------ */

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.tile {
  display: block;
  position: relative;
  padding: 22px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  color: var(--text);
  overflow: hidden;
  transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.tile::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(340px 160px at 80% 0%, rgba(127,212,255,.1), transparent 70%);
  opacity: 0;
  transition: opacity .22s ease;
}
.tile:hover {
  color: var(--text);
  transform: translateY(-3px);
  border-color: var(--line-bright);
  box-shadow: var(--shadow);
}
.tile:hover::after { opacity: 1; }

.tile .tile-icon { color: var(--ice); margin-bottom: 14px; }
.tile h3 { font-size: 1.08rem; }
.tile p { color: var(--muted); font-size: .92rem; margin-top: 6px; }
.tile .tile-count {
  margin-top: 14px;
  font-family: var(--mono);
  font-size: .78rem;
  color: var(--dim);
}

/* --- project cards -------------------------------------------------------- */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 18px;
}

.card {
  display: flex;
  flex-direction: column;
  padding: 22px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: border-color .18s ease, transform .18s ease;
}
.card:hover { border-color: var(--line-bright); transform: translateY(-2px); }

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.card h3 { font-size: 1.12rem; }
.card .tagline { color: var(--ice-dim); font-size: .88rem; margin-top: 4px; }
.card .desc { color: var(--muted); font-size: .93rem; margin-top: 12px; }

.card-meta {
  margin-top: 14px;
  font-family: var(--mono);
  font-size: .78rem;
  color: var(--dim);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
}

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.tag {
  font-size: .74rem;
  font-family: var(--mono);
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 9px;
}

/* margin-top:auto pushes the action row down so cards in a row line up. */
.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

code {
  font-family: var(--mono);
  font-size: .88em;
  color: var(--ice);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 6px;
}

/* --- status pills --------------------------------------------------------- */

.status {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .72rem;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line-bright);
  color: var(--muted);
  background: var(--surface-2);
  white-space: nowrap;
}
.status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.status-live    { color: var(--green); border-color: rgba(95,211,154,.3);  background: rgba(95,211,154,.08); }
.status-beta    { color: var(--amber); border-color: rgba(229,180,92,.3);  background: rgba(229,180,92,.08); }
.status-wip     { color: var(--ice);   border-color: rgba(127,212,255,.3); background: rgba(127,212,255,.08); }
.status-planned { color: var(--dim); }

/* --- empty state ---------------------------------------------------------- */

.empty {
  padding: 44px 24px;
  text-align: center;
  border: 1px dashed var(--line-bright);
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(13,19,29,.5);
}
.empty strong { display: block; color: var(--text); margin-bottom: 6px; }

/* --- contact -------------------------------------------------------------- */

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
}

.contact-card {
  font: inherit;
  text-align: left;   /* buttons centre by default */
  cursor: pointer;
  width: 100%;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 20px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  transition: border-color .18s ease, transform .18s ease;
}
.contact-card:hover { color: var(--text); border-color: var(--line-bright); transform: translateY(-2px); }
.contact-card .ci {
  flex: none;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ice);
}
.contact-card h3 { font-size: .98rem; }
.contact-card .val {
  font-family: var(--mono);
  font-size: .85rem;
  color: var(--muted);
  margin-top: 4px;
  overflow-wrap: anywhere;
}

.copy-note {
  margin-top: 20px;
  font-size: .88rem;
  color: var(--dim);
}

/* --- redirect / notice pages ---------------------------------------------- */

.centered {
  min-height: 72vh;
  display: grid;
  place-items: center;
  text-align: center;
}
.centered .inner { max-width: 44ch; }
.centered h1 { font-size: clamp(1.7rem, 1.3rem + 2vw, 2.6rem); }
.centered p { color: var(--muted); margin-top: 14px; }
.centered .btn { margin-top: 26px; }

.spinner {
  width: 34px;
  height: 34px;
  margin: 0 auto 26px;
  border-radius: 50%;
  border: 2px solid var(--line-bright);
  border-top-color: var(--ice);
  animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --- misc ----------------------------------------------------------------- */

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

noscript .nojs {
  margin: 24px 0;
  padding: 16px;
  border: 1px solid var(--line-bright);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

@media (max-width: 620px) {
  .hero { padding-top: 56px; }
  .site-header .wrap { min-height: 58px; gap: 10px; }
  .nav a { padding: 6px 9px; font-size: .86rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

/* --- additions ------------------------------------------------------------ */

/* Keyboard users can jump past the nav. Hidden until focused. */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 10px 16px;
  background: var(--surface-2);
  border: 1px solid var(--line-bright);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: .9rem;
}
.skip-link:focus-visible { left: 16px; top: 12px; }

/* Welcome / status panel on the home page. */
.notice {
  display: grid;
  gap: 14px;
  padding: 22px 24px;
  background:
    linear-gradient(180deg, rgba(127,212,255,.05), rgba(127,212,255,0)),
    var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--ice-dim);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: var(--muted);
}
.notice p { margin: 0; }
.notice code {
  font-family: var(--mono);
  font-size: .88em;
  padding: 1px 6px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--text);
}

/* Nav: never let five links break the header on a narrow phone. */
@media (max-width: 620px) {
  .site-header .wrap {
    flex-wrap: wrap;
    align-items: flex-start;
    padding-block: 10px;
  }
  .nav {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { white-space: nowrap; }
}
