/* The frame every page shares: skip link, header, round link, footer.
   Loaded after the page's own stylesheets, on the homepage and on inner pages.
   It also holds the site's palette and the two fonts every page uses. */

@font-face {
  font-family: "Instrument Serif";
  src: url("/fonts/instrument-serif-latin.woff2") format("woff2");
  font-display: swap;
}
@font-face {
  font-family: "Heebo";
  src: url("/fonts/heebo-hebrew.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0590-05FF, U+200C-2010, U+20AA, U+FB1D-FB4F;
}

/* The palette and the display face of the whole site. */
:root {
  --ink: #18372c;
  --paper: #f4eee1;
  --clay: #ac552f;
  --display: "Instrument Serif", Georgia, serif;
  --mast-height: 72px;
  --nav-h: var(--mast-height);
  --frame-gutter: var(--gutter, var(--side, 24px));
}
html { scroll-padding-top: var(--mast-height); }

.skip {
  position: fixed;
  z-index: 20;
  inset-block-start: 12px;
  inset-inline-start: 14px;
  padding: 12px 18px;
  background: var(--ink);
  color: var(--paper);
  transform: translateY(-150%);
}
.skip:focus { transform: none; }

/* Header */
.masthead {
  position: sticky;
  z-index: 8;
  top: 0;
  min-height: var(--mast-height);
  background: var(--paper);
  border-bottom: 1px solid #18372c22;
}
.masthead-inner {
  /* One row less than the header: its bottom border is part of the height. */
  min-height: calc(var(--mast-height) - 1px);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  grid-template-areas: "nav brand contact";
  align-items: center;
  column-gap: clamp(12px, 2vw, 38px);
  padding-inline: var(--frame-gutter);
  font-size: 14px;
}
.masthead a { color: inherit; text-decoration: none; }
.mast-nav {
  grid-area: nav;
  display: flex;
  align-items: center;
  gap: clamp(11px, 1.45vw, 25px);
  white-space: nowrap;
}
.mast-nav a, .mast-contact { width: fit-content; }
.mast-nav a:hover, .mast-contact:hover { text-decoration: underline; text-underline-offset: 5px; }
.mast-nav a[aria-current] {
  text-decoration: underline;
  text-decoration-color: var(--clay);
  text-underline-offset: 5px;
}
.mast-contact {
  grid-area: contact;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: .7em;
  min-height: 44px;
}
.brand {
  grid-area: brand;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  font-family: var(--display);
  font-size: 34px;
  line-height: .9;
  letter-spacing: -.03em;
}
.brand img { width: 34px; height: 38px; object-fit: contain; }
.mast-toggle { display: none; }
.scroll-line {
  position: absolute;
  bottom: -1px;
  right: 0;
  width: 100%;
  height: 2px;
  background: var(--clay);
  transform-origin: right;
  transform: scaleX(var(--scroll-progress, 0));
  pointer-events: none;
}

/* Below this width five links no longer fit beside the name. Without scripts
   they sit in a second row; with scripts they open from the menu button. */
@media (max-width: 1000px) {
  .masthead-inner {
    grid-template-areas: "toggle brand contact" "nav nav nav";
    grid-template-rows: calc(var(--mast-height) - 1px) auto;
    column-gap: 12px;
    font-size: 13px;
  }
  .mast-nav {
    justify-content: space-between;
    gap: 6px;
    border-top: 1px solid #18372c22;
  }
  .mast-nav a { display: inline-flex; align-items: center; min-height: 44px; font-size: 15px; }
  .mast-toggle:not([hidden]) {
    grid-area: toggle;
    justify-self: start;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 44px;
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    cursor: pointer;
  }
  .mast-toggle i { display: block; width: 22px; height: 8px; border-block: 1px solid currentColor; transition: height .2s; }
  .mast-toggle[aria-expanded="true"] i { height: 1px; border-block-end-width: 0; }
  .mast-toggle:not([hidden]) ~ .mast-nav {
    position: absolute;
    inset: 100% 0 auto;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 6px var(--frame-gutter) 18px;
    background: var(--paper);
    border-bottom: 1px solid #18372c22;
    max-height: calc(100dvh - var(--mast-height));
    overflow-y: auto;
  }
  .mast-toggle[aria-expanded="true"] ~ .mast-nav { display: flex; }
  .mast-toggle:not([hidden]) ~ .mast-nav a {
    width: auto;
    min-height: 52px;
    font-size: 18px;
    border-bottom: 1px solid #18372c22;
  }
  .mast-toggle:not([hidden]) ~ .mast-nav a:last-child { border-bottom: 0; }
}
@media (max-width: 700px) {
  :root { --mast-height: 60px; }
  .masthead .brand { font-size: 29px; gap: 5px; }
  .brand img { width: 25px; height: 30px; }
  .mast-contact { gap: .25em; }
}
@media (max-width: 374px) {
  .masthead-inner { column-gap: 6px; }
  .masthead .brand { font-size: 25px; gap: 3px; }
  .brand img { width: 23px; height: 26px; }
  .mast-contact span { display: none; }
  .mast-toggle span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
}
@media (prefers-reduced-motion: no-preference) and (scripting: enabled) {
  .masthead { view-transition-name: studio-masthead; }
}

/* Link with a round arrow */
.text-link {
  display: inline-flex;
  gap: 15px;
  align-items: center;
  width: fit-content;
  font-size: 15px;
  font-weight: 600;
  color: inherit;
  text-decoration: none;
}
.text-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.circle {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 39px;
  height: 39px;
  border: 1px solid currentColor;
  border-radius: 50%;
  font: 400 18px/1 Arial, sans-serif;
}
@media (max-width: 700px) {
  .text-link { font-size: 14px; gap: 8px; }
  .circle { width: 35px; height: 35px; }
}

/* Footer */
.edition-contact {
  display: grid;
  align-items: center;
  grid-template-columns: minmax(0, 1fr) minmax(125px, .4fr);
  gap: clamp(16px, 4vw, 65px);
  background: #d8ac8b;
  color: var(--ink);
  padding: clamp(42px, 7vw, 105px) var(--frame-gutter) 25px;
}
.edition-contact a { color: inherit; }
.edition-contact h2 {
  margin: 0;
  font: 400 clamp(63px, 8vw, 124px)/.82 var(--display);
  letter-spacing: -.045em;
  text-align: right;
}
.edition-contact img { width: min(222px, 100%); height: auto; justify-self: end; mix-blend-mode: multiply; }
.edition-contact p { margin: 14px 0 24px; font-size: clamp(15px, 1.5vw, 20px); line-height: 1.55; }
.email-link { display: block; width: fit-content; font-size: 13px; margin-top: 14px; text-decoration: underline; text-underline-offset: 3px; }
/* Every family of the catalogue, one click from any page. */
.foot-catalog {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 22px clamp(14px, 2.5vw, 40px);
  margin-top: 10px;
  padding-top: 24px;
  border-top: 1px solid #18372c46;
  font-size: 14px;
  line-height: 1.4;
}
.foot-catalog h3 { margin: 0 0 8px; font: 600 13px/1.4 Heebo, Arial, sans-serif; letter-spacing: 0; }
.foot-catalog ul { margin: 0; padding: 0; list-style: none; }
.foot-catalog a { display: inline-block; padding-block: 5px; text-decoration: none; }
.foot-catalog a:hover { text-decoration: underline; text-underline-offset: 4px; }
.back-top {
  display: flex;
  gap: 20px;
  border-top: 1px solid #18372c46;
  padding-block: 14px 0;
  grid-column: 1 / -1;
  font-size: 13px;
  text-decoration: none;
}
.back-top:hover { text-decoration: underline; text-underline-offset: 5px; }
@media (max-width: 700px) {
  .edition-contact { grid-template-columns: 1fr minmax(75px, .33fr); align-items: start; }
  .foot-catalog { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .foot-catalog a { display: flex; align-items: center; min-height: 44px; padding-block: 0; }
  .edition-contact h2 { font-size: clamp(46px, 13.1vw, 78px); }
  .edition-contact img { align-self: center; }
}

/* On a phone every link in the frame is at least 44px tall. */
@media (max-width: 700px) {
  .text-link { min-height: 44px; }
  .email-link { margin-top: 2px; padding-block: 14px; }
  .back-top { align-items: center; min-height: 44px; padding-block: 6px 0; }
}

/* ===== the catalogue ring (homepage and /catalog/) ===== */
/* The ring is a scrolling row of prints until home-scenes.js turns it into a circle. */
.ring-chapter { background: #e6d9c2; overflow: clip; }
.ring-stage { --card: clamp(190px, 21vw, 290px); position: relative; margin-inline: calc(-1 * var(--frame-gutter)); outline-offset: -4px; }
.ring { display: flex; gap: 18px; margin: 0; padding: 6px var(--frame-gutter) 18px; list-style: none; overflow-x: auto; scroll-snap-type: x mandatory; direction: rtl; }
.ring-card { flex: none; width: var(--card); scroll-snap-align: center; }
.ring-card a { display: block; }
.ring-print { display: block; aspect-ratio: .8; padding: 9px; background: #fbf8f1; box-shadow: 0 1px 0 #18372c1f, 0 22px 34px -24px #132d2499; }
.ring-print img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ring-print.specimen { background: #efeadf; }
.ring-print.specimen img { object-fit: contain; mix-blend-mode: multiply; }
.ring-caption { display: grid; gap: 3px; padding: 13px 2px 0; text-align: center; direction: rtl; }
.ring-caption span { font: 400 clamp(21px, 2vw, 29px)/1 var(--display); letter-spacing: -.03em; }
.ring-caption strong { font-size: 14px; font-weight: 500; }
.ring-card a:hover strong { text-decoration: underline; text-underline-offset: 4px; }
.ring-controls { justify-content: center; margin-top: 18px; }

.is-ring {
  height: var(--ring-height);
  perspective: 1500px;
  perspective-origin: 50% 40%;
  touch-action: pan-y;
  cursor: grab;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 13%, #000 87%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 13%, #000 87%, transparent);
}
.is-ring.is-dragging { cursor: grabbing; }
.is-ring .ring {
  position: absolute;
  inset: 0;
  display: block;
  padding: 0;
  overflow: visible;
  direction: ltr;
  transform-style: preserve-3d;
  transform: translateZ(calc(-1 * var(--radius))) rotateY(var(--angle, 0deg));
  will-change: transform;
}
.is-ring .ring-card {
  position: absolute;
  top: 10px;
  left: 50%;
  margin-left: calc(var(--card) / -2);
  transform: rotateY(var(--turn)) translateZ(var(--radius));
  backface-visibility: hidden;
}
.is-ring .ring-card:not(.is-near) { pointer-events: none; }
.is-ring .ring-caption { opacity: calc(1 - var(--away, 0) * .34); transition: opacity .3s; }
.is-ring .ring-print { filter: brightness(calc(1 - var(--away, 0) * .045)); }


.catalog-ring { padding: clamp(40px, 6vw, 90px) var(--frame-gutter) clamp(30px, 4vw, 60px); background: #e6d9c2; }
.catalog-ring .chapter-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: clamp(20px, 3vw, 44px); }
.catalog-ring h2 { margin: 0; font: 400 clamp(56px, 8vw, 128px)/.84 var(--display); letter-spacing: -.045em; }
.catalog-ring .chapter-head p { margin: 14px 0 0; font-size: clamp(15px, 1.4vw, 19px); }
.ring-controls { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 18px; }
.ring-controls[hidden] { display: none; }
.ring-controls button, .cf-controls button { width: 44px; height: 44px; border: 1px solid currentColor; border-radius: 50%; background: transparent; color: inherit; font: 400 18px/1 Arial, sans-serif; cursor: pointer; }
.ring-controls button:hover, .cf-controls button:hover { background: #18372c10; }
.ring-controls output, .cf-controls output { min-width: 56px; text-align: center; font: 400 17px var(--display); letter-spacing: .05em; }

/* Arrows and the play mark stay plain type on iPhones (build.py also adds U+FE0E after them). */
body { font-variant-emoji: text; }

/* ===== the guide coverflow ===== */
.coverflow { position: relative; overflow-x: clip; }
.cf-stage { outline-offset: 6px; }
.cf-track { display: flex; gap: 18px; margin: 0; padding: 4px 0 14px; list-style: none; overflow-x: auto; scroll-snap-type: x mandatory; }
.cf-card { flex: none; width: min(80vw, 540px); scroll-snap-align: center; }
.cf-card a { display: grid; height: 100%; color: inherit; text-decoration: none; background: #fbf8f1; box-shadow: 0 1px 0 #18372c1a, 0 30px 50px -36px #132d24aa; }
.cf-photo { display: block; aspect-ratio: 16 / 10; overflow: hidden; background: #e6d8bd; }
.cf-photo img { width: 100%; height: 100%; display: block; object-fit: cover; transition: transform 1.2s cubic-bezier(.22,.76,.25,1); }
.cf-photo.specimen { background: #efeadf; }
.cf-photo.specimen img { object-fit: contain; padding: 20px; mix-blend-mode: multiply; }
.cf-copy { display: grid; align-content: start; gap: 8px; padding: 20px 22px 24px; text-align: right; }
.cf-topic { font-size: 12px; font-weight: 600; letter-spacing: .04em; color: var(--clay); }
.cf-copy :is(h2, h3) { margin: 0; font: 600 clamp(21px, 1.9vw, 30px)/1.18 Heebo, Arial, sans-serif; letter-spacing: 0; text-align: right; }
.cf-intro { font-size: 15px; line-height: 1.6; }
.cf-read { margin-top: 6px; font-size: 14px; font-weight: 600; }
.cf-card a:hover .cf-read { text-decoration: underline; text-underline-offset: 4px; }

.coverflow.is-flow .cf-stage { position: relative; height: var(--cf-height, 560px); perspective: 1700px; perspective-origin: 50% 40%; }
.coverflow.is-flow .cf-track { position: absolute; inset: 0; display: block; padding: 0; overflow: visible; transform-style: preserve-3d; }
.coverflow.is-flow .cf-card {
  --w: min(72vw, 520px);
  position: absolute;
  top: 0;
  left: 50%;
  width: var(--w);
  margin-left: calc(var(--w) / -2);
  transform: translateX(calc(var(--offset) * -64%)) translateZ(calc(var(--distance) * -220px)) rotateY(calc(var(--offset) * -36deg));
  opacity: calc(1 - var(--distance) * .26);
  filter: brightness(calc(1 - var(--distance) * .07));
  z-index: calc(10 - var(--distance));
  transition: transform var(--cf-step, var(--cf-pace, .8s)) cubic-bezier(.22,.76,.25,1), opacity .6s, filter .6s;
}
.coverflow.is-flow .cf-card.is-hidden { opacity: 0; pointer-events: none; }
/* The homepage deck moves faster, and opens with one lap at full speed (coverflow.js, data-sprint). */
.coverflow[data-sprint] { --cf-pace: .56s; }
.coverflow.is-sprinting .cf-card { transition: transform var(--cf-step) cubic-bezier(.3,.6,.35,1), opacity var(--cf-step), filter var(--cf-step); }
.coverflow.is-sprinting .cf-card:not(.is-current) { filter: brightness(calc(1 - var(--distance) * .07)) blur(2px); }
.coverflow.is-sprinting .cf-controls output { color: var(--clay); }
.coverflow.is-flow .cf-card:not(.is-current) a { cursor: pointer; }
.coverflow.is-flow .cf-card.is-current .cf-photo img { transform: scale(1.05); }
.cf-controls { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 22px; }
.cf-controls[hidden] { display: none; }
.cf-toggle span { font-size: 13px; }
.cf-progress { width: clamp(60px, 12vw, 140px); height: 2px; background: #18372c24; overflow: hidden; }
.cf-progress span { display: block; height: 100%; background: var(--clay); transform: scaleX(0); transform-origin: right; }
.coverflow[data-rolling] .cf-progress span { animation: cf-clock var(--cf-interval) linear both; }
@keyframes cf-clock { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@media (prefers-reduced-motion: reduce) {
  .coverflow.is-flow .cf-card, .cf-photo img { transition: none; }
}
