/* Marianne Huotari — site styles.
   Edit here, not in dist/. Running build.py copies this into dist/assets/. */

:root {
  --paper:      #faf8f5;
  --paper-2:    #f3efe9;
  --ink:        #1b1a18;
  --ink-soft:   #6a635b;
  --line:       #e2dbd1;
  --clay:       #9c5f45;
  --collar-pink: #ac4b74;

  --display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --gutter: clamp(1.25rem, 5vw, 4rem);
  --section-y: clamp(2rem, 4vw, 3.5rem);
  --maxw: 1360px;
}

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-weight: 300;
  font-size: clamp(1rem, .95rem + .2vw, 1.0625rem);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; text-decoration: none; }
.bio-text a, .news-body a, .site-footer a, .section-intro a {
  text-decoration: underline;
  text-underline-offset: .18em;
  text-decoration-thickness: .5px;
  text-decoration-color: var(--line);
  transition: text-decoration-color .2s;
}
.bio-text a:hover, .news-body a:hover, .site-footer a:hover, .section-intro a:hover {
  text-decoration-color: var(--clay);
}

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

.skip {
  position: absolute; left: -9999px;
  background: var(--ink); color: var(--paper); padding: .75rem 1rem; z-index: 100;
}
.skip:focus { left: 1rem; top: 1rem; }

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

/* ---------- header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem; padding-block: .9rem;
  flex-wrap: wrap;
}
.wordmark {
  font-family: "Fraunces", var(--display); font-size: 1.35rem; letter-spacing: .04em;
  color: var(--collar-pink);
}
.site-header nav {
  display: flex; gap: clamp(.85rem, 2vw, 2rem); flex-wrap: wrap;
  font-size: .78rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-soft);
}
.site-header nav a { padding-block: .25rem; border-bottom: 1px solid transparent; }
.site-header nav a:hover { color: var(--ink); border-bottom-color: var(--clay); }

@media (max-width: 700px) {
  .header-inner { flex-wrap: nowrap; gap: .75rem; }
  .wordmark { font-size: 1.1rem; flex: none; }
  .site-header nav {
    flex-wrap: nowrap; overflow-x: auto; gap: 1rem;
    font-size: .7rem; letter-spacing: .1em;
    scrollbar-width: none; -ms-overflow-style: none;
    -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent);
            mask-image: linear-gradient(90deg, #000 85%, transparent);
  }
  .site-header nav::-webkit-scrollbar { display: none; }
  .site-header nav a { white-space: nowrap; }
}

/* ---------- hero ---------- */

.hero { padding-block: clamp(4rem, 14vw, 7rem) clamp(2rem, 6vw, 3rem); }
.hero h1 {
  font-family: var(--display); font-weight: 300;
  font-size: clamp(2.8rem, 8vw, 5.5rem);
  line-height: .95; letter-spacing: -.01em; margin: 0;
}
.tagline {
  margin: 1.5rem 0 0;
  font-size: .82rem; letter-spacing: .22em; text-transform: uppercase;
  color: var(--ink-soft);
}

/* ---------- sections ---------- */

.section { padding-block: var(--section-y); border-top: 1px solid var(--line); }
.section-title {
  font-family: var(--display); font-weight: 300;
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  margin: 0 0 1rem; line-height: 1.1;
}
.section-intro { max-width: 46ch; color: var(--ink-soft); margin: 0; }

/* ---------- bio ---------- */

.bio-grid { display: grid; gap: clamp(2rem, 5vw, 5rem); grid-template-columns: 1fr; align-items: start; }
@media (min-width: 860px) {
  .bio-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
}
.portrait { margin: 0; background: var(--paper-2); }
.portrait img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.bio-text p { max-width: 62ch; }
.bio-text p strong {
  display: block; font-family: var(--display); font-weight: 400;
  font-size: clamp(1.35rem, 2.6vw, 1.9rem); line-height: 1.35;
  margin-block: 2rem; color: var(--clay);
}

/* ---------- grids ---------- */

.grid { list-style: none; margin: clamp(2rem, 4vw, 3.5rem) 0 0; padding: 0; display: grid; gap: clamp(1.25rem, 3vw, 2.5rem); }
.gallery { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.news-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }

/* ---------- works ---------- */

.work { margin: 0; }
.work-figure { margin: 0; background: var(--paper-2); overflow: hidden; position: relative; }
.work-count {
  position: absolute; right: .6rem; bottom: .6rem;
  background: rgba(250, 248, 245, .94); color: var(--ink-soft);
  font-size: .72rem; line-height: 1; letter-spacing: .04em;
  padding: .32rem .6rem; border-radius: 999px;
  box-shadow: 0 1px 4px rgba(27, 26, 24, .18);
  pointer-events: none;
}
.work-figure img {
  width: 100%; aspect-ratio: 4 / 5; object-fit: cover;
  transition: transform .6s cubic-bezier(.2,.7,.3,1);
}
.work-open { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; text-align: left; }
.work-open:hover .work-figure img { transform: scale(1.03); }
.work-meta { margin-top: .9rem; }
.work-title { font-family: var(--display); font-size: 1.2rem; font-weight: 400; margin: 0; }
.work-line { margin: .2rem 0 0; font-size: .82rem; color: var(--ink-soft); }

