/* ==========================================================================
   Stylish Name Generators – main stylesheet (mobile first)
   Palette: deep navy + slate, one calm teal accent.
   ========================================================================== */

:root {
	--bg: #f6f7f9;
	--surface: #ffffff;
	--surface-2: #eef1f5;
	--text: #0f1b2d;          /* deep navy */
	--muted: #52607a;         /* slate */
	--border: #dde2ea;
	--accent: #0e7c7b;        /* refined teal */
	--accent-hover: #0a6463;
	--accent-soft: #e3f2f1;
	--accent-text: #ffffff;
	--ok: #067647;
	--warn: #b54708;
	--danger: #b42318;
	--shadow: 0 1px 2px rgba(15, 27, 45, .06), 0 4px 16px rgba(15, 27, 45, .06);
	--radius: 14px;
	--radius-sm: 10px;
	--font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
	--font-glyph: system-ui, -apple-system, "Segoe UI", "Segoe UI Symbol", "Segoe UI Emoji", Roboto, "Noto Sans", "Noto Sans Symbols 2", "Noto Sans Math", "Apple Color Emoji", sans-serif;
	--max: 1120px;
	color-scheme: light;
}

@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		--bg: #0b1422;
		--surface: #121d2f;
		--surface-2: #1a2840;
		--text: #e7ecf3;
		--muted: #9aa8bd;
		--border: #24344e;
		--accent: #4fb3ad;
		--accent-hover: #6cc6c0;
		--accent-soft: #12302f;
		--accent-text: #06201f;
		--ok: #47cd89;
		--warn: #fdb022;
		--danger: #f97066;
		--shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
		color-scheme: dark;
	}
}

:root[data-theme="dark"] {
	--bg: #0b1422;
	--surface: #121d2f;
	--surface-2: #1a2840;
	--text: #e7ecf3;
	--muted: #9aa8bd;
	--border: #24344e;
	--accent: #4fb3ad;
	--accent-hover: #6cc6c0;
	--accent-soft: #12302f;
	--accent-text: #06201f;
	--ok: #47cd89;
	--warn: #fdb022;
	--danger: #f97066;
	--shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
	color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font: 16px/1.65 var(--font);
	-webkit-font-smoothing: antialiased;
	overflow-x: hidden;
}
img { max-width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }
h1, h2, h3 { line-height: 1.25; color: var(--text); letter-spacing: -.01em; }
h2 { font-size: 1.45rem; margin: 2.2em 0 .6em; }
h3 { font-size: 1.15rem; margin: 1.6em 0 .4em; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
button { font: inherit; color: inherit; }
.sr-only { position: absolute !important; 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: -999px; top: 8px; background: var(--surface); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip-link:focus { left: 8px; }
.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 16px; }

/* ---------- Header ---------- */
.site-header {
	position: sticky; top: 0; z-index: 50;
	background: color-mix(in srgb, var(--bg) 88%, transparent);
	backdrop-filter: saturate(1.4) blur(10px);
	-webkit-backdrop-filter: saturate(1.4) blur(10px);
	border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 12px; min-height: 84px; }
.brand { display: inline-flex; align-items: center; flex-shrink: 0; }
.logo { display: block; width: auto; height: 64px; }
@media (max-width: 600px) {
	.header-inner { min-height: 68px; }
	.logo { height: 52px; }
}
.logo--dark { display: none; }
:root[data-theme="dark"] .logo--light { display: none; }
:root[data-theme="dark"] .logo--dark { display: block; }
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) .logo--light { display: none; }
	:root:not([data-theme="light"]) .logo--dark { display: block; }
}
.header-actions { margin-left: auto; display: flex; gap: 6px; }
.icon-btn {
	display: inline-grid; place-items: center; width: 42px; height: 42px;
	background: transparent; border: 1px solid var(--border); border-radius: 12px;
	color: var(--text); cursor: pointer; transition: background .15s;
}
.icon-btn:hover { background: var(--surface-2); }
.theme-toggle .i-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) .theme-toggle .i-sun { display: block; }
	:root:not([data-theme="light"]) .theme-toggle .i-moon { display: none; }
}

/* Nav – mobile: slide-down panel */
.main-nav { display: none; }
.main-nav.is-open {
	display: block; position: absolute; left: 0; right: 0; top: 100%;
	background: var(--surface); border-bottom: 1px solid var(--border);
	box-shadow: var(--shadow); max-height: calc(100vh - 64px); overflow-y: auto;
	padding: 8px 16px 16px;
}
.main-nav ul { list-style: none; margin: 0; padding: 0; }
.main-nav a {
	display: block; padding: 10px 8px; color: var(--text); text-decoration: none;
	border-radius: 8px; font-weight: 500;
}
.main-nav a:hover, .main-nav .current-menu-item > a { color: var(--accent); background: var(--surface-2); }
.main-nav .menu-item-has-children > a::after { content: "▾"; font-size: .8em; margin-left: 6px; opacity: .7; }
.main-nav .sub-menu { display: none; padding-left: 12px; }
.main-nav .is-open > .sub-menu { display: block; }
.main-nav .sub-menu a { font-weight: 400; font-size: .95rem; }

