:root {
	--bg: #0d1015;
	--bg-soft: #131821;
	--surface: #181e28;
	--surface-2: #1e2633;
	--border: #2c3545;
	--text: #f1ece3;
	--muted: #9aa3b2;
	--accent: #e0b34a;
	--accent-soft: rgba(224, 179, 74, 0.14);
	--today: #e0b34a;
	--today-text: #16120a;
	--shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
	--radius: 14px;
	font-family: "Segoe UI", "Source Sans 3", system-ui, sans-serif;
}

* {
	box-sizing: border-box;
}

html,
body {
	margin: 0;
	min-height: 100%;
	background:
		radial-gradient(1200px 500px at 50% -80px, rgba(224, 179, 74, 0.08), transparent 55%),
		var(--bg);
	color: var(--text);
}

body {
	min-height: 100dvh;
}

html[dir="rtl"] .clocks,
html[dir="rtl"] .calendar,
html[dir="rtl"] .seven-clock,
html[dir="rtl"] .convert input,
html[dir="rtl"] .convert select {
	direction: ltr;
	unicode-bidi: isolate;
}

.page {
	width: min(1180px, calc(100% - 32px));
	margin: 0 auto;
	padding: 28px 0 48px;
}

.masthead {
	display: flex;
	align-items: center;
	gap: 22px;
	margin-bottom: 28px;
}

.brand {
	display: inline-flex;
	text-decoration: none;
}

.brand-logo {
	display: block;
	height: 96px;
	width: auto;
	max-width: min(420px, 48vw);
}

