/* ==========================================================================
   Risolviamo – one page template
   ========================================================================== */

:root {
	--rs-bg: #111417;
	--rs-bg-panel: #15181c;
	--rs-line: #1d2126;
	--rs-num: #1d2126;
	--rs-text: #ffffff;
	--rs-muted: #8f959c;
	--rs-nav: #9aa0a6;
	--rs-accent: #fab94e;
	--rs-accent-hover: #ffc96f;
	--rs-error: #ff8577;
	--rs-field-line: #646a71;
	--rs-font: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--rs-container: 1100px;
	--rs-gutter: clamp(20px, 4vw, 32px);
	--rs-header-h: 108px;
	color-scheme: dark;
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	scroll-behavior: smooth;
	scroll-padding-top: 90px;
	-webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	*,
	*::before,
	*::after {
		transition: none !important;
		animation: none !important;
	}
}

body {
	margin: 0;
	background: var(--rs-bg);
	color: var(--rs-text);
	font-family: var(--rs-font);
	font-size: 15px;
	line-height: 1.9;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	overflow-x: hidden;
}

img {
	max-width: 100%;
	height: auto;
}

a {
	color: var(--rs-accent);
}

a:hover {
	color: var(--rs-accent-hover);
}

:focus-visible {
	outline: 2px solid var(--rs-accent);
	outline-offset: 3px;
}

h1,
h2,
h3,
h4 {
	font-weight: 400;
	line-height: 1.3;
	margin: 0;
}

p {
	margin: 0 0 24px;
}

.rs-visually-hidden {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.rs-skip {
	position: absolute;
	left: 16px;
	top: -60px;
	z-index: 100;
	padding: 10px 16px;
	background: var(--rs-accent);
	color: var(--rs-bg);
	font-weight: 600;
	text-decoration: none;
}

.rs-skip:focus {
	top: 16px;
}

.rs-container {
	max-width: calc(var(--rs-container) + 2 * var(--rs-gutter));
	margin: 0 auto;
	padding-inline: var(--rs-gutter);
}

.rs-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 0 22px;
	border: 0;
	background: var(--rs-accent);
	color: var(--rs-bg);
	font: 700 12px/1 var(--rs-font);
	letter-spacing: 0.18em;
	text-transform: uppercase;
	cursor: pointer;
}

.rs-button:hover {
	background: var(--rs-accent-hover);
}

/* ==========================================================================
   Header
   ========================================================================== */

.rs-header {
	position: absolute;
	inset: 0 0 auto;
	z-index: 50;
	transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.rs-page .rs-header,
.rs-header.is-scrolled {
	position: fixed;
	background: rgba(17, 20, 23, 0.94);
	box-shadow: 0 1px 0 var(--rs-line);
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
}

.rs-header__bar {
	display: flex;
	align-items: center;
	gap: 24px;
	padding: 36px 6vw 20px 4vw;
	transition: padding 0.3s ease;
}

.rs-header.is-scrolled .rs-header__bar,
.rs-page .rs-header__bar {
	padding-top: 16px;
	padding-bottom: 16px;
}

.rs-header__logo {
	flex: 0 0 auto;
	display: block;
	line-height: 0;
}

.rs-header__logo img {
	width: auto;
	height: 46px;
}

.rs-header__nav {
	flex: 1 1 auto;
	padding-left: 5vw;
}

.rs-menu {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 36px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.rs-menu__link {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	color: var(--rs-nav);
	font-size: 12px;
	font-weight: 500;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	text-decoration: none;
	transition: color 0.2s ease;
}

.rs-menu__link:hover,
.rs-menu__link.is-active,
.rs-menu__link[aria-current="page"] {
	color: var(--rs-text);
}

.rs-cta {
	flex: 0 0 auto;
	margin-left: auto;
	display: inline-flex;
	align-items: center;
	gap: 12px;
	min-height: 44px;
	padding: 0 26px;
	background: var(--rs-accent);
	color: var(--rs-bg);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	text-decoration: none;
	transition: background-color 0.2s ease;
}

.rs-cta:hover {
	background: var(--rs-accent-hover);
	color: var(--rs-bg);
}

.rs-header__toggle {
	display: none;
	order: 3;
	width: 44px;
	height: 44px;
	margin-left: 4px;
	padding: 0;
	border: 1px solid #2a2f36;
	background: transparent;
	cursor: pointer;
}

.rs-header__toggle-bars,
.rs-header__toggle-bars::before,
.rs-header__toggle-bars::after {
	display: block;
	width: 20px;
	height: 2px;
	margin: 0 auto;
	background: var(--rs-text);
	transition: transform 0.25s ease, opacity 0.25s ease;
}

.rs-header__toggle-bars {
	position: relative;
}

.rs-header__toggle-bars::before,
.rs-header__toggle-bars::after {
	content: "";
	position: absolute;
	left: 0;
}

.rs-header__toggle-bars::before {
	top: -6px;
}

.rs-header__toggle-bars::after {
	top: 6px;
}

.rs-header__toggle[aria-expanded="true"] .rs-header__toggle-bars {
	background: transparent;
}

.rs-header__toggle[aria-expanded="true"] .rs-header__toggle-bars::before {
	transform: translateY(6px) rotate(45deg);
}

.rs-header__toggle[aria-expanded="true"] .rs-header__toggle-bars::after {
	transform: translateY(-6px) rotate(-45deg);
}

@media (max-width: 900px) {
	.rs-header__bar {
		flex-wrap: wrap;
		padding: 16px var(--rs-gutter);
	}

	.rs-header__logo img {
		height: 38px;
	}

	.rs-header__toggle {
		display: block;
	}

	.rs-header__nav {
		order: 4;
		flex: 1 0 100%;
		display: none;
		padding: 8px 0 12px;
	}

	.rs-header.is-open {
		position: fixed;
		background: rgba(17, 20, 23, 0.97);
	}

	.rs-header.is-open .rs-header__nav {
		display: block;
	}

	.rs-menu {
		flex-direction: column;
		gap: 0;
	}

	.rs-menu__link {
		width: 100%;
		border-bottom: 1px solid var(--rs-line);
	}
}

@media (max-width: 480px) {
	.rs-cta {
		padding: 0 14px;
	}

	.rs-cta span {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0, 0, 0, 0);
	}
}

/* ==========================================================================
   Hero
   ========================================================================== */

.rs-hero {
	position: relative;
	display: flex;
	align-items: flex-end;
	--rs-hero-title-size: clamp(96px, 14vw, 210px);
	--rs-hero-lead-size: 1.5rem;
	/* same proportions as the header image (1920×1131), so the copy sits under the sheet,
	   but never taller than the screen: the copy is bottom aligned and must be fully
	   visible on load (wide but short screens, e.g. 1920×960) */
	min-height: min(max(720px, 58.9vw), 100vh);
	min-height: min(max(720px, 58.9vw), 100svh);
	padding: 160px 6vw 6.5vw 18vw;
	overflow: hidden;
	isolation: isolate;
	background-color: var(--rs-bg);
}

/* Photo and fade on two layers: the photo moves with the parallax (template.js
   sets --rs-hero-y while scrolling), the fade to the page colour stays still. */
.rs-hero::before,
.rs-hero::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	pointer-events: none;
}

