/* Cloudy Again… astrophotography by André Duffeck — "Deep Field" theme */

@font-face {
  font-family: "Manrope";
  src: url("../fonts/manrope-latin.woff2") format("woff2");
  font-weight: 200 800; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Manrope";
  src: url("../fonts/manrope-latin-ext.woff2") format("woff2");
  font-weight: 200 800; font-style: normal; font-display: swap;
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Instrument Serif (display: titles and the brand), regular and italic */
@font-face {
  font-family: "Instrument Serif";
  src: url("../fonts/instrument-serif-latin.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("../fonts/instrument-serif-latin-ext.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("../fonts/instrument-serif-italic-latin.woff2") format("woff2");
  font-weight: 400; font-style: italic; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("../fonts/instrument-serif-italic-latin-ext.woff2") format("woff2");
  font-weight: 400; font-style: italic; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  color-scheme: dark;
  --bg: #05060a;
  --fg: #eef0f6;
  --dim: #b7bdd0;
  --mute: #8f96ab;
  --accent: #8ea2ff;
  --accent-soft: rgba(142, 162, 255, 0.14);
  --accent-ink: #05060a;
  --link: #c9d2ff;
  --line: rgba(255, 255, 255, 0.10);
  --line-strong: rgba(255, 255, 255, 0.22);
  --glass: rgba(255, 255, 255, 0.05);
  --card: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --sky-text: linear-gradient(100deg, #f4f5fb 0%, #c7d0ff 45%, #8ea2ff 100%);
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --gutter: clamp(16px, 4vw, 48px);
  --max: 1160px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--link); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { text-wrap: balance; }
p { margin: 0 0 1em; }

/* Star field canvas (js/sky.js) and the page above it */
.sky { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; opacity: 0.75; }
.page { position: relative; z-index: 1; min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1 0 auto; }

.wrap { max-width: var(--max); margin: 0 auto; }
.band { padding-left: max(var(--gutter), env(safe-area-inset-left, 0px)); padding-right: max(var(--gutter), env(safe-area-inset-right, 0px)); }

.skip { position: absolute; left: -9999px; top: 12px; z-index: 10; background: var(--fg); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-weight: 600; }
.skip:focus { left: 12px; }

/* ---- Navigation pill --------------------------------------------------------- */
.top { padding-top: 28px; position: relative; z-index: 2; }
.nav {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px;
  padding: 8px 8px 8px 22px; border-radius: 28px;
  background: var(--glass); border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.brand {
  display: inline-flex; align-items: center; gap: 10px; padding: 4px 0;
  color: var(--fg); text-decoration: none; font-family: var(--serif); font-size: 25px; line-height: 1; letter-spacing: 0.005em;
}
.brand:hover { color: var(--fg); }
.brand em { font-style: italic; color: #c7d0ff; padding-right: 0.06em; }
.brand__mark { width: 30px; height: 30px; flex: none; }
.brand__star { fill: #ffd9a3; }
.brand__cloud { fill: #dfe4f4; }
.brand:hover .brand__star { fill: #ffe7c4; }
.nav__links { display: flex; flex-wrap: wrap; gap: 2px; font-size: 15px; }
.nav__links a { color: var(--dim); text-decoration: none; padding: 10px 14px; border-radius: 999px; }
.nav__links a:hover { color: var(--fg); background: var(--glass); }
.nav__links a[aria-current="page"] { color: var(--fg); }
.nav__links .nav__cta { color: var(--bg); background: var(--fg); font-weight: 650; padding-inline: 18px; }
.nav__links .nav__cta:hover { color: var(--bg); background: #fff; }

/* ---- Hero glow (both pages) ------------------------------------------------------ */
.page::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: min(1000px, 120vh); z-index: -1; pointer-events: none;
  -webkit-mask-image: linear-gradient(180deg, #000 55%, transparent); mask-image: linear-gradient(180deg, #000 55%, transparent);
  background:
    radial-gradient(ellipse 55% 60% at 80% 30%, rgba(92, 108, 255, 0.22), transparent 70%),
    radial-gradient(ellipse 45% 45% at 10% 80%, rgba(196, 72, 140, 0.12), transparent 70%);
}

/* ---- Landing hero ---------------------------------------------------------------- */
.hero-home {
  position: relative; overflow: hidden; overflow: clip;
  padding-block: clamp(64px, 9vw, 120px) clamp(64px, 8vw, 104px);
}
/* A thin layer of cloud drifting over the stars, true to the name */
.hero-home::before {
  content: ""; position: absolute; inset: -10% -25%; z-index: -1; pointer-events: none;
  background:
    radial-gradient(38% 20% at 68% 36%, rgba(196, 204, 236, 0.11), transparent 72%),
    radial-gradient(26% 14% at 86% 50%, rgba(196, 204, 236, 0.09), transparent 72%),
    radial-gradient(34% 16% at 52% 62%, rgba(170, 180, 226, 0.07), transparent 72%),
    radial-gradient(22% 10% at 30% 30%, rgba(170, 180, 226, 0.05), transparent 72%);
  filter: blur(24px);
  animation: hero-drift 80s ease-in-out infinite alternate;
}
@keyframes hero-drift { from { transform: translateX(-5%); } to { transform: translateX(5%); } }
@media (prefers-reduced-motion: reduce) { .hero-home::before { animation: none; } }
.display {
  margin: 0; font-family: var(--serif); font-weight: 400; font-size: clamp(48px, 6.8vw, 92px);
  line-height: 0.95; letter-spacing: -0.01em;
}
.display em, .title em {
  font-style: italic; padding-right: 0.08em;
  background: var(--sky-text); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.tagline { margin: 24px 0 0; max-width: 34ch; font-size: clamp(18px, 2.1vw, 22px); color: var(--dim); }

/* ---- Cards, chips, buttons ------------------------------------------------------- */
.card {
  border-radius: 32px; background: var(--card); border: 1px solid var(--line);
  padding: clamp(22px, 4vw, 56px);
}
.split { display: flex; flex-wrap: wrap; gap: clamp(28px, 5vw, 64px); align-items: center; }
.split > * { flex: 1 1 360px; min-width: 0; }
.chip {
  display: inline-block; margin: 0 0 16px; font-size: 13px; font-weight: 650;
  padding: 6px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--accent);
}
.h2 { margin: 0 0 16px; font-size: clamp(36px, 5vw, 56px); line-height: 1.02; letter-spacing: -0.035em; font-weight: 650; }
.lead { font-size: 20px; color: var(--fg); }
.muted { color: var(--dim); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 24px;
  border-radius: 999px; border: 1px solid var(--line-strong); color: var(--fg);
  text-decoration: none; font-weight: 650; font-size: 16px;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.btn:hover { color: var(--fg); border-color: rgba(255, 255, 255, 0.45); background: var(--glass); }
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 750; }
.btn--primary:hover { background: #a9b8ff; border-color: #a9b8ff; color: var(--accent-ink); }

/* ---- Landing projects ------------------------------------------------------------ */
.projects { padding-bottom: clamp(72px, 10vw, 130px); }
.stack { display: grid; gap: clamp(20px, 3vw, 32px); }
.h3 { margin: 0 0 16px; font-size: clamp(30px, 4vw, 44px); line-height: 1.05; letter-spacing: -0.03em; font-weight: 650; }
.split--top { align-items: flex-start; }
.subhead { margin: 6px 0 16px; font-size: 17px; font-weight: 650; }
.points { list-style: none; margin: 0; padding: 0; color: var(--dim); }
.points > li { position: relative; padding-left: 22px; }
.points > li + li { margin-top: 12px; }
.points > li::before {
  content: ""; position: absolute; left: 2px; top: 0.62em; width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
}
.shot { margin: clamp(28px, 4vw, 48px) 0 0; }
.shot a { display: block; border-radius: 22px; }
.shot img {
  width: 100%; height: auto; border-radius: 22px; background: #000;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55); outline: 1px solid var(--line); outline-offset: -1px;
}
.shot figcaption { color: var(--mute); font-size: 14px; margin-top: 14px; max-width: 62ch; }

/* ---- Halo Swatter page --------------------------------------------------------- */
.hero-tool { padding-block: clamp(64px, 10vw, 120px) clamp(64px, 9vw, 110px); }
.title { margin: 0 0 20px; font-family: var(--serif); font-weight: 400; font-size: clamp(46px, 5.8vw, 78px); line-height: 0.95; letter-spacing: -0.01em; }
.meta { margin-top: 18px; font-size: 14px; color: var(--mute); }

.section { padding-block: clamp(56px, 8vw, 100px); border-top: 1px solid var(--line); }
.section h2 { margin: 0 0 12px; font-size: clamp(30px, 4vw, 44px); line-height: 1.05; letter-spacing: -0.03em; font-weight: 650; }
.section h3 { margin: 40px 0 14px; font-size: 21px; letter-spacing: -0.01em; font-weight: 650; }
.intro { color: var(--dim); max-width: 60ch; margin-bottom: 32px; font-size: 18px; }
.narrow { max-width: 820px; }
.prose p { max-width: 65ch; color: var(--dim); }
.prose p:first-child { color: var(--fg); }
.gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: clamp(20px, 3vw, 32px); }

/* Before/after comparison (js/site.js drives --pos) */
.compare { margin: 0; }
.compare__frame {
  position: relative; aspect-ratio: 789 / 716; max-width: 100%; overflow: hidden;
  border-radius: 22px; background: #000; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
  outline: 1px solid var(--line); outline-offset: -1px; touch-action: pan-y;
}
.compare__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.compare__after { clip-path: inset(0 0 0 var(--pos)); }
.compare__handle { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 0; pointer-events: none; }
.compare__handle::before { content: ""; position: absolute; top: 0; bottom: 0; left: -1px; width: 2px; background: #fff; }
.compare__knob {
  position: absolute; top: 84%; left: 0; width: 44px; height: 44px; margin: -22px 0 0 -22px;
  border-radius: 50%; border: 2px solid #fff; background: rgba(5, 6, 10, 0.55);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.compare__knob::before, .compare__knob::after {   /* the two arrows */
  content: ""; position: absolute; top: 50%; width: 7px; height: 7px; margin-top: -4px;
  border: solid #fff; border-width: 0 0 2px 2px;
}
.compare__knob::before { left: 9px; transform: rotate(45deg); }
.compare__knob::after { right: 9px; transform: rotate(-135deg); }
.compare__tag {
  position: absolute; top: 14px; font-size: 13px; font-weight: 650; line-height: 1;
  padding: 7px 11px; border-radius: 999px; background: rgba(5, 6, 10, 0.7); color: var(--fg); pointer-events: none;
}
.compare__tag--before { left: 14px; }
.compare__tag--after { right: 14px; }
.compare__range { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; -webkit-appearance: none; appearance: none; }
.compare--zoom .compare__frame { aspect-ratio: 1; }
.compare__frame:has(.compare__range:focus-visible) { outline: 2px solid var(--accent); outline-offset: 3px; }
.compare figcaption { color: var(--mute); font-size: 14px; margin-top: 14px; max-width: 62ch; }

/* Install steps */
.panel { border-radius: 24px; background: var(--card); border: 1px solid var(--line); padding: clamp(20px, 3.5vw, 36px); }
.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; }
.steps > li { counter-increment: step; position: relative; padding: 0 0 26px 52px; }
.steps > li:last-child { padding-bottom: 0; }
.steps > li p { margin: 0; padding-top: 4px; }
.steps > li::before {
  content: counter(step); position: absolute; left: 0; top: 0; width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 750; font-size: 15px; background: var(--accent-soft); color: var(--accent);
}
.steps > li:not(:last-child)::after { content: ""; position: absolute; left: 16.5px; top: 42px; bottom: 6px; width: 1px; background: var(--line); }
.menu { font-weight: 650; color: var(--fg); }
.platforms { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: clamp(16px, 2.5vw, 24px); align-items: stretch; }
.platform { display: flex; flex-direction: column; }
.platform .note { margin-top: 18px; margin-bottom: 0; }
.platform .repo__url { flex-basis: 100%; }
.platform__name { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 0 0 22px !important; font-size: 24px !important; }
.platform__req { font-size: 14px; font-weight: 500; color: var(--mute); }

.repo { display: flex; align-items: stretch; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.repo__url {
  flex: 1 1 14rem; min-width: 0; font-family: var(--mono); font-size: 15px; overflow-wrap: anywhere;
  background: rgba(0, 0, 0, 0.45); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; color: var(--fg);
}
.repo__copy {
  font: inherit; font-weight: 650; font-size: 15px; min-height: 48px; padding: 0 20px; cursor: pointer;
  border-radius: 999px; border: 1px solid var(--line-strong); background: transparent; color: var(--fg);
}
.repo__copy:hover, .repo__copy[data-state="done"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.note { font-size: 15px; color: var(--mute); margin-top: 16px; max-width: 65ch; }

/* Keys and settings */
.keys, .settings { margin: 0; }
.keys > div, .settings > div { display: grid; grid-template-columns: minmax(0, 15rem) minmax(0, 1fr); gap: 20px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.keys > div:first-child, .settings > div:first-child { padding-top: 0; }
.keys > div:last-child, .settings > div:last-child { border-bottom: 0; padding-bottom: 0; }
.keys dt, .settings dt { font-weight: 650; }
.keys dd, .settings dd { margin: 0; color: var(--dim); }
kbd { font-family: var(--mono); font-size: 0.85em; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 6px; padding: 0.05em 0.45em; background: rgba(0, 0, 0, 0.4); color: var(--fg); }

.tip { margin-top: 32px; padding: 18px 22px; border-radius: 18px; background: var(--accent-soft); color: var(--fg); max-width: 65ch; }
.tip strong { color: var(--accent); }

/* ---- Footer ---------------------------------------------------------------------- */
.foot { border-top: 1px solid var(--line); padding-block: 40px 56px; font-size: 14px; color: var(--mute); background: rgba(5, 6, 10, 0.6); }
.foot__row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; }
.foot p { margin: 0; }
.foot__contact { color: var(--dim); }
.foot__contact a { font-weight: 650; }
.foot__small { margin-top: 18px !important; font-size: 13px; max-width: 80ch; }
.foot a { color: var(--link); }
.foot__small a { color: var(--mute); }

@media (max-width: 640px) {
  .nav { padding-left: 18px; border-radius: 24px; }
  .nav__links a { padding: 10px 11px; }
  .keys > div, .settings > div { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .steps > li { padding-left: 46px; }
}
