/*
 * ERMS.PRO — "the atelier", editorial cut.
 *
 * Bright, airy counterpart of ERMS.ONE's dark cosmic look: warm paper,
 * cobalt ink, brushed gold. The composition is a left-aligned magazine
 * layout — masthead on top, a big serif headline column on the left, and
 * an open right side where the background blueprint sketches draw
 * themselves.
 */

:root {
	--paper: #faf8f3;
	--paper-2: #f2eee4;
	--ink: #1b2230;
	--ink-soft: #5a6274;
	--cobalt: #0040c0;
	--cobalt-bright: #2e6bff;
	--gold: #b98a2e;
	--gold-bright: #d9ae54;
	--blush: #e2556a;
	--white: #ffffff;
	--font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--font-display: "Sora", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html, body {
	margin: 0;
	padding: 0;
	min-height: 100%;
}

body {
	position: relative;
	min-height: 100dvh;
	overflow-x: hidden;
	background:
		radial-gradient(1100px 700px at 18% -12%, rgba(46, 107, 255, 0.10) 0%, transparent 60%),
		radial-gradient(900px 650px at 108% 112%, rgba(226, 85, 106, 0.09) 0%, transparent 55%),
		radial-gradient(1000px 800px at 85% -5%, rgba(217, 174, 84, 0.12) 0%, transparent 55%),
		var(--paper);
	color: var(--ink);
	font-family: var(--font-body);
	-webkit-font-smoothing: antialiased;
}

/* ---------- Background layers ---------- */

#atelier {
	position: fixed;
	inset: 0;
	width: 100%;
	height: 100%;
	z-index: 0;
	display: block;
}

/* Drifting daylight tints — the light-theme sibling of ONE's aurora blobs. */
.light {
	position: fixed;
	inset: 0;
	z-index: 0;
	overflow: hidden;
	pointer-events: none;
	/* Soft gradients only — a live blur(70px) filter forces a huge
	   offscreen buffer and stalls first paint on many GPUs. */
	opacity: 0.75;
}

.tint {
	position: absolute;
	width: 52vw;
	height: 52vw;
	border-radius: 50%;
	will-change: transform;
}

.tint--cobalt {
	background: radial-gradient(circle, rgba(46, 107, 255, 0.16), transparent 65%);
	top: -14%;
	left: -10%;
	animation: sway1 26s ease-in-out infinite;
}

.tint--gold {
	background: radial-gradient(circle, rgba(217, 174, 84, 0.20), transparent 65%);
	top: 8%;
	right: -14%;
	animation: sway2 31s ease-in-out infinite;
}

.tint--blush {
	background: radial-gradient(circle, rgba(226, 85, 106, 0.11), transparent 60%);
	bottom: -18%;
	left: 30%;
	width: 40vw;
	height: 40vw;
	animation: sway3 37s ease-in-out infinite;
}

@keyframes sway1 {
	0%, 100% { transform: translate(0, 0) scale(1); }
	33%      { transform: translate(9vw, 7vh) scale(1.12); }
	66%      { transform: translate(3vw, 13vh) scale(1.04); }
}
@keyframes sway2 {
	0%, 100% { transform: translate(0, 0) scale(1.05); }
	33%      { transform: translate(-8vw, 9vh) scale(0.94); }
	66%      { transform: translate(-13vw, 2vh) scale(1.1); }
}
@keyframes sway3 {
	0%, 100% { transform: translate(0, 0) scale(1); }
	50%      { transform: translate(7vw, -8vh) scale(1.15); }
}

/* Fine drafting-paper grid, shifted toward the airy right side. */
.paper-grid {
	position: fixed;
	inset: 0;
	z-index: 1;
	pointer-events: none;
	background-image:
		linear-gradient(rgba(27, 34, 48, 0.055) 1px, transparent 1px),
		linear-gradient(90deg, rgba(27, 34, 48, 0.055) 1px, transparent 1px),
		linear-gradient(rgba(27, 34, 48, 0.028) 1px, transparent 1px),
		linear-gradient(90deg, rgba(27, 34, 48, 0.028) 1px, transparent 1px);
	background-size: 96px 96px, 96px 96px, 24px 24px, 24px 24px;
	mask-image: radial-gradient(circle at 72% 45%, black 12%, transparent 76%);
	-webkit-mask-image: radial-gradient(circle at 72% 45%, black 12%, transparent 76%);
}

