/* Single typeface page — Type Colony product style */

.typeface-page {
	--typeface-content-width: 1800px;

	padding-bottom: clamp(4rem, 8vw, 6rem);
}

.typeface-page .container,
.typeface-page .buying-options-wrap {
	width: 100%;
	max-width: var(--typeface-content-width);
	margin-inline: auto;
}

/* Preview slider — Type Colony reference
   ========================================================================== */

.typeface-preview {
	border-bottom: 1px solid var(--color-border);
}

/* Product gallery — Dirtyline-style horizontal strip
   ========================================================================== */

.typeface-gallery {
	width: 100%;
	max-width: none;
	margin-inline: 0;
	background: var(--color-bg);
}

.typeface-gallery__viewport {
	position: relative;
	overflow: hidden;
}

.typeface-gallery__track {
	display: flex;
	flex-wrap: nowrap;
	will-change: transform;
	transition: transform 0.6s ease;
}

.typeface-gallery__track.is-jump {
	transition: none;
}

.typeface-gallery__slide {
	flex: 0 0 100%;
	max-width: 100%;
	margin: 0;
}

.typeface-gallery__slide--image {
	display: block;
	min-height: inherit;
	background: var(--color-surface);
}

.typeface-gallery__image {
	display: block;
	width: 100%;
	height: 100%;
	min-height: clamp(240px, 36vw, 440px);
	object-fit: cover;
}

.typeface-gallery__slide--specimen {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.75rem;
	min-height: clamp(240px, 36vw, 440px);
	padding: clamp(1.5rem, 4vw, 3rem);
	text-align: center;
}

.typeface-gallery__specimen-meta {
	font-size: 0.6875rem;
	font-weight: 500;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	opacity: 0.72;
}

.typeface-gallery__specimen-text {
	display: block;
	max-width: 100%;
	font-weight: 400;
	font-synthesis: none;
	line-height: 1;
	letter-spacing: -0.02em;
	word-break: break-word;
}

.typeface-gallery__nav {
	position: absolute;
	top: 50%;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.5rem;
	height: 2.5rem;
	padding: 0;
	color: var(--color-text);
	background: color-mix(in srgb, var(--color-bg) 82%, transparent);
	border: 1px solid var(--color-border);
	border-radius: 999px;
	transform: translateY(-50%);
	cursor: pointer;
	opacity: 0;
	transition: opacity var(--transition), background var(--transition), border-color var(--transition);
}

.typeface-gallery__viewport:hover .typeface-gallery__nav,
.typeface-gallery__nav:focus-visible {
	opacity: 1;
}

.typeface-gallery__nav span {
	display: block;
	width: 0.55rem;
	height: 0.55rem;
	border-right: 1.5px solid currentColor;
	border-bottom: 1.5px solid currentColor;
}

.typeface-gallery__nav--prev {
	left: clamp(0.75rem, 2vw, 1.25rem);
}

.typeface-gallery__nav--prev span {
	transform: rotate(135deg) translate(-1px, -1px);
}

.typeface-gallery__nav--next {
	right: clamp(0.75rem, 2vw, 1.25rem);
}

.typeface-gallery__nav--next span {
	transform: rotate(-45deg) translate(-1px, -1px);
}

@media (min-width: 768px) {
	.typeface-gallery__slide {
		flex: 0 0 33.3333%;
		max-width: 33.3333%;
	}
}

.typeface-preview__toolbar {
	border-top: 1px solid var(--color-border);
	border-bottom: 1px solid var(--color-border);
}

.typeface-preview__toolbar-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1.5rem;
	min-height: 72px;
}

.typeface-preview__toolbar-name {
	display: flex;
	flex-direction: column;
	gap: 0.2rem;
}

.typeface-preview__title {
	margin: 0;
	font-size: clamp(1.125rem, 2vw, 1.5rem);
	font-weight: 400;
	line-height: 1.2;
	letter-spacing: -0.02em;
}

.typeface-preview__styles {
	font-size: 0.8125rem;
	color: var(--color-text-muted);
}

.typeface-preview__toolbar-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-end;
	gap: 0.5rem;
	flex-shrink: 0;
}

.typeface-preview__try,
.typeface-preview__buy {
	flex-shrink: 0;
	min-width: 5.5rem;
	padding: 0.5rem 1.125rem;
	font-size: 0.8125rem;
	border-radius: 999px;
	text-decoration: none;
	white-space: nowrap;
}

.typeface-preview__controls-wrap {
	overflow: visible;
}