.ticker {
	position: relative;
	flex: 1 1 auto;
	min-width: 0;
	height: 96px;
	overflow: hidden;
	mask-image: linear-gradient(180deg, transparent, #000 14%, #000 86%, transparent);
}

.ticker__line {
	position: absolute;
	left: 0;
	right: 0;
	top: 0;
	margin: 0;
	display: flex;
	align-items: center;
	justify-content: flex-end;
	min-height: 100%;
	text-align: right;
	color: var(--accent);
	font-size: clamp(15px, 2.1vw, 22px);
	font-weight: 550;
	letter-spacing: 0.01em;
	line-height: 1.35;
	opacity: 0;
	transform: translateY(-40%);
}

.ticker__line.is-run {
	animation: ticker-in 0.38s ease-out forwards;
}

@keyframes ticker-in {
	from {
		opacity: 0;
		transform: translateY(-42%);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.now-card {
	position: relative;
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 28px;
	align-items: start;
	padding: 28px 88px 28px 32px;
	border: 1px solid var(--border);
	border-radius: 22px;
	background: linear-gradient(180deg, var(--surface), var(--bg-soft));
	box-shadow: var(--shadow);
}

.now-info {
	position: absolute;
	top: 16px;
	right: 16px;
	z-index: 5;
}

.now-info__btn {
	height: 32px;
	padding: 0 12px;
	border: 1px solid var(--border);
	border-radius: 999px;
	background: var(--surface-2);
	color: var(--muted);
	font: inherit;
	font-size: 12px;
	font-weight: 650;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	cursor: pointer;
}

.now-info__btn:hover,
.now-info__btn[aria-expanded="true"] {
	border-color: var(--accent);
	color: var(--accent);
}

.now-info__panel {
	position: absolute;
	top: calc(100% + 8px);
	right: 0;
	width: min(360px, calc(100vw - 48px));
	padding: 14px 16px;
	border: 1px solid var(--border);
	border-radius: 12px;
	background: var(--surface);
	box-shadow: var(--shadow);
}

.now-info__panel p {
	margin: 0;
	color: var(--muted);
	font-size: 13px;
	line-height: 1.55;
}

.now-info__panel strong {
	color: var(--text);
}

.clocks {
	display: flex;
	align-items: center;
	gap: 22px;
}

.clock {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
	margin: 0;
	width: 248px;
	filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.28));
}

.clock svg {
	display: block;
	width: 248px;
	height: 248px;
}

.clock figcaption {
	color: var(--accent);
	font-size: 11px;
	font-weight: 650;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.seven-clock {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 5px;
	width: 100%;
	padding: 10px 12px 8px;
	border: 1px solid #6d5420;
	border-radius: 10px;
	background:
		linear-gradient(180deg, #1a1408 0%, #0c0a06 100%);
	box-shadow:
		inset 0 0 0 1px #3a2c10,
		inset 0 8px 16px rgba(0, 0, 0, 0.45),
		0 0 18px rgba(224, 179, 74, 0.12);
}

.seven {
	position: relative;
	width: 22px;
	height: 38px;
}

.seven i {
	position: absolute;
	display: block;
	background: rgba(224, 179, 74, 0.1);
	box-shadow: none;
}

.seven i.on {
	background: #f0c75a;
	box-shadow:
		0 0 6px rgba(240, 199, 90, 0.85),
		0 0 14px rgba(224, 179, 74, 0.35);
}

.seven [data-s="a"],
.seven [data-s="g"],
.seven [data-s="d"] {
	left: 4px;
	right: 4px;
	height: 4px;
	clip-path: polygon(8% 50%, 16% 0, 84% 0, 92% 50%, 84% 100%, 16% 100%);
}

.seven [data-s="a"] { top: 0; }
.seven [data-s="g"] { top: 17px; }
.seven [data-s="d"] { bottom: 0; }

.seven [data-s="b"],
.seven [data-s="c"],
.seven [data-s="e"],
.seven [data-s="f"] {
	width: 4px;
	clip-path: polygon(50% 8%, 100% 16%, 100% 84%, 50% 92%, 0 84%, 0 16%);
}

.seven [data-s="b"],
.seven [data-s="f"] { top: 3px; height: 15px; }
.seven [data-s="c"],
.seven [data-s="e"] { bottom: 3px; height: 15px; }
.seven [data-s="b"],
.seven [data-s="c"] { right: 0; }
.seven [data-s="e"],
.seven [data-s="f"] { left: 0; }

.seven-sep {
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	gap: 7px;
	width: 8px;
	height: 38px;
}

.seven-sep i,
.seven-comma {
	width: 5px;
	height: 5px;
	border-radius: 1px;
	background: rgba(224, 179, 74, 0.12);
	box-shadow: none;
}

.seven-sep.is-on i,
.seven-comma.is-on {
	background: #f0c75a;
	box-shadow: 0 0 8px rgba(240, 199, 90, 0.9);
}

.seven-comma {
	align-self: flex-end;
	margin: 22px 1px 0;
}

.clock__bezel {
	fill: #10141b;
	stroke: #3d4658;
	stroke-width: 3;
}

.clock__dial {
	fill: #151b24;
	stroke: #2a3342;
	stroke-width: 1.5;
}

.clock__tick {
	stroke: #6d7686;
	stroke-linecap: round;
}

.clock__tick--major {
	stroke: var(--text);
	stroke-width: 2;
}

.clock__tick--mid {
	stroke: #8b9384;
	stroke-width: 1.4;
}

.clock__tick--minor {
	stroke-width: 1;
}

.clock__numeral,
.clock__window-text {
	font-family: "Segoe UI", "Source Sans 3", system-ui, sans-serif;
}

.clock__numeral {
	fill: var(--text);
	font-size: 11px;
	font-weight: 650;
	font-variant-numeric: tabular-nums;
}

.clock__window {
	fill: #0d1118;
	stroke: #2a3342;
	stroke-width: 1;
}

.clock__window-text {
	fill: var(--accent);
	font-size: 12px;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}

.clock__hand--unit line {
	stroke: var(--text);
	stroke-width: 4.5;
	stroke-linecap: round;
}

.clock__hand--frac line,
.clock__hand--second line {
	stroke: var(--accent);
	stroke-width: 2;
	stroke-linecap: round;
}

.clock__hand--hour line {
	stroke: var(--text);
	stroke-width: 5;
	stroke-linecap: round;
}

.clock__hand--minute line {
	stroke: var(--text);
	stroke-width: 3.2;
	stroke-linecap: round;
}

.clock__pivot {
	fill: var(--text);
}

.clock__pivot-core {
	fill: var(--accent);
}

.now-meta {
	display: flex;
	flex-direction: column;
	align-items: center;
	align-self: start;
	gap: 22px;
	width: 100%;
	min-width: 0;
	padding-top: 4px;
	text-align: center;
}

.now-meta__block {
	display: flex;
	flex-direction: column;
	align-items: center;
}

.now-meta__label {
	margin: 0 0 8px;
	color: var(--accent);
	font-size: 12px;
	font-weight: 650;
	letter-spacing: 0.14em;
	text-transform: uppercase;
}

.now-meta__label--omni {
	margin-bottom: 10px;
	font-size: clamp(20px, 2.4vw, 28px);
	letter-spacing: 0.16em;
}

.now-meta__omni {
	margin: 0;
	font-size: clamp(26px, 3.2vw, 40px);
	font-weight: 650;
	letter-spacing: -0.03em;
	line-height: 1.15;
}

.now-meta__year {
	margin: 8px 0 0;
	font-size: clamp(22px, 2.6vw, 34px);
	font-weight: 650;
	letter-spacing: -0.02em;
}

.now-meta__classic {
	margin: 0;
	color: var(--muted);
	font-size: 16px;
}

.now-meta__copy {
	margin: 4px 0 0;
	max-width: 36em;
	color: var(--accent);
	font-size: 14px;
	line-height: 1.55;
}

.year-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin: 36px 0 16px;
}

.year-head h2 {
	margin: 0;
	font-size: 22px;
}

.year-head p {
	margin: 4px 0 0;
	color: var(--muted);
	font-size: 13px;
}

.year-nav {
	display: flex;
	gap: 8px;
}

.year-nav button {
	width: 40px;
	height: 40px;
	border: 1px solid var(--border);
	border-radius: 10px;
	background: var(--surface);
	color: var(--text);
	font-size: 20px;
	cursor: pointer;
}

.year-nav button:hover,
.year-nav button.is-now {
	border-color: var(--accent);
	color: var(--accent);
}

.calendar {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 12px;
}

.calendar-months {
	display: contents;
}

.month,
.yearday,
.convert {
	min-width: 0;
	padding: 12px;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--surface);
}

.month.is-current {
	border-color: var(--accent);
	box-shadow: inset 0 0 0 1px var(--accent);
}

.month header,
.yearday header,
.convert h3 {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 8px;
	margin: 0 0 8px;
	font-size: 13px;
	font-weight: 650;
}

.month header span,
.yearday p {
	color: var(--muted);
	font-size: 11px;
	font-weight: 500;
}

.weekdays,
.days {
	display: grid;
	grid-template-columns: repeat(7, minmax(0, 1fr));
	gap: 3px;
}

.weekdays span,
.day,
.special {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 24px;
	border-radius: 6px;
	font-size: 12px;
	font-variant-numeric: tabular-nums;
}

.weekdays span {
	color: var(--muted);
	font-size: 10px;
	font-weight: 650;
}

.day {
	color: var(--muted);
}

.day.is-today,
.special.is-today,
.yearday.is-today {
	background: var(--today);
	color: var(--today-text);
	font-weight: 700;
}

.yearday.is-today p {
	color: var(--today-text);
}

.special {
	grid-column: 1 / -1;
	margin: 3px 0;
	background: var(--accent-soft);
	color: var(--accent);
	font-size: 11px;
	font-weight: 650;
}

.yearday {
	grid-column: 1 / -1;
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 16px;
	border-style: dashed;
}

.site-footer {
	width: min(1180px, calc(100% - 32px));
	margin: 0 auto;
	padding: 28px 0 40px;
	border-top: 1px solid var(--border);
	color: var(--muted);
	font-size: 12px;
	line-height: 1.6;
	text-align: center;
}

.site-footer p {
	margin: 0;
}

.site-footer p + p {
	margin: 10px auto 0;
	max-width: 62em;
}

.convert {
	grid-column: span 3;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	gap: 10px;
	min-width: 0;
}

.convert-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px 16px;
	flex: 1 1 auto;
	align-content: center;
}

