/* Arnab Basak — portfolio. Dark by default, light on toggle. */

:root,
:root[data-theme="dark"] {
  --bg: #142130;
  --bg-raised: #1a2a3c;
  --bg-sunk: #0f1a26;
  --text: #e3e8ef;
  --text-soft: #a3b2c3;
  --text-faint: #6f8297;
  --rule: #263a50;
  --rule-strong: #3a5470;
  --amber: #f0b44c;
  --teal: #5cc6bd;
  --link: #f0b44c;
  --grid: rgba(92, 198, 189, 0.07);
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #f4f6f9;
  --bg-raised: #ffffff;
  --bg-sunk: #e9eef4;
  --text: #16212d;
  --text-soft: #47586b;
  --text-faint: #7a8a9b;
  --rule: #d6dee7;
  --rule-strong: #b3c1d0;
  --amber: #a5670a;
  --teal: #1d7f78;
  --link: #a5670a;
  --grid: rgba(29, 127, 120, 0.08);
  color-scheme: light;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.2s, color 0.2s;
}

a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; border-radius: 2px; }

.skip {
  position: absolute; left: -999px; top: 8px;
  background: var(--amber); color: #111; padding: 8px 12px; z-index: 10;
}
.skip:focus { left: 16px; }

h1, h2, h3 {
  font-family: "IBM Plex Sans Condensed", "IBM Plex Sans", sans-serif;
  font-weight: 600;
  line-height: 1.15;
  margin: 0;
}

p { margin: 0 0 1em; }

/* ---------- home: split layout ---------- */

.shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 32px;
  display: grid;
  grid-template-columns: minmax(280px, 400px) 1fr;
  gap: 64px;
}

.ident {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 72px 0 40px;
  display: flex;
  flex-direction: column;
}

.ident__photo {
  width: 84px; height: 84px; border-radius: 50%;
  border: 2px solid var(--rule-strong);
  object-fit: cover;
  margin-bottom: 24px;
}

.ident h1 { font-size: 52px; letter-spacing: -0.01em; }
.ident__role { font-size: 20px; color: var(--text); margin: 10px 0 14px; font-weight: 500; }
.ident__line { color: var(--text-soft); max-width: 34ch; }