.rs-hero::before {
	background: var(--rs-hero-image, none) right top / cover no-repeat;
	transform: translate3d(0, calc(var(--rs-hero-y, 0) * 0.4px), 0);
	will-change: transform;
}

.rs-hero::after {
	background: linear-gradient(180deg, rgba(17, 20, 23, 0) 62%, var(--rs-bg) 100%);
}

.rs-hero__inner {
	width: 100%;
	transform: translate3d(0, calc(var(--rs-hero-y, 0) * 0.15px), 0);
}

.rs-hero__title {
	margin: 0;
	color: var(--rs-accent);
	font-size: var(--rs-hero-title-size);
	font-weight: 600;
	line-height: 0.9;
	letter-spacing: -0.02em;
}

.rs-hero__lead {
	max-width: 560px;
	/* Indented 32px to the right of the visible edge of the "C".
	   Letters have a small inner margin (side bearing), 0.044em for this C and
	   0.047em for the lead's first letter, compensated by the calc. */
	margin: 28px 0 0 calc(var(--rs-hero-title-size) * 0.044 - var(--rs-hero-lead-size) * 0.047 + 32px);
	font-size: var(--rs-hero-lead-size);
	line-height: 1.45;
}

.rs-hero__scroll {
	position: absolute;
	left: 4.5vw;
	bottom: 70px;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 24px;
	color: var(--rs-nav);
	font-size: 11px;
	letter-spacing: 0.3em;
	line-height: 1;
	text-transform: uppercase;
	text-decoration: none;
	writing-mode: vertical-rl;
}

.rs-hero__scroll::after {
	content: "";
	display: block;
	width: 1px;
	height: clamp(120px, 26vh, 260px);
	background: var(--rs-accent);
}

.rs-hero__scroll:hover {
	color: var(--rs-text);
}

@media (max-width: 900px) {
	.rs-hero {
		min-height: 640px;
		padding: 140px var(--rs-gutter) 100px;
	}

	.rs-hero::before {
		background-position: 70% top;
	}

	/* on narrow screens the copy sits on the sheet: darken the photo */
	.rs-hero::after {
		background: linear-gradient(180deg, rgba(17, 20, 23, 0.55) 0%, rgba(17, 20, 23, 0.7) 55%, var(--rs-bg) 100%);
	}

	.rs-hero__scroll {
		display: none;
	}
}

/* ==========================================================================
   Sections – shared
   ========================================================================== */

.rs-section {
	position: relative;
	padding: 80px 0 120px;
}

.rs-heading {
	position: relative;
	min-height: 150px;
	margin-bottom: 40px;
	display: flex;
	align-items: center;
}

