/* upputuri.dev: editorial layout, hand-written CSS. site.js only adds small enhancements. */

@font-face {
  font-family: "Newsreader";
  src: url("/fonts/newsreader.woff2") format("woff2");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("/fonts/newsreader-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("/fonts/ibm-plex-sans.woff2") format("woff2");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}

/* Office paper and fountain-pen blue. --control is for borders people click (3:1). */
:root {
  --paper: #fafaf8;
  --ink: #1b1d21;
  --ink-soft: #3b3f46;
  --muted: #5f646c;
  --rule: #d6d8db;
  --control: #8a8f97;
  --accent: #1e4f91;
  --hit: #d3e0f3;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "IBM Plex Sans", -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #131518;
    --ink: #e8e9eb;
    --ink-soft: #c4c7cc;
    --muted: #969ba3;
    --rule: #2c3035;
    --control: #5d636b;
    --accent: #8fb4e8;
    --hit: #233a5c;
  }
  /* Logos with dark ink (Comenius, SASTRA) get a light version on the dark theme */
  .logo img.ink-dark { filter: invert(1) hue-rotate(180deg) brightness(1.15); }
  .logo img.ink-dark[data-tone="mono"] { filter: grayscale(1) invert(1) brightness(1.1); }
  .bldg .a-brick { stroke: #d9735c; }
  .bldg .a-blue { stroke: #4a90d9; }
}

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

html {
  -webkit-text-size-adjust: 100%; scroll-padding-top: 4.5rem;
  scrollbar-color: var(--control) transparent; accent-color: var(--accent);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-optical-sizing: auto;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--hit); color: var(--ink); }

a {
  color: inherit;
  text-decoration-color: var(--control); text-decoration-thickness: 1px; text-underline-offset: 0.18em;
  transition: color 0.12s ease-out, text-decoration-color 0.12s ease-out;
}
a:hover { color: var(--accent); text-decoration-color: currentColor; }
a:focus-visible,
button:focus-visible,
summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }

p, li, dd { text-wrap: pretty; }
h1, h2, h3 { text-wrap: balance; }
.nowrap { white-space: nowrap; }

.wrap { max-width: 68rem; margin: 0 auto; padding: 0 2rem; }

.skip {
  position: absolute; left: 1rem; top: -3rem; z-index: 20;
  background: var(--ink); color: var(--paper);
  padding: 0.5rem 0.75rem; font-family: var(--sans); font-size: 0.875rem;
}
.skip:focus { top: 1rem; }
.skip:hover, .skip:focus { color: var(--paper); }

/* ---------- Masthead ---------- */
.masthead {
  position: sticky; top: 0; z-index: 10;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}
.masthead-inner {
  display: flex; align-items: center; gap: 1.5rem;
  padding-top: 0.6rem; padding-bottom: 0.6rem;
  font-family: var(--sans); font-size: 0.875rem;
}
.wordmark { font-weight: 600; text-decoration: none; color: var(--ink); }
.masthead nav { display: flex; flex-wrap: wrap; gap: 0 1.5rem; margin-left: auto; }
.masthead nav a { color: var(--muted); text-decoration: none; padding: 0.35rem 0; }
.masthead nav a:hover { color: var(--accent); }
.masthead nav a[aria-current="true"] {
  color: var(--ink);
  text-decoration: underline; text-decoration-color: var(--accent);
  text-decoration-thickness: 2px; text-underline-offset: 0.5em;
}
.resume-link {
  color: var(--accent); font-weight: 500; text-decoration: none; white-space: nowrap;
  border: 1px solid currentColor; border-radius: 3px; padding: 0.3rem 0.65rem;
}
.resume-link:hover { background: var(--accent); color: var(--paper); }

/* ---------- Hero ---------- */
.hero {
  display: grid; grid-template-columns: minmax(0, 1fr) 12.5rem; gap: 3rem;
  align-items: end;
  padding: 4.5rem 0 3rem;
  border-bottom: 1px solid var(--rule);
}
.hero .hero-text { grid-column: 1; grid-row: 1; }
h1 {
  margin: 0;
  max-width: 17ch;
  font-size: clamp(2.25rem, 1.4rem + 3.2vw, 3.25rem);
  font-weight: 400; line-height: 1.1; letter-spacing: -0.015em;
}
.lede { margin: 1.4rem 0 0; max-width: 54ch; font-size: 1.1875rem; color: var(--ink-soft); }
.facts {
  display: flex; flex-wrap: wrap; gap: 0.25rem 0;
  margin: 1.5rem 0 0; padding: 0; list-style: none;
  font-family: var(--sans); font-size: 0.875rem; color: var(--muted);
}
.facts li:not(:last-child)::after { content: "·"; padding: 0 0.6rem; }
/* Passport-style portrait, studio background kept */
.portrait { margin: 0; grid-column: 2; grid-row: 1; }
.portrait img { display: block; width: 100%; height: auto; aspect-ratio: 420 / 580; object-fit: cover; border-radius: 4px; }

/* ---------- Sections ---------- */
h2 {
  margin: 0 0 1.25rem; padding-bottom: 0.45rem;
  border-bottom: 2px solid var(--ink);
  font-family: var(--sans); font-size: 0.875rem; font-weight: 600; letter-spacing: 0.01em;
}
h3 { margin: 0; font-size: 1.25rem; font-weight: 500; line-height: 1.3; }

#experience, #side-project { margin-top: 3.5rem; }
#education, #toolbox, #credentials { margin-top: 3rem; }

.sub { margin: 0.2rem 0 0; font-family: var(--sans); font-size: 0.8125rem; color: var(--muted); }
.role-line { margin: 0.3rem 0 0; font-family: var(--sans); font-size: 0.9375rem; font-weight: 500; color: var(--ink); }
.role-line + .sub { margin-top: 0.1rem; }

/* Right now */
.now { margin-top: 2.5rem; }
.now-list { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1.5rem 1.5rem; margin: 0; }
.now-list div { padding-top: 0.6rem; border-top: 1px solid var(--rule); }
.now-list dt { font-family: var(--sans); font-size: 0.8125rem; font-weight: 500; color: var(--muted); }
.now-list dd { margin: 0.3rem 0 0; color: var(--ink); line-height: 1.45; }

/* ---------- Logos ---------- */
.logo {
  float: right; margin: 0.1rem 0 0.5rem 1rem;
  display: flex; align-items: center; justify-content: center;
  height: 2.75rem; min-width: 2.75rem;
}
.logo img { height: 100%; width: auto; max-width: 5.5rem; object-fit: contain; }
.logo img[data-tone="mono"] { filter: grayscale(1); height: 85%; }

/* ---------- Skill filter ---------- */
.skill-filter {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem;
  margin: -0.25rem 0 1.5rem;
  font-family: var(--sans); font-size: 0.8125rem;
}
.skill-filter[hidden] { display: none; }
.filter-label { color: var(--muted); margin-right: 0.25rem; }
.skill-filter button, .copy {
  font: inherit; font-family: var(--sans); font-size: 0.8125rem; line-height: 1.2;
  color: var(--ink); background: transparent;
  min-height: 2.5rem; padding: 0.45rem 0.8rem;
  border: 1px solid var(--control); border-radius: 3px; cursor: pointer;
  transition: border-color 0.12s ease-out, background-color 0.12s ease-out, color 0.12s ease-out;
}
.skill-filter button:hover, .copy:hover { border-color: var(--ink); }
.skill-filter button[aria-pressed="true"] { background: var(--accent); color: var(--paper); border-color: var(--accent); }
.filter-result { flex-basis: 100%; margin: 0.35rem 0 0; color: var(--ink-soft); min-height: 1.5em; }
.filter-result:empty { display: none; }
.filter-result button {
  min-height: 0; padding: 0.2rem 0; margin-left: 0.75rem; border: 0; border-radius: 0;
  color: var(--accent); text-decoration: underline; text-underline-offset: 0.18em;
}
.filter-result button:hover { color: var(--ink); }

mark {
  background: transparent; color: inherit; border-radius: 2px;
  transition: background-color 0.15s ease-out, box-shadow 0.15s ease-out;
}
mark.is-hit {
  background: var(--hit); box-shadow: 0 0 0 0.15em var(--hit);
  text-decoration: underline 2px var(--accent); text-underline-offset: 0.2em;
}

/* ---------- Experience & Education: drawing + text ---------- */
.stop {
  display: grid; grid-template-columns: 15rem minmax(0, 1fr); gap: 0 2.25rem;
  padding: 2rem 0; border-top: 1px solid var(--rule);
}
h2 + .stop, .skill-filter + .stop { border-top: 0; padding-top: 0.25rem; }
/* The drawing keeps you company while you read a long entry */
.place { margin: 0; position: sticky; top: 5rem; align-self: start; }
.place figcaption { margin-top: 0.45rem; font-family: var(--sans); font-size: 0.75rem; color: var(--muted); }
.stop-body > h3 { font-size: 1.375rem; }
.stop-body > p:not(.sub):not(.role-line) { margin: 0.75rem 0 0; color: var(--ink-soft); max-width: 60ch; }

.part { margin-top: 1.6rem; padding-top: 1.25rem; border-top: 1px solid var(--rule); }
.part h4 { margin: 0; font-family: var(--sans); font-size: 0.9375rem; font-weight: 600; color: var(--ink); }
.part h4 .share { margin-left: 0.5rem; font-weight: 400; font-size: 0.8125rem; color: var(--muted); }
.part > p { margin: 0.5rem 0 0; color: var(--ink-soft); max-width: 62ch; }
.part ul { margin: 0.6rem 0 0; padding-left: 1.1rem; color: var(--ink-soft); max-width: 66ch; }
.part li + li { margin-top: 0.35rem; }
.part li::marker { color: var(--muted); }

.more { margin-top: 0.15rem; }
.more > summary {
  display: inline-block; cursor: pointer; list-style: none;
  font-family: var(--sans); font-size: 0.8125rem; color: var(--accent);
  padding: 0.6rem 0;
}
.more > summary::-webkit-details-marker { display: none; }
.more > summary:hover { text-decoration: underline; text-underline-offset: 0.18em; }
.more .when-open, .more[open] .when-closed { display: none; }
.more[open] .when-open { display: inline; }
.more > ul { margin-top: 0; }

.admin-list { margin: 0.75rem 0 0; max-width: 62ch; }
.admin-list div { padding: 0.6rem 0; border-top: 1px solid var(--rule); }
.admin-list div:first-child { border-top: 0; padding-top: 0; }
.admin-list dt { font-family: var(--sans); font-size: 0.875rem; font-weight: 500; color: var(--ink); }
.admin-list dd { margin: 0.2rem 0 0; color: var(--ink-soft); line-height: 1.45; }

/* ---------- Data-flow diagrams ---------- */
.part-flow { margin: 1.25rem 0 0; max-width: 30rem; }
.part-flow figcaption, .project-flow figcaption { font-family: var(--sans); font-size: 0.8125rem; color: var(--muted); margin-bottom: 0.9rem; }

.pipeline, .part .pipeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1.5rem; }
.pipeline li, .sources li {
  position: relative; padding: 0.55rem 0.75rem;
  border: 1px solid var(--control); border-radius: 3px;
  font-family: var(--sans); font-size: 0.8125rem; line-height: 1.3; color: var(--ink);
}
.part .pipeline li + li, .part .sources li + li { margin-top: 0; }
.pipeline li small { display: block; margin-top: 0.15rem; font-size: 0.75rem; color: var(--muted); font-weight: 400; }
/* Arrow between boxes, down the middle */
.pipeline li + li::before, .pipeline-end li:first-child::before {
  content: ""; position: absolute; left: 50%; top: -1.45rem; width: 1px; height: 1.3rem; background: var(--muted);
}
.pipeline li + li::after, .pipeline-end li:first-child::after {
  content: ""; position: absolute; left: calc(50% - 0.22rem); top: -0.5rem; width: 0.45rem; height: 0.45rem;
  border-right: 1px solid var(--muted); border-bottom: 1px solid var(--muted); transform: rotate(45deg);
}
.pipeline-end, .part .pipeline-end { margin-top: 1.5rem; }
.pipeline-end li:last-child, .pipeline-long li:last-child { border-color: var(--ink); font-weight: 500; }
.part-flow .pipeline-long { max-width: 18rem; }

