/* lorynholmes.com: shared styles. Mobile first; brand colors from the original site. */
:root {
  --cream: #fdfcea;
  --cream-deep: #f4f2d8;
  --moss: #4d6134;
  --moss-deep: #3b4b27;
  --ink: #23271f;
  --muted: #555d48;      /* 6.4:1 on cream */
  --line: #dcdcc4;
  --paper: #ffffff;
  --radius: 6px;
  --header-h: 64px;      /* sticky header height (one row) */
  --gutter: clamp(16px, 4vw, 40px);
  --display: 'Libre Caslon Display', 'Big Caslon', Georgia, serif;
  --serif: 'Libre Caslon Text', 'Big Caslon', Georgia, serif;
  --sans: 'Source Sans 3', -apple-system, 'Segoe UI', Roboto, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 8px); }
body {
  margin: 0;
  /* iPhone landscape: keep content clear of the notch and rounded corners (viewport-fit=cover) */
  padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right);
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.55;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--moss); text-underline-offset: 0.18em; }
/* Touch: no gray tap flash (custom :active states below), no double-tap zoom delay on controls */
a, button { -webkit-tap-highlight-color: transparent; }
button { touch-action: manipulation; }
a:hover { color: var(--moss-deep); }
:focus-visible { outline: 3px solid var(--moss); outline-offset: 3px; border-radius: 2px; }

.skip {
  position: absolute; left: 8px; top: -60px; z-index: 50;
  background: var(--moss); color: var(--cream); padding: 10px 14px; border-radius: var(--radius);
}
.skip:focus { top: 8px; color: var(--cream); }

/* Site header: brand left, three tap-sized links right; no menu toggle needed at any width.
   Sticky and translucent on every page, so content drifts softly underneath. The bar is full
   width, and its padding lines the brand and links up with the 1200px content column. */
