/* Direction A — Obsidian & Brass.
   The rules behind these values live in DESIGN.md. */

:root {
  --obsidian:   #0B0B0A;  /* page ground */
  --carbon:     #121210;  /* raised surfaces */
  --graphite:   #262521;  /* hairlines */
  --graphite-2: #3A3833;  /* outlined buttons, inputs */
  --ash:        #9C978D;  /* secondary text */
  --parchment:  #D9D3C7;  /* lead paragraphs */
  --ivory:      #ECE7DD;  /* headings, the primary button */
  --brass:      #B8985C;  /* accent ink, at most 5% of a screen */
  --paper:      #F1EDE5;  /* documents and screenshots */
  --ink:        #1A1916;  /* text on paper */

  /* secondary */
  --rule:       #1E1D1A;  /* header and footer rules */
  --stone:      #CFC9BD;  /* chip text, credential strip */
  --ink-2:      #5B574F;  /* secondary text on paper */

  --radius: 2px;
  --serif: 'Instrument Serif', Georgia, serif;
  --sans:  'Geist', 'Helvetica Neue', Arial, sans-serif;
  --mono:  'Geist Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;

  --gutter: 80px;
  --section-gap: 140px;

  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);  /* every hover and reveal: quick start, long settle */
  --light: rgba(184, 152, 92, 0.075);       /* Brass as light, never as paint */
}

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

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

html {
  background: var(--obsidian);
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  position: relative;
  isolation: isolate;
  margin: 0;
  background: var(--obsidian);
  color: var(--ivory);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

main { overflow-x: clip; }

/* ---------- Atmosphere: light and grain, so the ground reads as a material, not a flat fill ---------- */

/* A warm lamp above the page, falling off into a vignette. It stays put while the page scrolls. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(80% 55% at 76% -10%, rgba(184, 152, 92, 0.12), transparent 65%),
    radial-gradient(60% 45% at 4% 104%, rgba(236, 231, 221, 0.035), transparent 70%),
    radial-gradient(140% 100% at 50% 20%, transparent 50%, rgba(0, 0, 0, 0.55) 100%);
}

/* Film grain over everything. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  opacity: 0.055;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
  background-size: 240px;
}

/* A soft light that follows the cursor (added by motion.js on mouse devices). */
.torch {
  position: fixed;
  top: 0;
  left: 0;
  z-index: -1;
  width: 760px;
  height: 760px;
  margin: -380px 0 0 -380px;
  pointer-events: none;
  background: radial-gradient(closest-side, rgba(184, 152, 92, 0.07), rgba(184, 152, 92, 0.025) 55%, transparent);
  opacity: 0;
  transition: opacity 0.8s var(--ease);
  will-change: transform;
}
.torch.is-on { opacity: 1; }

h1, h2, h3, p, dl, dd, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }

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

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

::selection { background: var(--brass); color: var(--obsidian); }

.skip-link {
  position: absolute;
  top: -60px;
  left: 16px;
  z-index: 10;
  padding: 10px 14px;
  background: var(--ivory);
  color: var(--obsidian);
  border-radius: var(--radius);
}
.skip-link:focus { top: 16px; }

.wrap {
  width: 100%;
  max-width: 1440px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- Type ---------- */

.label {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.6;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brass);
}

.meta {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ash);
}

.lead {
  max-width: 860px;
  font-size: 26px;
  font-weight: 300;
  line-height: 1.42;
  color: var(--parchment);
}

.arrow { color: var(--brass); }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  height: 56px;
  padding: 0 28px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
  transition: background-color 0.25s, border-color 0.25s, color 0.25s;
}

/* Arrows lean the way they point. */
.btn__arrow, .btn .arrow { display: inline-block; transition: transform 0.45s var(--ease); }
.btn:hover .btn__arrow, .btn:hover .arrow { transform: translateX(5px); }

