/* ProfessorVR — site styles
   Palette: cool lab-grey paper, deep teal-black ink, fixation magenta, saccade teal. */

:root {
  --paper: #eef0ec;
  --paper-2: #e3e7e2;
  --ink: #1b262b;
  --muted: #56646a;
  --rule: #c9d0cb;
  --gaze: #c42a5f;
  --chart-up: #c42a5f;
  --chart-down: #0a7d9e;
  --trace: #2f6f73;
  --focus: #2f6f73;

  --font-ui: "Schibsted Grotesk", system-ui, sans-serif;
  --font-read: "Source Serif 4", Georgia, serif;

  --step--1: 0.875rem;
  --step-0: 1.125rem;
  --step-1: 1.375rem;
  --step-2: 1.75rem;
  --step-3: clamp(2rem, 4vw, 2.75rem);
  --step-hero: clamp(2.6rem, 7vw, 5.6rem);

  --measure: 38rem;
  --wide: 72rem;
  --gutter: clamp(1rem, 4vw, 3rem);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #141b1e;
    --paper-2: #1b2427;
    --ink: #e4e9e6;
    --muted: #9aa7a9;
    --rule: #2c383b;
    --gaze: #ff5f8f;
  --chart-up: #ec4d7c;
  --chart-down: #1fa3b5;
    --chart-up: #ec4d7c;
    --chart-down: #1fa3b5;
    --trace: #72b9bb;
    --focus: #72b9bb;
  }
}
:root[data-theme="dark"] {
  --paper: #141b1e;
  --paper-2: #1b2427;
  --ink: #e4e9e6;
  --muted: #9aa7a9;
  --rule: #2c383b;
  --gaze: #ff5f8f;
  --trace: #72b9bb;
  --focus: #72b9bb;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-read);
  font-size: var(--step-0);
  line-height: 1.62;
  font-optical-sizing: auto;
}

img, video, svg { max-width: 100%; }

a { color: inherit; text-decoration-color: var(--gaze); text-decoration-thickness: 1.5px; text-underline-offset: 0.18em; }
a:hover { color: var(--gaze); }

:focus-visible { outline: 2.5px solid var(--focus); outline-offset: 3px; border-radius: 2px; }

.skip { position: absolute; left: -999px; top: 0; }
.skip:focus { left: var(--gutter); top: 0.5rem; background: var(--paper); padding: 0.4rem 0.8rem; z-index: 10; }

.wrap { max-width: var(--wide); margin-inline: auto; padding-inline: var(--gutter); }

/* ---------- Header ---------- */
.site-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.25rem;
  font-family: var(--font-ui);
}
.wordmark { font-weight: 800; font-size: 1.15rem; letter-spacing: -0.01em; text-decoration: none; }
.wordmark span { color: var(--gaze); }
.site-nav { display: flex; gap: clamp(0.9rem, 3vw, 2rem); font-size: 1rem; }
.site-nav a { text-decoration: none; }
.site-nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--gaze); }

/* ---------- Hero ---------- */
.hero { position: relative; padding-block: clamp(1.5rem, 5vw, 3.75rem) clamp(2rem, 6vw, 4.5rem); }
.hero-stage { position: relative; }
.hero h1 {
  font-family: var(--font-ui);
  font-size: var(--step-hero);
  line-height: 1.03;
  letter-spacing: -0.025em;
  font-weight: 750;
  margin: 0;
  max-width: 15ch;
}
.scanpath {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}
.scanpath .sacc { stroke: var(--trace); stroke-width: 1.5; fill: none; opacity: 0.75; }
.scanpath .fix { fill: color-mix(in srgb, var(--gaze) 22%, transparent); stroke: var(--gaze); stroke-width: 1.75; }
.scanpath .fix-n { font-family: var(--font-ui); font-size: 10px; font-weight: 700; fill: var(--gaze); text-anchor: middle; dominant-baseline: central; }
.scanpath { z-index: 1; }
.scanpath-note { font-family: var(--font-ui); font-size: var(--step--1); color: var(--muted); margin: 1.1rem 0 0; max-width: var(--measure); }
.scanpath-bridge { color: var(--gaze); }
.scanpath-replay {
  font: inherit;
  font-weight: 600;
  color: var(--ink);
  background: none;
  border: 0;
  padding: 0;
  margin-left: 0.35rem;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: var(--gaze);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.18em;
}
.scanpath-replay:hover { color: var(--gaze); }