.site-header {
  position: sticky; top: 0; z-index: 20;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 4px 16px;
  padding: 10px max(var(--gutter), calc((100% - 1200px) / 2 + var(--gutter)));
  background: color-mix(in srgb, var(--cream) 58%, transparent);
  -webkit-backdrop-filter: saturate(1.5) blur(10px); backdrop-filter: saturate(1.5) blur(10px);
  border-bottom: 1px solid transparent;
}
/* iOS "Reduce Transparency" (and other platforms' equivalents): a solid bar instead of glass */
@media (prefers-reduced-transparency: reduce) {
  .site-header { background: var(--cream); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
/* Standalone (Home Screen) mode: clear the status bar */
@media (display-mode: standalone) { .site-header { padding-top: calc(10px + env(safe-area-inset-top)); } }
/* The hairline fades in once the page scrolls (no JS); older browsers simply never show it. */
@supports (animation-timeline: scroll()) {
  .site-header { animation: header-rule linear both; animation-timeline: scroll(); animation-range: 0 48px; }
  @keyframes header-rule { to { border-bottom-color: var(--line); } }
}
.brand {
  font-family: var(--display); font-size: 1.45rem; line-height: 1; color: var(--moss);
  text-decoration: none; padding: 10px 0;
}
.site-nav { display: flex; gap: 2px; margin-right: -12px; }
.site-nav a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px;
  font-weight: 600; font-size: 1rem; color: var(--ink); text-decoration: none; border-radius: var(--radius);
}
.site-nav a:hover, .site-nav a:active { background: var(--cream-deep); color: var(--moss-deep); }
.site-nav a[aria-current="page"] { color: var(--moss); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }
@media (max-width: 380px) {
  .brand { font-size: 1.25rem; }
  .site-nav a { padding: 0 9px; }
}

/* Hand-drawn arrow links (see templates/_macros.html.j2): editorial, not app buttons */
.arrow { flex: none; width: 32px; height: 18px; transition: transform .3s ease; }
.text-links { display: flex; flex-wrap: wrap; gap: 0 28px; margin: 14px 0 0; }
.text-link {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px;
  font-family: var(--serif); font-size: 1.2rem; color: var(--moss);
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .3em;
  text-decoration-color: color-mix(in srgb, var(--moss) 35%, transparent);
  transition: text-decoration-color .2s;
}
.text-link:hover, .text-link:focus-visible, .text-link:active { text-decoration-color: currentColor; }
.text-link:hover .arrow, .home-entry:hover .arrow, .home-entry:focus-visible .arrow { transform: translateX(6px); }
@media (prefers-reduced-motion: reduce) { .arrow { transition: none; } }

/* ---------- Home ---------- */
/* Phones: a band of the illustration on top, the name overlapping its faded edge, and both
   entries still on the first screen. Larger screens: art left, text right (see min-width: 900px). */
.home-main {
  display: grid; grid-template-areas: "art" "text";
  max-width: 1280px; margin: 0 auto; padding: 0 var(--gutter) 24px;
}
.hero-text { grid-area: text; position: relative; margin-top: -2rem; max-width: 34rem; }
.hero-text h1 {
  font-family: var(--display); font-weight: 400; color: var(--moss);
  font-size: clamp(2.6rem, 9vw, 5.25rem); line-height: 1.02; margin: 0;
}
.hero-roles { font-weight: 600; color: var(--moss); margin: 14px 0 0; font-size: 1.05rem; }
.hero-roles span { white-space: nowrap; }  /* wrap between roles, never before a separator */
.hero-intro { display: none; color: var(--muted); margin: 10px 0 0; }
.hero-intro-short { color: var(--muted); margin: 4px 0 0; font-size: 1rem; }
.hero-roles-short { display: none; }
/* Phones: one line each for roles and intro, tighter entries, so the art band can be taller */
@media (max-width: 599px) {
  .hero-roles { display: none; }
  .hero-roles-short { display: block; font-weight: 600; color: var(--moss); margin: 8px 0 0; font-size: 1.02rem; white-space: nowrap; }
  .entries { margin-top: 16px; }
  .home-entry { padding: 9px 2px 11px; }
  .home-entry-title { font-size: 1.42rem; }
  .home-entry-desc { font-size: .95rem; }
}
@media (min-width: 600px) { .hero-intro { display: block; } .hero-intro-short { display: none; } }
/* Home entries: a contents page, one row per destination; the whole row is the tap target */
.entries { margin-top: 24px; border-top: 1px solid var(--line); max-width: 30rem; }
.home-entry {
  display: grid; grid-template-columns: 1fr auto; grid-template-areas: "title arrow" "desc arrow";
  align-items: center; column-gap: 16px; padding: 14px 2px 16px;
  border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink);
  -webkit-tap-highlight-color: transparent;
}
.home-entry-title {
  grid-area: title; justify-self: start; padding-bottom: 3px;
  font-family: var(--serif); font-size: clamp(1.5rem, 4.6vw, 1.85rem); line-height: 1.2; color: var(--moss);
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size .35s ease;
}
.home-entry-desc { grid-area: desc; font-style: italic; color: var(--muted); font-size: .98rem; }
.home-entry .arrow { grid-area: arrow; color: var(--moss); }
.home-entry:hover .home-entry-title, .home-entry:focus-visible .home-entry-title { background-size: 100% 1px; }
.home-entry:active { background: var(--cream-deep); }
.home-entry:focus-visible { outline-offset: 0; }
.hero-links { margin: 16px 0 0; font-size: 0.98rem; }
.hero-links a { display: inline-block; padding: 6px 0; }
.hero-links .dot { color: var(--line); margin: 0 6px; }
/* The band starts behind the translucent header: petals show through the glass at ~35%,
   reach full strength just below it, and fade into the cream above her name. */
.hero-art { grid-area: art; margin: calc(-1 * var(--header-h)) calc(-1 * var(--gutter)) 0; min-height: 0; }
/* The stage crops the drawing (cover on phones, contain on desktop) and the canvas is the
   drawing's own box. It holds the <img> at first; wind.js swaps in the same drawing as GPU layers
   that react to touch, at exactly the same size and place. */
