/* ============================================================
   Estimating Time Spent on Work Tasks — paper landing page
   Editorial / research aesthetic.
   ============================================================ */

:root {
  --ink: #19131f;
  --ink-soft: #4c4458;
  --ink-faint: #8b8398;
  --line: #ece7f2;
  --line-strong: #ddd5e8;
  --bg: #ffffff;
  --bg-alt: #faf8fd;
  --bg-tint: #f3eefa;

  --purple: #6d3a9e;
  --purple-deep: #34165c;
  --purple-soft: #c4a9ec;
  --purple-wash: #f3ecfb;
  --green: #167a3b;
  --green-soft: #8fd694;
  --red: #d8453d;
  --gold: #b07a16;

  --radius: 18px;
  --radius-sm: 11px;
  --shadow-xs: none;
  --shadow-sm: none;
  --shadow-md: none;
  --maxw: 1120px;

  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 78px; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  counter-reset: sec;
}

a { color: var(--purple); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }

/* ---------- top nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: saturate(170%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 13px 28px;
  display: flex; align-items: center; gap: 18px;
}
.nav-brand {
  font-family: var(--serif); font-weight: 600; font-size: 15px;
  color: var(--purple-deep); letter-spacing: -0.01em; white-space: nowrap;
}
.nav-links { display: flex; gap: 22px; margin-left: auto; flex-wrap: wrap; }
.nav-links a {
  color: var(--ink-soft); font-size: 13.5px; font-weight: 500; position: relative;
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: -4px; height: 2px;
  background: var(--purple); border-radius: 2px; transition: right .22s ease;
}
.nav-links a:hover { color: var(--purple); text-decoration: none; }
.nav-links a:hover::after { right: 0; }
@media (max-width: 860px) { .nav-links { display: none; } }

/* ---------- hero ---------- */
.hero {
  position: relative; overflow: hidden;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--line);
  padding: 74px 0 56px;
  text-align: center;
}
.hero h1 {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(34px, 6.4vw, 62px); line-height: 1.04;
  letter-spacing: -0.025em; margin: 0 auto 26px; max-width: none;
  color: var(--purple-deep);
}
.authors { font-size: 17px; color: var(--ink); margin: 0 0 5px; }
.authors b { font-weight: 600; }
.authors a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line-strong); transition: border-color .15s ease, color .15s ease; }
.authors a:hover { color: var(--purple); border-bottom-color: var(--purple); }
.affil { font-size: 13.5px; color: var(--ink-faint); margin: 0 0 30px; }
.affil sup, .authors sup { color: var(--purple); font-weight: 600; }

.cta { display: flex; gap: 13px; justify-content: center; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 600; padding: 11px 20px;
  border-radius: 999px; border: 1px solid var(--line-strong);
  background: rgba(255,255,255,0.7); color: var(--ink); transition: all .16s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow-sm); border-color: var(--purple-soft); }
.btn.primary { background: var(--purple-deep); color: #fff; border-color: var(--purple-deep); }
.btn.primary:hover { background: var(--purple); border-color: var(--purple); }
.btn svg { width: 16px; height: 16px; }

/* ---------- sections ---------- */
section { padding: 76px 0; border-bottom: 1px solid var(--line); }
section:last-of-type { border-bottom: none; }
.section-alt { background: var(--bg-alt); }

.kicker {
  counter-increment: sec;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--purple); font-weight: 600;
  display: flex; align-items: center; gap: 13px; margin-bottom: 18px;
}
.kicker::before {
  content: counter(sec, decimal-leading-zero);
  font-size: 12px; color: #fff; background: var(--purple);
  width: 26px; height: 26px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  letter-spacing: 0;
}
.section-head h2 {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(26px, 4vw, 40px); line-height: 1.12;
  letter-spacing: -0.022em; margin: 0 0 18px; color: var(--purple-deep);
  max-width: none;
}
.lede { font-size: 18px; color: var(--ink-soft); max-width: none; margin: 0; }
.lede strong { color: inherit; font-weight: 400; }
.abstract p strong, .abstract p b { font-weight: 400; color: inherit; }
.cites {
  font-family: var(--mono); font-size: 12px; color: var(--ink-faint);
  line-height: 1.5; font-weight: 400;
}
.cites a { color: var(--ink-faint); text-decoration: none; border-bottom: 1px solid var(--line); transition: color .15s ease, border-color .15s ease; }
.cites a:hover { color: var(--purple); border-bottom-color: var(--purple); }

