/* Nuvella Labs home, founder page and the personal site: scroll-driven layer on top of home.css. */
.progress { position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 40; background: transparent; pointer-events: none; }
.progress i { display: block; height: 100%; width: 100%; background: var(--terracotta); transform-origin: 0 50%; transform: scaleX(var(--scroll, 0)); }

/* Reveal on scroll (JS adds .in; no-JS and reduced-motion show everything) */
.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s cubic-bezier(.2,.7,.2,1), transform .8s cubic-bezier(.2,.7,.2,1); transition-delay: var(--d, 0s); }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .js .reveal { opacity: 1; transform: none; transition: none; } }

/* Labs hero: type is the picture */
.lhero { min-height: min(92vh, 860px); display: grid; align-items: end; padding: clamp(56px, 9vw, 120px) 0 clamp(40px, 6vw, 80px); position: relative; overflow: clip; }
.lhero h1 { font-size: clamp(3rem, 1rem + 9vw, 9.6rem); line-height: .94; letter-spacing: -.035em; max-width: 11ch; }
.lhero h1 .ln { display: block; overflow: hidden; }
.lhero h1 .ln > span { display: block; transform: translateY(105%); animation: rise 1s cubic-bezier(.2,.8,.2,1) forwards; }
.lhero h1 .ln:nth-child(2) > span { animation-delay: .12s; } .lhero h1 .ln:nth-child(3) > span { animation-delay: .24s; }
@keyframes rise { to { transform: none; } }
@media (prefers-reduced-motion: reduce) { .lhero h1 .ln > span { transform: none; animation: none; } }
.lhero .sub { margin-top: 28px; max-width: 36em; color: var(--muted); font-size: clamp(1.05rem, 1rem + .35vw, 1.3rem); }
.lhero .grid-bg { position: absolute; inset: 0; z-index: -1; opacity: .5; transform: translateY(calc(var(--scroll, 0) * -160px)); }
.lhero .grid-bg path { stroke: var(--rule); stroke-width: 1.2; fill: none; }
.lhero .grid-bg .r { stroke: var(--safe); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 1400; stroke-dashoffset: 1400; animation: draw 3.2s .6s ease forwards; }
@media (prefers-reduced-motion: reduce) { .lhero .grid-bg .r { animation: none; stroke-dashoffset: 0; } }
.meta-row { display: flex; flex-wrap: wrap; gap: 14px 36px; margin-top: 40px; font-size: .92rem; color: var(--muted); }

/* Pinned story */
.story { height: 380vh; position: relative; }
.stage { position: sticky; top: 64px; height: calc(100vh - 64px); display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(24px, 5vw, 72px); align-items: center; }
.steps { position: relative; min-height: 260px; }
.step { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; gap: 14px; opacity: 0; transform: translateY(24px); transition: opacity .5s, transform .5s; pointer-events: none; }
.step.on { opacity: 1; transform: none; pointer-events: auto; }
.step .kicker { color: var(--terracotta); }
.step p { color: var(--muted); max-width: 30em; }
.dots { display: flex; gap: 8px; margin-top: 8px; }
.dots i { width: 28px; height: 4px; border-radius: 2px; background: var(--rule); transition: background .4s; }
.dots i.on { background: var(--ink); }
.stage .route-card { padding: 12px; }
.stage .map .walker { fill: var(--evergreen); stroke: var(--paper); stroke-width: 3; }
.stage .map .ring { fill: none; stroke: var(--terracotta); stroke-width: 3; opacity: 0; }
.stage .map .tag { opacity: 0; transition: opacity .5s; }
.stage .map .tag.on { opacity: 1; }
@media (max-width: 860px) { .stage { grid-template-columns: 1fr; align-content: center; gap: 12px; } .steps { min-height: 190px; order: 2; } }
@media (prefers-reduced-motion: reduce) { .story { height: auto; } .stage { position: static; height: auto; padding: 40px 0; } .steps { min-height: 0; display: grid; gap: 24px; } .step { position: static; opacity: 1; transform: none; } }

