/* Noxworld theme styles. Tokens come from theme.json (var(--wp--preset--*)); this file is layout,
   the logo, the lit exhibits and motion. Loaded on the front end and inside the editor. */

:root {
	--nox-night: var(--wp--preset--color--night);
	--nox-paper: var(--wp--preset--color--paper);
	--nox-dusk: var(--wp--preset--color--dusk);
	--nox-moon: var(--wp--preset--color--moon);
	--nox-margin: clamp(1rem, 2.1vw, 1.875rem);
	--nox-gutter: clamp(1rem, 2vw, 2rem);
	--nox-header: 4.5rem;
	--nox-section: var(--wp--preset--spacing--70);
	--nox-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

html { background: var(--nox-night); }
body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
.wp-site-blocks > * + * { margin-block-start: 0; }
::selection { background: var(--nox-moon); color: var(--nox-night); }
:where(a) { text-underline-offset: 0.3em; text-decoration-thickness: 1px; }
:where(a):hover { text-decoration-color: var(--nox-moon); }
:focus-visible { outline: 2px solid var(--nox-moon); outline-offset: 4px; }
p { text-wrap: pretty; }
h1, h2, h3 { text-wrap: balance; }

/* ---------- header ---------- */
.nox-site-header {
	position: sticky;
	top: var(--wp-admin--admin-bar--height, 0px);
	z-index: 60;
}
.nox-header {
	height: var(--nox-header);
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	gap: 1rem;
	padding-inline: var(--nox-margin);
	background: var(--nox-night);
	color: var(--nox-paper);
	transition: background-color 300ms ease, color 300ms ease;
}
.nox-header > * { margin: 0 !important; }
.nox-nav .wp-block-navigation-item__content { text-decoration: none; }
.nox-nav .wp-block-navigation-item__content:hover { text-decoration: underline; text-decoration-color: var(--nox-moon); }
.nox-nav .nox-nav-contact { display: none; }
.nox-header-lockup { justify-self: center; }
.nox-lockup { display: block; color: inherit; line-height: 0; }
.nox-lockup svg { height: 1.75rem; width: auto; }
.nox-header-action { justify-self: end; }
.nox-header-action .wp-block-button__link { padding: 0.65rem 1.1rem; }
.nox-site-header .nox-header-lockup { transition: opacity 500ms ease, transform 600ms var(--nox-ease); }
html.js.nox-at-hero .nox-header-lockup { opacity: 0; transform: translateY(-6px); pointer-events: none; }

/* the phone menu: one Night field, large links */
.nox-nav .wp-block-navigation__responsive-container.is-menu-open {
	background: var(--nox-night) !important;
	color: var(--nox-paper) !important;
	padding: calc(var(--nox-header) + 1rem) var(--nox-margin) 2rem;
}
.nox-nav .is-menu-open .wp-block-navigation__responsive-container-content { align-items: flex-start; }
.nox-nav .is-menu-open .wp-block-navigation-item { font-size: var(--wp--preset--font-size--large); font-weight: 300; }
.nox-nav .is-menu-open .nox-nav-contact { display: list-item; }

/* ---------- main ---------- */
.nox-main { padding-bottom: var(--nox-section); }
.nox-main > .wp-block-post-content > *:first-child { margin-block-start: 0; }
.nox-section { padding-top: var(--nox-section); }

/* ---------- hero: logo 99 alone ---------- */
.nox-hero {
	min-height: calc(100svh - var(--nox-header) - var(--wp-admin--admin-bar--height, 0px));
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: clamp(1.5rem, 4vh, 2.75rem);
	padding-block: 2rem 2.5rem;
	overflow-x: clip;
}
.nox-hero > * { margin-block: 0 !important; }
.nox-mark--hero { line-height: 0; display: flex; justify-content: center; max-width: 100%; }
.nox-hero-svg { height: min(68svh, 44rem); width: auto; max-width: 100%; overflow: visible; }
.nox-hero-line { max-width: 24em !important; font-weight: 300; line-height: 1.15; font-size: clamp(1.5rem, 1.05rem + 1.9vw, 2.75rem) !important; }

/* the moon: satellite by default (SMIL in the SVG), or pulse, or still */
.nox-ring { opacity: 0; }
.nox-cutout { fill: var(--nox-night); }
.nox-hero-svg[data-dot="satellite"] .nox-moon,
.nox-hero-svg[data-dot="satellite"] .nox-ring { display: none; }
.nox-hero-svg[data-dot="pulse"] .nox-sat,
.nox-hero-svg[data-dot="still"] .nox-sat,
.nox-hero-svg[data-dot="still"] .nox-ring,
.nox-hero-svg:not([data-dot="satellite"]) .nox-glow { display: none; }
.nox-moon, .nox-ring { transform-box: fill-box; transform-origin: center; }

/* ---------- cards: the Portfolio grid ---------- */
.nox-projects { margin-top: 3rem; }
.nox-projects .wp-block-post-template { gap: 3rem var(--nox-gutter); }
.nox-card { display: grid; gap: 1rem; }
.nox-card > * { margin: 0 !important; }
.nox-card-image { overflow: hidden; background: #000; }
.nox-card-screens { line-height: 0; }
.nox-card-screens a { display: block; }
.nox-card .wp-block-gallery.has-nested-images.is-style-crossfade { margin: 0 !important; }
.nox-card-image img { object-position: top center; transition: transform 900ms var(--nox-ease); }
.nox-card-title { font-size: var(--wp--preset--font-size--large); font-weight: 300; line-height: 1.1; }
.nox-card-title a { text-decoration: none; }
.nox-card-meta, .nox-card-meta p { margin: 0; }
.nox-card-meta .wp-block-post-excerpt__more-text { display: none; }
@media (hover: hover) and (pointer: fine) {
	.nox-card:hover .nox-card-image img { transform: scale(1.03); }
	.nox-card:hover .nox-card-title a { text-decoration: underline; text-decoration-color: var(--nox-moon); }
}
.nox-more { margin-top: 3rem; }

/* ---------- selected work on Home: each client by its logo, on a Paper tile ---------- */
.nox-work { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--nox-gutter); }
.nox-work > * { margin: 0 !important; }
.nox-work > .wp-block-heading { grid-column: 1 / 6; }
.nox-work > .nox-more { grid-column: 1 / 6; grid-row: 2; align-self: end; }
.nox-brands { grid-column: 7 / -1; grid-row: 1 / 3; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3rem var(--nox-gutter); }
.nox-brands > * { margin: 0 !important; }
.nox-brand { display: grid; gap: 0.35rem; align-content: start; }
.nox-brand > * { margin: 0 !important; }
.nox-brand .nox-brand-logo { aspect-ratio: 1; background: var(--nox-paper); overflow: hidden; margin-bottom: 0.9rem !important; }
.nox-brand-logo a { display: grid; place-items: center; width: 100%; height: 100%; }
.nox-brand-logo img { width: 62%; height: auto; max-height: 58%; object-fit: contain; transition: transform 900ms var(--nox-ease); }
.nox-brand-name { font-size: var(--wp--preset--font-size--medium); font-weight: 400; line-height: 1.2; }
.nox-brand-name a { text-decoration: none; }
.nox-brand-about { font-size: var(--wp--preset--font-size--small); color: var(--nox-dusk); }
@media (hover: hover) and (pointer: fine) {
	.nox-brand:hover .nox-brand-logo img { transform: scale(1.04); }
	.nox-brand:hover .nox-brand-name a { text-decoration: underline; text-decoration-color: var(--nox-moon); }
}

/* ---------- services, beside the seal ---------- */
.nox-services { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--nox-gutter); align-items: center; }
.nox-services > * { margin: 0 !important; }
.nox-tile { grid-column: 1 / 6; aspect-ratio: 1; display: grid; place-items: center; }
.nox-tile .nox-mark--seal { width: 74%; line-height: 0; }
.nox-tile .nox-mark--seal svg { width: 100%; height: auto; }
.nox-services-list { grid-column: 7 / 12; }
.nox-offer { display: grid; grid-template-columns: 7rem minmax(0, 1fr); gap: 1.75rem var(--nox-gutter); margin-top: 2.5rem; }
.nox-offer > * { margin: 0 !important; }
.nox-offer-name { font-weight: 500; }

