/*
 * Claritya's design system.
 *
 * Every colour, radius and shadow is a custom property, and nothing below hard
 * codes one. That is not tidiness for its own sake: white labelling means a
 * tenant's dashboard has to repaint itself in their colours at runtime, from a
 * value that arrives with the session. A stylesheet full of literal hex codes
 * cannot do that, so the variables ARE the feature.
 *
 * Dark by default because Discord is, and a support dashboard sitting beside it
 * on the same monitor all day should not be the bright rectangle.
 */

:root {
	color-scheme: dark;

	/* Repainted per tenant. --accent is the one that carries their identity. */
	--accent: #5865f2;
	--accent-strong: #4752c4;
	--accent-soft: rgba(88, 101, 242, 0.14);
	--accent-glow: rgba(88, 101, 242, 0.35);

	--bg: #08090d;
	--bg-raised: #0e1017;
	--panel: #12141c;
	--panel-hover: #171a24;
	--line: #22252f;
	--line-strong: #2f3340;

	--text: #eef1f7;
	--text-dim: #9aa3b7;
	--text-faint: #646d80;

	--good: #3ba55d;
	--warn: #f0b232;
	--bad: #ed4245;
	--premium: #f0b232;

	--radius-sm: 8px;
	--radius: 12px;
	--radius-lg: 18px;
	--radius-xl: 26px;

	--shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
	--shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
	--shadow-lg: 0 24px 70px rgba(0, 0, 0, 0.55);

	--font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--mono: ui-monospace, "SF Mono", "Cascadia Code", "Fira Code", Menlo, monospace;

	--max: 1180px;
	--header-height: 64px;
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	scroll-behavior: smooth;
}

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font-family: var(--font);
	font-size: 15px;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

/* Respect a stated preference for less motion. Not decoration: vestibular
   disorders are real and the animations below are large. */
@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
}

h1,
h2,
h3,
h4 {
	margin: 0;
	line-height: 1.15;
	letter-spacing: -0.022em;
	font-weight: 650;
}

h1 { font-size: clamp(2.3rem, 5.2vw, 4rem); }
h2 { font-size: clamp(1.7rem, 3.2vw, 2.5rem); }
h3 { font-size: 1.2rem; }

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

a {
	color: inherit;
	text-decoration: none;
}

code,
kbd,
pre {
	font-family: var(--mono);
	font-size: 0.88em;
}

code {
	background: var(--bg-raised);
	border: 1px solid var(--line);
	border-radius: 6px;
	padding: 0.1em 0.4em;
}

hr {
	border: 0;
	border-top: 1px solid var(--line);
	margin: 48px 0;
}

::selection {
	background: var(--accent-glow);
}

:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
	border-radius: 4px;
}

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */

.wrap {
	width: 100%;
	max-width: var(--max);
	margin: 0 auto;
	padding: 0 24px;
}

.narrow { max-width: 780px; }

.section { padding: 96px 0; }
.section-tight { padding: 56px 0; }

.stack { display: grid; gap: 16px; }
.stack-lg { display: grid; gap: 32px; }

.row {
	display: flex;
	align-items: center;
	gap: 12px;
}

.spread {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
}

.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }

.center { text-align: center; }
.muted { color: var(--text-dim); }
.faint { color: var(--text-faint); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.strong { font-weight: 620; }
.mono { font-family: var(--mono); }
.nowrap { white-space: nowrap; }

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

.site-header {
	position: sticky;
	top: 0;
	z-index: 50;
	height: var(--header-height);
	display: flex;
	align-items: center;
	background: rgba(8, 9, 13, 0.78);
	backdrop-filter: blur(14px);
	border-bottom: 1px solid var(--line);
}

.site-header .wrap {
	display: flex;
	align-items: center;
	gap: 28px;
}

.brand {
	display: flex;
	align-items: center;
	gap: 10px;
	font-weight: 680;
	font-size: 16px;
	letter-spacing: -0.02em;
}

.brand-mark {
	width: 28px;
	height: 28px;
	border-radius: 8px;
	background: linear-gradient(140deg, var(--accent), var(--accent-strong));
	display: grid;
	place-items: center;
	font-size: 15px;
	box-shadow: 0 4px 14px var(--accent-glow);
	flex: none;
	overflow: hidden;
}

.brand-mark img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.nav {
	display: flex;
	align-items: center;
	gap: 4px;
	margin-left: auto;
}

.nav a {
	padding: 8px 12px;
	border-radius: var(--radius-sm);
	color: var(--text-dim);
	font-size: 14px;
	font-weight: 500;
	transition: color 0.15s, background 0.15s;
}

.nav a:hover {
	color: var(--text);
	background: var(--panel);
}

.nav a.active { color: var(--text); }

@media (max-width: 820px) {
	.nav a.hide-sm { display: none; }
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 11px 18px;
	border-radius: var(--radius-sm);
	border: 1px solid transparent;
	background: var(--accent);
	color: #fff;
	font: inherit;
	font-weight: 600;
	font-size: 14px;
	cursor: pointer;
	white-space: nowrap;
	transition: transform 0.12s, box-shadow 0.15s, background 0.15s, border-color 0.15s;
}

.btn:hover {
	background: var(--accent-strong);
	transform: translateY(-1px);
	box-shadow: 0 8px 22px var(--accent-glow);
}

.btn:active { transform: translateY(0); }

.btn:disabled,
.btn[aria-disabled="true"] {
	opacity: 0.45;
	cursor: not-allowed;
	transform: none;
	box-shadow: none;
}

.btn-lg { padding: 14px 26px; font-size: 15px; border-radius: var(--radius); }
.btn-sm { padding: 7px 12px; font-size: 13px; }

.btn-ghost {
	background: transparent;
	border-color: var(--line-strong);
	color: var(--text-dim);
}

.btn-ghost:hover {
	background: var(--panel);
	color: var(--text);
	box-shadow: none;
}

.btn-quiet {
	background: var(--panel);
	border-color: var(--line);
	color: var(--text);
}

.btn-quiet:hover { background: var(--panel-hover); box-shadow: none; }

.btn-danger { background: var(--bad); }
.btn-danger:hover { background: #c0393b; box-shadow: 0 8px 22px rgba(237, 66, 69, 0.3); }

.btn-discord::before {
	content: "";
	width: 18px;
	height: 18px;
	flex: none;
	background: currentColor;
	-webkit-mask: var(--discord-mask) center / contain no-repeat;
	mask: var(--discord-mask) center / contain no-repeat;
}

:root {
	--discord-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 127 96'><path d='M107 8A105 105 0 0 0 81 0l-3 7a97 97 0 0 0-29 0l-4-7a105 105 0 0 0-26 8C2 33-1 57 1 81a106 106 0 0 0 32 16l6-11a69 69 0 0 1-11-5l3-2a75 75 0 0 0 64 0l3 2a68 68 0 0 1-11 5l6 11a106 106 0 0 0 32-16c3-28-2-52-18-73ZM42 66c-6 0-12-6-12-13s5-13 12-13 12 6 12 13-5 13-12 13Zm43 0c-7 0-12-6-12-13s5-13 12-13 12 6 12 13-5 13-12 13Z'/></svg>");
}

/* --------------------------------------------------------------------------
   Surfaces
   -------------------------------------------------------------------------- */

.card {
	background: var(--panel);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 22px;
}

.card-hover {
	transition: border-color 0.18s, transform 0.18s, background 0.18s;
}

.card-hover:hover {
	border-color: var(--line-strong);
	background: var(--panel-hover);
	transform: translateY(-2px);
}

.card-feature {
	position: relative;
	overflow: hidden;
}

.card-feature::before {
	content: "";
	position: absolute;
	inset: 0 0 auto;
	height: 1px;
	background: linear-gradient(90deg, transparent, var(--accent-glow), transparent);
	opacity: 0;
	transition: opacity 0.25s;
}

.card-feature:hover::before { opacity: 1; }

.panel {
	background: var(--bg-raised);
	border: 1px solid var(--line);
	border-radius: var(--radius-lg);
	overflow: hidden;
}

.panel-head {
	padding: 16px 20px;
	border-bottom: 1px solid var(--line);
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	background: var(--panel);
}

.panel-body { padding: 20px; }

/* --------------------------------------------------------------------------
   Chips, badges, pills
   -------------------------------------------------------------------------- */

.chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 4px 10px;
	border-radius: 999px;
	border: 1px solid var(--line-strong);
	background: var(--bg-raised);
	font-size: 12px;
	font-weight: 550;
	color: var(--text-dim);
	white-space: nowrap;
}

.chip-accent {
	border-color: transparent;
	background: var(--accent-soft);
	color: #b6bdfb;
}

.chip-premium {
	border-color: rgba(240, 178, 50, 0.35);
	background: rgba(240, 178, 50, 0.12);
	color: var(--premium);
}

.chip-good {
	border-color: rgba(59, 165, 93, 0.35);
	background: rgba(59, 165, 93, 0.12);
	color: #6fce8d;
}

.chip-bad {
	border-color: rgba(237, 66, 69, 0.35);
	background: rgba(237, 66, 69, 0.12);
	color: #f27d7f;
}

.dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--text-faint);
	flex: none;
}

