/* Chinmay Kumar T — portfolio
   Palette (user-supplied): taupe #6a6053, sage #92958a, grey-green #a0b1aa,
   mint #c0dbc4, light mint #d3ebd3. Darker text shades are derived from the taupe
   and sage so body copy clears 4.5:1 on the mint ground. */

:root {
  --paper: #d3ebd3;
  --paper-deep: #c0dbc4;
  --sage: #a0b1aa;
  --sage-deep: #92958a;
  --ink: #3a342c;
  --ink-soft: #6a6053;
  --ink-mute: #5f665f;
  --rule: #a0b1aa;
  --mark: #6a6053;
  --mark-deep: #3a342c;
  --mark-tint: #c0dbc4;

  --serif: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --measure: 66ch;
  --gutter: clamp(1.25rem, 5vw, 4rem);
  --page: 1180px;
  --edge: max(var(--gutter), calc((100% - var(--page)) / 2));
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  color-scheme: light;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--head-h, 4.5rem) + 1rem);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--mark);
  outline-offset: 3px;
  border-radius: 2px;
}

::selection { background: var(--mark); color: var(--paper); }

.skip {
  position: absolute;
  left: 1rem; top: -3rem;
  padding: .5rem .75rem;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  z-index: 10;
}
.skip:focus { top: 1rem; }

/* ---------- Masthead ---------- */

.masthead {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: baseline;
  gap: 2rem;
  padding: 1.1rem var(--edge);
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
  font-size: .9375rem;
}
.wordmark {
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 500;
  font-variation-settings: "opsz" 24;
  text-decoration: none;
  letter-spacing: -0.01em;
  margin-right: auto;
}
.masthead nav { display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; }
.masthead nav a,
.resume-link {
  color: var(--ink-soft);
  text-decoration: none;
  transition: color .2s var(--ease-out);
}
.masthead nav a:hover,
.resume-link:hover { color: var(--mark); }
.masthead nav a[aria-current="true"] {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: .35em;
  text-decoration-color: var(--mark);
  text-decoration-thickness: 2px;
}
.resume-link { font-weight: 500; }

/* ---------- Layout ---------- */

main { padding: 0 var(--edge); }

section {
  padding-block: clamp(3.5rem, 8vw, 6.5rem);
  border-bottom: 1px solid var(--rule);
}
section:last-of-type { border-bottom: 0; }

h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.75rem, 3.2vw, 2.5rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-wrap: balance;
  margin: 0 0 clamp(2rem, 4vw, 3.25rem);
  max-width: 24ch;
}

/* ---------- Hero ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 30%);
  align-items: center;
  gap: 2rem clamp(2rem, 5vw, 5rem);
  padding-top: clamp(3rem, 9vw, 7rem);
  padding-bottom: clamp(4rem, 10vw, 8rem);
}
.hero-copy { min-width: 0; }
.hero-object {
  position: relative;
  aspect-ratio: 1;
  max-height: 70vh;
  justify-self: end;
  width: 100%;
}
.hero-object canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.hero-where {
  margin: 0 0 1.75rem;
  color: var(--ink-mute);
  font-size: .9375rem;
}
h1 {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-variation-settings: "opsz" 144;
  line-height: 1.02;
  letter-spacing: -0.03em;
  margin: 0;
  max-width: 14ch;
}
h1 .line {
  display: block;
  overflow: hidden;
  padding-bottom: .06em;
  margin-bottom: -.06em;
}
h1 .line > span {
  display: block;
  transform: translateY(0);
}
h1 .em {
  font-style: italic;
  font-weight: 400;
  color: var(--mark);
}
.hero-lede {
  max-width: var(--measure);
  margin: 2.25rem 0 0;
  font-size: clamp(1.0625rem, 1.5vw, 1.25rem);
  line-height: 1.55;
  color: var(--ink-soft);
}
.hero-seeking {
  max-width: var(--measure);
  margin: 1.75rem 0 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  font-size: 1rem;
}
.hero-seeking a {
  display: inline-block;
  margin-left: .35rem;
  color: var(--mark);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: .25em;
  text-decoration-thickness: 1.5px;
  transition: color .2s var(--ease-out);
}
.hero-seeking a:hover { color: var(--mark-deep); }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem 1rem;
  margin-top: 1.5rem;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  padding: .75rem 1.25rem;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform .2s var(--ease-out), background-color .2s var(--ease-out),
              border-color .2s var(--ease-out), box-shadow .2s var(--ease-out);
}
.btn svg { width: 1.15rem; height: 1.15rem; }
.btn-primary {
  background: var(--ink);
  color: var(--paper);
  box-shadow: 0 12px 26px -18px rgba(58, 52, 44, .8);
}
.btn-primary:hover {
  background: var(--ink-soft);
  transform: translateY(-2px);
  box-shadow: 0 18px 30px -18px rgba(58, 52, 44, .9);
}
.btn-quiet {
  color: var(--ink);
  border-color: var(--sage-deep);
  background: color-mix(in srgb, var(--paper) 45%, transparent);
}
.btn-quiet:hover {
  background: color-mix(in srgb, var(--paper) 80%, transparent);
  transform: translateY(-2px);
}

/* Entrance: the one authored motion moment. */
@media (prefers-reduced-motion: no-preference) {
  .js h1 .line > span {
    animation: rise .9s var(--ease-out) both;
  }
  .js h1 .line:nth-child(2) > span { animation-delay: .08s; }
  .js h1 .line:nth-child(3) > span { animation-delay: .16s; }
  .js .hero-where,
  .js .hero-object,
  .js .hero-lede,
  .js .hero-seeking {
    animation: settle .8s var(--ease-out) both;
  }
  .js .hero-lede { animation-delay: .32s; }
  .js .hero-seeking { animation-delay: .42s; }
  .js .hero-actions { animation: settle .8s var(--ease-out) both; animation-delay: .52s; }
  .js .hero-object { animation-delay: .2s; animation-duration: 1.2s; }
}
@keyframes rise {
  from { transform: translateY(110%); }
  to   { transform: translateY(0); }
}
@keyframes settle {
  from { opacity: 0; transform: translateY(8px); filter: blur(2px); }
  to   { opacity: 1; transform: translateY(0); filter: blur(0); }
}

