/* ─────────────────────────────────────────────
   RACHEL LYN / EARTHLIER — site styles
   Colours, fonts and the type scale live at the top.
   ───────────────────────────────────────────── */

:root {
  --bg: #ffffff;
  --ink: #111111;
  --muted: #8c8c8c;
  --line: #e6e6e6;
  --tint: #f2f2f2;

  /* Fonts: the name, everything else, and the small play button */
  --wordmark: "Instrument Sans", "Helvetica Neue", Arial, sans-serif;
  --font: "Work Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;

  /* Type scale: six sizes, used everywhere */
  --fs-meta: 12px;                         /* years, small notes */
  --fs-label: 13px;                        /* menu, labels, lists (capitals) */
  --fs-body: 15px;                         /* all reading text */
  --fs-lead: 17px;                         /* opening paragraphs */
  --fs-title: clamp(20px, 1.7vw, 24px);    /* service titles, card titles, emails */
  --fs-display: clamp(34px, 3.6vw, 52px);  /* page headings */

  --lh-body: 1.55;
  --pad: clamp(16px, 1.7vw, 24px);
  --gap-section: clamp(60px, 8vw, 120px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--fs-label);
  font-weight: 500;
  line-height: 1.45;
  text-transform: uppercase;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; text-decoration: none; transition: opacity .2s; }
a:hover { opacity: .5; }
img { display: block; width: 100%; height: auto; }
button { font: inherit; text-transform: inherit; background: none; border: 0; color: inherit; cursor: pointer; padding: 0; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }

/* ── Shared text styles ──────────────────────
   One rule for each kind of text, so every page matches. */

/* Reading text: sentence case, regular weight */
.hero-text, .commercial-intro, .article-intro,
.work-top .statement, .prose, .lede, .info-text, .credits,
.service-list p, .card-text p, .earlier-note, .article-body p {
  text-transform: none;
  font-weight: 400;
  font-size: var(--fs-body);
  line-height: var(--lh-body);
}
.hero-text, .commercial-intro, .article-intro, .lede { font-size: var(--fs-lead); line-height: 1.5; }
.article-body p { font-size: 16px; line-height: 1.65; }   /* long read */

/* Page headings: "Work together", "Contact", article titles */
.services-title, .article-head h1 {
  font-family: var(--font);
  font-size: var(--fs-display);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -.02em;
  text-transform: none;
}

/* Second-level titles: services, resource cards, emails, client names */
.service-list h3, .card-text h2, .email, .client-list {
  font-family: var(--font);
  font-size: var(--fs-title);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -.01em;
  text-transform: none;
}

/* Small grey labels: section names, captions */
.bar .label, .info-block h2, .cv h2, .images-title,
.work-images figcaption, .article-body figcaption, .back, .watch, .copy { color: var(--muted); }

/* ── Header ─────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 20;
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px var(--pad);
  background: var(--bg);
}
.wordmark {
  font-family: var(--wordmark);
  font-size: 16px; font-weight: 500;
  text-transform: none; letter-spacing: .01em;
}
.nav { display: flex; gap: 18px; flex-wrap: wrap; justify-content: flex-end; }
.nav a { white-space: nowrap; }
.nav a[aria-current="page"] { color: var(--muted); }

main { flex: 1; padding: 0 var(--pad); }

/* One long page: each section starts like a new page of a book */
.chapter { scroll-margin-top: 56px; }
.chapter.turn { border-top: 1px solid var(--line); margin-top: clamp(40px, 6vw, 90px); padding-top: clamp(24px, 3vw, 40px); }
.chapter .services { padding-bottom: 0; }
.chapter .article-cards { padding-bottom: 0; }

/* Top of every page: same space above */
.hero, .work-top, .about, .wt-top, .contact-top, .page-head, .article { padding-top: 20px; }