.typeface-preview__controls {
	display: flex;
	align-items: center;
	min-height: 88px;
	gap: 0.5rem;
}

.typeface-preview__control {
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 0.65rem;
	flex: 1 1 0;
	min-width: 0;
	padding: 1rem 0.75rem;
}

.typeface-preview__control--style {
	flex: 0 0 auto;
	min-width: 170px;
}

.typeface-preview__control--align {
	flex: 0 0 auto;
	flex-direction: row;
	align-items: center;
	justify-content: center;
	gap: 0.35rem;
	min-width: auto;
	padding-inline: 0.5rem;
	margin-left: auto;
}

.typeface-preview__control.is-disabled {
	opacity: 0.38;
	pointer-events: none;
}

.typeface-preview__control.is-disabled .typeface-preview__range {
	cursor: not-allowed;
}

.typeface-preview__control-label {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	font-size: 0.8125rem;
	color: var(--color-text-muted);
}

.typeface-preview__value {
	color: var(--color-text);
	font-variant-numeric: tabular-nums;
}

.typeface-preview__select-wrap {
	position: relative;
}

.typeface-preview__select--native {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.typeface-preview__dropdown {
	position: relative;
	width: 100%;
}

.typeface-preview__dropdown-trigger {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	width: 100%;
	padding: 0.65rem 0.85rem;
	font: inherit;
	font-size: 0.9375rem;
	color: #ffffff;
	text-align: left;
	background: #000000;
	border: 1px solid #000000;
	border-radius: 10px;
	cursor: pointer;
	transition: background var(--transition), border-color var(--transition);
}

.typeface-preview__dropdown-trigger:hover,
.typeface-preview__dropdown-trigger:focus-visible {
	background: #1a1a1a;
	border-color: #1a1a1a;
	outline: none;
}

.typeface-preview__dropdown-label {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.typeface-preview__dropdown-chevron {
	flex-shrink: 0;
	width: 0.45rem;
	height: 0.45rem;
	border-right: 1.5px solid currentColor;
	border-bottom: 1.5px solid currentColor;
	transform: rotate(45deg) translateY(-2px);
	opacity: 0.65;
	transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.28s ease;
}

.typeface-preview__dropdown.is-open .typeface-preview__dropdown-chevron {
	transform: rotate(-135deg) translateY(-2px);
	opacity: 1;
}

.typeface-preview__dropdown-panel {
	position: absolute;
	top: calc(100% + 0.35rem);
	left: 0;
	z-index: 30;
	min-width: 100%;
	width: max-content;
	max-width: min(18rem, 80vw);
	overflow: hidden;
	color: #ffffff;
	background: #000000;
	border: 1px solid #1a1a1a;
	border-radius: 10px;
	box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
	opacity: 0;
	visibility: hidden;
	transform: translateY(-8px) scale(0.98);
	transform-origin: top left;
	transition:
		opacity 0.28s cubic-bezier(0.4, 0, 0.2, 1),
		transform 0.28s cubic-bezier(0.4, 0, 0.2, 1),
		visibility 0.28s cubic-bezier(0.4, 0, 0.2, 1);
	pointer-events: none;
}

.typeface-preview__dropdown.is-open .typeface-preview__dropdown-panel {
	opacity: 1;
	visibility: visible;
	transform: translateY(0) scale(1);
	pointer-events: auto;
}

.typeface-preview__dropdown-list {
	margin: 0;
	padding: 0.35rem;
	list-style: none;
	max-height: 14rem;
	overflow-y: auto;
}

.typeface-preview__dropdown-option {
	padding: 0.55rem 0.75rem;
	font-size: 0.9375rem;
	color: #ffffff;
	border-radius: 8px;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.typeface-preview__dropdown-option:hover,
.typeface-preview__dropdown-option:focus-visible {
	background: #1a1a1a;
	outline: none;
}

.typeface-preview__dropdown-option.is-selected {
	background: #262626;
}

.typeface-preview__select-wrap::after {
	display: none;
}

.typeface-preview__range {
	--range-thumb: 12px;
	--range-track: 2px;
	width: 100%;
	min-width: 0;
	height: var(--range-thumb);
	margin: 0;
	padding: 0;
	appearance: none;
	background: transparent;
	border: none;
	border-radius: 999px;
	cursor: pointer;
}

.typeface-preview__range::-webkit-slider-runnable-track {
	height: var(--range-thumb);
	background: linear-gradient(var(--color-border), var(--color-border)) center / 100% var(--range-track) no-repeat;
	border: none;
	border-radius: 999px;
}

.typeface-preview__range::-moz-range-track {
	height: var(--range-thumb);
	background: linear-gradient(var(--color-border), var(--color-border)) center / 100% var(--range-track) no-repeat;
	border: none;
	border-radius: 999px;
}

.typeface-preview__range::-webkit-slider-thumb {
	appearance: none;
	width: var(--range-thumb);
	height: var(--range-thumb);
	margin-top: 0;
	border-radius: 50%;
	background: var(--color-text);
	border: none;
}

.typeface-preview__range::-moz-range-thumb {
	width: var(--range-thumb);
	height: var(--range-thumb);
	border-radius: 50%;
	background: var(--color-text);
	border: none;
}

.typeface-preview__align {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.25rem;
	height: 2.25rem;
	padding: 0;
	border: 1px solid transparent;
	border-radius: 999px;
	color: var(--color-text-muted);
	transition: color var(--transition), border-color var(--transition), background var(--transition);
}

.typeface-preview__align span {
	display: block;
	width: 1rem;
	height: 0.75rem;
	background:
		linear-gradient(var(--color-text-muted), var(--color-text-muted)) 0 0 / 100% 1.5px no-repeat,
		linear-gradient(var(--color-text-muted), var(--color-text-muted)) 0 0.3rem / 75% 1.5px no-repeat,
		linear-gradient(var(--color-text-muted), var(--color-text-muted)) 0 0.6rem / 55% 1.5px no-repeat;
}

.typeface-preview__align[data-preview-align='center'] span {
	margin-inline: auto;
	background:
		linear-gradient(var(--color-text-muted), var(--color-text-muted)) 50% 0 / 100% 1.5px no-repeat,
		linear-gradient(var(--color-text-muted), var(--color-text-muted)) 50% 0.3rem / 75% 1.5px no-repeat,
		linear-gradient(var(--color-text-muted), var(--color-text-muted)) 50% 0.6rem / 55% 1.5px no-repeat;
}

.typeface-preview__align[data-preview-align='right'] span {
	margin-left: auto;
	background:
		linear-gradient(var(--color-text-muted), var(--color-text-muted)) 100% 0 / 100% 1.5px no-repeat,
		linear-gradient(var(--color-text-muted), var(--color-text-muted)) 100% 0.3rem / 75% 1.5px no-repeat,
		linear-gradient(var(--color-text-muted), var(--color-text-muted)) 100% 0.6rem / 55% 1.5px no-repeat;
}

.typeface-preview__align.is-active,
.typeface-preview__align:hover,
.typeface-preview__align:focus-visible {
	color: var(--color-text);
	border-color: var(--color-border);
	background: var(--color-hover);
}

.typeface-preview__align.is-active span,
.typeface-preview__align:hover span,
.typeface-preview__align:focus-visible span {
	background:
		linear-gradient(currentColor, currentColor) 0 0 / 100% 1.5px no-repeat,
		linear-gradient(currentColor, currentColor) 0 0.3rem / 75% 1.5px no-repeat,
		linear-gradient(currentColor, currentColor) 0 0.6rem / 55% 1.5px no-repeat;
}

.typeface-preview__align[data-preview-align='center'].is-active span,
.typeface-preview__align[data-preview-align='center']:hover span,
.typeface-preview__align[data-preview-align='center']:focus-visible span {
	background:
		linear-gradient(currentColor, currentColor) 50% 0 / 100% 1.5px no-repeat,
		linear-gradient(currentColor, currentColor) 50% 0.3rem / 75% 1.5px no-repeat,
		linear-gradient(currentColor, currentColor) 50% 0.6rem / 55% 1.5px no-repeat;
}

.typeface-preview__align[data-preview-align='right'].is-active span,
.typeface-preview__align[data-preview-align='right']:hover span,
.typeface-preview__align[data-preview-align='right']:focus-visible span {
	background:
		linear-gradient(currentColor, currentColor) 100% 0 / 100% 1.5px no-repeat,
		linear-gradient(currentColor, currentColor) 100% 0.3rem / 75% 1.5px no-repeat,
		linear-gradient(currentColor, currentColor) 100% 0.6rem / 55% 1.5px no-repeat;
}

.typeface-preview__canvas-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.25rem;
	height: 2.25rem;
	margin-left: 0.15rem;
	padding: 0;
	color: #ffffff;
	background: #000000;
	border: 1px solid #000000;
	border-radius: 999px;
	transition: background var(--transition), border-color var(--transition);
}

.typeface-preview__canvas-toggle:hover,
.typeface-preview__canvas-toggle:focus-visible {
	color: #ffffff;
	background: #1a1a1a;
	border-color: #1a1a1a;
	outline: none;
}

.typeface-preview__canvas-toggle-icon {
	display: block;
	width: 1.125rem;
	height: 1.125rem;
}

.typeface-preview__canvas-toggle-icon--moon {
	display: none;
}

.typeface-preview[data-preview-canvas-theme="dark"] .typeface-preview__canvas-toggle-icon--sun {
	display: none;
}

.typeface-preview[data-preview-canvas-theme="dark"] .typeface-preview__canvas-toggle-icon--moon {
	display: block;
}

.typeface-preview__stage {
	width: min(calc(100% - 2 * var(--container-padding)), var(--typeface-content-width));
	max-width: var(--typeface-content-width);
	margin-inline: auto;
	padding: clamp(2rem, 5vw, 4rem) clamp(1.5rem, 4vw, 2.5rem) clamp(3rem, 7vw, 5rem);
	border-radius: 10px;
	box-sizing: border-box;
	box-shadow: 0 2px 14px rgba(0, 0, 0, 0.08);
	transition: background-color 0.35s ease, box-shadow 0.35s ease;
}

.typeface-preview[data-preview-canvas-theme="light"] .typeface-preview__stage {
	background: #f7f7f5;
}

.typeface-preview[data-preview-canvas-theme="dark"] .typeface-preview__stage {
	background: #000000;
	box-shadow: 0 2px 14px rgba(0, 0, 0, 0.18);
}

.typeface-preview__input {
	display: block;
	width: 100%;
	min-height: clamp(180px, 28vw, 320px);
	margin: 0;
	padding: 0;
	overflow: hidden;
	font-size: 72px;
	line-height: 1.1;
	letter-spacing: -0.02em;
	text-align: center;
	color: #111111;
	background: transparent;
	border: none;
	resize: none;
	outline: none;
	field-sizing: content;
	transition: color 0.35s ease;
}

.typeface-preview[data-preview-canvas-theme="dark"] .typeface-preview__input {
	color: #ffffff;
}

/* Meta + content
   ========================================================================== */

.typeface-page__meta {
	padding-block: clamp(1.5rem, 3vw, 2.5rem);
}

.typeface-page__meta-panel {
	width: 100%;
	box-sizing: border-box;
	padding: clamp(1.25rem, 2.5vw, 2rem) clamp(1.5rem, 4vw, 2.5rem);
	color: #ffffff;
	background: #000000;
	border-radius: 10px;
}

.typeface-meta__list {
	display: flex;
	flex-wrap: nowrap;
	justify-content: space-between;
	align-items: flex-start;
	width: 100%;
	margin: 0;
	gap: clamp(0.75rem, 1.5vw, 1.25rem);
}

.typeface-meta__item {
	flex: 0 1 auto;
	min-width: 0;
	text-align: left;
}

@media (max-width: 900px) {
	.typeface-meta__list {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		justify-content: stretch;
		flex-wrap: wrap;
		gap: clamp(1.25rem, 2.5vw, 2rem);
	}

	.typeface-meta__item {
		flex: initial;
	}
}

@media (max-width: 520px) {
	.typeface-meta__list {
		grid-template-columns: 1fr;
	}
}

.typeface-meta__item dt {
	margin: 0 0 0.25rem;
	font-size: 0.75rem;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	text-align: left;
	color: rgba(255, 255, 255, 0.55);
}

.typeface-meta__item dd {
	margin: 0;
	font-size: 0.9375rem;
	text-align: left;
	color: #ffffff;
}

.typeface-content {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 320px;
	gap: clamp(2rem, 4vw, 3.5rem);
	padding-block: clamp(2.5rem, 5vw, 4rem);
	align-items: start;
}

.typeface-content__description {
	margin: 0 0 2.5rem;
	font-size: 1.0625rem;
	line-height: 1.75;
	color: var(--color-text-muted);
}

.typeface-content__description--specimen {
	font-size: clamp(1.25rem, 2.2vw, 1.5rem);
	font-weight: 400;
	font-synthesis: none;
	line-height: 1.65;
	color: var(--color-text);
}

.typeface-section {
	margin-bottom: 2rem;
}

.typeface-section h2 {
	margin: 0 0 0.75rem;
	font-size: 1.125rem;
	font-weight: 500;
}

.typeface-section p {
	margin: 0;
	line-height: 1.7;
	color: var(--color-text-muted);
}

.typeface-intro {
	padding-block: clamp(2.5rem, 5vw, 4rem) 0;
}

.typeface-details {
	padding-block: clamp(2rem, 4vw, 3rem) clamp(4rem, 8vw, 6rem);
}

/* Glyph explorer */

.glyph-explorer {
	--glyph-accent: #d95858;
	--glyph-guide-color: var(--color-text-muted);
	--glyph-guide-label-width: 5.5rem;

	margin-block: 0;
	margin-inline: auto;
	padding-block: clamp(2rem, 4vw, 3rem);
	border-top: 1px solid var(--color-border);
	font-family: var(--font-ui);
}

.glyph-explorer__layout {
	display: grid;
	grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
	gap: clamp(0.75rem, 2vw, 1rem);
	align-items: stretch;
}

.glyph-explorer__panel,
.glyph-explorer__browser-panel {
	border-radius: calc(var(--radius-md) + 2px);
}

.glyph-explorer__browser-panel {
	overflow: hidden;
}

.glyph-explorer__panel {
	display: flex;
	flex-direction: column;
	min-height: 100%;
	padding: clamp(1rem, 2.5vw, 1.35rem);
	background: var(--color-surface);
	border: 1px solid var(--color-border);
}

.glyph-explorer__stage-col {
	position: sticky;
	top: clamp(1rem, 3vw, 1.5rem);
	align-self: start;
	min-width: 0;
	z-index: 2;
}

.glyph-explorer__selects {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0.65rem;
	margin-bottom: clamp(1rem, 2.5vw, 1.35rem);
}

.glyph-explorer__select-wrap {
	display: block;
}

.glyph-explorer__select {
	width: 100%;
	padding: 0.8rem 2.25rem 0.8rem 0.95rem;
	font-family: var(--font-ui);
	font-size: 0.875rem;
	color: var(--color-text);
	background: var(--color-surface);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-md);
	appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 12 12' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3 4.5L6 7.5L9 4.5' stroke='%236b6b6b' stroke-width='1.25' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 0.85rem center;
	cursor: pointer;
	transition: border-color var(--transition), background-color var(--transition);
}

.glyph-explorer__select:hover,
.glyph-explorer__select:focus-visible {
	border-color: var(--color-text-muted);
}

.glyph-explorer__select:disabled {
	opacity: 0.55;
	cursor: not-allowed;
}

.glyph-explorer__stage {
	display: flex;
	align-items: center;
	justify-content: stretch;
	flex: 1;
	min-height: clamp(18rem, 38vw, 26rem);
	padding: clamp(1rem, 2.5vw, 1.5rem) clamp(1rem, 2.5vw, 1.5rem) clamp(1rem, 2.5vw, 1.5rem)
		calc(clamp(1rem, 2.5vw, 1.5rem) + var(--glyph-guide-label-width, 5.5rem));
	color: #ffffff;
	background: #000000;
	--glyph-guide-color: #6b6b6b;
	--glyph-preview-fg: #ffffff;
	border-radius: var(--radius-md);
	overflow: visible;
}

.glyph-explorer__metrics {
	position: relative;
	display: flex;
	justify-content: center;
	width: 100%;
}

.glyph-explorer__em-box {
	position: relative;
	width: min(84%, 26rem);
	aspect-ratio: 1 / 1;
	flex-shrink: 0;
}

.glyph-explorer__guides {
	position: absolute;
	inset: 0;
	left: calc(-1 * var(--glyph-guide-label-width, 5.5rem));
	width: calc(100% + var(--glyph-guide-label-width, 5.5rem));
	z-index: 2;
	pointer-events: none;
}

.glyph-explorer__guide {
	position: absolute;
	left: 0;
	right: 0;
	display: grid;
	grid-template-columns: var(--glyph-guide-label-width, 5.5rem) 1fr;
	align-items: center;
	gap: 0.5rem;
	top: 0;
	transform: translateY(-50%);
}

.glyph-explorer__guide-label {
	padding-right: 0.35rem;
	font-size: 0.8125rem;
	font-family: var(--font-ui);
	font-weight: 400;
	color: #ffffff;
	letter-spacing: 0.01em;
	white-space: nowrap;
}

.glyph-explorer__guide-line {
	display: none;
}

.glyph-explorer__preview-canvas {
	position: absolute;
	inset: 0;
	z-index: 1;
	width: 100%;
	height: 100%;
	pointer-events: none;
}

.glyph-explorer__browser-col {
	min-width: 0;
}

.glyph-explorer__browser-panel {
	min-height: 100%;
	padding: clamp(1rem, 2.5vw, 1.35rem);
	background: var(--color-bg);
	border: 1px solid var(--color-border);
}

.glyph-explorer__filters {
	display: flex;
	flex-wrap: wrap;
	gap: 0.45rem;
	margin-bottom: 1.35rem;
}

.glyph-explorer__filter {
	padding: 0.42rem 0.95rem;
	font-family: var(--font-ui);
	font-size: 0.8125rem;
	font-weight: 400;
	color: var(--color-text-muted);
	background: var(--color-surface);
	border: 1px solid transparent;
	border-radius: 10px;
	transition: color var(--transition), border-color var(--transition), background var(--transition);
}

.glyph-explorer__filter:hover,
.glyph-explorer__filter:focus-visible {
	color: var(--color-text);
}

.glyph-explorer__filter.is-active {
	color: #ffffff;
	border-color: #000000;
	background: #000000;
}

.glyph-explorer__filter.is-active:hover,
.glyph-explorer__filter.is-active:focus-visible {
	color: #ffffff;
	border-color: #000000;
	background: #000000;
}

.glyph-explorer__section + .glyph-explorer__section {
	margin-top: 1.5rem;
}

.glyph-explorer__section-title {
	margin: 0 0 0.75rem;
	font-family: var(--font-ui);
	font-size: 0.8125rem;
	font-weight: 400;
	color: #000000;
}

html[data-theme="dark"] .glyph-explorer__section-title {
	color: #ffffff;
}

.glyph-explorer__grid {
	display: grid;
	grid-template-columns: repeat(8, minmax(0, 1fr));
	gap: 0.45rem;
}

.glyph-explorer__cell {
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 1;
	min-height: 0;
	padding: 0.1rem;
	color: var(--color-text);
	background: var(--color-surface);
	border: 1px solid transparent;
	border-radius: calc(var(--radius-md) - 2px);
	container-type: inline-size;
	transition: border-color var(--transition), background var(--transition), transform var(--transition);
}

.glyph-explorer__cell-char {
	font-family: var(--glyph-preview-family, var(--font-ui));
	font-size: clamp(1.75rem, 68cqi, 3.25rem);
	line-height: 1;
}

.glyph-explorer__cell:hover,
.glyph-explorer__cell:focus-visible {
	border-color: var(--color-border);
}

.glyph-explorer__cell.is-active {
	border-color: var(--glyph-accent);
	background: var(--color-surface);
}

.glyph-explorer__empty {
	margin: 0;
	font-family: var(--font-ui);
	font-size: 0.9375rem;
	color: var(--color-text-muted);
}

@media (max-width: 900px) {
	.glyph-explorer__layout {
		grid-template-columns: 1fr;
	}

	.glyph-explorer__stage-col {
		position: static;
	}

	.glyph-explorer__stage {
		min-height: clamp(14rem, 42vw, 18rem);
	}

	.glyph-explorer__grid {
		grid-template-columns: repeat(6, minmax(0, 1fr));
	}
}

@media (max-width: 640px) {
	.glyph-explorer__selects {
		grid-template-columns: 1fr;
	}

	.glyph-explorer__grid {
		grid-template-columns: repeat(5, minmax(0, 1fr));
	}

	.glyph-explorer__cell-char {
		font-size: clamp(1.5rem, 62cqi, 2.75rem);
	}
}

/* Buying options */

.typeface-purchase--below-glyphs {
	padding-block: clamp(2rem, 4vw, 3rem);
	border-top: 1px solid var(--color-border);
}

.buying-options-wrap {
	padding-inline: var(--container-padding);
}

.buying-options {
	width: 100%;
	max-width: none;
	margin-inline: auto;
	padding: clamp(1.25rem, 3vw, 1.75rem);
	background: var(--color-surface);
	border: 1px solid var(--color-border);
	border-radius: calc(var(--radius-md) + 4px);
}

.buying-options,
.buying-options strong {
	font-weight: 400;
}

.buying-options__title {
	margin: 0 0 1rem;
	font-size: 1.125rem;
	font-weight: 500;
	line-height: 1.2;
	letter-spacing: -0.02em;
}

.buying-options__selector {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: 0.25rem;
	padding: 0.85rem 1rem;
	font-size: 0.8125rem;
	line-height: 1.3;
	color: var(--color-surface);
	background: var(--color-text);
	border: 1px solid var(--color-text);
	border-radius: var(--radius-md);
}

.buying-options__package {
	min-width: 0;
}

.buying-options__selector-label {
	display: inline-flex;
	flex-shrink: 0;
	align-items: center;
	gap: 0.35rem;
	font-weight: 500;
	opacity: 0.95;
}

.buying-options__chevron {
	flex-shrink: 0;
}

.buying-options__list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.buying-options__item {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 0.5rem 0.75rem;
	align-items: center;
	padding-block: 0.85rem;
	border-bottom: 1px solid var(--color-border);
}

.buying-options__row {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	gap: 0.75rem;
	align-items: center;
	min-width: 0;
	cursor: pointer;
}

.buying-options__label {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	min-width: 0;
}

.buying-options__input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.buying-options__check {
	display: grid;
	place-items: center;
	flex-shrink: 0;
	width: 1rem;
	height: 1rem;
	border: 1px solid var(--color-border);
	border-radius: 0.15rem;
	background: transparent;
	transition: border-color var(--transition), background var(--transition);
}

.buying-options__check::after {
	content: "";
	width: 0.4rem;
	height: 0.22rem;
	border-left: 2px solid var(--color-surface);
	border-bottom: 2px solid var(--color-surface);
	transform: rotate(-45deg) scale(0);
	transition: transform var(--transition);
}

.buying-options__item.is-selected .buying-options__check {
	border-color: var(--color-text);
	background: var(--color-text);
}

.buying-options__item.is-selected .buying-options__check::after {
	transform: rotate(-45deg) scale(1);
}

.buying-options__name {
	font-size: 0.875rem;
	line-height: 1.35;
	color: var(--color-text-muted);
	transition: color var(--transition);
}

.buying-options__item.is-selected .buying-options__name {
	color: var(--color-text);
}

.buying-options__info {
	position: relative;
	display: grid;
	place-items: center;
	flex-shrink: 0;
	width: 1.125rem;
	height: 1.125rem;
	padding: 0;
	font-size: 0.625rem;
	font-style: italic;
	font-family: Georgia, "Times New Roman", serif;
	line-height: 1;
	color: var(--color-text-muted);
	background: transparent;
	border: 1px solid var(--color-border);
	border-radius: 999px;
	cursor: help;
	transition: color var(--transition), border-color var(--transition);
}

.buying-options__info:hover,
.buying-options__info:focus-visible,
.buying-options__info.is-open {
	color: var(--color-text);
	border-color: var(--color-text);
	outline: none;
}

.buying-options__tooltip {
	position: absolute;
	z-index: 5;
	bottom: calc(100% + 0.5rem);
	left: 50%;
	min-width: 11rem;
	max-width: 18rem;
	padding: 0.65rem 0.8rem;
	font-size: 0.75rem;
	font-style: normal;
	font-weight: 400;
	font-family: var(--font-ui);
	line-height: 1.45;
	color: var(--color-text);
	text-align: left;
	white-space: normal;
	background: var(--color-bg);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-sm);
	box-shadow: 0 8px 24px var(--color-shadow);
	transform: translateX(-50%);
}