.dot-good { background: var(--good); box-shadow: 0 0 0 3px rgba(59, 165, 93, 0.18); }
.dot-bad { background: var(--bad); box-shadow: 0 0 0 3px rgba(237, 66, 69, 0.18); }
.dot-warn { background: var(--warn); box-shadow: 0 0 0 3px rgba(240, 178, 50, 0.18); }

.eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 12px;
	font-weight: 620;
	letter-spacing: 0.09em;
	text-transform: uppercase;
	color: var(--accent);
	margin-bottom: 14px;
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.hero {
	position: relative;
	padding: 108px 0 84px;
	overflow: hidden;
}

.hero::before {
	content: "";
	position: absolute;
	top: -320px;
	left: 50%;
	width: 1100px;
	height: 700px;
	transform: translateX(-50%);
	background: radial-gradient(closest-side, var(--accent-glow), transparent 72%);
	opacity: 0.5;
	pointer-events: none;
}

.hero::after {
	content: "";
	position: absolute;
	inset: 0;
	background-image: linear-gradient(var(--line) 1px, transparent 1px),
		linear-gradient(90deg, var(--line) 1px, transparent 1px);
	background-size: 56px 56px;
	opacity: 0.16;
	mask-image: radial-gradient(closest-side at 50% 30%, #000 30%, transparent 78%);
	pointer-events: none;
}

.hero .wrap { position: relative; z-index: 1; }

.hero-lead {
	font-size: clamp(1.05rem, 1.9vw, 1.28rem);
	color: var(--text-dim);
	max-width: 640px;
	margin: 20px auto 32px;
}

.hero-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	justify-content: center;
}

.gradient-text {
	background: linear-gradient(100deg, #fff 20%, var(--accent) 78%);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}

/* --------------------------------------------------------------------------
   Stats
   -------------------------------------------------------------------------- */

.stat {
	text-align: center;
	padding: 20px 12px;
}

.stat-value {
	font-size: clamp(1.6rem, 3vw, 2.1rem);
	font-weight: 700;
	letter-spacing: -0.03em;
	line-height: 1.1;
}

.stat-label {
	font-size: 12.5px;
	color: var(--text-dim);
	margin-top: 6px;
}

/* --------------------------------------------------------------------------
   Feature list
   -------------------------------------------------------------------------- */

.feature-icon {
	width: 38px;
	height: 38px;
	border-radius: 10px;
	background: var(--accent-soft);
	display: grid;
	place-items: center;
	font-size: 18px;
	margin-bottom: 14px;
}

.tick-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 9px;
}

.tick-list li {
	position: relative;
	padding-left: 26px;
	color: var(--text-dim);
	font-size: 14px;
}

.tick-list li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.52em;
	width: 14px;
	height: 8px;
	border-left: 2px solid var(--accent);
	border-bottom: 2px solid var(--accent);
	transform: rotate(-45deg);
}

.tick-list li strong { color: var(--text); font-weight: 580; }

/* --------------------------------------------------------------------------
   Comparison table
   -------------------------------------------------------------------------- */

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

table.matrix {
	width: 100%;
	border-collapse: collapse;
	font-size: 14px;
	min-width: 560px;
}

table.matrix th,
table.matrix td {
	padding: 12px 14px;
	text-align: left;
	border-bottom: 1px solid var(--line);
	vertical-align: top;
}

table.matrix thead th {
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.07em;
	color: var(--text-faint);
	font-weight: 620;
	border-bottom-color: var(--line-strong);
}

