/* Site styles for abhilashjohn.com. White page, one accent (mango), serif for reading, mono for metadata.
   Layout: a 1320px container; content sits in a 680px reading column, labels in a 220px rail. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; }
img, svg, video, iframe { max-width: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

:root { color-scheme: light;
  --paper: #ffffff; --ink: #1b1c1a; --muted: #6b6c68; --rule: #ececea; --card: #ffffff; --chip: #f4f6f1;
  --grass: #a9c46a; --grass2: #8fb257; --paddy: #c4da6e; --laterite: #b0532e; --path: #d9b77c;
  --water: #4fa3b5; --water2: #b5e0e6; --hill: #79a653; --hill2: #4f7e3d; --wall: #f3efe4;
  --roof: #c2582f; --wood: #8a5a3a; --trunk: #6b4a33; --leaf: #3f7340; --leaf2: #78a94e;
  --mango: #f2b51e; --unripe: #b2c74a; --stone: #b9ab95; --cloud: #ffffff; --cloudsh: #c9dbe6;
  --win: #a9c3cb; --slate: #2f3a36; --chalk: #f3f0e6; --skin: #8b5b3e;
  --tee: #9fd0e6; --denim: #3f5f86; --hair: #1d1a17; --cat: #4a4542; --crt: #d9d0b8; --pot: #efe8d8;
  --serif: "Literata", Georgia, "Times New Roman", serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
}
body { background: var(--paper); color: var(--ink); font-family: var(--serif); font-size: 17px; line-height: 1.6; overflow-x: hidden; }
:root { --hdr: 64px; --gut: max(20px, env(safe-area-inset-left, 0px)); --gutr: max(20px, env(safe-area-inset-right, 0px)); }
.wrap { max-width: 1320px; margin: 0 auto; padding-left: var(--gut); padding-right: var(--gutr); }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--paper); }

.site { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 9; background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid transparent; transition: border-color .2s ease; }
.site.scrolled { border-bottom-color: var(--rule); }
.site .wrap { height: var(--hdr); display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font: 600 16px/1 var(--serif); text-decoration: none; color: var(--ink); letter-spacing: -.005em; }
.brand img { height: 32px; width: auto; flex: none; }
.menu { display: flex; align-items: center; gap: 28px; font: 14.5px/1 var(--serif); }
.menu a { text-decoration: none; color: var(--muted); padding: 6px 0; border-bottom: 1.5px solid transparent; }
.menu a:hover { color: var(--ink); }
.menu a[aria-current="true"] { color: var(--ink); border-bottom-color: var(--mango); }
.menu .pill { color: var(--ink); border: 1px solid var(--ink); border-radius: 999px; padding: 9px 18px; border-bottom-width: 1px; }
.menu .pill:hover { background: var(--ink); color: var(--paper); }
.menu-btn { display: none; font: 13px var(--mono); background: none; border: 1px solid var(--rule); border-radius: 999px; padding: 7px 14px; color: var(--ink); cursor: pointer; }
.menu-btn:focus-visible, .menu a:focus-visible, .brand:focus-visible, .btn:focus-visible { outline: 2px solid var(--mango); outline-offset: 3px; }

.hero { min-height: calc(100svh - var(--hdr)); display: grid; grid-template-columns: minmax(0, 42fr) minmax(0, 58fr); align-items: center; gap: 40px; padding-block: 24px 40px; }
.hero-text { display: grid; gap: 22px; align-content: center; }
.hero h1 { margin: 0; font-size: clamp(2.5rem, 4.3vw, 4.1rem); line-height: 1.04; font-weight: 600; letter-spacing: -0.025em; text-wrap: balance; }
.hero h1 span { display: inline-block; white-space: pre; }
.hero h1 .ac { color: #d9881a; }
.hero h1.thud span span { animation: hop .55s cubic-bezier(.3, 1.7, .45, 1) both; animation-delay: calc(var(--i) * 12ms); }
@keyframes hop { 0% { transform: none; } 30% { transform: translateY(-6px); } 100% { transform: none; } }
.hero p { margin: 0; color: var(--muted); font-size: clamp(16.5px, 1.25vw, 19px); line-height: 1.6; max-width: 34em; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 4px; }
.btn { display: inline-flex; align-items: center; padding: 13px 24px; border-radius: 999px; font: 15.5px/1 var(--serif); text-decoration: none; border: 1px solid var(--ink); color: var(--ink); transition: background .15s ease, color .15s ease; }
.btn.primary { background: #f6c27a; border-color: #f6c27a; color: #2a1d08; }
.btn.primary:hover { background: #f2b35c; border-color: #f2b35c; }
.btn:not(.primary):hover { background: var(--ink); color: var(--paper); }
.hero-scene { display: grid; gap: 8px; min-width: 0; }
.hint { display: flex; justify-content: center; align-items: center; gap: 14px; flex-wrap: wrap; font: 12.5px var(--mono); color: var(--muted); min-height: 1.6em; }
.hint svg { width: 14px; height: 14px; vertical-align: -2px; margin-right: 6px; }

@media (max-width: 1023px) {
  .hero { grid-template-columns: minmax(0, 1fr); min-height: 0; gap: 28px; padding-block: 28px 16px; }
  .hero h1 { font-size: clamp(2.2rem, 7vw, 3.2rem); }
}
@media (max-width: 767px) {
  .menu-btn { display: inline-block; }
  .menu { display: none; position: absolute; top: var(--hdr); right: var(--gutr); flex-direction: column; align-items: stretch; gap: 0; min-width: 200px; padding: 8px; background: var(--card); border: 1px solid var(--rule); border-radius: 12px; box-shadow: 0 12px 28px rgba(0,0,0,.1); }
  .menu.open { display: flex; }
  .menu a { padding: 11px 12px; border-bottom: 0; border-radius: 8px; }
  .menu a[aria-current="true"] { background: var(--chip); }
  .menu .pill { margin-top: 6px; text-align: center; }
}

.stage { position: relative; }
canvas { display: block; width: 100%; aspect-ratio: 22 / 15; max-width: 100%; touch-action: manipulation; }
canvas.hot { cursor: pointer; }
canvas:focus-visible { outline: 2px solid var(--mango); outline-offset: 4px; border-radius: 6px; }

.pins { position: absolute; inset: 0; pointer-events: none; }
.pin {
  position: absolute; transform: translate(-50%, calc(-100% - 6px)); pointer-events: auto;
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px 3px 7px;
  font: 600 11px/1.4 var(--mono); letter-spacing: .02em; color: var(--ink);
  background: color-mix(in srgb, var(--card) 92%, transparent); border: 1px solid var(--rule); border-radius: 999px;
  cursor: pointer; white-space: nowrap; opacity: 0; transition: opacity .5s ease, transform .2s ease;
}
.pin::after { content: ""; position: absolute; left: 50%; top: 100%; width: 1px; height: 6px; background: var(--muted); }
.pin i { width: 7px; height: 7px; border-radius: 50%; background: var(--mango); box-shadow: 0 0 0 2px color-mix(in srgb, var(--mango) 30%, transparent); }
.pins.on .pin { opacity: 1; }
.pin:hover, .pin[aria-expanded="true"] { transform: translate(-50%, calc(-100% - 8px)); border-color: var(--muted); }
.pin:focus-visible { outline: 2px solid var(--mango); outline-offset: 2px; }
.card {
  position: absolute; width: min(320px, calc(100% - 16px)); max-height: calc(100% - 8px); overflow-y: auto; padding: 12px 14px; pointer-events: auto;
  background: var(--card); color: var(--ink); border: 1px solid var(--rule); border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12); font-size: 13.5px; line-height: 1.5; z-index: 2;
}
.card h3 { margin: 0 0 4px; font: 600 15px/1.3 var(--serif); }
.card p { margin: 0; color: var(--muted); }
.card ul { margin: 10px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.card li { display: grid; gap: 1px; color: var(--muted); }
.card li b { font: 600 12px/1.4 var(--mono); color: var(--ink); }

  #quip { opacity: 0; transition: opacity .35s ease; }
#quip.on { opacity: 1; }
.ctl { display: flex; gap: 14px; align-items: baseline; }
.ctl button { font: inherit; color: inherit; background: none; border: 0; padding: 2px 0; cursor: pointer; }
.ctl button:hover { color: var(--ink); }
.ctl button:focus-visible { outline: 2px solid var(--mango); outline-offset: 2px; }

.now { justify-self: start; align-self: start; display: inline-flex; gap: 8px; align-items: center; padding: 5px 12px 5px 10px; border-radius: 999px; background: var(--chip); font: 12px/1.4 var(--mono); color: var(--muted); }
.now b { font-weight: 600; color: var(--ink); }
.now i { width: 7px; height: 7px; border-radius: 50%; background: #58a55c; box-shadow: 0 0 0 3px rgba(88,165,92,.2); }
a { color: inherit; text-decoration-color: var(--rule); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
a:focus-visible { outline: 2px solid var(--mango); outline-offset: 2px; border-radius: 2px; }

.sections { display: grid; gap: 72px; padding-block: 56px 48px; }
.sections > section { display: grid; grid-template-columns: 220px minmax(0, 680px); gap: 8px 48px; scroll-margin-top: calc(var(--hdr) + 16px); }
.sections > section > .body { min-width: 0; }
.rail { display: grid; align-content: start; gap: 6px; }
.rail .label { margin: 0; padding-top: 12px; }
.rail a { font: 12.5px var(--mono); color: var(--muted); text-decoration: none; }
.rail a:hover { color: var(--ink); }
@media (max-width: 899px) { .sections > section { grid-template-columns: minmax(0, 1fr); } .rail { grid-auto-flow: column; justify-content: space-between; align-items: baseline; } }
[hidden] { display: none !important; }
.label { font: 400 12px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.lede { margin: 0 0 8px; color: var(--muted); font-size: 15.5px; }
.rows { list-style: none; margin: 0; padding: 0; }
.rows li { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; align-items: baseline; padding-block: 10px; border-top: 1px solid var(--rule); }
.rows li:last-child { border-bottom: 1px solid var(--rule); }
.rows li > * { min-width: 0; }
.meta { font: 12.5px var(--mono); color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.post a { text-decoration: none; } .post a:hover { text-decoration: underline; text-decoration-color: var(--rule); }
.tag { font: 11px var(--mono); color: var(--muted); margin-left: 8px; white-space: nowrap; }

.proj li { grid-template-columns: 40px 1fr auto; align-items: center; }
.mono { width: 40px; height: 40px; border-radius: 9px; display: grid; place-items: center; font: 600 13px var(--mono); color: #fff; }
.proj h3 { margin: 0; font: 600 15.5px/1.35 var(--serif); }
.proj p { margin: 0; color: var(--muted); font-size: 14.5px; line-height: 1.45; }
.status { font: 11px/1 var(--mono); padding: 5px 8px; border-radius: 999px; background: var(--chip); color: var(--muted); white-space: nowrap; }
.status.live { background: rgba(88,165,92,.12); color: #2f7a35; }

.work li { grid-template-columns: 9rem 1fr auto; }
.work .co { font-weight: 600; }
.work .role { color: var(--muted); font-size: 15px; }
.sub { margin: 20px 0 6px; font: 12px var(--mono); color: var(--muted); }

.principles { margin: 0; padding-left: 1.1em; display: grid; gap: 6px; color: var(--ink); }
.principles li::marker { color: var(--muted); }
.draft { font: 11px var(--mono); color: var(--muted); text-transform: none; letter-spacing: 0; }

.site-foot { display: grid; grid-template-columns: 2fr 1fr 1.4fr 1fr; gap: 24px; padding-block: 24px 40px; border-top: 1px solid var(--rule); font-size: 14px; color: var(--muted); }
.site-foot h2 { margin: 0 0 8px; font: 400 11px var(--mono); color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
.site-foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.site-foot a { text-decoration: none; }   .site-foot a:hover { color: var(--ink); }
.site-foot .small { grid-column: 1 / -1; font: 11.5px var(--mono); }
@media (max-width: 640px) { .pin { padding: 6px; gap: 0; } .pin .t { display: none; } .pin i { width: 9px; height: 9px; } }
@media (max-width: 900px) { .site-foot { grid-template-columns: repeat(3, 1fr); } .site-foot > div:first-child { grid-column: 1 / -1; } }
@media (max-width: 560px) {
  .work li { grid-template-columns: 1fr auto; } .work .role { grid-column: 1 / -1; grid-row: 2; }
  .site-foot { grid-template-columns: 1fr 1fr; } .site-foot > div:first-child { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) { .hero h1.thud span span { animation: none; } .site { transition: none; } #quip, .pin { transition: none; } }

/* ---------- shared bits ---------- */
.skip { position: absolute; left: -9999px; top: 10px; z-index: 30; padding: 8px 14px; border-radius: 8px; background: var(--ink); color: var(--paper); font: 13px var(--mono); text-decoration: none; }
.skip:focus { left: 12px; }
.more { font: 13px var(--mono); color: var(--ink); text-decoration-color: var(--mango); text-underline-offset: 4px; }
.mark { color: #b8740f; }

/* ---------- inner page header ---------- */
.page-head { padding-block: 64px 24px; display: grid; gap: 14px; max-width: 760px; }
.page-head h1 { margin: 0; font-size: clamp(2.3rem, 4.4vw, 3.4rem); line-height: 1.06; letter-spacing: -.022em; font-weight: 600; text-wrap: balance; }
.page-head p { margin: 0; color: var(--muted); font-size: clamp(17px, 1.3vw, 19px); max-width: 36em; }
.page-head .crumbs { font: 12.5px var(--mono); color: var(--muted); }
.page-head .crumbs a { color: var(--muted); text-decoration: none; }
.page-head .crumbs a:hover { color: var(--ink); }

/* ---------- article ---------- */
.article { max-width: 720px; margin: 0 auto; padding-block: 48px 72px; }
.article .crumbs { font: 12.5px var(--mono); color: var(--muted); }
.article .crumbs a { color: var(--muted); text-decoration: none; }
.article .crumbs a:hover { color: var(--ink); }
.kind { margin: 28px 0 12px; font: 12px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: #b8740f; }
.article h1 { margin: 0; font-size: clamp(2rem, 4.2vw, 3rem); line-height: 1.1; letter-spacing: -.02em; font-weight: 600; text-wrap: balance; }
.dek { margin: 18px 0 0; font-size: clamp(18px, 1.5vw, 20px); line-height: 1.5; color: var(--muted); }
.byline { margin: 22px 0 0; padding-bottom: 28px; border-bottom: 1px solid var(--rule); font: 13px var(--mono); color: var(--muted); }
.prose { padding-top: 20px; font-size: 18.5px; line-height: 1.75; overflow-wrap: break-word; }
.prose > * { margin-top: 0; margin-bottom: 1.15em; }
.prose h2 { margin: 1.9em 0 .55em; font-size: 1.55rem; line-height: 1.25; letter-spacing: -.01em; }
.prose h3 { margin: 1.6em 0 .5em; font-size: 1.28rem; line-height: 1.3; }
.prose h4, .prose h5 { margin: 1.4em 0 .4em; font-size: 1.08rem; }
.prose a { text-decoration-color: #e9b45a; text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: currentColor; }
.prose img { height: auto; border-radius: 6px; }
.prose p > img:only-child { display: block; margin: 0 auto; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: .35em; }
.prose li::marker { color: var(--muted); }
.prose blockquote { margin-left: 0; padding-left: 20px; border-left: 3px solid var(--mango); color: var(--muted); }
.prose code { font: .86em var(--mono); background: var(--chip); padding: .12em .36em; border-radius: 4px; }
.prose pre { overflow-x: auto; padding: 16px 18px; background: #f7f8f5; border-radius: 10px; font-size: 14px; line-height: 1.55; }
.prose pre code { background: none; padding: 0; }
.prose table { display: block; width: fit-content; max-width: 100%; margin-inline: auto; overflow-x: auto; border: 1px solid var(--rule); border-collapse: collapse; font-size: 15px; line-height: 1.5; }
.prose th, .prose td { padding: 10px 12px; border: 1px solid var(--rule); vertical-align: top; }
.prose td:has(> img) { text-align: center; vertical-align: middle; }
.prose td img { display: inline-block; border-radius: 4px; }
.prose th { background: #fafaf8; text-align: left; }
.prose iframe { display: block; border: 0; margin-inline: auto; }
.prose hr { border: 0; border-top: 1px solid var(--rule); margin: 2.2em 0; }
.prose em:only-child { display: block; text-align: center; font-size: 14.5px; color: var(--muted); }
.post-foot { margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--rule); display: grid; gap: 28px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.tags a { display: inline-block; padding: 6px 11px; border-radius: 999px; background: var(--chip); font: 12px var(--mono); color: var(--muted); text-decoration: none; }
.tags a:hover { color: var(--ink); }
.pn { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pn a { display: grid; gap: 4px; padding: 14px 16px; border: 1px solid var(--rule); border-radius: 12px; text-decoration: none; line-height: 1.35; }
.pn a:hover { border-color: var(--muted); }
.pn span { font: 11.5px var(--mono); color: var(--muted); }
.pn .next { grid-column: 2; text-align: right; }
@media (max-width: 560px) { .pn { grid-template-columns: 1fr; } .pn .next { grid-column: 1; } }

/* ---------- about ---------- */
.about { display: grid; grid-template-columns: minmax(0, 680px) 300px; justify-content: space-between; gap: 32px 64px; padding-block: 64px 8px; align-items: start; }
.about h1 { margin: 0 0 18px; font-size: clamp(2.3rem, 4.4vw, 3.4rem); line-height: 1.06; letter-spacing: -.022em; font-weight: 600; }
.about figure { margin: 0; position: sticky; top: calc(var(--hdr) + 24px); }
.about figure img { display: block; width: 100%; height: auto; aspect-ratio: 300 / 384; object-fit: cover; object-position: 50% 22%; border-radius: 56% 44% 48% 52% / 41% 38% 62% 59%; }
.about figcaption { margin-top: 10px; font: 12px var(--mono); color: var(--muted); }
.facts { list-style: none; margin: 0 0 28px; padding: 16px 18px; display: grid; gap: 8px; background: #fafaf7; border: 1px solid var(--rule); border-radius: 12px; font-size: 15.5px; }
.facts b { font: 600 11.5px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-right: 6px; }
.about .prose { padding-top: 0; }
.elsewhere { display: flex; flex-wrap: wrap; gap: 8px 20px; font: 13.5px var(--mono); }
@media (max-width: 899px) { .about { grid-template-columns: minmax(0, 1fr); } .about figure { position: static; max-width: 260px; grid-row: 1; } }

/* ---------- 404 ---------- */
.lost { min-height: calc(100svh - var(--hdr) - 220px); display: grid; align-content: center; gap: 16px; padding-block: 64px; }
.lost h1 { margin: 0; font-size: clamp(2.2rem, 5vw, 3.6rem); letter-spacing: -.02em; }
.lost p { margin: 0; color: var(--muted); font-size: 18px; }
.site-foot p { margin: 0; } .site-foot .who { margin-bottom: 6px; color: var(--ink); }
.sections.years { gap: 32px; padding-top: 24px; }
.hero .more { white-space: nowrap; }

/* What each role taught: small tags under the role */
.learn { display: flex; flex-wrap: wrap; gap: 6px; grid-column: 2 / -1; margin-top: 2px; }
.learn span { padding: 3px 8px; border-radius: 999px; background: var(--chip); font: 11px/1.4 var(--mono); color: var(--muted); }
.lede-tags { margin: -2px 0 10px; }
@media (max-width: 560px) { .work .learn { grid-column: 1 / -1; grid-row: 3; } }