/* ── Home: statement left, image right ───── */
.hero {
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--pad);
  padding-bottom: clamp(80px, 12vw, 180px);
}
.hero-text { max-width: 34em; }
.hero-text p + p { margin-top: 1.2em; }
.hero-left { display: grid; gap: 28px; align-content: start; }
/* Works intro: one sentence in old book type, then a quiet line of keywords */
.intro-line { font-family: "Libre Caslon Text", Georgia, "Times New Roman", serif; font-size: clamp(22px, 2vw, 28px); line-height: 1.38; text-transform: none; font-weight: 400; max-width: 22em; }
.intro-line i { font-style: italic; }
.intro-where { font-family: "Libre Caslon Text", Georgia, serif; font-style: italic; font-size: var(--fs-body); text-transform: none; font-weight: 400; color: #555; margin-top: 22px; }
.hero-left .services-title { margin-bottom: 0; }
.hero-figure { justify-self: start; width: min(100%, 560px); }
.hero-figure .frame { overflow: hidden; }   /* the photo shows whole, never cropped */
.hero-figure img, .hero-figure video { width: 100%; height: auto; display: block; }
.fade { transition: opacity .35s ease; }
.fade.out { opacity: 0; }

/* ── Lists (selected works, releases, archive) ── */
.bar { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; padding-bottom: 10px; }
.index { list-style: none; }
.index li + li { border-top: 1px solid var(--line); }
.index a, .index .plain {
  display: grid; grid-template-columns: 120px 1fr auto 20px; gap: var(--pad);
  padding: 10px 0; align-items: baseline;
}
.index a:hover { opacity: 1; }
.index .yr, .index .cat, .index .where { color: var(--muted); }
.index .yr { font-variant-numeric: tabular-nums; white-space: nowrap; }
.index .what { min-width: 0; }
.index .go { color: var(--muted); text-align: right; opacity: 0; transition: opacity .2s; }
.index a:hover .go { opacity: 1; color: var(--ink); }
.index a:hover .what { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }

.index.selected { border-top: 1px solid var(--line); }
.index.selected li { border-bottom: 1px solid var(--line); }
.index.selected li + li { border-top: 0; }
.index.selected a, .index.selected .plain { grid-template-columns: 52px 1fr auto 20px; padding: 12px 0; }
.index.selected .yr { font-size: var(--fs-meta); }
.releases, .archive-wrap { margin-top: var(--gap-section); }

.archive-toggle {
  width: 100%; display: flex; justify-content: space-between; align-items: baseline;
  padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--muted);
}
.archive-toggle:hover, .archive-toggle[aria-expanded="true"] { color: var(--ink); }
.archive-toggle:focus-visible { outline: 1px solid var(--ink); outline-offset: 4px; }
.year-block { display: grid; grid-template-columns: 100px 1fr; gap: var(--pad); border-bottom: 1px solid var(--line); }
.year { font-size: inherit; font-weight: 500; padding: 10px 0; }
.earlier-note { padding: 14px 0; max-width: 40em; color: var(--muted); }

/* ── Simple page (404) ───────────────────── */
.page-head { padding-bottom: var(--gap-section); max-width: 40em; }
.page-head.two { display: grid; grid-template-columns: 1fr 1fr; gap: var(--pad); max-width: none; padding-bottom: clamp(48px, 7vw, 100px); }
.page-head.two .services-title { margin-bottom: 0; }
.lede { max-width: 34em; }

/* ── Work page ───────────────────────────── */
.work-top { display: grid; grid-template-columns: 1fr 1fr; gap: var(--pad); padding-bottom: var(--gap-section); }
.work-top h1 { font-size: inherit; font-weight: 500; }
.work-top .meta { color: var(--muted); margin-top: 4px; }
.work-top .statement { max-width: 36em; }
.work-top .details { margin-top: 1.4em; color: var(--muted); list-style: none; }
.listen { display: inline-block; margin-top: 1.4em; margin-right: 18px; }
.watch:hover, .copy:hover { color: var(--ink); opacity: 1; }