.btn--primary { background: var(--ivory); color: var(--obsidian); }
.btn--primary:hover { background: #F8F5EF; }

.btn--secondary { border-color: var(--graphite-2); font-weight: 400; }
.btn--secondary:hover { border-color: var(--ash); background: rgba(236, 231, 221, 0.04); }

.btn--nav {
  height: 40px;
  padding: 0 18px;
  gap: 10px;
  border-color: var(--brass);
  font-size: 14px;
  font-weight: 400;
}
.btn--nav:hover { border-color: #C9B47F; }

.only-mobile { display: none; }

/* Email links stay hidden until email.js fills in the address. */
[data-email][hidden] { display: none; }

/* ---------- Header and footer ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid var(--rule);
  background: rgba(11, 11, 10, 0.72);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
}

.site-header .wrap {
  height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.wordmark { font-family: var(--serif); font-size: 26px; }

.site-nav { display: flex; align-items: center; gap: 36px; font-size: 14px; }
.site-nav a:not(.btn) { color: var(--ash); transition: color 0.25s; }
.site-nav a:not(.btn):hover, .site-nav a.is-current { color: var(--ivory); }
.nav-back { white-space: nowrap; }

/* Text links underline with a brass hairline that draws in from the left. */
.site-nav a:not(.btn), .footer__links a { position: relative; }
.site-nav a:not(.btn)::after, .footer__links a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 1px;
  background: var(--brass);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.5s var(--ease);
}
.site-nav a:not(.btn):hover::after, .site-nav a.is-current::after, .footer__links a:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.site-footer { border-top: 1px solid var(--rule); }

.site-footer .wrap {
  min-height: 96px;
  padding-block: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.footer__legal { display: flex; flex-direction: column; gap: 6px; }
.footer__disclaimer { font-size: 13px; color: var(--ash); }

.footer__links { display: flex; gap: 32px; font-size: 14px; }
.footer__links a { color: var(--ash); transition: color 0.25s; }
.footer__links a:hover { color: var(--ivory); }

/* ---------- CV: hero ---------- */

.hero { padding-top: 150px; }

.hero__top { position: relative; --portrait-w: clamp(260px, 29vw, 420px); }
.hero__text { position: relative; z-index: 2; }

/* The portrait stands on the facts rule, at the right; the name may run in front of it. */
.portrait {
  position: absolute;
  z-index: 1;
  right: 0;
  bottom: -120px;
  width: var(--portrait-w);
  margin: 0;
}

/* Backlight, so the dark suit separates from the dark ground. */
.portrait::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: 50%;
  top: 30%;
  width: 200%;
  aspect-ratio: 1;
  pointer-events: none;
  background: radial-gradient(closest-side, rgba(184, 152, 92, 0.2), rgba(184, 152, 92, 0.06) 50%, transparent);
  transform: translate(calc(-50% + var(--px, 0) * 16px), calc(-50% + var(--py, 0) * 12px));
  transition: transform 1.4s var(--ease);
}

.portrait__img {
  display: block;
  width: 100%;
  height: auto;
  -webkit-mask-image: linear-gradient(to bottom, #000 60%, transparent 97%);
  mask-image: linear-gradient(to bottom, #000 60%, transparent 97%);
  transform: translate3d(calc(var(--px, 0) * -7px), calc(var(--py, 0) * -5px), 0);
  transition: transform 1.4s var(--ease);
}

.hero__name {
  margin-top: 28px;
  font-family: var(--serif);
  font-size: clamp(60px, 12.2vw, 176px);
  font-weight: 400;
  line-height: 0.9;
  letter-spacing: -0.025em;
}

.hero .lead { margin-top: 44px; max-width: min(860px, calc(100% - var(--portrait-w) - 64px)); }

.hero__actions { margin-top: 52px; display: flex; flex-wrap: wrap; gap: 12px; }

.facts {
  margin-top: 120px;
  padding-top: 28px;
  border-top: 1px solid var(--graphite);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.fact { position: relative; display: flex; flex-direction: column; gap: 8px; }
.fact .label { font-size: 11px; letter-spacing: 0.16em; }
.fact__title { font-size: 18px; }
.fact__sub { font-size: 15px; color: var(--ash); transition: color 0.3s; }

/* ---------- CV: credential strip ---------- */

.strip { margin-top: 100px; border-block: 1px solid var(--rule); }

.strip .wrap {
  padding-block: 34px;
  display: flex;
  align-items: center;
  gap: 56px;
}

.strip__label {
  flex-shrink: 0;
  width: 170px;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.6;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ash);
}

.strip__list {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 24px;
  font-family: var(--serif);
  font-size: 22px;
  color: var(--stone);
}
.strip__list li { transition: color 0.3s; }
.strip__list li:hover { color: var(--ivory); }

/* ---------- CV: sections ---------- */

.section { padding-top: var(--section-gap); }

.section > .wrap {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 24px;
}

.section__head { grid-column: span 3; display: flex; flex-direction: column; gap: 20px; }
.section__body { grid-column: span 9; }

.section__intro { max-width: 250px; font-size: 15px; line-height: 1.55; color: var(--ash); }

.chip {
  flex-shrink: 0;
  display: inline-block;
  padding: 6px 10px;
  border: 1px solid var(--graphite-2);
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.4;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--stone);
}
.chip--brass { border-color: var(--brass); color: var(--brass); }
.chip--quiet { color: var(--ash); }

.paper { padding: 36px 0 44px; border-top: 1px solid var(--graphite); }

.paper__meta { display: flex; justify-content: space-between; align-items: center; gap: 24px; }

.paper__title {
  margin-top: 20px;
  font-family: var(--serif);
  font-size: 42px;
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.paper__summary { margin-top: 16px; max-width: 780px; font-size: 16px; line-height: 1.6; color: var(--ash); }

/* A paper with its own page: the title is the link, and it stretches over the whole entry. */
.paper__link::after { content: ""; position: absolute; inset: 0; z-index: 2; }
.paper__more {
  margin-top: 20px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ash);
  transition: color 0.35s;
}
.paper__more .arrow { display: inline-block; margin-left: 6px; transition: transform 0.45s var(--ease); }

.row { padding: 30px 0; border-top: 1px solid var(--graphite); display: flex; gap: 32px; }
.row:last-child { border-bottom: 1px solid var(--graphite); }
.row__date { flex-shrink: 0; width: 150px; padding-top: 5px; }
.row__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.row__title { font-size: 20px; font-weight: 600; }
.row__org { font-size: 15px; line-height: 1.5; color: var(--ash); }
.row__desc { flex-shrink: 0; width: 360px; font-size: 15px; line-height: 1.6; color: var(--ash); }

.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 48px; }

.list-title { margin-bottom: 12px; font-family: var(--serif); font-size: 30px; font-weight: 400; }

.item { padding: 22px 0; border-top: 1px solid var(--graphite); display: flex; gap: 20px; }
.item:last-child { border-bottom: 1px solid var(--graphite); }
.item__year { flex-shrink: 0; width: 44px; padding-top: 3px; font-family: var(--mono); font-size: 12px; color: var(--brass); }
.item__title { display: block; font-size: 17px; }
.item__sub { display: block; margin-top: 4px; font-size: 14px; line-height: 1.5; color: var(--ash); }

/* Off the record: the diving photo beside the list, shown as taken. */
.off-record__photo img { display: block; width: 100%; height: auto; border-radius: 2px; }
.off-record__photo figcaption { margin-top: 14px; }

/* ---------- CV: closing band ---------- */

.cta {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  margin-top: var(--section-gap);
  background: var(--carbon);
  border-top: 1px solid var(--rule);
}

/* Light rising from the lower right, and a section mark set large in the dark. */
.cta::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(55% 90% at 88% 115%, rgba(184, 152, 92, 0.13), transparent 70%);
}
.cta::after {
  content: "§";
  position: absolute;
  z-index: -1;
  right: 7%;
  top: 50%;
  font-family: var(--serif);
  font-size: clamp(280px, 38vw, 560px);
  line-height: 1;
  color: rgba(236, 231, 221, 0.035);
  transform: translateY(-52%);
  pointer-events: none;
}

