/* Jerich.io, the edition.
   Everything below the opening screen is set like a printed edition: the photography leads,
   type is quiet and exact, white space does the separating and nothing sits in a box. */

html body .ed {
  --ed-ink: #1A1917;
  --ed-ink-2: #4A4741;
  --ed-ink-3: #77726A;
  --ed-hair: rgba(26, 25, 23, .14);
  --ed-dpa: #2A4C9B;
  --ed-cre: #C7391F;
  --ed-ease: cubic-bezier(.2, .7, .1, 1);
  --ed-side: clamp(20px, 6vw, 112px);
  --ed-gap: clamp(16px, 2vw, 32px);
  --ed-space: clamp(110px, 12vw, 200px);
  color: var(--ed-ink);
  font-family: 'Familjen Grotesk', 'Inter', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
html body .ed *, html body .ed *::before, html body .ed *::after { box-sizing: border-box; }
html body .ed :is(h2, h3, p, figure, ol, dl, dd, dt) { margin: 0; padding: 0; }
html body .ed img { display: block; max-width: 100%; height: auto; }
html body .ed a { color: inherit; }
html body .ed :focus-visible { outline: 2px solid var(--ed-dpa); outline-offset: 4px; }

/* ---------- Type ---------- */
html body .ed .ed-h2 {
  font-family: inherit !important; font-weight: 400 !important; text-transform: none !important;
  font-size: clamp(34px, 3.7vw, 60px) !important; line-height: 1.04 !important; letter-spacing: -.028em !important;
  color: var(--ed-ink) !important; text-wrap: balance; max-width: 16ch;
}
html body .ed .ed-h3 {
  font-family: inherit !important; font-weight: 500 !important; text-transform: none !important;
  font-size: clamp(26px, 2.2vw, 34px) !important; line-height: 1.1 !important; letter-spacing: -.02em !important;
  color: var(--ed-ink) !important;
}
html body .ed .ed-lede {
  font-size: clamp(17px, 1.3vw, 20px) !important; line-height: 1.5 !important; color: var(--ed-ink-2) !important;
  max-width: 38ch; letter-spacing: -.004em; text-wrap: pretty;
}
html body .ed .ed-body { font-size: 17px !important; line-height: 1.5 !important; color: var(--ed-ink-2) !important; max-width: 34ch; text-wrap: pretty; }
html body .ed .ed-small { font-size: 14px !important; line-height: 1.5 !important; color: var(--ed-ink-3) !important; max-width: 34ch; }
html body .ed figcaption { display: flex; flex-direction: column; gap: 2px; margin-top: 14px; font-size: 14px; line-height: 1.35; }
html body .ed figcaption b { font-weight: 500; color: var(--ed-ink); }
html body .ed figcaption span { color: var(--ed-ink-3); }

/* ---------- Sections ---------- */
html body .ed .ed-sec { padding: var(--ed-space) var(--ed-side) 0; }
html body .ed .ed-head {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--ed-gap);
  align-items: end; margin-bottom: clamp(40px, 4.4vw, 72px);
}
html body .ed .ed-head .ed-h2 { grid-column: 1 / span 7; }
html body .ed .ed-head .ed-lede { grid-column: 9 / span 4; padding-bottom: .35em; }

/* One photograph, six frames: a contact sheet */
html body .ed .ed-strip {
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); column-gap: var(--ed-gap);
}
html body .ed .ed-shot .ed-img { overflow: hidden; background: rgba(26, 25, 23, .04); aspect-ratio: 4 / 5; }
html body .ed .ed-shot img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.4s var(--ed-ease); }
html body .ed .ed-shot:hover img { transform: scale(1.035); }
html body .ed .ed-shot:nth-child(even) { margin-top: clamp(28px, 4vw, 64px); }

/* Two tools: an asymmetric spread, the second page dropped below the first */
html body .ed .ed-pair {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--ed-gap);
}
html body .ed .ed-tool--dpa { grid-column: 1 / span 5; }
html body .ed .ed-tool--cre { grid-column: 8 / span 5; margin-top: clamp(120px, 14vw, 240px); }
html body .ed .ed-plate { display: block; overflow: hidden; aspect-ratio: 4 / 5; background: rgba(26, 25, 23, .05); }
html body .ed .ed-plate img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.6s var(--ed-ease); }
html body .ed .ed-tool:hover .ed-plate img { transform: scale(1.03); }
html body .ed .ed-tool-copy { display: grid; gap: 14px; margin-top: 28px; }
html body .ed .ed-steps { list-style: none; counter-reset: s; display: grid; gap: 8px; margin: 8px 0 6px !important; }
html body .ed .ed-steps li {
  counter-increment: s; display: grid; grid-template-columns: 22px 1fr; font-size: 15px; line-height: 1.45; color: var(--ed-ink-2);
}
html body .ed .ed-steps li::before { content: counter(s); color: var(--ed-ink-3); font-variant-numeric: tabular-nums; }

