/* ------------------------------------------------------------------
   Jacob Lin, personal site
   Sparse editorial layout. Serif text, mono technical labels,
   monochrome with a single neon blue accent.
   ------------------------------------------------------------------ */

:root {
  --bg: #ffffff;
  --ink: #0a0a0a;
  --ink-2: #0a0a0a;
  --ink-3: #0a0a0a;
  --rule: #e4e4e4;
  --rule-strong: #bdbdbd;
  --accent: #2323ff;
  --accent-text: #2323ff;
  --selection: rgba(35, 35, 255, 0.18);

  --serif: 'Newsreader', 'Iowan Old Style', 'Palatino Linotype', Georgia, 'Times New Roman', serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  --max: 1280px;
  --gutter: clamp(20px, 6vw, 96px);
  --label-size: 10.5px;
  --label-track: 0.08em;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0a0a;
    --ink: #ededed;
    --ink-2: #ededed;
    --ink-3: #ededed;
    --rule: #222222;
    --rule-strong: #3a3a3a;
    --accent: #2323ff;
    --accent-text: #7a7aff;
    --selection: rgba(122, 122, 255, 0.28);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0a0a0a;
  --ink: #ededed;
  --ink-2: #ededed;
  --ink-3: #ededed;
  --rule: #222222;
  --rule-strong: #3a3a3a;
  --accent: #2323ff;
  --accent-text: #7a7aff;
  --selection: rgba(122, 122, 255, 0.28);
  color-scheme: dark;
}

/* ---------- base ---------- */

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

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.55;
  font-weight: 400;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  transition: background-color 0.25s ease, color 0.25s ease;
}

::selection { background: var(--selection); }

a {
  color: inherit;
  text-decoration: none;
}

a:focus-visible,
button:focus-visible {
  outline: 1px solid var(--accent-text);
  outline-offset: 3px;
}

h1, h2, h3, p, ul, ol, dl, figure { margin: 0; }

/* ---------- technical labels ---------- */

.label {
  font-family: var(--mono);
  font-size: var(--label-size);
  letter-spacing: var(--label-track);
  text-transform: uppercase;
  color: var(--ink-3);
  line-height: 1.6;
  font-weight: 400;
}

.br {
  color: var(--ink-3);
  transition: color 0.15s ease;
}

.ctl {
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
  font-family: var(--mono);
  font-size: var(--label-size);
  letter-spacing: var(--label-track);
  text-transform: uppercase;
  color: var(--ink-2);
  line-height: 1.6;
  transition: color 0.15s ease;
}

.ctl:hover { color: var(--accent-text); }
.ctl:hover .br { color: var(--accent-text); }
.ctl.is-active { color: var(--accent-text); }
.ctl.is-active .br { color: var(--accent-text); }

/* ---------- navigation ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: baseline;
  gap: 24px;
  padding: 28px var(--gutter);
  max-width: var(--max);
  margin: 0 auto;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.nav__name {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.005em;
}

.nav__links {
  display: flex;
  gap: 22px;
  font-family: var(--mono);
  font-size: var(--label-size);
  letter-spacing: var(--label-track);
  text-transform: uppercase;
  color: var(--ink-2);
}

.nav__links a { transition: color 0.15s ease; }
.nav__links a:hover { color: var(--accent-text); }
.nav__links a:hover .br { color: var(--accent-text); }

.nav__meta {
  display: flex;
  justify-content: flex-end;
  align-items: baseline;
  gap: 22px;
}

.nav__clock {
  font-family: var(--mono);
  font-size: var(--label-size);
  letter-spacing: var(--label-track);
  text-transform: uppercase;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

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

main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(48px, 8vw, 128px);
  align-items: start;
  padding: clamp(72px, 12vh, 160px) 0 clamp(96px, 14vh, 192px);
}

.hero__text {
  position: sticky;
  top: 112px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.hero__title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(34px, 3.8vw, 52px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-optical-sizing: auto;
  font-variation-settings: 'opsz' 72;
  margin: 4px 0 8px;
}

.lede {
  font-size: clamp(16px, 1.2vw, 18px);
  line-height: 1.6;
  max-width: 38ch;
  color: var(--ink);
}

.lede a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: var(--rule-strong);
  transition: text-decoration-color 0.15s ease, color 0.15s ease;
}

.lede a:hover {
  color: var(--accent-text);
  text-decoration-color: var(--accent-text);
}

.lede--muted {
  color: var(--ink-2);
  font-size: clamp(17px, 1.25vw, 19px);
}

.tags {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  font-family: var(--mono);
  font-size: var(--label-size);
  letter-spacing: var(--label-track);
  text-transform: uppercase;
  color: var(--ink-3);
}

.tags li::before {
  content: '';
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-right: 9px;
  vertical-align: 1px;
  background: var(--accent);
}

/* ---------- exhibit ---------- */

