/* Pranav Innovates reel guides. The reels' stage (lavender-white, dot grid, Pixel, orange) as a calm reading page. */
:root {
	--paper: #F3F4FA;
	--surface: #FFFFFF;
	--ink: #12141C;
	--ink2: #464C63;
	--muted: #686E85;
	--line: #E0E2EB;
	--line2: #ECEEF4;
	--dot: rgba(30, 40, 90, 0.085);
	--accent: #EE5A24;        /* Pixel and graphic marks only */
	--accent-text: #B83E12;   /* links and keywords: 6.8:1 on white */
	--kw-bg: #FFEFE6;
	--inline-code: #EEF0F6;
	--code: #161821;
	--code-ink: #E6E8F0;
	--code-dim: #8E94AA;
	--shadow: 0 1px 2px rgba(18, 20, 28, 0.04), 0 18px 40px -28px rgba(18, 20, 28, 0.22);
	--serif: 'Instrument Serif', 'Iowan Old Style', Georgia, serif;
	--sans: 'Geist', ui-sans-serif, -apple-system, 'Segoe UI', sans-serif;
	--mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace;
	color-scheme: light;
}
@media (prefers-color-scheme: dark) {
	:root {
		--paper: #14161D;
		--surface: #1B1E27;
		--ink: #ECEDF3;
		--ink2: #B7BBCB;
		--muted: #8E93A6;
		--line: #2B2F3B;
		--line2: #252833;
		--dot: rgba(200, 210, 255, 0.07);
		--accent-text: #FF8F63;
		--kw-bg: #3A2117;
		--inline-code: #272B36;
		--code: #0F1117;
		--shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 18px 40px -28px rgba(0, 0, 0, 0.7);
		color-scheme: dark;
	}
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	font: 400 17px/1.65 var(--sans);
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
	position: relative;
	overflow-x: hidden;
}
/* The reels' dot grid, fading out below the hero. */
body::before {
	content: '';
	position: absolute;
	inset: 0 0 auto 0;
	height: 640px;
	background-image: radial-gradient(var(--dot) 1.2px, transparent 1.6px);
	background-size: 24px 24px;
	-webkit-mask-image: linear-gradient(#000 30%, transparent);
	mask-image: linear-gradient(#000 30%, transparent);
	pointer-events: none;
	z-index: 0;
}
body > * { position: relative; z-index: 1; }

a { color: var(--accent-text); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px;
	text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); overflow-wrap: anywhere; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 3px; border-radius: 4px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------------------------------------------------------------- top bar */
.top {
	max-width: 1104px;
	margin: 0 auto;
	padding: 20px 32px 0;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: 15px; letter-spacing: -0.01em; }
.social { display: flex; gap: 20px; font-size: 15px; }
.social a { color: var(--ink2); text-decoration: none; }
.social a:hover { color: var(--ink); }
.pixel { width: 64px; height: 64px; flex: none; display: block; }
.pixel-sm { width: 26px; height: 26px; }

/* ---------------------------------------------------------------- shared grid: contents rail + reading column */
.hero, .layout, .more, .foot, .index {
	max-width: 1104px;
	margin: 0 auto;
	padding: 0 32px;
	display: grid;
	grid-template-columns: 200px minmax(0, 760px);
	column-gap: 48px;
	justify-content: center;
}
.hero > *, .more > *, .foot > *, .index > * { grid-column: 2; }

/* ---------------------------------------------------------------- hero */
.hero { padding-top: 56px; padding-bottom: 36px; }
.greet { display: flex; align-items: flex-end; gap: 14px; }
.greet .pixel { animation: hop 0.7s cubic-bezier(.3, 1.6, .5, 1) 0.15s both; }
.bubble {
	margin: 0 0 18px;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: 18px 18px 18px 4px;
	padding: 11px 16px;
	font-size: 16px;
	line-height: 1.45;
	color: var(--ink2);
	box-shadow: var(--shadow);
	max-width: 34ch;
	animation: rise 0.45s ease-out 0.45s both;
}
.kw-inline { color: var(--accent-text); font-weight: 600; }
h1 {
	font: 400 clamp(42px, 6.4vw, 66px)/1.03 var(--serif);
	letter-spacing: -0.012em;
	margin: 26px 0 16px;
	text-wrap: balance;
	color: var(--ink);
}
.lede { margin: 0; font-size: 17.5px; color: var(--ink2); max-width: 60ch; }
.lede em { font-style: normal; }

/* ---------------------------------------------------------------- the guide */
.layout { align-items: start; }
.toc { grid-column: 1; position: sticky; top: 28px; padding-top: 34px; font-size: 14px; }
.toc-h { margin: 0 0 10px; color: var(--muted); font-weight: 500; font-size: 13px; }
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc a { display: block; padding: 6px 0 6px 14px; border-left: 2px solid var(--line); color: var(--ink2); text-decoration: none; line-height: 1.35; }
.toc a:hover { color: var(--ink); }
.toc a.on { border-left-color: var(--accent); color: var(--ink); font-weight: 500; }

.sheet {
	grid-column: 2;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: 20px;
	box-shadow: var(--shadow);
	padding: 4px 48px 36px;
	min-width: 0;
}
.intro { padding-top: 16px; }
.sec { padding: 36px 0 8px; border-top: 1px solid var(--line2); scroll-margin-top: 20px; }
.intro + .sec, .sheet > .sec:first-child { border-top: 0; }
.sheet > .sec:first-child { padding-top: 32px; }

h2 { margin: 0 0 14px; display: flex; align-items: flex-start; gap: 14px; font-weight: 400; }
h2 .h-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
h2 .name { font: 600 23px/1.25 var(--sans); letter-spacing: -0.02em; color: var(--ink); }
h2 .desc { font-size: 17px; line-height: 1.45; color: var(--ink2); }
h2 .n { font: italic 400 48px/0.9 var(--serif); color: var(--accent-text); min-width: 26px; padding-top: 2px; }
h2 .stars {
	margin-left: auto;
	flex: none;
	font: 500 14px/1 var(--sans);
	font-variant-numeric: tabular-nums;
	color: var(--ink2);
	border: 1px solid var(--line);
	border-radius: 999px;
	padding: 6px 11px;
	margin-top: 4px;
	white-space: nowrap;
}
h2 code { font-size: 0.9em; }

.sheet p, .sheet ul, .sheet ol { margin: 14px 0; }
.sheet ul, .sheet ol { padding-left: 22px; }
.sheet li { margin: 7px 0; padding-left: 2px; }
.sheet li::marker { color: var(--muted); }
.sheet ol > li::marker { color: var(--ink2); font-weight: 600; font-variant-numeric: tabular-nums; }
strong { font-weight: 600; color: var(--ink); }
code {
	font: 400 0.86em/1.5 var(--mono);
	background: var(--inline-code);
	padding: 2px 6px;
	border-radius: 6px;
	overflow-wrap: anywhere;
}
.note { font-size: 15px; color: var(--muted); }
.note strong { color: var(--ink2); }
.sheet > .sec:last-child .note:first-of-type { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line2); }

/* Code: a dark terminal card with a copy button, like the reels' terminal windows. */
.code { margin: 18px 0; background: var(--code); border-radius: 14px; overflow: hidden; }
.code-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 6px 8px 6px 16px;
	font: 500 13px/1 var(--sans);
	color: var(--code-dim);
	border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
.copy {
	font: 500 13px/1 var(--sans);
	color: var(--code-ink);
	background: rgba(255, 255, 255, 0.08);
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: 8px;
	padding: 0 14px;
	height: 34px;
	cursor: pointer;
	transition: background-color 0.15s, color 0.15s;
}
.copy:hover { background: rgba(255, 255, 255, 0.14); }
.copy.done { color: #A6EBC0; border-color: rgba(166, 235, 192, 0.35); }
.code pre {
	margin: 0;
	padding: 14px 16px 16px;
	overflow-x: auto;
	font: 400 14px/1.65 var(--mono);
	color: var(--code-ink);
	tab-size: 2;
}
.code pre code { background: none; padding: 0; font: inherit; border-radius: 0; overflow-wrap: normal; }
.code .c { color: var(--code-dim); }

table { width: 100%; border-collapse: collapse; margin: 18px 0 6px; font-variant-numeric: tabular-nums; font-size: 16px; }
th { text-align: left; font-weight: 500; font-size: 14px; color: var(--muted); padding: 0 12px 8px 0; border-bottom: 1px solid var(--line); }
td { padding: 11px 12px 11px 0; border-bottom: 1px solid var(--line2); }
td:last-child, th:last-child { text-align: right; padding-right: 0; }

/* ---------------------------------------------------------------- more guides + index rows */
.more { padding-top: 56px; }
.more h2, .index-h { font: 400 34px/1.1 var(--serif); margin: 0 0 8px; display: block; }
.others, .rows { list-style: none; margin: 0; padding: 0; }
.others a {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 14px 0;
	border-bottom: 1px solid var(--line);
	color: var(--ink);
	text-decoration: none;
}
.others a:hover .o-title { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.kw {
	flex: none;
	font: 600 13px/1 var(--sans);
	letter-spacing: 0.02em;
	color: var(--accent-text);
	background: var(--kw-bg);
	border-radius: 999px;
	padding: 7px 11px;
	min-width: 72px;
	text-align: center;
}

.index { padding-bottom: 8px; }
.rows { border-top: 1px solid var(--line); }
.row {
	display: grid;
	grid-template-columns: 84px minmax(0, 1fr);
	column-gap: 18px;
	row-gap: 6px;
	padding: 26px 0;
	border-bottom: 1px solid var(--line);
	color: var(--ink);
	text-decoration: none;
}
.row .kw { align-self: start; margin-top: 6px; }
.row-main { display: flex; flex-direction: column; gap: 6px; }
.row-title { font: 400 30px/1.12 var(--serif); letter-spacing: -0.005em; text-wrap: balance; }
.row-blurb { color: var(--ink2); font-size: 16px; line-height: 1.5; }
.row-link { grid-column: 2; font-size: 14px; color: var(--accent-text); }
.row:hover .row-title { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 5px; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); }

.foot { padding-top: 48px; padding-bottom: 64px; font-size: 14px; color: var(--muted); }
.foot p { margin: 0; }

/* ---------------------------------------------------------------- motion: one hello on load, a blink now and then */
@keyframes hop { 0% { transform: translateY(14px) scale(.7); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes rise { from { transform: translateY(6px); opacity: 0; } to { transform: none; opacity: 1; } }
.blink { opacity: 0; animation: blink 6s steps(1) 2s infinite; }
@keyframes blink { 0%, 96% { opacity: 0; } 97%, 99% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation: none !important; transition: none !important; }
	html { scroll-behavior: auto; }
	.blink { opacity: 0; }
}

/* ---------------------------------------------------------------- phones and tablets */
@media (max-width: 1100px) {
	.hero, .layout, .more, .foot, .index { grid-template-columns: minmax(0, 760px); }
	.hero > *, .more > *, .foot > *, .index > *, .sheet { grid-column: 1; }
	.toc { display: none; }
}
@media (max-width: 640px) {
	body { font-size: 16.5px; }
	.top { padding: 14px 16px 0; }
	.social { gap: 16px; font-size: 14px; }
	.hero, .layout, .more, .foot, .index { padding-left: 16px; padding-right: 16px; }
	.hero { padding-top: 32px; padding-bottom: 26px; }
	.pixel { width: 52px; height: 52px; }
	.pixel-sm { width: 24px; height: 24px; }
	.bubble { font-size: 15px; margin-bottom: 14px; }
	h1 { margin-top: 20px; }
	.lede { font-size: 16.5px; }
	.sheet { padding: 0 18px 24px; border-radius: 16px; }
	.sec { padding-top: 30px; }
	h2 { gap: 11px; flex-wrap: wrap; }
	h2 .n { font-size: 40px; min-width: 20px; }
	h2 .name { font-size: 20px; }
	h2 .desc { font-size: 16px; }
	h2 .h-main { flex: 1 1 0; }
	h2 .stars { font-size: 13px; padding: 5px 9px; }
	.code { margin-left: -6px; margin-right: -6px; border-radius: 12px; }
	.code pre { font-size: 13px; padding: 12px 14px 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
	/* On a phone, a trailing comment goes on its own line instead of being scrolled off the right edge. */
	.code .gap { display: none; }
	.code .gap + .c { display: block; padding-left: 2ch; }
	.row { grid-template-columns: minmax(0, 1fr); padding: 22px 0; }
	.row .kw { justify-self: start; min-width: 0; margin-top: 0; }
	.row-link { grid-column: 1; }
	.row-title { font-size: 27px; }
	.more h2, .index-h { font-size: 30px; }
	.others a { gap: 12px; }
}