/* Text link with a drawn arrow and an underline that runs in */
html body .ed .ed-go {
  justify-self: start; display: inline-flex; align-items: center; gap: 12px; padding: 10px 0;
  font-size: 16px; font-weight: 500; text-decoration: none; position: relative; min-height: 44px;
}
html body .ed .ed-go::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 6px; height: 1px; background: currentColor;
  transform: scaleX(.18); transform-origin: left; transition: transform .6s var(--ed-ease);
}
html body .ed .ed-go:hover::after { transform: scaleX(1); }
html body .ed .ed-go i { width: 18px; height: 1px; background: currentColor; position: relative; transition: width .5s var(--ed-ease); }
html body .ed .ed-go i::after { content: ""; position: absolute; right: 0; top: -3px; width: 7px; height: 7px; border-top: 1px solid currentColor; border-right: 1px solid currentColor; transform: rotate(45deg); }
html body .ed .ed-go:hover i { width: 28px; }
html body .ed .ed-tool--dpa .ed-go { color: var(--ed-dpa); }
html body .ed .ed-tool--cre .ed-go { color: var(--ed-cre); }

/* Brand: the picture on the left, the offer set beside it */
html body .ed .ed-brand {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--ed-gap); align-items: center;
}
html body .ed .ed-brand-fig { grid-column: 2 / span 4; }
html body .ed .ed-brand-fig figcaption { color: var(--ed-ink-3); }
html body .ed .ed-brand-copy { grid-column: 7 / span 5; display: grid; gap: 22px; }
html body .ed .ed-terms { display: grid; margin-top: 10px !important; }
html body .ed .ed-terms > div {
  display: grid; grid-template-columns: minmax(120px, 1fr) 2fr; column-gap: 20px;
  padding: 14px 0; border-top: 1px solid var(--ed-hair);
}
html body .ed .ed-terms > div:last-child { border-bottom: 1px solid var(--ed-hair); }
html body .ed .ed-terms dt { font-size: 15px; font-weight: 500; }
html body .ed .ed-terms dd { font-size: 15px; line-height: 1.45; color: var(--ed-ink-2); }
html body .ed .ed-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; margin-top: 8px; font-size: 15px; color: var(--ed-ink-3); }
html body .ed .ed-cta span a { color: var(--ed-ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
html body .ed .ed-btn {
  display: inline-flex; align-items: center; min-height: 48px; padding: 0 24px;
  background: var(--ed-ink); color: #F3F0E9 !important; text-decoration: none; font-size: 15px; font-weight: 500;
  transition: background .3s var(--ed-ease);
}
html body .ed .ed-btn:hover { background: var(--ed-dpa); }

/* Retouching and colour */
html body .ed .ed-finish-grid {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--ed-gap); align-items: end;
}
html body .ed .ed-portrait { grid-column: 1 / span 7; }
html body .ed .ed-filters { grid-column: 9 / span 4; display: grid; gap: 18px; }
html body .ed .ed-finish .wipe-box { aspect-ratio: 1 / 1; width: 100%; }
html body .ed .ed-finish .filter-base { transition: opacity .25s ease; }
html body .ed .ed-looks { display: flex; gap: 22px; }
html body .ed .ed-looks button {
  all: unset; cursor: pointer; padding: 10px 0; min-height: 24px; font-size: 15px; color: var(--ed-ink-3);
  box-shadow: inset 0 -1px 0 transparent; transition: color .25s, box-shadow .25s;
}
html body .ed .ed-looks button:hover { color: var(--ed-ink); }
html body .ed .ed-looks button[aria-selected="true"] { color: var(--ed-ink); box-shadow: inset 0 -1px 0 var(--ed-ink); }
html body .ed .ed-looks button:focus-visible { outline: 2px solid var(--ed-dpa); outline-offset: 2px; }

/* Footer: the name set across the full measure */
html body .ed .ed-foot { padding: var(--ed-space) var(--ed-side) 28px; margin-top: var(--ed-space); border-top: 1px solid var(--ed-hair); padding-top: clamp(48px, 5vw, 80px); }
html body .ed .ed-foot-top { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--ed-gap); align-items: start; }
html body .ed .ed-foot-line { grid-column: 1 / span 4; font-size: 17px; line-height: 1.45; color: var(--ed-ink-2); max-width: 24ch; }
html body .ed .ed-foot-nav { grid-column: 7 / span 6; display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--ed-gap); }
html body .ed .ed-foot-nav div { display: grid; gap: 4px; align-content: start; }
html body .ed .ed-foot-nav a { font-size: 15px; text-decoration: none; padding: 4px 0; color: var(--ed-ink-2); transition: color .2s; justify-self: start; }
html body .ed .ed-foot-nav a:hover { color: var(--ed-ink); text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
html body .ed .ed-foot-word {
  margin-top: clamp(60px, 7vw, 120px) !important; font-weight: 500; font-size: clamp(64px, 16.6vw, 280px);
  line-height: .8; letter-spacing: -.055em; color: var(--ed-ink); white-space: nowrap; margin-left: -.04em !important;
}
html body .ed .ed-foot-legal { margin-top: 28px !important; font-size: 13px; color: var(--ed-ink-3); }

/* ---------- Motion ---------- */
html.ed-motion body .ed .ed-rise { opacity: 0; transform: translateY(22px); transition: opacity 1s var(--ed-ease) var(--d, 0s), transform 1.2s var(--ed-ease) var(--d, 0s); }
html.ed-motion body .ed .ed-rise.is-in { opacity: 1; transform: none; }
html.ed-motion body .ed .ed-shot.ed-rise:nth-child(even) { transform: translateY(40px); }
html.ed-motion body .ed .ed-shot.ed-rise.is-in { transform: none; }
@media (prefers-reduced-motion: reduce) {
  html body .ed * { transition: none !important; }
}

/* ---------- Narrow screens ---------- */
@media (max-width: 1000px) {
  html body .ed .ed-head .ed-h2 { grid-column: 1 / -1; }
  html body .ed .ed-head .ed-lede { grid-column: 1 / span 9; margin-top: 18px; }
  html body .ed .ed-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 40px; }
  html body .ed .ed-shot:nth-child(even) { margin-top: 0; }
  html body .ed .ed-shot:nth-child(3n+2) { margin-top: 40px; }
  html body .ed .ed-tool--dpa { grid-column: 1 / span 6; }
  html body .ed .ed-tool--cre { grid-column: 7 / span 6; }
  html body .ed .ed-brand-fig { grid-column: 1 / span 5; }
  html body .ed .ed-brand-copy { grid-column: 7 / span 6; }
  html body .ed .ed-portrait { grid-column: 1 / span 7; }
  html body .ed .ed-filters { grid-column: 8 / span 5; }
  html body .ed .ed-foot-line { grid-column: 1 / -1; margin-bottom: 32px !important; }
  html body .ed .ed-foot-nav { grid-column: 1 / -1; }
}
@media (max-width: 680px) {
  html body .ed { --ed-side: 20px; --ed-space: 88px; --ed-gap: 14px; }
  html body .ed .ed-h2 { font-size: 32px !important; max-width: none; }
  html body .ed .ed-head { margin-bottom: 28px; }
  html body .ed .ed-head .ed-lede { grid-column: 1 / -1; font-size: 16px !important; }
  /* the contact sheet becomes a strip you thumb through */
  html body .ed .ed-strip {
    display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
    margin: 0 calc(-1 * var(--ed-side)); padding: 0 var(--ed-side) 4px; scroll-padding: 0 var(--ed-side);
  }
  html body .ed .ed-strip::-webkit-scrollbar { display: none; }
  html body .ed .ed-shot { flex: 0 0 52vw; scroll-snap-align: start; margin-top: 0 !important; }
  html.ed-motion body .ed .ed-shot.ed-rise:nth-child(even) { transform: translateY(22px); }
  html body .ed figcaption { font-size: 13px; }
  html body .ed .ed-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
  html body .ed .ed-tool--dpa, html body .ed .ed-tool--cre { grid-column: auto; margin-top: 0; }
  html body .ed .ed-tool-copy { margin-top: 16px; gap: 8px; }
  html body .ed .ed-h3 { font-size: 21px !important; }
  html body .ed .ed-body { font-size: 14px !important; }
  html body .ed .ed-steps { display: none; }
  html body .ed .ed-go { font-size: 14px; gap: 8px; }
  html body .ed .ed-brand { display: block; }
  html body .ed .ed-brand-fig { width: 56%; margin-bottom: 32px !important; }
  html body .ed .ed-brand-copy { gap: 16px; }
  html body .ed .ed-terms dd { display: none; }
  html body .ed .ed-terms > div { padding: 11px 0; }
  html body .ed .ed-finish-grid { display: block; }
  html body .ed .ed-portrait { width: 100%; }
  html body .ed .ed-filters { display: none; }
  html body .ed .ed-foot { margin-top: 88px; }
  html body .ed .ed-foot-nav { grid-template-columns: 1fr 1fr; row-gap: 18px; }
  html body .ed .ed-foot-word { font-size: 24vw; }
}