/* Zoho: several sources, each with its own drop, joined by one line into DataPrep */
.sources, .part .sources {
  position: relative; list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.6rem;
}
.sources li { padding: 0.55rem 0.7rem; }
.sources li::after {
  content: ""; position: absolute; left: 50%; bottom: -0.85rem; width: 1px; height: 0.85rem; background: var(--muted);
}
.sources::after {
  content: ""; position: absolute; bottom: calc(-0.85rem - 1px); height: 1px; background: var(--muted);
  left: calc((100% - 1.2rem) / 6); right: calc((100% - 1.2rem) / 6);
}
.sources + .pipeline-end li:first-child::before { top: calc(-0.65rem - 1px); height: 0.6rem; }

/* ---------- Building drawings that draw themselves ---------- */
.bldg { display: block; width: 100%; height: auto; color: var(--ink); overflow: visible; }
.bldg path {
  fill: none; stroke: currentColor; stroke-width: 1.4;
  stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke;
}
.bldg .thin { stroke-width: 0.9; stroke: var(--muted); }
.bldg .a-red { stroke: #e42527; stroke-width: 1.8; }
.bldg .a-green { stroke: #089949; stroke-width: 1.8; }
.bldg .a-blue { stroke: #226db4; stroke-width: 1.8; }
.bldg .a-yellow { stroke: #f9b21d; stroke-width: 1.8; }
.bldg .a-brick { stroke: #b5452f; stroke-width: 1.6; }
/* Each building draws in as you reach it (site.js). Visible without JS. */
.js .bldg path {
  stroke-dasharray: 1; stroke-dashoffset: 1;
  transition: stroke-dashoffset 1.2s cubic-bezier(0.25, 1, 0.5, 1);
}
.js .stop.is-in .bldg path { stroke-dashoffset: 0; }
.js .bldg .d2 { transition-delay: 0.1s; }
.js .bldg .d3 { transition-delay: 0.2s; }
.js .bldg .d4 { transition-delay: 0.3s; }
.js .bldg .d5 { transition-delay: 0.4s; }
.js .bldg .d6 { transition-delay: 0.5s; }
@media (prefers-reduced-motion: reduce) {
  .js .bldg path { stroke-dashoffset: 0; transition: none; }
  a, mark, .skill-filter button, .copy { transition: none; }
}

/* ---------- Side project ---------- */
.project { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 1.5rem 3.5rem; }
.project h3 { font-size: 1.375rem; }
.project-text > p:not(.sub) { margin: 0.9rem 0 0; color: var(--ink-soft); max-width: 62ch; }
.project-flow { margin: 0.35rem 0 0; }

.status {
  display: grid; grid-template-columns: max-content 1fr; gap: 0.5rem 1rem;
  margin: 1.25rem 0 0; padding-top: 1rem; border-top: 1px solid var(--rule); max-width: 62ch;
}
.status dt { font-family: var(--sans); font-size: 0.8125rem; font-weight: 500; color: var(--ink); padding-top: 0.15rem; }
.status dd { margin: 0; color: var(--ink-soft); }

.flow { margin: 1rem 0 0.25rem; }
.flow-tabs { display: none; }
.js .flow-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.flow-tabs button {
  font: inherit; font-family: var(--sans); font-size: 0.8125rem; line-height: 1.25; text-align: left;
  color: var(--ink-soft); background: transparent; cursor: pointer;
  border: 1px solid var(--control); margin-left: -1px; padding: 0.6rem 0.65rem;
  transition: background-color 0.12s ease-out, color 0.12s ease-out;
}
.flow-tabs button:nth-child(odd) { margin-left: 0; }
.flow-tabs button:nth-child(n+3) { margin-top: -1px; }
.flow-tabs button:hover { color: var(--ink); }
.flow-tabs button .n { display: block; color: var(--muted); font-size: 0.75rem; }
.flow-tabs button[aria-selected="true"] { background: var(--accent); color: var(--paper); border-color: var(--accent); position: relative; z-index: 1; }
.flow-tabs button[aria-selected="true"] .n { color: inherit; opacity: 0.75; }
.flow [role="tabpanel"] p { margin: 0.5rem 0 0; color: var(--ink-soft); }
.flow .panel-title { font-family: var(--sans); font-size: 0.8125rem; font-weight: 500; color: var(--ink); }
.js .flow .panel-title { display: none; }
.js .flow [role="tabpanel"] { min-height: 4.8em; padding-top: 0.25rem; }
.flow [role="tabpanel"][hidden] { display: none; }

/* ---------- Toolbox ---------- */
.toolbox-note { margin: 0 0 1.75rem; max-width: 58ch; color: var(--ink-soft); }
.toolbox { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem 2.75rem; }
.tool-group h3 {
  font-family: var(--sans); font-size: 0.875rem; font-weight: 600;
  padding-bottom: 0.4rem; margin-bottom: 0.35rem; border-bottom: 1px solid var(--rule);
}
.tools { list-style: none; margin: 0; padding: 0; }
.tools li { display: flex; justify-content: space-between; align-items: baseline; gap: 0.75rem; padding: 0.35rem 0; line-height: 1.4; }
.tools .kind { display: block; font-family: var(--sans); font-size: 0.75rem; font-weight: 500; color: var(--muted); }
.tools .src { flex-shrink: 0; font-family: var(--sans); font-size: 0.75rem; color: var(--muted); text-align: right; }

/* ---------- Certifications & languages ---------- */
.credentials { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 3rem 4rem; }
.issuer { margin: 0 0 0.35rem; font-family: var(--sans); font-size: 0.8125rem; font-weight: 500; color: var(--muted); }
.dated + .issuer { margin-top: 1.25rem; }
.dated { margin: 0; padding: 0; list-style: none; }
.dated li {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1.5rem;
  padding: 0.55rem 0; border-bottom: 1px solid var(--rule);
}
.dated time, .dated .level {
  flex-shrink: 0; font-family: var(--sans); font-size: 0.8125rem; color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ---------- Contact ---------- */
.contact { margin-top: 4rem; padding-top: 0.5rem; }
.contact-line { margin: 0; max-width: 40ch; font-size: 1.5rem; line-height: 1.35; }
.contact-links {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0 2rem;
  margin: 0.75rem 0 0; padding: 0; list-style: none;
  font-family: var(--sans); font-size: 0.9375rem;
}
.contact-links a { display: inline-block; padding: 0.65rem 0; }
.contact-links .email { display: flex; flex-wrap: wrap; align-items: center; gap: 0 0.75rem; }
.copy[hidden], .copy-status[hidden] { display: none; }
.copy-status { font-size: 0.8125rem; color: var(--muted); }

.footer {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.25rem 1rem;
  margin-top: 4rem; padding: 1.25rem 0 2.5rem;
  border-top: 1px solid var(--rule);
  font-family: var(--sans); font-size: 0.8125rem; color: var(--muted);
}
.footer p { margin: 0; }

/* ---------- Tablets ---------- */
@media (max-width: 54rem) {
  .now-list, .toolbox { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .now-list div:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .project, .credentials { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Phones ---------- */
@media (max-width: 40rem) {
  .wrap { padding: 0 1.25rem; }
  html { scroll-padding-top: 6rem; }

  /* Name and Resume on the first row; every section link fits on the second, no scrolling */
  .masthead-inner {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center;
    gap: 0.15rem 1rem; padding-top: 0.55rem; padding-bottom: 0.1rem;
  }
  .masthead nav {
    grid-column: 1 / -1; grid-row: 2; margin: 0;
    justify-content: space-between; gap: 0 0.75rem; font-size: 0.8125rem;
  }
  .masthead nav a { padding: 0.55rem 0 0.6rem; }
  .resume-link { font-size: 0.8125rem; }

  /* Photo sits beside the headline */
  .hero { display: block; padding-top: 2rem; padding-bottom: 2.25rem; }
  .hero::after { content: ""; display: block; clear: both; }
  .portrait { float: right; width: 6.5rem; margin: 0.35rem 0 0.75rem 1.1rem; }
  .hero h1 { font-size: 2.125rem; }
  .lede { font-size: 1.0625rem; }
  .facts { clear: both; flex-direction: column; gap: 0.15rem; }
  .facts li::after { content: none !important; }

  .now-list, .toolbox { grid-template-columns: minmax(0, 1fr); }

  /* Each entry leads with its title; the drawing sits small beside it */
  .stop { display: block; padding: 1.75rem 0; }
  .stop::after { content: ""; display: block; clear: both; }
  .place { position: static; float: right; width: 8.5rem; margin: 0.15rem 0 0.75rem 1rem; }
  .place figcaption { font-size: 0.6875rem; line-height: 1.35; }
  .stop-body .logo { display: none; }
  .part { clear: right; }

  .sources { gap: 0.4rem; }
  .sources li { padding: 0.45rem 0.5rem; font-size: 0.75rem; }

  .contact-line { font-size: 1.25rem; }
  .footer { flex-direction: column; }
  .dated li { flex-direction: column; gap: 0.1rem; }
}

/* ---------- Print: recruiters do print these ---------- */
@media print {
  :root { --paper: #fff; --ink: #000; --ink-soft: #222; --muted: #555; --rule: #bbb; --control: #888; --accent: #000; }
  body { font-size: 10.5pt; }
  .masthead nav, .resume-link, .skip, .skill-filter, .copy, .copy-status, .more > summary, .flow-tabs { display: none !important; }
  .masthead { position: static; }
  .hero { padding: 1rem 0 1.25rem; grid-template-columns: 1fr 6rem; }
  h1 { font-size: 20pt; }
  h2 { break-after: avoid; }
  .dated li, h2, .part { break-inside: avoid; }
  .stop { grid-template-columns: 9rem minmax(0, 1fr); break-inside: avoid; }
  .place { position: static; }
  .js .bldg path { stroke-dashoffset: 0 !important; transition: none !important; }
  .flow [role="tabpanel"] { display: block !important; min-height: 0 !important; }
  .flow .panel-title { display: block !important; }
  mark.is-hit { background: none; box-shadow: none; text-decoration: none; }
  .logo img { filter: none !important; }
  .contact, .footer { margin-top: 2rem; }
  a { text-decoration: none; }
  .contact-links a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 8pt; }
}
