/* ==========================================================================
   Nexiv Studio v1.1 — components & motion (loads after main.css)
   ========================================================================== */

/* Header: hides on scroll down, returns on scroll up */
.site-head { transition: transform .45s var(--ease), border-color .2s var(--ease); }
.site-head.is-hidden { transform: translateY(-100%); }
.progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; pointer-events: none; }
.progress span { display: block; height: 100%; background: var(--signal); transform: scaleX(0); transform-origin: 0 50%; }

/* Mobile nav CTA */
.nav__extra .btn { justify-self: start; }

/* Bigger, bolder hero title on phones */
@media (max-width: 600px) {
	.hero__title { font-size: clamp(3.3rem, 16.5vw, 5rem); letter-spacing: -.04em; }
	.hero__eyebrow { font-size: 12px; }
}

/* Cursor follower (fine pointers only) */
.cursor { position: fixed; left: 0; top: 0; z-index: 90; pointer-events: none; width: 0; height: 0; display: none; }
@media (hover: hover) and (pointer: fine) { .cursor { display: block; } }
.cursor span {
	position: absolute; left: 0; top: 0; translate: -50% -50%;
	display: grid; place-items: center; width: 84px; height: 84px; border-radius: 50%;
	background: var(--signal); color: var(--ink);
	font-size: 13px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
	scale: 0; transition: scale .35s cubic-bezier(.34, 1.56, .64, 1);
}
.cursor.is-on span { scale: 1; }
.motion-off .cursor { display: none; }

/* Hero rotating badge */
.badge { display: none; }
@media (min-width: 960px) {
	.badge {
		position: absolute; right: var(--gutter); top: clamp(120px, 14vw, 200px);
		display: grid; place-items: center; width: clamp(150px, 13vw, 200px); aspect-ratio: 1;
		color: var(--paper); text-decoration: none; border-radius: 50%;
	}
}
.badge__ring { position: absolute; inset: 0; width: 100%; height: 100%; animation: spin 22s linear infinite; }
.badge__ring text { fill: currentColor; font-family: var(--f-display); font-size: 15px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.badge__mark { position: relative; width: 28%; aspect-ratio: 1; border-radius: 50%; background: var(--signal); display: grid; place-items: center; transition: transform .5s cubic-bezier(.34, 1.56, .64, 1); }
.badge__mark::before, .badge__mark::after { content: ""; position: absolute; left: 50%; translate: -50% 0; background: var(--ink); }
.badge__mark::before { top: 22%; width: 14%; height: 36%; }
.badge__mark::after { bottom: 20%; width: 14%; aspect-ratio: 1; border-radius: 50%; }
.badge:hover { color: var(--signal); }
.badge:hover .badge__mark { transform: scale(1.25) rotate(-12deg); }
.badge:hover .badge__ring { animation-duration: 6s; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .badge__ring { animation: none; } }

/* Hero work reel */
.reel { margin-top: clamp(48px, 7vw, 88px); overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); }
.reel__track { display: flex; align-items: center; gap: clamp(12px, 1.6vw, 20px); width: max-content; list-style: none; margin: 0; padding: 0; animation: marquee 60s linear infinite; }
.reel:hover .reel__track, .reel:focus-within .reel__track { animation-play-state: paused; }
.reel__item a { display: block; width: clamp(200px, 22vw, 320px); aspect-ratio: 4 / 3; overflow: hidden; background: var(--ink-2); }
.reel__item:nth-child(even) a { aspect-ratio: 3 / 4; width: clamp(150px, 16vw, 240px); }
.reel__item img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.85); transition: transform .6s var(--ease), filter .4s var(--ease); }
.reel__item a:hover img, .reel__item a:focus-visible img { transform: scale(1.06); filter: none; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* Services ticker */
.ticker { background: var(--signal); color: var(--ink); overflow: hidden; border-block: 1.5px solid var(--ink); }
.ticker__track { display: flex; align-items: center; width: max-content; padding-block: clamp(14px, 2vw, 22px); animation: marquee 38s linear infinite; }
.ticker__item { font-size: clamp(1.6rem, 3.6vw, 3rem); font-weight: 900; font-stretch: 120%; letter-spacing: -.02em; line-height: 1; white-space: nowrap; padding-inline: clamp(16px, 2vw, 28px); }
.ticker__bang { font-size: clamp(1.6rem, 3.6vw, 3rem); font-weight: 900; line-height: 1; color: var(--paper); -webkit-text-stroke: 1.5px var(--ink); }
.ticker:hover .ticker__track { animation-duration: 90s; }
@media (prefers-reduced-motion: reduce) {
	.reel__track, .ticker__track { animation: none; }
	.reel { overflow-x: auto; -webkit-mask-image: none; mask-image: none; }
}

/* Process */
.process .h2 { max-width: 14ch; margin-bottom: clamp(32px, 5vw, 64px); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-6); }
.steps__item { position: relative; padding-top: var(--s-6); border-top: 1.5px solid var(--ink); }
@media (min-width: 860px) {
	.steps { grid-template-columns: repeat(3, 1fr); gap: 0; }
	.steps__item { padding-right: var(--s-7); }
	.steps__item + .steps__item { padding-left: var(--s-6); border-left: 1px solid var(--line); }
	.steps__item:nth-child(2) { margin-top: var(--s-8); }
	.steps__item:nth-child(3) { margin-top: calc(var(--s-8) * 2); }
}
.steps__num { display: block; margin-bottom: var(--s-5); font-size: clamp(3.5rem, 6vw, 5.5rem); font-weight: 900; font-stretch: 125%; line-height: .9; letter-spacing: -.04em; color: transparent; -webkit-text-stroke: 1.5px var(--ink); transition: color .3s var(--ease), -webkit-text-stroke-color .3s var(--ease); }
.steps__item:hover .steps__num { color: var(--signal); -webkit-text-stroke-color: var(--signal); }
.steps__title { font-size: 1.45rem; font-stretch: 108%; margin-bottom: var(--s-3); }
.steps__text { margin: 0; max-width: 36ch; font-family: var(--f-text); font-size: 1.1rem; color: #3b3832; }

.faq-wrap__more { margin-top: var(--s-6); font-family: var(--f-text); font-size: 1.1rem; color: var(--stone); }
.faq-wrap__more a { color: var(--ink); font-weight: 600; }
.faq__a { overflow: hidden; }

/* Breadcrumbs */
.crumbs { margin-bottom: var(--s-5); }
.crumbs ol { display: flex; flex-wrap: wrap; gap: 4px; list-style: none; margin: 0; padding: 0; font-size: 13px; color: var(--stone); }
.crumbs li + li::before { content: "/"; margin-right: 4px; color: var(--stone-light); }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--signal-deep); text-decoration: underline; }
.crumbs [aria-current] { color: var(--ink); }

