/* Space backgrounds layered over the particle film: black hole, the Sun, a planet per domain,
   Earth and the aurora landing. Black areas of this canvas drop out with the screen blend. */
.space { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; display: block; mix-blend-mode: screen; }
.no-gl .space { display: none; }

/* ---------- Work: fly past the nine planets */
.orbit { height: var(--orbit-h, 400vh); position: relative; }
.orbit-pin { position: sticky; top: 0; height: 100svh; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr auto; padding: clamp(84px, 12vh, 120px) 0 clamp(28px, 5vh, 52px); }
.orbit-hint { padding: 0 var(--m); font-weight: 600; font-size: var(--t-big); letter-spacing: -.02em; color: var(--ink-2); max-width: 44ch; }
.worlds { display: flex; align-items: center; padding-left: var(--track-pad, 30vw); will-change: transform; }
.world { flex: 0 0 var(--slot, clamp(300px, 30vw, 460px)); display: grid; place-items: center; }
.world-btn { display: grid; justify-items: center; text-align: center; gap: 8px; width: 100%; padding: 12px 18px 20px; border-radius: 24px; }
.world-btn > :not(.world-orb) { opacity: var(--focus, 1); }
.world-orb { width: calc(var(--slot, 30vw) * .5 * var(--sz, 1)); max-width: 260px; aspect-ratio: 1; border-radius: 50%; margin-bottom: clamp(14px, 3vh, 34px); }
.no-gl .world-orb { background: radial-gradient(circle at 34% 30%, color-mix(in srgb, var(--tint) 85%, #fff), color-mix(in srgb, var(--tint) 45%, #000) 60%, #000 100%); box-shadow: 0 0 60px -10px var(--tint); }
.world-no { font: 600 .8125rem "Text"; letter-spacing: .16em; text-transform: uppercase; color: var(--tint); }
.world-name { font: 900 clamp(1.75rem, 2.6vw, 2.5rem)/1 "Display"; letter-spacing: -.04em; }
.world-sub { max-width: 30ch; font-size: .9875rem; line-height: 1.45; color: var(--ink-2); }
.world-cta { margin-top: 8px; display: inline-flex; gap: 8px; align-items: center; padding: 10px 18px; border-radius: 999px; font-weight: 600; font-size: .9375rem; background: rgba(255,255,255,.07); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tint) 45%, transparent); transition: background-color 250ms ease; }
.world-cta span { transition: transform 250ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) {
  .world-btn:hover .world-cta { background: color-mix(in srgb, var(--tint) 22%, transparent); }
  .world-btn:hover .world-cta span { transform: translateX(4px); }
}
.world-btn:focus-visible { outline-offset: -2px; }
.orbit-rail { margin: 0 var(--m); height: 2px; background: rgba(255,255,255,.12); border-radius: 2px; overflow: hidden; }
.orbit-rail i { display: block; height: 100%; background: var(--accent); transform-origin: left; transform: scaleX(var(--p, 0)); }
/* reduced motion: the planets simply wrap */
html:not(.motion) .orbit { height: auto; }
html:not(.motion) .orbit-pin { position: relative; height: auto; overflow: visible; }
html:not(.motion) .worlds { flex-wrap: wrap; justify-content: center; padding: 32px var(--m) 0; transform: none !important; gap: 24px 0; }
html:not(.motion) .world { flex-basis: min(360px, 100%); }
html:not(.motion) .orbit-rail { display: none; }

/* Empty stretches of scroll where the stars streak past: the trip between scenes */
.travel { height: var(--h, 120svh); position: relative; pointer-events: none; }
html:not(.motion) .travel, .no-gl .travel { height: 0; }
#bg { transition: none; }

/* Landing: the whole name and copy on the left, the black hole on the right */
@media (min-width: 900px) {
  .hero-inner { max-width: min(62vw, 960px); }
  .hero-title { font-size: clamp(4.5rem, min(11vw, 21svh), 14rem); }
  .hero-title .line:last-child { text-align: left; margin-right: 0; }
  .hero-row { grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
  .portrait { width: min(250px, 17vw, 30svh); }
  .portrait figcaption { display: none; }
}

/* Work: the planet track is the whole section */
.page-home .work { margin-top: 0; }
.orbit-head { padding: 0 var(--m); display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px 40px; }
.orbit-title { font-size: clamp(3rem, 7vw, 6.5rem); line-height: .9; }
.orbit-head .orbit-hint { padding: 0; max-width: 40ch; }

/* Project sheets: one dialog per planet */
.sheet { width: min(1240px, calc(100vw - 2 * var(--m))); max-width: none; max-height: calc(100svh - 48px); margin: auto; padding: 0; border: 0; border-radius: 30px; color: var(--ink); overflow: auto; overscroll-behavior: contain;
  background: rgba(6,8,14,.8); -webkit-backdrop-filter: blur(22px) saturate(150%); backdrop-filter: blur(22px) saturate(150%);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.12), inset 0 1px 0 rgba(255,255,255,.18), 0 60px 120px -20px rgba(0,0,0,.9), 0 0 120px -40px var(--tint); }
.sheet::backdrop { background: rgba(0,0,0,.55); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.sheet[open] { animation: sheet-in 620ms var(--ease-out); }
.sheet.closing { animation: sheet-out 260ms ease-in forwards; }
@keyframes sheet-in { from { opacity: 0; transform: translateY(40px) scale(.96); filter: blur(8px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes sheet-out { to { opacity: 0; transform: translateY(20px) scale(.98); } }
.sheet-inner { padding: clamp(22px, 3.4vw, 52px); }
.sheet-head { position: relative; display: grid; gap: 10px; margin-bottom: clamp(24px, 3.4vw, 44px); padding-right: 120px; }
.sheet-planet { font: 600 .875rem "Text"; letter-spacing: .16em; text-transform: uppercase; color: var(--tint); }
.sheet-title { font-size: clamp(2.5rem, 6vw, 5.5rem); line-height: .9; letter-spacing: -.05em; }
.sheet-sub { font-size: var(--t-big); font-weight: 600; color: var(--ink-2); letter-spacing: -.02em; }
.sheet-sub span { margin-left: 10px; font-size: .8em; color: var(--tint); }
.sheet-close { position: absolute; top: 0; right: 0; display: inline-flex; gap: 10px; align-items: center; min-height: 44px; padding: 0 18px; border-radius: 999px; font-weight: 600; background: rgba(255,255,255,.08); box-shadow: inset 0 0 0 1px rgba(255,255,255,.16); }
.sheet-close kbd { font: inherit; font-size: .75rem; color: var(--ink-3); }
@media (hover: hover) and (pointer: fine) { .sheet-close:hover { background: rgba(255,255,255,.16); } }
@media (max-width: 640px) { .sheet-head { padding-right: 0; padding-top: 56px; } .sheet-close kbd { display: none; } }
.sheet .glass { opacity: 1 !important; filter: none !important; --ty: 0px; }
.sheet .g-body { align-content: start; gap: 12px; }
html:has(.sheet[open]) { overflow: hidden; }

/* pages slide: no extra gaps between screens */
.page-home .experience, .page-home .toolkit, .page-home .contact, .page-home .statement { margin-top: 0; }
[data-page] { will-change: transform, opacity; transform-origin: 50% 30%; }

/* ---------- Tech stack as a star chart */
.sky { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px clamp(16px, 2vw, 28px); }
.const { position: relative; padding: 14px 16px 6px; border-radius: 20px; background: radial-gradient(120% 100% at 50% 0%, rgba(120,140,255,.07), transparent 70%); box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); transition: box-shadow 300ms ease, background-color 300ms ease; }
.const-name { display: flex; justify-content: space-between; align-items: baseline; font: 600 .8125rem "Text"; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.const-name b { font: 900 1.25rem "Display"; letter-spacing: -.02em; color: rgba(255,255,255,.25); }
.const-field { position: relative; height: clamp(170px, 24svh, 240px); }
.const-lines { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.const-lines polyline { fill: none; stroke: rgba(170,190,255,.35); stroke-width: 1; vector-effect: non-scaling-stroke; stroke-dasharray: 3 4; transition: stroke 300ms ease; }
.const-field ul { position: absolute; inset: 0; }
.const-field li { position: absolute; transform: translate(-50%, -50%); }
.sky .skill { font: 600 .875rem/1.15 "Text"; letter-spacing: 0; display: grid; justify-items: center; gap: 6px; color: var(--ink-2); padding: 4px; text-align: center; white-space: nowrap; opacity: 1; filter: none; transform: none; text-decoration: none; }
.sky .skill i { width: 7px; height: 7px; border-radius: 50%; background: #fff; box-shadow: 0 0 8px 2px rgba(170,200,255,.7), 0 0 22px 4px rgba(120,140,255,.35); }
.sky .skill.big i { width: 11px; height: 11px; box-shadow: 0 0 12px 3px rgba(255,230,180,.85), 0 0 34px 8px rgba(255,170,90,.35); }
.motion .sky .skill i { animation: twinkle var(--tw, 3s) ease-in-out infinite alternate; }
@keyframes twinkle { from { opacity: .55; transform: scale(.8); } to { opacity: 1; transform: scale(1.1); } }
.sky .skill span { transition: color 200ms ease; }
.const:hover { box-shadow: inset 0 0 0 1px rgba(160,180,255,.22); }
.const:hover .const-lines polyline { stroke: rgba(190,210,255,.7); stroke-dasharray: none; }
.sky .skill:hover span, .sky .skill:focus-visible span, .sky .skill.on span { color: #fff; }
.sky .skill:hover i, .sky .skill.on i { transform: scale(1.8); animation: none; box-shadow: 0 0 14px 4px #fff, 0 0 40px 10px var(--c2); }
.sky .skill.on span { text-decoration: none; background: var(--accent); -webkit-background-clip: text; background-clip: text; color: transparent; }
.motion .const .skill { opacity: 0; }
.motion .const.in .skill { opacity: 1; transition: opacity 700ms var(--ease-out); transition-delay: calc(var(--n) * 25ms); }
.page-home .toolkit .used { margin-top: 22px; }
@media (max-width: 1099px) { .sky { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .sky { grid-template-columns: 1fr; } .const-field { height: 150px; } }

/* custom cursor can't reach the top layer: use the system pointer inside dialogs */
html:has(dialog[open]) .cursor, html:has(dialog[open]) .cursor-dot { opacity: 0 !important; }
html.has-cursor:has(dialog[open]) dialog, html.has-cursor:has(dialog[open]) dialog * { cursor: auto !important; }
html.has-cursor:has(dialog[open]) dialog a, html.has-cursor:has(dialog[open]) dialog button { cursor: pointer !important; }

/* ---------- What I do: three stops on one orbit, sensor to server to screen */
.page-home .statement-pin { justify-content: center; gap: clamp(18px, 3vh, 34px); padding-top: 90px; padding-bottom: 40px; }
.st-head { font-size: clamp(2.4rem, 5.2vw, 5.4rem); line-height: .92; letter-spacing: -.05em; max-width: 16ch; }
.st-orbits { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(20px, 3vw, 48px); padding-top: 54px; max-width: 1180px; }
.st-orbits::before { content: ""; position: absolute; left: -4%; right: -4%; top: 0; height: 120px; border-top: 1px solid rgba(255,255,255,.22); border-radius: 50% 50% 0 0 / 100% 100% 0 0; pointer-events: none; }
.st-orbit { position: relative; display: grid; gap: 8px; align-content: start; }
.st-planet { position: absolute; top: -54px; left: 0; width: 22px; height: 22px; border-radius: 50%; transform: translateY(-50%);
  background: radial-gradient(circle at 35% 30%, #fff, var(--c) 45%, color-mix(in srgb, var(--c) 30%, #000) 100%); box-shadow: 0 0 18px 2px color-mix(in srgb, var(--c) 60%, transparent); }
.st-orbit:nth-child(1) .st-planet { top: -30px; }
.st-orbit:nth-child(2) .st-planet { top: -56px; width: 26px; height: 26px; }
.st-orbit:nth-child(3) .st-planet { top: -36px; width: 18px; height: 18px; }
.motion .st-planet { animation: bob 5s ease-in-out infinite alternate; }
.st-orbit:nth-child(2) .st-planet { animation-delay: -1.6s; } .st-orbit:nth-child(3) .st-planet { animation-delay: -3.1s; }
@keyframes bob { to { transform: translateY(calc(-50% - 6px)); } }
.st-no { font: 600 .875rem "Text"; letter-spacing: .16em; text-transform: uppercase; color: var(--c); }
.st-line { font-size: clamp(1.0625rem, 1.3vw, 1.3rem); font-weight: 600; line-height: 1.4; letter-spacing: -.01em; color: #e6e6ee; max-width: 30ch; }
.st-tech { font-size: .9375rem; font-weight: 600; color: var(--ink-3); }
.page-home .statement .stat-row { gap: 10px 48px; }
.page-home .statement .stat-row b { font-size: clamp(2.25rem, 3.6vw, 3.5rem); }
@media (max-width: 899px) {
  .st-orbits { grid-template-columns: 1fr; padding: 0 0 0 34px; gap: 22px; }
  .st-orbits::before { left: 10px; right: auto; top: 6px; bottom: 6px; width: 1px; height: auto; border: 0; background: rgba(255,255,255,.2); border-radius: 0; }
  .st-planet, .st-orbit:nth-child(n) .st-planet { top: 4px; left: -34px; transform: none; }
  @keyframes bob { to { transform: translateY(-4px); } }
}

/* star chart v2: real constellations, solid lines, stars graded by brightness */
.const { background: radial-gradient(90% 80% at 50% 45%, rgba(90,110,220,.09), transparent 75%); }
.const-name em { font: 500 italic .8125rem "Text"; letter-spacing: .04em; text-transform: none; color: rgba(190,205,255,.45); }
.const-lines line { stroke: rgba(170,195,255,.32); stroke-width: 1; vector-effect: non-scaling-stroke; transition: stroke 300ms ease; }
.const:hover .const-lines line { stroke: rgba(205,220,255,.8); }
.sky .skill { gap: 7px; }
.sky .skill i { position: relative; width: 4px; height: 4px; background: #fff; border-radius: 50%; box-shadow: 0 0 4px 1px rgba(200,215,255,.8), 0 0 12px 2px rgba(140,160,255,.35); }
.sky .skill.m1 i { width: 5px; height: 5px; }
.sky .skill.m2 i { width: 7px; height: 7px; box-shadow: 0 0 6px 2px rgba(225,235,255,.9), 0 0 20px 5px rgba(150,175,255,.4); }
.sky .skill.m3 i { width: 9px; height: 9px; box-shadow: 0 0 8px 3px rgba(255,244,220,.95), 0 0 30px 8px rgba(255,200,140,.4); }
/* diffraction spikes on the bright ones, like a real photo of the sky */
.sky .skill.m2 i::before, .sky .skill.m2 i::after, .sky .skill.m3 i::before, .sky .skill.m3 i::after { content: ""; position: absolute; left: 50%; top: 50%; background: linear-gradient(90deg, transparent, rgba(255,255,255,.75), transparent); transform: translate(-50%, -50%); }
.sky .skill.m2 i::before { width: 26px; height: 1px; } .sky .skill.m2 i::after { width: 1px; height: 26px; background: linear-gradient(transparent, rgba(255,255,255,.75), transparent); }
.sky .skill.m3 i::before { width: 40px; height: 1px; } .sky .skill.m3 i::after { width: 1px; height: 40px; background: linear-gradient(transparent, rgba(255,255,255,.8), transparent); }
.sky .skill span { font-size: .8125rem; }
.sky .skill:hover i, .sky .skill.on i { transform: scale(1.6); }
