/* deepti.xyz: field-notebook theme.
   Hand-drawn framing over clean type: a researcher's sketchbook of road scenes,
   marked up the way a perception system marks them up. */

:root {
  --paper: #FAF6EE;
  --card: #FFFDF7;
  --sunk: #F1EADC;
  --ink: #1E2A33;
  --ink-soft: #5A666F;
  --marigold: #A34F0D;
  --teal: #2E6E68;
  --coral: #C2453F;
  --rule: rgba(30, 42, 51, 0.18);
  --link: var(--teal);

  /* Type scale: seven steps, rem-based so it honours the reader's
     browser font size. 12 / 14 / 15 / 16 / 18 / 26 / 34 at a 16px root. */
  --t-label: 0.75rem;    /* uppercase labels, tooltips, pills */
  --t-sm: 0.875rem;      /* secondary UI: chips, readouts, links, footer */
  --t-meta: 0.9375rem;   /* authors, tagline, news, supporting prose */
  --t-body: 1rem;        /* running prose */
  --t-title: 1.125rem;   /* publication titles */
  --t-h2: 1.625rem;      /* section headings */
  --t-h1: 2.125rem;      /* name */

  /* Weights: 300 long-form prose, 400 UI default, 500 headings and labels. */
  --w-prose: 300;
  --w-ui: 400;
  --w-strong: 500;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #151A1F;
    --card: #1E252C;
    --sunk: #232B33;
    --ink: #EDE6D9;
    --ink-soft: #9BA5AC;
    --marigold: #F0A94C;
    --teal: #6FBDB2;
    --coral: #E88379;
    --rule: rgba(237, 230, 217, 0.2);
  }
}

:root[data-theme="dark"] {
  --paper: #151A1F;
  --card: #1E252C;
  --sunk: #232B33;
  --ink: #EDE6D9;
  --ink-soft: #9BA5AC;
  --marigold: #F0A94C;
  --teal: #6FBDB2;
  --coral: #E88379;
  --rule: rgba(237, 230, 217, 0.2);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: "Lexend", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: var(--t-body);
  font-weight: var(--w-ui);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2 {
  font-family: "Lexend", "Public Sans", sans-serif;
  font-weight: var(--w-strong);
  line-height: 1.18;
  text-wrap: balance;
}

/* Caveat has a small x-height, so it is set a step up to sit optically
   level with the sans text around it. */
.hand { font-family: "Caveat", "Bradley Hand", cursive; font-size: 1.0625rem; line-height: 1.35; }
.label {
  font-family: "Lexend", sans-serif;
  font-size: var(--t-label);
  font-weight: var(--w-strong);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible, [role="button"]:focus-visible {
  outline: 2px solid var(--marigold);
  outline-offset: 3px;
  border-radius: 3px;
}

.wrap { max-width: 800px; margin: 0 auto; padding: 0 22px; }

/* ---------- Lane: road travelled turns amber ---------- */
.lane-rail, .lane-trail {
  position: fixed;
  left: 22px;
  width: 3px;
  z-index: 5;
  pointer-events: none;
  background: repeating-linear-gradient(180deg, currentColor 0 16px, transparent 16px 34px);
}
.lane-rail { top: 0; height: 100vh; color: var(--ink); opacity: 0.22; }
.lane-trail { top: 0; height: 0; color: var(--marigold); opacity: 0.95; }

.lane-rider {
  position: fixed;
  top: 0;
  left: 23.5px;
  z-index: 6;
  pointer-events: none;
  transform: translate(-50%, 0) rotate(90deg);
  transform-origin: center;
  color: var(--ink);
  will-change: top;
}
.lane-rider svg { display: block; overflow: visible; }

.puff {
  position: fixed;
  z-index: 6;
  pointer-events: none;
  color: var(--ink);
  animation: puff-rise 2.6s ease-out forwards;
}
@keyframes puff-rise {
  0%   { opacity: 0; transform: translate(-50%, 0) scale(0.5) rotate(-7deg); }
  15%  { opacity: 0.95; }
  60%  { opacity: 0.7; }
  100% { opacity: 0; transform: translate(-50%, -78px) scale(1.35) rotate(11deg); }
}
@media (max-width: 1040px) { .lane-rail, .lane-trail, .lane-rider, .puff { display: none; } }
@media (prefers-reduced-motion: reduce) { .puff { display: none; } }

/* ---------- Nav ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1.4px solid var(--rule);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-100%);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
}
.nav.scrolled { opacity: 1; visibility: visible; transform: none; }
@media (prefers-reduced-motion: reduce) { .nav { transition: none; } }
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 22px;
  max-width: 800px;
  margin: 0 auto;
}
.nav .brand {
  font-family: "Lexend", sans-serif;
  font-weight: var(--w-strong);
  font-size: var(--t-title);
  color: var(--ink);
}
.nav .brand:hover { text-decoration: none; }
.nav ul { display: flex; gap: 22px; list-style: none; }
.nav ul a { color: var(--ink-soft); }
.nav ul a:hover { color: var(--marigold); text-decoration: none; }

/* One vertical rhythm: every section owns 72px above and below itself,
   so the gap between any two sections is a consistent 144px. */
section { padding: 72px 0; scroll-margin-top: 66px; }

.head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.head h2 { font-size: var(--t-h2); letter-spacing: -0.01em; }
.underline { display: block; width: 128px; height: 9px; color: var(--marigold); margin-bottom: 26px; }
.underline svg { display: block; width: 100%; height: 100%; overflow: visible; }


/* ---------- About: owns the first screen ---------- */
.about {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 92px 0 72px;
  position: relative;
}
.about-head { display: flex; align-items: center; gap: 22px; margin-bottom: 24px; }

/* portrait, framed the way the models frame things */
.detect { position: relative; flex: none; width: 132px; padding: 7px; background: var(--sunk);
  border-radius: 195px 12px 215px 14px / 12px 205px 14px 195px; }
.detect img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  object-position: 50% 20%;
  border-radius: 165px 10px 175px 11px / 10px 170px 11px 165px;
}
.about h1 { font-size: var(--t-h1); letter-spacing: -0.02em; margin-bottom: 4px; }
.about .tagline { color: var(--ink-soft); font-size: var(--t-meta); }
.about p { margin-bottom: 14px; max-width: 72ch; font-weight: var(--w-prose); }
.about-links { margin-top: 28px; }

.icon-links { display: flex; flex-wrap: wrap; gap: 14px; }
.icon-links a,
.icon-links button {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  border: 0;
  padding: 0;
  cursor: pointer;
  font: inherit;
  transition: transform 0.16s ease, background 0.16s ease;
}
.icon-links a:hover,
.icon-links a:focus-visible,
.icon-links button:hover,
.icon-links button:focus-visible {
  background: var(--marigold);
  transform: translateY(-3px);
  text-decoration: none;
}
.icon-links svg { width: 20px; height: 20px; }
.icon-links .tip {
  position: absolute;
  top: calc(100% + 11px);
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  padding: 3px 11px;
  background: var(--card);
  color: var(--ink);
  border: 1.5px solid var(--ink);
  border-radius: 40px 9px 38px 10px / 9px 36px 10px 40px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease;
}
.icon-links .tip::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 50%;
  width: 7px;
  height: 7px;
  margin-left: -3.5px;
  border-radius: 50%;
  background: var(--ink);
}
.icon-links a:hover .tip,
.icon-links a:focus-visible .tip,
.icon-links button:hover .tip,
.icon-links button:focus-visible .tip,
.icon-links button.copied .tip { opacity: 1; transform: translateX(-50%) translateY(0); }
.icon-links button.copied { background: var(--teal); }
@media (prefers-reduced-motion: reduce) {
  .icon-links a, .icon-links button, .icon-links .tip { transition: none; }
}