.ident__contact { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 8px; font-size: 14.5px; color: var(--text-soft); }
.ident__contact li { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ident__contact svg { width: 16px; height: 16px; flex: none; fill: none; stroke: var(--text-faint); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ident__contact a { color: var(--text-soft); text-decoration: none; overflow-wrap: anywhere; }
.ident__contact a:hover { color: var(--text); text-decoration: underline; }

.ident nav { margin-top: 28px; }
.ident nav ol { list-style: none; padding: 0; margin: 0; }
.ident nav a {
  display: flex; align-items: center; gap: 14px;
  padding: 7px 0;
  color: var(--text-faint);
  text-decoration: none;
  font-weight: 500;
  font-size: 15px;
}
.ident nav a::before {
  content: ""; width: 28px; height: 1px; background: currentColor;
  transition: width 0.2s;
}
.ident nav a:hover,
.ident nav a[aria-current="true"] { color: var(--text); }
.ident nav a:hover::before,
.ident nav a[aria-current="true"]::before { width: 56px; background: var(--amber); }

.ident__foot { margin-top: auto; display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; }
.ident__foot a { color: var(--text-soft); text-decoration: none; font-size: 15px; }
.ident__foot a:hover { color: var(--text); text-decoration: underline; }

.cv {
  border: 1px solid var(--amber);
  color: var(--amber) !important;
  padding: 6px 14px;
  border-radius: 4px;
}
.cv:hover { background: var(--amber); color: var(--bg) !important; text-decoration: none !important; }

.theme {
  background: none;
  border: 1px solid var(--rule-strong);
  color: var(--text-soft);
  border-radius: 50%;
  width: 36px; height: 36px;
  padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.theme svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
:root[data-theme="dark"] .theme .i-moon,
:root[data-theme="light"] .theme .i-sun { display: none; }
.theme:hover { color: var(--text); border-color: var(--text-soft); }

main.content { padding: 72px 0 96px; min-width: 0; }

section { padding-bottom: 88px; scroll-margin-top: 48px; }
section > h2 { font-size: 30px; margin-bottom: 24px; }

.lede { font-size: 22px; line-height: 1.45; color: var(--text); margin-bottom: 24px; }
.content p { color: var(--text-soft); max-width: 66ch; }
.content p strong { color: var(--text); font-weight: 600; }

/* ---------- delivery track (a real sequence) ---------- */

.track { list-style: none; margin: 8px 0 0; padding: 0; counter-reset: stage; }
.track li {
  position: relative;
  padding: 0 0 28px 48px;
  counter-increment: stage;
}
.track li::before {
  content: counter(stage);
  position: absolute; left: 0; top: 2px;
  width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid var(--teal);
  background: var(--bg);
  color: var(--teal);
  font: 600 13px/22px "IBM Plex Mono", monospace;
  text-align: center;
  z-index: 1;
}
.track li::after {
  content: ""; position: absolute; left: 12px; top: 28px; bottom: 0;
  width: 2px; background: var(--rule-strong);
}
.track li:last-child::after { display: none; }
.track h3 { font-size: 21px; margin-bottom: 4px; }
.track p { margin: 0; }
.track .ai { color: var(--amber); }

/* ---------- selected work ---------- */

.work { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.work a {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 24px;
  padding: 22px 24px;
  border: 1px solid var(--rule);
  border-left: 3px solid var(--teal);
  background: var(--bg-raised);
  text-decoration: none;
  color: var(--text);
  border-radius: 2px 6px 6px 2px;
}
.work a:hover { border-color: var(--rule-strong); border-left-color: var(--amber); }
.work h3 { font-size: 22px; }
.work .who { color: var(--text-faint); font-size: 15px; grid-column: 1; }
.work .sum { color: var(--text-soft); grid-column: 1 / -1; margin: 8px 0 0; max-width: 62ch; }
.work .fig {
  grid-row: 1 / span 2; grid-column: 2;
  text-align: right;
  font-family: "IBM Plex Sans Condensed", sans-serif;
  font-size: 30px; font-weight: 600; color: var(--amber); line-height: 1.05;
}
.work .fig small { display: block; font-family: "IBM Plex Sans", sans-serif; font-size: 13px; font-weight: 400; color: var(--text-faint); }
.work .open { grid-column: 1 / -1; margin-top: 10px; font-size: 15px; color: var(--link); }

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

.roles { list-style: none; margin: 0; padding: 0; }
.roles > li { padding: 22px 0; border-top: 1px solid var(--rule); }
.roles .when { color: var(--text-faint); font-size: 14px; letter-spacing: .04em; text-transform: uppercase; margin: 0 0 4px; }
.roles h3 { font-size: 20px; }
.roles .org { color: var(--text-soft); margin: 2px 0 8px; }
.roles ul { margin: 0; padding-left: 18px; color: var(--text-soft); }
.roles ul li { margin-bottom: 4px; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 0; padding: 0; list-style: none; }
.tags li {
  font-size: 13px; color: var(--teal);
  border: 1px solid color-mix(in srgb, var(--teal) 40%, transparent);
  border-radius: 999px; padding: 2px 10px;
}

.also { list-style: none; padding: 0; margin: 0; }
.also li { padding: 12px 0; border-top: 1px solid var(--rule); display: grid; grid-template-columns: 1fr auto; gap: 16px; }
.also b { color: var(--text); font-weight: 600; }
.also span { color: var(--text-soft); }
.also time { color: var(--text-faint); font-size: 15px; white-space: nowrap; }

.creds { margin-top: 56px; }
.creds h3 { font-size: 20px; margin: 32px 0 8px; }
.creds h3:first-child { margin-top: 0; }
.cred-list { list-style: none; margin: 0; padding: 0; }
.cred-list li {
  display: grid; grid-template-columns: 22px 1fr auto; gap: 14px; align-items: start;
  padding: 12px 0; border-top: 1px solid var(--rule);
}
.cred-list svg { width: 20px; height: 20px; margin-top: 3px; fill: none; stroke: var(--teal); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.cred-list b { color: var(--text); font-weight: 600; }
.cred-list span { display: block; color: var(--text-soft); }
.cred-list time { color: var(--text-faint); font-size: 15px; white-space: nowrap; }
.creds .more { margin: 10px 0 0; font-size: 15px; }

.contact-form { display: grid; gap: 14px; max-width: 640px; margin-top: 8px; }
.contact-form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.contact-form label { display: grid; gap: 6px; font-size: 14px; color: var(--text-soft); }
.contact-form input, .contact-form textarea {
  font: inherit; font-size: 16px; color: var(--text); background: transparent;
  border: 1px solid var(--rule); border-radius: 8px; padding: 10px 12px; width: 100%; box-sizing: border-box;
}
.contact-form textarea { resize: vertical; min-height: 120px; }
.contact-form input:focus, .contact-form textarea:focus { outline: 2px solid var(--teal); outline-offset: 1px; border-color: transparent; }
.contact-form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.contact-form .send { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.contact-form button {
  font: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
  color: var(--bg); background: var(--teal); border: 0; border-radius: 999px; padding: 10px 22px;
}
.contact-form button[disabled] { opacity: .6; cursor: progress; }
.contact-form .status { margin: 0; font-size: 15px; color: var(--text-soft); }
.contact-form .status.ok { color: var(--teal); }
.contact-form .status.err { color: var(--amber); }

footer.small { color: var(--text-faint); font-size: 14px; border-top: 1px solid var(--rule); padding-top: 20px; }

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

.cs-top {
  max-width: 1080px; margin: 0 auto; padding: 24px 32px;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
}
.cs-top a.home { color: var(--text-soft); text-decoration: none; font-weight: 500; }
.cs-top a.home:hover { color: var(--text); }

.cs { max-width: 1080px; margin: 0 auto; padding: 24px 32px 96px; }
.cs header { max-width: 780px; padding: 24px 0 40px; }
.cs header .client { color: var(--teal); font-weight: 500; margin-bottom: 10px; }
.cs header h1 { font-size: 56px; letter-spacing: -0.01em; }
.cs header .lede { margin-top: 18px; color: var(--text-soft); }

.facts {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--rule-strong); border-bottom: 1px solid var(--rule);
  margin: 0 0 56px; padding: 0;
}
.facts div { padding: 18px 20px 18px 0; }
.facts dt { color: var(--text-faint); font-size: 14px; }
.facts dd { margin: 4px 0 0; font-weight: 500; }

.cs-body { display: grid; grid-template-columns: 1fr; gap: 0; }
.cs-body > section { padding-bottom: 56px; max-width: 760px; min-width: 0; }
.cs-body > section.wide { max-width: none; }
.cs-body h2 { font-size: 28px; margin-bottom: 16px; }
.cs-body p, .cs-body li { color: var(--text-soft); }
.cs-body ul { padding-left: 20px; }
.cs-body li { margin-bottom: 6px; }
.cs-body strong { color: var(--text); font-weight: 600; }

.outcomes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin: 8px 0 0; padding: 0; }
.outcomes div { border-left: 2px solid var(--amber); padding: 4px 20px 8px 16px; margin-bottom: 20px; }
.outcomes dt {
  font-family: "IBM Plex Sans Condensed", sans-serif; font-size: 34px; font-weight: 600;
  color: var(--text); line-height: 1.1;
}
.outcomes dd { margin: 4px 0 0; color: var(--text-soft); font-size: 15px; }

.next { display: flex; justify-content: space-between; gap: 16px; border-top: 1px solid var(--rule); padding-top: 24px; flex-wrap: wrap; }

/* ---------- diagrams: blueprint drafting style ---------- */

figure.dia { margin: 8px 0 0; }
.dia__frame {
  background-color: var(--bg-sunk);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px;
  border: 1px solid var(--rule-strong);
  border-radius: 6px;
  padding: 20px;
  overflow-x: auto;
}
.dia svg { display: block; width: 100%; height: auto; min-width: 760px; }
.dia figcaption { color: var(--text-faint); font-size: 14px; margin-top: 10px; max-width: 70ch; }

.dia text { font-family: "IBM Plex Mono", monospace; font-size: 12.5px; fill: var(--text); }
.dia .t-soft { fill: var(--text-soft); }
.dia .t-faint { fill: var(--text-faint); font-size: 11.5px; }
.dia .t-lane { fill: var(--text-soft); font-family: "IBM Plex Sans", sans-serif; font-weight: 600; font-size: 13px; }
.dia .t-head { font-family: "IBM Plex Sans", sans-serif; font-weight: 600; font-size: 14px; }
.dia .t-amber { fill: var(--amber); }
.dia .t-teal { fill: var(--teal); }

.dia .lane { fill: none; stroke: var(--rule-strong); stroke-width: 1; }
.dia .lane-head { fill: var(--bg-raised); stroke: var(--rule-strong); }
.dia .task { fill: var(--bg-raised); stroke: var(--text-soft); stroke-width: 1.2; }
.dia .task.hot { stroke: var(--teal); stroke-width: 1.8; }
.dia .task.ext { stroke-dasharray: 5 4; }
.dia .hub { fill: var(--bg-raised); stroke: var(--amber); stroke-width: 2; }
.dia .gw { fill: var(--bg-raised); stroke: var(--amber); stroke-width: 1.6; }
.dia .ev { fill: var(--bg-raised); stroke: var(--teal); stroke-width: 2; }
.dia .ev.end { stroke-width: 4; }
.dia .flow { fill: none; stroke: var(--text-soft); stroke-width: 1.4; marker-end: url(#arrow); }
.dia .flow.alt { stroke-dasharray: 5 4; }
.dia .flow.hot { stroke: var(--teal); marker-end: url(#arrow-teal); }
.dia .arrowhead { fill: var(--text-soft); }
.dia .arrowhead.teal { fill: var(--teal); }
.dia .bar-a { fill: var(--text-faint); }
.dia .bar-b { fill: var(--amber); }

/* ---------- responsive ---------- */

@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; gap: 0; padding: 0 20px; }
  .ident { position: static; height: auto; padding: 48px 0 32px; }
  .ident nav { display: none; }
  .ident__foot { margin-top: 24px; }
  main.content { padding-top: 24px; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .outcomes { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
  body { font-size: 16px; }
  .ident h1 { font-size: 42px; }
  .lede { font-size: 19px; }
  .work a { grid-template-columns: 1fr; padding: 18px; }
  .work .fig { grid-row: auto; grid-column: 1; text-align: left; margin-top: 6px; }
  .contact-form .row { grid-template-columns: 1fr; }
  .also li { grid-template-columns: 1fr; gap: 2px; }
  .cred-list li { grid-template-columns: 22px 1fr; }
  .cred-list time { grid-column: 2; }
  .cs, .cs-top { padding-left: 16px; padding-right: 16px; }
  .cs header h1 { font-size: 40px; }
  .outcomes { grid-template-columns: 1fr; }
  .dia__frame { padding: 12px; }
}

/* ---------- availability + resume button ---------- */

.open-to {
  display: flex; width: fit-content; align-items: center; flex-wrap: wrap; gap: 8px; margin: 14px 0 16px;
  font-size: 14px; font-weight: 600; color: var(--teal);
  border: 1px solid color-mix(in srgb, var(--teal) 45%, transparent);
  background: color-mix(in srgb, var(--teal) 10%, transparent);
  border-radius: 999px; padding: 4px 12px;
}
.open-to .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 3px color-mix(in srgb, var(--teal) 25%, transparent); }
.open-to .modes { font-weight: 400; color: var(--text-soft); }
.cv { display: inline-flex; align-items: center; gap: 8px; }
.cv svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.li-cta { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--rule); max-width: 640px; }
.li-cta p { margin: 0 0 12px; color: var(--text-soft); }
.li-btn {
  display: inline-flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 600;
  color: #fff !important; background: #0a66c2; border-radius: 999px; padding: 10px 20px; text-decoration: none !important;
}
.li-btn:hover { background: #004182; }
.li-btn svg { width: 18px; height: 18px; fill: currentColor; }
