/* ============================================================
   Harsh Gaur — portfolio
   Hand-written. No framework, no webfont, no network on first paint.
   ============================================================ */

/* ---------- tokens: dark is the default ---------- */
:root {
	--bg:          #17191E;
	--bg-raised:   #1E2127;
	--bg-card:     #1C1F25;
	--border:      #2B2F37;
	--border-hi:   #3E444E;
	--text:        #EDEAE6;
	--muted:       #A49E96;
	--dim:         #7C766E;
	--accent:      #E2705E;
	--accent-soft: rgba(226, 112, 94, 0.11);
	--accent-line: 226, 112, 94;
	--glow:        rgba(226, 112, 94, 0.055);
	--shadow:      0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.25);
	--radius:      12px;
	--maxw:        940px;
	--ease:        cubic-bezier(.22,.61,.36,1);
}

:root[data-theme="light"] {
	--bg:          #FBFAF9;
	--bg-raised:   #F3F1EE;
	--bg-card:     #FFFFFF;
	--border:      #E6E2DD;
	--border-hi:   #CFC8C0;
	--text:        #1F2125;
	--muted:       #6B655E;
	--dim:         #928B82;
	--accent:      #C4543F;
	--accent-soft: rgba(196, 84, 63, 0.075);
	--accent-line: 196, 84, 63;
	--glow:        rgba(196, 84, 63, 0.045);
	--shadow:      0 1px 2px rgba(16,24,40,.04), 0 8px 24px rgba(16,24,40,.06);
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: hidden; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
	             Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: 17px;
	line-height: 1.68;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
	overflow-x: hidden;
	transition: background-color .35s var(--ease), color .35s var(--ease);
}