.hero-stage { position: relative; overflow: hidden; container-type: size; }
.hero-canvas {
  position: absolute; left: 50%; top: 50%; translate: -50% -50%; aspect-ratio: 1500 / 1920;
  width: 100%;                                          /* browsers without container units */
  width: max(100cqw, 100cqh * 1500 / 1920);            /* edge to edge, wider if the band is tall */
}
.hero-canvas > img { display: block; width: 100%; height: 100%; }
/* Each part sits in a .hero-wind (turned by gusts) around a .hero-sway (the CSS sway), positioned
   in percent of the drawing, so the GPU can turn the parts without repainting them. */
.hero-defs { position: absolute; width: 0; height: 0; }
.hero-wind { position: absolute; }
.hero-sway { position: absolute; inset: 0; transform-origin: inherit; }
.hero-sway > svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
/* !important: each layer's inline animation shorthand would otherwise reset the play state */
.hero-stage.is-paused .hero-sway { animation-play-state: paused !important; }
@media (prefers-reduced-motion: reduce) { .hero-sway { animation: none !important; } }
/* The band fade, as a cream wash over the art rather than a mask (the page is flat cream, so it
   looks the same): a mask would make the GPU redraw the whole stage offscreen every frame. The art
   is fully faded 12px above the bottom of the band, where her name starts. */
.hero-stage::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to bottom, color-mix(in srgb, var(--cream) 65%, transparent),
              color-mix(in srgb, var(--cream) 60%, transparent) var(--header-h),
              transparent calc(var(--header-h) + 36px), transparent 55%, var(--cream) calc(100% - 12px));
}
/* Phones and tablets: the art band takes whatever height the text leaves on the first screen
   (svh = with the browser toolbars showing), so every phone shows as much art as fits while both
   entries stay visible. The PDF/email links land just below the fold. */
@media (max-width: 899px) {
  /* The links row is taken out of the sizing (absolute, inside the bottom padding), so the
     band can grow until the second entry sits ~12px above the bottom edge. */
  .home-main {
    display: flex; flex-direction: column; padding-bottom: 7rem;
    min-height: calc(100svh - var(--header-h) + 7rem - 12px);
  }
  .hero-links { position: absolute; top: 100%; left: 0; right: 0; }
  .hero-art {
    order: -1;  /* art first visually; the text stays first in the source for screen readers */
    flex: 1 1 0; position: relative;
    min-height: calc(170px + var(--header-h)); max-height: calc(62svh + var(--header-h));
  }
  /* Full bleed: no side margins; when the band is tall the drawing runs off both edges. */
  .hero-stage { position: absolute; inset: 0; }
  .hero-text { flex: none; margin-top: 0; }  /* below the band, not overlapping it */
}

@media (min-width: 900px) {
  .home-main {
    grid-template-areas: "art text"; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    align-items: center; column-gap: clamp(24px, 4vw, 72px);
  }
  .home-main { min-height: calc(100dvh - 64px); padding-bottom: 0; }
  .hero-art { margin: 0; height: calc(100dvh - 64px); display: flex; justify-content: center; align-items: flex-end; }
  .hero-stage { height: 94%; aspect-ratio: 1500 / 1920; max-width: 100%; }
  .hero-stage::after { content: none; }
  .hero-canvas { top: auto; bottom: 0; translate: -50% 0; width: min(100cqw, 100cqh * 1500 / 1920); }  /* contain, bottom */
  .hero-text { margin-top: 0; padding: 0 0 6vh; }
}

/* ---------- Page intro (floral) ---------- */
.page-intro { max-width: 1200px; margin: 0 auto; padding: 28px var(--gutter) 8px; }
.page-intro h1 {
  font-family: var(--display); font-weight: 400; color: var(--moss);
  font-size: clamp(2.2rem, 6vw, 3.4rem); line-height: 1.05; margin: 0;
}
.page-intro .lead { max-width: 44rem; color: var(--muted); margin: 10px 0 0; }


