:root {
  --sky-top: #2c74cf;
  --sky-horizon: #bfe2fb;
  --text: #f5f7fb;
  --muted: rgba(235, 240, 250, 0.72);
  --glass: rgba(12, 18, 36, 0.48);
  --glass-border: rgba(255, 255, 255, 0.14);
  --accent: #ffd27a;
  --radius: 18px;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sans);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  background: #0b1430;
}
a { color: inherit; }

/* ---------- live sky ---------- */
.sky {
  position: fixed;
  inset: 0;
  z-index: -1;
  /* Shown before JS paints (and if JS is off) */
  background: linear-gradient(#2c74cf, #6fb0ea 55%, #bfe2fb);
}
.sky svg, .sky canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#flash { position: absolute; inset: 0; background: #eef3ff; opacity: 0; pointer-events: none; }

/* Occasional twinkle: steady most of the cycle, then a quick shimmer. */
.twinkle { animation: twinkle 15s linear infinite; }
@keyframes twinkle {
  0%, 88%, 100% { opacity: 1; }
  91% { opacity: 0.3; }
  93% { opacity: 0.9; }
  95% { opacity: 0.45; }
}

/* ---------- top bar ---------- */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: max(14px, env(safe-area-inset-top)) clamp(16px, 4vw, 40px) 14px;
}
.topbar { transition: background 0.25s, box-shadow 0.25s, backdrop-filter 0.25s; }
.topbar.scrolled {
  background: rgba(10, 16, 34, 0.55);
  backdrop-filter: blur(16px) saturate(1.3);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08);
}
.brand {
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 0.01em;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.35);
}
.brand span { color: var(--accent); }
.nav { display: flex; gap: 1.25rem; margin-left: auto; }
.nav a {
  text-decoration: none;
  font-size: 0.95rem;
  opacity: 0.9;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.4);
}
.nav a:hover { opacity: 1; text-decoration: underline; text-underline-offset: 4px; }

.sky-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  backdrop-filter: blur(14px) saturate(1.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  max-width: 46vw;
  white-space: nowrap;
}
.sky-chip:hover { background: rgba(12, 18, 36, 0.62); }
#chipText { overflow: hidden; text-overflow: ellipsis; }