table.matrix tbody tr:hover { background: var(--panel); }
table.matrix td.center-cell { text-align: center; }

.yes { color: var(--good); font-weight: 700; }
.no { color: var(--text-faint); }

/* --------------------------------------------------------------------------
   Pricing
   -------------------------------------------------------------------------- */

.price-card {
	display: flex;
	flex-direction: column;
	gap: 18px;
	padding: 28px;
	border-radius: var(--radius-lg);
	background: var(--panel);
	border: 1px solid var(--line);
	position: relative;
}

.price-card.featured {
	border-color: var(--accent);
	box-shadow: 0 0 0 1px var(--accent), 0 22px 60px rgba(88, 101, 242, 0.16);
}

.price-card .amount {
	font-size: 2.5rem;
	font-weight: 700;
	letter-spacing: -0.035em;
	line-height: 1;
}

.price-card .per { font-size: 14px; color: var(--text-dim); font-weight: 500; }

.ribbon {
	position: absolute;
	top: -11px;
	left: 28px;
	background: var(--accent);
	color: #fff;
	font-size: 11px;
	font-weight: 680;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	padding: 4px 11px;
	border-radius: 999px;
}

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */

label.field {
	display: grid;
	gap: 6px;
	font-size: 13px;
	font-weight: 560;
	color: var(--text-dim);
}

input[type="text"],
input[type="url"],
input[type="number"],
input[type="password"],
input[type="search"],
input[type="color"],
select,
textarea {
	width: 100%;
	padding: 10px 12px;
	background: var(--bg);
	border: 1px solid var(--line-strong);
	border-radius: var(--radius-sm);
	color: var(--text);
	font: inherit;
	font-size: 14px;
	transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus,
select:focus,
textarea:focus {
	outline: none;
	border-color: var(--accent);
	box-shadow: 0 0 0 3px var(--accent-soft);
}

input::placeholder,
textarea::placeholder { color: var(--text-faint); }

input[type="color"] {
	padding: 4px;
	height: 40px;
	cursor: pointer;
}

textarea {
	resize: vertical;
	min-height: 90px;
	line-height: 1.55;
}

input:disabled,
select:disabled,
textarea:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.hint {
	font-size: 12px;
	color: var(--text-faint);
	font-weight: 450;
	line-height: 1.5;
}

.switch {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	cursor: pointer;
	user-select: none;
}

.switch input { position: absolute; opacity: 0; pointer-events: none; }

.switch .track {
	width: 38px;
	height: 22px;
	border-radius: 999px;
	background: var(--line-strong);
	position: relative;
	transition: background 0.18s;
	flex: none;
}

.switch .track::after {
	content: "";
	position: absolute;
	top: 3px;
	left: 3px;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background: #fff;
	transition: transform 0.18s;
}

.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { box-shadow: 0 0 0 3px var(--accent-soft); }
.switch input:disabled + .track { opacity: 0.45; }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.site-footer {
	border-top: 1px solid var(--line);
	padding: 56px 0 40px;
	margin-top: 64px;
	color: var(--text-dim);
	font-size: 14px;
}

.footer-grid {
	display: grid;
	grid-template-columns: 1.6fr repeat(auto-fit, minmax(140px, 1fr));
	gap: 32px;
}

.footer-grid h4 {
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--text-faint);
	margin-bottom: 12px;
}

.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer-grid a { color: var(--text-dim); }
.footer-grid a:hover { color: var(--text); }

/* --------------------------------------------------------------------------
   Utility
   -------------------------------------------------------------------------- */

.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.skip-link {
	position: absolute;
	left: -9999px;
	top: 8px;
	z-index: 100;
	background: var(--accent);
	color: #fff;
	padding: 10px 16px;
	border-radius: var(--radius-sm);
}

.skip-link:focus { left: 16px; }

.spinner {
	width: 16px;
	height: 16px;
	border: 2px solid var(--line-strong);
	border-top-color: var(--accent);
	border-radius: 50%;
	animation: spin 0.7s linear infinite;
	flex: none;
}

@keyframes spin { to { transform: rotate(360deg); } }

.fade-in { animation: fade-in 0.35s ease both; }

@keyframes fade-in {
	from { opacity: 0; transform: translateY(6px); }
	to { opacity: 1; transform: none; }
}
