/*
 * Casa Mora · En construcción
 * Basado en el Manual de identidad de marca 2026: Cormorant Garamond y Montserrat,
 * paleta oficial (crema, carbón cálido, arena, verde oliva y terracota) y
 * recursos gráficos discretos (filete fino, marco abierto e ilustración botánica).
 */

@font-face {
	font-family: "Cormorant Garamond";
	src: url("../fonts/cormorant-garamond-latin.woff2") format("woff2");
	font-weight: 500;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "Cormorant Garamond";
	src: url("../fonts/cormorant-garamond-italic-latin.woff2") format("woff2");
	font-weight: 300 700;
	font-style: italic;
	font-display: swap;
}

@font-face {
	font-family: "Montserrat";
	src: url("../fonts/montserrat-latin.woff2") format("woff2");
	font-weight: 100 900;
	font-style: normal;
	font-display: swap;
}

:root {
	--cm-crema: #F3EEE6;
	--cm-carbon: #2C2924;
	--cm-arena: #C9B39D;
	--cm-oliva: #686D5C;
	--cm-terracota: #A36545;
	--cm-serif: "Cormorant Garamond", "Cormorant", Garamond, "Times New Roman", serif;
	--cm-sans: "Montserrat", Arial, "Helvetica Neue", sans-serif;
	--cm-inset: clamp(14px, 2.4vw, 36px);
	--cm-ease: cubic-bezier(0.2, 0.7, 0.2, 1);
	--cm-draw: cubic-bezier(0.5, 0, 0.2, 1);
}

/* Base ------------------------------------------------------------------ */

html {
	background: var(--cm-crema);
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
}

