@font-face {
  font-family: "Source Serif 4";
  src: url("/fonts/SourceSerif4-Roman.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Source Serif 4";
  src: url("/fonts/SourceSerif4-Italic.woff2") format("woff2");
  font-weight: 200 900;
  font-style: italic;
  font-display: swap;
}

html {
  overflow-x: clip;
}

:root {
  color-scheme: light;
  --paper: #f0eee6;
  --ink: #14110e;
  /* brick maroon; chosen accent, not used yet */
  --accent: #6e2826;
  /* brick maroon "lit up": same hue, lighter and more saturated */
  --accent-on: #a83630;
  --link: #174882;
  /* link blue "lit up": same hue, lighter and more saturated */
  --link-on: #2769b7;
}

/* main grows to fill the window, so a footer sits at the bottom of the
   viewport on short pages and simply follows the content on long ones */
body {
  box-sizing: border-box;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  max-width: calc(76ch + 2rem);
  margin: 0 auto;
  padding: 2rem 1rem 1.25rem;
  background: var(--paper);
  color: var(--ink);
  font: 1.125rem/1.6 "Source Serif 4", Georgia, serif;
}

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

img {
  max-width: 100%;
  height: auto;
}

/* 404 page: centered in the window */
.notfound {
  min-height: 60dvh;
  display: grid;
  place-content: center;
  text-align: center;
}

.notfound h1 {
  margin: 0 0 0.5rem;
  font-size: 3rem;
}

/* a small aside after the text, set off by a short rule */
.note {
  margin-top: 3rem;
  margin-bottom: 2.25rem;
  text-align: center;
  font-size: 0.9rem;
  color: color-mix(in srgb, var(--ink) 70%, transparent);
}

/* divider: a maroon turn (gruppetto) ornament, drawn as a mask so it
   takes --accent */
.note::before {
  content: "";
  display: block;
  width: 2.1rem;
  height: 1rem;
  margin: 0 auto 1.25rem;
  background: var(--accent);
  mask: url("/icons/gruppetto.svg") center / contain no-repeat;
}


/* photo strip, between the text and the contact note: a row of small captioned squares, as
   wide as the text, that scrolls sideways within it.
   static/photos.js adds edge fades that follow the scroll position and, for
   mouse users, ‹ › buttons. The scrollbar is hidden; without JS, the row
   still scrolls by trackpad, touch, or shift+wheel. */
.photos-frame {
  position: relative;
  margin-top: 3rem;
  /* how far the ‹ › buttons sit outside the column: 3rem in the page
     margin, less when the margin is narrow, so they never leave the window */
  --button-out: clamp(0rem, (100vw - 100%) / 2 - 2.5rem, 3rem);
}

.photos {
  --fade-left: 0px;
  --fade-right: 0px;
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  mask-image: linear-gradient(to right,
    transparent, #000 var(--fade-left),
    #000 calc(100% - var(--fade-right)), transparent);
}

.photos.more-left {
  --fade-left: 4rem;
}

.photos.more-right {
  --fade-right: 4rem;
}

.photos figure {
  flex: none;
  width: 8.75rem;
  margin: 0 0.75rem 0 0;
  scroll-snap-align: start;
}

.photos img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 6px;
}

.photos figcaption {
  margin-top: 0.35rem;
  text-align: center;
  font-size: 0.875rem; /* was 0.8rem */
  line-height: 1.3;
  color: color-mix(in srgb, var(--ink) 80%, transparent); /* was 65% */
}

/* ‹ › buttons: always shown with a mouse, while there's more that way */
.photos-button {
  display: none;
}

.photos::-webkit-scrollbar {
  display: none;
}

@media (hover: hover) and (pointer: fine) {
  .photos-button {
    display: grid;
    place-items: center;
    position: absolute;
    top: calc(8.75rem / 2);
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: color-mix(in srgb, var(--paper) 90%, transparent);
    box-shadow: 0 1px 4px rgb(0 0 0 / 0.2);
    color: var(--ink);
    font: 1.5rem/1 "Source Serif 4", Georgia, serif;
    cursor: pointer;
    transform: translateY(-50%);
  }

  /* just outside the text column, in the page margin */
  .photos-button.prev {
    left: calc(-1 * var(--button-out));
  }

  .photos-button.next {
    right: calc(-1 * var(--button-out));
  }

  .photos-button[hidden] {
    display: none;
  }
}

main {
  flex: 1 0 auto;
}

/* homepage hero, as wide as the text: a large bounded portrait beside the
   name, a one-line intro and the links; stacked on phones */
.hero {
  margin: 1rem 0 3rem;
  display: grid;
  /* photo ~310px wide; the text side gets the rest */
  grid-template-columns: minmax(0, 19.4rem) minmax(0, 1fr);
  gap: 1.75rem;
  align-items: end;
}

.hero > p {
  margin: 0;
}

.portrait {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  object-position: 50% 15%;
  border-radius: 50%; /* was 6px (rounded square) */
}

.intro h1 {
  margin: 0 0 1rem;
  font-size: clamp(2.5rem, 7vw, 4rem);
  line-height: 1.1;
}

/* beside the photo: name at the top, links at the bottom, so the text
   spans the photo's height */
.intro {
  display: flex;
  flex-direction: column;
  align-self: stretch;
  text-align: center;
}

/* desktop: the text block sits vertically centered against the circle */
@media (min-width: 561px) {
  .intro {
    justify-content: center;
  }

  /* as big as it gets while still fitting on two lines at full column width
     (1.75rem wraps to three) */
  .hero .intro > p {
    font-size: 1.6875rem;
  }
}



.intro > p {
  margin: 0;
  font-size: 1.5rem;
  text-wrap: pretty;
  line-height: 1.4;
}

/* a maroon gruppetto between the intro and the links, like the one above
   the contact note */
.links::before {
  content: "";
  display: block;
  width: 2.1rem;
  height: 1rem;
  flex: none;
  margin: 1.25rem auto 1rem;
  background: var(--accent);
  mask: url("/icons/gruppetto.svg") center / contain no-repeat;
}

/* the links flow and wrap like a line of text */
.links ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.1rem;
}

