/* Pratyush Singh portfolio. One family (Archivo, variable width) does all the work:
   expanded for headlines, normal for reading, condensed for small data. */

:root {
  --paper: #f5f7fa;
  --panel: #ffffff;
  --ink: #0f1b2d;
  --muted: #546072;
  --line: #d8dee7;
  --signal: #2346e8;
  --signal-soft: #e4e9fd;
  --pass: #0b7a55;
  --measure: 66ch;
  --gutter: clamp(16px, 4vw, 48px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0d1522; --panel: #121d2e; --ink: #e7ecf3; --muted: #9aa6b8;
    --line: #243247; --signal: #8ea6ff; --signal-soft: #1b2847; --pass: #4bd39a;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0d1522; --panel: #121d2e; --ink: #e7ecf3; --muted: #9aa6b8;
  --line: #243247; --signal: #8ea6ff; --signal-soft: #1b2847; --pass: #4bd39a;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: "Archivo", system-ui, sans-serif; font-variation-settings: "wdth" 100;
  font-size: 1.0625rem; line-height: 1.6; font-feature-settings: "tnum" 1;
}
img, video, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--signal); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--signal); outline-offset: 3px; border-radius: 4px; }
p { margin: 0 0 1em; }
h1, h2, h3 { margin: 0; line-height: 1.05; font-weight: 700; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--paper); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }

.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- Top bar ---------- */
.bar { border-bottom: 1px solid var(--line); }
.bar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; flex-wrap: wrap; }
.bar .name { font-weight: 700; font-variation-settings: "wdth" 112; color: var(--ink); text-decoration: none; letter-spacing: -0.01em; }
.bar nav { display: flex; gap: clamp(12px, 2.4vw, 28px); flex-wrap: wrap; font-size: 0.95rem; }
.bar nav a { color: var(--muted); text-decoration: none; }
.bar nav a:hover, .bar nav a[aria-current] { color: var(--ink); }

/* ---------- Hero ---------- */
.hero { padding-top: clamp(40px, 6vw, 80px); padding-bottom: clamp(32px, 5vw, 56px); }
.hero h1 {
  font-size: clamp(2.5rem, 6.4vw, 5.6rem); font-variation-settings: "wdth" 125; font-weight: 800;
  letter-spacing: -0.035em; line-height: 0.95; max-width: 18ch; text-wrap: balance;
}
.hero .lede { margin-top: clamp(20px, 3vw, 32px); max-width: 60ch; font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: var(--muted); }
.hero .lede strong { color: var(--ink); font-weight: 600; }