.scroll-cue {
  position: absolute;
  left: 22px;
  bottom: 36px;
  color: var(--ink-soft);
  border-bottom: 1.6px dashed var(--rule);
  padding-bottom: 3px;
  transition: opacity 0.4s ease, color 0.2s ease;
}
.scroll-cue:hover { text-decoration: none; color: var(--marigold); border-color: var(--marigold); }
.scrolled-away .scroll-cue { opacity: 0; pointer-events: none; }

/* ---------- Publication cards ---------- */
.pub {
  position: relative;
  background: var(--card);
  border: 1.5px solid var(--rule);
  border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
  margin-bottom: 26px;
  overflow: hidden;
}
.pub:last-child { margin-bottom: 0; }
/* detection-box corner brackets */
.pub::before, .pub::after {
  content: "";
  position: absolute;
  width: 17px;
  height: 17px;
  border: 2.2px solid var(--marigold);
  opacity: 0.75;
  pointer-events: none;
}
.pub::before { top: 9px; left: 9px; border-right: 0; border-bottom: 0; border-radius: 4px 0 0 0; }
.pub::after { bottom: 9px; right: 9px; border-left: 0; border-top: 0; border-radius: 0 0 4px 0; }

.pub-main {
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
  gap: 24px;
  padding: 22px 24px 18px;
}

.row + .row { border-top: 1.4px dashed var(--rule); padding-top: 11px; margin-top: 11px; }

.pub .title {
  font-family: "Lexend", sans-serif;
  font-weight: var(--w-strong);
  font-size: var(--t-title);
  line-height: 1.4;
  letter-spacing: -0.005em;
  margin-bottom: 4px;
}
.pub .title a { color: var(--ink); }
.pub .title a:hover { color: var(--marigold); text-decoration: none; }
.pub .authors { font-size: var(--t-meta); color: var(--ink-soft); font-weight: var(--w-prose); }
.pub .authors .me { color: var(--ink); font-weight: var(--w-strong); }

