/* gordontan.io: home page */

:root {
  --accent: #A3166F;
  --ink: #111314;
  --ink-soft: #3C4146;
  --muted: #5B6168;
  --rule: #E4E6E8;
  --photo-ground: #EEF0F2;
  --sans: 'Geist', 'Helvetica Neue', Arial, sans-serif;
  --mono: 'Geist Mono', ui-monospace, Menlo, monospace;
}

/* ---------- Base ---------- */

body {
  position: relative;            /* anchors the tick strip */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: #FFFFFF;
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
a:hover { text-decoration-thickness: 2px; }
a:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 2px; }

strong { font-weight: 600; }

::selection { background: var(--accent); color: #FFFFFF; }

/* Acronyms, set slightly smaller and tracked out */
.ac { font-size: .86em; letter-spacing: .05em; }

.container {
  width: 100%;
  max-width: 860px;
  box-sizing: border-box;
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 40px);
}

/* ---------- Backdrop details ---------- */

/* Contour lines behind the header and introduction, fading out downwards */
.top-band { position: relative; }
.top-band > .container { position: relative; }
.contours {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: url(../images/contours.svg) center top / cover no-repeat;
  -webkit-mask-image: linear-gradient(to bottom, #000 0, #000 38%, transparent 90%);
  mask-image: linear-gradient(to bottom, #000 0, #000 38%, transparent 90%);
}

/* Tick strip on the left edge: a tick every 8px, a longer one every 40px.
   .edge__now is the same strip in a darker grey, clipped to the current section by js/main.js. */
.edge,
.edge__now {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 10px;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(to bottom, currentColor 0 1px, transparent 1px 8px),
    repeating-linear-gradient(to bottom, currentColor 0 1px, transparent 1px 40px);
  background-size: 5px 100%, 10px 100%;
  background-repeat: no-repeat;
}
.edge { color: #CBD0D6; }
.edge__now {
  color: var(--muted);
  clip-path: inset(0 0 100% 0);
  transition: clip-path .6s cubic-bezier(.22, .61, .36, 1);
}

/* ---------- Header ---------- */

.site-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0 24px;
  padding: 14px 0;
}
.site-header__home {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0 24px;
  font-size: 15px;
}
.site-nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--ink);
  text-decoration: none;
}
.site-nav .site-nav__cv { color: var(--accent); }

/* Dot beside the link for the section being read (aria-current is set by js/main.js) */
.site-nav a[aria-current="true"]::before {
  content: "";
  position: absolute;
  left: -11px;
  top: 50%;
  width: 5px;
  height: 5px;
  margin-top: -2.5px;
  border-radius: 50%;
  background: var(--accent);
}

/* ---------- Introduction ---------- */

.hero {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 40px 0 56px;
}
.hero__name {
  margin: 0;
  font-size: clamp(36px, 5.2vw, 52px);
  line-height: 1.05;
  font-weight: 300;
  letter-spacing: -0.03em;
}
.hero__name span {
  display: inline-block;
  padding-bottom: 7px;
  border-bottom: 3px solid var(--accent);
}
.hero__role {
  margin: 0;
  padding-bottom: 1.5em;         /* one blank line before the introduction */
  font-size: 17px;
  line-height: 1.5;
}

