/* ghis website. Same tokens as the app (src/ghis/web/style.css) so the two feel like one product. */

:root {
	color-scheme: light;
	--page: #f9f9f7;
	--surface: #fcfcfb;
	--surface-2: #f3f2ee;
	--ink: #0b0b0b;
	--ink-2: #52514e;
	--muted: #6f6d67;
	--border: rgba(11, 11, 11, 0.1);
	--shadow: 0 1px 2px rgba(11, 11, 11, 0.04), 0 18px 48px rgba(11, 11, 11, 0.08);
	--accent: #2a78d6;
	--violet: #6250d6;
	--aqua: #1baf7a;
	--good: #006300;
	--code: #0f1115;
	--code-ink: #e6e6e3;
	--glow-1: rgba(42, 120, 214, 0.22);
	--glow-2: rgba(98, 80, 214, 0.16);
	--font: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
	--mono: ui-monospace, 'SF Mono', 'Cascadia Mono', Menlo, monospace;
	--ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

@media (prefers-color-scheme: dark) {
	:root:not([data-theme='light']) {
		color-scheme: dark;
		--page: #0d0d0d;
		--surface: #1a1a19;
		--surface-2: #232321;
		--ink: #f0efec;
		--ink-2: #c3c2b7;
		--muted: #9a988f;
		--border: rgba(255, 255, 255, 0.1);
		--shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 18px 48px rgba(0, 0, 0, 0.45);
		--accent: #3987e5;
		--violet: #9085e9;
		--aqua: #199e70;
		--good: #0ca30c;
		--code: #121212;
		--glow-1: rgba(57, 135, 229, 0.24);
		--glow-2: rgba(144, 133, 233, 0.18);
	}
}

:root[data-theme='dark'] {
	color-scheme: dark;
	--page: #0d0d0d;
	--surface: #1a1a19;
	--surface-2: #232321;
	--ink: #f0efec;
	--ink-2: #c3c2b7;
	--muted: #9a988f;
	--border: rgba(255, 255, 255, 0.1);
	--shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 18px 48px rgba(0, 0, 0, 0.45);
	--accent: #3987e5;
	--violet: #9085e9;
	--aqua: #199e70;
	--good: #0ca30c;
	--code: #121212;
	--glow-1: rgba(57, 135, 229, 0.24);
	--glow-2: rgba(144, 133, 233, 0.18);
}

/* Theme switch, shared with the app's theme.js. */
::view-transition-old(root), ::view-transition-new(root) {
	animation-duration: 0.6s;
	animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}
.theme-fade, .theme-fade * { transition: background-color 0.6s ease, color 0.6s ease, border-color 0.6s ease !important; }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--ink); font: 17px/1.6 var(--font); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: inherit; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); }
a:hover { text-decoration-color: currentColor; }
code { font: 0.88em var(--mono); background: var(--surface-2); padding: 0.12em 0.4em; border-radius: 6px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

/* ------------------------------------------------------------------ nav */

.nav {
	position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 18px;
	padding: 12px max(16px, calc((100vw - 1160px) / 2));
	background: color-mix(in srgb, var(--page) 76%, transparent);
	backdrop-filter: saturate(1.5) blur(16px); -webkit-backdrop-filter: saturate(1.5) blur(16px);
	border-bottom: 1px solid var(--border);
}
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 800; font-size: 20px; letter-spacing: -0.03em; text-decoration: none; }
.brand svg { width: 26px; height: 26px; }
.nav-links { display: flex; gap: 22px; margin-left: 18px; }
.nav-links a { text-decoration: none; color: var(--ink-2); font-size: 15px; font-weight: 500; }
.nav-links a:hover { color: var(--ink); }
.spacer { flex: 1; }