/* ---------- Page frame ---------- */

.page {
	position: relative;
	z-index: 2;
	min-height: 100dvh;
	display: flex;
	flex-direction: column;
	padding: clamp(1.1rem, 3vh, 2.2rem) clamp(1.4rem, 6vw, 5.5rem);
}

/* ---------- Entrance animations ----------
 * Editorial "typesetting" feel: the masthead settles from above, the copy
 * column slides in from the left margin and sharpens from a blur. */

@keyframes settleDown {
	from { opacity: 0; transform: translateY(-10px); }
	to   { opacity: 1; transform: translateY(0); }
}

/* Opacity + transform only — animating filter:blur stalls the main thread
   and made the page feel like a hung PHP request on open. */
@keyframes inkIn {
	from {
		opacity: 0;
		transform: translateX(-18px);
	}
	to {
		opacity: 1;
		transform: translateX(0);
	}
}

/* ---------- Masthead ---------- */

.masthead {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 0.8rem 1.5rem;
	animation: settleDown 0.55s 0s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

.brand {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: clamp(0.5rem, 1vw, 0.8rem);
}

/* Cobalt plate is a real CSS box (rounded by the browser), white wordmark
   sits on top as a transparent SVG. This is the technique that looked right
   before — not clipping a pre-drawn rectangular bitmap/SVG with border-radius. */
.logo-frame {
	display: inline-block;
	line-height: 0;
	background: var(--cobalt);
	border-radius: 10px;
	box-shadow:
		0 8px 26px rgba(0, 64, 192, 0.22),
		0 1px 4px rgba(27, 34, 48, 0.10);
}

.logo {
	display: block;
	width: clamp(9.5em, 14vw, 13em);
	height: auto;
	/* Keep the img fully transparent in the corners so the rounded CSS
	   plate shows through — do not clip or re-round the image. */
	border-radius: 0;
	background: transparent;
}

.brand-mark {
	font-family: var(--font-display);
	font-weight: 700;
	font-size: clamp(1.15rem, 1.8vw, 1.55rem);
	letter-spacing: 0.04em;
	color: var(--ink);
	white-space: nowrap;
}

.brand-mark__pro {
	background: linear-gradient(115deg, var(--cobalt) 0%, var(--cobalt-bright) 45%, var(--gold) 110%);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}

.badge {
	display: inline-flex;
	align-items: center;
	margin-top: 0.35rem;
	gap: 0.6em;
	font-size: clamp(0.6rem, 1vw, 0.74rem);
	letter-spacing: 0.3em;
	font-weight: 500;
	color: var(--ink-soft);
	padding: 0.6em 1.2em;
	border: 1px solid rgba(27, 34, 48, 0.14);
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.72);
	box-shadow: 0 1px 2px rgba(27, 34, 48, 0.05);
}

.badge__dot {
	width: 0.55em;
	height: 0.55em;
	border-radius: 50%;
	background: var(--gold-bright);
	box-shadow: 0 0 0 3px rgba(217, 174, 84, 0.22);
	animation: breathe 2.4s ease-in-out infinite;
}

@keyframes breathe {
	0%, 100% { opacity: 1; transform: scale(1); }
	50%      { opacity: 0.45; transform: scale(0.72); }
}

/* ---------- Copy column (left, editorial) ---------- */

.copy {
	flex: 1;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: flex-start;
	text-align: left;
	max-width: 46rem;
	gap: clamp(1rem, 2.8vh, 1.8rem);
	padding: 5vh 0 4vh;
}