.buying-options__tooltip::after {
	content: "";
	position: absolute;
	top: 100%;
	left: 50%;
	width: 0;
	height: 0;
	margin-left: -5px;
	border: 5px solid transparent;
	border-top-color: var(--color-border);
}

.buying-options__tooltip ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.buying-options__tooltip li {
	position: relative;
	padding-left: 0.85rem;
}

.buying-options__tooltip li::before {
	content: "•";
	position: absolute;
	left: 0;
}

.buying-options__tooltip[hidden] {
	display: none;
}

.buying-options__price {
	justify-self: end;
	font-size: 0.875rem;
	line-height: 1.2;
	text-align: right;
	white-space: nowrap;
}

.buying-options__price-was {
	margin-right: 0.35rem;
	font-size: 0.75rem;
	font-weight: 400;
	color: var(--color-text-muted);
}

.buying-options__footer {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 1rem 1.5rem;
	margin-top: 1rem;
}

.buying-options__contact {
	margin: 0;
	font-size: 0.75rem;
	line-height: 1.4;
	color: var(--color-text-muted);
}

.buying-options__contact a {
	color: var(--color-text);
	text-decoration: none;
}

.buying-options__contact a:hover {
	text-decoration: underline;
	text-underline-offset: 0.15em;
}

.buying-options__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-end;
	gap: 0.75rem 1rem;
	margin-left: auto;
}