/* ---------- Projects ---------- */

.project {
  display: grid;
  grid-template-columns: minmax(0, 18rem) minmax(0, 1fr);
  gap: 2rem clamp(2rem, 5vw, 5rem);
  padding-block: 3rem;
  border-top: 1px solid var(--rule);
}
.project:last-child { padding-bottom: 0; }

.project-head h3,
.role-head h3 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.5rem;
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0 0 .6rem;
  text-wrap: balance;
}
.live {
  display: inline-block;
  font-family: var(--mono);
  font-size: .8125rem;
  color: var(--mark);
  text-decoration: none;
  word-break: break-all;
  padding: .3rem 0;
  border-bottom: 1px solid color-mix(in srgb, var(--mark) 40%, transparent);
  transition: border-color .2s var(--ease-out), color .2s var(--ease-out);
}
.live::after {
  content: " ↗";
  font-family: var(--sans);
}
.live:hover { border-bottom-color: var(--mark); color: var(--mark-deep); }

.project-body { max-width: var(--measure); }
.project-what {
  margin: 0 0 1.25rem;
  font-size: 1.125rem;
  line-height: 1.5;
}
.project-points {
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--ink-soft);
}
.project-points li {
  position: relative;
  padding-left: 1.4rem;
  margin-bottom: .55rem;
}
.project-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .72em;
  width: .6rem;
  height: 1px;
  background: var(--mark);
}

.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem 2.5rem;
  margin: 1.5rem 0 0;
  padding-top: 1rem;
  border-top: 1px dashed var(--rule);
  font-size: .9375rem;
}
.project-meta div { display: flex; gap: .6rem; }
.project-meta dt { color: var(--ink-mute); }
.project-meta dd { margin: 0; }

.results {
  border-collapse: collapse;
  margin: 1.5rem 0 0;
  font-size: .9375rem;
  min-width: 18rem;
}
.results th {
  text-align: left;
  font-weight: 500;
  color: var(--ink-mute);
  padding: .35rem 2rem .35rem 0;
  border-bottom: 1px solid var(--ink);
}
.results td {
  padding: .5rem 2rem .5rem 0;
  border-bottom: 1px solid var(--rule);
}
.results code {
  font-family: var(--mono);
  font-size: 1rem;
  color: var(--mark);
}

/* ---------- Experience ---------- */

.role {
  display: grid;
  grid-template-columns: minmax(0, 18rem) minmax(0, 1fr);
  gap: 1rem clamp(2rem, 5vw, 5rem);
  padding-block: 2.5rem;
  border-top: 1px solid var(--rule);
}
.role:last-child { padding-bottom: 0; }
.role-when {
  margin: 0;
  font-family: var(--mono);
  font-size: .8125rem;
  color: var(--ink-mute);
}
.role .project-points,
.role-body { max-width: var(--measure); }
.role-body > .role-line:first-child { margin-bottom: 1.1rem; }
.role-line {
  margin: 0 0 .5rem;
  color: var(--ink-soft);
}
.role-line:first-of-type { color: var(--ink); }

/* ---------- Contact ---------- */