/* Portrait comes first in the markup but sits on the right; it wraps above the text on narrow screens */
.hero__body {
  display: flex;
  flex-direction: row-reverse;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: flex-start;
  gap: 28px 48px;
}
.hero__portrait {
  flex: 0 0 auto;
  width: clamp(150px, 28vw, 240px);
  margin: 7px 0 0;
}
.hero__portrait img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: 50% 30%;
  background-color: var(--photo-ground);
}
.hero__text {
  flex: 1 1 420px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.hero__bio {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.hero__bio p {
  margin: 0;
  font-size: 17px;
  line-height: 1.55;
  text-wrap: pretty;
}
.hero__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 20px;
  font-family: var(--mono);
  font-size: 14px;
}
.hero__links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
.print-contact {
  display: none;
  margin: 0;
  font-family: var(--mono);
  font-size: 12px;
}

/* ---------- Sections ---------- */

.section { padding: 0 0 56px; }
.section__title {
  margin: 0;
  font-size: 22px;
  line-height: 1.3;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* Rule under each heading, ending in a latitude label */
.section__rule {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 1px;
  margin: 12px 0 0;
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1;
  letter-spacing: 0.03em;
  color: var(--muted);
}
.section__rule::before {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background-color: var(--ink);
}

/* ---------- Experience and education ---------- */

.entries {
  list-style: none;
  margin: 0;
  padding: 0;
}
.entry {
  position: relative;
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  column-gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--rule);
}
.entry__date {
  padding-top: 3px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
}
.entry__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.entry__title { font-size: 16px; line-height: 1.4; font-weight: 600; }
.entry__role { font-size: 15px; line-height: 1.45; color: var(--ink-soft); }
.entry__note { font-size: 15px; line-height: 1.45; color: var(--muted); }

/* Route marker between the date and the text: a line through every entry with a symbol on it.
   ::before is the line above the symbol, ::after the line below it. */
.wpt {
  position: absolute;
  left: 85px;
  top: 0;
  bottom: -1px;
  width: 11px;
  pointer-events: none;
  color: var(--accent);
}
.wpt svg { position: absolute; left: -2px; top: 17px; z-index: 1; }
.wpt::before,
.wpt::after {
  content: "";
  position: absolute;
  left: 5px;
  width: 1px;
  background: currentColor;
}
.wpt::before { top: 0; height: 25px; }
.wpt::after { top: 25px; bottom: 0; }
.wpt--last::after,
.wpt--solo::before,
.wpt--solo::after { display: none; }
/* Current entry: a short dashed stub ahead of the aircraft */
.wpt--now::before {
  top: 2px;
  height: 14px;
  background: repeating-linear-gradient(to bottom, currentColor 0 3px, transparent 3px 6px);
}
.wpt--solo svg { top: 15px; }

/* ---------- Publications ---------- */

.pub {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 24px;
  padding: 20px 0;
  border-bottom: 1px solid var(--rule);
}
.pub__figure {
  flex: 0 0 auto;
  align-self: flex-start;
  width: 168px;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}
.pub__body {
  flex: 1 1 360px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.pub__title {
  margin: 0;
  font-size: 18px;
  line-height: 1.35;
  font-weight: 600;
  text-wrap: pretty;
}
.pub__authors { margin: 0; font-size: 14px; line-height: 1.5; color: var(--muted); }
.pub__me { font-size: 15px; font-weight: 700; color: var(--ink); text-decoration: underline; }
.pub__venue { margin: 0; font-size: 15px; line-height: 1.5; color: var(--muted); }

.pub__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 8px;
}
.pub__links a,
.bib-button {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--accent);
  text-decoration: none;
}
.bib-button {
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.pill {
  padding: 3px 9px;
  border: 1px solid currentColor;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
}
/* BibTeX source for the BIB button: kept in the page, hidden from view */
.bib-src {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: pre;
}
.pub-note { margin: 10px 0 0; font-size: 13px; color: var(--muted); }

/* ---------- Off the clock ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(120px, 100%), 1fr));
  align-items: start;
  gap: 24px 16px;
  margin: 20px 0 0;
}
.grid__item {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.grid__item:nth-child(even) { margin-top: 32px; }   /* staggered columns */
.grid__number { align-self: flex-end; display: block; }
.grid__imagewrap {
  display: flex;
  aspect-ratio: 1 / 2;
  overflow: hidden;
}
/* The photo is held slightly enlarged so it has room to drift under the pointer (js/main.js) */
.grid__image {
  flex: 1 1 auto;
  display: flex;
  margin: 0;
  background-color: var(--photo-ground);
  transform: scale(1.12);
  transition: transform 2.4s cubic-bezier(.22, .61, .36, 1);
  will-change: transform;
}
.grid__image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
}
.grid__title { font-size: 16px; line-height: 1.4; font-weight: 600; }

/* ---------- Footer ---------- */

.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--rule);
}
.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 24px;
  padding-top: 20px;
  padding-bottom: 28px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

/* ---------- Small screens, reduced motion, print ---------- */

@media (max-width: 600px) {
  .edge { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .edge__now,
  .grid__image { transition: none; }
}

/* Printed, the page is a one-sheet summary: no navigation, no gallery, plain contact line */
@media print {
  .edge,
  .contours,
  .site-nav,
  .hero__links,
  #off-the-clock { display: none; }
  .print-contact { display: block; }
  a { color: var(--ink) !important; text-decoration: none !important; }
  button { color: var(--ink) !important; }
  section { padding-bottom: 28px !important; break-inside: avoid; }
  .site-footer { border-top: 0; }
}
