/* manishabhardwaj.in — one stylesheet for the portfolio and its case studies.
   Direction: warm healthcare. Teal is the working voice, coral is reserved for
   "a human needs to look at this", the way it is in the two apps. */

:root {
  --bg:        #FCF8F4;   /* warm linen */
  --bg-2:      #F1F8F5;   /* teal-tinted mint, alternating sections */
  --card:      #FFFFFF;
  --ink:       #1D2926;
  --muted:     #5B6966;
  --line:      #E9E2DA;
  --line-2:    #D8E7E2;

  --teal:      #0F8B7E;
  --teal-deep: #0A6A5F;
  --teal-ink:  #05433C;
  --teal-soft: #DCF1EC;
  --teal-mist: #EAF6F3;

  --coral:     #E0654A;   /* reserved: flagged / needs review */
  --coral-soft:#FFE3DA;
  --coral-ink: #8F3A25;

  --peach:     #FFECDF;
  --amber-ink: #8A5A14;
  --amber-soft:#FFF1D8;

  --display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --body:    "Figtree", "Segoe UI", system-ui, sans-serif;
  --mono:    "DM Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --r: 22px;
  --r-lg: 30px;
  --shadow: 0 1px 2px rgba(29,41,38,.04), 0 14px 34px -14px rgba(15,139,126,.18);
  --shadow-lift: 0 2px 4px rgba(29,41,38,.04), 0 28px 56px -22px rgba(15,139,126,.32);
  --gutter: clamp(1.1rem, 5vw, 4rem);
  --measure: 60ch;
  --ease: cubic-bezier(.2,.7,.2,1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.6;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--teal-deep); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; border-radius: 6px; }

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.08;
  margin: 0;
  text-wrap: balance;
  font-variation-settings: "opsz" 96, "wdth" 100;
}
p { margin: 0 0 1em; max-width: var(--measure); }
p:last-child { margin-bottom: 0; }

.wrap { max-width: 72rem; margin-inline: auto; padding-inline: var(--gutter); }

.eyebrow {
  font-family: var(--body);
  font-weight: 600;
  font-size: .8125rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--teal-deep);
  margin-bottom: 1rem;
}
.field { font-family: var(--mono); font-size: .75rem; letter-spacing: .04em; color: var(--muted); }

.skip { position: absolute; left: -9999px; background: var(--teal-ink); color: #fff; padding: .75rem 1rem; z-index: 20; border-radius: 0 0 12px 0; }
.skip:focus { left: 0; top: 0; }

/* ---------- buttons & chips ---------- */

.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--body); font-weight: 600; font-size: .9375rem;
  padding: .8rem 1.25rem; border-radius: 999px;
  text-decoration: none; border: 1.5px solid transparent;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), background .18s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--teal); color: #fff; box-shadow: 0 10px 24px -12px rgba(15,139,126,.6); }
.btn-primary:hover { background: var(--teal-deep); }
.btn-ghost { background: transparent; color: var(--teal-ink); border-color: var(--line-2); }
.btn-ghost:hover { background: var(--teal-mist); border-color: var(--teal-soft); }
.btn-light { background: #fff; color: var(--teal-ink); }
.btn-light:hover { background: var(--teal-soft); }
.btn svg { width: 1.05em; height: 1.05em; }

.chip {
  display: inline-flex; align-items: center; gap: .45rem;
  font-size: .8125rem; font-weight: 600;
  padding: .35rem .8rem; border-radius: 999px;
  background: var(--teal-soft); color: var(--teal-ink);
}
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .8; }
.chip-uat   { background: var(--amber-soft); color: var(--amber-ink); }
.chip-proto { background: var(--teal-soft); color: var(--teal-ink); }
.chip-flag  { background: var(--coral-soft); color: var(--coral-ink); }

/* ---------- masthead ---------- */

