/* harishraju.tech — one stylesheet, no build step. */

:root {
  --bg: #fbfbf9;
  --surface: #f3f3ef;
  --text: #17171a;
  --muted: #5f6066;
  --faint: #8b8c92;
  --rule: #e3e3de;
  --accent: #0e6b5c;
  --accent-soft: #e2f0ec;
  --warn: #8a5a00;
  --warn-soft: #f6ecd6;

  --sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --measure: 44rem;
  --gutter: 1rem;

  color-scheme: light;
}

/* Light is the default. Dark applies only when the visitor picks it (assets/theme.js). */
:root[data-theme="dark"] {
  --bg: #111214;
  --surface: #18191c;
  --text: #e8e8e6;
  --muted: #a3a4a8;
  --faint: #75767b;
  --rule: #2a2b2f;
  --accent: #5cc3ac;
  --accent-soft: #15302a;
  --warn: #e0b45c;
  --warn-soft: #2d2513;

  color-scheme: dark;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--sans);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: calc(var(--measure) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
}

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

.skip { position: absolute; left: -999px; }
.skip:focus { left: var(--gutter); top: .5rem; background: var(--bg); padding: .25rem .5rem; }

/* ---------- top bar ---------- */

.top {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 1.5rem 0 0; font-size: .875rem;
}
.top .home { font-weight: 600; text-decoration: none; }
.top nav { display: flex; gap: 1.25rem; color: var(--muted); }
.top nav a { text-decoration: none; }
.top .right { display: flex; align-items: center; gap: 1.25rem; }

/* Hidden until theme.js runs, so it never shows as a dead button without JS. */
.theme-toggle { display: none; }
:root[data-theme] .theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2rem; height: 2rem; margin: -.4rem -.4rem -.4rem 0; padding: 0;
  border: 0; border-radius: 6px; background: none; color: var(--muted); cursor: pointer;
}
.theme-toggle:hover { color: var(--accent); background: var(--surface); }
.theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.theme-toggle svg { width: 1.05rem; height: 1.05rem; }
.theme-toggle .moon, :root[data-theme="dark"] .theme-toggle .sun { display: block; }
.theme-toggle .sun, :root[data-theme="dark"] .theme-toggle .moon { display: none; }

/* ---------- type ---------- */

h1 { font-size: 2rem; line-height: 1.2; letter-spacing: -.02em; margin: 0; font-weight: 650; }
h2 {
  font-size: .75rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 1.25rem;
}
h3 { font-size: 1.125rem; line-height: 1.35; margin: 0; font-weight: 620; letter-spacing: -.01em; }
p { margin: 0 0 1rem; }
.muted { color: var(--muted); }
.mono, code { font-family: var(--mono); font-size: .875em; }
code { background: var(--surface); padding: .1em .35em; border-radius: 3px; }

section { padding: 2.75rem 0; border-top: 1px solid var(--rule); }
section:first-of-type { border-top: 0; }

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

.hero { padding: 3.5rem 0 2.5rem; }
.hero .role { font-size: 1.25rem; color: var(--muted); margin: .4rem 0 1.5rem; letter-spacing: -.01em; }
.hero .lede { font-size: 1.0625rem; max-width: 38rem; }
.status {
  display: inline-flex; align-items: center; gap: .5rem;
  font-size: .8125rem; color: var(--muted); margin-bottom: 1.25rem;
}
.dot { width: .5rem; height: .5rem; border-radius: 50%; background: var(--accent); flex: none; }
.links { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; margin-top: 1.5rem; font-size: .9375rem; }
.links a { font-weight: 500; }

/* ---------- key numbers ---------- */

.facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.25rem; }
.facts li { display: grid; grid-template-columns: 7.5rem 1fr; gap: 1rem; align-items: baseline; }
.facts .n { font-family: var(--mono); font-size: 1.25rem; font-weight: 600; letter-spacing: -.02em; color: var(--accent); white-space: nowrap; }
.facts .d { color: var(--text); }
.facts .d a { color: var(--muted); font-size: .875rem; white-space: nowrap; }

/* ---------- project entries ---------- */

.project { padding: 1.75rem 0; border-top: 1px solid var(--rule); }
.project:first-of-type { border-top: 0; padding-top: 0; }
.project header { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; margin-bottom: .5rem; }
.project .what { color: var(--muted); margin-bottom: 1rem; }
.project ul { margin: 0 0 1rem; padding-left: 1.1rem; }
.project li { margin-bottom: .4rem; }
.project li::marker { color: var(--faint); }

.badge {
  font-family: var(--mono); font-size: .6875rem; letter-spacing: .02em;
  padding: .15rem .5rem; border-radius: 999px; white-space: nowrap;
  background: var(--accent-soft); color: var(--accent);
}
.badge.wip { background: var(--warn-soft); color: var(--warn); }

.spec { display: grid; grid-template-columns: 4.5rem 1fr; gap: .25rem 1rem; font-size: .8125rem; margin: 0 0 1rem; }
.spec dt { font-family: var(--mono); color: var(--faint); text-transform: lowercase; }
.spec dd { margin: 0; color: var(--muted); }

.actions { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; font-size: .875rem; font-weight: 500; }
.actions a::after { content: " \2192"; color: var(--faint); }
.actions a[target="_blank"]::after { content: " \2197"; } /* ↗ = opens in a new tab */

