/* =========================================================================
   Eye color scanner and eye color chart. Loaded only on /eye-color/ and
   /eye-color-chart/, on top of eyeshapes.css, using its tokens.
   ========================================================================= */

.privacy-line {
	margin-top: 0.85rem;
	color: var(--haze);
	font-size: var(--step-small);
}

.drop {
	touch-action: manipulation;
}

/* --- Result ------------------------------------------------------------- */

.ec-result {
	margin-top: 1.25rem;
	min-width: 0;
	background: var(--stroma);
	border: 1px solid var(--edge);
	border-radius: var(--radius-lg);
	padding: clamp(1rem, 0.6rem + 1.4vw, 1.5rem);
	display: grid;
	gap: 1.4rem;
}

/* The result slides in from slightly lower when it appears: transform only,
   never from opacity 0, and it plays once. */
.ec-result.is-in {
	animation: ec-rise 380ms cubic-bezier(0.23, 1, 0.32, 1) 1;
}

@keyframes ec-rise {
	from {
		transform: translateY(10px);
	}
	to {
		transform: none;
	}
}

.ec-result > * {
	min-width: 0;
}

.ec-result__eyes {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.75rem;
}

.ec-eye {
	min-width: 0;
	display: grid;
	gap: 0.4rem;
}

.ec-eye canvas {
	width: 100%;
	height: auto;
	aspect-ratio: 3 / 2;
	border-radius: var(--radius);
	border: 1px solid var(--edge-lit);
	background: var(--pupil);
}

.ec-result__head {
	display: flex;
	align-items: center;
	gap: 1rem;
}

.ec-result__head > div {
	min-width: 0;
}

.ec-result__swatch {
	flex: none;
	width: 64px;
	height: 64px;
	border-radius: 50%;
	border: 1px solid var(--edge-lit);
	background: var(--edge);
	box-shadow: inset 0 0 0 10px color-mix(in oklch, black 25%, transparent);
}

.ec-result__name {
	font-size: var(--step-h2);
	line-height: 1.05;
	margin-block: 0.2rem 0.35rem;
	color: var(--catch);
}

.ec-sure {
	padding: 0.75rem 0.9rem;
	border-radius: var(--radius);
	border-left: 3px solid var(--iris);
	background: color-mix(in oklch, var(--iris) 8%, var(--pupil));
	font-size: var(--step-small);
}

.ec-sure[data-level="medium"] {
	border-left-color: var(--iris-dim);
}

.ec-sure[data-level="low"] {
	border-left-color: var(--alarm);
	background: color-mix(in oklch, var(--alarm) 9%, var(--pupil));
}

.ec-sure strong {
	color: var(--catch);
}

/* Composition of the iris, not a score: a stacked strip of the tones found. */
.ec-mix__bar {
	display: flex;
	height: 14px;
	margin-top: 0.6rem;
	border-radius: 999px;
	overflow: hidden;
	background: var(--edge);
}

.ec-mix__bar span {
	display: block;
	height: 100%;
}

.ec-mix__legend {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem 1rem;
	margin-top: 0.6rem;
	padding: 0;
	list-style: none;
	font-size: var(--step-small);
	color: var(--haze);
}

.ec-mix__legend li {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
}

.ec-mix__legend i {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	display: inline-block;
}

.ec-chart__strip {
	display: grid;
	grid-template-columns: repeat(7, minmax(0, 1fr));
	gap: 0.35rem;
	margin-top: 0.6rem;
	padding: 0;
	list-style: none;
}

.ec-chart__cell {
	display: grid;
	justify-items: center;
	gap: 0.35rem;
	padding: 0.45rem 0.1rem;
	border-radius: var(--radius);
	border: 1px solid transparent;
	text-align: center;
	min-width: 0;
}

.ec-chart__chip {
	width: 100%;
	max-width: 44px;
	aspect-ratio: 1;
	border-radius: 50%;
	background: var(--chip);
	border: 1px solid var(--edge);
}

.ec-chart__name {
	font-size: 0.7rem;
	line-height: 1.2;
	color: var(--haze);
	overflow-wrap: anywhere;
}

.ec-chart__cell.is-hit {
	border-color: var(--iris);
	background: color-mix(in oklch, var(--iris) 8%, transparent);
}

.ec-chart__cell.is-hit .ec-chart__name {
	color: var(--catch);
	font-weight: 600;
}

.ec-chart__cell.is-hit .ec-chart__chip {
	border-color: var(--catch);
}

.ec-result__next .btn {
	touch-action: manipulation;
}

@media (max-width: 520px) {
	.ec-result__next .btn {
		flex: 1 1 100%;
	}
}

.ec-result__shape {
	font-size: var(--step-small);
}

/* --- Color list on the scanner page ------------------------------------- */

.ec-steps {
	padding: 0;
	list-style: none;
}

.ec-colors {
	display: grid;
	gap: 0 clamp(1.5rem, 1rem + 2.5vw, 3rem);
	padding: 0;
	list-style: none;
}

@media (min-width: 780px) {
	.ec-colors {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

.ec-colors__item {
	display: flex;
	gap: 1rem;
	align-items: flex-start;
	padding-block: 1.1rem;
	border-top: 1px solid var(--edge);
}

.iris-dot {
	flex: none;
}

.ec-colors__text {
	min-width: 0;
}

.ec-colors__text h3 {
	font-size: var(--step-h4);
	margin-bottom: 0.3rem;
}

.ec-colors__text h3 a {
	color: var(--catch);
	text-decoration: none;
}

@media (hover: hover) and (pointer: fine) {
	.ec-colors__text h3 a:hover {
		color: var(--iris);
	}
}

.ec-colors__text p {
	color: var(--haze);
	font-size: var(--step-small);
}

.ec-colors__text .readout {
	margin-top: 0.35rem;
	color: var(--sclera);
}

/* --- Chart page --------------------------------------------------------- */

.ec-rows {
	padding: 0;
	list-style: none;
	max-width: 860px;
	margin-inline: auto;
}

.ec-row {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	gap: clamp(1rem, 0.6rem + 2vw, 2rem);
	padding-block: 1.75rem;
	border-top: 1px solid var(--edge);
	scroll-margin-top: 5.5rem;
}

.ec-row:target {
	border-top-color: var(--iris);
}

@media (max-width: 520px) {
	.ec-row .iris-dot {
		width: 60px;
		height: 60px;
	}
}

.ec-row__body > * + * {
	margin-top: 0.6rem;
}

.ec-row__name {
	font-size: var(--step-h3);
	color: var(--catch);
}

.ec-row__short {
	color: var(--iris);
	font-weight: 500;
}

.ec-row__facts {
	display: grid;
	gap: 0.6rem 1.5rem;
	margin-top: 1rem !important;
}

@media (min-width: 640px) {
	.ec-row__facts {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

.ec-row__facts dd {
	margin: 0.15rem 0 0;
	font-size: var(--step-small);
}

.ec-table table {
	display: table;
}

.ec-table {
	overflow-x: auto;
}

.ec-refs {
	font-size: var(--step-small);
}

.ec-refs a {
	overflow-wrap: anywhere;
}

@media (prefers-reduced-motion: reduce) {
	.ec-result.is-in {
		animation: none;
	}
}