.work-video { display: grid; gap: 12px; justify-items: end; padding-bottom: var(--gap-section); }
.video-frame { width: min(100%, 900px); aspect-ratio: 16 / 9; background: #111; }
.video-frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.poster { position: relative; cursor: pointer; overflow: hidden; }
.poster img { width: 100%; height: 100%; object-fit: contain; display: block; transition: opacity .3s; }
.poster:hover img { opacity: .85; }
.poster:focus-visible { outline: 1px solid var(--ink); outline-offset: 4px; }
.poster .play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  font-family: var(--mono); font-size: var(--fs-meta); letter-spacing: .08em;
  color: #f4f1e8; border: 1px solid rgba(244,241,232,.7); padding: 10px 16px; text-shadow: 0 0 4px rgba(0,0,0,.5);
}

.images-title { width: min(100%, 620px); margin-left: auto; margin-bottom: 12px; }
.work-images { display: grid; gap: clamp(40px, 6vw, 90px); padding-bottom: 40px; }
.work-images figure { width: min(100%, 620px); margin-left: auto; }
.work-images img { width: auto; max-width: 100%; max-height: 78vh; }   /* whole photo, never cropped, never taller than the screen */
.work-images figcaption, .article-body figcaption { margin-top: 10px; }
.pager { display: flex; justify-content: space-between; gap: 16px; border-top: 1px solid var(--line); padding: 14px 0; }

/* Album info: tracklist, about, credits */
.info-block { display: grid; grid-template-columns: 1fr 1fr; gap: var(--pad); border-top: 1px solid var(--line); padding: 16px 0 clamp(40px, 6vw, 72px); }
.info-block h2 { font-size: inherit; font-weight: 500; }
.tracklist { list-style: none; max-width: 36em; }
.tracklist li { display: grid; grid-template-columns: 28px 1fr auto; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.info-text { max-width: 36em; }
.info-text p + p { margin-top: 1em; }
.credits { list-style: none; line-height: 1.7; }

/* ── About ───────────────────────────────── */
.about { display: grid; grid-template-columns: 1fr 1fr; gap: var(--pad); padding-bottom: var(--gap-section); }
.prose { max-width: 36em; }
.about-left { display: grid; gap: 28px; align-content: start; }
.about-left .services-title { margin-bottom: 0; }
.about-figure { justify-self: start; position: sticky; top: 70px; align-self: start; width: clamp(240px, 28vw, 420px); }
.about-figure figcaption { margin-top: 10px; color: var(--muted); }
.prose p + p { margin-top: 1em; }
/* Opening statements: one per section, all in the same book type and size as the Works intro */
.commercial-intro.book, .lede.book {
  font-family: "Libre Caslon Text", Georgia, "Times New Roman", serif;
  font-size: clamp(22px, 2vw, 28px); line-height: 1.38; font-weight: 400; max-width: 22em;
}
.commercial-intro.book p + p { margin-top: .6em; }

/* Drop caps (inspired by Daphne Oram's "An Individual Note") */
/* Text stays in the site font; only the opening letter is a large book-type initial */
/* Every drop cap on the site is the same size: About's R, Work together's I, Resources' A and the Works M */
.prose.book p:first-child::first-letter, .commercial-intro.book p:first-child::first-letter, .lede.book::first-letter, .intro-line::first-letter {
  float: left; font-family: "Libre Caslon Text", Georgia, "Times New Roman", serif; font-weight: 400; font-style: normal;
  font-size: clamp(56px, 5vw, 68px); line-height: .8; padding: .1em .08em 0 0; }
/* A quote in Rachel's own words: full width, large, after the bio */
.quote-block { border-top: 1px solid var(--line); padding: clamp(60px, 9vw, 140px) 0 var(--gap-section); display: grid; justify-items: center; text-align: center; gap: 28px; }
.quote-block blockquote { max-width: min(100%, 880px); text-transform: none; font-weight: 400; display: grid; gap: clamp(20px, 2.4vw, 36px); justify-items: center; }
.quote-block .q-lead { font-size: clamp(44px, 7vw, 104px); line-height: 1; letter-spacing: -.035em; }
.quote-block p:not(.q-lead):not(.q-by) { max-width: 30em; font-size: clamp(20px, 2vw, 30px); line-height: 1.35; letter-spacing: -.015em; text-wrap: balance; }
.quote-block .q-by { color: var(--muted); }
.cv { margin-bottom: clamp(48px, 6vw, 90px); }
.cv h2 { font-size: inherit; font-weight: 500; padding-bottom: 10px; }
.names { max-width: 60em; border-top: 1px solid var(--line); padding-top: 14px; }

/* ── Work together ───────────────────────── */
.wt-top, .contact-top { display: grid; grid-template-columns: 1fr 1fr; gap: var(--pad); padding-bottom: clamp(48px, 7vw, 100px); }
.commercial-intro { max-width: 34em; }
.commercial-intro p + p { margin-top: .8em; }
.cta { display: inline-block; margin-top: 28px; }
.services { padding-bottom: clamp(40px, 6vw, 90px); }
.services-title { margin-bottom: clamp(20px, 3vw, 40px); }
.service-list { list-style: none; border-top: 1px solid var(--line); }
.service-list li {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--pad);
  padding: 18px 0 20px; border-bottom: 1px solid var(--line); align-items: baseline;
  scroll-margin-top: 70px;
}
.service-list p { max-width: 30em; }
/* Big type list: large service names, description opens on tap */
.service-list.big li { display: block; padding: 0; }
.svc-toggle {
  width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) 32px; gap: var(--pad); align-items: baseline;
  padding: clamp(10px, 1vw, 14px) 0; text-align: left; text-transform: none;
}
.svc-name { font-size: clamp(22px, 2.4vw, 34px); font-weight: 400; line-height: 1.1; letter-spacing: -.02em; transition: color .2s; }
.svc-plus { text-align: right; color: var(--muted); font-size: var(--fs-title); font-weight: 400; }
.svc-toggle:hover .svc-name, .svc-toggle[aria-expanded="true"] .svc-name { color: var(--muted); }
.svc-toggle:focus-visible { outline: 1px solid var(--ink); outline-offset: 4px; }
.svc-body { padding: 0 0 clamp(20px, 2.4vw, 32px) calc(50% + var(--pad) / 2); }
.svc-body p { max-width: 30em; }
.clients { display: grid; grid-template-columns: 1fr 1fr; gap: var(--pad); border-top: 1px solid var(--line); padding: 16px 0 40px; }
.client-list { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 0; }
.client-list li:not(:last-child)::after { content: "·"; margin: 0 .45em; color: var(--muted); }