/* ---------- news ---------- */

.news-item { display: flex; flex-direction: column; }
.news-item img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; background: var(--paper-2); }
.news-grid { align-items: start; }
.news-date { margin: .9rem 0 .35rem; font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); }
.news-title { font-family: var(--display); font-weight: 400; font-size: 1.3rem; margin: 0 0 .5rem; line-height: 1.25; }
.news-body p { margin: 0 0 .6rem; }
.news-link {
  align-self: flex-start;
  margin-top: .1rem;
  font-size: .92rem;
  color: var(--clay);
  text-decoration: underline;
  text-underline-offset: .2em;
  text-decoration-thickness: .5px;
  text-decoration-color: color-mix(in srgb, var(--clay) 40%, transparent);
}
.news-link:hover { text-decoration-color: var(--clay); }
.news-link::after { content: " \2192"; }

/* ---------- footer ---------- */

.site-footer { border-top: 1px solid var(--line); padding-block: var(--section-y) 2rem; background: var(--paper-2); }
.footer-grid { display: grid; gap: clamp(2rem, 5vw, 4rem); grid-template-columns: 1fr; }
@media (min-width: 720px) { .footer-grid { grid-template-columns: repeat(3, 1fr); } }
.footer-label { font-family: var(--body); font-size: .76rem; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-soft); font-weight: 500; margin: 0 0 .75rem; }
.site-footer p { margin: 0; }
.site-footer a { text-decoration-color: #c9c0b3; }
.footer-quiet { color: var(--ink-soft); }
.footer-grid > div { align-content: start; }
.plain { list-style: none; margin: 0; padding: 0; }
.plain li { margin-bottom: .3rem; }
.colophon { margin-top: clamp(3rem, 8vw, 6rem); padding-top: 1.5rem; border-top: 1px solid var(--line); font-size: .78rem; color: var(--ink-soft); }

/* ---------- lightbox ---------- */

.lightbox {
  position: fixed; inset: 0; z-index: 200;
  background: #151412;
  /* The scroll container does no aligning of its own. Centring a tall item
     inside a scroller puts its top edge above scrollTop 0, where it cannot be
     reached — Safari on iOS would not scroll at all. The figure centres itself
     with min-height instead: short content sits in the middle, tall content
     grows the figure and scrolls from the top. */
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: clamp(1rem, 4vw, 3rem) clamp(3.5rem, 9vw, 7rem);
}
.lightbox[hidden] { display: none; }
.lightbox figure {
  margin: 0 auto; max-width: min(1100px, 100%);
  min-height: 100%;
  display: flex; flex-direction: column; justify-content: center;
}
.lightbox img { max-height: 70vh; width: auto; margin-inline: auto; object-fit: contain; }
.lightbox figcaption { color: #ded8d0; text-align: center; margin: 1.25rem auto 0; max-width: 58ch; }
.lb-title { font-family: var(--display); font-size: 1.35rem; color: #fff; margin: 0; }
.lb-meta { font-size: .8rem; letter-spacing: .08em; color: #a9a29a; margin: .3rem 0 0; }
.lb-count { font-size: .74rem; letter-spacing: .14em; color: #8b847c; margin: .55rem 0 0; }
.lb-desc { font-size: .92rem; line-height: 1.6; margin: .9rem 0 0; }
.lb-meta:empty, .lb-desc:empty, .lb-count:empty { display: none; }
.lightbox-close {
  /* Fixed, not absolute: the lightbox scrolls now, and a close button that
     scrolls away with a long caption strands anyone without an Escape key. */
  position: fixed; top: 1rem; right: 1.25rem; z-index: 2;
  background: none; border: 0; color: #fff; font-size: 2.25rem; line-height: 1;
  cursor: pointer; padding: .25rem .5rem;
}

.lightbox-nav {
  /* Starts below the close button, which also sits above it in the stack. */
  position: fixed; top: 4.5rem; bottom: 0; width: clamp(3rem, 9vw, 6rem);
  display: grid; place-items: center;
  background: none; border: 0; color: #fff; opacity: .55;
  font-size: clamp(2.5rem, 6vw, 3.75rem); line-height: 1;
  cursor: pointer; transition: opacity .2s;
}
.lightbox-nav:hover { opacity: 1; }
.lightbox-nav[hidden] { display: none; }
.lightbox-prev { left: 0; }
.lightbox-next { right: 0; }

@media (max-width: 700px) {
  /* Arrows sit beside the photograph rather than at the foot of the window,
     where a long caption now runs underneath them. They keep a disc behind
     them so they stay legible over text once the caption is scrolled up. */
  .lightbox { padding: 1rem 1rem 5.5rem; }
  .lightbox-nav {
    top: 0; bottom: auto; height: 58vh; opacity: .9;
    font-size: 2rem;
    /* Legible over a photograph or over the caption, without a disc that
       would need its own stacking context inside the button. */
    text-shadow: 0 1px 6px rgba(0, 0, 0, .9);
  }
  .lightbox img { max-height: 58vh; }
}
