/* ---------- tokens ---------- */
:root {
  color-scheme: dark;
  --bg: #10201a;
  --fg: #ece8e1;
  --muted: #93a097;
  --rule: #26392f;
  --accent: #ece8e1;
  --measure: 34rem;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: ui-sans-serif, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

/* ---------- base ---------- */
* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

main {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 1.5rem 5rem;
}

.site-footer {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.4rem 1.5rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.site-footer p { margin: 0; }

.site-footer__links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.5rem;
}

/* ---------- hero + name animation ---------- */
/* Ported from the original site. The keyframes are copied verbatim; the pixel
   offsets are calibrated against the system sans stack at 3.75rem, so both are
   pinned here rather than inherited from the page's serif. */

.hero {
  min-height: 78svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.hero-name {
  --glyph-size: 3.75rem;
  --p-tuck: -160px;   /* pulls the P against the I to form the monogram */
  --i-travel: -170px; /* how far the I group slides to open the name */
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
}

.hero-name__line {
  display: flex;
  align-items: center;
  justify-content: center;
}

.glyph {
  font-size: var(--glyph-size);
  line-height: 1;
  font-weight: 700;
}

.is-hidden { opacity: 0; }

/* The I and "sabell" travel together; the P stays put, so the gap opens
   between them. */
.hero-name__isa {
  display: flex;
  align-items: center;
}

.hero-name__isa.is-open {
  animation: moveIAndSabell 1s ease-out forwards;
}

.hero-name__sabell {
  display: flex;
  overflow: hidden;
}

.hero-name__sabell.is-in {
  animation: fadeIn 0.5s ease-in forwards;
}

.hero-name__p { margin-left: var(--p-tuck); }

.hero-name__line .glyph.is-in {
  animation: fadeInFromBehindP 0.5s ease-in forwards;
}

.glyph.is-pulsing {
  animation: pulsateIP 1.8s ease-in-out 1 forwards;
}

.hero-name__subtitle {
  font-size: 1.5rem;
  line-height: 2rem;
  margin-top: 2.5rem;
  text-align: center;
}

/* The original left this one inert through a typo in the class name; it fades
   in here like everything else. */
.hero-name__subtitle.is-in {
  animation: fadeIn 0.5s ease-in forwards;
}

@keyframes fadeIn {
  0%  { opacity: 0; transform: translateX(50px); }
  to  { opacity: 1; transform: translateX(0); }
}

@keyframes fadeInFromBehindP {
  0%  { opacity: 0; transform: translateX(-20px); }
  to  { opacity: 1; transform: translateX(0); }
}

@keyframes moveIAndSabell {
  0%  { transform: translateX(0); }
  to  { transform: translateX(var(--i-travel)); }
}

@keyframes pulsateIP {
  0%, to { transform: scale(1); }
  50%    { transform: scale(3); }
}

/* The offsets are absolute pixels, so the whole thing is scaled down rather
   than reflowed — reflowing would desynchronise the geometry. */
@media (max-width: 560px) {
  .hero-name {
    --glyph-size: 2.4rem;
    --p-tuck: -102px;
    --i-travel: -109px;
  }
  .hero-name__subtitle { font-size: 1.1rem; }
}

/* With reduced motion the component jumps straight to the open state, so only
   the transitions need suppressing — the final transform must survive. */
@media (prefers-reduced-motion: reduce) {
  .hero-name * { animation-duration: 0.01ms !important; }
}

/* ---------- project index ---------- */
.cards {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--rule);
}

.card { border-bottom: 1px solid var(--rule); }

.card__link {
  display: block;
  padding: 2rem 0;
  text-decoration: none;
}

.card__link:hover .card__title { text-decoration: underline; }

.card__title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.6rem;
  margin: 0 0 0.4rem;
}

.card__summary {
  margin: 0 0 0.6rem;
  color: var(--muted);
}

/* ---------- shared meta chip ---------- */
.card__status,
.project__status {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- project page ---------- */
.project { padding-top: 4rem; }

.back {
  margin: 0 0 3rem;
  font-size: 0.9rem;
}

.project__header {
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 2rem;
}

.project__title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2rem, 7vw, 3rem);
  margin: 0 0 0.5rem;
}

.project__summary {
  margin: 1rem 0 0;
  color: var(--muted);
}

.project__body p { margin: 0 0 1.2rem; }

.project__links {
  list-style: none;
  margin: 2.5rem 0 0;
  padding: 0;
}

.project__links li { margin-bottom: 0.4rem; }