/* icons: Simple Icons (CC0) + Lucide (ISC), tinted to the link color via mask */
.links a {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  color: var(--link);
  font-size: 1.125rem;
  font-weight: 600;
  text-decoration: none;
  transition: color 150ms ease;
}

/* hover: the link "turns on" */
.links a:hover,
.links a:focus-visible {
  color: var(--link-on);
}

.links a::before {
  content: "";
  flex: none;
  width: 0.95em;
  height: 0.95em;
  background: currentColor;
  mask: var(--icon) center / contain no-repeat;
}

/* icons only: the label stays in the markup for screen readers and as the
   hover tooltip, but isn't drawn */
.links a {
  font-size: 0;
  gap: 0;
  min-width: 2.75rem;
  min-height: 2.75rem;
  justify-content: center;
}

.links a::before {
  width: 1.6rem;
  height: 1.6rem;
}

.links ul {
  justify-content: center;
  gap: 0.25rem;
}

.links a[href*="twitter.com"]   { --icon: url("/icons/twitter.svg"); }
.links a[href*="substack.com"]  { --icon: url("/icons/substack.svg"); }
.links a[href*="instagram.com"] { --icon: url("/icons/instagram.svg"); }
.links a[href*="youtube.com"]   { --icon: url("/icons/youtube.svg"); }
.links a[href*="linkedin.com"]  { --icon: url("/icons/linkedin.svg"); }
.links a[href*="admonymous.co"] { --icon: url("/icons/feedback.svg"); }
.links a[href^="mailto:"]       { --icon: url("/icons/email.svg"); }

@media (max-width: 560px) {
  .hero {
    margin: 0 0 3rem;
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .portrait {
    width: 15rem;
    margin-inline: auto;
    aspect-ratio: 1;
    object-position: 50% 20%;
  }


  .links a {
    min-height: 2.75rem;
  }
}