.rs-heading__num {
	position: absolute;
	left: 0;
	top: 0;
	color: var(--rs-num);
	font-size: 150px;
	font-weight: 600;
	line-height: 1;
	pointer-events: none;
	user-select: none;
}

.rs-heading__label {
	position: relative;
	margin: 0 0 0 2px;
	color: var(--rs-accent);
	font-size: 15px;
	font-weight: 500;
	letter-spacing: 0.3em;
	text-transform: uppercase;
	line-height: 1.5;
}

.rs-title {
	margin: 0 0 40px;
	font-size: clamp(25px, 2.4vw, 34px);
	line-height: 1.35;
}

.rs-section p {
	color: var(--rs-muted);
}

.rs-section .rs-strong,
.rs-section strong {
	color: var(--rs-text);
	font-weight: 700;
}

.rs-split {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	gap: 64px;
}

.rs-split > * {
	flex: 1 1 420px;
	min-width: 0;
}

.rs-split__media img {
	display: block;
	width: 100%;
}

@media (max-width: 600px) {
	.rs-section {
		padding: 56px 0 80px;
	}

	.rs-heading {
		min-height: 110px;
	}

	.rs-heading__num {
		font-size: 110px;
	}

	.rs-split {
		gap: 40px;
	}

	.rs-split > * {
		flex-basis: 100%;
	}
}

/* ---------------------------------------------------------------- Light sections
   Same layout, lighter background: the palette is redefined locally so every
   component inside (titles, texts, fields, lists) follows it. */

.rs-section--light {
	--rs-bg: #f5f5f5;
	--rs-bg-panel: #ffffff;
	--rs-line: #dcdfe2;
	--rs-num: #e4e6e8;
	--rs-text: #111417;
	--rs-muted: #6b7178;
	--rs-field-line: #b5babf;
	--rs-error: #c0392b;
	color-scheme: light;
	background: var(--rs-bg);
	color: var(--rs-text);
}

/* Text on the yellow accent stays dark, as in the dark sections. */
.rs-section--light .rs-form__send,
.rs-section--light .rs-form-done__icon {
	color: #111417;
}

.rs-section--light .rs-field__input:focus,
.rs-section--light .rs-field__input:focus-visible {
	background-color: #ffffff;
}

.rs-section--light .rs-form-done p {
	color: var(--rs-muted);
}

.rs-section--light .rs-form__alert {
	border-color: rgba(192, 57, 43, 0.4);
	background: rgba(192, 57, 43, 0.06);
	color: #8a2a1f;
}

/* ==========================================================================
   01 – Chi siamo
   ========================================================================== */

.rs-section--chi-siamo {
	background: var(--rs-bg) url("../images/kanji-bg.jpg") center top / cover no-repeat;
}

.rs-steps {
	counter-reset: rs-step;
	list-style: none;
	margin: 110px 0 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
	gap: 64px 48px;
}

.rs-steps li {
	counter-increment: rs-step;
	display: grid;
	grid-template-columns: 40px 1fr;
	gap: 14px;
}

.rs-steps li::before {
	content: counter(rs-step);
	grid-row: 1;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: var(--rs-accent);
	color: var(--rs-text);
	font-size: 13px;
	font-weight: 600;
	line-height: 40px;
	text-align: center;
}

.rs-steps h4 {
	grid-column: 2;
	grid-row: 1;
	align-self: center;
	font-size: 21px;
	font-weight: 500;
}

.rs-steps p {
	grid-column: 2;
	margin: 0;
}

/* ==========================================================================
   02 – Skills
   ========================================================================== */

.rs-section--skills::before {
	content: "";
	position: absolute;
	top: 0;
	right: 0;
	bottom: 260px;
	left: 37%;
	background: var(--rs-bg-panel);
	pointer-events: none;
}

/* On the light background the side panel is not needed: one flat colour. */
.rs-section--skills.rs-section--light::before {
	content: none;
}

.rs-section--skills .rs-container {
	position: relative;
}

.rs-section--skills .rs-container::before {
	content: "";
	display: block;
	width: 50%;
	height: 1px;
	margin: 0 0 70px auto;
	background: var(--rs-accent);
	opacity: 0.7;
}

.rs-section--skills .rs-split {
	margin-bottom: 90px;
}

.rs-section--skills .rs-split .rs-title {
	margin: 0;
	line-height: 1.4;
}

/* ---------------------------------------------------------------- Stacked cards
   Repertorio, scheda 02 «Card impilate», versione composta.
   Each card is sticky a step lower than the previous one, so they pile up and
   leave their top edges in view. The sticky <li> is never transformed: only the
   sheet inside it slides sideways and tilts (template.js writes --x, --angle
   and --scale while scrolling). Without JS, with reduced motion or when a card
   does not fit the window, the cards stay in a plain column (no data-stacked). */

.rs-stack {
	--step: 18px;
	--top: 110px;
	--gap: 28px;
	position: relative;
	width: min(100%, 940px);
	margin: 0 auto;
	padding: 0;
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: var(--gap);
}