/* Category filters: serif tabs on a hairline, like the site nav; scroll sideways on phones */
.filters-wrap { max-width: 1200px; margin: 18px auto 16px; padding: 0 var(--gutter); }
.filters {
  display: flex; gap: 26px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none;
  overscroll-behavior-x: contain;
  box-shadow: inset 0 -1px 0 var(--line);   /* hairline inside the box, so tabs never overflow it */
}
.filters::-webkit-scrollbar { display: none; }
.filters { scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
.filters button { scroll-snap-align: start; }
.filters button {
  flex: none; min-height: 46px; padding: 0 1px;
  font-family: var(--serif); font-size: 1.12rem; color: var(--muted);
  background: none; border: 0; border-bottom: 2px solid transparent; border-radius: 0; cursor: pointer;
}
.filters button:hover { color: var(--moss); }
.filters button[aria-pressed="true"] { color: var(--moss); border-bottom-color: var(--moss); }
.filters .n { font: 600 .7rem/1 var(--sans); margin-left: 4px; position: relative; top: -.55em; color: var(--muted); }

/* Gallery grid: uniform tiles keep the visual order and the lightbox order the same */
.grid {
  list-style: none; margin: 0 auto; padding: 0 var(--gutter);
  max-width: 1200px;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px;
}
@media (min-width: 700px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; } }
@media (min-width: 1100px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; } }
.grid li[hidden] { display: none; }
.tile {
  display: block; position: relative; overflow: hidden; border-radius: var(--radius);
  aspect-ratio: 4 / 5; background: var(--ph, var(--cream-deep));
}
.grid .wide { grid-column: span 2; }
.grid .wide .tile { aspect-ratio: 8 / 5; }
.tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
@media (hover: hover) { .tile:hover img { transform: scale(1.03); } }
.tile:active img { opacity: .88; }
@media (prefers-reduced-motion: reduce) { .tile img { transition: none; } .tile:hover img { transform: none; } }

.closing { max-width: 1200px; margin: 0 auto; padding: 40px var(--gutter) 8px; text-align: center; }
.closing h2 { font-family: var(--serif); font-weight: 400; color: var(--moss); font-size: 1.6rem; margin: 0; }
.closing p { color: var(--muted); margin: 8px 0 18px; }
.closing .text-links { justify-content: center; }

/* Lightbox */
.lightbox {
  overscroll-behavior: contain;          /* no page bounce behind the viewer */
  width: 100vw; height: 100dvh; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0; color: #f4f2e6;
  background: rgba(18, 20, 14, .97);
}
.lightbox::backdrop { background: rgba(18, 20, 14, .97); }
.lightbox[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
/* Safe areas: controls stay clear of the notch, the rounded corners, and the home indicator */
.lb-top, .lb-bottom {
  display: flex; align-items: center; gap: 12px;
  padding: 8px max(12px, env(safe-area-inset-right)) 8px max(12px, env(safe-area-inset-left));
}
.lb-top { padding-top: max(8px, env(safe-area-inset-top)); }
.lb-bottom { padding-bottom: max(10px, env(safe-area-inset-bottom)); }
.lb-actions { display: flex; gap: 8px; }
.lb-top { justify-content: space-between; }
.lb-count { font-variant-numeric: tabular-nums; opacity: .85; padding-left: 6px; }
.lb-stage { position: relative; display: flex; align-items: center; justify-content: center; min-height: 0; touch-action: pan-y pinch-zoom; }
.lb-stage img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; user-select: none; -webkit-user-drag: none; }
.lb-caption { flex: 1; margin: 0; text-align: center; font-size: .98rem; line-height: 1.4; opacity: .9; }
.lightbox button {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; border-radius: 999px; border: 0; cursor: pointer;
  background: rgba(255, 255, 255, .1); color: #fff;
}
.lightbox button:hover, .lightbox button:active { background: rgba(255, 255, 255, .2); }
.lightbox svg { width: 24px; height: 24px; }
@media (min-width: 900px) {
  .lb-stage { padding: 0 72px; }
  .lb-prev, .lb-next { position: absolute; top: 50%; transform: translateY(-50%); }
  .lb-prev { left: 16px; } .lb-next { right: 16px; }
}

/* Footer */
.site-footer {
  max-width: 1200px; margin: 48px auto 0;
  padding: 20px var(--gutter) calc(32px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line); color: var(--muted); font-size: .95rem;
  display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between;
}
.site-footer a { display: inline-block; padding: 4px 0; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 4px 18px; }

/* Page-to-page crossfade (Safari 18.2+, Chrome 126+); the header holds still between pages. */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  .site-header { view-transition-name: site-header; }
}
