/* ---------------------------------------------------------------
   Style — you normally don't need to touch this file.
   To change the accent colour, edit --accent below.
   --------------------------------------------------------------- */
:root {
  --paper: #f2eee6;
  --paper-2: #e9e3d7;
  --ink: #1c1b18;
  --muted: #6b665c;
  --line: #d3cbbb;
  --accent: #a8492a;      /* laterite red */
  --serif: "Newsreader", Georgia, serif;
  --sans: "Instrument Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --gutter: clamp(16px, 4vw, 48px);
  --max: 1280px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #161512; --paper-2: #1f1d19; --ink: #ece6da;
    --muted: #9c9587; --line: #35322c; --accent: #d9764f;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--sans); font-size: 16px; line-height: 1.55;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent); }
img { max-width: 100%; display: block; }
.mono { font-family: var(--mono); font-size: 12px; letter-spacing: .04em; text-transform: uppercase; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 8px; top: 8px; background: var(--ink); color: var(--paper); padding: 8px 12px; z-index: 10; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---- top bar ---- */
.topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 14px var(--gutter);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { font-family: var(--serif); font-size: 19px; text-decoration: none; white-space: nowrap; }
.nav { display: flex; gap: 22px; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; text-decoration: none; color: var(--muted); white-space: nowrap; }
.nav a:hover, .nav a.active { color: var(--ink); }
.nav a.active { text-decoration: underline; text-decoration-color: var(--accent); }

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

/* ---- hero ---- */
.hero { padding: clamp(48px, 9vw, 120px) 0 0; }
.eyebrow { color: var(--muted); margin: 0 0 40px; }
.hero-name {
  font-family: var(--serif); font-weight: 300; margin: 0;
  font-size: clamp(52px, 11vw, 168px); line-height: .92; letter-spacing: -.035em;
}
.hero-tagline {
  font-family: var(--serif); font-size: clamp(20px, 2.4vw, 30px); line-height: 1.3;
  max-width: 30ch; margin: 28px 0 0; font-weight: 350; text-wrap: balance;
}
.now {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin: clamp(40px, 6vw, 72px) 0 0; border-top: 1px solid var(--ink);
}
.now > div { padding: 14px 20px 14px 0; border-bottom: 1px solid var(--line); }
.now dt { font-family: var(--serif); font-size: 19px; line-height: 1.25; }
.now dd { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.now .yrs { font-family: var(--mono); font-size: 11px; color: var(--accent); text-transform: uppercase; letter-spacing: .05em; display: block; margin-bottom: 6px; }

.hero-figure { margin: clamp(40px, 6vw, 72px) 0 0; }
.hero-figure img, .hero-figure svg { width: 100%; aspect-ratio: 21 / 9; object-fit: cover; background: var(--paper-2); }
figcaption { font-family: var(--mono); font-size: 11px; color: var(--muted); margin-top: 10px; letter-spacing: .03em; }

/* ---- sections ---- */
.section {
  display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 9fr); gap: 0 var(--gutter);
  padding: clamp(56px, 8vw, 104px) 0; border-bottom: 1px solid var(--line);
}
.section-head { position: sticky; top: 84px; align-self: start; display: flex; gap: 14px; align-items: baseline; }
.section-head .mono { color: var(--accent); }
.section-head h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(28px, 3vw, 40px); margin: 0; letter-spacing: -.01em; line-height: 1.05; }
.section-body { min-width: 0; }

/* about */
.about { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: var(--gutter); align-items: start; }
.about-text p { font-family: var(--serif); font-size: clamp(18px, 1.6vw, 21px); line-height: 1.55; margin: 0 0 1em; max-width: 62ch; }
.portrait { margin: 0; }
.portrait img, .portrait svg { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; background: var(--paper-2); }

/* projects */
.projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 40px 28px; }
.project { display: flex; flex-direction: column; }
.project .img { aspect-ratio: 4 / 3; background: var(--paper-2); overflow: hidden; margin-bottom: 16px; }
.project .img img, .project .img svg { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.project:hover .img img { transform: scale(1.03); }
.project .meta { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); }
.project h3 { font-family: var(--serif); font-weight: 400; font-size: 24px; line-height: 1.15; margin: 8px 0 8px; }
.project h3 a { text-decoration: none; }
.project p { margin: 0 0 10px; color: var(--ink); font-size: 15px; }
.project .role { color: var(--accent); }