/* ---------- studio and contact ---------- */
.nox-studio { gap: 4rem clamp(2rem, 8vw, 8rem); }
.nox-studio p { max-width: 42ch; }
.nox-button-large .wp-block-button__link { padding: 1rem 1.6rem; font-size: var(--wp--preset--font-size--medium); }

/* ---------- page heads ---------- */
.nox-page-head { padding-top: clamp(4rem, 12vh, 8rem); }
.nox-page-intro { max-width: 34ch; margin-top: 1.5rem; }
.nox-portfolio .nox-projects { margin-top: clamp(3rem, 8vh, 5rem); }

/* ---------- a project ---------- */
.nox-case-head { padding-top: clamp(4rem, 12vh, 8rem); }
.nox-case-title { font-size: clamp(2.75rem, 1rem + 4.5vw, 5.5rem) !important; line-height: 1 !important; }
.nox-case-meta { margin-top: 1rem; }
.nox-case-meta p { margin: 0; }
.nox-facts {
	display: grid;
	grid-template-columns: 8rem minmax(0, 1fr);
	gap: 0.6rem var(--nox-gutter);
	max-width: 40rem;
	margin-top: 3rem !important;
	font-size: var(--wp--preset--font-size--small);
}
.nox-facts > * { margin: 0 !important; }
.nox-fact-label { color: var(--nox-dusk); }