/* Journal */
.journal-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: var(--s-5); margin-bottom: var(--s-7); }
.journal-bar .chips { margin: 0; }
.journal-bar__search { flex: 0 1 340px; }
.journal-bar__search .searchform input, .journal-bar__search .searchform .btn { min-height: 44px; }

.feature { display: grid; gap: var(--s-6); margin-bottom: clamp(48px, 7vw, 96px); padding-bottom: clamp(48px, 7vw, 96px); border-bottom: 1px solid var(--line); }
@media (min-width: 900px) { .feature { grid-template-columns: 7fr 5fr; align-items: center; gap: var(--s-8); } }
.feature__media { display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--paper-2); }
.feature__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.feature:hover .feature__media img { transform: scale(1.03); }
.feature__tag { background: var(--ink); color: var(--paper); padding: 2px 8px; font-weight: 700; }
.feature__title { margin: var(--s-3) 0 var(--s-4); font-size: clamp(1.9rem, 3.4vw, 3rem); font-stretch: 110%; line-height: 1.02; text-wrap: balance; }
.feature__title a { text-decoration: none; }
.feature__title a:hover { color: var(--signal-deep); }
.feature__excerpt { margin: 0 0 var(--s-5); font-family: var(--f-text); font-size: 1.15rem; color: #4a463f; }

/* Article layout + TOC */
.article__head .crumbs { margin-bottom: var(--s-6); }
.article__hero-frame { overflow: hidden; }
.article__layout .prose { max-width: 720px; margin-inline: auto; }
@media (min-width: 1100px) {
	.article__layout.has-toc { display: grid; grid-template-columns: 240px minmax(0, 720px); justify-content: center; gap: var(--s-9); }
	.article__layout.has-toc .prose { margin: 0; }
	.toc { position: sticky; top: calc(var(--head-h) + 24px); align-self: start; max-height: calc(100vh - var(--head-h) - 48px); overflow: auto; scrollbar-width: none; overscroll-behavior: contain; }
	.toc::-webkit-scrollbar { display: none; }
	.toc__title { pointer-events: none; }
}
.toc__box { margin-bottom: var(--s-7); padding-top: var(--s-4); border-top: 1.5px solid var(--ink); }
.toc__title { margin-bottom: var(--s-3); font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; cursor: pointer; list-style: none; }
.toc__title::-webkit-details-marker { display: none; }
.toc ol { display: grid; gap: 2px; list-style: none; margin: 0; padding: 0; counter-reset: toc; }
.toc li { counter-increment: toc; }
.toc a { display: grid; grid-template-columns: 1.8rem 1fr; padding: 6px 0; font-size: 14px; line-height: 1.35; color: var(--stone); text-decoration: none; transition: color .2s var(--ease); }
.toc a::before { content: counter(toc, decimal-leading-zero); padding-top: 1px; font-size: 12px; font-variant-numeric: tabular-nums; }
.toc a:hover, .toc a.is-active { color: var(--ink); }
.toc a.is-active::before { color: var(--signal-deep); }

.article-cta { position: relative; overflow: hidden; margin-top: 3em; padding: clamp(24px, 4vw, 40px); background: var(--ink); color: var(--paper); font-family: var(--f-display); }
.article-cta::after { content: "!"; position: absolute; right: -.05em; bottom: -.28em; font-size: 12rem; font-weight: 900; line-height: 1; color: var(--signal); pointer-events: none; }
.prose .article-cta__eyebrow { margin: 0 0 var(--s-2); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--stone-light); }
.prose .article-cta__title { position: relative; z-index: 1; max-width: 22ch; margin: 0 0 var(--s-5); font-size: clamp(1.4rem, 2.4vw, 1.9rem); font-weight: 800; font-stretch: 110%; line-height: 1.15; color: var(--paper); }
.article-cta .btn { position: relative; z-index: 1; }
.prose .article-cta a.btn { color: var(--ink); text-decoration: none; }