/* abstract */
.abstract {
  margin: 44px auto 0; max-width: none;
  background: rgba(255,255,255,0.86); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 30px 34px; box-shadow: var(--shadow-sm);
  text-align: left; position: relative;
}
.abstract::before {
  content: ""; position: absolute; left: 0; top: 22px; bottom: 22px; width: 4px;
  background: var(--purple); border-radius: 4px;
}
.abstract h3 {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--purple); margin: 0 0 13px;
}
.abstract p { margin: 0; font-size: 16px; color: var(--ink-soft); }
.abstract p + p { margin-top: 14px; }

/* ---------- cards / figures ---------- */
.figure {
  margin-top: 34px; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden;
}
.figure-body { padding: 26px 28px; }
.figure-cap {
  font-size: 13px; color: var(--ink-faint); padding: 16px 28px;
  border-top: 1px solid var(--line);
  background: var(--bg-alt); line-height: 1.55;
}
.figure-cap b { color: var(--ink-soft); }

/* controls */
.controls { display: flex; flex-wrap: wrap; gap: 18px 28px; align-items: flex-end; margin-bottom: 22px; }
.control { display: flex; flex-direction: column; gap: 8px; }
.control > label {
  font-size: 11px; font-weight: 600; letter-spacing: 0.07em;
  text-transform: uppercase; color: var(--ink-faint);
}
.seg {
  display: inline-flex; background: var(--bg-tint); border: 1px solid var(--line);
  border-radius: 999px; padding: 4px;
}
.seg button {
  border: none; background: transparent; cursor: pointer;
  font-family: var(--sans); font-size: 13px; font-weight: 600; color: var(--ink-soft);
  padding: 8px 16px; border-radius: 999px; transition: all .15s ease; white-space: nowrap;
}
.seg button.active { background: #fff; color: var(--purple-deep); box-shadow: var(--shadow-xs); }
.seg button:hover:not(.active) { color: var(--purple); }

.combo { position: relative; width: 100%; }
.combo input {
  width: 100%; font-family: var(--sans); font-size: 15px; color: var(--ink);
  padding: 13px 16px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: #fff; outline: none; transition: border-color .15s ease, box-shadow .15s ease;
}
.combo input:focus { border-color: var(--purple-soft); box-shadow: 0 0 0 4px var(--purple-wash); }
.combo-list {
  position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; right: 0;
  max-height: 300px; overflow-y: auto; background: #fff;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md); padding: 6px; margin: 0; list-style: none;
}
.combo-list[hidden] { display: none; }
.combo-list li {
  padding: 9px 12px; border-radius: 8px; cursor: pointer; font-size: 14px;
  display: flex; justify-content: space-between; gap: 12px; align-items: baseline;
}
.combo-list li:hover, .combo-list li.hl { background: var(--bg-tint); }
.combo-list li .code { font-family: var(--mono); font-size: 11.5px; color: var(--ink-faint); }

.occ-name {
  font-family: var(--sans); font-size: 20px; font-weight: 700; color: var(--purple-deep);
  letter-spacing: -0.01em;
}

/* stat cards */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-bottom: 24px; }
.stat {
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 20px 22px; background: #fff; position: relative; overflow: hidden;
}
.stat::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; }
.stat.exposed::after { background: var(--red); }
.stat.time::after { background: var(--purple); }
.stat .v { font-family: var(--serif); font-size: 38px; font-weight: 600; line-height: 1; letter-spacing: -0.02em; }
.stat .l { font-size: 13px; color: var(--ink-faint); margin-top: 9px; }
.stat.exposed .v { color: var(--red); }
.stat.time .v { color: var(--purple); }
@media (max-width: 560px) { .stats { grid-template-columns: 1fr; } }

