@import url("https://fonts.googleapis.com/css2?family=Lora:wght@400;500;600&display=swap");

@property --photo-left { syntax: "<color>"; inherits: true; initial-value: rgb(138, 164, 183); }
@property --photo-right { syntax: "<color>"; inherits: true; initial-value: rgb(186, 178, 155); }

:root {
  color-scheme: light;
  --text: #24272b;
  --muted: #74777d;
  --link: #3f6084;
  --rule: #e5e7ea;
  --surface: #f8f9fa;
  --photo-left: rgb(138, 164, 183);
  --photo-right: rgb(186, 178, 155);
  --serif: "Lora", Georgia, "Times New Roman", serif;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.65;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--text); background: #fff; isolation: isolate; }
/* The photo atmosphere belongs only to the home page. */
body.home::before {
  content: "";
  position: absolute;
  inset: -44px 0 auto;
  height: clamp(224px, 28svh, 288px);
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(100deg, var(--photo-left), var(--photo-right));
  opacity: .62;
  filter: blur(11px);
  mask-image: linear-gradient(#000 0%, rgb(0 0 0 / 92%) 28%, rgb(0 0 0 / 34%) 72%, transparent 100%);
}

a { color: inherit; text-decoration-color: #c9cdd3; text-underline-offset: 3px; }
a:hover, a:focus-visible { color: var(--link); text-decoration-color: currentColor; }
button { font: inherit; color: inherit; cursor: pointer; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--link); outline-offset: 5px; }
button:disabled { cursor: default; opacity: .45; }
button.plain { padding: 0; border: 0; background: none; }
.container { width: min(100% - 40px, 704px); margin: 0 auto; padding: 40px 0 28px; }
.site-header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 24px; }
.site-name { font: 500 17px/1.5 var(--serif); text-decoration: none; }
.native-name { margin-left: 9px; font: 400 14px/1.5 "Kohinoor Odia", "Noto Sans Oriya", sans-serif; color: #656970; }
.site-nav { display: flex; flex-wrap: wrap; gap: 23px; }
.site-nav a { color: #535860; text-decoration: none; line-height: 22px; }
.site-nav a[aria-current="page"] { color: #131518; text-decoration: underline; text-underline-offset: 5px; }
.site-nav a:hover, .site-nav a:focus-visible, .site-name:hover, .site-name:focus-visible { color: var(--link); }
.site-main { margin-top: 48px; }
h1, h2, h3, p, figure { margin: 0; }
h1 { font: 500 22px/1.5 var(--serif); }
h2 { font: 500 17px/1.5 var(--serif); }
.page-description { color: #555b64; margin: 6px 0 27px; }
.intro, .profile, .profile-links { min-width: 0; overflow-wrap: anywhere; }
.intro img, .intro video { max-width: 100%; height: auto; }
.intro p { margin-bottom: 14px; }
.intro p:last-child { margin-bottom: 0; }
.intro a { text-decoration-color: #c8ccd2; }
.intro-layout { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 30px; align-items: start; }
.profile-portrait { flex-shrink: 0; display: block; width: 150px; height: 150px; border-radius: 4px; object-fit: cover; }
.profile-links { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 9px; margin-top: 11px; text-align: center; font-size: 11px; color: var(--link); }
.profile-links a { text-decoration: none; }
.gallery { margin-top: 28px; }
.photo-stage { position: relative; height: min(396px, calc((100vw - 40px) * 9 / 16)); border-radius: 5px; overflow: hidden; background: #edf0f2; }
.photo-stage::after { content: ""; position: absolute; inset: auto 0 0; height: 55px; background: linear-gradient(transparent, rgb(0 0 0 / 24%)); pointer-events: none; }
.photo-backdrop { width: 100%; height: 100%; position: absolute; object-fit: cover; filter: blur(30px); opacity: .3; transform: scale(1.15); }
.gallery-image { position: relative; display: block; height: 100%; width: 100%; object-fit: contain; }
.gallery-image[data-fit="cover"] { object-fit: cover; }
.gallery-controls { position: absolute; inset: auto 0 7px; z-index: 1; display: flex; align-items: center; justify-content: center; gap: 6px; color: white; }
.gallery-controls > button { flex-shrink: 0; font-size: 17px; width: 28px; height: 28px; text-shadow: 0 1px 3px rgb(0 0 0 / 35%); }
.photo-dots { display: flex; flex-wrap: wrap; justify-content: center; min-width: 0; gap: 0; }
.photo-dot { width: 17px; height: 28px; border: 0; background: none; padding: 5px; }
.photo-dot::before { content: ""; display: block; width: 6px; height: 6px; background: rgb(255 255 255 / 50%); border-radius: 50%; }
.photo-dot[aria-pressed="true"]::before { background: white; }
.gallery-controls button:focus-visible { outline-color: white; outline-offset: 1px; }
.gallery-caption { margin-top: 7px; font-size: 11px; text-align: center; color: var(--muted); }
.contact-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 15px; margin-top: 18px; font-size: 12px; }
.contact-links a { text-decoration: none; }
.news-list, .work-list, .writing-list { list-style: none; padding: 0; margin: 0; }
.news-list > li { display: grid; grid-template-columns: 73px 1fr; gap: 18px; margin-bottom: 21px; }
.news-list time { font-size: 12px; color: var(--muted); padding-top: 2px; }
.writing-list > li { margin-bottom: 28px; }
.writing-post { display: grid; grid-template-columns: minmax(0, 1fr) clamp(84px, 22vw, 160px); gap: clamp(12px, 3vw, 28px); align-items: start; text-decoration: none; }
.writing-post img { display: block; width: 100%; height: auto; border-radius: 4px; }
.writing-post:hover h2, .writing-post:focus-visible h2 { color: var(--link); text-decoration: underline; text-underline-offset: 3px; }
.writing-post .item-description { color: #555b64; }
.item-description { margin-top: 6px; }
.item-meta { margin-top: 6px; font-size: 12px; color: var(--muted); }
.work-list > li { margin-bottom: 26px; }
.work-list > li:last-child { margin-bottom: 0; }
.project-preview { border: 1px solid var(--rule); border-radius: 4px; background: var(--surface); padding: 10px 15px; margin-bottom: 12px; }
.preview-bar { display: flex; justify-content: space-between; align-items: center; gap: 15px; font-size: 11px; color: var(--muted); }
.preview-bar button { min-height: 26px; color: var(--link); }
.forecast-chart { width: 100%; height: 65px; display: block; margin-top: 4px; }
.research-preview .forecast-chart { height: 155px; }
.chart-grid { stroke: #e4e7eb; stroke-width: 1; }
.chart-history { stroke: #688fa7; stroke-width: 2; }
.chart-forecast { stroke: #688fa7; stroke-width: 2; stroke-dasharray: 5 4; }
.preview-axis { display: flex; justify-content: space-between; color: #737b86; font-size: 10px; line-height: 14px; }
.preview-log { display: grid; gap: 4px; min-height: 65px; margin-top: 5px; font: 11px/1.6 ui-monospace, SFMono-Regular, Consolas, monospace; }
.preview-result { color: #416a82; }
.split-preview { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 8px; }
.split-preview div { border-left: 2px solid #d7dde3; padding-left: 10px; font-size: 12px; min-height: 57px; }
.split-preview span { display: block; font-size: 11px; color: var(--muted); }
.preview-explanation { margin-top: 6px; color: var(--muted); font-size: 11px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 20px; top: -80px; background: white; padding: 8px 12px; z-index: 3; }
.skip-link:focus { top: 8px; }

@media (min-width: 761px) and (max-height: 740px) {
  .container { padding-top: 21px; }
  .site-main { margin-top: 24px; }
  .intro { font-size: 14px; line-height: 1.65; }
  .intro p { margin-bottom: 10px; }
}
@media (max-width: 760px) {
  .site-header { display: block; }
  .site-nav { margin-top: 11px; }
  .container { padding-top: 28px; }
  .site-main { margin-top: 33px; }
}
@media (max-width: 600px) {
  .container { padding-top: 24px; width: calc(100% - 40px); }
  .site-name { font-size: 17px; }
  .native-name { font-size: 12px; margin-left: 6px; }
  .site-main { margin-top: 27px; }
  .site-nav { gap: 20px; }
  .intro { font-size: 14px; line-height: 1.65; }
  .intro-layout { display: block; }
  .profile { display: flex; gap: 17px; align-items: center; margin-bottom: 18px; }
  .profile-portrait { width: 80px; height: 80px; }
  .profile-links { margin-top: 0; text-align: left; }
  .gallery-controls { gap: 5px; }
  .photo-dots { gap: 0; }
  .photo-dot { width: 22px; padding: 8px; }
  .gallery { margin-top: 17px; }
  .contact-links { gap: 12px; font-size: 11px; }
  .news-list > li { grid-template-columns: 59px 1fr; gap: 12px; font-size: 13px; margin-bottom: 22px; }
  .news-list time { font-size: 11px; }
  .preview-bar { font-size: 10px; }
  .project-preview { padding: 10px 12px; }
  .forecast-chart { height: 100px; }
  .preview-log { min-height: 100px; align-content: center; }
  .item-description { font-size: 13px; }
}
@media (max-width: 380px) {
  .site-nav { gap: 18px; }
  .photo-dot { width: 18px; padding: 6px; }
  .gallery-controls { gap: 2px; }
  .gallery-controls > button { width: 24px; }
  .contact-links { column-gap: 14px; row-gap: 5px; }
}
@media (max-width: 380px) and (max-height: 740px) {
  .container { padding-top: 20px; padding-bottom: 18px; }
  .site-main { margin-top: 22px; }
  .intro { font-size: 13px; line-height: 1.6; }
  .profile { gap: 13px; margin-bottom: 13px; }
  .profile-portrait { width: 60px; height: 60px; }
  .profile-links { font-size: 10px; }
  .gallery { margin-top: 12px; }
  .contact-links { margin-top: 13px; }
  .research-preview .forecast-chart { height: 95px; }
}
/* Full homepage: content-aware fitting, with no scrolling or text panels. */
html:has(body.home) { height: 100%; overflow: hidden; }
body.home { height: 100dvh; overflow: clip; }
.home .container {
  transform: scale(var(--home-scale, 1));
  transform-origin: top center;
  padding-top: calc(var(--home-top, 40px) * var(--home-spacing, 1));
  padding-bottom: calc(28px * var(--home-spacing, 1));
}
.home .site-main { margin-top: calc(var(--home-main-gap, 48px) * var(--home-spacing, 1)); }
.home .gallery { margin-top: calc(var(--home-gallery-gap, 28px) * var(--home-spacing, 1)); }
.home .intro, .home .reach-out { font-size: var(--intro-font-size, 14px); line-height: 1.65; }
.reach-out { max-width: 576px; margin: calc(28px * var(--home-spacing, 1)) auto 0; overflow-wrap: anywhere; color: #444b55; }
.home .intro p { margin-bottom: calc(1em * var(--home-spacing, 1)); }
.home .intro p:last-child { margin-bottom: 0; }
.home .intro > h2, .home .intro > h3 { font-size: 1.2em; }
.home .intro ul, .home .intro ol { padding-left: 1.4em; }
.home .intro pre { white-space: pre-wrap; overflow-wrap: anywhere; }
@media (min-width: 761px) and (max-height: 740px) {
  body.home { --home-top: 21px; --home-main-gap: 24px; }
}
@media (max-width: 760px) {
  body.home { --home-top: 28px; --home-main-gap: 33px; }
}
@media (max-width: 600px) {
  body.home { --home-top: 24px; --home-main-gap: 27px; --home-gallery-gap: 17px; }
}
@media (max-width: 380px) and (max-height: 740px) {
  body.home { --home-top: 20px; --home-main-gap: 22px; --home-gallery-gap: 12px; }
}
@media (max-height: 500px) and (min-width: 601px) {
  .home .intro-layout { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 20px; }
  .home .profile-portrait { width: 80px; height: 80px; margin-inline: auto; }
  .home .profile-links { font-size: 10px; }
  .home .site-header { display: flex; }
  .home .site-nav { margin-top: 0; }
  body.home { --home-top: 12px; --home-main-gap: 16px; --home-gallery-gap: 12px; }
}

@media (prefers-reduced-motion: no-preference) {
  body.home { transition: --photo-left 850ms ease, --photo-right 850ms ease; }
  .photo-stage { transition: background-color .3s; }
  a { transition: color .15s; }
}
@media print {
  html:has(body.home), body.home { height: auto; overflow: visible; }
  .home .container { transform: none; }
  .home .intro { font-size: 14px; }
  body::before, .gallery-controls, .skip-link, .preview-bar button { display: none !important; }
  .container { width: 100%; }
}

/* Small previews stay directly above their links. */
#link-preview { position: fixed; inset: auto; margin: 0; padding: 0; width: 160px; border: 1px solid rgb(130 164 195 / 30%); border-radius: 6px; background: rgb(246 250 255 / 94%); backdrop-filter: blur(14px) saturate(130%); box-shadow: 0 3px 12px rgb(54 83 112 / 12%); color: #293b4d; font: 10px/1.35 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; overflow: hidden; }
#link-preview .preview-link { display: block; text-decoration: none; color: inherit; background: none; box-shadow: none; }
#link-preview img { display: block; width: 100%; height: var(--preview-image-height, 52px); object-fit: cover; }
#link-preview img[data-kind="page"] { object-fit: contain; background: white; }
#link-preview .preview-copy { display: grid; gap: 3px; padding: 6px 8px; }
#link-preview .preview-domain { font-size: 8px; color: #627e97; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#link-preview strong { font-size: 10px; font-weight: 600; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
#link-preview .preview-description { font-size: 9px; color: #667787; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
#link-preview.mini .preview-description { display: none; }
#link-preview.is-cosign img { height: auto; }
#link-preview.is-cosign .preview-copy { display: none; }
@media print { #link-preview { display: none !important; } }

.engineering-projects {
  list-style: none;
  padding: 0;
  margin: 0;
}
.engineering-project {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  align-items: start;
  gap: 24px;
  margin-bottom: 44px;
}
.engineering-project:last-child { margin-bottom: 0; }
.engineering-project h2 { font: 500 17px/1.5 var(--serif); }
.engineering-project .item-description { color: #555b64; }
.engineering-image {
  display: block;
  border: 1px solid var(--rule);
  border-radius: 4px;
  overflow: hidden;
}
.engineering-image img { display: block; width: 100%; height: auto; }
@media (max-width: 760px) {
  .engineering-project {
    grid-template-columns: minmax(0, 1fr) clamp(84px, 22vw, 160px);
    gap: clamp(12px, 3vw, 20px);
  }
}

.engineering-more { margin-top: 40px; padding-top: 28px; border-top: 1px solid var(--rule); }
.engineering-more > h2 { font-size: 12px; font-weight: 500; font-family: inherit; line-height: 1.5; color: var(--muted); }
.more-projects { margin-top: 18px; }
.more-projects h3 { font: 500 17px/1.5 var(--serif); }

/* Native essays share the portfolio shell and scroll independently of home fitting. */
.article-page { --article-breakout: clamp(0px, calc((100vw - 616px) / 2), 64px); }
.article-header, .article-body, .article-footer { max-width: 576px; margin-inline: auto; }
.article-header { margin-bottom: 36px; }
.article-header h1 { font: 500 clamp(26px, 4vw, 34px)/1.3 var(--serif); text-wrap: balance; }
.article-description { margin-top: 14px; font-size: 16px; line-height: 1.65; color: #555b64; }
.article-description:empty { display: none; }
.article-byline { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 18px; font-size: 13px; color: var(--muted); }
.article-body { font-size: 16px; line-height: 1.75; overflow-wrap: anywhere; }
.article-body p, .article-body ul, .article-body ol, .article-body blockquote, .article-body pre, .article-body .article-table { margin: 0 0 24px; }
.article-body h2 { margin: 38px 0 14px; font: 500 22px/1.4 var(--serif); }
.article-body h3 { margin: 28px 0 12px; font: 500 18px/1.5 var(--serif); }
.article-body ul, .article-body ol { padding-left: 1.5em; }
.article-body li + li { margin-top: 8px; }
.article-body blockquote { border-left: 2px solid var(--rule); padding-left: 20px; color: #555b64; }
.article-body blockquote p:last-child { margin-bottom: 0; }
.article-body figure { width: calc(100% + 2 * var(--article-breakout)); margin: 32px calc(-1 * var(--article-breakout)); }
.article-body img, .article-body video { display: block; width: 100%; height: auto; border-radius: 3px; }
.article-body figcaption { max-width: 576px; margin: 12px auto 0; font-size: 13px; line-height: 1.6; text-align: center; color: var(--muted); }
.article-body code { font: .88em/1.6 ui-monospace, SFMono-Regular, Consolas, monospace; }
.article-body :not(pre) > code { padding: 2px 4px; background: var(--surface); border-radius: 3px; }
.article-body pre { padding: 18px; background: var(--surface); overflow-x: auto; overflow-wrap: normal; }
.article-body .article-table { overflow-x: auto; }
.article-body table { width: 100%; border-collapse: collapse; font-size: 14px; }
.article-body th, .article-body td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--rule); }
.article-body hr { margin: 32px 0; border: 0; border-top: 1px solid var(--rule); }
.article-body [id] { scroll-margin-top: 24px; }
.article-footer { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--rule); font-size: 13px; }