h1, h2, h3, h4 { line-height: 1.2; margin: 0; font-weight: 650; letter-spacing: -0.02em; }
p { margin: 0 0 1em; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
img { max-width: 100%; height: auto; display: block; }
ul { margin: 0; padding: 0; list-style: none; }
code, .mono, .stat-num, .eyebrow, .tag, .meta {
	font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* ---------- layout ---------- */
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
section { padding: 88px 0; position: relative; }
section + section { border-top: 1px solid var(--border); }

.eyebrow {
	font-size: 12.5px;
	letter-spacing: .16em;
	text-transform: uppercase;
	color: var(--dim);
	margin-bottom: 16px;
	display: block;
}
.section-title { font-size: clamp(26px, 3.8vw, 36px); margin-bottom: 10px; }
.section-sub { color: var(--muted); max-width: 62ch; margin-bottom: 40px; font-size: 17px; }

/* ---------- skip link ---------- */
.skip {
	position: absolute; left: -9999px; top: 0; z-index: 100;
	background: var(--accent); color: var(--bg);
	padding: 10px 16px; border-radius: 0 0 8px 0; font-size: 14px; font-weight: 600;
}
.skip:focus { left: 0; }

/* ---------- scroll progress ---------- */
.progress {
	position: fixed; top: 0; left: 0; height: 2px; width: 0;
	background: var(--accent); z-index: 60;
	transition: width .1s linear;
}

/* ---------- cursor glow (ambient, behind content) ---------- */
.cursor-glow {
	position: fixed; top: 0; left: 0; z-index: 0;
	width: 560px; height: 560px; border-radius: 50%;
	background: radial-gradient(circle, var(--glow) 0%, transparent 66%);
	pointer-events: none; opacity: 0;
	transition: opacity .45s var(--ease);
	will-change: transform;
}
@media (pointer: coarse) { .cursor-glow { display: none; } }

/* ---------- nav ---------- */
.nav {
	position: sticky; top: 0; z-index: 50;
	background: color-mix(in srgb, var(--bg) 85%, transparent);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	/* Always drawn, in both themes, so the header is separated from the page
	   even at scroll position zero. It only deepens once content runs under it. */
	border-bottom: 1px solid var(--border);
	transition: border-color .3s var(--ease), box-shadow .3s var(--ease);
}
.nav.scrolled {
	border-bottom-color: var(--border-hi);
	box-shadow: 0 1px 12px rgba(0, 0, 0, .16);
}
:root[data-theme="light"] .nav.scrolled { box-shadow: 0 1px 12px rgba(31, 33, 37, .07); }
.nav-in {
	max-width: var(--maxw); margin: 0 auto; padding: 0 24px;
	min-height: 68px;
	display: flex; align-items: center; gap: 28px;
}
.brand {
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
	font-size: 20px; font-weight: 650; color: var(--text);
	letter-spacing: -.02em;
	/* mono metrics sit high in the box; line-height 1 plus flex centring
	   puts the wordmark on the same optical line as the links and toggle */
	line-height: 1; display: flex; align-items: center;
}
.brand:hover { text-decoration: none; color: var(--accent); }
.nav-links { display: flex; gap: 26px; margin-left: auto; align-items: center; }
.nav-links a {
	font-size: 15.5px; font-weight: 500; color: var(--muted);
	line-height: 1; display: flex; align-items: center;
	transition: color .2s var(--ease);
}
.nav-links a:hover { color: var(--text); text-decoration: none; }

/* On a narrow phone the four links plus the toggle no longer fit beside the
   wordmark. The page is one continuous scroll, so the links are the part that
   can go — the theme toggle stays. */
@media (max-width: 560px) {
	.nav-in { gap: 12px; padding: 0 20px; min-height: 60px; }
	.brand { font-size: 18px; }
	.nav-links { gap: 0; }
	.nav-links a { display: none; }
}

.icon-btn {
	background: none; border: 1px solid var(--border); color: var(--muted);
	width: 38px; height: 38px; border-radius: 9px; cursor: pointer;
	display: grid; place-items: center; padding: 0;
	transition: border-color .2s var(--ease), color .2s var(--ease), background-color .2s var(--ease);
}
.icon-btn:hover { border-color: var(--border-hi); color: var(--text); background: var(--bg-raised); }
.icon-btn svg { width: 17px; height: 17px; }
:root[data-theme="light"] .moon { display: none; }
:root:not([data-theme="light"]) .sun { display: none; }

/* ---------- hero ---------- */
.hero {
	position: relative;
	min-height: min(88vh, 760px);
	display: flex; align-items: center;
	padding: 80px 0 64px;
	border-top: 0;
	overflow: hidden;
}
#field {
	position: absolute; inset: 0;
	width: 100%; height: 100%;
	z-index: 0; pointer-events: none;
}
.hero-in { position: relative; z-index: 1; width: 100%; }

.hero-tag {
	display: block;
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
	font-size: 14px; letter-spacing: .19em; text-transform: uppercase;
	color: var(--accent); font-weight: 600;
	margin-bottom: 20px;
}

.hero h1 {
	font-size: clamp(42px, 8.4vw, 74px);
	letter-spacing: -0.038em;
	line-height: 1.03;
	margin-bottom: 18px;
}
.hero-role {
	font-size: clamp(18px, 2.6vw, 23px);
	color: var(--text); font-weight: 550;
	margin-bottom: 20px;
}
.hero-role .accent { color: var(--accent); }
.hero-pitch {
	font-size: clamp(16.5px, 2.1vw, 19px);
	color: var(--muted); max-width: 58ch; margin-bottom: 36px;
	line-height: 1.6;
}
.hero-pitch strong { color: var(--text); font-weight: 550; }

.cta-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 44px; }
.btn {
	display: inline-flex; align-items: center; gap: 8px;
	font-size: 15.5px; font-weight: 550;
	padding: 11px 19px; border-radius: 10px;
	border: 1px solid var(--border); color: var(--text);
	background: var(--bg-raised);
	transition: border-color .2s var(--ease), transform .2s var(--ease), background-color .2s var(--ease);
}
.btn:hover { text-decoration: none; border-color: var(--border-hi); transform: translateY(-2px); }
.btn-primary {
	background: var(--accent); color: #1B0F0C; border-color: var(--accent);
	font-weight: 650;
}
:root[data-theme="light"] .btn-primary { color: #FFFFFF; }
.btn-primary:hover { filter: brightness(1.07); border-color: var(--accent); }
.btn svg { width: 16px; height: 16px; }

/* ---------- stats ---------- */
.stats {
	display: grid; grid-template-columns: repeat(4, 1fr);
	gap: 1px; background: var(--border);
	border: 1px solid var(--border); border-radius: var(--radius);
	overflow: hidden;
}
.stat { background: var(--bg-card); padding: 20px 22px; }
.stat-num {
	font-size: clamp(22px, 3vw, 28px); font-weight: 600;
	color: var(--text); letter-spacing: -.02em; display: block;
}
.stat-label {
	font-size: 12.5px; color: var(--muted); margin-top: 4px;
	letter-spacing: .02em; display: block; line-height: 1.4;
}
@media (max-width: 760px) {
	.stats { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- cards + per-card spotlight ---------- */
.card {
	position: relative;
	background: var(--bg-card);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 26px 28px;
	overflow: hidden;
	transition: border-color .25s var(--ease), transform .25s var(--ease);
	isolation: isolate;
}
/* the spotlight: a radial gradient parked at the pointer, inside the card */
.card::before {
	content: "";
	position: absolute; inset: 0; z-index: -1;
	background: radial-gradient(
		360px circle at var(--mx, 50%) var(--my, 0%),
		var(--accent-soft) 0%,
		transparent 62%
	);
	opacity: 0;
	transition: opacity .32s var(--ease);
	pointer-events: none;
}
.card:hover { border-color: var(--border-hi); transform: translateY(-2px); }
.card:hover::before { opacity: 1; }
@media (pointer: coarse) { .card::before { display: none; } .card:hover { transform: none; } }
@media (prefers-reduced-motion: reduce) { .card, .card::before { transition: none; } .card:hover { transform: none; } }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 720px) { .grid-2 { grid-template-columns: 1fr; } }

/* ---------- experience ---------- */
.job { position: relative; padding-bottom: 36px; }
.job:last-child { padding-bottom: 0; }
.job-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-bottom: 4px; }
.job-title { font-size: 20px; font-weight: 620; }
.job-meta { font-size: 14.5px; color: var(--muted); }
.job-co { font-size: 15.5px; color: var(--accent); margin-bottom: 18px; }
.bullets li {
	position: relative; padding-left: 22px; margin-bottom: 11px;
	font-size: 16px; color: var(--muted); line-height: 1.62;
}
.bullets li::before {
	content: ""; position: absolute; left: 5px; top: 11px;
	width: 5px; height: 5px; border-radius: 50%;
	background: var(--border-hi);
}
.bullets strong { color: var(--text); font-weight: 600; }

/* ---------- work themes ---------- */
.work-card h3 { font-size: 19px; margin-bottom: 9px; display: flex; align-items: center; gap: 10px; }
.work-card h3 .num {
	font-family: ui-monospace, Menlo, monospace;
	font-size: 12px; color: var(--accent);
	border: 1px solid var(--border); border-radius: 5px;
	padding: 2px 7px; font-weight: 500; flex: none;
}
.work-card p { font-size: 15.5px; color: var(--muted); margin-bottom: 14px; line-height: 1.6; }
.work-card .result {
	font-size: 15px; color: var(--text);
	border-left: 2px solid var(--accent); padding-left: 14px;
	margin-bottom: 14px; line-height: 1.6;
}
.tags { display: flex; flex-wrap: wrap; gap: 7px; }
.tag {
	font-size: 12.5px; color: var(--muted);
	border: 1px solid var(--border); border-radius: 6px;
	padding: 3px 9px; white-space: nowrap;
}

/* ---------- projects ---------- */
.proj-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 7px; }
.proj-head h3 { font-size: 19px; }
.badge {
	font-family: ui-monospace, Menlo, monospace;
	font-size: 11.5px; letter-spacing: .04em; text-transform: uppercase;
	padding: 3px 8px; border-radius: 5px; flex: none;
	border: 1px solid var(--border); color: var(--dim);
}
.badge-live { color: var(--accent); border-color: rgba(var(--accent-line), .35); background: var(--accent-soft); }
.proj-links { display: flex; gap: 16px; margin-top: 16px; font-size: 15px; }