.masthead {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.masthead .wrap {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding-block: .8rem;
}
.wordmark {
  display: inline-flex; align-items: center; gap: .6rem;
  font-family: var(--display); font-weight: 600; font-size: 1rem;
  color: var(--ink); text-decoration: none; letter-spacing: -.01em;
}
.wordmark .mark {
  width: 30px; height: 30px; border-radius: 10px;
  background: var(--teal); color: #fff;
  display: grid; place-items: center;
  font-size: .875rem; font-weight: 700;
}
.masthead nav { display: flex; align-items: center; gap: 1.4rem; }
.masthead nav a { text-decoration: none; font-weight: 500; font-size: .9375rem; }
.masthead nav a:not(.btn) { color: var(--muted); }
.masthead nav a:not(.btn):hover { color: var(--teal-deep); }
.masthead nav .btn { padding: .55rem 1rem; font-size: .875rem; }
@media (max-width: 46rem) {
  .masthead nav a:not(.btn) { display: none; }
}

/* ---------- hero ---------- */

.hero {
  position: relative;
  padding-block: clamp(3rem, 8vw, 6.5rem) clamp(2.5rem, 6vw, 4.5rem);
  overflow: clip;
}
.hero::before {
  /* one soft warm-teal bloom behind the record card */
  content: ""; position: absolute; inset: auto -10% -30% auto;
  width: 60vw; max-width: 760px; aspect-ratio: 1;
  background: radial-gradient(closest-side, rgba(15,139,126,.16), rgba(255,236,223,.55) 55%, transparent 75%);
  pointer-events: none; z-index: 0;
}
.hero .wrap {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 1.08fr .92fr; gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}
.hero h1 {
  font-size: clamp(2.5rem, 5.6vw, 4.375rem);
  max-width: 13ch;
  margin-bottom: 1.25rem;
}
.hero h1 em { font-style: normal; color: var(--teal-deep); }
.hero .lede { font-size: clamp(1.0625rem, 1.5vw, 1.1875rem); color: var(--muted); max-width: 50ch; margin-bottom: 1.75rem; }
.hero .cta { display: flex; flex-wrap: wrap; gap: .75rem; }

.facts { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 2rem; padding: 0; list-style: none; max-width: 40rem; }
.facts li {
  font-size: .875rem; font-weight: 500; color: var(--teal-ink);
  background: #fff; border: 1px solid var(--line-2);
  padding: .45rem .85rem; border-radius: 999px;
}

@media (max-width: 58rem) {
  .hero .wrap { grid-template-columns: 1fr; }
  .hero::before { inset: auto -30% -10% auto; width: 90vw; }
}

/* ---------- the signature: a field being validated ---------- */

.crf {
  background: var(--card);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lift);
  padding: 1.5rem 1.6rem 1.35rem;
  max-width: 30rem;
  margin-inline: auto;
  width: 100%;
}
.crf-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: 1.1rem; }
.crf-head .field { color: var(--teal-deep); }
.crf-value { display: flex; align-items: baseline; gap: .4rem; }
.crf-value .num {
  font-family: var(--display); font-weight: 700; font-size: 3.75rem; line-height: 1;
  letter-spacing: -.03em; font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.crf-value .unit { color: var(--muted); font-weight: 500; }
.crf-rule { font-size: .875rem; color: var(--muted); margin-top: .35rem; }

.crf-steps { list-style: none; margin: 1.25rem 0 0; padding: 0; display: grid; gap: .5rem; }
.crf-steps li {
  display: flex; align-items: center; gap: .7rem;
  font-size: .9375rem; padding: .6rem .8rem;
  border-radius: 14px; background: var(--bg);
}
.crf-steps li .ico {
  width: 26px; height: 26px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-size: .8rem; font-weight: 700;
  background: var(--teal-soft); color: var(--teal-ink);
}
.crf-steps li.flag { background: var(--coral-soft); color: var(--coral-ink); font-weight: 600; }
.crf-steps li.flag .ico { background: var(--coral); color: #fff; }
.crf-steps li.lock { background: var(--teal-soft); color: var(--teal-ink); font-weight: 600; }
.crf-steps li.lock .ico { background: var(--teal); color: #fff; }
.crf-steps li .when { margin-left: auto; font-family: var(--mono); font-size: .72rem; color: var(--muted); font-weight: 400; white-space: nowrap; }

.crf-track { display: flex; align-items: center; gap: .4rem; margin-top: 1.2rem; }
.crf-track span { flex: 1; height: 5px; border-radius: 999px; background: var(--line); transition: background .4s; }
.crf-track span.on { background: var(--teal); }
.crf-track span.on.flag { background: var(--coral); }
.crf-caption { display: flex; justify-content: space-between; margin-top: .4rem; }
.crf-caption .field { font-size: .66rem; }

/* choreography — everything hidden, then let in on a schedule */
@media (prefers-reduced-motion: no-preference) {
  .crf { animation: rise .7s var(--ease) .15s backwards; }
  .crf-steps li { opacity: 0; transform: translateY(6px); animation: stepin .45s var(--ease) forwards; }
  .crf-steps li:nth-child(1) { animation-delay: 1.5s; }
  .crf-steps li:nth-child(2) { animation-delay: 2.35s; }
  .crf-steps li:nth-child(3) { animation-delay: 3.2s; }
  .crf-steps li:nth-child(4) { animation-delay: 4.05s; }
  /* static markup already carries .on/.flag so reduced-motion shows the end state;
     here they start grey and are switched on in step with the rows */
  .crf-track span.on:nth-child(1) { background: var(--line); animation: trackon .01s linear .3s forwards; }
  .crf-track span.on:nth-child(2) { background: var(--line); animation: trackflag .01s linear 1.5s forwards; }
  .crf-track span.on:nth-child(3) { background: var(--line); animation: trackon .01s linear 3.2s forwards; }
  .crf-track span.on:nth-child(4) { background: var(--line); animation: trackon .01s linear 4.05s forwards; }
  .rise { animation: rise .7s var(--ease) backwards; }
  .rise:nth-child(1) { animation-delay: .05s; }
  .rise:nth-child(2) { animation-delay: .14s; }
  .rise:nth-child(3) { animation-delay: .23s; }
  .rise:nth-child(4) { animation-delay: .32s; }
  .rise:nth-child(5) { animation-delay: .41s; }
}
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }
@keyframes stepin { to { opacity: 1; transform: none; } }
@keyframes trackon { to { background: var(--teal); } }
@keyframes trackflag { to { background: var(--coral); } }

/* ---------- sections ---------- */

main > section { padding-block: clamp(3.5rem, 7vw, 6rem); }
main > section.tint { background: var(--bg-2); }
.section-head { margin-bottom: clamp(1.75rem, 4vw, 2.75rem); }
.section-head h2 { font-size: clamp(1.75rem, 3.4vw, 2.5rem); margin-bottom: .6rem; }
.section-head p { color: var(--muted); font-size: 1.0625rem; }

/* scroll reveal — one class, one observer */
@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
  .reveal.in { opacity: 1; transform: none; }
  .reveal[data-delay="1"] { transition-delay: .1s; }
  .reveal[data-delay="2"] { transition-delay: .2s; }
  .reveal[data-delay="3"] { transition-delay: .3s; }
}

/* ---------- lifecycle: four stages on one track ---------- */

.stages { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.stages::before {
  content: ""; position: absolute; left: 3rem; right: 3rem; top: 2.9rem; height: 3px;
  background: linear-gradient(90deg, var(--teal-soft), var(--teal), var(--teal-soft));
  border-radius: 999px; z-index: 0;
}
.stage {
  position: relative; z-index: 1;
  background: var(--card); border-radius: var(--r); box-shadow: var(--shadow);
  padding: 1.4rem 1.35rem 1.5rem;
}
.stage .ico {
  width: 46px; height: 46px; border-radius: 16px; display: grid; place-items: center;
  background: var(--teal-soft); color: var(--teal-deep); margin-bottom: 1rem;
  outline: 6px solid var(--card);
}
.stage .ico svg { width: 22px; height: 22px; }
.stage.resolve .ico { background: var(--peach); color: var(--coral-ink); }
.stage .label { font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--teal-deep); display: block; margin-bottom: .35rem; }
.stage.resolve .label { color: var(--coral-ink); }
.stage h3 { font-size: 1.125rem; margin-bottom: .5rem; }
.stage p { font-size: .9375rem; color: var(--muted); }
@media (max-width: 60rem) {
  .stages { grid-template-columns: repeat(2, 1fr); }
  .stages::before { display: none; }
}
@media (max-width: 34rem) { .stages { grid-template-columns: 1fr; } }

/* ---------- projects ---------- */

.projects { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
.project {
  position: relative; overflow: hidden;
  background: var(--card); border-radius: var(--r-lg); box-shadow: var(--shadow);
  display: grid; grid-template-columns: 1.15fr .85fr; gap: 1rem;
  padding: 1.75rem 0 0 1.75rem;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
.project:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); }
.project .body { padding-bottom: 1.75rem; display: flex; flex-direction: column; }
.project h3 { font-size: 1.375rem; margin: .9rem 0 .6rem; }
.project h3 a { color: inherit; text-decoration: none; }
.project h3 a::after { content: ""; position: absolute; inset: 0; }
.project p { font-size: .9375rem; color: var(--muted); }
.project .links { position: relative; z-index: 2; margin-top: auto; padding-top: 1.25rem; display: flex; flex-wrap: wrap; gap: .5rem; }
.project .links .btn { padding: .6rem 1rem; font-size: .875rem; }
.phone {
  align-self: end; justify-self: end;
  width: min(100%, 230px); margin-bottom: -18%;
  border-radius: 30px; border: 6px solid #fff;
  box-shadow: 0 30px 50px -26px rgba(29,41,38,.45), 0 0 0 1px var(--line);
  overflow: hidden; background: #fff;
  transform: rotate(-3deg) translateX(6px);
  transition: transform .35s var(--ease);
}
.project:hover .phone { transform: rotate(-1.5deg) translate(4px, -6px); }
.phone img { width: 100%; }
@media (max-width: 62rem) { .projects { grid-template-columns: 1fr; } }
@media (max-width: 30rem) {
  .project { grid-template-columns: 1fr; padding: 1.5rem 1.5rem 0; }
  .phone { justify-self: center; width: 200px; transform: none; }
}

/* ---------- experience ---------- */

.timeline { position: relative; display: grid; gap: 1.25rem; }
.timeline::before { content: ""; position: absolute; left: 11.5rem; top: 1.2rem; bottom: 1.2rem; width: 2px; background: var(--line-2); }
.job { display: grid; grid-template-columns: 10rem 1fr; gap: 0 3rem; position: relative; }
.job .when { font-weight: 600; font-size: .9375rem; color: var(--teal-deep); padding-top: 1.35rem; }
.job .when::after {
  content: ""; position: absolute; left: calc(11.5rem - 5px); top: 1.85rem;
  width: 12px; height: 12px; border-radius: 50%; background: var(--teal);
  outline: 4px solid var(--bg);
}
.job .card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 1.35rem 1.5rem; }
.job h3 { font-size: 1.125rem; margin-bottom: .2rem; }
.job .org { color: var(--muted); font-size: .9375rem; margin-bottom: .8rem; }
.job ul { margin: 0; padding-left: 1.15rem; }
.job li { font-size: .9375rem; margin-bottom: .4rem; }
.job li::marker { color: var(--teal); }
@media (max-width: 46rem) {
  .timeline::before, .job .when::after { display: none; }
  .job { grid-template-columns: 1fr; gap: .25rem; }
  .job .when { padding-top: 0; }
}

