/* manideepgns.com: one night sky for every page.
   Type rule: Cormorant Garamond for the sky (names, headlines; italic for star names, as old
   celestial atlases label constellations). Geist for reading text and controls. */

@font-face { font-family: 'Cormorant Garamond'; font-style: normal; font-weight: 300 700; font-display: swap; src: url(../fonts/cormorant.woff2) format('woff2') }
@font-face { font-family: 'Cormorant Garamond'; font-style: italic; font-weight: 300 700; font-display: swap; src: url(../fonts/cormorant-italic.woff2) format('woff2') }
@font-face { font-family: 'Geist'; font-style: normal; font-weight: 100 900; font-display: swap; src: url(../fonts/geist.woff2) format('woff2') }

:root {
  --night: #040406; --bg-rgb: 4,4,6; --sky: var(--night); --ink: #f2efe8; --ink-rgb: 242,239,232;
  --dim: rgba(var(--ink-rgb),.66); --faint: rgba(var(--ink-rgb),.56);
  --rule: rgba(var(--ink-rgb),.14); --line: rgba(var(--ink-rgb),.5); --glass: rgba(10,10,14,.55);
  --on-ink: #0b0b0d; --ink-hi: #fff; --code-bg: rgba(8,8,12,.8);
  --accent: var(--ink); --accent-rgb: var(--ink-rgb);
  /* stars and their glow, as r,g,b so canvas and CSS share them */
  --star-warm: 255,226,189; --star-cool: 238,242,255; --glow: 255,246,230; --star-a: 1;
  --tint-warm: 255,236,206; --tint-cool: 206,214,255;
  /* thin type glows on black, so night reads lighter; paper needs the regular weight */
  --body-w: 300;
  --serif: 'Cormorant Garamond', Georgia, serif; --sans: Geist, system-ui, sans-serif;
  color-scheme: dark;
}
/* day: the atlas printed in one ink. Porcelain paper, navy type, and ultramarine as the only colour,
   carried by everything the night draws in starlight: the name, the stars, the lines, the links */
:root[data-theme="light"] {
  --night: #e9eefb; --bg-rgb: 233,238,251; --ink: #101a38; --ink-rgb: 16,26,56;
  --sky: linear-gradient(180deg, #e9eefb 0, #f5f7fc 420px, #f7f8fc 100%);
  --dim: rgba(var(--ink-rgb),.74); --faint: rgba(var(--ink-rgb),.62);
  --rule: rgba(var(--ink-rgb),.12); --line: rgba(35,67,214,.55); --glass: rgba(247,248,252,.75);
  --on-ink: #f7f8fc; --ink-hi: #1a35b8; --code-bg: rgba(255,255,255,.7);
  --accent: #2343d6; --accent-rgb: 35,67,214;
  --star-warm: 16,26,56; --star-cool: 35,67,214; --glow: 35,67,214; --star-a: .55;
  --tint-warm: 35,67,214; --tint-cool: 35,67,214; --body-w: 400;
  color-scheme: light;
}
* { box-sizing: border-box; margin: 0; padding: 0 }
html { background: var(--night); scroll-behavior: smooth }
body { background: var(--sky) fixed; min-height: 100vh }

/* day/night switch: the new sky spreads out in a circle from the button (theme.js drives it) */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal }
body { color: var(--ink); font: 16px/1.6 var(--sans); font-weight: var(--body-w); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility }
a { color: inherit; text-decoration: none }
:focus-visible { outline: 1.5px solid var(--ink); outline-offset: 4px; border-radius: 4px }
::selection { background: rgba(var(--ink-rgb),.85); color: var(--on-ink) }

/* the sky behind everything */
canvas.stars { position: fixed; inset: 0; width: 100%; height: 100%; display: block; z-index: 0; pointer-events: none }

/* top bar */
.top { position: fixed; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: center; padding: 24px 36px; z-index: 10; font-size: 14px; font-weight: 400 }
.top .me { font-family: var(--serif); font-size: 21px; font-weight: 500; letter-spacing: .01em }
.top nav { display: flex; align-items: center; gap: 28px; color: var(--dim) }
.top nav a { transition: color .3s; padding: 12px 2px; margin: -12px -2px }
.top nav a:hover, .top nav a[aria-current] { color: var(--ink) }
.top.solid { background: linear-gradient(var(--night) 58%, rgba(var(--bg-rgb),0)) }