.contact-lede {
  max-width: var(--measure);
  margin: -1.5rem 0 2.25rem;
  font-size: 1.125rem;
  color: var(--ink-soft);
}
.contact-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 clamp(2rem, 5vw, 4rem);
  max-width: 60rem;
}
.contact-list li:nth-child(2) { border-top: 1px solid var(--rule); }
.contact-list li:nth-last-child(2) { border-bottom: 1px solid var(--rule); }
.contact-list li {
  display: grid;
  grid-template-columns: 6rem minmax(0, 1fr);
  gap: 1rem;
  padding: .85rem 0;
  border-top: 1px solid var(--rule);
}
.contact-list li:last-child { border-bottom: 1px solid var(--rule); }
.contact-list span { color: var(--ink-mute); }
.contact-list a {
  text-decoration: none;
  overflow-wrap: anywhere;
  transition: color .2s var(--ease-out);
}
.contact-list a:hover { color: var(--mark); }

/* ---------- Colophon ---------- */

.colophon {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem 2rem;
  padding: 2.25rem var(--edge) 2.5rem;
  border-top: 1px solid var(--rule);
  background: var(--paper-deep);
  color: var(--ink-mute);
  font-size: .9375rem;
}
.colophon p { margin: 0; }
.colophon strong { color: var(--ink); font-weight: 500; }
.colophon-left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem 1.25rem;
}
.colophon-left .made { display: inline-flex; align-items: center; gap: .35rem; }
.colophon-left .clock {
  padding-left: 1.25rem;
  border-left: 1px solid var(--rule);
}
.heart {
  width: 1rem;
  height: 1rem;
  fill: #b3401e;
  transform-origin: center;
}
@media (prefers-reduced-motion: no-preference) {
  .heart { animation: beat 1.6s ease-in-out infinite; }
}
@keyframes beat {
  0%, 100% { transform: scale(1); }
  14% { transform: scale(1.18); }
  28% { transform: scale(1); }
  42% { transform: scale(1.12); }
  56% { transform: scale(1); }
}
.clock #local-time { font-variant-numeric: tabular-nums; }
.mail-pill {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  padding: .7rem 1.1rem;
  border: 1px solid var(--sage);
  border-radius: 8px;
  color: var(--ink);
  text-decoration: none;
  background: color-mix(in srgb, var(--paper) 60%, transparent);
  transition: border-color .2s var(--ease-out), background-color .2s var(--ease-out), transform .2s var(--ease-out);
}
.mail-pill svg { width: 1.1rem; height: 1.1rem; fill: var(--ink-soft); }
.mail-pill:hover {
  border-color: var(--ink-soft);
  background: var(--paper);
  transform: translateY(-1px);
}

/* ---------- Responsive ---------- */

@media (max-width: 760px) {
  .colophon-left .clock { padding-left: 0; border-left: 0; }
  .mail-pill { width: 100%; justify-content: center; overflow-wrap: anywhere; }
  .masthead {
    flex-wrap: wrap;
    gap: .5rem 1.25rem;
    padding-block: .9rem;
  }
  .wordmark { flex-basis: 100%; margin-right: 0; }
  .masthead nav { gap: .35rem 1rem; }
  .resume-link { margin-left: auto; align-self: flex-start; }

  .hero { grid-template-columns: 1fr; }
  .hero-object { max-width: 16rem; justify-self: start; order: -1; margin-bottom: -1rem; }
  .about,
  .project,
  .role { grid-template-columns: 1fr; gap: 1rem; }
  .about-aside { display: none; }
  .contact-list { grid-template-columns: 1fr; }
  .contact-list li { grid-template-columns: 1fr; gap: .15rem; }
  .contact-list li:nth-last-child(2) { border-bottom: 0; }
  h1 { max-width: none; }
}


/* ---------- Project links on the index ---------- */

.project-head h3 a {
  text-decoration: none;
  transition: color .2s var(--ease-out);
}
.project-head h3 a:hover { color: var(--mark); text-decoration: underline; text-underline-offset: .18em; text-decoration-thickness: 1.5px; }
.more {
  display: inline-block;
  margin-top: 1.25rem;
  font-weight: 500;
  color: var(--mark);
  text-decoration: underline;
  text-underline-offset: .25em;
  text-decoration-thickness: 1.5px;
  transition: color .2s var(--ease-out);
}
.more::after { content: " →"; }
.more:hover { color: var(--mark-deep); }

/* ---------- Project detail pages ---------- */