.rs-stack__card {
	position: relative;
}

.rs-stack__sheet {
	--rs-num: #eef0f2;
	position: relative;
	min-height: var(--card-h, 0px);
	border: 1px solid var(--rs-line);
	background: var(--rs-bg-panel);
	color: var(--rs-text);
}

/* Rhythm of the pile: white, grey, dark, white… */
.rs-stack__card:nth-child(4n + 2) .rs-stack__sheet {
	--rs-bg-panel: #e9ebed;
	--rs-num: #dde0e3;
	--rs-line: #d3d7db;
}

.rs-stack__card:nth-child(4n + 3) .rs-stack__sheet {
	--rs-bg-panel: #15181c;
	--rs-num: #1f2328;
	--rs-line: #15181c;
	--rs-text: #ffffff;
	--rs-muted: #8f959c;
}

.rs-stack__content {
	position: relative;
	overflow: hidden;
	padding: 0 48px 48px;
}

.rs-stack__num {
	position: absolute;
	top: 26px;
	right: 40px;
	color: var(--rs-num);
	font-size: 60px;
	font-weight: 600;
	line-height: 1;
	pointer-events: none;
	user-select: none;
}

.rs-stack__body {
	position: relative;
	display: grid;
	grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
	align-items: start;
	gap: 24px 56px;
	padding-top: 112px;
}

/* Big and faint behind the title: the protagonist of the card.
   The drawing fills only the middle ~55% of the SVG, hence the large box
   and the negative offsets: the drawing itself is ~200px, centred on the
   title and starting ~36px from the left edge. */
.rs-stack__icon {
	position: absolute;
	top: -35px;
	left: -49px;
	width: 370px;
	height: 370px;
	opacity: 0.22;
	pointer-events: none;
	user-select: none;
}

.rs-stack__card:nth-child(4n + 3) .rs-stack__icon {
	opacity: 0.3;
}

.rs-stack h4 {
	margin: 0;
	color: var(--rs-text);
	font-size: clamp(24px, 2.3vw, 31px);
	font-weight: 500;
	line-height: 1.3;
}

.rs-stack__body p {
	align-self: end; /* side by side: the text ends level with the title */
	margin: 0;
	color: var(--rs-muted);
}

/* The pile, switched on by template.js once it has measured the cards. */
.rs-stack[data-stacked] {
	gap: var(--space);
}

/* A real flex item makes the sticky area last until the last card lands;
   padding would not. */
.rs-stack[data-stacked]::after {
	content: "";
	flex: 0 0 auto;
	height: var(--tail);
	margin-top: calc(-1 * var(--space));
}

.rs-stack[data-stacked] .rs-stack__card {
	position: sticky;
	top: var(--stick-top);
}

.rs-stack[data-stacked] .rs-stack__sheet {
	transform: translateX(var(--x, 0px)) rotate(var(--angle, 0deg)) scale(var(--scale, 1));
	transform-origin: center 28px;
	box-shadow: 0 18px 40px rgba(17, 20, 23, 0.1);
	will-change: transform;
}

@media (max-width: 900px) {
	.rs-stack {
		--step: 12px;
		--top: 86px;
	}

	.rs-stack__content {
		padding: 0 28px 36px;
	}

	.rs-stack__icon {
		top: -22px;
		left: -47px;
		width: 290px;
		height: 290px;
	}

	.rs-stack__num {
		top: 22px;
		right: 26px;
		font-size: 52px;
	}

	.rs-stack__body {
		grid-template-columns: 1fr;
		padding-top: 88px;
	}
}

@media (max-width: 600px) {
	.rs-stack__content {
		padding: 0 22px 30px;
	}

	.rs-stack__icon {
		top: -13px;
		left: -47px;
		width: 255px;
		height: 255px;
	}

	.rs-stack__num {
		top: 20px;
		right: 22px;
		font-size: 46px;
	}

	.rs-stack__body {
		padding-top: 78px;
	}
}

.rs-claim {
	max-width: 560px;
	margin: 120px 0 0;
	font-size: clamp(21px, 2vw, 28px);
	line-height: 1.6;
}

.rs-section .rs-claim {
	color: var(--rs-text);
}

.rs-claim strong {
	display: block;
	margin-bottom: 10px;
	font-size: clamp(27px, 2.6vw, 38px);
	font-weight: 400;
	line-height: 1.3;
}

@media (max-width: 900px) {
	.rs-section--skills::before {
		left: 0;
		bottom: 0;
	}

	.rs-section--skills .rs-container::before {
		width: 100%;
	}
}

@media (max-width: 600px) {
	.rs-steps li {
		grid-template-columns: 40px 1fr;
	}

	.rs-steps p {
		grid-column: 1 / -1;
	}

	.rs-claim {
		margin-top: 80px;
	}
}

/* ==========================================================================
   03 – Portfolio
   ========================================================================== */

.rs-section--portfolio {
	padding-top: 60px;
}

.rs-section--portfolio .rs-heading {
	margin-bottom: 60px;
}