.exhibit {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.exhibit__controls {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
}

.exhibit__frame {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-height: 620px;
}

.exhibit__frame canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: crosshair;
}

.exhibit__caption {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 16px;
  font-size: 13px;
  line-height: 1.6;
  max-width: 60ch;
}

.exhibit__caption .label { padding-top: 2px; }

/* ---------- sections ---------- */

.section {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 8fr);
  gap: clamp(32px, 6vw, 128px);
  padding: clamp(72px, 12vh, 160px) 0;
}

.section__label { padding-top: 6px; }

.section__body {
  display: flex;
  flex-direction: column;
  gap: 32px;
  max-width: 64ch;
}

.prose {
  font-size: clamp(16px, 1.2vw, 18px);
  line-height: 1.6;
  color: var(--ink);
}

.prose a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: var(--rule-strong);
  transition: text-decoration-color 0.15s ease, color 0.15s ease;
}

.prose a:hover {
  color: var(--accent-text);
  text-decoration-color: var(--accent-text);
}

.prose--after { margin-top: 8px; }

.sublabel { margin-bottom: -8px; }
.sublabel--spaced { margin-top: 48px; }

/* photograph */

.photo {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0;
}

.photo__frame {
  position: relative;
  background: var(--bg);
}

.photo__frame img {
  display: block;
  width: 100%;
  height: auto;
  filter: grayscale(1) contrast(1.02);   /* always black and white */
}

/* index list in About */

.index {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 8px;
}

.index__row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 20px;
  align-items: baseline;
}

.index__row dd {
  margin: 0;
  font-size: 16px;
  line-height: 1.5;
}

.index__row dd a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: var(--rule-strong);
}

.index__row dd a:hover { color: var(--accent-text); text-decoration-color: var(--accent-text); }

.index__links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
}

/* projects */

.projects {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.project {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 24px;
  align-items: start;
}

.project__num { padding-top: 5px; }

.project__content {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.project__title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(18px, 1.4vw, 21px);
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.project__question {
  font-size: 15px;
  line-height: 1.6;
  max-width: 56ch;
}

.project__status { padding-top: 5px; white-space: nowrap; }

/* arrow links */

.link-arrow {
  display: inline-block;
  transition: color 0.15s ease;
}

.link-arrow::after {
  content: '\2197';
  display: inline-block;
  margin-left: 0.35em;
  font-family: var(--mono);
  font-size: 0.7em;
  color: var(--ink-3);
  transform: translateY(-0.1em);
  transition: color 0.15s ease, transform 0.15s ease;
}

.link-arrow:hover { color: var(--accent-text); }
.link-arrow:hover::after { color: var(--accent-text); transform: translate(2px, -3px); }

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

.footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 64px var(--gutter) 64px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 24px;
  align-items: baseline;
}

.footer__col {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.footer__links {
  flex-direction: row;
  gap: 22px;
}

.footer__links a { transition: color 0.15s ease; }
.footer__links a:hover { color: var(--accent-text); }
.footer__links a:hover .br { color: var(--accent-text); }

.footer__right { align-items: flex-end; }


/* ---------- responsive ---------- */

@media (max-width: 1040px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 56px;
  }
  .hero__text { position: static; }
  .exhibit__frame { max-height: none; }
}

@media (max-width: 760px) {
  body { font-size: 16px; }

  .nav {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "name meta"
      "links links";
    row-gap: 14px;
    padding-top: 18px;
    padding-bottom: 16px;
  }
  .nav__name { grid-area: name; }
  .nav__links { grid-area: links; gap: 16px; }
  .nav__meta { grid-area: meta; gap: 16px; }
  .nav__clock { display: none; }

  .hero { padding-top: 48px; padding-bottom: 72px; gap: 64px; }
  .hero__title { font-size: clamp(32px, 9vw, 42px); }

  .section {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 64px 0;
  }

  .index__row { grid-template-columns: 1fr; gap: 6px; }

  .project {
    grid-template-columns: 36px 1fr;
    gap: 14px;
  }
  .project__status {
    grid-column: 2;
    padding-top: 0;
  }

  .exhibit__caption { grid-template-columns: 1fr; gap: 6px; }

  .footer {
    grid-template-columns: 1fr 1fr;
    row-gap: 28px;
  }
  .footer__links { flex-wrap: wrap; gap: 12px 20px; }
  .footer__links a { white-space: nowrap; }
  .footer__right { grid-column: 2; grid-row: 1; }
  .footer__links { grid-column: 1 / -1; }
}
