/* FURIANI theme styles. Tokens come from theme.json; this file is layout and
   component detail. Static-first: everything renders finished without JS;
   motion.js only animates entrances for motion-tolerant visitors. */

:root {
	--furiani-line: var(--wp--custom--line, #C9C5B4);
	--furiani-radius: var(--wp--custom--radius, 6px);
	--furiani-gutter: clamp(1rem, 4vw, 2.5rem);
}

/* ---- page gutter ---- */
/* Keeps text off the screen edge. Without it everything in main and the
   footer starts at x = 0 once the screen is narrower than the 720px column.
   From about 1340px up the gutter is narrower than the margin the wide
   blocks already keep, so the desktop layout does not move. The footer
   takes the same gutter in its own rule below. */
.wp-site-blocks > main {
	padding-left: var(--furiani-gutter);
	padding-right: var(--furiani-gutter);
}

/* ---- header ---- */
.furiani-header {
	padding: 1.1rem clamp(1rem, 2.5vw, 2.5rem) 0.9rem;
	border-bottom: 1px solid var(--furiani-line);
	align-items: center;
}
.furiani-lockup {
	display: inline-flex;
	align-items: center;
	gap: 0.7rem;
	text-decoration: none;
	color: var(--wp--preset--color--ink);
}
.furiani-lockup-word {
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 700;
	letter-spacing: 0.18em;
	font-size: 1.05rem;
}
.furiani-header .wp-block-navigation a:where(:not(.wp-element-button)) {
	text-decoration: none;
}
/* Hover and focus change the color and nothing else. Core holds navigation
   links at color: inherit with three classes, so this needs the header class
   in front to win. */
.furiani-header .wp-block-navigation a:hover,
.furiani-header .wp-block-navigation a:focus {
	color: var(--wp--preset--color--crimson);
	text-decoration: none;
}
/* The phone menu takes the page gutter. Core's own padding for it reads a
   root padding variable this theme does not set, so it comes out as zero. */
.furiani-header .wp-block-navigation .wp-block-navigation__responsive-container.is-menu-open {
	padding: var(--furiani-gutter);
}

/* ---- hero ---- */
.furiani-hero {
	padding: clamp(3rem, 8vh, 6rem) 0 2.5rem;
	text-align: left;
}
.furiani-hero h1 { max-width: 18ch; }
.furiani-hero-lead { max-width: 52ch; color: var(--wp--custom--text-soft, #4A4442); }

/* The cardinal hero: the four around the copy, each facing the name. */
.furiani-hero.is-cardinal {
	position: relative;
	overflow: hidden;
	text-align: center;
	padding: clamp(7rem, 15vh, 10rem) 0 clamp(8rem, 17vh, 12rem);
	min-height: 44rem;
}
.furiani-hero.is-cardinal h1,
.furiani-hero.is-cardinal .furiani-hero-lead { margin-left: auto; margin-right: auto; }
.furiani-hero-copy { position: relative; z-index: 2; max-width: 40rem; margin: 0 auto; }
.furiani-beast { position: absolute; z-index: 1; }
.furiani-beast svg { display: block; }
.furiani-beast.is-n { top: 0; left: 50%; transform: translate(-32%, 6px) rotate(-7deg); }
.furiani-beast.is-e { right: 0; top: 50%; transform: translate(-6%, -62%) rotate(5deg); }
.furiani-beast.is-s { bottom: 0; left: 50%; transform: translate(-70%, 0) rotate(4deg); }
.furiani-beast.is-w { left: 0; top: 50%; transform: translate(4%, -40%) rotate(-4deg); }
.furiani-weather { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.furiani-weather svg { position: absolute; display: block; }
.furiani-weather .is-storm { top: -30px; right: 12%; width: 520px; }
.furiani-weather .is-strata { bottom: -20px; left: 6%; width: 560px; }
.furiani-weather .is-tide { right: -40px; bottom: 70px; width: 380px; }
.furiani-weather .is-ember { left: 8%; top: 120px; width: 260px; }
@media (max-width: 820px) {
	.furiani-hero.is-cardinal { min-height: auto; padding: 2.5rem 0 2rem; }
	.furiani-weather { display: none; }
	.furiani-beast { position: static; display: inline-block; margin: 0 0.4rem 1.2rem; transform: none !important; }
	.furiani-beast svg { width: 68px; height: 68px; }
}

/* ---- section rhythm ---- */
main > .wp-block-group > section,
main section.furiani-reveal {
	padding: clamp(2.25rem, 6vh, 4.5rem) 0;
}
section + section { border-top: 1px solid var(--furiani-line); }

/* ---- layers grid ---- */
.furiani-layer-grid {
	list-style: none;
	margin: 1.5rem 0 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
	gap: 1.25rem;
}
.furiani-layer-card {
	background: var(--wp--custom--surface-raised, #F6F4EA);
	border: 1px solid var(--furiani-line);
	border-radius: var(--furiani-radius);
	padding: 1.35rem 1.35rem 1.1rem;
	border-top: 4px solid var(--wp--preset--color--ink);
}
.furiani-layer-card-2 { border-top-color: var(--wp--preset--color--crimson); }
.furiani-layer-card-3 { border-top-color: var(--wp--preset--color--oxblood); }
.furiani-layer-card-4 { border-top-color: var(--wp--preset--color--rose); }
.furiani-layer-card h3 { margin: 0 0 0.4rem; }
.furiani-layer-card p { margin: 0; font-size: 0.95rem; }

/* ---- approach ---- */
.furiani-steps-row {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: 1rem;
	counter-reset: furiani-step;
	list-style: none;
	margin: 1.5rem 0;
	padding: 0;
	font-family: var(--wp--preset--font-family--heading);
}
.furiani-steps-row li {
	counter-increment: furiani-step;
	padding-top: 0.5rem;
	border-top: 3px solid var(--wp--preset--color--oxblood);
}
.furiani-steps-row li::before {
	content: counter(furiani-step, decimal-leading-zero);
	display: block;
	color: var(--wp--preset--color--crimson);
	font-weight: 700;
	font-size: 0.85rem;
	margin-bottom: 0.3rem;
}
.furiani-approach-grid {
	display: grid;
	grid-template-columns: 250px 1fr;
	gap: 2.5rem;
	align-items: start;
}
.furiani-approach-diagram {
	position: sticky;
	top: 2rem;
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.8rem;
}
.furiani-approach-cell {
	background: var(--wp--custom--surface-raised, #F6F4EA);
	border: 1px solid var(--furiani-line);
	border-radius: var(--wp--custom--radius, 6px);
	padding: 0.75rem 0.5rem;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.5rem;
	font-family: var(--wp--preset--font-family--heading);
	font-size: 0.68rem;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--wp--custom--text-soft, #4A4442);
	transition: border-color 0.4s ease, color 0.4s ease;
}
.furiani-approach-cell svg { transition: opacity 0.4s ease; }
.furiani-approach-diagram.has-lit .furiani-approach-cell:not(.is-lit) svg { opacity: 0.28; }
.furiani-approach-cell.is-lit {
	border-color: var(--wp--preset--color--ink);
	box-shadow: inset 0 0 0 2px var(--wp--preset--color--ink);
	color: var(--wp--preset--color--ink);
}
.furiani-approach-steps { list-style: none; margin: 0; padding: 0; }
.furiani-approach-steps li { padding: 1.5rem 0; border-bottom: 1px solid var(--furiani-line); }
.furiani-approach-steps h2 { margin: 0 0 0.5rem; font-size: var(--wp--preset--font-size--large); }
@media (max-width: 781px) {
	.furiani-approach-grid { grid-template-columns: 1fr; }
	.furiani-approach-diagram { position: static; }
}

/* ---- work grid / cards ---- */
.furiani-work-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 1.75rem;
	margin-top: 1.5rem;
}
.furiani-card { min-width: 0; }
.furiani-card img {
	width: 100%;
	height: auto;
	aspect-ratio: 3 / 2;
	object-fit: cover;
	border-radius: var(--furiani-radius);
	display: block;
}
.furiani-card-link { text-decoration: none; color: inherit; }
.furiani-card-link:hover h3,
.furiani-card-link:focus h3 {
	color: var(--wp--preset--color--crimson);
}
.furiani-card h3 { margin: 0.75rem 0 0.25rem; font-size: var(--wp--preset--font-size--large); }
.furiani-card-meta-line,
.furiani-card-meta {
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--custom--text-soft, #4A4442);
	margin: 0 0 0.4rem;
	gap: 0.5rem;
}
.furiani-card p { margin: 0; }

/* archive grid built with core query loop */
.furiani-work-grid.wp-block-post-template { gap: 1.75rem; margin-top: 1.5rem; }

/* ---- filters ---- */
.furiani-filters { margin: 1.25rem 0 0.5rem; }
.furiani-filter-row {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.5rem;
	margin-bottom: 0.6rem;
}
.furiani-filter-label {
	font-family: var(--wp--preset--font-family--heading);
	font-size: 0.8rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	min-width: 3.5rem;
	color: var(--wp--custom--text-soft, #4A4442);
}
.furiani-filter {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	text-decoration: none;
	border: 1px solid var(--furiani-line);
	border-radius: 999px;
	padding: 0.15rem 0.8rem 0.15rem 0.6rem;
	font-size: 0.9rem;
	color: var(--wp--preset--color--ink);
	background: var(--wp--custom--surface-raised, #F6F4EA);
}
.furiani-filter:hover, .furiani-filter:focus { border-color: var(--wp--preset--color--crimson); color: var(--wp--preset--color--crimson); }
.furiani-filter.is-active {
	background: var(--wp--preset--color--oxblood);
	border-color: var(--wp--preset--color--oxblood);
	color: var(--wp--preset--color--paper);
}

/* ---- case pages ---- */
/* Migrated case bodies carry images at their upload width; keep them inside
 * the column so the page never scrolls sideways. */
.wp-block-post-content img,
.wp-block-post-content figure,
.wp-block-post-content video,
.wp-block-post-content iframe { max-width: 100%; height: auto; }
.wp-block-post-content table { display: block; overflow-x: auto; max-width: 100%; }
.furiani-case-head { padding-top: 2.5rem; }
/* The lead image on a case page is drawn at its own size and never stretched
   across the column: most are 600px screenshots and go soft when scaled up.
   It sits at the left edge of the column, under the title. The body class
   in front is what outweighs core's own width: 100% on this image. */
.single-project .wp-block-post-featured-image img {
	width: auto;
	max-width: 100%;
	height: auto;
	max-height: 26rem;
	object-fit: contain;
}
/* With the picture's pixel size handed over (functions.php), the same drawn
   size is spelled out as a width, so the box is held before the file
   arrives and nothing below it jumps. */
.single-project .wp-block-post-featured-image img[style*="--furiani-w"] {
	width: min(100%, calc(var(--furiani-w) * 1px), calc(26rem * var(--furiani-w) / var(--furiani-h)));
}
.furiani-meta-strip { margin: 0.5rem 0 1.75rem; }
.furiani-meta-line {
	font-family: var(--wp--preset--font-family--heading);
	letter-spacing: 0.04em;
	color: var(--wp--custom--text-soft, #4A4442);
	margin: 0 0 0.35rem;
}
/* Layer tags are pills, the same shape as the work filters: a link is never
   underlined, and a bar under the text reads as one. */
.furiani-meta-layers a {
	display: inline-block;
	text-decoration: none;
	font-size: 0.75rem;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	border: 1px solid var(--furiani-line);
	border-radius: 999px;
	padding: 0.1rem 0.7rem;
	margin: 0 0.5rem 0.4rem 0;
	color: var(--wp--preset--color--ink);
	background: var(--wp--custom--surface-raised, #F6F4EA);
}
.furiani-meta-layers a:hover,
.furiani-meta-layers a:focus {
	border-color: var(--wp--preset--color--crimson);
	color: var(--wp--preset--color--crimson);
}
.furiani-meta-note {
	font-size: 0.9rem;
	font-style: italic;
	color: var(--wp--custom--text-soft, #4A4442);
	margin: 0.35rem 0 0;
}
.furiani-case-extras { margin: 2.5rem 0; }
.furiani-case-links a { margin-right: 1.25rem; }
.furiani-case-footer { padding: 2rem 0 3rem; }

/* ---- connect ---- */
.furiani-connect { text-align: center; }
.furiani-connect h2 { margin-bottom: 0.5rem; }
/* The buttons block is a flex row, so text-align does not reach it. */
.furiani-connect .wp-block-buttons { justify-content: center; }

/* ---- footer ---- */
.furiani-footer {
	border-top: 2px solid var(--wp--preset--color--ink);
	margin-top: 3rem;
	padding: 1.5rem var(--furiani-gutter) 2.5rem;
	font-size: var(--wp--preset--font-size--small);
}
.furiani-footer-brand { margin: 0; }
.furiani-footer-descriptor {
	margin: 0 0 1.4rem;
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 500;
	font-size: 0.7rem;
	letter-spacing: 0.14em;
	line-height: 1.55;
	text-transform: uppercase;
	color: var(--wp--custom--text-soft);
}

/* ---- generic ---- */
/* A forward link ("All work", "The whole story") is told by its weight and an
   arrow, never by a line under it. */
a.furiani-more {
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 600;
	text-decoration: none;
}
a.furiani-more::after {
	content: "\00a0\2192";
}
a.furiani-more:hover, a.furiani-more:focus { color: var(--wp--preset--color--crimson); }

/* A link in running text is told apart by its color and its weight. Buttons,
   the "more" links, filter pills, card links and layer tags carry their own
   treatment and are left out, and a link inside a heading keeps the
   heading's weight. */
main a:where(:not(.wp-element-button, .wp-block-button__link, .furiani-more, .furiani-filter, .furiani-card-link, .furiani-meta-layers a, h1 a, h2 a, h3 a, h4 a, h5 a, h6 a)),
.furiani-footer a {
	font-weight: 600;
}

:focus-visible {
	outline: 3px solid var(--wp--preset--color--crimson);
	outline-offset: 2px;
}

/* ---- motion (additive; static state above is the default) ---- */
@media (prefers-reduced-motion: no-preference) {
	.furiani-motion-ready .furiani-reveal {
		opacity: 0;
		transform: translateY(14px);
		transition: opacity 0.6s ease, transform 0.6s ease;
	}
	.furiani-motion-ready .furiani-reveal.is-visible {
		opacity: 1;
		transform: none;
	}
}