/* the exhibit: a gallery whose screens crossfade (Crossfade style) */
.wp-block-gallery.has-nested-images.is-style-crossfade {
	display: block;
	position: relative;
	aspect-ratio: 16 / 10;
	overflow: hidden;
	background: #000;
	margin-top: clamp(3rem, 8vh, 4.5rem) !important;
}
.wp-block-gallery.has-nested-images.is-style-crossfade figure.wp-block-image {
	position: absolute;
	inset: 0;
	width: 100% !important;
	height: 100%;
	margin: 0 !important;
}
.wp-block-gallery.has-nested-images.is-style-crossfade figure.wp-block-image img {
	width: 100%;
	height: 100% !important;
	object-fit: cover;
	object-position: top center;
}
.wp-block-gallery.is-style-crossfade figure.wp-block-image:not(:first-child) { opacity: 0; }
.wp-block-gallery.is-style-crossfade.is-ready figure.wp-block-image { opacity: 0; transition: opacity 1600ms ease; }
.wp-block-gallery.is-style-crossfade.is-ready figure.wp-block-image.is-current { opacity: 1; }
.wp-block-gallery.is-style-crossfade figcaption { display: none; }

/* three screens at uneven sizes */
.nox-screens {
	display: grid;
	grid-template-columns: repeat(12, minmax(0, 1fr));
	column-gap: var(--nox-gutter);
	row-gap: 2rem;
	align-items: end;
	margin-top: clamp(3rem, 8vh, 5rem) !important;
}
.nox-screens > * { margin: 0 !important; }
.nox-screens img { width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block; }
.nox-screen-square { grid-column: 1 / 5; aspect-ratio: 1; overflow: hidden; }
.nox-screen-phone { grid-column: 6 / 8; }
.nox-screen-wide { grid-column: 9 / 13; aspect-ratio: 16 / 10; overflow: hidden; background: #000; }
/* the second arrangement: phone first, then two desktop screens */
.nox-screens--b .nox-screen-phone { grid-column: 1 / 3; }
.nox-screen-mid { grid-column: 4 / 9; aspect-ratio: 16 / 10; overflow: hidden; background: #000; }
.nox-screens--b .nox-screen-wide { grid-column: 9 / 13; }
.is-style-phone img { filter: brightness(0.92); transition: filter 600ms ease; }
.is-style-phone:hover img { filter: none; }
.nox-notes { margin-top: clamp(3rem, 8vh, 5rem) !important; gap: var(--nox-gutter) clamp(2rem, 8vw, 8rem); }
.nox-notes p { max-width: 52ch; }
.nox-case-nav { margin-top: var(--nox-section) !important; font-size: var(--wp--preset--font-size--small); }
.nox-case-nav a { color: var(--nox-paper); }

/* ---------- footer: only the name, in Paper ---------- */
.nox-footer { padding: clamp(3rem, 10vh, 6rem) var(--nox-margin) var(--nox-margin); }
.nox-footer-word { margin: 0 !important; line-height: 0; }
.nox-footer-word svg { display: block; width: 100%; height: auto; }
.nox-footer-word text { font-family: var(--wp--preset--font-family--jost); font-weight: 400; font-size: 132px; }

/* ---------- 404 ---------- */
.nox-404-mark { width: 5rem; line-height: 0; margin-bottom: 2rem; color: var(--nox-paper); }
.nox-404-mark svg { width: 100%; height: auto; }

/* ---------- tablet and phone ---------- */
@media (max-width: 1000px) {
	.nox-tile { grid-column: 1 / 6; }
	.nox-services-list { grid-column: 7 / -1; }
}
@media (max-width: 781px) {
	:root { --nox-header: 4rem; }
	.nox-header { grid-template-columns: auto 1fr auto; }
	.nox-header-lockup { justify-self: start; }
	.nox-lockup svg { height: 1.5rem; }
	html.js.nox-at-hero .nox-header-lockup { opacity: 1; transform: none; pointer-events: auto; }
	.nox-work > .wp-block-heading, .nox-brands, .nox-work > .nox-more { grid-column: 1 / -1; grid-row: auto; }
	.nox-brands { margin-top: 2rem !important; gap: 2.5rem var(--nox-gutter); }
	.nox-work > .nox-more { margin-top: 2.5rem !important; }
	.nox-services { row-gap: 3rem; }
	.nox-tile { grid-column: 3 / -3; grid-row: 2; }
	.nox-services-list { grid-column: 1 / -1; }
	.nox-offer { grid-template-columns: 1fr; row-gap: 0.25rem; }
	.nox-offer > p:not(.nox-offer-name) { margin-bottom: 1.25rem !important; }
	.nox-facts { grid-template-columns: 5.5rem minmax(0, 1fr); }
	.nox-screen-square, .nox-screen-wide, .nox-screen-mid, .nox-screens--b .nox-screen-wide { grid-column: 1 / -1; }
	.nox-screen-phone, .nox-screens--b .nox-screen-phone { grid-column: 1 / 7; }
}

/* ---------- motion (content stays visible without script and in the editor) ---------- */
@media (prefers-reduced-motion: no-preference) {
	.js .nox-hero .nox-mark--hero { opacity: 0; translate: 0 16px; animation: nox-rise 1400ms var(--nox-ease) 150ms forwards; }
	.js .nox-hero .nox-hero-line { opacity: 0; translate: 0 12px; animation: nox-rise 1200ms var(--nox-ease) 700ms forwards; }
	.js .nox-reveal, .js .nox-card > *, .js .nox-exhibit { opacity: 0; translate: 0 24px; transition: opacity 900ms var(--nox-ease), translate 1100ms var(--nox-ease); transition-delay: calc(var(--nox-i, 0) * 80ms); }
	.js .nox-reveal.is-in, .js .nox-card > .is-in, .js .nox-exhibit.is-in { opacity: 1; translate: none; }
	.nox-hero-svg[data-dot="pulse"] .nox-moon { animation: nox-breathe 3.2s ease-in-out infinite; }
	.nox-hero-svg[data-dot="pulse"] .nox-ring { animation: nox-ripple 3.2s ease-out 1.6s infinite; }
}
@keyframes nox-rise { to { opacity: 1; translate: none; } }
@keyframes nox-breathe { 0%, 100% { scale: 1; } 50% { scale: 1.2; } }
@keyframes nox-ripple { 0% { scale: 1; opacity: 0.85; } 75% { opacity: 0; } 100% { scale: 3.4; opacity: 0; } }