.cta .wrap {
  padding-block: 120px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 28px;
}

.cta__title {
  font-family: var(--serif);
  font-size: clamp(48px, 6.7vw, 96px);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.02em;
}

.cta__text { max-width: 640px; font-size: 20px; font-weight: 300; line-height: 1.5; color: var(--ash); }
.cta .btn { margin-top: 12px; }

/* ---------- Open source page ---------- */

.page-hero { padding-top: 130px; }

.page-hero__title {
  margin-top: 28px;
  max-width: 1100px;
  font-family: var(--serif);
  font-size: clamp(56px, 8.9vw, 128px);
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: -0.025em;
}

.page-hero .lead { margin-top: 36px; max-width: 780px; font-size: 22px; line-height: 1.5; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.featured {
  margin-top: 110px;
  padding: 56px;
  background: var(--carbon);
  border: 1px solid var(--graphite);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 64px;
}

.featured__main { display: flex; flex-direction: column; }

.project__title {
  margin-top: 28px;
  font-family: var(--serif);
  font-size: 64px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.015em;
}

.project__desc { margin-top: 22px; font-size: 18px; line-height: 1.55; color: var(--parchment); }

.features { margin-top: 28px; display: flex; flex-direction: column; gap: 12px; font-size: 15px; line-height: 1.5; color: var(--ash); }
.features li { display: flex; gap: 14px; }
.features li::before {
  content: "";
  flex-shrink: 0;
  width: 14px;
  height: 1px;
  margin-top: 11px;
  background: var(--brass);
}

.project__actions { margin-top: auto; padding-top: 36px; display: flex; flex-wrap: wrap; gap: 12px; }

.sheet-figure { display: flex; flex-direction: column; gap: 14px; }

/* The index page on Paper, set the way the Word file sets it: Times New Roman, a ruled TAB / DESCRIPTION
   table, shaded italic group rows, and the red note on every authority to be inserted by hand. */
.sheet {
  flex: 1;
  padding: 48px 40px 40px;
  background: var(--paper);
  color: var(--ink);
  border-radius: var(--radius);
  font-family: 'Times New Roman', Times, serif;
  font-size: 12px;
  line-height: 1.3;
}

.sheet__title { font-size: 14px; font-weight: 700; text-align: center; text-transform: uppercase; }

.sheet__table { width: 100%; margin-top: 30px; border-collapse: collapse; table-layout: fixed; }
.sheet__table td, .sheet__table th {
  padding: 4px 7px 12px;
  border: 1px solid var(--ink);
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}
.sheet__table td:first-child, .sheet__table th:first-child { width: 15%; }
.sheet__head th { background: rgba(26, 25, 22, 0.05); font-weight: 700; text-transform: uppercase; }
.sheet__group td { background: rgba(26, 25, 22, 0.08); font-weight: 700; font-style: italic; }
.sheet__table td.sheet__tab { font-weight: 700; text-align: center; }
.sheet__table b { font-size: 11.5px; }
.sheet__pin, .sheet__flag { display: block; }
.sheet__pin { font-size: 10.5px; }
.sheet__flag { font-size: 9.5px; color: #B43232; }

.cards { margin-top: 24px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }

.card {
  padding: 48px;
  background: var(--carbon);
  border: 1px solid var(--graphite);
  display: flex;
  flex-direction: column;
}

.card__title { margin-top: 28px; font-family: var(--serif); font-size: 56px; font-weight: 400; line-height: 1; }
.card__subtitle { font-style: italic; font-size: 0.57em; color: var(--ash); }
.card__repo { margin-top: 12px; font-family: var(--mono); font-size: 12px; color: var(--ash); overflow-wrap: anywhere; }
.card__desc { margin-top: 22px; font-size: 17px; line-height: 1.6; color: var(--parchment); }

.facts-list { margin-top: 32px; }
.facts-list > div { padding: 14px 0; border-top: 1px solid var(--graphite); display: flex; gap: 24px; font-size: 14px; line-height: 1.5; }
.facts-list > div:last-child { border-bottom: 1px solid var(--graphite); }
.facts-list dt {
  flex-shrink: 0;
  width: 88px;
  padding-top: 2px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brass);
}
.facts-list dd { color: var(--stone); }

.deployed { margin-top: 110px; }

.deployed__row {
  margin-top: 22px;
  padding: 36px 0;
  border-block: 1px solid var(--graphite);
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 24px;
  align-items: baseline;
}

.deployed__name { grid-column: span 3; font-family: var(--serif); font-size: 44px; font-weight: 400; }
.deployed__desc { grid-column: span 6; font-size: 17px; line-height: 1.6; color: var(--parchment); }
.deployed__meta { grid-column: span 3; justify-self: end; }
.deployed__row + .deployed__row { margin-top: 0; border-top: 0; }
.deployed__meta a { padding-bottom: 2px; border-bottom: 1px solid var(--brass); color: var(--parchment); transition: color 0.15s; }
.deployed__meta a:hover { color: var(--ivory); }

.page-end { height: 140px; }

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

/* ---------- Amicus ---------- */

.amicus-cta {
  max-width: 280px;
  margin-top: 12px;
  padding-top: 24px;
  border-top: 1px solid var(--graphite);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
}
.amicus-cta[hidden] { display: none; }
.amicus-cta__text { font-size: 15px; line-height: 1.55; color: var(--ash); }
.amicus-cta__name { font-family: var(--serif); font-size: 21px; color: var(--ivory); }
.amicus-cta .btn { height: 48px; padding: 0 22px; font-family: var(--sans); cursor: pointer; background: none; color: var(--ivory); }

html.amicus-open { overflow: hidden; }

.amicus-backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(5, 5, 4, 0.72); }
.amicus-backdrop[hidden] { display: none; }

