/* Licensed web fonts: drop these files into /fonts and they take over from the fallbacks */
@font-face { font-family: "Neue Haas Grotesk Text"; src: url("../fonts/NeueHaasGroteskText-Roman.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Everson Mono"; src: url("../fonts/EversonMono.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }

/* ------------------------------------------------------------
   Emma Piercy — site styles, built from the 2026 Portfolio Figma file
------------------------------------------------------------ */

@font-face {
  font-family: "Ceraph";
  src: url("../fonts/Ceraph-Regular.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Ceraph";
  src: url("../fonts/Ceraph-Italic.woff2") format("woff2");
  font-weight: 400; font-style: italic; font-display: swap;
}

:root {
  --paper: #ffffff;
  --ink: #090909;
  --rule: #c9c6c0;
  --rule-strong: #353535;
  --night: #000000;
  --night-ink: #dcdcd8;

  /* Neue Haas Grotesk Text needs a web licence; Helvetica Neue stands in until then */
  --grotesk: "Neue Haas Grotesk Text", "Haas Grot Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --label: "Neue Haas Grotesk Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --ceraph: "Ceraph", "Times New Roman", Times, serif;

  --gutter: 28px;
  --reading: 16.5px;
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--grotesk);
  font-size: var(--reading);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body.night { background: var(--night); color: var(--night-ink); }

a { color: inherit; text-decoration: none; }
:focus-visible { outline: 1px solid currentColor; outline-offset: 3px; }

p { margin: 0; }

/* ---------- Navigation ---------- */

.site-header {
  position: relative;
  z-index: 10;
  height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--gutter);
  text-transform: uppercase;
}

.identity { font-size: 12px; }

.menu { display: flex; gap: 30px; font-size: 12px; align-items: center; }

.dropdown { position: relative; }

.menu-button {
  appearance: none; border: 0; background: none; padding: 0;
  font: inherit; color: inherit; text-transform: inherit; cursor: pointer;
}

.dropdown-list {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  min-width: 170px;
  text-align: right;
  display: none;
  gap: 6px;
}

.dropdown-list:not([hidden]) { display: grid; }

.dropdown:hover .dropdown-list,
.dropdown:focus-within .dropdown-list { display: grid; }

/* invisible bridge so the menu stays open while the pointer moves down to it */
.dropdown-list::before { content: ""; position: absolute; left: 0; right: 0; top: -12px; height: 12px; }

.dropdown-divider {
  margin-top: 8px;
  font-size: 10px;
  opacity: 0.55;
}


:root { --mono: "Everson Mono", "Courier New", Courier, monospace; --frame-w: 1440; --frame-h: 960; }
[hidden] { display: none !important; }
.identity { font-size: 12px; }

/* ---------- Home: images sit centred on the screen, behind both menus ---------- */

body.home { height: 100vh; height: 100svh; overflow: hidden; }

.stage { position: fixed; inset: 0; z-index: 0; cursor: pointer; }
.slide {
  position: absolute; inset: 0; margin: 0; display: grid; place-items: center;
  opacity: 0; pointer-events: none;
}
.slide.is-active { opacity: 1; pointer-events: auto; }
.slide img {
  display: block; width: auto; object-fit: contain;
  height: calc(var(--h) / var(--frame-h) * 100vh);
  max-width: calc(var(--w) / var(--frame-w) * 100vw);
}

/* Menus stay above the image. carousel.js checks what sits under each line of lettering
   and sets it black or white, whichever stands out more. */
body.home .site-header, .projects { z-index: 5; }
body.home .site-header .tone, body.home .projects .tone {
  color: transparent; -webkit-background-clip: text; background-clip: text;
  background-image: linear-gradient(to right,
    var(--ink) var(--a, 0px), var(--c, var(--ink)) var(--a, 0px),
    var(--c, var(--ink)) var(--b, 0px), var(--ink) var(--b, 0px));
}
.tone:focus-visible { outline-color: var(--ink); }
body.home .site-header { pointer-events: none; }
body.home .site-header a, body.home .site-header button, body.home .dropdown-list { pointer-events: auto; }

.projects {
  position: fixed; left: var(--gutter); top: max(98px, calc(17.2vh - 20px));
  font-size: 12px; line-height: 22px; pointer-events: none;
}
.projects h2, .projects h3 { margin: 0; font: inherit; text-transform: uppercase; }
.projects h2 { margin-bottom: 10px; }
.projects h3 { margin-top: 12px; padding-left: 14px; }
.projects h2 + h3 { margin-top: 0; }
.projects ul { list-style: none; margin: 0; padding: 0 0 0 14px; }
.projects button, .projects a {
  appearance: none; border: 0; background: none; padding: 0; margin: 0;
  font: inherit; color: inherit; cursor: pointer; text-align: left; pointer-events: auto; text-decoration: none;
}

.projects-toggle { text-transform: inherit; cursor: default; }

/* Phones: the list folds away under its heading so the image stays clear */
@media (max-width: 600px) {
  .projects { top: 84px; }
  .projects h2 { margin-bottom: 0; }
  .projects-toggle { cursor: pointer; padding-right: 14px; }
  .projects-toggle::after { content: " +"; }
  .projects.is-open .projects-toggle::after { content: " \2212"; }
  .projects-list { display: none; padding-top: 10px; }
  .projects.is-open .tone { --c: var(--ink) !important; }
  .projects.is-open { background: var(--paper); left: 0; padding: 0 28px 20px var(--gutter); }
  .projects.is-open .projects-list { display: block; }
}
@media (max-width: 800px) {
  .slide img { height: auto; max-height: 70vh; max-width: calc(100vw - 2 * var(--gutter)); }
}
@media (prefers-reduced-motion: reduce) { .slide { transition: none; } }

/* ---------- Info ---------- */

.info {
  display: grid; grid-template-columns: 342px minmax(0, 1fr);
  padding: 40px var(--gutter) 120px; align-items: start;
}
.info-side { font-size: 12px; line-height: 18px; }
.info-side h2 { font-size: 12px; line-height: 17px; font-weight: 400; text-transform: uppercase; margin: 0 0 12px; }
.info-side ul { list-style: none; margin: 0 0 46px; padding: 0; }
.info-text { grid-column: 2; max-width: 600px; font-size: 17px; line-height: 25px; }
.info-block { margin-top: 56px; max-width: 485px; }
.info-block:first-child { margin-top: 0; }
.info-bio { max-width: 600px; }
.info-block h2 { font-size: 12px; line-height: 17px; font-weight: 400; text-transform: uppercase; margin: 0 0 12px; }
.info-block p + p, #bio-more p { margin-top: 25px; }
.text-link {
  appearance: none; border: 0; background: none; padding: 0; cursor: pointer; color: inherit;
  display: inline-block; margin-top: 16px;
  font-family: var(--mono); font-size: 13px; line-height: 20px;
}
@media (max-width: 900px) {
  .side-break { display: none; }
  .info { grid-template-columns: 1fr; padding-top: 24px; }
  .info-text { grid-column: 1; grid-row: 1; }
  .info-side { grid-row: 2; margin-top: 64px; }
}

/* ---------- Typeface pages ---------- */

.typeface {
  width: min(1180px, 100% - 2 * var(--gutter)); margin: 0 auto; padding-bottom: 120px;
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 44px;
}
.tf-title {
  margin: 0; padding: 150px 0 126px; text-align: center; font-weight: 400;
  font-size: clamp(64px, 8.2vw, 118px); line-height: 1;
}
.tf-title.ceraph { font-family: var(--ceraph); }
.tf-title .plate { margin: 0 auto; }

.tester { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; min-width: 0; }

/* One control bar, reused everywhere. A block only carries the controls it needs. */
.tf-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 30px;
  padding-bottom: 9px; border-bottom: 1px solid var(--rule);
  font-family: var(--label); font-size: 10px; line-height: 14px; text-transform: uppercase;
}
body.night .tf-bar { border-color: rgba(220, 220, 216, 0.55); }
.tf-menu summary {
  appearance: none; -webkit-appearance: none; border: 0; background: none; margin: 0;
  font: inherit; color: inherit; text-transform: inherit; cursor: pointer; list-style: none;
  padding: 0 11px 0 0;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: right 3px center, right 0 center; background-size: 3px 3px, 3px 3px; background-repeat: no-repeat;
}
.tf-menu summary::-webkit-details-marker { display: none; }
.tf-menu { position: relative; }
.tf-pop {
  position: absolute; z-index: 20; top: calc(100% + 10px); left: -12px; min-width: 190px;
  display: grid; gap: 8px; padding: 12px; background: var(--paper); border: 1px solid var(--ink);
}
.tf-pop label { display: flex; gap: 8px; align-items: center; cursor: pointer; white-space: nowrap; }
.tf-pop input { margin: 0; accent-color: var(--ink); }
.tf-style .tf-pop { min-width: 110px; }
body.night .tf-size input::-webkit-slider-runnable-track { background: rgba(220, 220, 216, 0.55); }
body.night .tf-size input::-moz-range-track { background: rgba(220, 220, 216, 0.55); }
.tf-size { display: flex; gap: 10px; align-items: center; }
.tf-size input {
  -webkit-appearance: none; appearance: none; background: transparent; color: inherit;
  width: 96px; height: 13px; margin: 0; cursor: pointer;
}
.tf-size input::-webkit-slider-runnable-track { height: 1px; background: var(--rule); }
.tf-size input::-webkit-slider-thumb {
  -webkit-appearance: none; width: 7px; height: 7px; border-radius: 50%;
  background: currentColor; margin-top: -3px;
}
.tf-size input::-moz-range-track { height: 1px; background: var(--rule); }
.tf-size input::-moz-range-thumb { width: 7px; height: 7px; border: 0; border-radius: 50%; background: currentColor; }
.tf-px { min-width: 44px; font-variant-numeric: tabular-nums; }

.specimen {
  font-family: var(--ceraph);
  font-size: clamp(calc(var(--m) * 1px), calc(var(--s) / 1440 * 100vw), calc(var(--s) * 1px));
  line-height: 1.3; outline: none; overflow-wrap: break-word; min-width: 0;
  cursor: text; caret-color: currentColor;
}
.tester.is-italic .specimen { font-style: italic; }
.specimen.caps { text-transform: uppercase; }
.specimen.tight { line-height: 1.08; }
.specimen.caps.tight { line-height: 1; padding: 0.12em 0; }
.specimen.justify { text-align: justify; line-height: 0.96; padding-top: 0.3em; }
.specimen.right { text-align: right; }
.specimen.text { line-height: 1.31; }
.cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 36px; padding-top: 14px; }

.tf-about { padding: 56px 0 44px; text-align: center; display: grid; justify-items: center; }
.tf-about p { max-width: 690px; font-size: 17px; line-height: 24px; }
.tf-meta { list-style: none; margin: 36px 0 0; padding: 0; font-family: var(--mono); font-size: 13px; line-height: 20px; }
.tf-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 11px; margin-top: 40px; }
.tf-actions a { font-family: var(--mono); font-size: 13px; line-height: 1; padding: 11px 20px; border: 1px solid currentColor; }

