@font-face {
	font-family: Fustat;
	src: url("/assets/fustat-latin-variable.woff2") format("woff2");
	font-weight: 200 800;
	font-display: swap;
}

:root {
	color-scheme: light;
	--ink: #17191f;
	--muted: #5f6672;
	--paper: #f3f4f6;
	--surface: #fbfbfc;
	--line: #e0e2e7;
	--accent: #5b4fcf;
	--on-accent: #fff;
	--tint: #f4f1ff;
	--active: #067647;
	font: 500 16px/1.55 Fustat, system-ui, sans-serif;
}

:root[data-theme="dark"] {
	color-scheme: dark;
	--ink: #f3f4f6;
	--muted: #a7adb8;
	--paper: #111216;
	--surface: #17181d;
	--line: #343740;
	--accent: #a69af8;
	--on-accent: #17112f;
	--tint: #211e34;
	--active: #6ce9a6;
}

@media (prefers-color-scheme: dark) {
	:root:not([data-theme]) {
		color-scheme: dark;
		--ink: #f3f4f6;
		--muted: #a7adb8;
		--paper: #111216;
		--surface: #17181d;
		--line: #343740;
		--accent: #a69af8;
		--on-accent: #17112f;
		--tint: #211e34;
		--active: #6ce9a6;
	}
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); }
a { color: var(--accent); }
.site, main, footer { width: min(100% - 2.5rem, 68rem); margin-inline: auto; }
.site { min-height: 5rem; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: .5rem; color: var(--ink); font-size: 1.35rem; font-weight: 800; text-decoration: none; }
.brand img { width: 2rem; height: 2rem; }
main { padding: clamp(2rem, 5vw, 4rem) 0 3rem; }
h1 { margin: 0; font-size: clamp(2.25rem, 5vw, 3.5rem); line-height: 1.05; letter-spacing: -.055em; }
.intro { color: var(--muted); font-size: 1.08rem; margin: .75rem 0 1.5rem; }
#choose-plan { scroll-margin-top: 1.25rem; }
#choose-plan-title { font-size: 1.35rem; margin: 1.3rem 0 .75rem; }
.plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.plan { position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); padding: 1.25rem; border-radius: .85rem; }
.plan:hover { border-color: var(--accent); }
.plan.selected { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: var(--tint); }
.plan-title { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.plan h3 { margin: 0; font-size: 1.15rem; }
.plan h3 a { color: var(--ink); text-decoration: none; }
.plan h3 a::after { position: absolute; inset: 0; border-radius: .85rem; content: ""; }
.plan h3 a:focus-visible { outline: none; }
.plan:has(a:focus-visible) { outline: 3px solid var(--accent); outline-offset: 3px; }
.plan-selector { flex: none; width: 1rem; height: 1rem; border: 1px solid var(--muted); border-radius: 50%; }
.plan.selected .plan-selector { border: .29rem solid var(--accent); }
.price { margin: .55rem 0 0; font-size: clamp(2rem, 5vw, 3rem); line-height: 1; letter-spacing: -.05em; font-weight: 800; }
.price-note { margin: .3rem 0 0; color: var(--muted); font-size: .94rem; }
.period { margin: .65rem 0 1.1rem; color: var(--muted); }
.plan-period { display: inline-block; margin-right: .3rem; padding: .12rem .48rem; border: 1px solid var(--accent); border-radius: 999px; color: var(--accent); font-size: .8rem; font-weight: 750; }
.plan dl { margin: .4rem 0 0; }
.plan dl div { display: flex; align-items: baseline; justify-content: space-between; gap: .6rem; padding: .65rem 0; border-top: 1px solid var(--line); }
.plan dt { color: var(--muted); }
.plan dd { margin: 0; text-align: right; font-weight: 750; font-variant-numeric: tabular-nums; }
.plan-current { margin: auto 0 0; padding-top: .4rem; color: var(--active); font-size: .9rem; font-weight: 750; }
.choice-summary { margin-top: .9rem; }
.choice-summary h3 { margin: 0; font-size: 1.12rem; }
.choice-summary h3 span { color: var(--muted); font-weight: 650; }
.choice-summary .choice-price-note { color: var(--ink); font-weight: 700; }
.plan-details { padding: .85rem 1.25rem; border: 1px solid var(--line); border-radius: .75rem; background: var(--surface); }
.plan-details summary { color: var(--accent); font-weight: 750; cursor: pointer; }
.plan-details dl { margin: .65rem 0 0; }
.plan-details dl div { display: grid; grid-template-columns: minmax(7rem, 1fr) 3fr; gap: .25rem .75rem; padding: .5rem 0; border-bottom: 1px solid var(--line); }
.plan-details dt { font-weight: 750; }
.plan-details dd { margin: 0; color: var(--muted); }
.plan-details p { margin: .75rem 0 0; color: var(--muted); }
.action { display: inline-block; padding: .65rem .9rem; border: 1px solid var(--accent); border-radius: .4rem; background: var(--accent); color: var(--on-accent); cursor: pointer; text-align: center; text-decoration: none; font: inherit; font-weight: 750; }
.action.secondary { background: transparent; color: var(--accent); }
.action:hover { filter: brightness(.9); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.account-plan, .receipt, .notice { padding: 1rem 1.25rem; margin: 0 0 1rem; border: 1px solid var(--line); border-radius: .75rem; background: var(--surface); }
.account-title, .receipt, .actions { display: flex; align-items: center; justify-content: space-between; gap: .7rem; flex-wrap: wrap; }
.account-title h2, .receipt h2 { font-size: 1.2rem; margin: 0; }
.account-title p, .receipt p { color: var(--muted); margin: 0; }
.plan-state { color: var(--active); font-weight: 750; }
.usage-meters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.2rem; margin-top: .85rem; padding-top: .85rem; border-top: 1px solid var(--line); }
.usage-meter h3 { font-size: .95rem; font-weight: 650; margin: 0; }
.usage-meter p { color: var(--muted); margin: .25rem 0; font-variant-numeric: tabular-nums; }
.usage-meter strong { color: var(--ink); font-size: 1.3rem; }
.usage-meter .usage-warning { margin-top: .35rem; color: var(--ink); font-weight: 700; }
.usage-meter small { color: var(--muted); }
.usage-meter meter { display: block; width: 100%; height: .6rem; margin: .35rem 0; }
.usage-meter meter::-webkit-meter-bar { background: var(--line); border: 0; }
.usage-meter meter::-webkit-meter-optimum-value { background: var(--accent); }
.usage-meter meter::-moz-meter-bar { background: var(--accent); }
.details { max-width: 43rem; margin-top: 2.5rem; }
.details h2 { font-size: 1.35rem; margin: 0; }
.details p { color: var(--muted); margin: .6rem 0; }
.billing-terms-note { color: var(--muted); font-size: .9rem; margin: 0 0 .8rem; }
.payment-history ul { padding: 0; margin: .65rem 0 0; list-style: none; }
.payment-history li { display: flex; align-items: center; justify-content: space-between; gap: .6rem; border-bottom: 1px solid var(--line); padding: .65rem 0; }
.payment-history small { display: block; color: var(--muted); }
.receipt-page { width: min(100% - 2.5rem, 43rem); }
.receipt-fields div { display: grid; grid-template-columns: minmax(8rem, 1fr) 2fr; gap: .3rem .8rem; padding: .6rem 0; border-bottom: 1px solid var(--line); }
.receipt-fields dd { margin: 0; overflow-wrap: anywhere; }
.receipt-controls { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
footer { border-top: 1px solid var(--line); padding: 1.15rem 0 2.5rem; display: flex; gap: 1.25rem; }

@media (max-width: 760px) {
	.plans { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
	.usage-meters, .plan-details dl div, .receipt-fields div { grid-template-columns: 1fr; }
}

@media print {
	.receipt-page { width: 100%; padding: 0; }
	.receipt-controls { display: none; }
}
