/* Olivia Liu — personal site
   Navy is sampled from the portrait's studio backdrop; the body is ledger paper. */

:root {
  --navy: #152838;
  --navy-lift: #2e4153;
  --navy-deep: #0e1c28;
  --on-navy: #e9eeea;
  --on-navy-soft: #a7b6c2;
  --sky: #a9c7de;

  --paper: #eef2ee;
  --rule: #c3d1c6;
  --ink: #142636;
  --ink-soft: #4c5d69;
  --link: #1f5480;
  --ledger-red: #b5524a;

  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --sans: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;

  --max: 1180px;
  --gutter: clamp(16px, 4vw, 48px);
  --measure: 66ch;
  --lens-h: 0px;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0f1b25;
    --rule: #263847;
    --ink: #e1e8e4;
    --ink-soft: #9badb9;
    --link: #a9c7de;
    --ledger-red: #c96c62;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0f1b25;
  --rule: #263847;
  --ink: #e1e8e4;
  --ink-soft: #9badb9;
  --link: #a9c7de;
  --ledger-red: #c96c62;
  color-scheme: dark;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--lens-h) + 16px);
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.55;
  font-feature-settings: "kern", "liga";
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, ul, dl, dd, figure { margin: 0; }
ul { padding: 0; list-style: none; }
img { display: block; max-width: 100%; height: auto; }