/* ---------- skills ---------- */
.skill-row { padding: 18px 0; border-bottom: 1px solid var(--border); display: grid; grid-template-columns: 190px 1fr; gap: 20px; }
.skill-row:last-child { border-bottom: 0; }
.skill-cat { font-size: 14.5px; color: var(--dim); letter-spacing: .01em; padding-top: 1px; }
.skill-list { font-size: 16px; color: var(--text); line-height: 1.8; }
.skill-list .pri { color: var(--text); font-weight: 550; }
.skill-list .sec { color: var(--muted); }
@media (max-width: 680px) { .skill-row { grid-template-columns: 1fr; gap: 5px; } }

/* ---------- writing ---------- */
.post { padding: 20px 0; border-bottom: 1px solid var(--border); }
a.post { color: inherit; }
a.post:hover { text-decoration: none; }
a.post:hover h3 { color: var(--accent); }
a.post h3 { transition: color .2s var(--ease); }
.post:last-child { border-bottom: 0; }
.post-head { display: flex; align-items: baseline; gap: 11px; flex-wrap: wrap; margin-bottom: 4px; }
.post h3 { font-size: 18px; font-weight: 600; color: var(--text); }
.post p { font-size: 15.5px; color: var(--muted); margin: 0; line-height: 1.6; }
.post .badge { align-self: center; }