/* ── Contact ─────────────────────────────── */
.contact-intro { display: grid; align-content: start; gap: 28px; }
.contact-intro .services-title { margin-bottom: 0; }
.contact-figure { width: min(100%, 440px); }
.contact { display: grid; gap: 28px; }
.contact .block { display: grid; gap: 6px; justify-items: start; }
.email-row { display: flex; gap: 14px; align-items: baseline; flex-wrap: wrap; }
.email { user-select: all; word-break: break-all; }
.inline-links { display: flex; flex-wrap: wrap; gap: 4px 16px; }

/* ── Resources ───────────────────────────── */
.article-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 56px var(--pad); padding-bottom: var(--gap-section); }
.article-card { display: grid; gap: 14px; align-content: start; }
.article-card:hover { opacity: 1; }
.article-card .frame { overflow: hidden; }   /* covers show whole, never cropped */
.article-card img { width: 100%; height: auto; transition: transform .9s cubic-bezier(.2,.7,.2,1); }
.article-card:hover img { transform: scale(1.02); }
.card-text { display: grid; gap: 8px; }
.card-text .read { margin-top: 4px; }
.article-card:hover .read { text-decoration: underline; text-underline-offset: 3px; }

.article { padding-bottom: var(--gap-section); }
.back { display: inline-block; }
.article-head { max-width: 46rem; margin: clamp(40px, 6vw, 72px) auto; text-align: center; display: grid; gap: 22px; justify-items: center; }
.article-head h1 { text-wrap: balance; }
.article-head h1 span { color: var(--muted); }
.article-intro { max-width: 34em; }
.article-body { max-width: 64rem; margin: 0 auto; display: grid; gap: 28px; }
.article-body > p, .article-body > h2, .article-body > blockquote { width: 100%; max-width: 40rem; justify-self: center; }   /* text stays a narrow column */
.article-body figure { margin: 24px 0; }
.article-body h2 { font-size: inherit; font-weight: 500; color: var(--muted); padding-top: 18px; margin-top: 36px; border-top: 1px solid var(--line); }
.article-body h2:first-child { margin-top: 0; }
/* Editorial touches: a large opening paragraph and a pull quote */
.article-body > p.lead { font-size: var(--fs-title); line-height: 1.4; letter-spacing: -.01em; }
.article-body blockquote {
  justify-self: center; max-width: 30ch; margin: clamp(24px, 4vw, 56px) 0; text-align: center;
  font-size: var(--fs-display); font-weight: 400; line-height: 1.08; letter-spacing: -.02em; text-transform: none; text-wrap: balance;
}
.article-body blockquote::before { content: "“"; }
.article-body blockquote::after { content: "”"; }
/* Images in an article run wider than the text */
.article-body figure.wide { width: 100%; max-width: 52rem; justify-self: center; }
.article-body figure.wide > img { width: 100%; max-height: 80vh; object-fit: contain; margin: 0 auto; }
.article-body .row { display: flex; gap: var(--pad); align-items: flex-start; margin: 0 auto; }
.article-body .row img { flex: 1 1 0; min-width: 0; width: 0; height: auto; }   /* widths follow each photo's shape, so the row lines up */
.article-body figure.wide figcaption { text-align: center; }
.article-body .video-frame { width: 100%; }
.article-links { max-width: 40rem; margin: clamp(40px, 6vw, 72px) auto 0; }
.article-end { max-width: 40rem; margin: 40px auto 0; }
.links { list-style: none; border-top: 1px solid var(--line); }
.links a, .links .plain-link { display: grid; grid-template-columns: 110px 1fr 20px; gap: var(--pad); padding: 14px 0; border-bottom: 1px solid var(--line); }
.links .kind, .links .by { color: var(--muted); }
.links .arrow { text-align: right; }

