/* ============ Veil web proxy — dark theme ============ */
:root {
	--bg: #0b0e17;
	--bg-soft: #11152a;
	--panel: rgba(255, 255, 255, 0.04);
	--border: rgba(255, 255, 255, 0.09);
	--text: #e8ebf5;
	--muted: #8b91a8;
	--accent-a: #7c6cff;
	--accent-b: #00d4ff;
	--danger: #ff5c7a;
	--radius: 14px;
}

* {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

/* never let author display rules override the hidden attribute */
[hidden] {
	display: none !important;
}

html,
body {
	height: 100%;
}

body {
	font-family:
		"Segoe UI",
		system-ui,
		-apple-system,
		sans-serif;
	background:
		radial-gradient(1100px 500px at 15% -10%, rgba(124, 108, 255, 0.16), transparent 60%),
		radial-gradient(900px 450px at 90% 0%, rgba(0, 212, 255, 0.10), transparent 55%),
		var(--bg);
	color: var(--text);
}

/* ---------- home ---------- */
.home {
	min-height: 100vh;
	display: flex;
	flex-direction: column;
}

.hero {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 18px;
	padding: 48px 20px 32px;
}

.brand {
	display: flex;
	align-items: center;
	gap: 16px;
}

.brand-mark {
	width: 52px;
	height: 52px;
	filter: drop-shadow(0 6px 24px rgba(124, 108, 255, 0.45));
}

.brand h1 {
	font-size: 2.4rem;
	font-weight: 700;
	letter-spacing: 0.02em;
}

.tagline {
	color: var(--muted);
	font-size: 1.05rem;
}

/* address bar */
.address-bar {
	display: flex;
	align-items: center;
	width: min(640px, 100%);
	background: var(--bg-soft);
	border: 1px solid var(--border);
	border-radius: 999px;
	padding: 6px 6px 6px 18px;
	transition: border-color 0.15s, box-shadow 0.15s;
}

.address-bar:focus-within {
	border-color: rgba(124, 108, 255, 0.6);
	box-shadow: 0 0 0 4px rgba(124, 108, 255, 0.15);
}

.ab-icon {
	width: 18px;
	height: 18px;
	color: var(--muted);
	flex-shrink: 0;
}

#address {
	flex: 1;
	background: none;
	border: none;
	outline: none;
	color: var(--text);
	font-size: 1rem;
	padding: 10px 14px;
}

#address::placeholder {
	color: var(--muted);
}

.go-btn {
	border: none;
	border-radius: 999px;
	padding: 10px 26px;
	font-size: 0.95rem;
	font-weight: 600;
	color: #fff;
	cursor: pointer;
	background: linear-gradient(135deg, var(--accent-a), var(--accent-b));
	transition: filter 0.15s, transform 0.05s;
}

.go-btn:hover {
	filter: brightness(1.12);
}

.go-btn:active {
	transform: scale(0.97);
}

/* engine picker */
.engine-picker {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-top: 6px;
	flex-wrap: wrap;
	justify-content: center;
}

.engine-label {
	color: var(--muted);
	font-size: 0.85rem;
}

.engine-chip {
	border: 1px solid var(--border);
	background: var(--panel);
	color: var(--muted);
	border-radius: 999px;
	padding: 6px 14px;
	font-size: 0.85rem;
	cursor: pointer;
	transition: all 0.15s;
}

.engine-chip:hover {
	color: var(--text);
	border-color: rgba(255, 255, 255, 0.25);
}

.engine-chip.is-active {
	color: #fff;
	border-color: transparent;
	background: linear-gradient(135deg, rgba(124, 108, 255, 0.85), rgba(0, 212, 255, 0.85));
}

.engine-hint {
	color: var(--muted);
	font-size: 0.8rem;
	opacity: 0.8;
}

/* error box */
.error {
	width: min(640px, 100%);
	background: rgba(255, 92, 122, 0.08);
	border: 1px solid rgba(255, 92, 122, 0.35);
	border-radius: var(--radius);
	padding: 14px 18px;
}

.error p {
	color: var(--danger);
	font-weight: 600;
	font-size: 0.95rem;
}

.error pre {
	margin-top: 6px;
	color: var(--muted);
	font-size: 0.8rem;
	white-space: pre-wrap;
	word-break: break-word;
}

/* quick links */
.quick-links {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
	gap: 12px;
	width: min(640px, 100%);
	margin-top: 22px;
}

.q-link {
	display: flex;
	align-items: center;
	gap: 10px;
	background: var(--panel);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 12px 14px;
	color: var(--text);
	font-size: 0.92rem;
	cursor: pointer;
	transition: all 0.15s;
}