/* ---------- Role lens: the one bold thing ---------- */
.lens { margin-top: clamp(32px, 5vw, 56px); border-top: 2px solid var(--ink); padding-top: 20px; }
.lens h2 { font-size: 1rem; font-weight: 600; font-variation-settings: "wdth" 100; color: var(--muted); margin-bottom: 14px; }
.lens-options { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.lens-options a {
  display: inline-block; padding: 10px 18px; border: 1.5px solid var(--ink); border-radius: 999px;
  color: var(--ink); text-decoration: none; font-weight: 600; font-variation-settings: "wdth" 108;
  transition: background .15s, color .15s;
}
.lens-options a:hover { background: var(--signal-soft); }
.lens-options a[aria-current="true"] { background: var(--ink); color: var(--paper); }

.fit { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); margin-top: 28px; }
.fit-pitch p { font-size: clamp(1.15rem, 2vw, 1.5rem); line-height: 1.4; font-variation-settings: "wdth" 104; max-width: 34ch; margin: 0; }
.fit-pitch .link-hint { margin-top: 14px; font-size: 0.9rem; color: var(--muted); }
html[data-lens="any"] .fit-pitch .link-hint { display: none; }
.evidence { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.evidence li { display: grid; grid-template-columns: 7.5rem 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 0.95rem; line-height: 1.45; }
.evidence b { font-size: 1.35rem; font-variation-settings: "wdth" 120; font-weight: 700; line-height: 1.1; color: var(--signal); }
.evidence span { color: var(--muted); }
.evidence span em { font-style: normal; color: var(--ink); }

/* Lens visibility. Default view ("any") is set on <html data-lens>. */
[data-for] { display: none; }
html[data-lens="any"] [data-for~="any"],
html[data-lens="ai-pm"] [data-for~="ai-pm"],
html[data-lens="pm"] [data-for~="pm"],
html[data-lens="tech"] [data-for~="tech"],
html[data-lens="ops"] [data-for~="ops"],
html[data-lens="tpm"] [data-for~="tpm"] { display: revert; }

/* ---------- Sections ---------- */
section { padding: clamp(48px, 7vw, 88px) 0; border-top: 1px solid var(--line); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: clamp(24px, 4vw, 40px); }
.section-head h2 { font-size: clamp(1.9rem, 4vw, 3rem); font-variation-settings: "wdth" 118; letter-spacing: -0.02em; }
.section-head p { color: var(--muted); margin: 0; max-width: 46ch; }

/* ---------- Work rows ---------- */
.work { display: flex; flex-direction: column; }
.work-item {
  display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: clamp(20px, 4vw, 56px);
  padding: clamp(24px, 4vw, 40px) 0; border-top: 1px solid var(--line);
}
.work-item:first-child { border-top: 0; padding-top: 0; }
.work-item h3 { font-size: clamp(1.6rem, 3.2vw, 2.4rem); font-variation-settings: "wdth" 115; letter-spacing: -0.02em; }
.work-item h3 a { color: var(--ink); text-decoration: none; }
.work-item h3 a:hover { color: var(--signal); }
.work-item .kicker { color: var(--muted); margin: 8px 0 14px; font-size: 1rem; }
.work-item .shows { border-left: 3px solid var(--signal); padding: 2px 0 2px 14px; margin: 0 0 16px; max-width: 58ch; }
.work-item .shows strong { font-weight: 600; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 18px; padding: 0; list-style: none; font-size: 0.82rem; font-variation-settings: "wdth" 85; }
.tags li { padding: 3px 9px; border-radius: 4px; background: var(--signal-soft); color: var(--ink); }
.actions { display: flex; flex-wrap: wrap; gap: 10px 20px; font-weight: 600; }

/* Lens ordering: each row carries its rank per lens. */
html[data-lens="ai-pm"] .work-item { order: var(--ai-pm); }
html[data-lens="pm"] .work-item { order: var(--pm); }
html[data-lens="tech"] .work-item { order: var(--tech); }
html[data-lens="ops"] .work-item { order: var(--ops); }
html[data-lens="tpm"] .work-item { order: var(--tpm); }

/* The receipt: a small gate table, like the ones the builds ship with. */
.receipt { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; align-self: start; font-size: 0.92rem; }
.receipt caption { text-align: left; font-weight: 600; padding-bottom: 8px; color: var(--muted); font-size: 0.85rem; }
.receipt table { width: 100%; border-collapse: collapse; }
.receipt td { padding: 7px 0; border-top: 1px dashed var(--line); vertical-align: top; }
.receipt td:last-child { text-align: right; font-weight: 700; font-variation-settings: "wdth" 112; white-space: nowrap; padding-left: 12px; }
.receipt .ok { color: var(--pass); }
.receipt .note { margin: 10px 0 0; font-size: 0.8rem; color: var(--muted); line-height: 1.4; }

/* ---------- Experience timeline (a real sequence) ---------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.job { display: grid; grid-template-columns: 13rem minmax(0, 1fr); gap: clamp(16px, 4vw, 48px); padding: 28px 0; border-top: 1px solid var(--line); }
.job:first-child { border-top: 0; padding-top: 0; }
.job .when { color: var(--muted); font-size: 0.95rem; }
.job .when b { display: block; color: var(--ink); font-size: 1.25rem; font-variation-settings: "wdth" 115; margin-bottom: 2px; }
.job h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: 10px; line-height: 1.3; }
.job ul { margin: 0; padding-left: 1.1em; max-width: var(--measure); }
.job li { margin-bottom: 8px; transition: opacity .2s; }
.job li::marker { color: var(--muted); }
html:not([data-lens="any"]) .job li { opacity: .45; }
html[data-lens="ai-pm"] .job li[data-l~="ai-pm"],
html[data-lens="pm"] .job li[data-l~="pm"],
html[data-lens="tech"] .job li[data-l~="tech"],
html[data-lens="ops"] .job li[data-l~="ops"],
html[data-lens="tpm"] .job li[data-l~="tpm"] { opacity: 1; }
.lens-note { color: var(--muted); font-size: 0.9rem; margin: -16px 0 24px; }
html[data-lens="any"] .lens-note { display: none; }

/* ---------- Writing & smaller work ---------- */
.shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 0 clamp(20px, 3vw, 40px); list-style: none; margin: 0; padding: 0; }
.shelf li { border-top: 1px solid var(--line); padding: 18px 0 22px; }
.shelf a.title { font-weight: 700; font-size: 1.15rem; font-variation-settings: "wdth" 110; color: var(--ink); text-decoration: none; }
.shelf a.title:hover { color: var(--signal); text-decoration: underline; }
.shelf .kind { display: block; font-size: 0.82rem; color: var(--muted); font-variation-settings: "wdth" 85; margin-bottom: 4px; }
.shelf p { margin: 6px 0 0; color: var(--muted); font-size: 0.95rem; }