.in-use { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 36px; align-items: end; padding: 110px 0 60px; }
.in-use figure { margin: 0; display: grid; justify-items: center; gap: 56px; }
.in-use img { display: block; height: auto; max-width: 100%; }
.in-use figcaption { font-size: 16px; line-height: 22px; text-align: center; }

.commission { margin-top: 76px; padding-top: 16px; border-top: 1px solid var(--rule); width: 50%; display: grid; gap: 14px; justify-items: start; }
body.night .commission { border-color: rgba(220, 220, 216, 0.55); }
.commission h2 { margin: 0; font-size: 28px; line-height: 36px; font-weight: 400; }
.small-link { font-family: var(--label); font-size: 11px; }

.site-footer { display: none; justify-content: space-between; gap: 16px; font-size: 11px; padding-top: 40px; }

/* Daturne: specimens are images, so the unreleased font never ships */
.plate { display: block; width: var(--pw); max-width: 100%; height: auto; }
.plate-box { display: grid; justify-items: center; padding: var(--pt, 60px) 0 var(--pb, 70px); }
.wip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; padding-top: 16px; }
.ph { aspect-ratio: 383 / 340; background: #d9d9d9; color: #6a6a6a; display: grid; place-items: center; font-size: 10px; text-transform: uppercase; }
.ph-wide { grid-column: 1 / -1; aspect-ratio: 1180 / 540; margin-bottom: 40px; }

@media (max-width: 700px) {
  :root { --gutter: 20px; }
  .menu { gap: 20px; }
  .typeface { gap: 32px; padding-bottom: 48px; }
  .tf-title { padding: 80px 0 70px; }
  .tf-title .plate { width: 62%; }
  .tf-bar { gap: 6px 20px; }
  .cols, .in-use { grid-template-columns: minmax(0, 1fr); }
  .in-use { padding: 56px 0 24px; gap: 56px; }
  .in-use figure { gap: 24px; }
  .specimen.justify { text-align: left; }
  .tf-about { padding: 28px 0 20px; }
  .tf-about p { font-size: 15px; line-height: 21px; }
  .plate-box { padding: 36px 0 40px; }
  .commission { width: 100%; margin-top: 40px; }
  .commission h2 { font-size: 20px; line-height: 26px; }
  .wip { grid-template-columns: minmax(0, 1fr); }
  .ph-wide { margin-bottom: 0; }
  .site-footer { display: flex; }
}

/* Info: subscribe opens an email field in place */
.subscribe-form { display: flex; align-items: baseline; gap: 16px; margin-top: 16px; max-width: 420px; }
.subscribe-form input {
  flex: 1; min-width: 0; padding: 4px 0; border: 0; border-bottom: 0.5px solid var(--ink); border-radius: 0;
  background: transparent; color: var(--ink); font-family: var(--mono); font-size: 13px; line-height: 20px;
}
.subscribe-form input:focus { outline: none; }
.subscribe-form button { margin-top: 0; }
.subscribe-note { font-family: var(--mono); font-size: 13px; line-height: 20px; margin-top: 16px; }

/* Selected logos and artwork pages */
.gallery-page { width: min(1180px, 100% - 2 * var(--gutter)); margin: 0 auto; padding: 120px 0 120px; }
.gallery-page h1 { margin: 0 0 12px; font-size: 12px; font-weight: 400; text-transform: uppercase; }
.gallery-page .lede { max-width: 600px; font-size: 17px; line-height: 25px; margin-bottom: 64px; }
.logo-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.logo-grid figure { margin: 0; display: grid; gap: 10px; }
.logo-tile { aspect-ratio: 1; background: #f2f2f2; display: grid; place-items: center; overflow: hidden; }
.logo-tile img { max-width: 62%; max-height: 62%; object-fit: contain; }
.logo-tile.empty { color: #8a8a8a; font-size: 10px; text-transform: uppercase; }
.logo-grid figcaption { font-size: 12px; line-height: 17px; }
.logo-grid figcaption span { display: block; color: #6b6b6b; }
.art-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 36px; align-items: start; }
.art-grid figure { margin: 0; display: grid; gap: 12px; }
.art-grid img { width: 100%; height: auto; display: block; }
.art-grid figcaption { font-size: 12px; line-height: 17px; }
@media (max-width: 700px) {
  .gallery-page { padding-top: 56px; }
  .logo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .art-grid { grid-template-columns: minmax(0, 1fr); }
}
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.link-row { display: flex; gap: 24px; }

/* Letter Noirs: thumbnails on black, click to enlarge */
.noirs { width: min(1180px, 100% - 2 * var(--gutter)); margin: 0 auto; padding: 120px 0 120px; }
.noir-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 48px 24px; }
.noir-grid li { display: grid; gap: 14px; min-width: 0; }
.noir-thumb { appearance: none; border: 0; padding: 0; background: none; cursor: zoom-in; display: block; }
.noir-thumb img { display: block; width: 100%; height: auto; }
.noir-grid p { font-size: 12px; line-height: 17px; }
.lightbox {
  position: fixed; inset: 0; z-index: 50; background: var(--paper); color: var(--ink);
  display: grid; grid-template-columns: 80px minmax(0, 1fr) 80px; align-items: center; padding: 56px 0 32px;
}
.lightbox figure { margin: 0; display: grid; justify-items: center; gap: 16px; min-width: 0; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 140px); width: auto; height: auto; display: block; }
.lightbox figcaption { font-size: 12px; line-height: 17px; }
.lightbox button {
  appearance: none; border: 0; background: none; color: inherit; cursor: pointer;
  font: inherit; font-size: 12px; text-transform: uppercase; padding: 12px;
}
.lb-close { position: absolute; top: 22px; right: calc(var(--gutter) - 12px); }
@media (max-width: 700px) {
  .noirs { padding-top: 56px; }
  .noir-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 16px; }
  .lightbox { grid-template-columns: 1fr 1fr; grid-template-rows: minmax(0, 1fr) auto; padding: 64px var(--gutter) 24px; }
  .lightbox figure { grid-column: 1 / -1; grid-row: 1; }
  .lb-prev { grid-row: 2; justify-self: start; }
  .lb-next { grid-row: 2; justify-self: end; }
}
