/* Attingimus — website 2026
   Design principles: native scrolling, one sticky stage driven 1:1 by scroll,
   translucent chrome, size-specific type, restraint. */

:root {
	--red: #a62320;
	--red-press: #8c1d1b;
	--ink: #1d2e3a;
	--ink-2: #4f5d68;
	--ink-3: #7b8790;
	--paper: #ffffff;
	--tile: #f5f5f7;
	--line: rgba(29, 46, 58, 0.12);
	--nav-h: 52px;
	--radius: 22px;
	--ease-out: cubic-bezier(0.22, 1, 0.36, 1);
	--ease-in: cubic-bezier(0.64, 0, 0.78, 0); /* mirrored counterpart */
	--font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable", "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
	--font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI Variable Display", "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
	color-scheme: light;
}

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

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
	scroll-behavior: smooth;
	scroll-padding-top: calc(var(--nav-h) + 8px);
}

body {
	margin: 0;
	font: 400 1.0625rem/1.55 var(--font);
	letter-spacing: -0.003em;
	color: var(--ink);
	background: var(--paper);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	font-optical-sizing: auto;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
p { margin: 0 0 1em; color: var(--ink-2); }
h1, h2, h3 { margin: 0; font-family: var(--font-display); color: var(--ink); }

::selection { background: rgba(166, 35, 32, 0.18); }

:focus-visible {
	outline: 3px solid rgba(166, 35, 32, 0.45);
	outline-offset: 3px;
	border-radius: 6px;
}

.skip {
	position: fixed; left: 12px; top: -60px; z-index: 100;
	padding: 10px 16px; border-radius: 999px;
	background: var(--ink); color: #fff; font-weight: 600;
	transition: top 200ms var(--ease-out);
}
.skip:focus { top: 10px; }

/* ---------- Navigation: translucent material, content scrolls beneath ---------- */

.nav {
	position: fixed; inset: 0 0 auto 0; z-index: 50;
	height: var(--nav-h);
	background: rgba(255, 255, 255, 0.72);
	-webkit-backdrop-filter: saturate(180%) blur(20px);
	backdrop-filter: saturate(180%) blur(20px);
	transition: box-shadow 250ms ease;
}
/* scroll-edge effect instead of a permanent hard divider */
.nav.is-scrolled { box-shadow: 0 1px 0 var(--line), 0 6px 20px -12px rgba(29, 46, 58, 0.25); }

.nav-inner {
	height: 100%;
	max-width: 1280px;
	margin: 0 auto;
	padding: 0 max(20px, env(safe-area-inset-left)) 0 max(20px, env(safe-area-inset-right));
	display: flex; align-items: center; gap: 28px;
}

.brand { display: flex; align-items: center; gap: 10px; flex: none; }
.brand img { height: 26px; width: auto; }
.brand .brand-name { height: 13px; }

.nav-links { display: flex; gap: 26px; margin-left: auto; }
.nav-links a {
	font-size: 0.8125rem; letter-spacing: 0.005em;
	color: var(--ink-2);
	padding: 6px 0;
	transition: color 150ms ease;
}
.nav-links a:hover, .nav-links a[aria-current="true"] { color: var(--ink); }
.nav-links a[aria-current="true"] { font-weight: 600; }

/* ---------- Buttons: feedback on press, instantly ---------- */

.btn {
	display: inline-flex; align-items: center; justify-content: center;
	min-height: 44px; padding: 0 22px;
	border-radius: 999px;
	background: var(--red); color: #fff;
	font-size: 1rem; font-weight: 600; letter-spacing: -0.01em;
	transition: transform 100ms ease-out, background-color 150ms ease;
	-webkit-tap-highlight-color: transparent;
}
.btn:hover { background: var(--red-press); }
.btn:active { transform: scale(0.97); }
.btn-small { min-height: 30px; padding: 0 14px; font-size: 0.8125rem; letter-spacing: 0; }

.link {
	display: inline-flex; align-items: center; gap: 4px;
	color: var(--red); font-weight: 500;
	-webkit-tap-highlight-color: transparent;
}
.link::after {
	content: "›"; font-size: 1.25em; line-height: 1;
	transform: translateY(-0.04em);
	transition: transform 200ms var(--ease-out);
}
.link:hover { text-decoration: underline; text-underline-offset: 3px; }
.link:hover::after { transform: translate(3px, -0.04em); }
.link:active { opacity: 0.6; }
.link[href="#top"]::after { content: "↑"; font-size: 1em; transform: none; }

/* ---------- Mobile menu: grows from its trigger, leaves the same way ---------- */

.menu-btn {
	display: none;
	position: relative; width: 44px; height: 44px; margin-right: -10px;
	border: 0; background: none; cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}
.menu-btn span {
	position: absolute; left: 13px; width: 18px; height: 1.5px; border-radius: 1px;
	background: var(--ink);
	transition: transform 300ms var(--ease-out);
}
.menu-btn span:first-child { transform: translateY(-3.5px); }
.menu-btn span:last-child  { transform: translateY(3.5px); }
.menu-btn[aria-expanded="true"] span:first-child { transform: rotate(45deg); }
.menu-btn[aria-expanded="true"] span:last-child  { transform: rotate(-45deg); }

.sheet {
	position: absolute; top: calc(var(--nav-h) - 4px); right: 12px;
	min-width: 220px;
	display: flex; flex-direction: column;
	padding: 8px;
	border-radius: 18px;
	background: rgba(255, 255, 255, 0.86);
	-webkit-backdrop-filter: saturate(180%) blur(28px);
	backdrop-filter: saturate(180%) blur(28px);
	box-shadow: 0 0 0 0.5px var(--line), 0 20px 50px -10px rgba(29, 46, 58, 0.35);
	transform-origin: top right;
	transform: scale(0.92) translateY(-6px);
	opacity: 0;
	visibility: hidden;
	transition: transform 220ms var(--ease-in), opacity 180ms ease, visibility 0s 220ms;
}
.sheet a {
	padding: 12px 14px; border-radius: 12px;
	font-size: 1.0625rem; font-weight: 500;
	transition: background-color 80ms ease;
}
.sheet a:active { background: rgba(29, 46, 58, 0.08); }
.sheet a:last-child { color: var(--red); }
.nav.menu-open .sheet {
	transform: none; opacity: 1; visibility: visible;
	transition: transform 380ms var(--ease-out), opacity 200ms ease, visibility 0s;
}

.scrim {
	position: fixed; inset: 0; z-index: 40;
	background: rgba(29, 46, 58, 0.18);
	opacity: 0; pointer-events: none;
	transition: opacity 250ms ease;
}
.scrim.is-open { opacity: 1; pointer-events: auto; }

/* ---------- Tour: sticky stage + scrolling chapters ---------- */

main { padding-top: var(--nav-h); }

.tour {
	max-width: 1280px;
	margin: 0 auto;
	padding: 0 clamp(20px, 4vw, 48px);
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
	column-gap: clamp(32px, 5vw, 80px);
}

.stage {
	grid-column: 2; grid-row: 1;
	position: sticky; top: var(--nav-h);
	height: calc(100vh - var(--nav-h));
	height: calc(100svh - var(--nav-h));
	display: flex; flex-direction: column; align-items: center; justify-content: center;
	gap: 8px;
}
.stage-inner {
	position: relative;
	width: min(100%, calc(100svh - var(--nav-h) - 110px));
	aspect-ratio: 1;
}
.stage canvas, .stage-fallback {
	position: absolute; inset: 0; width: 100%; height: 100%;
}
.js .stage-fallback { visibility: hidden; }

.stage-label {
	min-height: 34px;
	display: flex; align-items: center;
}
.stage-label span {
	display: inline-block;
	padding: 6px 14px; border-radius: 999px;
	background: var(--tile);
	font-size: 0.8125rem; font-weight: 500; letter-spacing: 0.005em;
	color: var(--ink-2);
	transition: opacity 200ms ease, transform 300ms var(--ease-out);
}
.stage-label span.is-swapping { opacity: 0; transform: translateY(4px); }

/* Hotspots — only visible in the fully exploded state */
.hotspots {
	position: absolute; inset: 0;
	opacity: 0; pointer-events: none;
	transition: opacity 250ms ease;
}
.hotspots.is-visible { opacity: 1; pointer-events: auto; }
.hotspot {
	position: absolute; right: -4%; top: var(--y);
	transform: translateY(-50%);
	display: inline-flex; align-items: center; gap: 8px;
	padding: 7px 14px 7px 10px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.78);
	-webkit-backdrop-filter: saturate(180%) blur(16px);
	backdrop-filter: saturate(180%) blur(16px);
	box-shadow: 0 0 0 0.5px var(--line), 0 6px 18px -8px rgba(29, 46, 58, 0.35);
	font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.01em;
	transition: transform 100ms ease-out, box-shadow 200ms ease;
	-webkit-tap-highlight-color: transparent;
}
.hotspot i {
	width: 8px; height: 8px; border-radius: 50%;
	background: var(--red);
	box-shadow: 0 0 0 4px rgba(166, 35, 32, 0.15);
}
.hotspot:hover { box-shadow: 0 0 0 0.5px var(--line), 0 10px 24px -8px rgba(29, 46, 58, 0.45); }
.hotspot:active { transform: translateY(-50%) scale(0.96); }