.btn {
	display: inline-flex; align-items: center; gap: 8px; padding: 11px 20px; border-radius: 999px;
	border: 1px solid var(--border); background: var(--surface); color: var(--ink);
	font: 600 15px var(--font); text-decoration: none; cursor: pointer;
	transition: transform 0.18s var(--ease), box-shadow 0.25s;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.btn.primary { background: var(--ink); color: var(--page); border-color: transparent; }
.btn.ghost { padding: 7px 14px; font-size: 14px; }
.btn.small { padding: 7px 14px; font-size: 14px; }
.nav-cta { display: none; }
.btn svg { width: 17px; height: 17px; }
.icon-btn { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--ink-2); cursor: pointer; transition: transform 0.25s var(--ease); }
.icon-btn:hover { transform: rotate(-15deg); color: var(--ink); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn.github svg { width: 20px; height: 20px; }

/* ------------------------------------------------------------------ hero */

main { max-width: 1160px; margin: 0 auto; padding: 0 16px; }

.hero {
	position: relative; isolation: isolate; text-align: center; padding: clamp(56px, 10vw, 112px) 0 40px;
	/* The glows below are wider than a phone; clipped here they cannot widen the page (which
	   phones answer by zooming the whole page out). `hidden` is the fallback for old Safari. */
	overflow-x: hidden;
	overflow-x: clip;
}
.hero::before, .hero::after {
	content: ''; position: absolute; z-index: -1; border-radius: 50%; filter: blur(70px); pointer-events: none;
	animation: drift 20s ease-in-out infinite alternate;
}
.hero::before { width: 620px; height: 620px; left: calc(50% - 560px); top: -120px; background: radial-gradient(circle, var(--glow-1), transparent 65%); }
.hero::after { width: 560px; height: 560px; left: calc(50% - 20px); top: -40px; background: radial-gradient(circle, var(--glow-2), transparent 65%); animation-direction: alternate-reverse; animation-duration: 24s; }
@keyframes drift { from { transform: translate3d(-40px, 0, 0) scale(1); } to { transform: translate3d(50px, 40px, 0) scale(1.15); } }
@keyframes rise { from { transform: translateY(26px); opacity: 0; } }

.badge {
	display: inline-flex; align-items: center; gap: 8px; margin: 0 0 22px; padding: 6px 14px; border-radius: 999px;
	background: var(--surface); border: 1px solid var(--border); font-size: 14px; font-weight: 600; color: var(--ink-2);
	animation: rise 0.8s var(--ease) both;
}
.badge .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 4px color-mix(in srgb, var(--good) 22%, transparent); }
.hero h1 { margin: 0; font-size: clamp(44px, 8.4vw, 96px); line-height: 0.98; letter-spacing: -0.05em; font-weight: 850; animation: rise 0.9s 0.08s var(--ease) both; }
.hero h1 em { font-style: normal; background: linear-gradient(100deg, var(--accent), var(--violet) 55%, var(--aqua)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { max-width: 60ch; margin: 24px auto 0; font-size: clamp(17px, 2.1vw, 21px); color: var(--ink-2); animation: rise 0.9s 0.16s var(--ease) both; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 32px; animation: rise 0.9s 0.24s var(--ease) both; }
.cta .btn { padding: 14px 26px; font-size: 16px; }

.hosts { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 22px; margin: 34px 0 0; color: var(--muted); font-size: 14px; font-weight: 600; letter-spacing: 0.02em; animation: rise 0.9s 0.3s var(--ease) both; }

.window {
	margin: 56px auto 0; max-width: 1080px; border-radius: 18px; overflow: hidden;
	background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow), 0 40px 120px -40px var(--glow-1);
	animation: rise 1.1s 0.35s var(--ease) both;
}
.window-bar { display: flex; align-items: center; gap: 7px; padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.window-bar i { width: 11px; height: 11px; border-radius: 50%; background: var(--border); }
.window-bar span { margin: 0 auto; padding: 3px 14px; border-radius: 8px; background: var(--surface); font: 12px var(--mono); color: var(--muted); }
.frame { position: relative; }
.window iframe { display: block; width: 100%; height: min(78vh, 760px); border: 0; background: var(--page); }
.tap { display: none; }
.window figcaption { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 16px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--border); }
.demo-switch { display: inline-flex; gap: 4px; padding: 3px; border-radius: 999px; background: var(--surface-2); }
.demo-switch button { border: 0; background: transparent; color: var(--ink-2); font: 600 13px var(--font); padding: 4px 12px; border-radius: 999px; cursor: pointer; }
.demo-switch button[aria-pressed='true'] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }

/* ------------------------------------------------------------------ blocks */

.block { padding: clamp(64px, 10vw, 120px) 0 0; }
.kicker { margin: 0 0 8px; font-size: 13px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }
.block h2 { margin: 0; font-size: clamp(32px, 5vw, 54px); line-height: 1.05; letter-spacing: -0.04em; }
.sub { margin: 14px 0 0; font-size: 19px; color: var(--ink-2); max-width: 56ch; }