/* legend */
.legend { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 4px 0 0; font-size: 12.5px; color: var(--ink-soft); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.swatch { width: 13px; height: 13px; border-radius: 4px; display: inline-block; }

/* bar chart rows */
.bars { display: flex; flex-direction: column; gap: 6px; }
.bar-row { display: grid; grid-template-columns: minmax(190px, 330px) 1fr 56px; gap: 14px; align-items: center; }
.bar-label { font-size: 13.5px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-label.exp { color: var(--red); font-weight: 600; }
.bar-track { height: 22px; background: var(--bg-tint); border-radius: 6px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 6px; transition: width .55s cubic-bezier(.2,.7,.2,1); }
.bar-val { font-family: var(--mono); font-size: 12px; color: var(--ink-soft); text-align: right; }
@media (max-width: 640px) {
  .bar-row { grid-template-columns: 1fr; gap: 3px; }
  .bar-row .bar-val { text-align: left; }
}

/* svg chart */
.chart-host { width: 100%; }
.chart-host svg { width: 100%; height: auto; display: block; }
.axis text { font-family: var(--sans); font-size: 11px; fill: var(--ink-faint); }
.axis line, .axis path { stroke: var(--line); }
.grid line { stroke: var(--line); stroke-dasharray: 2 3; }
.cdf-tooltip {
  position: absolute; pointer-events: none; background: var(--purple-deep); color: #fff;
  font-size: 12px; padding: 8px 11px; border-radius: 9px; box-shadow: var(--shadow-md);
  opacity: 0; transition: opacity .1s ease; white-space: nowrap; z-index: 20; line-height: 1.5;
}
.cdf-tooltip b { color: var(--green-soft); }

/* ---------- tables ---------- */
.tbl-wrap { margin-top: 30px; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); background: #fff; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; background: #fff; }
table.data th, table.data td { padding: 13px 16px; text-align: left; border-bottom: 1px solid var(--line); }
table.data thead th {
  background: var(--bg-tint); color: var(--ink-soft); font-size: 11.5px;
  font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; position: sticky; top: 0;
}
table.data tbody tr:last-child td { border-bottom: none; }
table.data tbody tr { transition: background .12s ease; }
table.data tbody tr:hover { background: var(--bg-alt); }
table.data td.num, table.data th.num { text-align: right; font-family: var(--mono); font-size: 12.5px; }
table.data .soc { font-family: var(--mono); font-size: 12px; color: var(--ink-faint); }

/* Table 2 — descriptive multi-line numeric headers */
table.table2 thead th { vertical-align: bottom; }
table.table2 thead th.num {
  text-transform: none; letter-spacing: 0.01em; font-weight: 600;
  line-height: 1.35; white-space: normal; font-family: var(--sans); font-size: 11.5px;
}
table.table2 tbody td:nth-child(1), table.table2 thead th:nth-child(1) { width: 28%; }
table.table2 tbody td:nth-child(2), table.table2 thead th:nth-child(2) { width: 13%; }
table.table2 tbody td:nth-child(3), table.table2 thead th:nth-child(3),
table.table2 tbody td:nth-child(4), table.table2 thead th:nth-child(4) { width: 29.5%; }
.check { color: var(--green); font-weight: 700; font-size: 22px; line-height: 1; }
.cross { color: var(--ink-faint); font-weight: 700; font-size: 22px; line-height: 1; }
.ours-row { background: var(--purple-wash) !important; }
.ours-row td:first-child, .ours-row td:nth-child(3) { font-weight: 600; color: var(--purple-deep); }

/* swap columns */
.swap-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 32px; }
@media (max-width: 740px) { .swap-grid { grid-template-columns: 1fr; } }
.swap-col { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); background: #fff; }
.swap-col h4 {
  margin: 0; font-size: 13.5px; padding: 15px 18px; display: flex; align-items: center; gap: 10px;
  font-family: var(--sans); font-weight: 600;
}
.swap-col.out h4 { background: #fdecea; color: #ad322a; }
.swap-col.in  h4 { background: #e9f6ed; color: #0f5e2d; }
.swap-col ul { margin: 0; padding: 6px 0; list-style: none; }
.swap-col li { padding: 10px 18px; font-size: 14px; border-top: 1px solid var(--line); color: var(--ink); }
.swap-col li:first-child { border-top: none; }
.swap-arrow { font-size: 15px; }

/* delta chips */
.delta { font-family: var(--mono); font-size: 11.5px; padding: 2px 7px; border-radius: 999px; font-weight: 600; }
.delta.up { background: #eaf6ee; color: var(--green); }
.delta.down { background: #fdeceb; color: var(--red); }

/* method diagram image */
.method-img { display: block; width: 100%; max-width: 760px; margin: 4px auto 0; }

/* notes / link buttons */
.note { font-size: 13.5px; color: var(--ink-faint); margin-top: 16px; }
.note code { font-family: var(--mono); font-size: 12.5px; background: var(--bg-tint); padding: 1px 5px; border-radius: 4px; }
.linkbtn {
  background: none; border: none; color: var(--purple); font-family: var(--sans);
  font-size: 13.5px; font-weight: 600; cursor: pointer; padding: 0;
}
.linkbtn:hover { text-decoration: underline; }

/* footer */
footer { background: var(--purple-deep); color: #cdbfe4; padding: 52px 0; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 22px; justify-content: space-between; align-items: center; }
footer a { color: #fff; }
footer .cite {
  font-family: var(--mono); font-size: 11.5px; color: #c3b4e0; background: rgba(255,255,255,.07);
  padding: 14px 18px; border-radius: var(--radius-sm); white-space: pre-wrap; line-height: 1.55;
  max-width: 100%; overflow-x: auto; border: 1px solid rgba(255,255,255,.08);
}

.hidden { display: none !important; }