.q-link:hover {
	border-color: rgba(124, 108, 255, 0.55);
	background: rgba(124, 108, 255, 0.08);
	transform: translateY(-1px);
}

.q-ico {
	width: 28px;
	height: 28px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 8px;
	font-size: 0.85rem;
	font-weight: 700;
	flex-shrink: 0;
}

.q-yt { background: #ff0000; color: #fff; }
.q-ddg { background: #de5833; color: #fff; font-size: 1rem; }
.q-g { background: #fff; color: #4285f4; }
.q-wiki { background: #fff; color: #000; }
.q-reddit { background: #ff4500; color: #fff; font-size: 0.7rem; }
.q-x { background: #000; color: #fff; border: 1px solid #333; }

/* ---------- top navigation ---------- */
.topnav {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
	padding: 12px 22px;
	background: rgba(11, 14, 23, 0.85);
	backdrop-filter: blur(8px);
	border-bottom: 1px solid var(--border);
	position: sticky;
	top: 0;
	z-index: 20;
}

.nav-brand {
	display: inline-flex;
	align-items: center;
	gap: 9px;
	color: var(--text);
	font-weight: 700;
	text-decoration: none;
	font-size: 1rem;
	white-space: nowrap;
}

.nav-logo {
	width: 18px;
	height: 18px;
	border-radius: 5px;
	background: linear-gradient(135deg, var(--accent-a), var(--accent-b));
}

.nav-links {
	display: flex;
	gap: 18px;
	flex-wrap: wrap;
}

.nav-links a {
	color: var(--muted);
	text-decoration: none;
	font-size: 0.9rem;
}

.nav-links a:hover {
	color: var(--text);
}

/* ---------- article / guides pages ---------- */
.article {
	max-width: 760px;
	margin: 0 auto;
	padding: 34px 20px 60px;
	color: var(--text);
}

.article .crumbs {
	color: var(--muted);
	font-size: 0.85rem;
	margin-bottom: 14px;
}

.article .crumbs a {
	color: var(--accent-a);
	text-decoration: none;
}

.article h1 {
	font-size: 2rem;
	margin: 6px 0 8px;
}

.article .meta {
	color: var(--muted);
	font-size: 0.85rem;
	margin-bottom: 24px;
}

.article p,
.article li {
	color: var(--muted);
	line-height: 1.75;
}

.article h2 {
	color: var(--text);
	font-size: 1.35rem;
	margin: 28px 0 10px;
}

.article h3 {
	color: var(--text);
	font-size: 1.1rem;
	margin: 22px 0 8px;
}

.article a {
	color: var(--accent-a);
}

.article table.cmp {
	border-collapse: collapse;
	width: 100%;
	margin: 14px 0;
	font-size: 0.9rem;
}

.article table.cmp th,
.article table.cmp td {
	border: 1px solid var(--border);
	padding: 8px 12px;
	color: var(--muted);
	text-align: left;
}

.article table.cmp th {
	color: var(--text);
	background: var(--panel);
}

.article code {
	background: var(--bg-soft);
	border: 1px solid var(--border);
	border-radius: 5px;
	padding: 1px 6px;
	font-size: 0.85em;
}

.article ul,
.article ol {
	padding-left: 24px;
	margin: 10px 0;
}

.article .tool-links {
	line-height: 2;
}

.article .rel-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 12px;
	margin: 12px 0 30px;
}

.rel-card {
	display: flex;
	flex-direction: column;
	gap: 6px;
	background: var(--panel);
	border: 1px solid var(--border);
	border-radius: 12px;
	padding: 14px 16px;
	text-decoration: none;
	transition: border-color 0.15s;
}

.rel-card:hover {
	border-color: rgba(124, 108, 255, 0.55);
}

.rel-card strong {
	color: var(--text);
	font-size: 0.95rem;
}

.rel-card span {
	color: var(--muted);
	font-size: 0.82rem;
	line-height: 1.5;
}

.rel-card em {
	color: var(--muted);
	font-size: 0.75rem;
}

.chip-link {
	display: inline-block;
	background: var(--panel);
	border: 1px solid var(--border);
	border-radius: 999px;
	padding: 6px 14px;
	color: var(--muted);
	text-decoration: none;
	font-size: 0.85rem;
	margin: 0 6px 6px 0;
}

.chip-link:hover {
	color: var(--text);
	border-color: rgba(124, 108, 255, 0.55);
}

@media (max-width: 640px) {
	.nav-links { gap: 12px; }
	.nav-links a { font-size: 0.82rem; }
}

/* ---------- home SEO content ---------- */
.seo-home {
	width: min(760px, 100%);
	margin-top: 34px;
	padding-top: 26px;
	border-top: 1px solid var(--border);
	font-size: 0.95rem;
	line-height: 1.7;
	color: var(--muted);
}

.seo-home h2 {
	color: var(--text);
	font-size: 1.5rem;
	margin: 18px 0 10px;
}

.seo-home h3 {
	color: var(--text);
	font-size: 1.1rem;
	margin: 22px 0 8px;
}

.seo-home a {
	color: var(--accent-a);
	text-decoration: none;
}

.seo-home a:hover {
	text-decoration: underline;
}

.seo-links {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 10px 0;
}

.seo-links a {
	display: inline-block;
	background: var(--panel);
	border: 1px solid var(--border);
	border-radius: 999px;
	padding: 6px 14px;
	font-size: 0.85rem;
	transition: all 0.15s;
}

.seo-links a:hover {
	border-color: rgba(124, 108, 255, 0.55);
	color: var(--text);
	text-decoration: none;
}

.seo-home .faq-item {
	border: 1px solid var(--border);
	background: var(--panel);
	border-radius: 10px;
	padding: 12px 16px;
	margin: 8px 0;
}

.seo-home .faq-item summary {
	cursor: pointer;
	font-weight: 600;
	color: var(--text);
}

.seo-home .faq-item p {
	margin-top: 8px;
	line-height: 1.6;
}

/* footer */
.footer {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
	padding: 18px 24px;
	color: var(--muted);
	font-size: 0.78rem;
	border-top: 1px solid var(--border);
}

/* ---------- proxy view ---------- */
.proxy-view {
	position: fixed;
	inset: 0;
	display: flex;
	flex-direction: column;
	z-index: 10;
	background: var(--bg);
}

.toolbar {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 12px;
	background: var(--bg-soft);
	border-bottom: 1px solid var(--border);
}

.tb-btn {
	border: 1px solid var(--border);
	background: var(--panel);
	color: var(--text);
	border-radius: 9px;
	padding: 7px 12px;
	font-size: 0.88rem;
	cursor: pointer;
	transition: all 0.15s;
	white-space: nowrap;
}

.tb-btn:hover {
	border-color: rgba(124, 108, 255, 0.55);
}

.tb-home {
	font-weight: 700;
	color: #fff;
	background: linear-gradient(135deg, rgba(124, 108, 255, 0.85), rgba(0, 212, 255, 0.85));
	border-color: transparent;
}

.tb-switch {
	color: #ffb454;
	border-color: rgba(255, 180, 84, 0.4);
}

.tb-address {
	flex: 1;
	display: flex;
	gap: 6px;
	min-width: 120px;
}

#tb-address {
	flex: 1;
	background: var(--bg);
	border: 1px solid var(--border);
	border-radius: 9px;
	padding: 7px 12px;
	color: var(--text);
	font-size: 0.88rem;
	outline: none;
	min-width: 0;
}

#tb-address:focus {
	border-color: rgba(124, 108, 255, 0.6);
}

.tb-badge {
	font-size: 0.72rem;
	color: var(--muted);
	border: 1px solid var(--border);
	border-radius: 999px;
	padding: 4px 10px;
	white-space: nowrap;
}

.frame-wrap {
	flex: 1;
	position: relative;
	display: flex;
	flex-direction: column;
	min-height: 0;
}

.frame-container {
	flex: 1;
	position: relative;
	background: var(--bg);
}

.frame-container iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: none;
	background: #fff;
}

/* launching overlay (the "Proxy is launching..." moment) */
.launch-overlay {
	position: absolute;
	inset: 0;
	z-index: 5;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 18px;
	background: var(--bg);
}

.launch-spinner {
	width: 46px;
	height: 46px;
	border-radius: 50%;
	border: 5px solid rgba(255, 255, 255, 0.1);
	border-top-color: var(--accent-a);
	animation: veil-spin 0.9s linear infinite;
}

@keyframes veil-spin {
	to {
		transform: rotate(360deg);
	}
}

.launch-text {
	color: var(--muted);
	font-size: 0.95rem;
}

.launch-dots::after {
	content: "";
	animation: veil-dots 1.4s steps(4, end) infinite;
}

@keyframes veil-dots {
	0% { content: ""; }
	25% { content: "."; }
	50% { content: ".."; }
	75% { content: "..."; }
	100% { content: ""; }
}

/* ---------- responsive ---------- */
@media (max-width: 560px) {
	.brand h1 { font-size: 1.8rem; }
	.tagline { text-align: center; padding: 0 12px; }
	.quick-links { grid-template-columns: repeat(2, 1fr); }
	.tb-switch { display: none; } /* engine switching still available via chips after going home */
	.footer { justify-content: center; }
}