.amicus {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  width: min(560px, 100vw);
  display: flex;
  flex-direction: column;
  background: var(--carbon);
  border-left: 1px solid var(--graphite);
}
.amicus[hidden] { display: none; }

.amicus__head {
  flex-shrink: 0;
  height: 72px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--graphite);
}
.amicus__title { display: flex; align-items: baseline; gap: 14px; }
.amicus__name { font-family: var(--serif); font-size: 30px; font-weight: 400; }
.amicus__title .meta { font-size: 11px; }

/* How it's built, for the technical reader: an "i" beside the title. Hover or keyboard focus shows
   the note; on touch screens a tap toggles it (amicus.js). */
/* Sized to the "Beta" label beside it and set on the same baseline. */
.amicus-info { position: relative; align-self: baseline; display: flex; margin-left: -4px; }
.amicus-info__button {
  width: 13px;
  height: 13px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid var(--ash);
  border-radius: 50%;
  background: none;
  color: var(--ash);
  font-family: var(--serif);
  font-size: 10px;
  font-style: italic;
  line-height: 11px;
  cursor: help;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.amicus-info.is-open .amicus-info__button,
.amicus-info__button:focus-visible { border-color: var(--brass); color: var(--brass); outline: none; }

.amicus-info__tip {
  position: absolute;
  top: calc(100% + 14px);
  right: -12px;
  z-index: 2;
  width: max-content;
  max-width: min(300px, calc(100vw - 48px));
  padding: 14px 16px 15px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--obsidian);
  border: 1px solid var(--graphite-2);
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.02em;
  line-height: 1.45;
  color: var(--parchment);
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: opacity 0.18s var(--ease), transform 0.18s var(--ease), visibility 0s linear 0.18s;
}
.amicus-info__tip::before {
  content: "";
  position: absolute;
  top: -5px;
  right: 14px;
  width: 8px;
  height: 8px;
  background: var(--obsidian);
  border-top: 1px solid var(--graphite-2);
  border-left: 1px solid var(--graphite-2);
  transform: rotate(45deg);
}
.amicus-info.is-open .amicus-info__tip,
.amicus-info__button:focus-visible + .amicus-info__tip {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition-delay: 0s;
}
/* Hover only where there is a mouse; on touch screens a tap's hover would stick. */
@media (hover: hover) {
  .amicus-info:hover .amicus-info__button { border-color: var(--brass); color: var(--brass); }
  .amicus-info:hover .amicus-info__tip { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
}
.amicus-info__label {
  margin-bottom: 4px;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brass);
}