.chapters { grid-column: 1; grid-row: 1; }

.chapter {
	min-height: calc(100svh - var(--nav-h));
	padding: 14vh 0;
	display: flex; flex-direction: column; justify-content: center; align-items: flex-start;
	max-width: 34rem;
}

/* ---------- Typography: tracking & leading by size ---------- */

.eyebrow {
	margin-bottom: 0.75rem;
	font-size: 0.875rem; font-weight: 600; letter-spacing: 0.01em;
	color: var(--red);
}
h1 {
	font-size: clamp(2.75rem, 6vw, 5rem);
	line-height: 1.04; letter-spacing: -0.035em; font-weight: 700;
	margin-bottom: 1.25rem;
}
h2 {
	font-size: clamp(2rem, 3.6vw, 3rem);
	line-height: 1.08; letter-spacing: -0.028em; font-weight: 700;
	margin-bottom: 1.25rem;
	text-wrap: balance;
}
h3 { font-size: 1.1875rem; line-height: 1.25; letter-spacing: -0.015em; font-weight: 600; }
.lead {
	font-size: clamp(1.1875rem, 1.6vw, 1.375rem);
	line-height: 1.4; letter-spacing: -0.012em;
	color: var(--ink);
	text-wrap: pretty;
}
.hero .lead { color: var(--ink-2); max-width: 30rem; }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; margin-top: 0.75rem; }

