/* ══════════════════════════════════════════════════════════════════
   PART 3 of 3 — EDITORIALSITE

   Ordinary document flow after the sticky pin releases. It opens on the
   page ground (--ground) and closes on the atelier's night (--ink), the
   colour the PaperJourney began in.

   One typeface, one axis: a small label on the left, the content from
   the fifth column. Images are the project's own renders; everything
   else is type and space. Every selector is scoped to .editorial-site / .es-.
   ══════════════════════════════════════════════════════════════════ */

.editorial-site {
  --page-x: clamp(20px, 3.4vw, 64px);
  --section-y: clamp(104px, 13vw, 232px);
  --axis: 5 / -1;
  --ease: cubic-bezier(.2, .7, .1, 1);
  position: relative;
  background: var(--grain), var(--ground);
  color: var(--ink-text);
  font-family: var(--font-text);
  font-size: 17px;
  line-height: 1.6;
  font-weight: 400;
}
.editorial-site a:focus-visible,
.editorial-site button:focus-visible { outline: 1px solid currentColor; outline-offset: 4px; }
.editorial-site em {
  font-family: var(--font-italic);
  font-style: normal;
  font-size: .92em;
  letter-spacing: -.03em;
}

.es-wrap { max-width: 1760px; margin: 0 auto; padding: 0 var(--page-x); }
.es-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: clamp(16px, 1.8vw, 32px); }
.es-section { position: relative; padding: var(--section-y) 0; }

/* ── type ───────────────────────────────────────────────────────── */
.es-label { grid-column: 1 / span 4; margin: 0; font-size: 15px; font-weight: 400; line-height: 1.4; color: var(--ink-muted); }
.es-statement,
.es-title { margin: 0; font-family: var(--font-display); font-weight: 400; color: var(--ink-text); text-wrap: balance; }
.es-statement { margin-top: clamp(20px, 2.4vw, 40px); font-size: clamp(44px, 6.9vw, 124px); line-height: 1.02; letter-spacing: -.035em; }
.es-title { grid-column: var(--axis); font-size: clamp(36px, 4.7vw, 84px); line-height: 1.04; letter-spacing: -.03em; }
.es-lede { margin: 0; max-width: 25em; font-size: clamp(22px, 2.1vw, 34px); line-height: 1.28; letter-spacing: -.012em; color: var(--ink-text); }
.es-text { margin: clamp(24px, 2.4vw, 36px) 0 0; max-width: 34em; color: var(--ink-body); }
.es-intro { grid-column: 5 / span 6; margin: clamp(24px, 2.4vw, 36px) 0 0; max-width: 34em; color: var(--ink-body); }

/* an image cropped by its frame: focus and ratio are set per figure */
.es-crop {
  display: block;
  position: relative;
  margin: 0;
  overflow: hidden;
  aspect-ratio: var(--ratio, 16 / 9);
  background: var(--ground-deep);
}
.es-crop img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--fx, 50%) var(--fy, 50%);
  transition: transform 1.6s var(--ease);
}
.es-caption { display: flex; justify-content: space-between; gap: 24px; margin-top: 12px; font-size: 14px; line-height: 1.4; color: var(--ink-muted); }
.es-caption span:last-child { text-align: right; }

/* ── about ──────────────────────────────────────────────────────── */
.es-studio { padding-bottom: clamp(88px, 10vw, 176px); }
.es-studio__grid { margin-top: clamp(64px, 8vw, 152px); align-items: start; }
.es-studio__figure { grid-column: 1 / span 4; margin: 0 clamp(0px, 4vw, 72px) 0 0; }
.es-studio__text { grid-column: var(--axis); }
.es-principles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(24px, 2.4vw, 40px); margin: clamp(56px, 6vw, 104px) 0 0; padding: 0; list-style: none; }
.es-principles b { display: block; margin-bottom: 10px; font-weight: 500; }
.es-principles span { display: block; font-size: 15px; line-height: 1.55; color: var(--ink-body); }
.es-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(24px, 2.4vw, 40px); margin: clamp(40px, 4vw, 64px) 0 0; }
.es-facts dt { font-size: 15px; color: var(--ink-muted); }
.es-facts dd { margin: 4px 0 0; }

/* ── full-bleed render ──────────────────────────────────────────── */
.es-bleed { margin: 0; }
.es-bleed .es-crop { aspect-ratio: auto; height: min(100vh, 62vw); min-height: 420px; }

/* ── every project ──────────────────────────────────────────────── */
.es-work__label { grid-column: 1 / -1; margin-bottom: clamp(32px, 4vw, 64px); }
.es-work__list { grid-column: 1 / -1; margin: 0; padding: 0; list-style: none; }
.es-work__row { display: block; padding: 0 0 clamp(32px, 4vw, 48px); }
.es-work__thumb { margin-bottom: 14px; --ratio: 3 / 2; }
.es-work__name { display: block; font-family: var(--font-display); font-size: clamp(34px, 4.2vw, 76px); line-height: 1.04; letter-spacing: -.03em; }
.es-work__type { display: block; margin-top: 8px; font-size: 15px; line-height: 1.4; color: var(--ink-muted); }
.es-work__preview { display: none; }

