/* House of May LLC, studio site.
   Classical bookplate system: Libre Bodoni (Didone display), EB Garamond (text),
   deep forest ink on warm cream. No first-party JavaScript. Light theme by intent. */

@font-face {
  font-family: "Libre Bodoni";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/fonts/libre-bodoni.woff2") format("woff2");
}

@font-face {
  font-family: "EB Garamond";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("/fonts/eb-garamond.woff2") format("woff2");
}

:root {
  color-scheme: light;
  --paper: #FAF8F3;       /* warm cream, bookplate paper */
  --ink: #1F3D2D;         /* brand deep forest green */
  --muted: #4F6157;       /* muted green-gray, secondary text */
  --hairline: #C9D2CB;    /* soft rule */
  --frame: rgba(31, 61, 45, 0.28);  /* hairline frame and dividers */
  --decoration: #A7B6AC;  /* link underline, resting */
  --wash: rgba(31, 61, 45, 0.035);  /* faint hover fill */
  --gilt: #86683A;        /* muted antique gold, decorative marks ONLY (gold-stamped-binding feel).
                             Scoped to the drop cap, ornaments, and work numerals. Deepened from
                             #937544 to clear WCAG AA (4.88:1 on paper) for the small numerals.
                             To go all-green, set this to var(--muted) and nothing else changes. */
  --display: "Libre Bodoni", "Bodoni 72", Didot, "Bodoni MT", Georgia, serif;
  --text: "EB Garamond", "Iowan Old Style", Palatino, Georgia, "Times New Roman", serif;
  --inset: clamp(0.75rem, 2.4vw, 1.75rem);
  --measure: 40rem;
}

/* Dark scheme: a moonlit library. Deep forest-black paper, aged cream ink,
   candlelit gold. Same bookplate, after hours. All pairs pass WCAG AA
   (ink 14.4:1, muted 8.4:1, gilt 7.3:1 against the dark paper). */
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --paper: #0F1A14;
    --ink: #ECE7DA;
    --muted: #A8B5AB;
    --hairline: #26332B;
    --frame: rgba(236, 231, 218, 0.26);
    --decoration: #56685D;
    --wash: rgba(236, 231, 218, 0.045);
    --gilt: #C0A265;
  }
}

/* Higher-contrast preference: strengthen the quiet grays and hairlines */
@media (prefers-contrast: more) {
  :root {
    --muted: #33473B;
    --frame: rgba(31, 61, 45, 0.6);
    --hairline: #8FA096;
    --decoration: #4F6157;
  }
}

@media (prefers-contrast: more) and (prefers-color-scheme: dark) {
  :root {
    --muted: #C9D3CA;
    --frame: rgba(236, 231, 218, 0.55);
    --hairline: #4A5A50;
    --decoration: #8FA096;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  hanging-punctuation: first last; /* fine-press margins where supported (Safari) */
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--text);
  font-size: 1.1875rem;
  line-height: 1.6;
  font-variant-numeric: oldstyle-nums;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Base link color, so nothing falls back to browser blue */
a {
  color: var(--ink);
}

/* Skip link */
.skip-link {
  position: absolute;
  left: -9999px;
}

.skip-link:focus {
  left: 50%;
  top: 0.5rem;
  transform: translateX(-50%);
  z-index: 10;
  padding: 0.5rem 1rem;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 3px;
  text-decoration: none;
}

/* Bookplate frame, inset evenly from the page edges */
.plate {
  min-height: calc(100vh - 2 * var(--inset));
  min-height: calc(100svh - 2 * var(--inset));
  margin: var(--inset);
  padding: clamp(1.75rem, 4.5vw, 3rem) clamp(1.25rem, 5vw, 3.25rem);
  border: 1px solid var(--frame);
  display: flex;
  flex-direction: column;
}

/* Shared uniform small-caps label treatment */
.eyebrow,
.masthead__nav a,
.work__status,
.disciplines dt,
.contact dt,
.colophon__nav a,
.colophon__legal {
  text-transform: lowercase;
  font-variant-caps: small-caps;
  font-variant-numeric: oldstyle-nums;
  letter-spacing: 0.18em;
}

/* Masthead: monogram, wordmark home link, primary nav */
.masthead {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding-bottom: clamp(1.4rem, 3.5vh, 2rem);
  border-bottom: 1px solid var(--hairline);
  text-align: center;
}

.masthead__brand {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--ink);
  text-decoration: none;
}

.masthead__mark {
  line-height: 0;
}

.masthead__mark svg {
  display: block;
  width: 46px;
  height: auto;
}

.masthead__wordmark {
  font-family: var(--display);
  font-weight: 500;
  font-size: 1.05rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

.masthead__nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem 1.6rem;
}