.amicus__close {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--graphite-2);
  border-radius: var(--radius);
  color: var(--ivory);
  cursor: pointer;
}
.amicus__close:hover { border-color: var(--ash); }

.amicus__view { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.amicus__view[hidden] { display: none; }
.amicus__scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 32px 28px; }

/* Start-up and sign-in: a hairline ring with a Brass arc, centred in the panel. */
.amicus__loading {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: 32px 28px;
  text-align: center;
}
.amicus__spinner {
  width: 40px;
  height: 40px;
  border: 1.5px solid var(--graphite-2);
  border-top-color: var(--brass);
  border-radius: 50%;
  animation: amicus-spin 0.9s linear infinite;
}
@keyframes amicus-spin { to { transform: rotate(360deg); } }
/* Clerk's form box stays empty until Clerk has drawn the form: show the ring meanwhile. */
.amicus__signin:empty, .amicus__signin > div:empty { display: flex; align-items: center; gap: 14px; min-height: 40px; }
.amicus__signin:empty::before, .amicus__signin > div:empty::before {
  content: "";
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--graphite-2);
  border-top-color: var(--brass);
  border-radius: 50%;
  animation: amicus-spin 0.9s linear infinite;
}
.amicus__signin:empty::after, .amicus__signin > div:empty::after {
  content: "Loading sign-in…";
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ash);
}