/* A pointer can choose a project, so one frame shows the one it is on. */
@media (min-width: 901px) and (hover: hover) {
  .es-work__list { grid-column: 1 / span 7; }
  .es-work__thumb { display: none; }
  .es-work__row { padding: clamp(10px, 1vw, 16px) 0; transition: opacity .35s; }
  .es-work__list:hover .es-work__row:not(:hover) { opacity: .32; }
  .es-work__preview {
    display: block;
    grid-column: 8 / -1;
    grid-row: 2;
    position: sticky;
    top: 96px;
    align-self: start;
    overflow: hidden;
    aspect-ratio: 5 / 4;
    background: var(--ground-deep);
  }
  .es-work__preview img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity .5s var(--ease);
  }
  .es-work__preview img.is-active { opacity: 1; }
}

/* ── entries: experience, skills, education ─────────────────────── */
.es-career,
.es-services { grid-column: var(--axis); margin: clamp(64px, 7vw, 120px) 0 0; padding: 0; list-style: none; }
.es-entry { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); column-gap: clamp(16px, 1.8vw, 32px); padding: clamp(28px, 2.8vw, 44px) 0; border-top: 1px solid var(--hairline); }
.es-entry > :first-child { grid-column: 1 / span 3; }
.es-entry__body { grid-column: 4 / -1; }
.es-entry__date { margin: 0; font-size: 15px; line-height: 1.45; color: var(--ink-text); }
.es-entry__date span { display: block; margin-top: 4px; color: var(--ink-muted); }
.es-entry h3 { margin: 0; font-family: var(--font-display); font-size: clamp(22px, 1.9vw, 30px); font-weight: 400; line-height: 1.16; letter-spacing: -.015em; }
.es-entry__body h3 + p { margin-top: 12px; }
.es-entry__body p { margin: 16px 0 0; max-width: 36em; color: var(--ink-body); }
.es-entry__body > p:first-child { margin-top: 0; }
.es-entry__body .es-entry__role { margin-top: 8px; font-size: 15px; color: var(--ink-muted); }
.es-entry small { display: block; margin-top: 12px; font-size: 15px; line-height: 1.45; color: var(--ink-muted); }
.es-tags { display: flex; flex-wrap: wrap; margin: 16px 0 0; padding: 0; list-style: none; font-size: 15px; color: var(--ink-muted); }
.es-tags li:not(:last-child)::after { content: '·'; margin: 0 8px; }

/* ── two renders between the chapters ───────────────────────────── */
.es-pair { align-items: end; }
.es-pair figure { margin: 0; }
.es-pair__large { grid-column: 1 / span 8; }
.es-pair__small { grid-column: 10 / -1; }

/* ── inquiry ────────────────────────────────────────────────────── */
.es-inquiry { background: var(--ink); color: var(--paper); padding-bottom: clamp(88px, 10vw, 176px); }
.es-inquiry .es-label,
.es-inquiry .es-form__note { color: var(--muted); }
.es-inquiry .es-lede { color: var(--paper); }
.es-mail {
  display: block;
  width: fit-content;
  margin-top: clamp(20px, 2.4vw, 40px);
  font-family: var(--font-display);
  font-size: min(7.5vw, 124px);
  line-height: 1.1;
  letter-spacing: -.035em;
  text-decoration: underline transparent 1px;
  text-underline-offset: .12em;
  transition: text-decoration-color .3s;
}
.es-mail:hover { text-decoration-color: currentColor; }
.es-inquiry__grid { margin-top: clamp(72px, 9vw, 160px); align-items: start; }
.es-details { grid-column: 1 / span 4; margin: 0; }
.es-details div + div { margin-top: 24px; }
.es-details dt { font-size: 15px; color: var(--muted); }
.es-details dd { margin: 4px 0 0; max-width: 18em; color: var(--paper); }
.es-inquiry__form { grid-column: var(--axis); }