.buying-options__total-wrap {
	text-align: right;
}

.buying-options__total {
	display: block;
	font-size: 1.5rem;
	line-height: 1;
	letter-spacing: -0.03em;
}

.buying-options__total-label {
	display: block;
	margin-top: 0.25rem;
	font-size: 0.6875rem;
	color: var(--color-text-muted);
}

.buying-options__cta {
	min-width: 8.5rem;
	padding-inline: 1.25rem;
	border-radius: 999px;
	font-weight: 400;
}

.buying-options__cta:disabled {
	opacity: 0.45;
	cursor: not-allowed;
}

@media (max-width: 640px) {
	.buying-options__actions {
		width: 100%;
		justify-content: stretch;
	}

	.buying-options__cta {
		flex: 1;
	}
}

@media (max-width: 960px) {
	.typeface-preview__controls-wrap {
		overflow-x: auto;
		overflow-y: hidden;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
	}

	.typeface-preview__controls-wrap::-webkit-scrollbar {
		display: none;
	}

	.typeface-preview__control:not(.typeface-preview__control--style):not(.typeface-preview__control--align) {
		flex: 0 0 11rem;
		min-width: 11rem;
	}

	.typeface-preview__control--align {
		margin-left: 0;
	}
}

@media (max-width: 640px) {
	.typeface-preview__toolbar-inner {
		flex-wrap: wrap;
		padding-block: 1rem;
	}

	.typeface-preview__controls {
		min-height: 0;
	}

	.typeface-preview__input {
		font-size: 40px;
	}
}