.row-venue { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pill {
  display: inline-block;
  padding: 2px 11px;
  border-radius: 40px 9px 38px 10px / 9px 36px 10px 40px;
  background: var(--marigold);
  color: var(--card);
}
.pill--live { background: var(--teal); }
.pill--ghost { background: transparent; border: 1.4px solid var(--rule); color: var(--ink-soft); }

.par { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 4px 13px; }
.par dt { color: var(--marigold); padding-top: 5px; }
.par dd { font-size: var(--t-meta); line-height: 1.65; font-weight: var(--w-prose); }

.deployed {
  margin-top: 11px;
  font-size: var(--t-sm);
  font-weight: var(--w-prose);
  line-height: 1.55;
  padding: 9px 13px;
  background: var(--sunk);
  border-left: 3px solid var(--teal);
  border-radius: 0 130px 10px 0 / 0 10px 130px 0;
}

/* links strip closes each card */
.pub-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  align-items: center;
  padding: 12px 24px;
  background: var(--sunk);
  border-top: 1.4px solid var(--rule);
  font-size: var(--t-sm);
}
.pub-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-soft);
  cursor: pointer;
}
.pub-links a:hover { color: var(--marigold); text-decoration: none; }
.pub-links svg { width: 15px; height: 15px; flex: none; }

/* ---------- Media + interactive previews ---------- */
.frame { padding: 7px; background: var(--sunk); border-radius: 195px 12px 215px 14px / 12px 205px 14px 195px; }
.frame video, .frame img {
  width: 100%;
  display: block;
  border-radius: 145px 9px 155px 10px / 9px 150px 10px 145px;
  background: #000;
}
.preview-note { display: block; margin-top: 7px; color: var(--ink-soft); }

.chip {
  font-family: "Lexend", sans-serif;
  font-size: var(--t-sm);
  font-weight: var(--w-ui);
  color: var(--ink);
  background: transparent;
  border: 1.4px solid var(--rule);
  border-radius: 45px 8px 42px 9px / 8px 40px 9px 44px;
  padding: 4px 12px;
  cursor: pointer;
  text-align: left;
}
.chip:hover { border-color: var(--marigold); }
.chip[aria-pressed="true"] { background: var(--marigold); border-color: var(--marigold); color: var(--card); }

.demo-controls { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 9px; }
.qa-chips { display: flex; flex-direction: column; gap: 6px; margin-top: 9px; }

.readout {
  margin-top: 9px;
  padding: 8px 12px;
  background: var(--sunk);
  border-left: 3px solid var(--marigold);
  border-radius: 0 120px 9px 0 / 0 9px 120px 0;
  font-size: var(--t-sm);
  font-weight: var(--w-prose);
  line-height: 1.55;
}
.readout .label { color: var(--marigold); display: block; margin-bottom: 2px; }
.readout--link { border-left-color: var(--teal); }
.readout--link .label { color: var(--teal); }

.gaze-quiz { position: relative; display: block; width: 100%; cursor: crosshair; }
.gaze-quiz img { display: block; }
.gaze-mark {
  position: absolute;
  width: 26px; height: 26px;
  margin: -13px 0 0 -13px;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.gaze-mark.show { opacity: 1; }
.gaze-mark--truth { border: 4px solid #E23A2E; box-shadow: 0 0 0 2px rgba(255,255,255,0.9); }
.gaze-mark--guess { border: 3px dashed #FFFFFF; box-shadow: 0 0 0 2px rgba(0,0,0,0.45); }

/* ---------- News ---------- */
.news ul { list-style: none; }
.news li {
  font-weight: var(--w-prose);
  font-size: var(--t-meta);
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 18px;
  padding: 9px 0;
}
.news .date { color: var(--marigold); padding-top: 3px; white-space: nowrap; }

/* ---------- Footer ---------- */
footer {
  border-top: 1.4px dashed var(--rule);
  padding: 30px 0 56px;
  color: var(--ink-soft);
  font-size: var(--t-sm);
  font-weight: var(--w-prose);
}
footer .credit { max-width: 72ch; }

/* ---------- Responsive ---------- */
@media (max-width: 780px) {
  .pub-main { grid-template-columns: 1fr; gap: 16px; padding: 18px 18px 14px; }
  .pub-links { padding: 12px 18px; }
  .frame, .gaze-quiz { max-width: 440px; }
  .news li { grid-template-columns: 1fr; gap: 0; }
  .nav ul { gap: 14px; }
  .about-head { gap: 16px; }
  .detect { width: 104px; }
  .about h1 { font-size: 1.75rem; }
  .par { grid-template-columns: 1fr; gap: 0; }
  .par dt { padding-top: 9px; }
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