.masthead__nav a {
  font-size: 0.8rem;
  color: var(--muted);
  text-decoration: none;
  padding: 0.45rem 0.2rem; /* generous tap target on touch screens */
  transition: color 120ms ease;
}

.masthead__nav a:hover {
  color: var(--ink);
}

.masthead__nav a[aria-current="page"] {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--decoration);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.32em;
}

/* Main reading column */
main {
  flex: 1 0 auto;
  width: 100%;
  max-width: var(--measure);
  margin-inline: auto;
  padding-block: clamp(2.25rem, 6vh, 3.75rem);
  display: flex;
  flex-direction: column;
  gap: clamp(2.5rem, 6vh, 4rem);
}

/* Hero (home) and page head (inner pages): centered */
.hero,
.pagehead {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  text-align: center;
}

.eyebrow {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
}

.hero__statement,
.page-title {
  margin: 0;
  font-family: var(--display);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: 0.01em;
  color: var(--ink);
  text-wrap: balance;
}

.hero__statement {
  font-size: clamp(1.9rem, 5.2vw, 3rem);
  max-width: 18ch;
}

.page-title {
  font-size: clamp(2rem, 6vw, 2.85rem);
}

.lede {
  margin: 0;
  max-width: 46ch;
  font-size: clamp(1.1rem, 2.3vw, 1.25rem);
  line-height: 1.58;
  color: var(--muted);
  text-wrap: pretty;
}

.rule {
  width: 44px;
  height: 1px;
  margin: 0.2rem auto 0;
  border: 0;
  background: var(--frame);
}

/* Editorial prose (Studio) */
.prose {
  max-width: var(--measure);
  font-size: 1.1rem;
  line-height: 1.68;
}

.prose > * {
  margin: 0;
}

.prose > * + * {
  margin-top: 1.3em;
}

.prose p {
  text-wrap: pretty;
}

.prose a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--decoration);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

.prose a:hover {
  text-decoration-color: var(--ink);
}

/* A centered small-caps label that titles a section */
.section-label {
  margin: 0 0 1.1rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: lowercase;
  font-variant-caps: small-caps;
  font-variant-numeric: oldstyle-nums;
  letter-spacing: 0.18em;
  text-align: center;
}

/* Disciplines triad (home) */
.disciplines {
  margin: 0;
  display: grid;
  gap: 1.5rem;
  text-align: center;
}

@media (min-width: 34rem) {
  .disciplines {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.75rem;
  }
}

.disciplines dt {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.35rem;
}

.disciplines dd {
  margin: 0;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--muted);
}

/* Works list (Ventures) and the home preview */
.works {
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
}

.work {
  padding-block: clamp(1.6rem, 4vh, 2.1rem);
  border-top: 1px solid var(--hairline);
}

.work:first-child {
  border-top: 0;
  padding-top: 0;
}

.work__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem 1rem;
}

.work__name {
  margin: 0;
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(1.5rem, 3.6vw, 1.85rem);
  line-height: 1.1;
  color: var(--ink);
}

.work__status {
  font-size: 0.74rem;
  color: var(--muted);
}

.work__desc {
  margin: 0.7rem 0 0;
  max-width: 52ch;
  font-size: 1.075rem;
  line-height: 1.6;
  color: var(--ink);
  text-wrap: pretty;
}

.work__link {
  margin: 0.7rem 0 0;
  font-size: 1rem;
}

.work__link a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--decoration);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

.work__link a:hover {
  text-decoration-color: var(--ink);
}

.work__todo {
  margin: 0.6rem 0 0;
  font-size: 0.95rem;
  color: var(--muted);
  font-style: italic;
}

/* A quiet closing note under a list */
.endnote {
  margin: 0;
  font-size: 1rem;
  color: var(--muted);
  text-align: center;
  text-wrap: pretty;
}

.endnote a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--decoration);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: text-decoration-color 120ms ease;
}

.endnote a:hover {
  text-decoration-color: var(--ink);
}

/* Principles (Studio) */
.principles {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 40rem) {
  .principles {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.75rem;
  }
}

.principle h3 {
  margin: 0 0 0.4rem;
  font-family: var(--display);
  font-weight: 500;
  font-size: 1.2rem;
  line-height: 1.15;
  color: var(--ink);
}

.principle p {
  margin: 0;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--muted);
  text-wrap: pretty;
}

/* Contact and address */
.contact {
  margin: 0;
  display: grid;
  gap: 1.4rem;
  text-align: center;
}

.contact__row {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.contact dt {
  font-size: 0.78rem;
  color: var(--muted);
}

.contact dd {
  margin: 0;
  font-size: 1.15rem;
}

.contact a,
.return a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--decoration);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: text-decoration-color 120ms ease;
}