/* ── Footer ──────────────────────────────── */
.site-footer {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 16px;
  padding: 60px var(--pad) 18px;
}
.site-footer .right { display: flex; gap: 16px; flex-wrap: wrap; justify-content: flex-end; }

/* ── Tablet ──────────────────────────────── */
@media (max-width: 900px) {
  .article-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .year-block { grid-template-columns: 70px 1fr; }
}

/* ── Phone ───────────────────────────────── */
@media (max-width: 640px) {
  .about > div:empty { display: none; }
  .chapter { scroll-margin-top: 104px; }   /* the menu wraps to two lines on a phone */
  .about-figure { position: static; width: 100%; }
  .svc-toggle { grid-template-columns: minmax(0, 1fr) 24px; }
  .svc-body { padding-left: 0; }
  .site-header { flex-wrap: wrap; gap: 8px 16px; }
  .wordmark { white-space: nowrap; }
  .nav { justify-content: flex-start; gap: 6px 14px; }

  .hero, .work-top, .about, .wt-top, .contact-top, .page-head.two,
  .info-block, .clients, .service-list li { grid-template-columns: 1fr; }
  .hero, .work-top, .about { gap: 28px; }
  .wt-top, .contact-top, .page-head.two { gap: 28px; }
  .wt-top .services-title { margin-bottom: 0; }
  .info-block, .clients { gap: 12px; }
  .service-list li { gap: 8px; }
  .hero-figure { justify-self: start; width: 100%; }

  .year-block { grid-template-columns: 1fr; gap: 0; }
  .year { padding-bottom: 0; }
  .index a, .index .plain { display: block; }
  .index .yr { display: block; font-size: var(--fs-meta); margin-bottom: 2px; }
  .index .cat, .index .go { display: none !important; }

  .article-cards { grid-template-columns: 1fr; }
  .links a { grid-template-columns: 84px 1fr 16px; }
  .pager { font-size: var(--fs-meta); }
  .site-footer { flex-direction: column; align-items: flex-start; }
  .site-footer .right { justify-content: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  .fade, .article-card img { transition: none; }
}