@media (min-width: 900px) {
	.nav-toggle { display: none; }
	.main-nav, .main-nav.is-open {
		display: block; position: static; background: none; border: 0; box-shadow: none;
		padding: 0; max-height: none; overflow: visible; margin-left: auto;
	}
	.header-actions { margin-left: 4px; }
	.main-nav > .menu { display: flex; gap: 2px; }
	.main-nav > .menu > li { position: relative; }
	.main-nav > .menu > li > a { padding: 8px 12px; font-size: .95rem; }
	.main-nav .sub-menu {
		position: absolute; top: 100%; left: 0; min-width: 240px; padding: 8px;
		background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
		box-shadow: var(--shadow);
	}
	.main-nav li:hover > .sub-menu, .main-nav li:focus-within > .sub-menu, .main-nav .is-open > .sub-menu { display: block; }
}

/* ---------- Layout pieces ---------- */
.site-main { min-height: 60vh; }
.hero { padding: 20px 0 8px; }
.hero-title { font-size: clamp(1.6rem, 5vw, 2.4rem); margin: .2em 0 .25em; }
.hero-lead { color: var(--muted); font-size: 1.05rem; margin: 0 0 4px; max-width: 70ch; }
.breadcrumbs { font-size: .85rem; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; }
.breadcrumbs a { color: var(--muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--accent); }
.content-wrap { padding-top: 24px; padding-bottom: 48px; }
.page-title { font-size: clamp(1.6rem, 5vw, 2.2rem); margin: .3em 0 .6em; }
.prose { max-width: 75ch; }
.prose p, .prose li { color: var(--text); }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin: .3em 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 1em 0; font-size: .95rem; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--border); padding: 8px 10px; text-align: left; vertical-align: top; }
.prose th { background: var(--surface-2); }
.prose code { background: var(--surface-2); padding: 2px 6px; border-radius: 6px; font-size: .92em; }
.prose .example { font-family: var(--font-glyph); }
.prose .callout { background: var(--accent-soft); border-left: 4px solid var(--accent); padding: 12px 16px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.post-meta { color: var(--muted); font-size: .9rem; }
.post-card { padding: 16px 0; border-bottom: 1px solid var(--border); }
.post-card h2 { margin: 0 0 4px; font-size: 1.2rem; }

/* FAQ */
.faq { margin-top: 2.5em; }
.faq-item { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); margin: 10px 0; }
.faq-item summary { cursor: pointer; padding: 14px 44px 14px 16px; font-weight: 600; list-style: none; position: relative; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; position: absolute; right: 16px; top: 12px; font-size: 1.3rem; color: var(--muted); }
.faq-item[open] summary::after { content: "–"; }
.faq-answer { padding: 0 16px 6px; color: var(--muted); }

/* Related tools */
.related { margin-top: 48px; }
.related-grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 600px) { .related-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .related-grid { grid-template-columns: repeat(3, 1fr); } }
.related-card {
	display: flex; flex-direction: column; gap: 4px; padding: 16px;
	background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
	text-decoration: none; color: var(--text); transition: border-color .15s, transform .15s;
}
.related-card:hover { border-color: var(--accent); transform: translateY(-2px); color: var(--text); }
.related-card span { color: var(--muted); font-size: .9rem; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); margin-top: 32px; padding-top: 36px; }
.footer-grid { display: grid; gap: 28px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr; } }
.footer-about p { color: var(--muted); font-size: .95rem; max-width: 46ch; }
.footer-title { font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 6px 0 10px; }
.footer-menu { list-style: none; padding: 0; margin: 0; }
.footer-menu a { display: inline-block; padding: 5px 0; color: var(--text); text-decoration: none; }
.footer-menu a:hover { color: var(--accent); }
.footer-bottom { border-top: 1px solid var(--border); margin-top: 28px; padding-top: 16px; padding-bottom: 24px; font-size: .85rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 24px; justify-content: space-between; }
.footer-bottom p { margin: 0; }

/* ---------- Buttons & toast (shared) ---------- */
.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 6px;
	min-height: 42px; padding: 0 16px; border-radius: 12px; border: 1px solid transparent;
	font-weight: 600; cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s, color .15s;
}
.btn--primary { background: var(--accent); color: var(--accent-text); }
.btn--primary:hover { background: var(--accent-hover); }
.btn--ghost { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }
.toast {
	position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px);
	background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 999px;
	font-weight: 600; font-size: .95rem; opacity: 0; pointer-events: none; z-index: 200;
	transition: opacity .2s, transform .2s; max-width: calc(100% - 32px); text-align: center;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.notice { background: var(--surface-2); padding: 12px 16px; border-radius: var(--radius-sm); }