/* ---------- principles ---------- */

.principles { list-style: none; padding: 0; margin: 0; display: grid; gap: 1.25rem; counter-reset: p; }
.principles li { counter-increment: p; display: grid; grid-template-columns: 2rem 1fr; }
.principles li::before { content: counter(p, decimal-leading-zero); font-family: var(--mono); font-size: .8125rem; color: var(--faint); padding-top: .15rem; }
.principles strong { font-weight: 600; }
.principles p { margin: .15rem 0 0; color: var(--muted); font-size: .9375rem; }

/* ---------- skills ---------- */

.skills { display: grid; grid-template-columns: 8.5rem 1fr; gap: .6rem 1rem; margin: 0; font-size: .9375rem; }
.skills dt { color: var(--muted); }
.skills dd { margin: 0; }

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

.crumb { font-size: .8125rem; color: var(--muted); margin: 3rem 0 .75rem; font-family: var(--mono); }
.crumb a { text-decoration: none; }
.cs-head { padding-bottom: 2rem; }
.cs-head .role { font-size: 1.125rem; color: var(--muted); margin: .5rem 0 1.5rem; }

.prose p, .prose li { max-width: 40rem; }
.prose ul, .prose ol { padding-left: 1.1rem; margin: 0 0 1rem; }
.prose li { margin-bottom: .5rem; }
.prose h3 { margin: 2rem 0 .5rem; }
.prose h3:first-child { margin-top: 0; }

table { width: 100%; border-collapse: collapse; font-size: .875rem; margin: 0 0 1rem; }
th, td { text-align: left; padding: .55rem .75rem .55rem 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
th { font-weight: 600; font-size: .75rem; color: var(--muted); letter-spacing: .02em; }
td.num, th.num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; padding-right: 0; padding-left: .75rem; white-space: nowrap; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.caption { font-size: .8125rem; color: var(--muted); }

/* decision blocks */
.decision { border-left: 2px solid var(--rule); padding-left: 1rem; margin: 0 0 1.5rem; }
.decision h3 { font-size: 1rem; margin-bottom: .35rem; }
.decision p { color: var(--muted); font-size: .9375rem; margin-bottom: .5rem; }
.decision .alt { font-size: .875rem; color: var(--faint); }

/* ---------- flow diagrams (HTML, so they reflow on phones) ---------- */

.flow { display: grid; gap: 0; margin: .5rem 0 1rem; font-size: .8125rem; }
.flow .step {
  border: 1px solid var(--rule); border-radius: 6px; background: var(--surface);
  padding: .55rem .75rem; display: grid; grid-template-columns: 1fr auto; gap: .75rem; align-items: baseline;
}
.flow .step b { font-weight: 600; }
.flow .step span { color: var(--muted); font-family: var(--mono); font-size: .75rem; text-align: right; }
.flow .step.accent { border-color: var(--accent); background: var(--accent-soft); }
.flow .arrow { height: 1.25rem; position: relative; }
.flow .arrow::before { content: ""; position: absolute; left: 1.25rem; top: 0; bottom: 0; border-left: 1px solid var(--faint); }
.flow .arrow::after { content: ""; position: absolute; left: calc(1.25rem - 3px); bottom: 0; border: 3px solid transparent; border-top-color: var(--faint); border-bottom: 0; }
.flow .arrow em { position: absolute; left: 2rem; top: .1rem; font-style: normal; font-family: var(--mono); font-size: .6875rem; color: var(--faint); }
.flow .fork { display: grid; grid-template-columns: repeat(var(--n, 2), minmax(0, 1fr)); gap: .5rem; }
.flow .fork.four { --n: 4; }
.flow .fork .step { grid-template-columns: 1fr; gap: .15rem; }
.flow .fork .step span { text-align: left; }

/* ---------- footer ---------- */

footer.site { border-top: 1px solid var(--rule); padding: 2rem 0 3rem; font-size: .8125rem; color: var(--muted); display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

/* ---------- small screens ---------- */

@media (max-width: 560px) {
  h1 { font-size: 1.75rem; }
  .hero { padding-top: 2.5rem; }
  .facts li { grid-template-columns: 1fr; gap: .1rem; }
  .skills { grid-template-columns: 1fr; gap: .1rem; }
  .skills dd { margin-bottom: .6rem; }
  .flow .fork { grid-template-columns: 1fr 1fr; }
  .top nav { gap: .9rem; }
  .top .right { gap: .9rem; }
  table { font-size: .8125rem; }
  td.num, th.num { padding-left: .5rem; }
  th, td { padding-right: .5rem; }
}

/* ---------- print: recruiters do print these ---------- */

@media print {
  :root { --bg: #fff; --text: #000; --muted: #333; --faint: #666; --rule: #ccc; --accent: #000; --accent-soft: #fff; --surface: #fff; }
  .top nav, .theme-toggle, .skip, footer.site .built { display: none !important; }
  section { padding: 1.25rem 0; break-inside: avoid-page; }
  .project { break-inside: avoid; }
  a { text-decoration: none; }
  .links a[href^="http"]::after, .actions a[href^="http"]::after { content: " (" attr(href) ")"; font-size: .75rem; color: var(--muted); }
}