.detail .detail-intro {
  padding-top: clamp(3rem, 8vw, 6rem);
  padding-bottom: clamp(2rem, 4vw, 3rem);
}
.detail .detail-intro h1 {
  font-size: clamp(2.25rem, 5vw, 4rem);
  font-weight: 400;
  max-width: 18ch;
  margin: 1.25rem 0 1rem;
}
.back {
  font-size: .9375rem;
  color: var(--ink-mute);
  text-decoration: none;
  transition: color .2s var(--ease-out);
}
.back::before { content: "← "; }
.back:hover { color: var(--mark); }
.detail-body { max-width: var(--measure); }
.detail-body .project-what { font-size: 1.25rem; }
.detail-nav { padding-block: 2.5rem; }

.screens h2 { margin-bottom: 1.75rem; }
.screen-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr));
  gap: 1.5rem;
}
.screen-grid figure {
  margin: 0;
  padding: .5rem;
  background: var(--paper-deep);
  border: 1px solid var(--sage);
  border-radius: 10px;
  box-shadow: 0 18px 40px -24px rgba(58, 52, 44, .45), 0 2px 6px -2px rgba(58, 52, 44, .2);
}
.screen-grid img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 5px;
}
.screen-grid figure.wide { grid-column: 1 / -1; }

/* ---------- Background shader ---------- */

.bg-shader {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}
.has-shader .masthead {
  background: color-mix(in srgb, var(--paper) 72%, transparent);
}
.has-shader .colophon {
  background: color-mix(in srgb, var(--paper-deep) 70%, transparent);
}

/* ---------- About ---------- */

.about {
  display: grid;
  grid-template-columns: minmax(0, 18rem) minmax(0, 1fr);
  gap: 1.5rem clamp(2rem, 5vw, 5rem);
  align-items: start;
}
.about h2 { grid-column: 1 / -1; }
.about-aside { margin: 0; }
.about-aside p {
  margin: 0 0 .6rem;
  padding-top: .6rem;
  border-top: 1px solid var(--rule);
  font-size: .9375rem;
  color: var(--ink-mute);
}
.about-body { max-width: var(--measure); }
.about-body p {
  margin: 0 0 1.1rem;
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--ink-soft);
}
.about-body p:first-child { color: var(--ink); }
.about-body p:last-child { margin-bottom: 0; }

/* ---------- Skills grid ---------- */

.skill-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
  gap: .9rem;
  max-width: 66rem;
}
.skill {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .75rem;
  aspect-ratio: 4 / 3;
  padding: 1rem .75rem;
  color: var(--ink);
  background: color-mix(in srgb, var(--paper) 55%, transparent);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid color-mix(in srgb, var(--sage) 65%, transparent);
  border-radius: 12px;
  box-shadow: 0 10px 24px -20px rgba(58, 52, 44, .5);
  transition: transform .25s var(--ease-out), box-shadow .25s var(--ease-out),
              background-color .25s var(--ease-out), border-color .25s var(--ease-out);
}
.skill:hover {
  transform: translateY(-3px);
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  border-color: var(--sage-deep);
  box-shadow: 0 18px 32px -22px rgba(58, 52, 44, .6);
}
.skill-img {
  width: 2.25rem;
  height: 2.25rem;
  object-fit: contain;
}
.skill-icon {
  width: 2.25rem;
  height: 2.25rem;
  background: var(--brand);
  -webkit-mask: var(--icon) center / contain no-repeat;
  mask: var(--icon) center / contain no-repeat;
}
.skill span {
  font-size: .9375rem;
  font-weight: 500;
  text-align: center;
  line-height: 1.2;
  color: var(--ink-soft);
}
.skills-more {
  max-width: var(--measure);
  margin: 1.75rem 0 0;
  color: var(--ink-mute);
  font-size: .9375rem;
}

/* ---------- Projects inside Work Experience ---------- */

.projects { margin-top: 3.5rem; }
.projects-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.4rem, 2.4vw, 1.9rem);
  letter-spacing: -0.015em;
  margin: 0 0 1.5rem;
}
.projects .project:last-child { padding-bottom: 0; }

@media (max-width: 760px) {
  .skill-grid { grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr)); gap: .7rem; }
  .skill svg { width: 2.1rem; height: 2.1rem; }
  .skill span { font-size: .875rem; }
}

.load-error {
  margin: 0;
  padding: 1rem 0;
  color: var(--ink-soft);
}

/* ---------- Project icon ---------- */

.project-icon {
  display: block;
  width: 2.5rem;
  height: 2.5rem;
  margin-bottom: .7rem;
  object-fit: contain;
  padding: .35rem;
  background: color-mix(in srgb, var(--paper) 60%, transparent);
  border: 1px solid color-mix(in srgb, var(--sage) 65%, transparent);
  border-radius: 9px;
}
.project-icon-lg {
  width: 3.25rem;
  height: 3.25rem;
  margin-bottom: 0;
  flex: none;
}
.detail-title {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.25rem 0 1rem;
}
.detail-title h1 { margin: 0; }