/* rows (publications, talks) */
.rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); }
.row {
  display: grid; grid-template-columns: 84px minmax(0, 1fr) 28px; gap: 4px 20px;
  padding: 20px 0; border-bottom: 1px solid var(--line);
}
.row .when { font-family: var(--mono); font-size: 12px; color: var(--muted); padding-top: 5px; }
.row .title { font-family: var(--serif); font-weight: 400; font-size: 21px; line-height: 1.25; margin: 0; }
.row .title a { text-decoration: none; }
.row .title a:hover { text-decoration: underline; }
.row .authors { font-size: 14px; color: var(--muted); margin: 6px 0 0; }
.row .authors b { color: var(--ink); font-weight: 600; }
.row .venue { font-size: 14px; margin: 2px 0 0; font-style: italic; font-family: var(--serif); }
.row .arrow { font-family: var(--mono); text-decoration: none; color: var(--muted); padding-top: 4px; text-align: right; }
a.row-link:hover .arrow { color: var(--accent); }
.tag { display: inline-block; font-family: var(--mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; padding: 2px 7px; border: 1px solid var(--line); color: var(--muted); margin: 8px 6px 0 0; }
.tag.award { border-color: var(--accent); color: var(--accent); }

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.chip {
  font-family: var(--mono); font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em;
  background: transparent; color: var(--muted); border: 1px solid var(--line); padding: 7px 12px; cursor: pointer; border-radius: 0;
}
.chip:hover { color: var(--ink); border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chip .n { opacity: .6; margin-left: 4px; }
.more { margin-top: 20px; background: none; border: 1px solid var(--ink); color: var(--ink); padding: 10px 16px; cursor: pointer; }
.more:hover { background: var(--ink); color: var(--paper); }

/* teaching / awards */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gutter); }
.sub { color: var(--muted); margin: 0 0 6px; font-weight: 400; }
.simple { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); }
.simple li { padding: 14px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 12px; }
.simple .t { font-family: var(--serif); font-size: 18px; line-height: 1.3; }
.simple .w { display: block; font-size: 14px; color: var(--muted); font-family: var(--sans); }
.simple .y { font-family: var(--mono); font-size: 12px; color: var(--muted); padding-top: 4px; }

/* contact */
.email { font-family: var(--serif); font-size: clamp(28px, 5vw, 64px); font-weight: 300; letter-spacing: -.02em; text-decoration: none; border-bottom: 1px solid var(--accent); overflow-wrap: anywhere; }
.links { list-style: none; padding: 0; margin: 36px 0 0; display: flex; flex-wrap: wrap; gap: 12px 28px; }
.links a { text-decoration: none; }
.links a::after { content: " ↗"; color: var(--accent); }

.footer { max-width: var(--max); margin: 0 auto; padding: 28px var(--gutter) 40px; display: flex; justify-content: space-between; gap: 16px; color: var(--muted); flex-wrap: wrap; }

/* drawing placeholders */
.drawing { color: var(--ink); }
.drawing .faint { stroke: var(--line); }
.drawing .acc { stroke: var(--accent); }

/* typo banner */
.content-error { position: fixed; inset: auto 16px 16px 16px; z-index: 20; background: #b3261e; color: #fff; padding: 16px 20px; font-family: var(--mono); font-size: 13px; line-height: 1.5; }

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } html { scroll-behavior: auto; } }

/* ---- responsive ---- */
@media (max-width: 860px) {
  .section { grid-template-columns: 1fr; }
  .section-head { position: static; margin-bottom: 28px; }
  .about { grid-template-columns: 1fr; }
  .portrait { max-width: 260px; }
  .two-col { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .topbar { flex-direction: column; align-items: flex-start; gap: 8px; padding-top: 10px; padding-bottom: 10px; }
  .nav { width: 100%; gap: 18px; }
  html { scroll-padding-top: 96px; }
  .row { grid-template-columns: minmax(0, 1fr) 20px; }
  .row .when { grid-column: 1 / -1; padding-top: 0; }
  .row .title { font-size: 19px; }
  .hero-figure img, .hero-figure svg { aspect-ratio: 4 / 3; }
}
@media print {
  .topbar, .filters, .more, .hero-figure { display: none; }
  .reveal { opacity: 1; transform: none; }
}

/* ---- my changes ---- */
.hero-name .suffix { font-size: .3em; letter-spacing: 0; }
.now { display: none; }
.hero-name { white-space: nowrap; font-size: clamp(32px, 9vw, 130px); }

/* ---- slowly shifting background colour ---- */
@property --paper { syntax: '<color>'; inherits: true; initial-value: #f2eee6; }
:root { animation: paper-shift 30s ease-in-out infinite alternate; }
@keyframes paper-shift {
  0%   { --paper: #f2eee6; }   /* paper */
  25%  { --paper: #f6e4d0; }   /* warm sand */
  50%  { --paper: #f3dbd1; }   /* pale clay */
  75%  { --paper: #dfe8d9; }   /* pale sage */
  100% { --paper: #d9e5eb; }   /* cool mist */
}
/* phones and computers in dark mode get a darker version of the same drift */
@media (prefers-color-scheme: dark) {
  :root { animation-name: paper-shift-dark; }
}
@keyframes paper-shift-dark {
  0%   { --paper: #161512; }
  25%  { --paper: #1f1912; }
  50%  { --paper: #221715; }
  75%  { --paper: #151c16; }
  100% { --paper: #12191d; }
}