/* sun / moon switch, added to the top bar by theme.js */
.theme { background: none; border: 0; color: var(--dim); cursor: pointer; padding: 10px; margin: -10px -4px -10px 0; display: inline-grid; place-items: center; transition: color .3s }
.theme:hover { color: var(--accent) }
.theme svg { transition: transform .7s cubic-bezier(.16,1,.3,1) }
.theme:active svg { transform: rotate(90deg) scale(.85) }
.theme svg { width: 17px; height: 17px; display: block }
/* day: the one ink does the work night gives to starlight */
[data-theme="light"] .pill.solid { background: var(--accent); border-color: var(--accent) }
[data-theme="light"] .pill:not(.solid):hover { background: rgba(var(--accent-rgb),.06); border-color: var(--accent); color: var(--accent) }
[data-theme="light"] .top nav a:hover, [data-theme="light"] .top nav a[aria-current] { color: var(--accent) }
[data-theme="light"] .page .kicker, [data-theme="light"] .essay-head .eyebrow, [data-theme="light"] .post .meta { color: var(--accent) }
[data-theme="light"] .page h1 em, [data-theme="light"] .group h2, [data-theme="light"] .essay-body h2, [data-theme="light"] .post h2 { color: var(--accent) }
[data-theme="light"] a.post:hover { border-color: var(--accent) }
[data-theme="light"] .essay-body blockquote { color: var(--accent) }
[data-theme="light"] ::selection { background: rgba(var(--accent-rgb),.2); color: var(--ink) }

/* pills */
.pill { display: inline-flex; gap: 8px; align-items: center; padding: 11px 20px; border: 1px solid rgba(var(--ink-rgb),.28); border-radius: 999px; font-size: 14px; font-weight: 400; transition: background .3s, border-color .3s }
.pill:hover { background: rgba(var(--ink-rgb),.08); border-color: var(--ink) }
.pill.solid { background: var(--ink); color: var(--on-ink); border-color: var(--ink); font-weight: 500 }
.pill.solid:hover { background: var(--ink-hi); border-color: var(--ink-hi) }

footer.foot { position: relative; z-index: 2; display: flex; justify-content: space-between; gap: 16px; max-width: 1240px; margin: 0 auto; padding: 28px 36px 40px; color: var(--faint); font-size: 13px; border-top: 1px solid var(--rule) }
footer.foot a:hover { color: var(--ink) }

