/* Greater Star Lab – the whole look of greaterstar.io. A night sky where every experiment is a star.
   Used by dist/index.html and dist/sv/index.html (built from src/template.html by tools/build.py). */

@font-face { font-family: "Inter"; src: url("fonts/inter-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url("fonts/newsreader-latin-wght-normal.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("fonts/GeistMono-Medium-latin.woff2") format("woff2"); font-weight: 500; font-display: swap; }

:root {
	--sky: #070a12;
	--sky-2: #0d1220;
	--line: rgba(255, 255, 255, .12);
	--text: #e9ecf5;
	--muted: #9aa3b8;
	--cyan: #25d6fc;
	--blue: #3a84f4;
	--wrap: 1180px;
	--gutter: clamp(1rem, 4vw, 2.5rem);
	--serif: "Newsreader", Georgia, serif;
	--sans: "Inter", system-ui, sans-serif;
	--mono: "Geist Mono", ui-monospace, monospace;
	color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--sky); color: var(--text); font: 400 1.0625rem/1.6 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 4px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: var(--gutter); top: -4rem; z-index: 10; padding: .6rem 1rem; background: var(--text); color: var(--sky); border-radius: 999px; text-decoration: none; }
.skip:focus { top: 1rem; }

/* Every block shares one column: the logo's edge to the agency link's edge (the star map too, in .sky__map). */
.top, .sky__text, .cards, .log, .cta, .foot { width: min(var(--wrap), 100% - 2 * var(--gutter)); margin-inline: auto; }

/* ---------- Header ---------- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; height: 84px; position: relative; z-index: 3; }
.logo { display: flex; align-items: center; gap: .6rem; text-decoration: none; }
.logo img { height: 44px; width: auto; }
.logo span { font: 500 .78rem/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--cyan); border: 1px solid color-mix(in srgb, var(--cyan) 45%, transparent); padding: .3rem .45rem; border-radius: 999px; }
.top__nav { display: flex; align-items: center; gap: 1.25rem; font-size: .95rem; }
.top__nav a { text-decoration: none; color: var(--muted); }
.top__nav a:hover { color: var(--text); }
.top__nav .top__agency { color: var(--text); border: 1px solid var(--line); padding: .5rem .9rem; border-radius: 999px; }
.top__nav .top__agency:hover { border-color: var(--text); }

/* ---------- The sky (hero and star map) ---------- */
.sky { position: relative; min-height: min(92vh, 860px); display: grid; grid-template-rows: auto 1fr; margin-top: -84px; padding-top: 84px; overflow: hidden;
	background: radial-gradient(120% 80% at 70% 10%, #13203f 0%, var(--sky-2) 45%, var(--sky) 100%); }
.sky__canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.sky__text { position: relative; z-index: 2; padding-top: clamp(2rem, 7vh, 5rem); pointer-events: none; }
.sky__text > * { pointer-events: auto; }
.kicker { margin: 0 0 1rem; font: 500 .78rem/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--cyan); }
h1 { margin: 0; max-width: 15ch; font: 400 clamp(2.6rem, 6.5vw, 5.4rem)/1.02 var(--serif); letter-spacing: -.025em; }
.intro { max-width: 34rem; margin: 1.5rem 0 0; color: var(--muted); font-size: 1.125rem; }

/* The stars are real links (work without JavaScript and with the keyboard); the canvas only draws the sky behind. */
.sky__map { position: relative; z-index: 2; min-height: 300px; width: min(var(--wrap), 100% - 2 * var(--gutter)); margin-inline: auto; }
/* The dot (14 px, after .5rem padding) sits exactly on x/y; the label runs inwards from it. */
.star { position: absolute; left: calc(var(--x) * 1%); top: calc(var(--y) * 1%); transform: translate(calc(-.5rem - 7px), -50%); display: flex; align-items: center; gap: .65rem; padding: .5rem; text-decoration: none; }
.star__dot { width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 4px color-mix(in srgb, var(--cyan) 25%, transparent), 0 0 18px 4px color-mix(in srgb, var(--cyan) 70%, transparent); flex: none; transition: transform .25s, box-shadow .25s; }
.star__label { font-size: .9rem; white-space: nowrap; color: var(--text); background: color-mix(in srgb, var(--sky) 80%, transparent); padding: .3rem .6rem; border-radius: 999px; border: 1px solid var(--line); opacity: .62; transition: opacity .2s, border-color .2s; }
.star__num { font: 500 .72rem/1 var(--mono); color: var(--cyan); }
.star:hover .star__dot, .star:focus-visible .star__dot, .star.is-lit .star__dot { transform: scale(1.35); box-shadow: 0 0 0 6px color-mix(in srgb, var(--cyan) 30%, transparent), 0 0 30px 8px var(--cyan); }
.star:hover .star__label, .star:focus-visible .star__label, .star.is-lit .star__label { opacity: 1; border-color: color-mix(in srgb, var(--cyan) 55%, transparent); }
/* Below 1100 px the labels would crowd each other: they show only on hover or keyboard focus. */
@media (max-width: 1100px) { .star__label { opacity: 0; } }
/* Stars on the right half show their label to the left, so it never runs off the screen. */
.star.is-right { flex-direction: row-reverse; transform: translate(calc(-100% + .5rem + 7px), -50%); }

/* ---------- Experiment cards ---------- */
.section-title { margin: 0 0 1.5rem; font: 500 .78rem/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.cards { padding-block: clamp(3rem, 8vw, 6rem) 0; }
.cards__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 1rem; }
.card { position: relative; display: flex; flex-direction: column; gap: .75rem; padding: 1.5rem; border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(180deg, rgba(255, 255, 255, .045), rgba(255, 255, 255, .015)); scroll-margin-top: 2rem; transition: border-color .25s; }
.card p { margin: 0; color: var(--muted); }
.card h3 { margin: 0; font: 400 1.6rem/1.15 var(--serif); color: var(--text); }
.card__num { font: 500 .75rem/1 var(--mono); color: var(--cyan) !important; }
.card__learned { padding-top: .75rem; border-top: 1px solid var(--line); font-size: .95rem; }
.card__learned span { display: block; margin-bottom: .25rem; font: 500 .7rem/1.4 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--text); }
.card__link { margin-top: auto; padding-top: .5rem; color: var(--text); text-decoration: none; font-weight: 500; }
.card__link:hover { color: var(--cyan); }
.card:hover, .card.is-lit, .card:target { border-color: color-mix(in srgb, var(--cyan) 55%, transparent); }