.caption {
	margin: 0;
	font-size: clamp(0.62rem, 1vw, 0.8rem);
	font-weight: 400;
	letter-spacing: 0.34em;
	text-transform: uppercase;
	color: var(--ink-soft);
	animation: inkIn 0.55s 0.05s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

.headline {
	margin: 0;
	font-family: var(--font-display);
	font-weight: 700;
	font-size: clamp(3rem, 9vw, 7.5rem);
	line-height: 1.03;
	letter-spacing: -0.025em;
	color: var(--ink);
	animation: inkIn 0.6s 0.1s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

.headline em {
	font-style: normal;
	font-weight: 800;
	background: linear-gradient(115deg,
		var(--cobalt) 0%,
		var(--cobalt-bright) 32%,
		var(--gold-bright) 55%,
		var(--gold) 70%,
		var(--cobalt) 100%);
	background-size: 240% auto;
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
	animation: sheen 9s linear infinite;
}

@keyframes sheen {
	to { background-position: 240% center; }
}

/* Tailor's dimension line |———◆ drawing out from the left margin. */
.measure {
	display: flex;
	align-items: center;
	width: min(34vw, 17rem);
	gap: 0.45rem;
	animation: inkIn 0.5s 0.18s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

.measure__tick {
	flex: none;
	width: 1px;
	height: 0.85rem;
	background: rgba(27, 34, 48, 0.42);
}

.measure__line {
	flex: 1;
	height: 1px;
	background: linear-gradient(90deg, rgba(27, 34, 48, 0.42), rgba(185, 138, 46, 0.6));
	transform-origin: left;
	animation: drawLine 0.9s 0.3s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

.measure__gem {
	flex: none;
	width: 0.5rem;
	height: 0.5rem;
	background: var(--gold-bright);
	transform: rotate(45deg);
	box-shadow: 0 0 0 3px rgba(217, 174, 84, 0.2);
	animation: gemIn 0.5s 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes drawLine {
	from { transform: scaleX(0); }
	to   { transform: scaleX(1); }
}
@keyframes gemIn {
	from { opacity: 0; transform: rotate(45deg) scale(0); }
	to   { opacity: 1; transform: rotate(45deg) scale(1); }
}

.tagline {
	margin: 0;
	max-width: 42ch;
	color: var(--ink-soft);
	font-size: clamp(1rem, 1.9vw, 1.3rem);
	font-weight: 400;
	line-height: 1.65;
	animation: inkIn 0.5s 0.22s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

.cta-row {
	display: flex;
	flex-wrap: wrap;
	gap: 0.9rem;
	justify-content: flex-start;
	margin-top: 0.3rem;
	animation: inkIn 0.5s 0.28s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

.cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-family: var(--font-body);
	font-weight: 500;
	font-size: clamp(0.85rem, 1.4vw, 1rem);
	letter-spacing: 0.03em;
	padding: 0.9em 1.8em;
	border-radius: 999px;
	text-decoration: none;
	transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
	will-change: transform;
}

.cta:focus-visible {
	outline: 2px solid var(--cobalt-bright);
	outline-offset: 3px;
}

.cta--primary {
	color: var(--white);
	background: linear-gradient(120deg, var(--cobalt) 0%, var(--cobalt-bright) 70%, #5a8bff 130%);
	box-shadow:
		0 10px 28px rgba(0, 64, 192, 0.30),
		inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.cta--primary:hover {
	transform: translateY(-2px);
	box-shadow:
		0 16px 38px rgba(0, 64, 192, 0.38),
		inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.cta--ghost {
	color: var(--ink);
	border: 1px solid rgba(27, 34, 48, 0.22);
	background: rgba(255, 255, 255, 0.72);
}
.cta--ghost:hover {
	transform: translateY(-2px);
	border-color: var(--gold);
	box-shadow: 0 8px 24px rgba(185, 138, 46, 0.20);
}

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

.footer {
	display: flex;
	flex-wrap: wrap;
	gap: 0.7rem;
	align-items: center;
	justify-content: flex-start;
	padding: 1.2rem 0 0.4rem;
	color: rgba(90, 98, 116, 0.75);
	font-size: 0.8rem;
	letter-spacing: 0.04em;
	animation: settleDown 0.5s 0.35s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}
.footer__sep { opacity: 0.45; }

/* ---------- Small screens ---------- */

@media (max-width: 760px) {
	.masthead {
		justify-content: center;
		align-items: center;
		text-align: center;
	}
	.brand { align-items: center; }
	.copy {
		max-width: 100%;
		padding: 4vh 0 3vh;
	}
	.measure { width: min(56vw, 15rem); }
	.footer { justify-content: center; }
}

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

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after {
		animation-duration: 0.001ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.001ms !important;
	}
	.headline em { background-position: 0 center; }
}
