/* Shared styles for anilpoudyal.com */
:root {
    --bg: #ffffff;
    --text: #16181d;
    --muted: #61656f;
    --faint: #8b8f99;
    --rule: #e4e5e8;
    --tint: #f6f6f4;
    --accent: #9a3412;
    --max: 1080px;
    --sans: 'IBM Plex Sans', -apple-system, 'Segoe UI', sans-serif;
    --mono: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 16px/1.65 var(--sans); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 3px; text-decoration-thickness: 1px; transition: color .15s, text-decoration-color .15s; }
a:hover { color: var(--accent); text-decoration-color: currentColor; }
h1, h2, h3, p { margin: 0; }
::selection { background: #fde8d7; }
.hero-grid > *, .section-grid > *, .row > *, .contact-grid > * { min-width: 0; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }
.mono { font-family: var(--mono); font-size: 13px; letter-spacing: 0; color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 10; background: rgba(255,255,255,.94); backdrop-filter: saturate(180%) blur(8px); -webkit-backdrop-filter: saturate(180%) blur(8px); border-bottom: 1px solid transparent; transition: border-color .2s; }
.site-header.scrolled { border-bottom-color: var(--rule); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { font-weight: 600; font-size: 17px; text-decoration: none; letter-spacing: -.02em; }
.brand:hover { color: var(--text); }
.brand-dot { color: var(--accent); }
.nav { display: flex; gap: 24px; font-size: 14px; }
.nav a { text-decoration: none; color: var(--muted); }
.nav a:hover, .nav a.active { color: var(--text); }
.nav-toggle { display: none; background: none; border: 1px solid var(--rule); border-radius: 6px; padding: 6px 10px; font: 500 13px var(--sans); color: var(--text); cursor: pointer; }

/* Hero */
.hero { padding: 96px 0 80px; }
.hero-grid { display: grid; grid-template-columns: 1fr 260px; gap: 64px; align-items: end; }
.hero h1 { font-size: clamp(40px, 6vw, 64px); font-weight: 500; letter-spacing: -.035em; line-height: 1.02; }
.hero .lede { margin-top: 28px; font-size: 21px; line-height: 1.5; color: var(--text); max-width: 620px; letter-spacing: -.005em; }
.hero .lede span { color: var(--muted); }
.hero-photo { aspect-ratio: 4 / 5; object-fit: cover; border-radius: 4px; filter: saturate(.9); }
.facts { margin-top: 56px; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--rule); }
.facts div { padding: 18px 24px 0 0; }
.facts dt { font-family: var(--mono); font-size: 12px; color: var(--faint); text-transform: uppercase; letter-spacing: .06em; }
.facts dd { margin: 6px 0 0; font-size: 15px; }
.hero-actions { margin-top: 40px; display: flex; flex-wrap: wrap; gap: 12px 28px; align-items: center; font-size: 15px; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 18px; border-radius: 6px; background: var(--text); color: #fff; text-decoration: none; font-weight: 500; font-size: 15px; transition: background .15s; }
.btn:hover { background: var(--accent); color: #fff; }
.links { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.links a { color: var(--muted); }

/* Sections */
.section { border-top: 1px solid var(--rule); padding: 72px 0; }
.section-grid { display: grid; grid-template-columns: 220px 1fr; gap: 48px; }
.section-label { position: sticky; top: 96px; align-self: start; }
.section-label h2 { font-size: 15px; font-weight: 600; letter-spacing: -.005em; }
.section-label p { margin-top: 6px; font-size: 14px; color: var(--muted); line-height: 1.5; }
.intro { font-size: 19px; line-height: 1.6; max-width: 680px; letter-spacing: -.005em; }
.intro + .intro { margin-top: 18px; }

/* Row lists (experience, education, work) */
.rows { list-style: none; margin: 0; padding: 0; }
.row { display: grid; grid-template-columns: 150px 1fr; gap: 24px; padding: 22px 0; border-bottom: 1px solid var(--rule); }
.row:first-child { padding-top: 0; }
.row:last-child { border-bottom: 0; padding-bottom: 0; }
.row h3 { font-size: 17px; font-weight: 600; letter-spacing: -.01em; line-height: 1.4; }
.row .org { color: var(--muted); font-size: 15px; }
.row p.desc { margin-top: 8px; color: #3a3d45; font-size: 15px; max-width: 640px; }
.row .meta { margin-top: 10px; font-size: 14px; color: var(--muted); }
.tag { display: inline-block; margin-left: 8px; padding: 1px 7px; font: 500 11px var(--mono); color: var(--accent); border: 1px solid #f1d5c4; border-radius: 3px; vertical-align: 2px; }

/* Services */
.services { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border-top: 1px solid var(--rule); border-left: 1px solid var(--rule); }
.services div { padding: 24px 24px 28px; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.services h3 { font-size: 16px; font-weight: 600; }
.services p { margin-top: 8px; font-size: 15px; color: #3a3d45; }

.footnote { margin-top: 18px; font-size: 14px; color: var(--muted); }


/* Research */
.thesis { padding: 28px 32px; background: var(--tint); border-left: 2px solid var(--text); }
.thesis .mono { text-transform: uppercase; letter-spacing: .06em; font-size: 12px; }
.thesis p.title { margin-top: 10px; font-size: 20px; line-height: 1.45; letter-spacing: -.01em; }
.subhead { margin: 44px 0 18px; font: 500 12px var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--faint); }
.citation { font-size: 16px; line-height: 1.6; }
.citation em { font-style: italic; }


/* Writing */
.posts .row { grid-template-columns: 150px 1fr auto; align-items: baseline; }
.posts h3 { font-weight: 500; font-size: 16px; }
.posts h3 a { text-decoration: none; }
.posts h3 a:hover { text-decoration: underline; }
.posts .arrow { color: var(--faint); }
.skeleton { height: 14px; background: var(--tint); border-radius: 3px; }

/* Contact */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
form { display: grid; gap: 18px; }
label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; }
input, textarea { width: 100%; font: 400 15px var(--sans); color: var(--text); background: #fff; border: 1px solid #d4d6db; border-radius: 6px; padding: 11px 12px; transition: border-color .15s, box-shadow .15s; }
input:focus, textarea:focus { outline: none; border-color: var(--text); box-shadow: 0 0 0 3px rgba(22,24,29,.08); }
textarea { resize: vertical; min-height: 130px; }
button[type=submit] { justify-self: start; border: 0; cursor: pointer; font-family: var(--sans); }

footer { border-top: 1px solid var(--rule); padding: 0 0 40px; font-size: 14px; color: var(--muted); }
.footer-row { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
footer a { color: var(--muted); }



/* Identity & research blocks */
.hero h1 .role { display: block; margin-top: 14px; font-size: clamp(20px, 2.4vw, 26px); font-weight: 400; letter-spacing: -.015em; line-height: 1.3; color: var(--muted); }
.hero .lede a { color: var(--text); text-decoration-color: var(--accent); }
.available { margin-top: 28px; font-size: 15px; color: var(--muted); }
.interests { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.interests li { font-size: 14px; padding: 5px 11px; background: #fff; border: 1px solid var(--rule); border-radius: 4px; transition: border-color .2s, color .2s; }
.interests li:hover { border-color: var(--accent); color: var(--accent); }
.profiles { display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 15px; }
.callout { margin-top: 32px; padding: 26px 30px; border: 1px solid var(--rule); border-left: 2px solid var(--accent); }
.callout h3 { font-size: 17px; font-weight: 600; }
.callout p { margin-top: 8px; font-size: 15px; color: #3a3d45; }
.routes { margin-top: 28px; }
.routes .row { grid-template-columns: 110px 1fr; padding: 16px 0; }
.routes .row p { font-size: 15px; }

/* Writing page */
[hidden] { display: none !important; }
.nav a[aria-current="page"] { color: var(--text); }
.nav a[aria-current="page"]::after { transform: scaleX(1); }
.hero-compact { padding: 88px 0 64px; }
.crumb { margin-bottom: 18px; }
.crumb a { color: var(--muted); }
.featured-image { display: block; margin-bottom: 24px; overflow: hidden; border-radius: 4px; background: var(--tint); aspect-ratio: 16 / 8; }
.featured-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s cubic-bezier(.2,.7,.2,1); }
.featured:hover .featured-image img { transform: scale(1.03); }
.featured h2 { margin-top: 10px; font-size: clamp(24px, 3vw, 32px); font-weight: 500; letter-spacing: -.025em; line-height: 1.2; }
.featured h2 a { text-decoration: none; }
.featured h2 a:hover { text-decoration: underline; }
.featured-excerpt { margin-top: 14px; font-size: 18px; line-height: 1.6; color: #3a3d45; max-width: 680px; }
.featured .meta { margin-top: 16px; font-size: 15px; }
.featured .meta .arrow { display: inline-block; transition: transform .25s ease; }
.featured:hover .meta .arrow { transform: translate(3px, -3px); color: var(--accent); }
.post-tags { margin-top: 10px; font-size: 12px; color: var(--faint); }
.featured .post-tags { margin-top: 14px; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.filters button { font: 400 12px var(--mono); color: var(--muted); background: #fff; border: 1px solid var(--rule); border-radius: 4px; padding: 4px 9px; cursor: pointer; transition: border-color .2s, color .2s, background .2s; }
.filters button:hover { border-color: var(--accent); color: var(--accent); }
.filters button[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: #fff; }
.year-group:first-child .subhead { margin-top: 0; }
.subhead .count { color: var(--rule); }
.post-list .desc { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 860px) {
    .hero-compact { padding: 56px 0 40px; }
}

/* Ambient extras */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 20; background: var(--accent); transform-origin: left; transform: scaleX(0); }
.building { margin-top: 22px; font-size: 15px; color: var(--muted); }
.building .mono { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); margin-right: 6px; }
.rotate { display: inline-block; position: relative; color: var(--text); font-weight: 500; transition: transform .45s cubic-bezier(.2,.7,.2,1), opacity .45s ease; }
.rotate::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--accent); }
.rotate.out { transform: translateY(-60%); opacity: 0; }
.rotate.pre { transform: translateY(60%); opacity: 0; transition: none; }

.ticker { border-top: 1px solid var(--rule); padding: 16px 0; overflow: hidden;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); }
.ticker-track { display: flex; width: max-content; animation: ticker 60s linear infinite; }
.ticker span { font: 400 13px var(--mono); color: var(--muted); white-space: nowrap; padding: 0 18px; }
.ticker .sep { color: #c9ccd2; padding: 0; }
.ticker:hover .ticker-track { animation-play-state: paused; }
@keyframes ticker { to { transform: translateX(-50%); } }

.stats { margin-top: 44px; display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--rule); }
.stats > div { padding: 20px 16px 0 0; }
.stats .num { display: block; font-size: 36px; font-weight: 500; letter-spacing: -.035em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stats .lbl { display: block; margin-top: 6px; font: 400 12px var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--faint); }

.section > .wrap { position: relative; z-index: 1; }
.bg-canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.bg-net { -webkit-mask-image: radial-gradient(ellipse 34% 75% at 14% 62%, #000 20%, transparent 78%); mask-image: radial-gradient(ellipse 34% 75% at 14% 62%, #000 20%, transparent 78%); }
.bg-waves { -webkit-mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent); mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent); }
.bg-dots { -webkit-mask-image: radial-gradient(ellipse 38% 80% at 12% 85%, #000 20%, transparent 75%); mask-image: radial-gradient(ellipse 38% 80% at 12% 85%, #000 20%, transparent 75%); }
#research { background: #fafaf8; }
#research .thesis { background-color: #fff; }

.label-progress { display: block; position: relative; width: 1px; height: 96px; margin-top: 22px; background: var(--rule); overflow: hidden; }
.label-progress i { position: absolute; inset: 0; background: var(--accent); transform-origin: top; transform: scaleY(var(--p, 0)); }

.spot { background-image: radial-gradient(260px circle at var(--mx, -999px) var(--my, -999px), rgba(154,52,18,.075), transparent 70%); }

.wordmark { font-size: clamp(52px, 15vw, 176px); font-weight: 600; letter-spacing: -.055em; line-height: .95; padding: 48px 0 36px; white-space: nowrap; user-select: none;
    color: transparent; -webkit-text-stroke: 1px #cdd0d6;
    background-image: linear-gradient(var(--text), var(--text)); background-repeat: no-repeat; background-size: var(--fill, 0%) 100%;
    -webkit-background-clip: text; background-clip: text; }

/* Motion */
.hero { position: relative; overflow: hidden; }
.hero > .wrap { position: relative; z-index: 1; }
.hero-field { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none;
    -webkit-mask-image: radial-gradient(ellipse 65% 85% at 78% 45%, #000 25%, transparent 75%);
            mask-image: radial-gradient(ellipse 65% 85% at 78% 45%, #000 25%, transparent 75%); }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes unveil { from { clip-path: inset(100% 0 0 0); transform: scale(1.06); } to { clip-path: inset(0 0 0 0); transform: none; } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(22,163,74,.45); } 100% { box-shadow: 0 0 0 8px rgba(22,163,74,0); } }
.js .hero h1, .js .hero .lede, .js .facts > div, .js .hero-actions { animation: rise .9s cubic-bezier(.2,.7,.2,1) both; }
.js .hero .lede { animation-delay: .12s; }
.js .facts > div:nth-child(1) { animation-delay: .24s; }
.js .facts > div:nth-child(2) { animation-delay: .32s; }
.js .facts > div:nth-child(3) { animation-delay: .40s; }
.js .hero-actions { animation-delay: .5s; }
.js .hero-photo { animation: unveil 1.2s cubic-bezier(.7,0,.2,1) .1s both; }
.live { display: inline-block; width: 7px; height: 7px; margin-right: 8px; border-radius: 50%; background: #16a34a; vertical-align: 1px; animation: pulse 2s ease-out infinite; }

.section { border-top: 0; position: relative; }
.section::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: var(--rule); transform-origin: left; }
.js .section::before { transform: scaleX(0); transition: transform 1.4s cubic-bezier(.7,0,.2,1); }
.js .section.seen::before { transform: scaleX(1); }
.js .rv { opacity: 0; transform: translateY(14px); transition: opacity .8s ease, transform .8s cubic-bezier(.2,.7,.2,1); transition-delay: var(--d, 0s); }
.js .rv.in { opacity: 1; transform: none; }

.nav a { position: relative; }
.nav a::after { content: ''; position: absolute; left: 0; right: 0; bottom: -6px; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform .3s ease; }
.nav a:hover::after, .nav a.active::after { transform: scaleX(1); }
.btn .btn-arrow { transition: transform .2s ease; }
.btn:hover .btn-arrow { transform: translateX(3px); }

.row { position: relative; }
.row::before { content: ''; position: absolute; left: -20px; top: 0; bottom: 22px; width: 2px; background: var(--accent); transform: scaleY(0); transform-origin: top; transition: transform .35s cubic-bezier(.2,.7,.2,1); }
.row:not(:first-child)::before { top: 22px; }
.row:last-child::before { bottom: 0; }
.row:hover::before { transform: scaleY(1); }
.row > .mono { transition: color .2s; }
.row:hover > .mono { color: var(--accent); }
.row h3 a { text-decoration: none; }
.row h3 .arrow { display: inline-block; color: var(--faint); font-weight: 400; transition: transform .25s ease, color .2s; }
.row:hover h3 .arrow { transform: translate(3px, -3px); color: var(--accent); }
.posts .arrow { transition: transform .25s ease, color .2s; }
.posts .row:hover .arrow { transform: translate(3px, -3px); color: var(--accent); }
.services div { transition: background .3s ease; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
    .js .rv { opacity: 1; transform: none; }
    .js .section::before { transform: none; }
    .wordmark { background-size: 100% 100%; }
}

/* Responsive */
@media (max-width: 860px) {
    .row::before { display: none; }
    .stats { grid-template-columns: 1fr 1fr; }
    .label-progress { display: none; }
    .bg-net, .bg-dots { opacity: .5; }
    .hero-field { -webkit-mask-image: radial-gradient(ellipse 90% 60% at 60% 20%, #000 20%, transparent 75%); mask-image: radial-gradient(ellipse 90% 60% at 60% 20%, #000 20%, transparent 75%); }
    .hero { padding: 56px 0 56px; }
    .hero-grid { grid-template-columns: 1fr; gap: 36px; }
    .hero-photo { width: 168px; order: -1; }
    .hero .lede { font-size: 18px; }
    .facts { grid-template-columns: 1fr; }
    .facts div { padding: 14px 0; border-bottom: 1px solid var(--rule); }
    .section { padding: 56px 0; }
    .section-grid { grid-template-columns: 1fr; gap: 28px; }
    .section-label { position: static; }
    .row, .posts .row { grid-template-columns: 1fr; gap: 4px; }
    .posts .arrow { display: none; }
    .services { grid-template-columns: 1fr; }
    .contact-grid { grid-template-columns: 1fr; }
    .nav { display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; gap: 0; background: #fff; border-bottom: 1px solid var(--rule); padding: 8px 24px 16px; }
    .nav.open { display: flex; }
    .nav a { padding: 10px 0; font-size: 16px; color: var(--text); }
    .nav-toggle { display: block; }
}