.scroll-hint {
	margin-top: 12vh; margin-bottom: 0;
	font-size: 0.8125rem; color: var(--ink-3);
	display: flex; align-items: center; gap: 8px;
}
.scroll-hint::after { content: "↓"; }

.hint { font-size: 0.875rem; color: var(--ink-3); margin-top: 0.5rem; }
.hint-touch { display: none; }

/* ---------- Stats tiles ---------- */

.stats {
	display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 10px; width: 100%;
	margin: 0.75rem 0 1.25rem;
}
.stats-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stats > div {
	padding: 18px 18px 16px;
	border-radius: 18px;
	background: var(--tile);
	display: flex; flex-direction: column; gap: 4px;
}
.stats strong {
	font-family: var(--font-display);
	font-size: clamp(1.5rem, 2.4vw, 2rem);
	line-height: 1.05; letter-spacing: -0.03em; font-weight: 700;
	white-space: nowrap;
}
.stats strong small { font-size: 0.6em; letter-spacing: 0; }
.stats span { font-size: 0.8125rem; line-height: 1.35; color: var(--ink-2); }

/* ---------- Application cards ---------- */

.cards {
	list-style: none; margin: 0.5rem 0 1.5rem; padding: 0;
	display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px;
	width: 100%;
}
.card {
	padding: 20px 20px 4px;
	border-radius: var(--radius);
	background: var(--tile);
}
.card h3 { margin-bottom: 0.5rem; }
.card p { font-size: 0.9375rem; line-height: 1.45; }

/* ---------- Measurands & specs ---------- */

.sub { margin: 1rem 0 0.5rem; }
.measures, .specs { margin: 0 0 1.5rem; width: 100%; }
.measures > div, .specs > div {
	display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: 12px;
	padding: 14px 0;
	border-top: 1px solid var(--line);
}
.measures > div:last-child, .specs > div:last-child { border-bottom: 1px solid var(--line); }
dt { font-weight: 600; letter-spacing: -0.01em; }
dd { margin: 0; color: var(--ink-2); font-size: 0.9375rem; line-height: 1.45; }

/* ---------- Chips ---------- */