/* ---------- Opening screen, refined ---------- */
html body .statement .index-links a.jb, html body .statement .index-links a.jb:hover { box-shadow: none !important; filter: none !important; }
html body .statement .hero-sub { color: #4A4741 !important; }

/* Footer word is fitted to the measure by script; this is the fallback */
html body .ed .ed-foot { margin-top: clamp(96px, 9vw, 150px); }
html body .ed .ed-foot-word { font-size: 24.5vw; display: inline-block; }
html body .ed .ed-foot-word { line-height: .96 !important; }
html body .ed .ed-foot-legal { margin-top: 20px !important; }
html:not(#_e1):not(#_e2):not(#_e3):not(#_e4):not(#_e5):not(#_e6) body .index-links a.jb, html:not(#_e1):not(#_e2):not(#_e3):not(#_e4):not(#_e5):not(#_e6) body .index-links a.jb:hover, html:not(#_e1):not(#_e2):not(#_e3):not(#_e4):not(#_e5):not(#_e6) body .index-links a.jb * { box-shadow: none !important; filter: none !important; }

/* Retouch shown smaller, beside the filters */
html body .ed .ed-portrait { grid-column: 1 / span 5; }
html body .ed .ed-filters { grid-column: 7 / span 4; }
@media (max-width: 1000px) { html body .ed .ed-portrait { grid-column: 1 / span 6; } html body .ed .ed-filters { grid-column: 7 / span 6; } }
@media (max-width: 680px) { html body .ed .ed-portrait { width: 78%; } }

/* The opening name set like the closing one: heavier and tighter */
html:not(#_e1):not(#_e2):not(#_e3) body .statement .tagline .tl-a {
  font-weight: 500 !important; letter-spacing: -.058em !important; font-size: clamp(120px, 13.4vw, 214px) !important;
  line-height: .9 !important; color: #1A1917 !important; margin-left: -.04em;
}
@media (max-width: 760px) {
  html:not(#_e1):not(#_e2):not(#_e3) body .statement .tagline .tl-a { font-size: 23.5vw !important; }
}

/* Opening text block nudged left on wide screens */
@media (min-width: 761px) {
  html:not(#_e1):not(#_e2):not(#_e3) body .statement .tagline,
  html:not(#_e1):not(#_e2):not(#_e3) body .statement .hero-sub,
  html:not(#_e1):not(#_e2):not(#_e3) body .statement .index-links { translate: -56px 0 !important; }
}

/* Creative button: the page colour with a dark ink line */
html:not(#_e1):not(#_e2):not(#_e3):not(#_e4):not(#_e5):not(#_e6):not(#_e7) body .statement .index-links a.jb[href="creative.html"] {
  background: #F3F0E9 !important; border: 1.5px solid #1A1917 !important; color: #1A1917 !important;
}
html:not(#_e1):not(#_e2):not(#_e3):not(#_e4):not(#_e5):not(#_e6):not(#_e7) body .statement .index-links a.jb[href="creative.html"] :is(.nm, .jb-roll, .jb-t) { color: #1A1917 !important; }
html:not(#_e1):not(#_e2):not(#_e3):not(#_e4):not(#_e5):not(#_e6):not(#_e7) body .statement .index-links a.jb[href="creative.html"]:hover :is(.nm, .jb-roll, .jb-t) { color: #F3F0E9 !important; }

/* Opening demo: frames swap instantly, no transition */
html:not(#_e1):not(#_e2):not(#_e3):not(#_e4) body .statement .demo-img { opacity: 0 !important; transition: none !important; clip-path: none !important; translate: none !important; scale: none !important; rotate: none !important; filter: none !important; }
html:not(#_e1):not(#_e2):not(#_e3):not(#_e4) body .statement .demo-img.is-on { opacity: 1 !important; }
@media (min-width: 861px) and (prefers-reduced-motion: no-preference) {
  html:not(#_e1):not(#_e2):not(#_e3):not(#_e4) body .statement .demo-stage > .demo-cursor {
    display: block !important; position: absolute !important; left: 0 !important; top: 0 !important;
    width: 14px !important; height: 14px !important; margin: -7px 0 0 -7px !important; z-index: 6 !important; filter: none !important;
  }
}
@media (min-width: 861px) {
  /* keep the moving cursor from counting towards the opening screen's height */
  html:not(#_e1):not(#_e2):not(#_e3):not(#_e4) body .statement .demo-stage { overflow: clip !important; overflow-clip-margin: 40px; }
}

/* the demo cursor is the logo dot; it dips slightly as it clicks */
html body .statement .demo-cursor circle { transform-origin: 7px 7px; transition: transform .14s ease; }
html body .statement .demo-stage.is-pressing .demo-cursor circle { transform: scale(.72); }
html body .statement .demo-click-ring { border-color: rgba(199,57,31,.7) !important; }
html body .statement .demo-click-ring::after { background: rgba(199,57,31,.3) !important; }