/* ---------- glass ---------- */
.glass {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  backdrop-filter: blur(18px) saturate(1.3);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

.sky-panel {
  position: fixed;
  z-index: 20;
  top: 64px;
  right: clamp(12px, 4vw, 40px);
  width: min(340px, calc(100vw - 24px));
  max-height: calc(100vh - 80px);
  max-height: calc(100dvh - 80px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 1.1rem 1.2rem 1rem;
  animation: pop 0.18s ease-out;
}
@keyframes pop { from { opacity: 0; transform: translateY(-6px); } }
.sky-panel h2 { margin: 0.1rem 0 0; font-family: var(--serif); font-size: 1.5rem; }
.panel-kicker { margin: 0; font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); }
.sky-panel .muted { margin: 0.1rem 0 0.6rem; font-size: 0.85rem; }
.cond { margin: 0 0 0.6rem; font-size: 1.05rem; font-weight: 600; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem 1rem; margin: 0 0 0.9rem; }
.stats .wide { grid-column: 1 / -1; }
.stats dt { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.stats dd { margin: 0; font-size: 0.95rem; }
.controls { border-top: 1px solid var(--glass-border); padding-top: 0.8rem; }
.controls-head {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 2rem; margin-bottom: 0.6rem;
  font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted);
}
.seg {
  display: grid; grid-template-columns: repeat(3, 1fr);
  padding: 3px; margin-bottom: 0.7rem;
  border-radius: 999px; background: rgba(255, 255, 255, 0.08); border: 1px solid var(--glass-border);
}
.seg button {
  font: inherit; font-size: 0.85rem; color: var(--text);
  padding: 0.35rem 0.4rem; border: 0; border-radius: 999px;
  background: transparent; cursor: pointer; transition: background 0.15s, color 0.15s;
}
.seg button:hover { background: rgba(255, 255, 255, 0.1); }
.seg button[aria-checked="true"] { background: var(--accent); color: #1a1406; font-weight: 600; }
.slider { display: block; font-size: 0.85rem; }
.slider span { display: flex; justify-content: space-between; }
.slider input { width: 100%; accent-color: var(--accent); margin: 0.3rem 0 0.55rem; }
.fine { margin: 0.8rem 0 0; font-size: 0.75rem; color: var(--muted); }

/* ---------- hero ---------- */
.hero {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 90px clamp(20px, 7vw, 96px) 22vh;
  position: relative;
}
/* Soft scrim so text stays readable over bright clouds and skies */
.hero::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: min(900px, 100%);
  background: radial-gradient(ellipse 70% 45% at 30% 48%, rgba(8, 14, 32, 0.32), transparent 70%);
  pointer-events: none;
  z-index: -1;
}
.eyebrow { margin: 0; font-size: 1.05rem; opacity: 0.92; text-shadow: 0 1px 14px rgba(0, 0, 0, 0.35); }
h1 {
  margin: 0.1rem 0 0.6rem;
  font-family: var(--serif);
  font-size: clamp(3rem, 9vw, 6.5rem);
  line-height: 1;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 30px rgba(0, 0, 0, 0.35);
}
.lede {
  margin: 0 0 1.8rem;
  max-width: 34rem;
  font-size: clamp(1.05rem, 2.2vw, 1.3rem);
  text-shadow: 0 1px 16px rgba(0, 0, 0, 0.45);
}
.cta { display: flex; flex-wrap: wrap; gap: 0.8rem; }
.scroll-hint {
  position: absolute;
  left: 50%;
  bottom: 4vh;
  translate: -50% 0;
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
  animation: bob 2.4s ease-in-out infinite;
}
@keyframes bob { 50% { transform: translateY(6px); } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  padding: 0.75rem 1.25rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--text);
  text-decoration: none;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, background 0.15s;
}
.btn:hover { transform: translateY(-1px); background: rgba(255, 255, 255, 0.2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #1a1406; }
.btn.primary:hover { background: #ffe0a0; }
.btn.small { padding: 0.4rem 0.9rem; font-size: 0.85rem; }

/* ---------- sections ---------- */
.section { padding: 0 clamp(12px, 4vw, 40px) clamp(20px, 4vw, 40px); scroll-margin-top: 70px; }
.section-inner { max-width: 1100px; margin: 0 auto; padding: clamp(22px, 4vw, 44px); }
.section h2 { margin: 0 0 0.3rem; font-family: var(--serif); font-size: clamp(1.8rem, 4vw, 2.4rem); }
.muted { color: var(--muted); }
.sub { margin: 0 0 0.8rem; font-size: 1rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}
.card {
  display: flex;
  flex-direction: column;
  padding: 1.25rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-decoration: none;
  transition: transform 0.2s, background 0.2s, border-color 0.2s;
}
.card:hover { transform: translateY(-3px); background: rgba(255, 255, 255, 0.11); border-color: rgba(255, 210, 122, 0.5); }
.card-top { display: flex; justify-content: space-between; align-items: center; }
.card-icon {
  display: grid; place-items: center;
  width: 42px; height: 42px;
  border-radius: 12px;
  background: rgba(255, 210, 122, 0.15);
}
.card-icon svg { width: 22px; height: 22px; fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.card h3 { margin: 0.9rem 0 0.3rem; font-size: 1.2rem; }
.card p { margin: 0 0 0.9rem; color: var(--muted); font-size: 0.95rem; flex: 1; }
.card-url { margin-top: 0.9rem; font-size: 0.85rem; color: var(--accent); }
.badge { font-size: 0.72rem; padding: 0.2rem 0.6rem; border-radius: 999px; font-weight: 600; }
.badge.live { background: rgba(110, 231, 160, 0.16); color: #8ef0b4; }
.badge.wip { background: rgba(255, 210, 122, 0.14); color: var(--accent); }

.tags { display: flex; flex-wrap: wrap; gap: 0.4rem; padding: 0; margin: 0; list-style: none; }
.tags li { font-size: 0.75rem; padding: 0.2rem 0.6rem; border-radius: 999px; background: rgba(255, 255, 255, 0.09); }
.tags.big li { font-size: 0.9rem; padding: 0.35rem 0.85rem; }

.two-col { display: grid; grid-template-columns: 1.5fr 1fr; gap: clamp(20px, 4vw, 48px); }
.contact { text-align: center; }
.links { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.8rem; margin-top: 1.2rem; }

.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem;
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem clamp(20px, 4vw, 40px) max(1.5rem, env(safe-area-inset-bottom));
  font-size: 0.8rem;
  color: var(--muted);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
}

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

@media (max-width: 720px) {
  .nav { display: none; }
  .sky-chip { margin-left: auto; }
  .two-col { grid-template-columns: 1fr; }
  .hero { padding-bottom: 28vh; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .twinkle, .scroll-hint { animation: none; }
}