.contact a:hover,
.return a:hover {
  text-decoration-color: var(--ink);
}

/* Larger tap target for the contact links on mobile */
.contact dd a {
  display: inline-block;
  padding-block: 0.15rem;
}

.postal {
  font-style: normal;
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--ink);
}

/* Colophon footer */
.colophon {
  flex: 0 0 auto;
  width: 100%;
  max-width: var(--measure);
  margin: clamp(2.5rem, 6vh, 3.5rem) auto 0;
  padding-top: clamp(1.25rem, 3vh, 1.75rem);
  border-top: 1px solid var(--hairline);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
  text-align: center;
}

.colophon__nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem 1.4rem;
}

.colophon__nav a {
  font-size: 0.76rem;
  color: var(--muted);
  text-decoration: none;
  padding: 0.35rem 0.1rem; /* tap target */
  transition: color 120ms ease;
}

.colophon__nav a:hover {
  color: var(--ink);
}

.colophon__nav a[aria-current="page"] {
  color: var(--ink);
}

.colophon__legal {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

/* Focus */
a:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  border-radius: 2px;
}

/* 404 */
.notfound-title {
  margin: 0;
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(1.8rem, 5vw, 2.4rem);
  line-height: 1.1;
  letter-spacing: 0.01em;
  color: var(--ink);
}

.return {
  margin: 0;
  font-size: 1.1rem;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0ms !important;
    transition: none !important;
  }
}

/* ===================================================================
   Elevation layer. Fine-press ornament, drop cap, work numerals, a
   whisper of gilt, and a slow staggered entrance. Every gilt mark is
   decorative and driven by --gilt alone. Motion is opt-in under
   prefers-reduced-motion: no-preference and, because the reduce block
   above collapses any animation to an instant, it never hides content.
   =================================================================== */

::selection {
  background: var(--ink);
  color: var(--paper);
}

/* Fine-press ornament: a small gilt lozenge flanked by hairlines */
.ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  margin: 0.3rem 0 0;
}

.ornament::before,
.ornament::after {
  content: "";
  display: block;
  width: clamp(28px, 8vw, 42px);
  height: 1px;
  background: var(--hairline);
}

.ornament span {
  display: block;
  width: 6px;
  height: 6px;
  background: var(--gilt);
  transform: rotate(45deg);
}

/* Drop cap: opens the studio narrative like a set page */
.dropcap::first-letter {
  float: left;
  margin: 0.03em 0.11em 0 0;
  font-family: var(--display);
  font-weight: 500;
  font-size: 3.5em;
  line-height: 0.72;
  color: var(--gilt);
}

/* Numbered works: a printer's catalogue, I through IV */
.works--numbered {
  counter-reset: work;
}

.works--numbered .work {
  counter-increment: work;
}

.works--numbered .work::before {
  content: counter(work, upper-roman);
  display: block;
  margin-bottom: 0.55rem;
  font-family: var(--text);
  font-variant-numeric: normal;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.28em;
  color: var(--gilt);
}

/* Footer colophon note: the typefaces the site is set in */
.colophon__note {
  margin: 0;
  font-size: 0.86rem;
  font-style: italic;
  color: var(--muted);
  letter-spacing: 0.01em;
  text-wrap: pretty;
}

/* Small print (privacy effective date, etc.) */
.fineprint {
  font-size: 0.92rem;
  color: var(--muted);
}

/* Entrance: a slow, staggered rise. Opt-in, and collapsed to nothing by
   the reduced-motion block above, so content is never left hidden. */
@media (prefers-reduced-motion: no-preference) {
  @keyframes rise {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  /* The house stands; the page settles. The masthead stays planted (it also
     persists across navigations via view-transition-name) while the content
     rises in beneath it. */
  main > * {
    animation: rise 0.72s cubic-bezier(0.22, 1, 0.36, 1) both;
  }

  main > *:nth-child(1) { animation-delay: 0.06s; }
  main > *:nth-child(2) { animation-delay: 0.16s; }
  main > *:nth-child(3) { animation-delay: 0.26s; }
  main > *:nth-child(4) { animation-delay: 0.36s; }
  main > *:nth-child(5) { animation-delay: 0.46s; }
  main > *:nth-child(n+6) { animation-delay: 0.54s; }

  /* Home only: the monogram circle draws itself once, like a plate being
     engraved, then the M settles into it. Requires pathLength="1" on the
     circle (set in index.html). */
  .home .masthead__mark circle {
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    animation: engrave 1s cubic-bezier(0.4, 0, 0.2, 1) 0.05s both;
  }

  .home .masthead__mark g {
    animation: settle 0.45s ease 0.8s both;
  }

  @keyframes engrave {
    to { stroke-dashoffset: 0; }
  }

  @keyframes settle {
    from { opacity: 0; }
  }

  /* Cross-document view transitions: page-to-page navigation cross-fades
     like turning a leaf. Pure CSS, progressive enhancement, no JS. */
  @view-transition {
    navigation: auto;
  }

  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation-duration: 200ms;
    animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
  }
}