/* ---------- background cards ---------- */

.cards3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 1.4rem 1.5rem; }
.card h3 { font-size: 1.0625rem; margin-bottom: .9rem; display: flex; align-items: center; gap: .6rem; }
.card h3 .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--teal); }
.card ul { list-style: none; margin: 0; padding: 0; }
.card li { padding-block: .6rem; border-top: 1px solid var(--line); font-size: .9375rem; }
.card li:first-child { border-top: 0; padding-top: 0; }
.card li:last-child { padding-bottom: 0; }
.card .sub { display: block; color: var(--muted); font-size: .8125rem; margin-top: .15rem; }
@media (max-width: 56rem) { .cards3 { grid-template-columns: 1fr; } }

/* ---------- contact ---------- */

.contact-panel {
  background: linear-gradient(135deg, var(--teal-deep), var(--teal-ink));
  color: #fff; border-radius: var(--r-lg);
  padding: clamp(2rem, 5vw, 3.5rem);
  display: grid; grid-template-columns: 1.2fr .8fr; gap: 2rem; align-items: center;
  box-shadow: var(--shadow-lift);
}
.contact-panel h2 { font-size: clamp(1.75rem, 3.4vw, 2.5rem); margin-bottom: .75rem; }
.contact-panel p { color: rgba(255,255,255,.82); }
.contact-panel .mail { font-family: var(--display); font-weight: 600; font-size: clamp(1.125rem, 2.4vw, 1.5rem); color: #fff; text-decoration: none; word-break: break-all; }
.contact-panel .mail:hover { text-decoration: underline; }
.contact-panel .side { display: grid; gap: .75rem; justify-items: start; }
@media (max-width: 50rem) { .contact-panel { grid-template-columns: 1fr; } }

footer { padding-block: 2rem 3rem; color: var(--muted); font-size: .875rem; }
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 2rem; }
footer p { margin: 0; }