.reveal { opacity: 0; transform: translateY(30px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 16px; margin-top: 40px; }
.feature {
	padding: 26px; border-radius: 20px; background: var(--surface); border: 1px solid var(--border);
	transition: transform 0.3s var(--ease), box-shadow 0.3s;
}
.feature:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.f-icon { display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: var(--surface-2); font-size: 24px; }
.feature h3 { margin: 18px 0 6px; font-size: 20px; letter-spacing: -0.02em; }
.feature p { margin: 0; color: var(--ink-2); font-size: 16px; }
.reveal .feature { opacity: 0; transform: translateY(18px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease), box-shadow 0.3s; }
.reveal.in .feature { opacity: 1; transform: none; }
.reveal.in .feature:nth-child(2) { transition-delay: 0.06s; }
.reveal.in .feature:nth-child(3) { transition-delay: 0.12s; }
.reveal.in .feature:nth-child(4) { transition-delay: 0.18s; }
.reveal.in .feature:nth-child(5) { transition-delay: 0.24s; }
.reveal.in .feature:nth-child(6) { transition-delay: 0.3s; }
.reveal.in .feature:hover { transform: translateY(-4px); transition-delay: 0s; }

/* ------------------------------------------------------------------ get started */

.code-card { margin-top: 32px; border-radius: 18px; overflow: hidden; background: var(--code); color: var(--code-ink); box-shadow: var(--shadow); max-width: 760px; }
.code-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); font-size: 13px; color: #9a988f; }
.copy { border: 1px solid rgba(255, 255, 255, 0.16); background: transparent; color: #e6e6e3; border-radius: 8px; padding: 4px 12px; font: 600 12px var(--font); cursor: pointer; }
.copy:hover { background: rgba(255, 255, 255, 0.08); }
.code-card pre { margin: 0; padding: 20px 22px; overflow-x: auto; font: 15px/1.8 var(--mono); }
.code-card pre code { background: none; padding: 0; font: inherit; color: inherit; }
.code-card .c { color: #6da7ec; user-select: none; }

.steps { list-style: none; counter-reset: step; padding: 0; margin: 32px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 16px; }
.steps li { counter-increment: step; position: relative; padding: 22px 22px 22px 70px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); }
.steps li::before { content: counter(step); position: absolute; left: 22px; top: 20px; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--ink); color: var(--page); font-weight: 800; }
.steps b { display: block; font-size: 17px; }
.steps span { color: var(--ink-2); font-size: 15px; }

.ways { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 16px; margin-top: 40px; }
.way { padding: 24px; border-radius: 18px; background: var(--surface-2); }
.way h3 { margin: 0; font-size: 18px; }
.way p { margin: 4px 0 14px; color: var(--ink-2); font-size: 15px; }
.way pre { margin: 0; padding: 14px 16px; border-radius: 12px; background: var(--code); color: var(--code-ink); overflow-x: auto; font: 13px/1.7 var(--mono); }
.way pre code { background: none; padding: 0; font: inherit; }

/* ------------------------------------------------------------------ privacy, faq, final */

.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 48px; align-items: start; }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.checks li { position: relative; padding: 18px 20px 18px 56px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); color: var(--ink-2); }
.checks li::before { content: '✓'; position: absolute; left: 18px; top: 17px; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; font-size: 13px; font-weight: 800; color: var(--good); background: color-mix(in srgb, var(--good) 16%, transparent); }
.checks b { color: var(--ink); }