/* ---------- education + certs ---------- */
.edu-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.certs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.cert {
	font-size: 14px; color: var(--muted);
	border: 1px solid var(--border); border-radius: 8px;
	padding: 8px 13px; background: var(--bg-card);
	transition: border-color .2s var(--ease), color .2s var(--ease);
}
.cert:hover { text-decoration: none; border-color: var(--border-hi); color: var(--text); }

/* ---------- contact ---------- */
.contact-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 8px; }
@media (max-width: 620px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-row { display: flex; align-items: center; gap: 13px; font-size: 16px; }
.contact-row svg { width: 18px; height: 18px; color: var(--dim); flex: none; }
.contact-row span { color: var(--muted); }
.avail {
	margin-top: 28px; padding: 22px 24px;
	border: 1px solid var(--border); border-left: 2px solid var(--accent);
	border-radius: var(--radius); background: var(--bg-card);
	font-size: 15.5px; color: var(--muted); line-height: 1.7;
}
.avail strong { color: var(--text); font-weight: 600; }

/* ---------- footer ---------- */
footer {
	border-top: 1px solid var(--border);
	padding: 32px 0 46px;
	font-size: 14.5px; color: var(--dim);
}
.foot-in { display: flex; flex-wrap: wrap; gap: 10px 20px; align-items: center; justify-content: space-between; }
.foot-in a { color: var(--muted); }
.foot-note { font-size: 13.5px; color: var(--dim); margin-top: 12px; }

/* ---------- scroll reveal ---------- */
/* Hidden only when JS is actually running, so the page is fully readable
   without it (and in any crawler that does not execute scripts). */
.js .reveal { opacity: 0; transform: translateY(14px); }
.js .reveal.in { opacity: 1; transform: none; transition: opacity .6s var(--ease), transform .6s var(--ease); }
@media (prefers-reduced-motion: reduce) {
	.js .reveal { opacity: 1; transform: none; }
	.js .reveal.in { transition: none; }
}

/* ---------- print ---------- */
@media print {
	.nav, .progress, .cursor-glow, #field, .cta-row, .icon-btn { display: none !important; }
	body { background: #fff; color: #000; }
	section { padding: 18px 0; border-top: 1px solid #ccc; }
	.card { border: 1px solid #ccc; break-inside: avoid; }
	a { color: #000; }
}

/* ============================================================
   Sub-pages: about, writing index, article
   ============================================================ */

/* ---------- page header (non-home hero) ---------- */
.page-head {
	padding: 72px 0 40px;
	position: relative;
	overflow: hidden;
}
/* the dot field sits behind the header content on sub-pages,
   exactly as it does behind the landing banner on the index */
.page-head > .wrap { position: relative; z-index: 1; }
.page-head h1 {
	font-size: clamp(34px, 5.6vw, 52px);
	letter-spacing: -.035em; line-height: 1.05; margin-bottom: 16px;
}
.page-head .lead {
	font-size: clamp(16.5px, 2.1vw, 19px); color: var(--muted);
	max-width: 62ch; line-height: 1.62;
}

/* ---------- about: fact cards ---------- */
.facts {
	display: grid; grid-template-columns: repeat(3, 1fr);
	gap: 1px; background: var(--border);
	border: 1px solid var(--border); border-radius: var(--radius);
	overflow: hidden; margin-top: 8px;
}
.fact { background: var(--bg-card); padding: 20px 22px; }
.fact dt {
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
	font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase;
	color: var(--dim); margin-bottom: 7px;
}
.fact dd { margin: 0; font-size: 15.5px; color: var(--text); line-height: 1.5; }
.fact dd a { color: var(--accent); }
@media (max-width: 860px) { .facts { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .facts { grid-template-columns: 1fr; } }

/* ---------- about: narrative timeline ---------- */
.story { max-width: 68ch; }
.story p { font-size: 17px; color: var(--muted); line-height: 1.75; margin-bottom: 1.15em; }
.story p strong { color: var(--text); font-weight: 600; }
.story h3 {
	font-size: 20px; margin: 40px 0 6px; color: var(--text);
}
.story h3 + .when {
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
	font-size: 13px; color: var(--accent); margin-bottom: 14px; display: block;
	letter-spacing: .02em;
}

/* ---------- writing index ---------- */
.post-card {
	display: block; padding: 26px 28px;
	border: 1px solid var(--border); border-radius: var(--radius);
	background: var(--bg-card); position: relative; overflow: hidden;
	isolation: isolate;
	transition: border-color .25s var(--ease), transform .25s var(--ease);
}
.post-card::before {
	content: ""; position: absolute; inset: 0; z-index: -1;
	background: radial-gradient(360px circle at var(--mx, 50%) var(--my, 0%),
		var(--accent-soft) 0%, transparent 62%);
	opacity: 0; transition: opacity .32s var(--ease); pointer-events: none;
}
.post-card:hover { border-color: var(--border-hi); transform: translateY(-2px); text-decoration: none; }
.post-card:hover::before { opacity: 1; }
.post-card:hover h2 { color: var(--accent); }
@media (pointer: coarse) { .post-card::before { display: none; } .post-card:hover { transform: none; } }

.post-meta {
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
	font-size: 12px; letter-spacing: .09em; text-transform: uppercase;
	color: var(--dim); margin-bottom: 11px;
}
.post-card h2 {
	font-size: 21px; color: var(--text); margin-bottom: 9px;
	letter-spacing: -.02em; transition: color .2s var(--ease);
}
.post-card p { font-size: 15.5px; color: var(--muted); margin: 0; line-height: 1.6; }
.post-card .more {
	display: inline-block; margin-top: 14px;
	font-size: 14.5px; color: var(--accent); font-weight: 550;
}

/* ---------- article ---------- */
.article { max-width: 70ch; margin: 0 auto; }
.article-head { margin-bottom: 0; }
.article-head h1 {
	font-size: clamp(30px, 4.6vw, 44px);
	letter-spacing: -.032em; line-height: 1.12; margin-bottom: 18px;
}
.standfirst {
	font-size: clamp(17px, 2.2vw, 20px); color: var(--muted);
	line-height: 1.6; border-left: 2px solid var(--accent); padding-left: 16px;
}
.article-body { font-size: 17.5px; line-height: 1.78; color: var(--muted); }
.article-body p { margin-bottom: 1.2em; }
.article-body strong { color: var(--text); font-weight: 600; }
.article-body h2 {
	font-size: clamp(21px, 2.8vw, 27px); color: var(--text);
	margin: 48px 0 14px; letter-spacing: -.022em; line-height: 1.25;
}
.article-body h3 { font-size: 19px; color: var(--text); margin: 32px 0 10px; }
.article-body ul, .article-body ol { margin: 0 0 1.2em; padding-left: 0; }
.article-body li {
	position: relative; padding-left: 22px; margin-bottom: 10px; list-style: none;
}
.article-body li::before {
	content: ""; position: absolute; left: 5px; top: 12px;
	width: 5px; height: 5px; border-radius: 50%; background: var(--border-hi);
}
.article-body ol { counter-reset: n; }
.article-body ol li { counter-increment: n; }
.article-body ol li::before {
	content: counter(n) "."; background: none; border-radius: 0;
	width: auto; height: auto; top: 0; left: 0;
	font-family: ui-monospace, Menlo, monospace; font-size: 14px; color: var(--accent);
}
.article-body code {
	font-size: .88em; background: var(--bg-raised); color: var(--text);
	padding: 2px 6px; border-radius: 5px; border: 1px solid var(--border);
}
.article-body pre {
	background: var(--bg-raised); border: 1px solid var(--border);
	border-radius: var(--radius); padding: 18px 20px; overflow-x: auto;
	margin: 0 0 1.4em; font-size: 14.5px; line-height: 1.65;
}
.article-body pre code { background: none; border: 0; padding: 0; font-size: inherit; }
.callout {
	border: 1px solid var(--border); border-left: 2px solid var(--accent);
	border-radius: var(--radius); background: var(--bg-card);
	padding: 20px 24px; margin: 0 0 1.4em; font-size: 16.5px; line-height: 1.68;
}
.callout strong { color: var(--text); }
.article-foot {
	margin-top: 56px; padding-top: 28px; border-top: 1px solid var(--border);
	display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between;
}
.article-foot p { margin: 0; font-size: 15.5px; color: var(--muted); }

/* ---------- nav: current page marker ---------- */
.nav-links a.current { color: var(--text); }
.nav-resume {
	border: 1px solid var(--border-hi); border-radius: 8px;
	padding: 7px 13px; color: var(--text) !important;
	transition: border-color .2s var(--ease), background-color .2s var(--ease);
}
.nav-resume:hover { background: var(--bg-raised); border-color: var(--accent); text-decoration: none; }
@media (max-width: 560px) { .nav-links a.nav-resume { display: flex; } }
