@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;700&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

/* SignalScout design system. See DESIGN.md for the full spec.
   Fonts are loaded from Google Fonts to keep everything in this file;
   for production, self-hosting the three families as woff2 is preferred. */

/* --- Tokens: light (default) --------------------------------------------- */
:root {
	--bg: #FBFBFA;          /* Paper */
	--card: #FFFFFF;        /* Card */
	--panel: #F4F6F5;       /* Panel */
	--border: #E7E9E6;      /* Rule */
	--text: #101915;        /* Graphite */
	--muted: #5B6660;       /* Slate */
	--faint: #9AA39E;       /* Mist */

	--accent: #10B981;      /* Signal (fills, mark, dots) */
	--accent-d: #059669;    /* Signal Deep (hover, pressed) */
	--accent-text: #047857; /* Lock (links, text on light, AA) */
	--on-accent: #0E1512;   /* Ink (text on green fills) */

	--ok: #10B981;          /* Signal = high confidence / success */
	--warn: #D9942B;        /* Amber */
	--danger: #C7442F;      /* Clay */

	--tag-bg: rgba(16, 185, 129, 0.10);
	--warn-bg: rgba(217, 148, 43, 0.12);
	--danger-bg: rgba(199, 68, 47, 0.12);
	--shadow: 0 6px 20px rgba(14, 21, 18, 0.10);
	--radius-control: 8px;
	--radius-card: 12px;

	--font-display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
	--font-body: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

	color-scheme: light;
}

/* --- Tokens: dark --------------------------------------------------------- */
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		--bg: #0E1512;        /* Console */
		--card: #151D19;      /* Deck */
		--panel: #1C2823;     /* Bay */
		--border: #26332C;    /* Grid */
		--text: #E8EEEA;      /* Bone */
		--muted: #93A099;     /* Ash */
		--faint: #5B6660;

		--accent: #34D399;    /* Signal Bright */
		--accent-d: #10B981;
		--accent-text: #34D399;
		--on-accent: #0E1512;

		--ok: #34D399;
		--warn: #E6A94A;
		--danger: #E4674F;

		--tag-bg: rgba(52, 211, 153, 0.14);
		--warn-bg: rgba(230, 169, 74, 0.16);
		--danger-bg: rgba(228, 103, 79, 0.16);
		--shadow: 0 6px 20px rgba(0, 0, 0, 0.40);

		color-scheme: dark;
	}
}

/* Explicit dark override (for a future theme toggle) */
:root[data-theme="dark"] {
	--bg: #0E1512; --card: #151D19; --panel: #1C2823; --border: #26332C;
	--text: #E8EEEA; --muted: #93A099; --faint: #5B6660;
	--accent: #34D399; --accent-d: #10B981; --accent-text: #34D399; --on-accent: #0E1512;
	--ok: #34D399; --warn: #E6A94A; --danger: #E4674F;
	--tag-bg: rgba(52, 211, 153, 0.14);
	--warn-bg: rgba(230, 169, 74, 0.16);
	--danger-bg: rgba(228, 103, 79, 0.16);
	--shadow: 0 6px 20px rgba(0, 0, 0, 0.40);
	color-scheme: dark;
}

/* --- Base ---------------------------------------------------------------- */
* { box-sizing: border-box; }
body {
	margin: 0;
	font-family: var(--font-body);
	color: var(--text);
	background: var(--bg);
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}
::selection { background: var(--tag-bg); }

a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { font-family: var(--font-display); letter-spacing: -0.01em; }

.container { max-width: 960px; margin: 0 auto; padding: 0 20px; }

/* --- Nav & brand --------------------------------------------------------- */
header.nav { display: flex; align-items: center; justify-content: space-between; padding: 18px 0; }
.brand {
	font-family: var(--font-display);
	font-weight: 700; font-size: 18px; letter-spacing: -0.02em;
	color: var(--text);
}
.brand:hover { text-decoration: none; }
.brand span { color: var(--accent-text); }

/* --- Buttons ------------------------------------------------------------- */
.btn {
	display: inline-block; background: var(--accent); color: var(--on-accent);
	border: 1px solid transparent; border-radius: var(--radius-control);
	padding: 10px 16px; font-family: var(--font-body); font-size: 15px; font-weight: 600;
	line-height: 1.2; cursor: pointer; text-decoration: none;
	transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}
.btn:hover { background: var(--accent-d); text-decoration: none; }
.btn.secondary {
	background: transparent; color: var(--text); border-color: var(--border);
}
.btn.secondary:hover {
	background: var(--tag-bg); border-color: var(--accent); color: var(--accent-text);
}
.btn[disabled] { opacity: 0.5; cursor: default; pointer-events: none; }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* --- Hero ---------------------------------------------------------------- */
.hero { padding: 64px 0 32px; }
.hero h1 { font-size: 44px; line-height: 1.08; letter-spacing: -0.02em; margin: 0 0 16px; }
.hero p.lead { font-size: 19px; color: var(--muted); max-width: 640px; margin: 0 0 24px; }

/* --- Cards & grid -------------------------------------------------------- */
.card {
	background: var(--card); border: 1px solid var(--border);
	border-radius: var(--radius-card); padding: 22px;
}
.grid { display: grid; gap: 18px; }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }

/* --- Forms --------------------------------------------------------------- */
label {
	display: block; font-size: 13px; font-weight: 600; color: var(--muted);
	margin: 12px 0 6px; letter-spacing: 0.01em;
}
input, textarea, select {
	width: 100%; padding: 10px 12px; border: 1px solid var(--border);
	border-radius: var(--radius-control); font-size: 15px; font-family: var(--font-body);
	background: var(--card); color: var(--text);
	transition: border-color 140ms ease, box-shadow 140ms ease;
}
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, textarea:focus, select:focus {
	outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--tag-bg);
}
/* Domain, URL, and list inputs read as data: mono. */
textarea, input#s-domain, input#b-you {
	font-family: var(--font-mono); font-size: 13px;
}
textarea { min-height: 120px; resize: vertical; }

/* --- Text utilities ------------------------------------------------------ */
.muted { color: var(--muted); }
.small { font-size: 13px; }
code {
	font-family: var(--font-mono); font-size: 12px;
	background: var(--panel); border: 1px solid var(--border);
	border-radius: 6px; padding: 1px 6px;
}

/* --- Sections ------------------------------------------------------------ */
.section { padding: 40px 0; }
.section h2 { font-size: 26px; letter-spacing: -0.01em; margin: 0 0 18px; }

/* --- Pills & signal tags ------------------------------------------------- */
.pill {
	display: inline-block; font-size: 12px; font-weight: 600;
	padding: 3px 10px; border-radius: 999px;
	background: var(--tag-bg); color: var(--accent-text);
}
/* Semantic tags (signal type, credits, status) get a status dot and mono. */
.pill.ok, .pill.warn, .pill.danger {
	font-family: var(--font-mono); font-weight: 500; font-size: 11px;
	letter-spacing: 0.04em; text-transform: uppercase;
	display: inline-flex; align-items: center; gap: 6px;
}
.pill.ok::before, .pill.warn::before, .pill.danger::before {
	content: ""; width: 6px; height: 6px; border-radius: 999px; background: currentColor;
}
.pill.ok { background: var(--tag-bg); color: var(--accent-text); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.danger { background: var(--danger-bg); color: var(--danger); }

/* --- Tables (results, history) ------------------------------------------- */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
	text-align: left; padding: 8px; border-bottom: 1px solid var(--border);
	font-family: var(--font-mono); font-size: 11px; font-weight: 500;
	letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted);
	vertical-align: bottom;
}
td { text-align: left; padding: 8px; border-bottom: 1px solid var(--border); vertical-align: top; }

/* --- Result / email block (Panel) ---------------------------------------- */
.row-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.result {
	white-space: pre-wrap; background: var(--panel); border: 1px solid var(--border);
	border-radius: var(--radius-control); padding: 12px 14px; margin-top: 6px;
	font-size: 13px; line-height: 1.55;
}
/* The free-tool result panel hardcodes a light background inline; keep it on-theme. */
#s-result { background: var(--panel) !important; }

/* --- How-it-works steps -------------------------------------------------- */
.steps { counter-reset: step; }
.steps .card:before {
	counter-increment: step; content: counter(step);
	display: inline-flex; width: 28px; height: 28px; align-items: center; justify-content: center;
	border-radius: 50%; background: var(--accent); color: var(--on-accent);
	font-family: var(--font-mono); font-weight: 500; margin-bottom: 10px;
}

/* --- Footer -------------------------------------------------------------- */
footer {
	padding: 40px 0; color: var(--muted); font-size: 14px;
	border-top: 1px solid var(--border); margin-top: 40px;
}

/* --- Utilities ----------------------------------------------------------- */
.hidden { display: none !important; }

/* --- Motion: spinner (inline) + signal ping (signature) ------------------ */
.spinner {
	display: inline-block; width: 14px; height: 14px;
	border: 2px solid var(--border); border-top-color: var(--accent);
	border-radius: 50%; animation: spin .7s linear infinite; vertical-align: -2px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Signature motion: a dot emits one expanding ring. Wrap a dot element in
   .ping to use it (live-research state, logo). See DESIGN.md section 8. */
@keyframes ping {
	0%   { transform: scale(0.6); opacity: 0.7; }
	80%, 100% { transform: scale(2.4); opacity: 0; }
}
.ping { position: relative; }
.ping::after {
	content: ""; position: absolute; inset: 0;
	border-radius: 999px; border: 2px solid var(--accent);
	animation: ping 1.4s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@media (prefers-reduced-motion: reduce) {
	.spinner { animation-duration: 1.6s; }
	.ping::after { animation: none; opacity: 0; }
	* { scroll-behavior: auto; }
}

/* --- Legal pages --------------------------------------------------------- */
.legal article h1 { font-size: 32px; margin: 0 0 8px; }
.legal article h2 { font-size: 18px; margin: 28px 0 10px; }
.legal article ul { padding-left: 1.2em; }
.legal article li { margin: 6px 0; }
.legal article p { max-width: 72ch; }
.card.popular { border-color: var(--accent); box-shadow: var(--shadow); }

/* --- Responsive ---------------------------------------------------------- */
@media (max-width: 720px) {
	.grid.cols-3, .grid.cols-2 { grid-template-columns: 1fr; }
	.hero h1 { font-size: 32px; }
	header.nav .row-actions a:not(.btn) { display: none; }
}