.share__copy { padding: 0; background: none; border: 0; font: inherit; color: var(--stone); cursor: pointer; text-decoration: underline; text-underline-offset: .2em; }
.share__copy:hover { color: var(--signal-deep); }

/* Project */
.project__intro { display: grid; gap: var(--s-6); margin-top: var(--s-6); }
@media (min-width: 900px) { .project__intro { grid-template-columns: 7fr 4fr; align-items: end; gap: var(--s-9); } }
.project__intro .page-head__intro { margin: 0; }
.project__meta { display: grid; grid-template-columns: repeat(3, auto); justify-content: start; gap: var(--s-6); margin: 0; padding-top: var(--s-4); border-top: 1.5px solid var(--ink); }
.project__meta dt { margin-bottom: 4px; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--stone); }
.project__meta dd { margin: 0; font-weight: 700; }
.project__meta a { text-decoration: none; }
.page-head--project { padding-bottom: var(--s-7); }
.project__hero img { width: 100%; height: auto; }
.project-cta { border-top: 1px solid var(--line); }
.project-cta__inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--s-5); padding-block: clamp(40px, 6vw, 72px); }
.project-cta__title { margin: 0; font-size: clamp(1.6rem, 3.4vw, 2.6rem); font-weight: 900; font-stretch: 115%; letter-spacing: -.02em; line-height: 1.05; }
.next-project__link { position: relative; }
.next-project__peek { position: absolute; right: var(--gutter); top: 50%; width: clamp(120px, 16vw, 220px); aspect-ratio: 4 / 3; overflow: hidden; translate: 0 -50%; scale: .85; rotate: 4deg; opacity: 0; transition: opacity .35s var(--ease), scale .5s cubic-bezier(.34, 1.56, .64, 1), rotate .5s var(--ease); }
.next-project__peek img { width: 100%; height: 100%; object-fit: cover; }
.next-project__link:hover .next-project__peek, .next-project__link:focus-visible .next-project__peek { opacity: 1; scale: 1; rotate: -2deg; }
@media (max-width: 700px) { .next-project__peek { display: none; } }

/* Cards: clamp excerpts so rows stay even */
.card__excerpt { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* Focus ring on dark backgrounds */
.section--ink :focus-visible, .hero :focus-visible, .site-head :focus-visible, .site-foot :focus-visible, .next-project :focus-visible, .article-cta :focus-visible { outline-color: var(--paper); }