.rs-portfolio {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
	gap: 2px;
}

.rs-work {
	position: relative;
	aspect-ratio: 732 / 447;
	overflow: hidden;
	background: var(--rs-bg-panel);
}

.rs-work > img,
.rs-work > p > img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.6s ease;
}

.rs-work__body {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	padding: 30px 32px;
	background: rgba(17, 20, 23, 0.6);
	opacity: 0;
	transition: opacity 0.3s ease;
}

.rs-work__body::after {
	content: "";
	position: absolute;
	left: 50%;
	top: 50%;
	width: 22px;
	height: 22px;
	margin: -11px 0 0 -11px;
	background:
		linear-gradient(#fff, #fff) center / 100% 1.5px no-repeat,
		linear-gradient(#fff, #fff) center / 1.5px 100% no-repeat;
	pointer-events: none;
}

.rs-work:hover .rs-work__body,
.rs-work:focus-within .rs-work__body {
	opacity: 1;
}

.rs-work:hover > img {
	transform: scale(1.04);
}

.rs-section .rs-work__cat {
	margin: 0 0 4px;
	color: #d5d8dc;
	font-size: 12px;
	line-height: 1.5;
}

.rs-work__title {
	font-size: 18px;
	font-weight: 500;
}

.rs-work__more {
	margin-top: auto;
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding: 0 14px;
	border: 1px solid #fff;
	color: #fff;
	font-size: 12px;
	text-decoration: none;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.rs-work__more:hover {
	background: #fff;
	color: var(--rs-bg);
}

@media (hover: none) {
	.rs-work__body {
		opacity: 1;
		background: linear-gradient(180deg, rgba(17, 20, 23, 0.75), rgba(17, 20, 23, 0.25) 60%, rgba(17, 20, 23, 0.6));
	}

	.rs-work__body::after {
		display: none;
	}
}

/* Project popup ----------------------------------------------------------
   Each .rs-work may hold a hidden .rs-work__detail: template.js shows it
   in a <dialog> when the tile (or "Leggi di più") is clicked. */

.rs-work__detail {
	display: none;
}

.rs-work.is-clickable {
	cursor: pointer;
}

.rs-dialog {
	width: min(880px, calc(100% - 32px));
	max-width: none;
	max-height: calc(100% - 64px);
	margin: auto;
	padding: 0;
	border: 0;
	overflow: hidden;
	background: var(--rs-bg-panel);
	color: var(--rs-text);
	box-shadow: 0 40px 120px rgba(0, 0, 0, 0.6);
	font-family: var(--rs-font);
}

.rs-dialog[open] {
	display: flex;
	flex-direction: column;
	animation: rs-dialog-in 0.28s ease-out;
}

.rs-dialog::backdrop {
	background: rgba(8, 10, 12, 0.82);
}

.rs-dialog[open]::backdrop {
	animation: rs-fade-in 0.28s ease-out;
}

@keyframes rs-dialog-in {
	from {
		opacity: 0;
		transform: translateY(16px) scale(0.98);
	}
}

@keyframes rs-fade-in {
	from {
		opacity: 0;
	}
}

.rs-dialog__scroll {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	overscroll-behavior: contain;
}

.rs-dialog__close {
	position: absolute;
	top: 18px;
	right: 18px;
	z-index: 1;
	width: 44px;
	height: 44px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(17, 20, 23, 0.85);
	color: var(--rs-text);
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.rs-dialog__close:hover {
	background: var(--rs-accent);
	color: var(--rs-bg);
}

.rs-detail__img {
	display: block;
	width: 100%;
	height: 340px;
	object-fit: cover;
}

.rs-detail__body {
	padding: 44px 56px 48px;
}

.rs-dialog p {
	margin: 0 0 18px;
	color: #c2c7cc;
	font-size: 15px;
	line-height: 1.9;
}

.rs-dialog .rs-detail__eyebrow {
	margin: 0 0 10px;
	color: var(--rs-accent);
	font-size: 12px;
	font-weight: 500;
	letter-spacing: 0.25em;
	line-height: 1.5;
	text-transform: uppercase;
}

.rs-detail__title {
	font-size: clamp(24px, 3vw, 32px);
	line-height: 1.25;
}

.rs-dialog .rs-detail__year {
	margin: 8px 0 28px;
	color: var(--rs-muted);
	font-size: 13px;
	line-height: 1.5;
}

.rs-detail__meta {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 32px;
	margin-top: 32px;
	padding-top: 28px;
	border-top: 1px solid var(--rs-line);
}

.rs-detail__meta h4 {
	margin-bottom: 8px;
	color: var(--rs-muted);
	font-size: 11px;
	font-weight: 500;
	letter-spacing: 0.2em;
	text-transform: uppercase;
}

.rs-dialog .rs-detail__value,
.rs-dialog .rs-detail__meta p {
	margin: 0;
	color: #d5d8dc;
	font-size: 13px;
	line-height: 1.7;
}

html.rs-dialog-open {
	overflow: hidden;
}

@media (max-width: 600px) {
	.rs-dialog {
		width: 100%;
		height: 100%;
		max-height: 100%;
		margin: 0;
	}

	.rs-detail__img {
		height: 230px;
	}

	.rs-dialog__close {
		top: 14px;
		right: 14px;
	}

	.rs-detail__body {
		padding: 28px 24px 40px;
	}

	.rs-dialog p {
		font-size: 14px;
		line-height: 1.85;
	}

	.rs-detail__meta {
		grid-template-columns: 1fr;
		gap: 18px;
	}
}

/* Clients */

.rs-clients {
	margin-top: 110px;
}

.rs-section .rs-clients__title {
	max-width: 720px;
	margin: 0 0 70px;
	color: var(--rs-text);
	font-size: clamp(22px, 2.2vw, 32px);
	line-height: 1.5;
}

.rs-clients__list {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: calc((100% - 6 * 32px) / 7);
	gap: 32px;
	margin: 0;
	padding: 0;
	list-style: none;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	scrollbar-width: none;
}

.rs-clients__list::-webkit-scrollbar {
	display: none;
}

.rs-clients__list li {
	/* Keeps the hidden "new tab" text inside the scrolling list: without it
	   the page gets wider than the screen on phones. */
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	scroll-snap-align: start;
}

.rs-clients__list img {
	display: block;
	width: 100%;
	max-width: 150px;
	height: auto;
	filter: grayscale(1) brightness(1.6);
	opacity: 0.75;
	transition: opacity 0.2s ease;
}

.rs-clients__list img:hover {
	opacity: 1;
}

/* "Logo scuro" in the backend: black or dark logos are inverted instead of
   brightened, otherwise they disappear on the dark background. */
.rs-clients__list .is-dark img {
	filter: grayscale(1) invert(1) brightness(1.1);
}

.rs-clients__dots {
	display: flex;
	justify-content: center;
	gap: 4px;
	margin-top: 30px;
}

.rs-clients__dot {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	background: transparent;
	cursor: pointer;
}

.rs-clients__dot::before {
	content: "";
	width: 10px;
	height: 10px;
	border: 1.5px solid var(--rs-accent);
	border-radius: 50%;
	transition: background-color 0.2s ease;
}

.rs-clients__dot[aria-current="true"]::before {
	background: var(--rs-accent);
}

@media (max-width: 1000px) {
	.rs-clients__list {
		grid-auto-columns: calc((100% - 3 * 24px) / 4);
		gap: 24px;
	}
}

@media (max-width: 600px) {
	.rs-clients {
		margin-top: 80px;
	}

	.rs-clients__list {
		/* Two logos per page on phones, so they read bigger. */
		grid-auto-columns: calc((100% - 24px) / 2);
		gap: 24px;
	}

	/* Always one row: the dots get narrower when there are many pages
	   (the tap area stays 44px tall). */
	.rs-clients__dots {
		flex-wrap: nowrap;
		gap: 0;
	}

	.rs-clients__dot {
		flex: 0 1 28px;
		min-width: 16px;
	}

	.rs-clients__dot::before {
		flex: none;
		width: 8px;
		height: 8px;
	}
}

/* ==========================================================================
   04 – Contatti
   ========================================================================== */

.rs-contact {
	display: grid;
	grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
	grid-template-areas:
		"text form"
		"list form";
	grid-template-rows: auto 1fr;
	column-gap: 64px;
	align-items: start;
}

.rs-contact__text {
	grid-area: text;
}

.rs-contact__text .rs-title {
	margin-bottom: 28px;
}

.rs-contact__list {
	grid-area: list;
	margin: 32px 0 0;
	padding: 28px 0 0;
	border-top: 1px solid var(--rs-line);
	list-style: none;
}

.rs-contact__list li {
	margin: 0 0 14px;
	color: var(--rs-muted);
}

.rs-contact__list strong {
	display: block;
	color: var(--rs-text);
	font-size: 11px;
	font-weight: 500;
	letter-spacing: 0.2em;
	text-transform: uppercase;
}

/* The form starts on the line of the title (heading 150px + 40px). */
.rs-contact__form {
	grid-area: form;
	min-width: 0;
	padding-top: 190px;
}

/* ---------------------------------------------------------------- Form */

.rs-form {
	display: flex;
	flex-direction: column;
	gap: 28px;
	margin: 0;
}

.rs-form[hidden],
.rs-form [hidden],
.rs-form-done[hidden] {
	display: none !important;
}

.rs-section .rs-form__note {
	margin: 0;
	font-size: 13px;
	line-height: 1.6;
}

.rs-form__row {
	display: flex;
	flex-wrap: wrap;
	gap: 28px 24px;
}

.rs-field {
	display: flex;
	flex: 1 1 220px;
	flex-direction: column;
	gap: 8px;
	min-width: 0;
}

.rs-field__label {
	color: var(--rs-text);
	font-size: 11px;
	font-weight: 500;
	line-height: 1.6;
	letter-spacing: 0.2em;
	text-transform: uppercase;
}

.rs-field__optional {
	color: var(--rs-muted);
	letter-spacing: 0.08em;
	text-transform: none;
}

.rs-field__input {
	display: block;
	width: 100%;
	height: 52px;
	margin: 0;
	padding: 0 16px;
	border: 1px solid transparent;
	border-bottom-color: var(--rs-field-line);
	border-radius: 0;
	background: var(--rs-bg-panel);
	color: var(--rs-text);
	font: inherit;
	font-size: 16px; /* 16px: iOS does not zoom in on focus */
	line-height: 1.4;
	-webkit-appearance: none;
	appearance: none;
	transition: border-color 0.15s ease, background-color 0.15s ease;
}

textarea.rs-field__input {
	height: auto;
	min-height: 168px;
	padding: 14px 16px;
	line-height: 1.7;
	resize: vertical;
}

.rs-field__input:hover {
	border-bottom-color: var(--rs-muted);
}

.rs-field__input:focus,
.rs-field__input:focus-visible {
	border-color: var(--rs-accent);
	outline: none;
	background-color: #191d22;
}

.rs-field.is-error .rs-field__input {
	border-bottom-color: var(--rs-error);
}

.rs-field.is-error .rs-field__input:focus {
	border-color: var(--rs-error);
}

.rs-field__input:read-only {
	opacity: 0.6;
}

/* Keep the dark look when the browser autofills a field. */
.rs-field__input:-webkit-autofill {
	-webkit-box-shadow: 0 0 0 100px var(--rs-bg-panel) inset;
	-webkit-text-fill-color: var(--rs-text);
	caret-color: var(--rs-text);
}

.rs-section .rs-field__error {
	display: flex;
	gap: 8px;
	align-items: flex-start;
	margin: 0;
	color: var(--rs-error);
	font-size: 13px;
	line-height: 1.5;
}

.rs-field__error svg {
	flex: none;
	margin-top: 2px;
}

.rs-form__hp {
	position: absolute;
	left: -10000px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.rs-form__alert {
	display: flex;
	gap: 12px;
	align-items: flex-start;
	padding: 16px 18px;
	border: 1px solid rgba(255, 133, 119, 0.5);
	background: rgba(255, 133, 119, 0.08);
	color: #ffd6d0;
	font-size: 14px;
	line-height: 1.6;
}

.rs-form__alert svg {
	flex: none;
	margin-top: 3px;
	color: var(--rs-error);
}

.rs-form__foot {
	display: flex;
	flex-wrap: wrap;
	gap: 20px 32px;
	align-items: center;
	justify-content: space-between;
}

.rs-section .rs-form__privacy {
	flex: 1 1 240px;
	margin: 0;
	font-size: 13px;
	line-height: 1.7;
}

/* reCAPTCHA v3: the floating Google badge is hidden and replaced by this
   note under the button, as Google's terms allow. */
.rs-section .rs-form__recaptcha {
	flex: 1 1 100%;
	order: 3;
	margin: 0;
	font-size: 12px;
	line-height: 1.6;
}

.rs-form__recaptcha a {
	color: inherit;
}

.grecaptcha-badge {
	visibility: hidden;
}

.rs-form__send {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 52px;
	padding: 0 30px;
	border: 0;
	border-radius: 0;
	background: var(--rs-accent);
	color: var(--rs-bg);
	font: inherit;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	cursor: pointer;
	transition: background-color 0.2s ease;
}

.rs-form__send > span {
	display: inline-flex;
	gap: 12px;
	align-items: center;
}

.rs-form__send:hover {
	background: var(--rs-accent-hover);
}

.rs-form__send:disabled {
	cursor: progress;
}

.rs-form__spin {
	animation: rs-spin 0.8s linear infinite;
}

@keyframes rs-spin {
	to {
		transform: rotate(360deg);
	}
}

/* ---------------------------------------------------------------- Sent */

.rs-form-done {
	display: flex;
	flex-direction: column;
	gap: 20px;
	align-items: flex-start;
	padding: 56px 48px;
	background: var(--rs-bg-panel);
}

.rs-form-done:focus {
	outline: none;
}

.rs-form-done__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	border-radius: 50%;
	background: var(--rs-accent);
	color: var(--rs-bg);
}

.rs-form-done__title {
	margin: 0;
	font-size: 28px;
	font-weight: 400;
	line-height: 1.3;
}

.rs-section .rs-form-done p {
	max-width: 440px;
	margin: 0;
	color: #c2c7cc;
}

.rs-form-done__again {
	min-height: 44px;
	margin-top: 8px;
	padding: 0 18px;
	border: 1px solid var(--rs-text);
	border-radius: 0;
	background: transparent;
	color: var(--rs-text);
	font: inherit;
	font-size: 12px;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.rs-form-done__again:hover {
	background: var(--rs-text);
	color: var(--rs-bg);
}

@media (max-width: 900px) {
	.rs-contact {
		grid-template-columns: 1fr;
		grid-template-areas:
			"text"
			"form"
			"list";
		grid-template-rows: auto;
		row-gap: 40px;
	}

	.rs-contact__form {
		padding-top: 0;
	}

	.rs-contact__list {
		margin-top: 8px;
	}
}

@media (max-width: 560px) {
	.rs-form__send {
		width: 100%;
	}

	.rs-form-done {
		padding: 40px 24px;
	}
}

/* ==========================================================================
   Map
   ========================================================================== */

.rs-map {
	position: relative;
	height: var(--rs-map-h, 500px);
	overflow: hidden;
	background: #303030;
}

.rs-map__preview {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	opacity: 0.7;
}

.rs-map__canvas {
	position: absolute;
	inset: 0;
}

.rs-map__canvas[hidden],
.rs-map__consent[hidden],
.rs-map [hidden] {
	display: none !important;
}

.rs-map__consent {
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	width: min(460px, calc(100% - 2 * var(--rs-gutter)));
	padding: 26px 28px;
	background: rgba(17, 20, 23, 0.92);
	text-align: center;
}

.rs-map__consent p {
	margin: 0 0 18px;
	color: #c9cdd2;
	font-size: 13px;
	line-height: 1.7;
}

.rs-map__consent .rs-map__links {
	margin: 18px 0 0;
	font-size: 12px;
}

/* Google's own controls and labels use Roboto: keep them readable on dark. */
.rs-map .gm-style {
	font-family: var(--rs-font);
}

/* ==========================================================================
   Footer
   ========================================================================== */

.rs-footer {
	padding: 70px 0 50px;
	border-top: 1px solid var(--rs-line);
	color: var(--rs-muted);
	font-size: 14px;
}

.rs-footer__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	justify-content: space-between;
	gap: 40px;
}

.rs-footer__logo {
	width: auto;
	height: 40px;
}

.rs-footer address {
	font-style: normal;
}

.rs-footer strong {
	color: var(--rs-text);
	font-weight: 600;
}

.rs-footer a {
	color: var(--rs-muted);
	text-decoration-color: rgba(143, 149, 156, 0.4);
	text-underline-offset: 3px;
}

.rs-footer a:hover {
	color: var(--rs-accent);
}

.rs-contact__list a {
	color: var(--rs-text);
	text-decoration: none;
}

.rs-contact__list a:hover {
	color: var(--rs-accent);
}

.rs-footer p {
	margin: 0;
}

.rs-footer__cols {
	display: flex;
	flex-wrap: wrap;
	gap: 24px 64px;
}

/* ==========================================================================
   Inner pages (articles, contact form, errors…)
   ========================================================================== */

.rs-page-body {
	min-height: 60vh;
	padding: 160px 0 100px;
}

.rs-page-body h1,
.rs-page-body h2 {
	margin-bottom: 24px;
	font-size: clamp(26px, 3vw, 40px);
}

.rs-page-body p,
.rs-page-body li {
	color: #c2c7cc;
}

.rs-page-body .rs-heading__label {
	color: var(--rs-accent);
}

a.rs-button {
	text-decoration: none;
}

a.rs-button:hover {
	color: var(--rs-bg);
}

/* Joomla system messages */

#system-message-container {
	max-width: calc(var(--rs-container) + 2 * var(--rs-gutter));
	margin: 0 auto;
	padding-inline: var(--rs-gutter);
}

joomla-alert {
	display: block;
	margin: 24px 0;
	padding: 16px 20px;
	border-left: 3px solid var(--rs-accent);
	background: var(--rs-bg-panel);
	color: var(--rs-text);
}

/* ==========================================================================
   Intro (first visit): the logo kanji is written, then flies into the logo.
   html.rs-intro-on is set by the inline script in the <head> (index.php)
   and removed by template.js at the end of the intro.
   ========================================================================== */

.rs-intro {
	display: none;
}

.rs-intro-on {
	overflow: hidden;
}

.rs-intro-on .rs-intro {
	position: fixed;
	inset: 0;
	z-index: 1000;
	display: grid;
	place-items: center;
	cursor: pointer;
	/* Failsafe: if the script never runs, get out of the way. */
	animation: rs-intro-failsafe 0s 6s forwards;
}

.rs-intro__bg {
	position: absolute;
	inset: 0;
	background: var(--rs-bg);
}

.rs-intro__kanji {
	position: relative;
	width: min(56vmin, 320px);
	aspect-ratio: 1966 / 1863;
	transform-origin: 0 0;
	will-change: transform;
}

/* While the kanji is in the air the header shows the logo without it. */
.rs-intro-on .rs-header__logo {
	background: url("../images/logo-text.png") 0 0 / auto 100% no-repeat;
}

.rs-intro-on .rs-header__logo img {
	opacity: 0;
	animation: rs-intro-failsafe-logo 0s 6s forwards;
}

@keyframes rs-intro-failsafe {
	to {
		visibility: hidden;
	}
}

@keyframes rs-intro-failsafe-logo {
	to {
		opacity: 1;
	}
}