.faq { margin-top: 32px; display: grid; gap: 10px; max-width: 820px; }
.faq details { border-radius: 16px; background: var(--surface); border: 1px solid var(--border); padding: 4px 22px; }
.faq summary { cursor: pointer; padding: 14px 0; font-weight: 650; font-size: 17px; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; font-size: 22px; line-height: 1; color: var(--muted); transition: transform 0.25s var(--ease); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq .answer { overflow: hidden; }
.faq p { margin: 0 0 16px; color: var(--ink-2); }

.final { text-align: center; padding-bottom: 40px; }
.final .sub { margin-inline: auto; }

.foot { margin-top: 80px; padding: 28px 16px 40px; border-top: 1px solid var(--border); color: var(--muted); font-size: 14px; }
.foot-inner { max-width: 1160px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.foot p { margin: 4px 0; }

/* The radufarcas.dev monogram as a mask: its shape, the theme's text color, so it reads
   on both the light and the dark page. */
.maker { display: inline-flex; align-items: center; gap: 10px; flex: none; color: var(--muted); text-decoration: none; font-weight: 600; transition: color 0.25s; }
.maker:hover { color: var(--ink); }
.maker-logo {
	width: 32px; height: 32px; background: currentColor;
	-webkit-mask: url(fr.png) center / contain no-repeat;
	mask: url(fr.png) center / contain no-repeat;
	transition: transform 0.4s var(--ease);
}
.maker:hover .maker-logo { transform: rotate(-20deg); }

/* ------------------------------------------------------------------ 404 */

.lost { min-height: 100vh; display: grid; place-content: center; text-align: center; padding: 24px 16px; }
.lost h1 { margin: 0; font-size: clamp(34px, 7vw, 64px); letter-spacing: -0.04em; line-height: 1.05; }
.lost .sub { margin-inline: auto; }

/* ------------------------------------------------------------------ responsive & preferences */

@media (max-width: 820px) {
	.nav-links { display: none; }
	.nav-cta { display: inline-flex; }
	.split { grid-template-columns: 1fr; gap: 24px; }
	.window iframe { height: 70vh; }
}

/* Phones: a page of its own, not the desktop page squeezed. */
@media (max-width: 640px) {
	body { font-size: 16px; }
	.nav { gap: 10px; padding-block: 10px; }
	.nav .btn.ghost { display: none; }

	.hero { padding: 40px 0 24px; }
	.badge { margin-bottom: 18px; font-size: 13px; }
	.hero h1 { font-size: clamp(30px, 9.2vw, 44px); line-height: 1.04; letter-spacing: -0.045em; }
	.lead { margin-top: 18px; font-size: 17px; }
	.cta { flex-direction: column; align-items: stretch; max-width: 340px; margin: 26px auto 0; }
	.cta .btn { justify-content: center; padding: 14px 20px; }
	.hosts { gap: 6px 14px; margin-top: 26px; font-size: 13px; }

	/* The live demo turns into a zoomed-out preview: the story at twice the width, scaled
	   to half, with nothing to scroll inside it. Tapping opens the real thing. */
	.window { margin-top: 36px; border-radius: 16px; }
	.window-bar { padding: 10px 12px; }
	.window-bar span { font-size: 11px; }
	.frame { height: 440px; overflow: hidden; }
	.window iframe { width: 200%; height: 880px; transform: scale(0.5); transform-origin: 0 0; pointer-events: none; }
	.tap {
		display: flex; position: absolute; inset: 0; align-items: flex-end; justify-content: center;
		padding-bottom: 20px; text-decoration: none;
		background: linear-gradient(to bottom, transparent 45%, color-mix(in srgb, var(--surface) 92%, transparent));
	}
	.tap span { padding: 10px 18px; border-radius: 999px; background: var(--ink); color: var(--page); font-weight: 700; font-size: 15px; box-shadow: var(--shadow); }
	.window figcaption { flex-direction: column; align-items: stretch; text-align: center; }
	.window figcaption > span:first-child { display: none; } /* "scroll inside it" is not how phones get it */
	.demo-switch { justify-content: center; }
	.demo-switch button { flex: 1; }

	.block { padding-top: 64px; }
	.block h2 { font-size: clamp(28px, 8vw, 36px); }
	.sub { font-size: 17px; }

	/* Features: icon beside the text, so six of them fit in a couple of screens. */
	.features { gap: 10px; margin-top: 28px; }
	.feature { display: grid; grid-template-columns: 44px 1fr; gap: 2px 14px; padding: 18px; border-radius: 16px; }
	.f-icon { grid-row: span 2; width: 44px; height: 44px; font-size: 21px; border-radius: 12px; }
	.feature h3 { margin: 0; font-size: 17px; }
	.feature p { font-size: 15px; }

	/* Commands wrap instead of running off the screen. */
	.code-card { margin-top: 24px; border-radius: 14px; }
	.code-card pre { padding: 16px; font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; }
	.way pre { white-space: pre-wrap; overflow-wrap: anywhere; }
	.steps { gap: 10px; margin-top: 24px; }
	.steps li { padding: 18px 18px 18px 62px; }
	.steps li::before { left: 18px; top: 18px; width: 30px; height: 30px; }
	.ways { gap: 10px; margin-top: 28px; }
	.way { padding: 20px; }

	.checks li { padding: 16px 16px 16px 52px; font-size: 15px; }
	.checks li::before { left: 16px; top: 16px; }
	.faq details { padding: 2px 18px; }
	.faq summary { font-size: 16px; padding: 14px 0; }
	.foot { margin-top: 56px; }
	.foot-inner { flex-direction: column; text-align: center; }
}

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