/* ---------- case-study pages ---------- */

.cs-hero .wrap { display: grid; grid-template-columns: 1fr; gap: 2rem; }
.cs-hero h1 { font-size: clamp(2.125rem, 4.6vw, 3.5rem); max-width: 18ch; margin-bottom: 1rem; }
.cs-meta {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 1rem;
  background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 1.35rem 1.5rem;
  margin-top: 1.75rem;
}
.cs-meta .field { display: block; margin-bottom: .25rem; }
.cs-meta strong { font-weight: 600; display: block; }
.cs-meta .sub { color: var(--muted); font-size: .875rem; }

.showcase { position: relative; margin-top: clamp(1.5rem, 4vw, 3rem); }
.browser {
  border-radius: 18px; overflow: hidden; background: #fff;
  box-shadow: var(--shadow-lift), 0 0 0 1px var(--line);
}
.browser .bar { height: 30px; background: #F3EFEA; display: flex; align-items: center; gap: 6px; padding-left: 12px; border-bottom: 1px solid var(--line); }
.browser .bar i { width: 9px; height: 9px; border-radius: 50%; background: #DDD5CB; }
.showcase .phone { position: absolute; right: 3%; bottom: -8%; width: min(26%, 210px); margin: 0; transform: rotate(-4deg); }
@media (max-width: 40rem) { .showcase .phone { display: none; } }

.callout {
  background: var(--card); border-left: 5px solid var(--teal); border-radius: 16px;
  box-shadow: var(--shadow); padding: 1.25rem 1.5rem; max-width: 46rem;
}
.callout.flag { border-left-color: var(--coral); }
.prose p { max-width: 62ch; }
.prose { display: grid; gap: 0; }

.modules { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1rem; }
.module { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 1.3rem 1.35rem; }
.module .who { font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--teal-deep); }
.module h3 { font-size: 1.0625rem; margin: .5rem 0 .4rem; }
.module p { font-size: .9125rem; color: var(--muted); }

.dict { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; max-width: 48rem; }
.dict .row { display: grid; grid-template-columns: 9rem 1fr; gap: 1rem; padding: .9rem 1.35rem; border-top: 1px solid var(--line); }
.dict .row:first-child { border-top: 0; background: var(--teal-mist); }
.dict .row .field { color: var(--teal-deep); padding-top: .15rem; }
.dict .row .sub { display: block; color: var(--muted); font-size: .875rem; }
@media (max-width: 34rem) { .dict .row { grid-template-columns: 1fr; gap: .25rem; } }

.gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); gap: 1.25rem; }
.gallery figure { margin: 0; }
.gallery img { border-radius: 16px; box-shadow: var(--shadow), 0 0 0 1px var(--line); }
.gallery figcaption { font-size: .875rem; color: var(--muted); margin-top: .6rem; }

@media print {
  .masthead, .btn, .crf-track { display: none; }
  body { background: #fff; }
  section { break-inside: avoid; }
}