/* Product rail */
.rail { display: flex; gap: 18px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 20px 24px; margin-inline: calc((100vw - min(1160px, 100vw - 40px)) / -2); padding-inline: calc((100vw - min(1160px, 100vw - 40px)) / 2); scrollbar-width: thin; }
.prod { flex: 0 0 min(440px, 84vw); scroll-snap-align: start; border-radius: 28px; padding: 30px; min-height: 420px; display: flex; flex-direction: column; gap: 14px; border: 1px solid var(--rule); background: var(--paper); }
.prod.live { background: var(--evergreen); color: #F4F1E9; border-color: transparent; }
.prod.live p { color: #C5D2CC; }
.prod .tagline { font: 600 .74rem/1 var(--body); letter-spacing: .14em; text-transform: uppercase; opacity: .75; }
.prod .grow { flex: 1; }
.prod.next { background: transparent; border-style: dashed; }
.prod.next p { color: var(--muted); }
.btn.on-dark { background: #F4F1E9; color: #192C29; border-color: #F4F1E9; }

/* Numbers */
.nums { display: grid; grid-template-columns: repeat(2, 1fr); gap: 32px; margin-top: 8px; }
.num strong { display: block; font: 700 clamp(3rem, 2rem + 5vw, 6.5rem)/1 var(--display); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.num span { display: block; margin-top: 10px; color: var(--muted); max-width: 22em; }
.num small { display: block; margin-top: 8px; color: var(--muted); font-size: .8rem; }
@media (max-width: 700px) { .nums { grid-template-columns: 1fr; } }
.principles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 1px solid var(--rule); margin-top: clamp(40px, 6vw, 72px); }
.principles > div { padding: 26px 26px 6px 0; }
.principles > div + div { padding-left: 26px; border-left: 1px solid var(--rule); }
.principles p { color: var(--muted); margin-top: 8px; }
@media (max-width: 800px) { .principles { grid-template-columns: 1fr; } .principles > div + div { padding-left: 0; border-left: 0; border-top: 1px solid var(--rule); margin-top: 20px; padding-top: 20px; } }

/* Founder card + pages */
.fcard { display: grid; grid-template-columns: 200px 1fr; gap: clamp(20px, 4vw, 44px); align-items: center; background: var(--paper); border: 1px solid var(--rule); border-radius: 30px; padding: clamp(18px, 3vw, 30px); }
.fcard img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 22px; display: block; }
.fcard h3 { font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.2rem); }
.fcard .role { color: var(--terracotta); font-weight: 600; margin-top: 4px; }
.fcard p { color: var(--muted); margin-top: 12px; max-width: 38em; }
.fcard .links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
@media (max-width: 640px) { .fcard { grid-template-columns: 1fr; } .fcard img { max-width: 220px; } }
.arrow::after { content: " \2192"; }
.phead { padding: clamp(48px, 8vw, 110px) 0 clamp(28px, 4vw, 48px); }
.phead h1 { font-size: clamp(2.6rem, 1.2rem + 6vw, 6rem); line-height: .98; max-width: 14ch; }
.phead .sub { margin-top: 22px; max-width: 36em; color: var(--muted); font-size: clamp(1.05rem, 1rem + .3vw, 1.25rem); }
.prose { max-width: 40em; }
.prose p + p { margin-top: 1em; }
.prose p { color: var(--muted); }
.prose p b { color: var(--ink); font-weight: 600; }

/* Personal site */
.ali-hero .wrap { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: clamp(28px, 6vw, 80px); align-items: center; }
.ali-hero img { width: 100%; max-width: 460px; justify-self: end; aspect-ratio: 4/5; object-fit: cover; border-radius: 36px; box-shadow: 0 40px 70px -35px color-mix(in srgb, var(--ink) 55%, transparent); transform: rotate(1.5deg); }
@media (max-width: 860px) { .ali-hero .wrap { grid-template-columns: minmax(0, 1fr); } .ali-hero img { justify-self: start; max-width: 320px; order: -1; transform: none; } }
.tl { border-left: 2px solid var(--rule); margin: 0; padding: 0 0 0 28px; list-style: none; display: grid; gap: 34px; }
.tl li { position: relative; }
.tl li::before { content: ""; position: absolute; left: -36px; top: .55em; width: 14px; height: 14px; border-radius: 50%; background: var(--ivory); border: 3px solid var(--terracotta); }
.tl .when { font: 600 .78rem/1 var(--body); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.tl h3 { margin: 8px 0 6px; }
.tl p, .tl ul { color: var(--muted); }
.tl ul { margin: 8px 0 0; padding-left: 1.1em; display: grid; gap: 6px; }
.cols { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
@media (max-width: 760px) { .cols { grid-template-columns: 1fr; } }
.tile { border: 1px solid var(--rule); background: var(--paper); border-radius: 22px; padding: 24px 26px; }
.tile h3 { margin-bottom: 10px; }
.tile p, .tile li { color: var(--muted); }
.tile ul { margin: 0; padding-left: 1.1em; display: grid; gap: 6px; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.pill { border: 1px solid var(--rule); border-radius: 999px; padding: 7px 14px; font-size: .9rem; background: var(--paper); }

body { overflow-x: clip; }