.lead { font-size: var(--step-1); line-height: 1.5; max-width: var(--measure); margin: 2.25rem 0 0; }

.actions { display: flex; flex-wrap: wrap; gap: 0.75rem 1.5rem; margin-top: 2rem; font-family: var(--font-ui); align-items: center; }
.btn {
  display: inline-block;
  font-weight: 650;
  padding: 0.7rem 1.15rem;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  border-radius: 999px;
}
.btn:hover { background: var(--gaze); color: #fff; }
.btn { transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.4s ease; }
/* The design cue in the hero animation, and the faint ring it leaves behind. */
.btn.is-cued { background: var(--gaze); color: #fff; }
.btn.was-cued { box-shadow: 0 0 0 3px color-mix(in srgb, var(--gaze) 35%, transparent); }
@media (prefers-reduced-motion: reduce) { .btn { transition: none; } }
.link-quiet { font-weight: 600; }

/* ---------- Sections ---------- */
section { padding-block: clamp(2.5rem, 7vw, 5rem); }
/* divider drawn inside the gutters so it aligns with the content edge */
section + section {
  background: linear-gradient(var(--rule), var(--rule)) no-repeat center top / calc(100% - 2 * var(--gutter)) 1px;
}
h2 {
  font-family: var(--font-ui);
  font-size: var(--step-3);
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-weight: 700;
  margin: 0 0 1.75rem;
}
h3 { font-family: var(--font-ui); font-size: var(--step-1); line-height: 1.25; font-weight: 700; margin: 0 0 0.5rem; letter-spacing: -0.01em; }
p { margin: 0 0 1rem; }
.measure { max-width: var(--measure); }
.muted { color: var(--muted); }

/* Capabilities: three columns separated by rules, not cards */
.capabilities { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; }
.capabilities > div { padding: 0 1.5rem; border-left: 1px solid var(--rule); }
.capabilities > div:first-child { padding-left: 0; border-left: 0; }
.capabilities p { font-size: 1.02rem; }
.tools { font-family: var(--font-ui); font-size: var(--step--1); color: var(--muted); line-height: 1.5; }

/* Selected work: full-width rows */
.work-list { list-style: none; margin: 0; padding: 0; }
.work-item { border-top: 1px solid var(--rule); }
.work-item:last-child { border-bottom: 1px solid var(--rule); }
.work-item a {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 0.5rem 3rem;
  padding: 1.75rem 0;
  text-decoration: none;
}
.work-item a { padding-inline: 1rem; margin-inline: -1rem; border-radius: 6px; transition: background-color 0.2s ease; }
.work-more { display: inline-block; margin-top: 0.9rem; font-family: var(--font-ui); font-size: var(--step--1); font-weight: 600; color: var(--ink); }
.work-more .label { text-decoration: underline; text-decoration-color: var(--gaze); text-decoration-thickness: 1.5px; text-underline-offset: 0.18em; }
.work-more .arrow { display: inline-block; transition: transform 0.2s ease; }
.work-item a:focus-visible { background: var(--paper-2); }
/* hover effects only on devices with a mouse, so a tapped row on a phone doesn't stay highlighted */
@media (hover: hover) {
  .work-item a:hover { background: var(--paper-2); }
  .work-item a:hover h3, .work-item a:hover .work-more { color: var(--gaze); }
  .work-item a:hover .work-more .arrow { transform: translateX(4px); }
}
@media (hover: none) { .work-item a:hover { color: inherit; } }
.work-item h3 { font-size: var(--step-2); margin: 0; }
.work-item .summary { margin: 0; }
.work-item .meta { font-family: var(--font-ui); font-size: var(--step--1); color: var(--muted); margin-top: 0.6rem; }
.status {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: 0.8rem;
  font-weight: 650;
  color: var(--trace);
  border: 1.5px solid var(--trace);
  border-radius: 999px;
  padding: 0.05rem 0.6rem;
  margin-left: 0.6rem;
  vertical-align: 0.3em;
  white-space: nowrap;
  letter-spacing: normal;
}

/* Method sequence (a real sequence, so it is numbered) */
.method { list-style: none; counter-reset: step; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1.5rem; }
.method li { counter-increment: step; }
.method li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 2rem; height: 2rem;
  border: 1.75px solid var(--gaze);
  border-radius: 50%;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--gaze);
  margin-bottom: 0.75rem;
}
.method h3 { font-size: 1.1rem; }
.method p { font-size: 0.98rem; }

