/*
 * Ticket Tool X'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;

	--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;
}

/*
 * When the mark IS the image rather than a box containing one, the gradient
 * underneath would rim a logo that has its own background. Artwork wins.
 */
img.brand-mark {
	background: none;
	box-shadow: none;
	object-fit: contain;
}

.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; }
}

/* --------------------------------------------------------------------------
   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); }