a { color: var(--link); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

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

.skip {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 50;
  padding: 10px 14px;
  background: var(--on-navy);
  color: var(--navy);
}
.skip:focus { top: 16px; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

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

/* ---------- Hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  color: var(--on-navy);
  background:
    radial-gradient(90% 80% at 88% 8%, var(--navy-lift) 0%, rgba(46, 65, 83, 0) 60%),
    linear-gradient(180deg, var(--navy) 0%, var(--navy-deep) 100%);
}
.hero :focus-visible { outline-color: var(--sky); }

.nav {
  position: relative;
  z-index: 3;
  max-width: var(--max);
  margin: 0 auto;
  padding: 22px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.nav a { color: var(--on-navy); text-decoration: none; }
.nav a:hover { text-decoration: underline; }
.nav__home {
  font-family: var(--serif);
  font-size: 1.3125rem;
  letter-spacing: 0.02em;
}
.nav__links {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.4vw, 32px);
  font-size: 0.9375rem;
}
.nav__resume {
  padding: 6px 14px;
  border: 1px solid rgba(233, 238, 234, 0.45);
  border-radius: 999px;
}
.nav__resume:hover { text-decoration: none !important; border-color: var(--on-navy); }

.hero__photo {
  position: absolute;
  z-index: 1;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(54vw, 880px);
  -webkit-mask-image:
    linear-gradient(to right, transparent 0%, #000 30%),
    linear-gradient(to bottom, transparent 0%, #000 14%);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(to right, transparent 0%, #000 30%),
    linear-gradient(to bottom, transparent 0%, #000 14%);
  mask-composite: intersect;
}
.hero__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 46% 18%;
}

.hero__inner {
  position: relative;
  z-index: 2;
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(48px, 9vh, 120px) var(--gutter) clamp(56px, 10vh, 120px);
  min-height: min(calc(100vh - 80px), 780px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.hero__inner > * { max-width: 560px; }

.hero__name {
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-weight: 400;
  font-size: clamp(3.5rem, 9vw, 7.5rem);
  line-height: 0.92;
  letter-spacing: -0.025em;
  max-width: none;
  white-space: nowrap;
}

.hero__lede {
  margin-top: 28px;
  font-family: var(--serif);
  font-size: clamp(1.1875rem, 1.6vw, 1.375rem);
  line-height: 1.45;
  color: var(--on-navy);
  max-width: 34ch;
}

.hero__creds {
  margin-top: 32px;
  display: grid;
  gap: 10px;
  font-size: 0.9375rem;
  color: var(--on-navy-soft);
}
.hero__creds div { display: flex; flex-wrap: wrap; column-gap: 10px; }
.hero__creds dt { color: var(--on-navy); font-weight: 500; }

.hero__actions {
  margin-top: 36px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 14px;
}

.btn {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  padding: 0 22px;
  border-radius: 999px;
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease;
}
.btn--solid { background: var(--on-navy); color: var(--navy); }
.btn--solid:hover { background: #ffffff; }
.btn--line { border: 1px solid rgba(233, 238, 234, 0.5); color: var(--on-navy); }
.btn--line:hover { border-color: var(--on-navy); background: rgba(233, 238, 234, 0.06); }
.btn--text { color: var(--on-navy); padding: 0 6px; text-decoration: underline; text-decoration-color: rgba(233, 238, 234, 0.4); }
.btn--text:hover { text-decoration-color: var(--on-navy); }

.hero__status {
  margin-top: 28px;
  font-size: 0.875rem;
  color: var(--on-navy-soft);
}

/* The one orchestrated moment: she steps out of the backdrop, then the name settles. */
@media (prefers-reduced-motion: no-preference) {
  .hero__photo img { animation: emerge 1400ms cubic-bezier(.2, .7, .2, 1) both; }
  .hero__inner > * { animation: settle 900ms cubic-bezier(.2, .7, .2, 1) both; }
  .hero__name { animation-delay: 250ms; }
  .hero__lede { animation-delay: 420ms; }
  .hero__creds { animation-delay: 520ms; }
  .hero__actions { animation-delay: 600ms; }
  .hero__status { animation-delay: 680ms; }
}
@keyframes emerge {
  from { opacity: 0; transform: scale(1.04); }
  to { opacity: 1; transform: none; }
}
@keyframes settle {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

/* ---------- Shared section type ---------- */

.section-title {
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-weight: 400;
  font-size: clamp(2rem, 3.6vw, 2.75rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.block { padding: clamp(64px, 9vw, 112px) 0 0; }
.block .section-title { margin-bottom: clamp(28px, 4vw, 48px); }

/* ---------- Figures, set as a ledger page ---------- */

.figures { padding: clamp(64px, 9vw, 112px) 0 clamp(56px, 7vw, 88px); }
.figures .section-title { margin-bottom: 28px; }

.ledger {
  --amt: clamp(8.25rem, 20vw, 13.5rem);
  position: relative;
  border-top: 1px solid var(--rule);
}
/* the double red rule that runs down a ledger page before the amount column */
.ledger::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  right: var(--amt);
  width: 4px;
  border-left: 1px solid var(--ledger-red);
  border-right: 1px solid var(--ledger-red);
  opacity: 0.75;
}
.ledger li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--amt);
  align-items: baseline;
  border-bottom: 1px solid var(--rule);
  padding: 18px 0 16px;
}
.ledger li > div { padding-right: 28px; }
.ledger__what { max-width: 52ch; }
.ledger__where { margin-top: 4px; font-size: 0.875rem; color: var(--ink-soft); }
.ledger__fig {
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-size: clamp(1.75rem, 3.4vw, 2.625rem);
  line-height: 1;
  text-align: right;
  font-variant-numeric: lining-nums tabular-nums;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

/* ---------- Focus switch ---------- */

.lens {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--paper);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.lens__inner {
  display: flex;
  align-items: center;
  gap: 12px 20px;
  padding-top: 12px;
  padding-bottom: 12px;
}
.lens__label { font-size: 0.875rem; color: var(--ink-soft); white-space: nowrap; }
.lens__options {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  flex: 1 1 auto;
  min-width: 0;
}
.lens__options::-webkit-scrollbar { display: none; }
.lens__options button {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease;
}
.lens__options button:hover { border-color: var(--ink-soft); }
.lens__options button[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}
.lens__resume { font-size: 0.875rem; white-space: nowrap; }

/* items outside the chosen focus step back but stay readable */
[data-lens], .entry__org, .entry__role, .entry__when {
  transition: opacity 220ms ease;
}
.is-dim { opacity: 0.36; }
.entry.is-quiet .entry__org,
.entry.is-quiet .entry__role,
.entry.is-quiet .entry__when { opacity: 0.36; }

/* ---------- Experience, set as journal entries ---------- */

.entry {
  display: grid;
  grid-template-columns: 11rem minmax(0, 1fr);
  gap: 8px 32px;
  padding: 28px 0 32px;
  border-top: 1px solid var(--rule);
}
.entry:last-child { border-bottom: 1px solid var(--rule); }
.entry__when {
  padding-top: 6px;
  font-size: 0.9375rem;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}
.entry__org {
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-weight: 500;
  font-size: 1.5rem;
  line-height: 1.2;
}
.entry__role { margin-top: 2px; color: var(--ink-soft); }
.entry__points { margin-top: 14px; max-width: var(--measure); }
.entry__points li {
  position: relative;
  padding-left: 20px;
}
.entry__points li + li { margin-top: 8px; }
.entry__points li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.72em;
  width: 8px;
  height: 1px;
  background: var(--ink-soft);
}

/* ---------- Projects ---------- */

.projects {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 clamp(32px, 5vw, 72px);
}
.project {
  padding: 28px 0 36px;
  border-top: 2px solid var(--ink);
}
.project__title {
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-weight: 500;
  font-size: 1.5rem;
  line-height: 1.2;
  max-width: 24ch;
}
.project__context { margin: 4px 0 14px; font-size: 0.9375rem; color: var(--ink-soft); }
.project p:not([class]) { max-width: 60ch; }
.project__methods { margin-top: 14px; font-size: 0.875rem; color: var(--ink-soft); font-style: italic; font-family: var(--serif); font-size: 1rem; }

/* ---------- Skills ---------- */

.skills > div {
  display: grid;
  grid-template-columns: 11rem minmax(0, 1fr);
  gap: 4px 32px;
  padding: 18px 0;
  border-top: 1px solid var(--rule);
}
.skills > div:last-child { border-bottom: 1px solid var(--rule); }
.skills dt {
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-size: 1.1875rem;
  font-weight: 500;
}
.skills dd { max-width: var(--measure); }

/* ---------- Education ---------- */

.schools {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 clamp(32px, 5vw, 72px);
}
.school { padding: 28px 0 8px; border-top: 1px solid var(--rule); }
.school__name {
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-weight: 500;
  font-size: 1.5rem;
  line-height: 1.2;
}
.school__degree { margin-top: 6px; }
.school__when { margin-top: 2px; font-size: 0.9375rem; color: var(--ink-soft); }
.school__detail { margin-top: 14px; max-width: 56ch; color: var(--ink-soft); }

/* ---------- Contact ---------- */

.contact {
  margin-top: clamp(80px, 11vw, 140px);
  padding: clamp(64px, 9vw, 112px) 0 40px;
  color: var(--on-navy);
  background:
    radial-gradient(80% 90% at 90% 0%, var(--navy-lift) 0%, rgba(46, 65, 83, 0) 60%),
    var(--navy);
}
.contact :focus-visible { outline-color: var(--sky); }
.contact__title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2rem, 3.6vw, 2.75rem);
  line-height: 1.1;
}
.contact__lede { margin-top: 12px; color: var(--on-navy-soft); }
.contact__email {
  display: inline-block;
  margin-top: 28px;
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-size: clamp(1.75rem, 5vw, 3.5rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--on-navy);
  text-decoration-color: rgba(233, 238, 234, 0.35);
  overflow-wrap: anywhere;
}
.contact__email:hover { text-decoration-color: var(--on-navy); }
.contact__links {
  margin-top: 32px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
}
.contact__links a { color: var(--on-navy); }
.contact__fine {
  margin-top: clamp(56px, 8vw, 96px);
  padding-top: 20px;
  border-top: 1px solid rgba(233, 238, 234, 0.14);
  font-size: 0.8125rem;
  color: var(--on-navy-soft);
}