.convert label {
	display: block;
	margin-bottom: 6px;
	color: var(--muted);
	font-size: 11px;
	font-weight: 650;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.convert input,
.convert select {
	width: 100%;
	height: 38px;
	padding: 0 10px;
	border: 1px solid var(--border);
	border-radius: 8px;
	background: var(--surface-2);
	color: var(--text);
	font: inherit;
}

.convert-omni {
	display: flex;
	gap: 8px;
}

.convert-omni .year {
	flex: 0 0 110px;
}

.convert-omni .daynum {
	flex: 0 0 64px;
}

.convert output {
	display: block;
	margin-top: 8px;
	font-weight: 650;
}

@media (max-width: 960px) {
	.calendar {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.convert {
		grid-column: 1 / -1;
	}

	.convert-grid {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 640px) {
	.page,
	.site-footer {
		width: min(100% - 20px, 1180px);
	}

	.page {
		padding-top: 18px;
	}

	.brand-logo {
		height: 76px;
	}

	.ticker {
		height: 76px;
	}

	.ticker__line {
		font-size: 14px;
	}

	.now-card {
		grid-template-columns: 1fr;
		justify-items: center;
		text-align: center;
		padding: 52px 18px 22px;
	}

	.clocks {
		flex-wrap: wrap;
		justify-content: center;
	}

	.clock,
	.clock svg {
		width: 210px;
		height: auto;
	}

	.clock svg {
		height: 210px;
	}

	.calendar {
		grid-template-columns: 1fr;
	}

	.convert-omni {
		flex-wrap: wrap;
	}
}