/* ---------- Lab log ---------- */
.log { padding-block: clamp(3rem, 8vw, 6rem) 0; }
.log__intro { margin: -.75rem 0 1.5rem; color: var(--muted); }
.log__list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); max-width: 52rem; }
.log__list li { display: grid; grid-template-columns: 7.5rem 1fr; gap: 1rem; padding: 1rem 0; border-bottom: 1px solid var(--line); }
.log__list time { font: 500 .8rem/1.9 var(--mono); color: var(--cyan); }
.log__list p { margin: 0; }

/* ---------- Call to the agency ---------- */
.cta { margin-block: clamp(3rem, 8vw, 6rem); padding: clamp(2rem, 5vw, 3.5rem); border-radius: 22px; border: 1px solid var(--line); background: radial-gradient(120% 140% at 100% 0%, #183064 0%, var(--sky-2) 60%); }
.cta h2 { margin: 0; font: 400 clamp(1.9rem, 4vw, 2.8rem)/1.1 var(--serif); }
.cta p { margin: .75rem 0 1.75rem; color: var(--muted); max-width: 34rem; }
.button { display: inline-block; padding: .85rem 1.4rem; border-radius: 999px; background: var(--text); color: var(--sky); text-decoration: none; font-weight: 600; }
.button:hover { background: #fff; }

.foot { padding-block: 0 2.5rem; color: var(--muted); font-size: .85rem; }

/* ---------- Phones: the map becomes a compact sky above the list ---------- */
@media (max-width: 720px) {
	.top { height: 72px; }
	.top__nav { gap: .75rem; font-size: .85rem; }
	.logo img { height: 36px; }
	.sky { min-height: 0; margin-top: -72px; padding-top: 72px; }
	.sky__map { min-height: 220px; margin-block: 1.5rem 1rem; }
	.star__label { display: none; }
	.log__list li { grid-template-columns: 1fr; gap: .25rem; }
}

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after { transition: none !important; }
}