/* ── drawings (assets/art.js) ── */
/* the drawings: small constellations that carry a caption, never a riddle. Drawn whole on load */
.art { margin: 0 }
.art svg { width: 100%; max-width: 520px; height: auto; display: block; margin: 0 0 0 auto; overflow: visible }
.art figcaption { margin-top: 18px; text-align: right; color: var(--faint); font-size: 13.5px }
.art .ln { stroke: var(--line); stroke-width: 1 }
.art .st { fill: var(--ink); opacity: .9 }
.art .st.lit { filter: drop-shadow(0 0 5px rgba(var(--glow),.9)); fill: var(--accent) }
.art .ha { fill: url(#halo); opacity: .6 }
.art .tx { fill: var(--dim); font-family: var(--sans); font-weight: 300 }
.art .tx.big { fill: var(--ink); font-family: var(--serif); font-weight: 500 }
.art .tx.it { fill: var(--ink); font-family: var(--serif); font-style: italic }
.art .flow { fill: none; stroke: var(--ink); stroke-width: .6; opacity: .12 }
.art .packet { fill: rgb(var(--star-warm)); filter: drop-shadow(0 0 3px rgba(var(--star-warm),.9)) }
.art .ln.back { fill: none; stroke-dasharray: 3 5; opacity: .7 }
[data-theme="light"] .art .st { fill: var(--accent); opacity: 1 }
[data-theme="light"] .art .st.lit, [data-theme="light"] .art .packet { filter: none }
[data-theme="light"] .art .ha { display: none }
[data-theme="light"] .art .ha.lit { display: inline; fill: none; stroke: var(--accent); stroke-width: 1; r: 10px; opacity: .45 }
[data-theme="light"] .art .flow { stroke: var(--accent); opacity: .22 }

/* ── reading pages (writing, memo, stack) ── */
.page { position: relative; z-index: 2; max-width: 760px; margin: 0 auto; padding: 150px 28px 96px }
.page .kicker { color: var(--faint); font-size: 14px }
.page h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(44px, 6vw, 76px); line-height: 1.04; letter-spacing: -.015em; margin-top: 10px }
.page h1 em { font-style: italic }
.page .lede { margin-top: 18px; font-size: 19px; color: var(--dim); max-width: 52ch }

/* writing index */
.posts { margin-top: 64px; display: grid; gap: 18px }
.post { display: block; padding: 28px 30px; border: 1px solid var(--rule); border-radius: 16px; transition: border-color .3s, transform .3s cubic-bezier(.16,1,.3,1) }
a.post:hover { border-color: rgba(var(--ink-rgb),.4); transform: translateY(-2px) }
.post .meta { color: var(--faint); font-size: 13.5px }
.post h2 { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 34px; line-height: 1.1; margin-top: 8px }
.post p { color: var(--dim); margin-top: 10px }
.post.soon { opacity: .6 }

/* stack */
.group { margin-top: 64px }
.group h2 { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 32px }
.group > p { color: var(--dim); margin-top: 6px; max-width: 56ch }
.tools { margin-top: 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 0 40px }
.tool { padding: 16px 0; border-top: 1px solid var(--rule) }
.tool b { font-weight: 500; display: block }
.tool span { color: var(--dim); font-size: 14.5px; display: block; margin-top: 4px }

/* memo */
.essay { position: relative; z-index: 2; max-width: 760px; margin: 0 auto; padding: 150px 28px 96px }
.essay-head .eyebrow { color: var(--faint); font-size: 14px }
.essay-head h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(40px, 5.4vw, 66px); line-height: 1.06; letter-spacing: -.01em; margin-top: 12px }
.essay-head .frame { margin-top: 20px; color: var(--dim); font-size: 17px }
.essay-head .frame-update { margin-top: 10px; color: var(--faint); font-size: 15px }
.essay-body { margin-top: 56px; font-size: 18px; line-height: 1.75 }
.essay-body h2 { font-family: var(--serif); font-style: italic; font-weight: 500; font-size: 34px; line-height: 1.15; margin: 56px 0 14px }
.essay-body h3 { font-weight: 500; font-size: 19px; margin: 32px 0 8px }
.essay-body p { margin: 0 0 18px; color: rgba(var(--ink-rgb),.86) }
.essay-body strong { font-weight: 500; color: var(--ink) }
.essay-body ul, .essay-body ol { margin: 0 0 18px 22px; color: rgba(var(--ink-rgb),.86) }
.essay-body li { margin-bottom: 6px }
.essay-body a { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px }
.essay-body blockquote { margin: 0 0 22px; padding: 0; font-family: var(--serif); font-style: italic; font-size: 26px; line-height: 1.35; color: var(--ink) }
.essay-body blockquote p { color: inherit; margin: 0 }
.essay-body .callout { margin: 26px 0; padding: 20px 24px; border: 1px solid var(--rule); border-radius: 16px }
.essay-body .callout p { margin: 0 }
.essay-body pre { margin: 22px 0 26px; padding: 20px; overflow-x: auto; border: 1px solid var(--rule); border-radius: 16px; background: var(--code-bg); font: 12.5px/1.5 ui-monospace, 'SF Mono', Menlo, monospace; color: rgba(var(--ink-rgb),.82) }
.essay-body table { width: 100%; border-collapse: collapse; margin: 18px 0 26px; font-size: 15px }
.essay-body th, .essay-body td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--rule); vertical-align: top }
.essay-body th { font-weight: 500; color: var(--dim) }
.essay-body code { font: .88em ui-monospace, 'SF Mono', Menlo, monospace }
.status-frame { margin-top: 48px; padding: 24px 26px; border: 1px solid var(--rule); border-radius: 16px }
.status-head { font-family: var(--serif); font-style: italic; font-size: 26px; margin-bottom: 8px }
.essay-foot { margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--rule); color: var(--faint); font-size: 14px }
.essay-foot .back { color: var(--ink) }

@media (max-width: 760px) {
  .top { padding: 18px 20px } .top nav { gap: 18px; font-size: 14px }
  .top nav a.wide { display: none }
  .page, .essay { padding: 120px 20px 72px }
  .tools { grid-template-columns: minmax(0, 1fr) }
  footer.foot { padding: 24px 20px 32px; flex-direction: column }
}

/* Cormorant defaults to old-style figures; headings read better with lining numerals */
h1, h2, h3 { font-variant-numeric: lining-nums }