.amicus__lead { font-family: var(--serif); font-size: 26px; line-height: 1.25; }
.amicus__small { margin-top: 16px; font-size: 14px; line-height: 1.6; color: var(--ash); }
.amicus__small a { padding-bottom: 1px; border-bottom: 1px solid var(--brass); color: var(--ivory); }
.amicus__signin { margin-top: 28px; }
.amicus__view[data-view="error"] .btn { margin-top: 24px; height: 48px; background: none; color: var(--ivory); cursor: pointer; font-family: var(--sans); }

.amicus-suggestions { margin-top: 28px; display: flex; flex-direction: column; gap: 8px; }
.amicus-suggestion {
  padding: 14px 16px;
  text-align: left;
  background: none;
  border: 1px solid var(--graphite-2);
  border-radius: var(--radius);
  color: var(--parchment);
  font: inherit;
  font-size: 15px;
  line-height: 1.45;
  cursor: pointer;
}
.amicus-suggestion:hover { border-color: var(--ash); color: var(--ivory); }

.amicus__how { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--graphite); }
.amicus__how summary { cursor: pointer; font-size: 11px; }
.amicus__how p { margin-top: 12px; font-size: 14px; line-height: 1.6; color: var(--ash); }

.amicus-turn { padding: 28px 0; border-top: 1px solid var(--graphite); }
.amicus-turn:first-of-type { padding-top: 0; border-top: 0; }
.amicus-turn > .meta { font-size: 11px; }
.amicus-q { margin-top: 8px; font-family: var(--serif); font-size: 24px; line-height: 1.25; }
.amicus-pending { margin-top: 18px; font-size: 11px; }

.amicus-answer { margin-top: 18px; }
.amicus-answer__text { font-size: 16px; line-height: 1.7; color: var(--parchment); }
.amicus-answer__message { margin-top: 18px; font-size: 15px; line-height: 1.6; color: var(--ash); }
.amicus-answer .amicus-answer__message { margin-top: 0; }
.amicus-cite {
  margin-left: 3px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--brass);
  vertical-align: super;
  line-height: 0;
}
.amicus-cite:hover { color: #C9B47F; }

.amicus-sources { margin-top: 20px; }
.amicus-source { padding: 14px 0; border-top: 1px solid var(--graphite); }
.amicus-source__meta { font-size: 11px; }
.amicus-source__quote {
  margin: 8px 0 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 18px;
  line-height: 1.4;
  color: var(--parchment);
}
.amicus-note { margin-top: 14px; font-family: var(--mono); font-size: 11px; line-height: 1.6; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ash); }

.amicus__foot { flex-shrink: 0; padding: 20px 28px 22px; border-top: 1px solid var(--graphite); }
.amicus__form { display: flex; align-items: flex-end; gap: 10px; }
.amicus__input {
  flex: 1;
  min-height: 52px;
  max-height: 160px;
  padding: 14px;
  resize: none;
  background: var(--obsidian);
  border: 1px solid var(--graphite-2);
  border-radius: var(--radius);
  color: var(--ivory);
  font: inherit;
  font-size: 15px;
  line-height: 1.5;
}
.amicus__input:focus { outline: none; border-color: var(--brass); }
.amicus__input::placeholder { color: var(--ash); }
.amicus__send { height: 52px; padding: 0 24px; border: 0; cursor: pointer; font-family: var(--sans); }
.amicus__send:disabled { opacity: 0.5; cursor: default; }
.amicus__meta { margin-top: 12px; display: flex; justify-content: space-between; gap: 16px; }
.amicus__meta .meta { font-size: 11px; }
.amicus__signout {
  padding: 0;
  background: none;
  border: 0;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ash);
  cursor: pointer;
}
.amicus__signout:hover { color: var(--ivory); }
.amicus__signout[hidden] { display: none; }

/* ---------- Hover: the CV's entries and the project cards ----------
   Under the cursor, an entry's graphite rule draws over in Brass, a faint light follows the pointer
   (--x/--y, set by motion.js), its text steps forward and its neighbours step back. */