/* ---------- Narrower screens ---------- */

@media (max-width: 980px) {
  .hero__photo { width: 60vw; opacity: 0.9; }
  .hero__inner > * { max-width: 480px; }
  .lens__label { display: none; }
}

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

  .nav__wide { display: none; }

  .hero__photo {
    position: relative;
    width: 100%;
    height: min(72vh, 520px);
    margin-top: -78px;
    opacity: 1;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 18%, #000 62%, transparent 100%);
    mask-image: linear-gradient(to bottom, transparent 0%, #000 18%, #000 62%, transparent 100%);
  }
  .hero__photo img { object-position: 50% 22%; }
  .hero__inner {
    min-height: 0;
    margin-top: -112px;
    padding-top: 0;
    padding-bottom: 56px;
  }
  .hero__name { font-size: clamp(3.25rem, 15vw, 4.5rem); }
  .hero__lede { margin-top: 20px; }

  .ledger { --amt: 8rem; }
  .ledger li > div { padding-right: 16px; }
  .ledger__fig { font-size: 1.375rem; }

  .lens__inner { flex-wrap: wrap; gap: 8px; padding-top: 10px; padding-bottom: 10px; }
  .lens__options { order: 2; flex-basis: 100%; margin: 0 calc(var(--gutter) * -1); padding: 0 var(--gutter); }
  .lens__resume { order: 1; margin-left: auto; }
  .lens__label { display: block; order: 0; }

  .entry,
  .skills > div { grid-template-columns: minmax(0, 1fr); }
  .entry__when { padding-top: 0; order: -1; }

  .projects,
  .schools { grid-template-columns: minmax(0, 1fr); }
}

@media print {
  .lens, .nav, .hero__photo { display: none; }
  .hero, .contact { background: none; color: #000; }
  .is-dim, .entry.is-quiet * { opacity: 1 !important; }
}
