:root {
	--bg: #0b1020;
	--card: #141a2f;
	--text: #e6e9ef;
	--muted: #a9b0c0;
	--accent: #6ea8fe;
	--accent-2: #9bdbff;
	--border: #26304a;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
	margin: 0;
	font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
	background: var(--bg);
	color: var(--text);
	line-height: 1.6;
}

.container { width: min(100%, 960px); margin: 0 auto; padding: 0 16px; }

.site-header { position: sticky; top: 0; backdrop-filter: blur(6px); background: rgba(11,16,32,0.8); border-bottom: 1px solid var(--border); z-index: 10; }
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; }
.brand { color: var(--text); text-decoration: none; font-weight: 700; letter-spacing: .2px; }
.nav { display: flex; gap: 12px; }
.nav-link { color: var(--muted); text-decoration: none; padding: 6px 10px; border-radius: 6px; }
.nav-link:hover { color: var(--text); background: rgba(255,255,255,0.06); }

.section { padding: 40px 0; border-bottom: 1px solid var(--border); }
.lead { color: var(--muted); font-size: 1.1rem; }
.muted { color: var(--muted); }

.btn { display: inline-block; background: #1e263f; color: var(--text); border: 1px solid var(--border); padding: 8px 14px; border-radius: 8px; text-decoration: none; cursor: pointer; }
.btn:hover { background: #253055; }
.btn-accent { background: var(--accent); color: #0b1020; border-color: transparent; }
.btn-accent:hover { background: var(--accent-2); }

.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 16px; }

.code-block { background: #0f1428; border: 1px solid var(--border); border-radius: 10px; padding: 12px; overflow: auto; }
pre { margin: 0; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: 0.95rem; }

.quiz-list { display: grid; gap: 16px; padding-left: 1rem; }
.quiz-item label { display: block; margin: 6px 0; }
.answer { display: none; }

.site-footer { border-top: 1px solid var(--border); padding: 24px 0; color: var(--muted); }


/* === Enhancements for a prettier UI === */
html { scroll-behavior: smooth; }

/* Background accents */
body {
	background:
		radial-gradient(1200px 600px at 20% -10%, rgba(110,168,254,0.12), transparent 60%),
		radial-gradient(900px 500px at 90% 0%, rgba(124,247,212,0.10), transparent 60%),
		var(--bg);
}

/* Headings and typography */
h1, h2, h3 { line-height: 1.2; margin: 0 0 12px; }
h1 { font-size: clamp(1.8rem, 2.2vw + 1.3rem, 3rem); font-weight: 700; }
h2 { font-size: clamp(1.3rem, 1.2vw + 1rem, 1.8rem); font-weight: 700; }
h3 { font-size: 1.1rem; font-weight: 600; color: var(--text); }
p { margin: 0.5rem 0 1rem; }
ul { padding-left: 1.1rem; }

/* Hero glow for home */
#home.section { position: relative; isolation: isolate; }
#home.section::before {
	content: "";
	position: absolute; inset: -20px -20px auto -20px; height: 220px; z-index: -1;
	background: radial-gradient(600px 200px at 10% 20%, rgba(110,168,254,0.25), transparent 60%),
	            radial-gradient(500px 200px at 80% 10%, rgba(124,247,212,0.20), transparent 60%);
	border-bottom: 1px solid var(--border);
}

/* Buttons */
.btn { background: linear-gradient(180deg, #1f2a4d, #1a2342); padding: 10px 16px; border-radius: 10px; transition: transform .1s ease, background .2s ease, box-shadow .2s ease; box-shadow: 0 2px 0 rgba(255,255,255,0.05) inset; }
.btn:hover { background: linear-gradient(180deg, #25325b, #1d2748); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-accent { background: linear-gradient(180deg, var(--accent-2), var(--accent)); color: #061124; border-color: transparent; box-shadow: 0 8px 20px rgba(110,168,254,0.25); }
.btn-accent:hover { background: linear-gradient(180deg, #aee6ff, var(--accent-2)); }

/* Cards */
.card { background: linear-gradient(180deg, var(--card), #0f152a); border-radius: 14px; box-shadow: 0 10px 30px rgba(0,0,0,0.35); transition: transform .15s ease, box-shadow .2s ease, border-color .2s ease; }
.card:hover { transform: translateY(-2px); box-shadow: 0 12px 34px rgba(0,0,0,0.45); border-color: #33406a; }
.card-grid { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }

/* Code blocks */
.code-block { border-radius: 12px; padding: 14px; box-shadow: 0 6px 18px rgba(0,0,0,0.3) inset; }
code { color: #cde3ff; }

/* Quiz feedback */
.quiz-item { background: #0f1428; border-radius: 12px; padding: 14px; }
.quiz-item.correct { border-color: rgba(31,189,108,0.6); box-shadow: 0 0 0 3px rgba(31,189,108,0.15); background: linear-gradient(180deg, rgba(31,189,108,0.08), #0f1428); }
.quiz-item.incorrect { border-color: rgba(239,95,107,0.55); box-shadow: 0 0 0 3px rgba(239,95,107,0.12); background: linear-gradient(180deg, rgba(239,95,107,0.07), #0f1428); }

/* Active nav link */
.nav-link.active { color: #000814; background: var(--accent); }

/* Section spacing and anchor offset */
.section { padding: 56px 0; }
.section > h1, .section > h2 { scroll-margin-top: 84px; }

/* Links */
a { color: var(--accent-2); }
a:hover { color: var(--accent); }

/* Responsive tweaks */
@media (max-width: 640px) {
	.nav { gap: 4px; }
	.nav-link { padding: 6px 10px; }
	.section { padding: 44px 0; }
	.container { padding: 0 16px; }
}

/* Terminal styles */
.terminal-controls { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 12px; }
#fetch-url { flex: 1 1 280px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: #10192f; color: var(--text); }
#fetch-url:focus { outline: 2px solid var(--accent); }
.manual-run { margin: 0 0 14px; display: flex; flex-direction: column; gap: 8px; }
#manual-code { width: 100%; resize: vertical; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); font-family: ui-monospace, monospace; background: #10192f; color: var(--text); }
#manual-code:focus { outline: 2px solid var(--accent); }
.terminal { background:#111b2e; color:#e6e9ef; font:14px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; padding:12px 14px; border-radius:12px; max-height:360px; overflow:auto; border:1px solid var(--border); box-shadow:0 0 0 1px #182538, 0 0 14px #000 inset; }
.terminal .error { color:#ff5f56; }
.terminal .warn { color:#ffaa2b; }
.terminal .out { color:#6ad76a; }
.terminal .muted { color:#5d6a80; font-style:italic; }
.terminal .sep { color:#4da3ff; }
