/* ============================================================
   Sastra website — shared styles
   Light by default, hot-pink (#FF006E) accent, Gabarito.
   Header + footer read theme variables so the docs dark mode
   can recolour them.
   ============================================================ */

:root {
	--accent: #ff006e;
	--accent-hover: #d6005d;
	--accent-soft: #ffe1ee;
	--accent-tint: #fff5f9;

	--ink: #1a1320;
	--ink-soft: #4a4453;
	--muted: #857e90;

	--bg: #ffffff;
	--bg-alt: #faf6fb;
	--bg-tint: #f6eef6;

	--panel: #ffffff;
	--border: #ece6f0;
	--border-strong: #ddd4e4;

	/* chrome (header/footer) — overridable by docs dark theme */
	--chrome-bg: rgba(255, 255, 255, .82);
	--chrome-solid: #ffffff;
	--chrome-ink: #1a1320;
	--chrome-ink-soft: #4a4453;
	--chrome-border: #ece6f0;
	--chrome-hover: #fff5f9;

	--shadow-sm: 0 2px 8px rgba(26, 19, 32, .06);
	--shadow-md: 0 8px 28px rgba(26, 19, 32, .10);
	--shadow-lg: 0 24px 64px rgba(26, 19, 32, .16);

	--radius-sm: 10px;
	--radius: 16px;
	--radius-lg: 24px;
	--radius-pill: 999px;

	--font: "Gabarito", system-ui, -apple-system, "Segoe UI", sans-serif;
	--mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

	--maxw: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
	margin: 0;
	font-family: var(--font);
	color: var(--ink);
	background: var(--bg);
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
	overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { line-height: 1.15; font-weight: 700; letter-spacing: -.01em; }
::selection { background: var(--accent); color: #fff; }

/* ---------- Layout helpers ---------- */
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.section { padding: 92px 0; }
.center { text-align: center; }

/* ---------- Logo wordmark ---------- */
.wordmark {
	display: inline-flex;
	align-items: baseline;
	gap: 9px;
	font-weight: 500;
	font-size: 1.5rem;
	color: var(--chrome-ink);
}
.wordmark svg { height: .95em; width: auto; align-self: center; }
.wordmark > span { line-height: 1; }
.wordmark .byline {
	font-size: .82rem;
	font-weight: 400;
	opacity: .5;
	letter-spacing: 0;
}
.wordmark:hover { color: var(--chrome-ink); }

/* ---------- Buttons (no shadow / glow) ---------- */
.btn {
	display: inline-flex;
	align-items: center;
	gap: 9px;
	font-family: var(--font);
	font-weight: 600;
	font-size: 1.02rem;
	padding: 13px 26px;
	border-radius: var(--radius-pill);
	border: 2px solid transparent;
	cursor: pointer;
	transition: background .16s ease, color .16s ease, border-color .16s ease, transform .16s ease;
	text-decoration: none;
	white-space: nowrap;
}
.btn svg { width: 1.1em; height: 1.1em; }
.btn i { font-size: 1.05em; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); color: #fff; transform: translateY(-2px); }
.btn-ghost { background: var(--chrome-solid); color: var(--chrome-ink); border-color: var(--border-strong); }
.btn-ghost:hover { color: var(--chrome-ink); border-color: var(--accent); transform: translateY(-2px); }
.btn-lg { font-size: 1.1rem; padding: 16px 34px; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }

/* ---------- Icon button ---------- */
.icon-btn {
	display: grid; place-items: center;
	width: 40px; height: 40px; border-radius: 50%;
	border: 1px solid var(--chrome-border);
	background: transparent; color: var(--chrome-ink);
	cursor: pointer; transition: background .15s, color .15s, border-color .15s;
	flex: none;
}
.icon-btn:hover { color: var(--accent); border-color: var(--accent); }
.icon-btn svg { width: 20px; height: 20px; }

/* ---------- Header ---------- */
.site-nav {
	position: sticky; top: 0; z-index: 100;
	background: var(--chrome-bg);
	backdrop-filter: saturate(180%) blur(14px);
	border-bottom: 1px solid var(--chrome-border);
}
.nav-inner {
	max-width: var(--maxw); margin: 0 auto;
	padding: 12px 24px;
	display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.nav-left { display: flex; align-items: center; gap: 12px; }
.nav-right { display: flex; align-items: center; gap: 10px; }
.nav-links { display: flex; align-items: center; gap: 6px; }
.nav-links a {
	color: var(--chrome-ink-soft);
	font-weight: 600; font-size: .98rem;
	padding: 8px 14px; border-radius: var(--radius-pill);
	transition: background .15s, color .15s;
}
.nav-links a:hover { color: var(--accent); background: var(--chrome-hover); }
.nav-links a.cta { background: var(--accent); color: #fff; margin-left: 12px; }
.nav-links a.cta:hover { background: var(--accent-hover); color: #fff; }
.nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: 8px; color: var(--chrome-ink); }
.sidebar-btn { display: none; }

/* ---------- Footer ---------- */
.site-footer {
	background: var(--bg-alt);
	border-top: 1px solid var(--chrome-border);
	padding: 44px 0 32px;
}
.footer-inner {
	max-width: var(--maxw); margin: 0 auto; padding: 0 24px;
	display: flex; flex-wrap: wrap; gap: 24px 40px;
	justify-content: space-between; align-items: center;
}
.footer-inner .wordmark { color: var(--chrome-ink); }
/* negative right margin so the rightmost link's TEXT lines up with the edge,
   not the (invisible) pill padding */
.footer-links { display: flex; flex-wrap: wrap; gap: 2px; margin-right: -14px; }
.footer-links a {
	color: var(--chrome-ink-soft); font-weight: 600; font-size: .98rem;
	padding: 8px 14px; border-radius: var(--radius-pill);
	transition: background .15s, color .15s;
}
.footer-links a:hover { color: var(--accent); background: var(--chrome-hover); }
.footer-bottom {
	max-width: var(--maxw); margin: 28px auto 0; padding: 22px 24px 0;
	border-top: 1px solid var(--chrome-border);
	display: flex; flex-wrap: wrap; gap: 14px; justify-content: space-between; align-items: center;
}
.krysion-badge { display: inline-flex; align-items: center; gap: 9px; color: var(--chrome-ink); font-weight: 500; font-size: 1.05rem; }
.krysion-badge img { width: 28px; height: 28px; border-radius: 7px; object-fit: contain; }
.krysion-badge:hover { color: #7c44ff; }
.footer-bottom .copy { color: var(--chrome-ink); font-size: .9rem; }
.footer-end { display: flex; align-items: center; gap: 18px; }
.socials { display: flex; align-items: center; gap: 14px; }
.socials a { color: var(--chrome-ink-soft); font-size: 1.15rem; line-height: 1; transition: color .15s, transform .15s; }
.socials a:hover { color: var(--accent); transform: translateY(-2px); }

/* ---------- Reveal-on-scroll ---------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation: none !important; transition: none !important; }
	.reveal { opacity: 1; transform: none; }
	html { scroll-behavior: auto; }
}

/* ---------- Responsive header + footer ---------- */
@media (max-width: 760px) {
	.nav-links {
		position: absolute; top: 100%; left: 0; right: 0;
		flex-direction: column; align-items: stretch; gap: 4px;
		background: var(--chrome-solid);
		padding: 12px; border-bottom: 1px solid var(--chrome-border);
		box-shadow: var(--shadow-md); display: none;
	}
	.nav-links.open { display: flex; }
	.nav-links a { text-align: left; }
	/* in the dropdown the CTA is full width; drop the desktop spacing so its
	   text lines up with the other items */
	.nav-links a.cta { margin-left: 0; }
	.nav-toggle { display: block; }
	.section { padding: 60px 0; }

	/* footer: stack and left-align everything neatly.
	   Order: Krysion badge, then socials, then copyright. */
	.footer-inner { flex-direction: column; align-items: flex-start; gap: 18px; }
	.footer-links { margin-right: 0; margin-left: -14px; }
	.footer-bottom { flex-direction: column; align-items: flex-start; gap: 16px; }
	.footer-end { flex-direction: column; align-items: flex-start; gap: 14px; }
}