body.cm-body {
	margin: 0;
	background: var(--cm-crema);
	color: var(--cm-carbon);
	font-family: var(--cm-sans);
	font-weight: 400;
	font-size: 1.0625rem;
	line-height: 1.65;
	font-kerning: normal;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

:where(.cm-body) *,
:where(.cm-body) *::before,
:where(.cm-body) *::after {
	box-sizing: border-box;
}

:where(.cm-body) :where(h1, p) {
	margin: 0;
}

::selection {
	background: var(--cm-arena);
	color: var(--cm-carbon);
}

.cm-sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

/* Página: una sola pantalla ------------------------------------------------ */

.cm-page {
	position: relative;
	isolation: isolate;
	overflow: hidden;
	display: grid;
	grid-template-rows: 1fr auto;
	min-height: 100vh;
	min-height: 100svh;
	background: var(--cm-crema);
}

/* Marco abierto: dos esquinas que enmarcan sin encerrar. */
.cm-frame {
	position: absolute;
	inset: var(--cm-inset);
	z-index: -1;
	pointer-events: none;
}

.cm-frame::before,
.cm-frame::after {
	content: "";
	position: absolute;
	width: clamp(44px, 6vw, 88px);
	height: clamp(44px, 6vw, 88px);
	border: 0 solid var(--cm-arena);
}

.cm-frame::before {
	top: 0;
	left: 0;
	border-top-width: 1px;
	border-left-width: 1px;
}

.cm-frame::after {
	right: 0;
	bottom: 0;
	border-right-width: 1px;
	border-bottom-width: 1px;
}

/* Ilustración botánica: se dibuja una vez, como algo que crece. */
.cm-branch {
	position: absolute;
	z-index: -1;
	right: clamp(-150px, -7vw, -28px);
	bottom: clamp(-150px, -14vh, -48px);
	width: clamp(240px, 33vw, 500px);
	pointer-events: none;
	color: var(--cm-arena);
	/* Grosor en unidades del dibujo, ajustado por tamaño para que la línea mida ~1,5 px. */
	--cm-stroke: 2.4;
}

.cm-branch__svg {
	display: block;
	width: 100%;
	height: auto;
	overflow: visible;
}

.cm-branch path {
	fill: none;
	stroke: currentColor;
	stroke-width: var(--cm-stroke);
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-dasharray: 1 1;
	stroke-dashoffset: 0;
}

.cm-branch .cm-branch__vein {
	stroke-width: calc(var(--cm-stroke) * 0.66);
	stroke-opacity: 0.8;
}

.cm-hero {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: clamp(72px, 11vh, 120px) clamp(24px, 6vw, 72px) clamp(32px, 5vh, 56px);
	text-align: center;
}

/* Logotipo maestro: firma vertical, con aire (área de protección = 22 % de su alto). */
.cm-logo {
	width: clamp(240px, 21vw, 300px);
	margin-bottom: clamp(44px, 7.5vh, 76px);
	color: var(--cm-carbon);
	line-height: 0;
}

.cm-logo__svg {
	display: block;
	width: 100%;
	height: auto;
}

.cm-hero__copy {
	display: flex;
	flex-direction: column;
	align-items: center;
	max-width: 56rem;
}

.cm-kicker {
	display: inline-flex;
	align-items: center;
	gap: 14px;
	margin-bottom: clamp(18px, 2.8vh, 28px);
	padding-left: 0.32em;
	font-weight: 500;
	font-size: 0.75rem;
	line-height: 1.4;
	letter-spacing: 0.32em;
	text-transform: uppercase;
	color: var(--cm-carbon);
}

.cm-kicker::before,
.cm-kicker::after {
	content: "";
	flex: none;
	width: 28px;
	height: 1px;
	background: var(--cm-terracota);
}

.cm-hero__title {
	max-width: 14em;
	font-family: var(--cm-serif);
	font-weight: 500;
	font-size: clamp(2.5rem, 1.55rem + 2.7vw, 4.25rem);
	line-height: 1.08;
	letter-spacing: -0.01em;
	text-wrap: balance;
	color: var(--cm-carbon);
}

.cm-hero__title em {
	font-style: italic;
	font-weight: 500;
}

.cm-hero__lead {
	max-width: 36em;
	margin-top: clamp(18px, 2.8vh, 28px);
	font-weight: 400;
	font-size: clamp(1.0625rem, 1rem + 0.2vw, 1.125rem);
	line-height: 1.7;
	text-wrap: balance;
}

/* Redes: íconos de trazo fino sobre círculo de arena al 20 %, con su nombre visible. */
.cm-social {
	margin-top: clamp(28px, 4.4vh, 44px);
}

.cm-social__list {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 12px clamp(28px, 4vw, 44px);
	margin: 0;
	padding: 0;
	list-style: none;
}

.cm-social__link {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	padding: 2px 4px 2px 2px;
	font-weight: 600;
	font-size: 0.875rem;
	line-height: 1.2;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	text-decoration: none;
	color: var(--cm-carbon);
	border-radius: 999px;
}

.cm-social__badge {
	display: grid;
	place-items: center;
	flex: none;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: rgba(201, 179, 157, 0.2);
	transition: background-color 0.4s var(--cm-ease);
}

.cm-social__icon {
	display: block;
	width: 22px;
	height: 22px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.5;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.cm-social__icon .cm-social__dot {
	fill: currentColor;
}

.cm-social__link:hover .cm-social__badge,
.cm-social__link:focus-visible .cm-social__badge {
	background: rgba(201, 179, 157, 0.45);
}

.cm-social__link:focus-visible {
	outline: 2px solid var(--cm-oliva);
	outline-offset: 4px;
}

.cm-footer {
	padding: 0 clamp(24px, 6vw, 72px) calc(var(--cm-inset) + clamp(14px, 2.4vh, 24px));
	font-weight: 500;
	font-size: 0.75rem;
	line-height: 1.5;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	text-align: center;
}

/* Entrada -------------------------------------------------------------------- */

@media (prefers-reduced-motion: no-preference) {
	.cm-logo {
		animation: cm-fade 1.2s var(--cm-ease) both;
	}

	.cm-hero__copy > * {
		animation: cm-rise 0.9s var(--cm-ease) both;
	}

	.cm-hero__copy > :nth-child(1) {
		animation-delay: 0.15s;
	}

	.cm-hero__copy > :nth-child(2) {
		animation-delay: 0.25s;
	}

	.cm-hero__copy > :nth-child(3) {
		animation-delay: 0.35s;
	}

	.cm-hero__copy > :nth-child(4) {
		animation-delay: 0.45s;
	}

	.cm-frame,
	.cm-footer {
		animation: cm-fade 1.6s ease 0.5s both;
	}

	.cm-branch path {
		animation: cm-draw 1.5s var(--cm-draw) both;
		animation-delay: calc(var(--d, 0s) + 0.6s);
	}

	.cm-branch .cm-branch__stem {
		animation-duration: 2.4s;
	}
}

@keyframes cm-fade {
	from {
		opacity: 0;
	}

	to {
		opacity: 1;
	}
}

@keyframes cm-rise {
	from {
		opacity: 0;
		transform: translate3d(0, 14px, 0);
	}

	to {
		opacity: 1;
		transform: none;
	}
}

@keyframes cm-draw {
	0% {
		stroke-dashoffset: 1;
		opacity: 0;
	}

	8% {
		opacity: 1;
	}

	100% {
		stroke-dashoffset: 0;
		opacity: 1;
	}
}

/* Móvil ---------------------------------------------------------------------- */

@media (max-width: 1199px) {
	.cm-branch {
		--cm-stroke: 3.2;
	}
}

@media (max-width: 900px) {
	.cm-branch {
		--cm-stroke: 4.1;
	}
}

/* En vertical la rama ocupa la esquina inferior: el marco abierto queda solo arriba. */
@media (max-width: 1100px) and (orientation: portrait) {
	.cm-frame::after {
		display: none;
	}
}

@media (max-height: 760px) {
	.cm-hero {
		padding-top: clamp(48px, 9vh, 72px);
	}

	.cm-logo {
		margin-bottom: clamp(32px, 5.5vh, 44px);
	}
}

@media (max-width: 600px) {
	.cm-hero {
		padding-top: 64px;
	}

	.cm-branch {
		--cm-stroke: 6.4;
		right: -10vw;
		bottom: -16vh;
		width: 44vw;
	}
}

/* Teléfonos bajos: sin espacio para la rama, vuelve la esquina del marco. */
@media (max-width: 600px) and (max-height: 800px) {
	.cm-branch {
		display: none;
	}

	.cm-frame::after {
		display: block;
	}
}

@media (max-width: 400px) {
	.cm-kicker {
		gap: 10px;
		padding-left: 0.22em;
		letter-spacing: 0.22em;
	}

	.cm-kicker::before,
	.cm-kicker::after {
		width: 18px;
	}

	.cm-social__list {
		column-gap: 16px;
	}

	.cm-social__link {
		gap: 10px;
		letter-spacing: 0.14em;
	}
}

@media (forced-colors: active) {
	.cm-branch,
	.cm-frame {
		display: none;
	}
}