/* Related products
   ========================================================================== */

.related-products {
	padding-block: clamp(3rem, 6vw, 4.5rem) clamp(4rem, 8vw, 6rem);
	border-top: 1px solid var(--color-border);
}

.related-products__title {
	margin: 0 0 clamp(2rem, 4vw, 2.75rem);
	font-size: clamp(1.5rem, 3vw, 2rem);
	font-weight: 500;
	line-height: 1.2;
	letter-spacing: -0.03em;
	text-align: center;
}

.related-products__grid {
	display: grid;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	grid-template-rows: repeat(2, auto);
	gap: clamp(0.75rem, 1.5vw, 1.25rem);
}

.related-product-card {
	min-width: 0;
}

.related-product-card__link {
	display: block;
	color: inherit;
	text-decoration: none;
}

.related-product-card__link:hover .related-product-card__name,
.related-product-card__link:focus-visible .related-product-card__name {
	opacity: 0.65;
}

.related-product-card__media {
	position: relative;
	overflow: hidden;
	aspect-ratio: 4 / 3;
	background: var(--color-surface);
	border: 1px solid var(--color-border);
}

.related-product-card__image {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.related-product-card__placeholder {
	display: grid;
	place-items: center;
	width: 100%;
	height: 100%;
	padding: 1rem;
	background: var(--color-surface);
	text-align: center;
}

.related-product-card__placeholder span {
	font-size: 0.875rem;
	line-height: 1.4;
	color: var(--color-text-muted);
}

.related-product-card__badge {
	position: absolute;
	top: 0.65rem;
	left: 0.65rem;
	padding: 0.3rem 0.5rem;
	font-size: 0.6875rem;
	font-weight: 400;
	line-height: 1;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: #fff;
	background: #d92d20;
}

.related-product-card__row {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 0.75rem;
	margin-top: 0.85rem;
}

.related-product-card__name {
	margin: 0;
	font-size: 0.9375rem;
	font-weight: 400;
	line-height: 1.35;
	transition: opacity var(--transition);
}

.related-product-card__price {
	flex-shrink: 0;
	margin: 0;
	font-size: 0.875rem;
	line-height: 1.35;
	color: var(--color-text);
	white-space: nowrap;
}

.related-product-card__price.is-sale {
	color: #d92d20;
}

.related-product-card__meta {
	margin: 0.35rem 0 0;
	font-size: 0.8125rem;
	line-height: 1.5;
	color: var(--color-text-muted);
}

.related-product-card__category {
	color: var(--color-text-muted);
}

@media (max-width: 900px) {
	.related-products__inner {
		overflow-x: visible;
	}

	.related-products__grid {
		min-width: 0;
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (max-width: 640px) {
	.related-products__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}