/* ---------- About ---------- */
.about { display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 1fr) minmax(0, 0.8fr); gap: clamp(24px, 4vw, 56px); align-items: start; }
.about img { border-radius: 12px; aspect-ratio: 1; object-fit: cover; }
.about .bio h2 { font-size: clamp(1.9rem, 4vw, 3rem); font-variation-settings: "wdth" 118; letter-spacing: -0.02em; margin-bottom: 20px; }
.about .bio p { max-width: 60ch; }
.facts h3 { font-size: 0.95rem; font-weight: 600; color: var(--muted); margin: 0 0 8px; }
.facts ul { list-style: none; padding: 0; margin: 0 0 24px; font-size: 0.95rem; }
.facts li { padding: 4px 0; }

/* ---------- Contact ---------- */
.contact h2 { font-size: clamp(2.2rem, 6vw, 4.8rem); font-variation-settings: "wdth" 125; letter-spacing: -0.03em; max-width: 14ch; }
.contact .mail { display: inline-block; margin-top: 24px; font-size: clamp(1.1rem, 2.6vw, 1.75rem); font-weight: 600; word-break: break-word; }
.contact .links { display: flex; flex-wrap: wrap; gap: 12px 28px; margin-top: 20px; font-weight: 600; }
footer { padding: 28px 0 96px; /* clears the host's corner badge */ color: var(--muted); font-size: 0.85rem; border-top: 1px solid var(--line); }
footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.theme-toggle { background: none; border: 1px solid var(--line); color: var(--muted); border-radius: 999px; padding: 4px 12px; font: inherit; cursor: pointer; }

/* ---------- Case study pages ---------- */
.case-head { padding: clamp(40px, 7vw, 88px) 0 clamp(24px, 4vw, 40px); }
.case-head .back { font-weight: 600; text-decoration: none; }
.case-head h1 { margin-top: 24px; font-size: clamp(2.4rem, 6.5vw, 5rem); font-variation-settings: "wdth" 122; font-weight: 800; letter-spacing: -0.03em; line-height: 0.98; max-width: 16ch; }
.case-head .summary { margin-top: 24px; font-size: clamp(1.1rem, 1.9vw, 1.35rem); line-height: 1.5; max-width: 58ch; }
.meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 0 32px; margin: 32px 0 0; padding: 0; border-top: 2px solid var(--ink); }
.meta div { padding: 14px 0; border-bottom: 1px solid var(--line); }
.meta dt { font-size: 0.85rem; color: var(--muted); }
.meta dd { margin: 2px 0 0; font-weight: 600; }