/* The plate's chrome persists across page navigations: with cross-document
   view transitions, only the reading column turns; masthead and colophon
   hold still. Ignored where unsupported. */
.masthead {
  view-transition-name: masthead;
}

.colophon {
  view-transition-name: colophon;
}

/* Optical cap alignment for the Didone display settings, where supported */
.hero__statement,
.page-title,
.work__name {
  text-box: trim-both cap alphabetic;
}

/* The roman numerals are visual indexing; the list order already speaks for
   itself, so screen readers skip them (alt-text syntax, with a plain
   fallback above for engines that do not know it). */
.works--numbered .work::before {
  content: counter(work, upper-roman);
  content: counter(work, upper-roman) / "";
}

/* Windows High Contrast / forced colors: keep the drawn marks visible */
@media (forced-colors: active) {
  .ornament span,
  .ornament::before,
  .ornament::after,
  .rule {
    forced-color-adjust: none;
    background: CanvasText;
  }
}

/* ===================================================================
   Colophon page: type specimens and drawn palette swatches
   =================================================================== */

.specimen {
  margin: 0 0 0.9rem;
  text-align: center;
  text-wrap: balance;
}

.specimen--display {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(1.6rem, 4.5vw, 2.3rem);
  line-height: 1.2;
  letter-spacing: 0.04em;
  color: var(--ink);
}

.specimen--text {
  font-family: var(--text);
  font-size: clamp(1.15rem, 2.6vw, 1.4rem);
  line-height: 1.5;
  color: var(--ink);
}

.specimen--caps {
  font-family: var(--text);
  font-size: 1.05rem;
  text-transform: lowercase;
  font-variant-caps: small-caps;
  font-variant-numeric: oldstyle-nums;
  letter-spacing: 0.18em;
  color: var(--muted);
}

.swatches {
  list-style: none;
  margin: 0.4rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.4rem;
}

.swatch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.swatch__chip {
  width: 64px;
  height: 64px;
  border: 1px solid var(--frame);
}

.swatch__chip--paper { background: var(--paper); }
.swatch__chip--ink { background: var(--ink); }
.swatch__chip--muted { background: var(--muted); }
.swatch__chip--gilt { background: var(--gilt); }
.swatch__chip--hairline { background: var(--hairline); }

.swatch__name {
  font-size: 0.74rem;
  text-transform: lowercase;
  font-variant-caps: small-caps;
  letter-spacing: 0.18em;
  color: var(--muted);
}

/* Colophon page sections read as a centered column of short entries */
.colophon-entry {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
  text-align: center;
}

.colophon-entry .prose {
  max-width: 52ch;
  text-align: center;
}

/* ===================================================================
   Notes: index list and the note page itself
   =================================================================== */

.note-meta {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: lowercase;
  font-variant-caps: small-caps;
  font-variant-numeric: oldstyle-nums;
  letter-spacing: 0.18em;
  color: var(--muted);
}

.note-body {
  margin-inline: auto;
}

.note-sig {
  margin: 1.6rem 0 0;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: lowercase;
  font-variant-caps: small-caps;
  letter-spacing: 0.18em;
  color: var(--ink);
  text-align: center;
}

.note-sig::before {
  content: "";
  display: block;
  width: 44px;
  height: 1px;
  margin: 0 auto 1.1rem;
  background: var(--frame);
}

.note-pub {
  margin: 0.5rem 0 0;
  text-align: center;
}

/* Note titles on the index link without losing the display setting */
.work__title-link {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--decoration);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.14em;
  transition: text-decoration-color 120ms ease;
}

.work__title-link:hover {
  text-decoration-color: var(--ink);
}

/* Print: a clean leaf. Light palette, no chrome, no frame height games. */
@media print {
  :root {
    --paper: #ffffff;
    --ink: #1a1a1a;
    --muted: #444444;
    --gilt: #6f5527;
    --frame: #cccccc;
    --hairline: #dddddd;
  }

  .skip-link,
  .masthead__nav,
  .colophon__nav {
    display: none;
  }

  .plate {
    min-height: auto;
    margin: 0;
  }

  .masthead,
  main > *,
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation: none !important;
  }
}