/* Applications */
.applications { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem 3rem; }

/* Contact */
.contact-line { font-family: var(--font-ui); font-size: var(--step-2); font-weight: 650; letter-spacing: -0.01em; }

/* Footer */
.site-foot {
  font-family: var(--font-ui); font-size: var(--step--1); color: var(--muted); padding-block: 2rem 3rem;
  background: linear-gradient(var(--rule), var(--rule)) no-repeat center top / calc(100% - 2 * var(--gutter)) 1px;
}

/* ---------- Case study pages ---------- */
.case-head { padding-block: clamp(2rem, 7vw, 5rem) 1.5rem; }
.case-head h1 { font-family: var(--font-ui); font-size: clamp(2.2rem, 5.5vw, 4rem); line-height: 1.05; letter-spacing: -0.025em; margin: 0 0 1.25rem; max-width: 20ch; }
.case-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem 2rem; margin: 2.5rem 0 0; padding: 1.25rem 0; border-block: 1px solid var(--rule); font-family: var(--font-ui); font-size: 0.95rem; }
.case-facts dt { color: var(--muted); font-size: var(--step--1); }
.case-facts dd { margin: 0.15rem 0 0; font-weight: 550; }
.case-body { display: grid; grid-template-columns: 12rem minmax(0, 1fr); gap: 0 3rem; }
.case-body > h2 { font-size: var(--step-1); margin: 0; align-self: stretch; }
/* the label sticks only within its own section's row, so labels never pile up */
.case-body > h2 > span { display: block; padding-top: 0.25rem; position: sticky; top: 1rem; }
.case-body > div { max-width: var(--measure); margin-bottom: 3rem; }
.case-body ul { padding-left: 1.2rem; }
.case-body li { margin-bottom: 0.4rem; }

.result { font-family: var(--font-ui); display: grid; grid-template-columns: auto 1fr; gap: 0.25rem 1.25rem; align-items: baseline; padding: 1rem 0; border-top: 1px solid var(--rule); }
.result:last-of-type { border-bottom: 1px solid var(--rule); }
.result strong { font-size: var(--step-2); font-weight: 700; color: var(--gaze); white-space: nowrap; }

.figure-slot {
  border: 1.5px dashed var(--rule);
  border-radius: 6px;
  padding: 2.25rem 1.25rem;
  font-family: var(--font-ui);
  font-size: 0.95rem;
  color: var(--muted);
  background: var(--paper-2);
  margin: 1.5rem 0;
}
.figure-slot strong { color: var(--ink); display: block; margin-bottom: 0.25rem; }

.next-case { font-family: var(--font-ui); padding-block: 2.5rem; }

/* Embedded video (YouTube, privacy-enhanced mode) */
.video { margin: 1.5rem 0; }
.video iframe { display: block; width: 100%; aspect-ratio: 16 / 9; height: auto; border: 0; border-radius: 6px; background: var(--paper-2); }
.video figcaption { font-family: var(--font-ui); font-size: var(--step--1); color: var(--muted); margin-top: 0.5rem; }