.case { display: grid; grid-template-columns: 13rem minmax(0, 1fr); gap: clamp(16px, 4vw, 56px); padding-bottom: 72px; }
.case aside { position: sticky; top: 24px; align-self: start; font-size: 0.92rem; }
.case aside ol { list-style: none; padding: 0; margin: 0; border-left: 1px solid var(--line); }
.case aside a { display: block; padding: 5px 0 5px 14px; color: var(--muted); text-decoration: none; }
.case aside a:hover { color: var(--ink); }
.prose { max-width: 70ch; }
.prose h2 { font-size: clamp(1.5rem, 2.8vw, 2rem); font-variation-settings: "wdth" 115; letter-spacing: -0.015em; margin: 56px 0 16px; scroll-margin-top: 24px; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: 1.15rem; margin: 28px 0 8px; line-height: 1.3; }
.prose ul, .prose ol { padding-left: 1.2em; }
.prose li { margin-bottom: 8px; }
.prose figure { margin: 28px 0; }
.prose figure img, .prose video { border: 1px solid var(--line); border-radius: 10px; }
.prose figcaption { font-size: 0.88rem; color: var(--muted); margin-top: 8px; }
.prose .callout { border-left: 3px solid var(--signal); padding: 4px 0 4px 16px; margin: 24px 0; font-size: 1.1rem; }
.table-scroll { overflow-x: auto; margin: 20px 0 28px; }
.prose table { border-collapse: collapse; width: 100%; font-size: 0.94rem; min-width: 480px; }
.prose th, .prose td { text-align: left; padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { font-size: 0.85rem; color: var(--muted); font-weight: 600; border-bottom: 2px solid var(--ink); }
.prose td.num { font-weight: 700; white-space: nowrap; }
.prose .ok { color: var(--pass); }
.flow { list-style: none; padding: 0 !important; counter-reset: step; display: grid; gap: 8px; margin: 20px 0 28px; }
.flow li { counter-increment: step; display: grid; grid-template-columns: 2.2rem 1fr; gap: 10px; align-items: baseline; padding: 10px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; margin: 0; }
.flow li::before { content: counter(step); font-weight: 700; color: var(--signal); font-variation-settings: "wdth" 120; }
.flow li.code { border-color: var(--ink); }
.honest { background: var(--signal-soft); border-radius: 10px; padding: 16px 20px; margin: 28px 0; font-size: 0.95rem; }
.honest p:last-child { margin: 0; }
.next-case { border-top: 2px solid var(--ink); padding: 28px 0 0; margin-top: 64px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-weight: 600; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .fit, .work-item, .job, .case { grid-template-columns: minmax(0, 1fr); }
  .about { grid-template-columns: 140px 1fr; }
  .about .facts { grid-column: 1 / -1; }
  .case aside { position: static; }
  .case aside ol { display: flex; flex-wrap: wrap; gap: 4px 0; border: 0; }
  .case aside a { padding: 4px 14px 4px 0; }
}
@media (max-width: 520px) {
  .about { grid-template-columns: 1fr; }
  .about img { max-width: 160px; }
  .evidence li { grid-template-columns: 6rem 1fr; }
  .lens-options a { padding: 8px 14px; font-size: 0.95rem; }
}
/* Touch screens: give text links a 40px-tall hit area without changing the layout much. */
@media (pointer: coarse) {
  .bar nav a, .bar .name, .actions a, .contact .links a, .case-head .back, .next-case a, footer a, .vl-ghost, .contact .mail { display: inline-block; padding-block: 8px; }
  .bar nav { gap: 4px 18px; }
}
@media print {
  .bar nav, .lens-options, .theme-toggle { display: none; }
  html[data-lens] [data-for] { display: revert; }
}