.es-form { display: grid; grid-template-columns: 1fr 1fr; gap: 32px clamp(16px, 1.8vw, 32px); max-width: 880px; margin-top: clamp(48px, 5vw, 80px); }
.es-field { display: flex; flex-direction: column; }
.es-field--wide { grid-column: 1 / -1; }
.es-field label { font-size: 15px; line-height: 1.4; color: var(--muted); }
.es-field input,
.es-field select,
.es-field textarea {
  width: 100%;
  padding: 8px 0 12px;
  font: inherit;
  color: var(--paper);
  background: transparent;
  border: 0;
  border-bottom: 1px solid #ffffff38;
  border-radius: 0;
  transition: border-color .3s;
  -webkit-appearance: none;
  appearance: none;
}
.es-field select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23b3afa2' stroke-width='1.2'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 2px center;
}
.es-field select option { color: var(--ink-text); background: var(--sheet); }
.es-field textarea { resize: vertical; }
.es-field input::placeholder, .es-field textarea::placeholder { color: var(--muted); }
.es-field input:focus, .es-field select:focus, .es-field textarea:focus { outline: none; border-color: var(--paper); }
.es-field input:user-invalid, .es-field textarea:user-invalid { border-color: #d7957f; }

.es-form__foot { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 16px 32px; }
.es-submit {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 15px 26px;
  font-size: 16px;
  color: var(--ink);
  background: var(--paper);
  transition: background-color .3s;
}
.es-submit:hover { background: #fff; }
.es-submit span { transition: transform .35s; }
.es-submit:hover span { transform: translateX(4px); }
.es-form__note { flex: 1 1 18em; margin: 0; max-width: 30em; font-size: 14px; line-height: 1.5; }
.es-form__status { grid-column: 1 / -1; margin: 0; min-height: 1.5em; font-size: 15px; line-height: 1.5; color: var(--paper); }
.es-form__status:empty { display: none; }

/* ── footer ─────────────────────────────────────────────────────── */
.es-footer { background: var(--ink); color: var(--paper); padding: 0 0 clamp(20px, 2vw, 32px); }
.es-footer .es-wrap { container-type: inline-size; }
.es-footer__top { padding-top: clamp(32px, 3vw, 48px); border-top: 1px solid var(--line); row-gap: 40px; }
.es-footer__place { grid-column: 1 / span 4; margin: 0; font-size: 15px; color: var(--muted); }
.es-footer__col { grid-column: span 3; }
.es-footer__col:nth-of-type(1) { grid-column: 5 / span 2; }
.es-footer__col:nth-of-type(2) { grid-column: 7 / span 3; }
.es-footer__col:nth-of-type(3) { grid-column: 10 / -1; }
.es-footer__col h2 { margin: 0 0 12px; font-size: 15px; font-weight: 400; color: var(--muted); }
.es-footer__col ul { margin: 0; padding: 0; list-style: none; }
.es-footer__col li { margin: 0 0 6px; font-size: 15px; overflow-wrap: anywhere; }
.es-footer__col a, .es-footer__col button { text-decoration: underline transparent 1px; text-underline-offset: .2em; transition: text-decoration-color .3s; }
.es-footer__col a:hover, .es-footer__col button:hover { text-decoration-color: currentColor; }
.es-footer__col button { font-size: 15px; text-align: left; }
.es-footer__mark {
  margin: clamp(72px, 9vw, 160px) 0 0;
  font-family: var(--font-display);
  font-size: 25.6cqw;
  line-height: 1;
  letter-spacing: -.045em;
  white-space: nowrap;
}
.es-footer__mark span { display: block; margin-left: -.03em; }
.es-footer__base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 24px; margin-top: clamp(16px, 2vw, 32px); font-size: 14px; color: var(--muted); }
.es-footer__base p { margin: 0; }

/* ── reveal on entry ────────────────────────────────────────────── */
.js .es-reveal {
  opacity: 0;
  transform: translate3d(0, 16px, 0);
  transition: opacity .9s var(--ease), transform 1.1s var(--ease);
  transition-delay: var(--delay, 0s);
}
.js .es-reveal.is-in { opacity: 1; transform: none; }
.js .es-reveal .es-crop img { transform: scale(1.04); }
.js .es-reveal.is-in .es-crop img { transform: none; }

/* ── portrait and small screens ─────────────────────────────────── */
@media (max-width: 900px) {
  .es-grid > * { grid-column: 1 / -1 !important; grid-row: auto !important; }
  .es-title { margin-top: 16px; }
  .es-studio__figure { margin-right: 0; }
  .es-studio__text { margin-top: 56px; }
  .es-principles { grid-template-columns: 1fr; gap: 28px; }
  .es-bleed .es-crop { height: auto; min-height: 0; aspect-ratio: 4 / 5; }
  .es-bleed .es-caption { padding-top: 0; }
  .es-pair__small { width: 62%; margin: 40px 0 0 auto; }
  .es-inquiry__form { margin-top: 56px; }
  .es-footer__col, .es-footer__col:nth-of-type(n) { grid-column: 1 / -1 !important; }
}
@media (max-width: 640px) {
  .es-entry { display: block; }
  .es-entry > :first-child { margin-bottom: 14px; }
  .es-form { grid-template-columns: 1fr; }
  .es-facts { grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .js .es-reveal { transform: none; transition: opacity .6s linear; }
  .es-crop img, .js .es-reveal .es-crop img { transition: none; transform: none; }
  .es-submit span, .es-work__row, .es-work__preview img { transition: none; }
}