/* Self-hosted media (images and clips) */
/* Slope chart (boredom study): colors validated for color-vision deficiency in both themes */
.slope-figure { margin: 1.75rem 0 0; }
.slope { display: block; width: 100%; max-width: 600px; height: auto; }
.slope text { font-family: var(--font-ui); fill: var(--ink); }
.slope .s-col { font-size: 13px; font-weight: 650; }
.slope .s-axis, .slope .s-tick { font-size: 11.5px; fill: var(--muted); }
.slope .s-lab { font-size: 12px; }
.slope .s-grid { stroke: var(--rule); stroke-width: 1; }
.slope .s-zero { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 2 3; }
.slope .s-up { --c: var(--chart-up); }
.slope .s-down { --c: var(--chart-down); }
.slope .s-line { stroke: var(--c); stroke-width: 2; stroke-linecap: round; transition: opacity 0.15s ease, stroke-width 0.15s ease; }
.slope .s-down .s-line { stroke-dasharray: 6 4; }
.slope .s-dot { fill: var(--c); stroke: var(--paper); stroke-width: 2; }
.slope .s-hit { stroke: transparent; stroke-width: 14; }
.slope g[tabindex] { outline: none; }
.slope:hover g:not(:hover) .s-line, .slope:focus-within g:not(:focus) .s-line { opacity: 0.35; }
.slope g:hover .s-line, .slope g:focus .s-line { stroke-width: 3.5; }
.slope .s-key-up { stroke: var(--chart-up); stroke-width: 2; }
.slope .s-key-down { stroke: var(--chart-down); stroke-width: 2; stroke-dasharray: 6 4; }
.slope-figure figcaption { font-family: var(--font-ui); font-size: var(--step--1); color: var(--muted); margin-top: 0.5rem; }
.slope-table { margin-top: 0.75rem; font-family: var(--font-ui); font-size: var(--step--1); }
.slope-table summary { cursor: pointer; font-weight: 600; text-decoration: underline; text-decoration-color: var(--gaze); text-decoration-thickness: 1.5px; text-underline-offset: 0.18em; }
.slope-table .table-scroll { overflow-x: auto; margin-top: 0.5rem; }
.slope-table table { border-collapse: collapse; font-variant-numeric: tabular-nums; white-space: nowrap; }
.slope-table th, .slope-table td { text-align: left; padding: 0.3rem 0.8rem 0.3rem 0; border-bottom: 1px solid var(--rule); }
.slope-table th { font-weight: 650; color: var(--muted); }
.slope-note { color: var(--muted); margin: 0.6rem 0 0; }
@media (prefers-reduced-motion: reduce) { .slope .s-line { transition: none; } }

.media { margin: 1.5rem 0; }
.media img, .media video { display: block; width: 100%; height: auto; border-radius: 6px; background: var(--paper-2); }
.media.square { max-width: 30rem; }
.media figcaption { font-family: var(--font-ui); font-size: var(--step--1); color: var(--muted); margin-top: 0.5rem; }

/* Publication list */
.pubs, .case-body .pubs { list-style: none; padding: 0; margin: 0; }
.pubs li { padding: 0.9rem 0; border-top: 1px solid var(--rule); font-size: 1rem; }
.pubs li:last-child { border-bottom: 1px solid var(--rule); }
.pubs .award { display: block; font-family: var(--font-ui); font-size: var(--step--1); color: var(--trace); margin-top: 0.25rem; }
.pubs .rights { display: block; font-family: var(--font-ui); font-size: 0.8rem; line-height: 1.45; color: var(--muted); margin-top: 0.35rem; }
.pubs .rights a { color: inherit; }

/* Publications page: one entry per paper, each with its own anchor */
.pub-list li { padding: 1.5rem 0; scroll-margin-top: 1rem; }
.pub-list li:target { background: linear-gradient(90deg, color-mix(in srgb, var(--gaze) 9%, transparent), transparent 70%); }
.pub-list .cite { margin: 0; }
.pub-list .venue { font-family: var(--font-ui); font-size: var(--step--1); color: var(--muted); margin: 0.4rem 0 0; }
.pub-list .summary { margin: 0.75rem 0 0; }
.pub-list .pub-links { font-family: var(--font-ui); font-size: var(--step--1); font-weight: 600; display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; margin: 0.75rem 0 0; }
.pub-list .pub-links a { overflow-wrap: anywhere; }
.pub-list .abstract { margin: 0.75rem 0 0; }
.pub-list .abstract summary { font-family: var(--font-ui); font-size: var(--step--1); font-weight: 600; cursor: pointer; text-decoration: underline; text-decoration-color: var(--gaze); text-decoration-thickness: 1.5px; text-underline-offset: 0.18em; }
.pub-list .abstract p { margin: 0.75rem 0 0; }
.pub-note { font-family: var(--font-ui); font-size: var(--step--1); margin: 0 0 0.75rem; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .method { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .case-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .capabilities { grid-template-columns: 1fr; gap: 2rem; }
  .capabilities > div { padding: 0; border-left: 0; }
  .work-item a { grid-template-columns: 1fr; }
  .applications { grid-template-columns: 1fr; }
  .case-body { grid-template-columns: 1fr; }
  .case-body > h2 { margin-bottom: 0.75rem; }
  .case-body > h2 > span { position: static; }
  .site-head { flex-wrap: wrap; }
}
@media (max-width: 480px) {
  .method { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
