@font-face {
  font-family: 'Space Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/SpaceMono-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Space Mono';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('fonts/SpaceMono-700.woff2') format('woff2');
}

:root {
  color-scheme: dark;
  --bg: #050506;
  --text: #ffffff;
  --font-mono: 'Space Mono', Consolas, 'SFMono-Regular', Menlo, monospace;
  /* used for both the background aurora and every link's text/underline color */
  --aurora-a: #a855f7;
  --aurora-b: #ec4899;
  --aurora-c: #3b82f6;
  --aurora-d: #22d3ee;
  --aurora-e: #34d399;
  --aurora-f: #4ade80;
}

* { box-sizing: border-box; }

/* hidden off-screen until keyboard focus, no transition (snap, not animate) */
.skip-link {
  position: absolute;
  top: -100%;
  left: 12px;
  z-index: 2000;
  background: var(--bg);
  color: var(--text);
  border: 2px solid var(--aurora-a);
  border-radius: 4px;
  padding: 8px 16px;
  font-size: 0.85rem;
  text-decoration: none;
  text-transform: lowercase;
}
.skip-link:focus {
  top: 12px;
}

a {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* native scrollbar hidden, custom .scroll-indicator (below) replaces the
   scroll cue without ever occupying layout space */
html {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
html::-webkit-scrollbar {
  width: 0;
  height: 0;
  background: transparent;
}
.scroll-indicator {
  position: fixed;
  top: 0;
  right: 3px;
  width: 5px;
  border-radius: 3px;
  background: var(--aurora-a);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
  z-index: 1000;
}
.scroll-indicator.visible { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .scroll-indicator { transition: none; }
}

/* consistent, visible keyboard-focus style for every link site-wide —
   never remove this without replacing it with something equally visible */
a:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 3px;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

/* starfield */
.stars {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  /* forces its own compositing layer — works around a mobile Safari bug
     where full-viewport fixed elements can drift/scroll with the page */
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}
.star {
  position: absolute;
  background: #fff;
  border-radius: 50%;
  opacity: 0.2;
  animation: twinkle ease-in-out infinite;
}
@keyframes twinkle {
  0%, 100% { opacity: 0.15; }
  50% { opacity: 0.9; }
}

/* aurora — long, rotated, heavily-blurred ellipses (not circles) so they
   read as swooping diagonal curtains instead of blobs. All bands tilt and
   drift the same down-right (↘) direction. Clustered toward the right so
   it reads fully there and fades out toward the left where the text sits. */
.aurora {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}
.aurora-blob {
  position: absolute;
  border-radius: 50%;
  /* vw, not px: blob width/height are also vw, so this keeps the
     blur-to-blob-size ratio constant at every viewport width instead of
     drifting (a fixed px blur washed blobs out more as they shrank on
     narrow screens, and would under-blur them on very wide ones too) */
  filter: blur(10vw);
  mix-blend-mode: screen;
}
.blob-1 {
  width: 85vw;
  height: 18vw;
  top: -8%;
  right: -30%;
  opacity: 0.3;
  background: radial-gradient(ellipse, var(--aurora-a) 0%, transparent 70%);
  animation: swoop1 34s ease-in-out infinite alternate;
}
.blob-2 {
  width: 78vw;
  height: 16vw;
  top: 8%;
  right: -18%;
  opacity: 0.26;
  background: radial-gradient(ellipse, var(--aurora-b) 0%, transparent 70%);
  animation: swoop2 38s ease-in-out infinite alternate;
}
.blob-3 {
  width: 74vw;
  height: 20vw;
  top: 26%;
  right: -22%;
  opacity: 0.28;
  background: radial-gradient(ellipse, var(--aurora-c) 0%, transparent 70%);
  animation: swoop3 40s ease-in-out infinite alternate;
}
.blob-4 {
  width: 68vw;
  height: 15vw;
  top: 44%;
  right: -12%;
  opacity: 0.24;
  background: radial-gradient(ellipse, var(--aurora-d) 0%, transparent 70%);
  animation: swoop4 36s ease-in-out infinite alternate;
}
.blob-5 {
  width: 76vw;
  height: 19vw;
  top: 34%;
  right: -4%;
  opacity: 0.4;
  background: radial-gradient(ellipse, var(--aurora-e) 0%, transparent 70%);
  animation: swoop5 42s ease-in-out infinite alternate;
}
.blob-6 {
  width: 64vw;
  height: 14vw;
  top: 14%;
  right: 4%;
  opacity: 0.3;
  background: radial-gradient(ellipse, var(--aurora-f) 0%, transparent 70%);
  animation: swoop6 37s ease-in-out infinite alternate;
}
@keyframes swoop1 {
  from { transform: translate(0, 0) rotate(28deg); }
  to   { transform: translate(6%, 7%) rotate(28deg); }
}
@keyframes swoop2 {
  from { transform: translate(0, 0) rotate(32deg); }
  to   { transform: translate(5%, 6%) rotate(32deg); }
}
@keyframes swoop3 {
  from { transform: translate(0, 0) rotate(26deg); }
  to   { transform: translate(7%, 8%) rotate(26deg); }
}
@keyframes swoop4 {
  from { transform: translate(0, 0) rotate(34deg); }
  to   { transform: translate(4%, 5%) rotate(34deg); }
}
@keyframes swoop5 {
  from { transform: translate(0, 0) rotate(30deg); }
  to   { transform: translate(6%, 6%) rotate(30deg); }
}
@keyframes swoop6 {
  from { transform: translate(0, 0) rotate(33deg); }
  to   { transform: translate(5%, 7%) rotate(33deg); }
}

@media (prefers-reduced-motion: reduce) {
  .star, .aurora-blob { animation: none; }
}

/* every page (homepage included) shares the same centered article column;
   see .site-main below for the shared container rules */
.site-main > .hero {
  margin-bottom: 24px;
}
.site-main > nav {
  margin-bottom: 24px;
}

/* project links */
.projects {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.project-link {
  color: var(--aurora-e);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.05rem;
  text-transform: lowercase;
  transition: color 0.2s ease;
}
.project-link:hover, .project-link:focus-visible {
  color: var(--aurora-a);
}
/* underline lives on this inner span, not .project-link itself, so it
   doesn't reach .external-icon: an ancestor's text-decoration line draws
   across every descendant regardless of the descendant's own
   text-decoration value, so the icon can only stay un-underlined by
   never being a descendant of the underlined element in the first place */
.link-text {
  text-decoration: underline;
  text-decoration-color: currentColor;
  text-underline-offset: 4px;
}
.external-icon {
  font-size: 0.9rem;
  color: var(--text);
}

.cat-art {
  display: block;
  width: fit-content;
  margin: 0 auto;
  text-align: left;
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.3;
  white-space: pre;
}
.footer-links {
  margin: 12px 0 0;
  font-size: 0.75rem;
  color: var(--text);
  text-transform: lowercase;
}
/* shared by footer links and site-main body links (privacy/terms prose,
   "back to ydnim.com", email link) — same color/underline/hover treatment,
   declared once instead of twice */
.footer-links a,
.site-main a:not(.project-link) {
  color: var(--aurora-e);
  text-decoration: underline;
  text-decoration-color: var(--aurora-e);
  text-underline-offset: 3px;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}
.footer-links a:hover, .footer-links a:focus-visible,
.site-main a:not(.project-link):hover, .site-main a:not(.project-link):focus-visible {
  color: var(--aurora-a);
  text-decoration-color: var(--aurora-a);
}

/* every page (including the homepage) shares this centered article column */
.site-main {
  position: relative;
  z-index: 1;
  max-width: 640px;
  margin: 0 auto;
  padding: 64px 24px 80px;
  text-transform: lowercase;
}
.site-main h1 {
  font-size: clamp(1.4rem, 4vw, 1.8rem);
  font-weight: 700;
  margin: 0 0 8px;
  text-wrap: balance;
}
.site-main .updated {
  font-size: 0.8rem;
  color: var(--text);
  margin: 0 0 24px;
}
.site-main h2 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 20px 0 8px;
}
.site-main p, .site-main li {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text);
  max-width: 68ch;
  margin: 0 0 14px;
}
.site-main ul:not(.projects) {
  margin: 0 0 14px;
  padding-left: 20px;
}
.site-main li {
  margin-bottom: 4px;
}
/* the shared link rule above uses :not(.project-link) so its underline
   doesn't beat .project-link's own text-decoration:none — .site-main a
   (specificity 0,1,1) is more specific than .project-link alone (0,1,0),
   so without the exclusion it would silently override .project-link's
   rules for the nav links nested inside .site-main, dragging the
   underline back onto the whole link (icon included) */
.back-link {
  display: inline-block;
  margin-top: 48px;
  font-size: 0.85rem;
}

/* shared footer for every page — cat above the copyright/links line, both
   centered. Flows normally at the end of the page (not position:fixed):
   privacy/terms scroll, and a fixed block would overlap article text at
   some viewport widths as the page scrolls. */
.site-footer {
  position: relative;
  z-index: 1;
  max-width: 640px;
  margin: 0 auto;
  padding: 24px 24px 60px;
  text-align: center;
}

@media (max-width: 640px) {
  .site-main { padding: 56px 20px 60px; }
  .site-footer { max-width: 100%; padding: 0 20px 40px; }
  /* blur now scales with blob size (see .aurora-blob), so no override
     needed here — this opacity boost alone compensates for a real
     perceptual effect: the same proportional shape still lights up fewer
     actual screen pixels on a small phone, so it reads as dimmer even at
     an identical blur ratio. */
  .blob-1 { opacity: 0.42; }
  .blob-2 { opacity: 0.36; }
  .blob-3 { opacity: 0.38; }
  .blob-4 { opacity: 0.34; }
  .blob-5 { opacity: 0.5; }
  .blob-6 { opacity: 0.4; }
}