.chips { list-style: none; padding: 0; margin: 0.25rem 0 1.25rem; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li {
	padding: 6px 14px; border-radius: 999px;
	background: var(--tile);
	font-size: 0.875rem; font-weight: 500; color: var(--ink-2);
	text-decoration: line-through; text-decoration-color: rgba(166, 35, 32, 0.6); text-decoration-thickness: 1.5px;
}

/* ---------- Contact ---------- */

.contact-card {
	width: 100%;
	margin: 0.5rem 0 1.5rem;
	border-radius: var(--radius);
	background: var(--tile);
	padding: 4px 20px;
}
.contact-row {
	display: grid; grid-template-columns: 5.5rem minmax(0, 1fr); gap: 12px;
	padding: 16px 0;
	border-bottom: 1px solid var(--line);
	transition: opacity 80ms ease;
}
.contact-row:last-child { border-bottom: 0; }
a.contact-row:active { opacity: 0.55; }
a.contact-row .value { color: var(--red); font-weight: 500; }
.contact-row .label { font-size: 0.875rem; color: var(--ink-3); padding-top: 1px; }
.contact-row address { font-style: normal; color: var(--ink); }

/* ---------- Footer ---------- */

.footer { border-top: 1px solid var(--line); background: var(--tile); }
.footer-inner {
	max-width: 1280px; margin: 0 auto;
	padding: 22px clamp(20px, 4vw, 48px) calc(22px + env(safe-area-inset-bottom));
	display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px;
	font-size: 0.75rem; color: var(--ink-3);
}
.footer-inner img { height: 20px; width: auto; }
.footer-inner a { color: var(--ink-2); }
.footer-inner a:first-of-type { margin-left: auto; }
.footer-inner a:hover { text-decoration: underline; }

/* ---------- Reveal (gentle; content stays visible without JS) ---------- */

.js [data-reveal] {
	opacity: 0;
	transform: translateY(18px);
	transition: opacity 700ms var(--ease-out), transform 900ms var(--ease-out);
}
.js [data-reveal].is-in { opacity: 1; transform: none; }

/* ---------- Layout: narrow screens ---------- */

@media (max-width: 960px) {
	.nav-links, .nav-cta { display: none; }
	.menu-btn { display: block; margin-left: auto; }
}

@media (max-width: 820px) {
	.tour { grid-template-columns: minmax(0, 1fr); }
	.stage {
		grid-column: 1; grid-row: 1;
		z-index: 5;
		height: auto;
		padding: 8px 0 6px;
		margin: 0 calc(-1 * clamp(20px, 4vw, 48px));
		background: var(--paper);
	}
	/* scroll edge: content dissolves under the stage instead of a hard cut */
	.stage::after {
		content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 28px;
		background: linear-gradient(var(--paper), rgba(255, 255, 255, 0));
		pointer-events: none;
	}
	.stage-inner { width: min(78vw, 38svh); }
	.stage-label { min-height: 30px; }
	.chapters { grid-row: 2; }
	.chapter { min-height: 0; padding: 56px 0 40px; max-width: none; }
	.hero { padding-top: 16px; }
	.scroll-hint { margin-top: 32px; }
	.hotspot { right: -6%; font-size: 0.75rem; padding: 5px 11px 5px 8px; }
	.hint-desktop { display: none; }
	.hint-touch { display: inline; }
}

@media (max-width: 520px) {
	.cards { grid-template-columns: minmax(0, 1fr); }
	.stats-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.stats-3 > div:last-child { grid-column: span 2; }
	.measures > div, .specs > div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}

/* ---------- Accessibility preferences ---------- */

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	.js [data-reveal] { transform: none; transition: opacity 300ms ease; }
	.sheet, .nav.menu-open .sheet { transform: none; transition: opacity 150ms ease, visibility 0s; }
	.link::after, .link:hover::after { transition: none; }
}

@media (prefers-reduced-transparency: reduce) {
	.nav, .sheet, .hotspot { background: #fff; -webkit-backdrop-filter: none; backdrop-filter: none; }
}

@media (prefers-contrast: more) {
	:root { --ink-2: #26343f; --ink-3: #3d4a54; --line: rgba(29, 46, 58, 0.45); }
	.nav { background: #fff; box-shadow: 0 1px 0 var(--ink); }
	.card, .stats > div, .contact-card { box-shadow: inset 0 0 0 1px var(--ink); }
}