.paper, .row, .item, .card, .featured, .deployed__row { position: relative; isolation: isolate; }

.paper__title, .row__main, .item > p { transition: transform 0.6s var(--ease); }
.paper__summary, .row__desc, .row__org, .item__sub, .row__date { transition: color 0.35s; }

@media (hover: hover) and (pointer: fine) {
  .paper, .row, .item { --bleed: 28px; transition: opacity 0.4s var(--ease); }

  .paper::before, .row::before, .item::before, .fact::before {
    content: "";
    position: absolute;
    z-index: 1;
    left: 0;
    right: 0;
    top: -1px;
    height: 1px;
    background: var(--brass);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.8s var(--ease);
  }
  .fact::before { top: -29px; }

  .paper::after, .row::after, .item::after, .card::after, .featured::after, .deployed__row::after {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 0 calc(var(--bleed, 0px) * -1);
    pointer-events: none;
    background: radial-gradient(460px circle at calc(var(--x, 50%) + var(--bleed, 0px)) var(--y, 50%), var(--light), transparent 70%);
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 var(--bleed, 0px), #000 calc(100% - var(--bleed, 0px)), transparent);
    mask-image: linear-gradient(90deg, transparent, #000 var(--bleed, 0px), #000 calc(100% - var(--bleed, 0px)), transparent);
    opacity: 0;
    transition: opacity 0.5s var(--ease);
  }

  .paper:hover::before, .row:hover::before, .item:hover::before, .fact:hover::before { transform: scaleX(1); }
  .paper:hover::after, .row:hover::after, .item:hover::after,
  .card:hover::after, .featured:hover::after, .deployed__row:hover::after { opacity: 1; }

  .paper:hover .paper__title { transform: translateX(10px); }
  .paper:hover .paper__more { color: var(--parchment); }
  .paper:hover .paper__more .arrow { transform: translateX(5px); }
  .row:hover .row__main, .item:hover > p { transform: translateX(8px); }
  .paper:hover .paper__summary, .row:hover .row__desc, .row:hover .row__org,
  .item:hover .item__sub, .fact:hover .fact__sub { color: var(--parchment); }
  .row:hover .row__date { color: var(--brass); }

  .section__body:has(> .paper:hover) > .paper:not(:hover),
  .section__body:has(> .row:hover) > .row:not(:hover),
  .two-col:has(.item:hover) .item:not(:hover) { opacity: 0.5; }

  .card, .featured { transition: border-color 0.4s; }
  .card:hover, .featured:hover { border-color: var(--graphite-2); }
}

/* The section label and intro stay in view while their entries scroll past. */
@media (min-width: 761px) {
  .section__head { position: sticky; top: 124px; align-self: start; }
  .section { scroll-margin-top: 84px; }
}

/* ---------- Reveal on scroll ----------
   The inline script in <head> adds .motion; motion.js adds .is-in as each block comes into view. */

@keyframes reveal { from { opacity: 0; transform: translateY(24px); } }
@keyframes reveal-name { from { opacity: 0; transform: translateY(32px); filter: blur(14px); } }
@keyframes reveal-portrait { from { opacity: 0; transform: translateY(16px) scale(0.985); filter: blur(6px); } }

.motion [data-reveal]:not(.is-in) { opacity: 0; }
.motion [data-reveal].is-in {
  animation: reveal 1.1s var(--ease) backwards;
  animation-delay: calc(var(--i, 0) * 90ms);
}
.motion .hero__name.is-in { animation-name: reveal-name; animation-duration: 1.4s; }
.motion .portrait.is-in { animation-name: reveal-portrait; animation-duration: 1.8s; }

@media print {
  .motion [data-reveal] { opacity: 1 !important; animation: none !important; }
  body::before, body::after, .torch { display: none; }
}

/* ---------- Tablet ---------- */

@media (max-width: 1100px) {
  :root { --gutter: 48px; --section-gap: 112px; }

  .row__desc { width: 280px; }
  .featured { grid-template-columns: 1fr; }
  .cards { grid-template-columns: 1fr; }
}

/* Narrow screens: the portrait moves above the name, which overlaps its faded lower edge. */
@media (max-width: 900px) {
  .hero__top { display: flex; flex-direction: column; --portrait-w: min(52vw, 300px); }
  .hero .lead { max-width: 860px; }
  .portrait {
    position: relative;
    order: -1;
    right: auto;
    bottom: auto;
    align-self: center;
    margin-bottom: -40px;
  }
  .portrait__img {
    -webkit-mask-image: linear-gradient(to bottom, #000 52%, transparent 90%);
    mask-image: linear-gradient(to bottom, #000 52%, transparent 90%);
  }
}

/* ---------- Phone: what an NFC tap opens ---------- */

@media (max-width: 760px) {
  :root { --gutter: 24px; --section-gap: 88px; }

  .site-header .wrap { height: 64px; }
  .wordmark { font-size: 22px; white-space: nowrap; }
  .site-nav { gap: 20px; }
  .site-nav a:not(.btn):not(.nav-back) { display: none; }
  .nav-back__long { display: none; }

  .hero { padding-top: 24px; }
  .hero__top { --portrait-w: min(50vw, 210px); }
  .portrait { margin-bottom: -26px; }
  .hero .label { font-size: 11px; letter-spacing: 0.16em; }
  .hero__name { margin-top: 14px; font-size: 60px; line-height: 0.96; letter-spacing: -0.02em; }
  .hero .lead { margin-top: 18px; font-size: 17px; line-height: 1.45; }

  .hero__actions {
    margin-top: 28px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .only-desktop { display: none; }
  .only-mobile { display: inline-flex; }
  .hero__actions .btn--secondary { height: 46px; padding: 0 12px; font-size: 14px; }
  .hero__actions .btn--save {
    grid-column: 1 / -1;
    height: 52px;
    background: var(--ivory);
    color: var(--obsidian);
    border-color: var(--ivory);
    font-size: 15px;
    font-weight: 500;
  }

  .facts { margin-top: 36px; padding-top: 22px; grid-template-columns: 1fr; gap: 18px; }

  .strip { margin-top: 56px; }
  .strip .wrap { padding-block: 28px; flex-direction: column; align-items: flex-start; gap: 14px; }
  .strip__label { width: auto; }
  .strip__list { flex-direction: column; gap: 8px; font-size: 20px; }

  .section > .wrap { grid-template-columns: minmax(0, 1fr); row-gap: 16px; }
  .section__head, .section__body { grid-column: auto; }
  .section__intro { max-width: none; }

  .paper { padding: 28px 0 32px; }
  .paper__meta { flex-direction: column; align-items: flex-start; gap: 12px; }
  .paper__title { font-size: 30px; }

  .row { padding: 24px 0; flex-direction: column; gap: 8px; }
  .row__date, .row__desc { width: auto; padding-top: 0; }

  .two-col { grid-template-columns: minmax(0, 1fr); row-gap: 48px; }

  .cta .wrap { padding-block: 80px; }
  .cta__text { font-size: 18px; }

  .site-footer .wrap { flex-direction: column; align-items: flex-start; }
  .footer__links { gap: 24px; }

  .page-hero { padding-top: 64px; }
  .page-hero .lead { margin-top: 24px; font-size: 18px; }

  .featured { margin-top: 64px; padding: 28px; gap: 40px; }
  .project__title { font-size: 44px; }
  .sheet { padding: 28px 16px 24px; }
  .sheet__title { font-size: 13px; }
  .sheet__table { margin-top: 20px; }
  .sheet__table td, .sheet__table th { padding: 4px 5px 10px; }
  .sheet__table td:first-child, .sheet__table th:first-child { width: 17%; }

  .card { padding: 28px; }
  .card__title { font-size: 44px; }

  .deployed { margin-top: 88px; }
  .deployed__row { grid-template-columns: minmax(0, 1fr); row-gap: 12px; }
  .deployed__name, .deployed__desc, .deployed__meta { grid-column: auto; justify-self: start; }

  .page-end { height: 88px; }

  .amicus-cta { max-width: none; }
  .amicus { width: 100vw; border-left: 0; }
  .amicus__head { height: 64px; padding: 0 20px; }
  .amicus__scroll { padding: 24px 20px; }
  .amicus__foot { padding: 14px 20px 18px; }
  .amicus__lead { font-size: 23px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* The Turnstile check sits under the question box; it takes no space unless it needs a tick. */
.amicus__turnstile:not(:empty) { margin-top: 12px; }
