.field-notes {
  --field-ink: #070807;
  --field-paper: #d3cec4;
  --field-white: #f1eee7;
  --field-line: rgba(238, 235, 226, 0.46);
  --field-sans: "Helvetica Neue", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  --field-serif: "Yu Mincho", "Hiragino Mincho ProN", "HGS明朝E", serif;
  position: relative;
  z-index: 4;
  height: 430vh;
  min-height: 3000px;
  color: var(--field-white);
  background:
    linear-gradient(rgba(7,8,7,.72), rgba(7,8,7,.84)),
    url('/assets/gimmicks/field-notes/editorial-ledger.webp') center / cover no-repeat,
    var(--field-ink);
  isolation: isolate;
}

.field-notes *,
.field-notes *::before,
.field-notes *::after { box-sizing: border-box; }

.field-notes button { color: inherit; }

.field-notes__sticky {
  position: sticky;
  top: 0;
  width: 100%;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  color: var(--field-white);
  background: var(--field-ink);
  font-family: var(--field-serif);
  touch-action: pan-y;
}

.field-notes__scene,
.field-notes__route {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.field-notes__scene { z-index: 1; }
.field-notes__route { z-index: 5; pointer-events: none; }

.field-notes__grain {
  position: absolute;
  z-index: 9;
  inset: -40%;
  pointer-events: none;
  opacity: 0.12;
  mix-blend-mode: screen;
  background-image:
    radial-gradient(circle, rgba(255,255,255,.75) 0 .35px, transparent .5px),
    radial-gradient(circle, rgba(255,255,255,.4) 0 .3px, transparent .5px);
  background-position: 0 0, 7px 11px;
  background-size: 17px 19px, 23px 29px;
  animation: field-grain-shift .24s steps(2) infinite;
}

@keyframes field-grain-shift {
  0% { transform: translate3d(-1%, 1%, 0); }
  25% { transform: translate3d(1%, -1%, 0); }
  50% { transform: translate3d(.5%, 1.5%, 0); }
  75% { transform: translate3d(-1.5%, -.5%, 0); }
  100% { transform: translate3d(0, 0, 0); }
}

.field-notes__ghost {
  position: absolute;
  z-index: 2;
  top: 48%;
  left: 50%;
  display: none;
  transform: translate(-50%, -50%) scaleX(1.08);
  color: rgba(111, 63, 33, .57);
  font-family: var(--field-serif);
  font-size: min(52vw, 690px);
  font-weight: 400;
  line-height: .8;
  pointer-events: none;
  transition: opacity .7s, color 1.2s;
}

.field-notes.is-fallback .field-notes__sticky::before {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  background: linear-gradient(rgba(0,0,0,.48), rgba(0,0,0,.68)), var(--field-fallback) center / cover no-repeat;
  filter: grayscale(.7);
}

.field-notes.is-fallback .field-notes__ghost { display: block; opacity: .28; }

.field-notes__head {
  position: absolute;
  z-index: 14;
  inset: 66px 0 auto;
  height: 45px;
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: none;
  text-shadow: 0 1px 15px #000;
}

.field-notes__head h2 {
  margin: 0;
  font-family: var(--field-sans);
  font-size: 13px;
  font-weight: 700;
  line-height: .96;
  letter-spacing: .25em;
  text-align: center;
}

.field-notes__stage {
  position: absolute;
  z-index: 10;
  inset: 0;
  cursor: ew-resize;
}

.field-notes__lead {
  position: absolute;
  top: 15.7%;
  left: 50%;
  width: min(350px, 33vw);
  transform: translateX(-50%);
  text-align: center;
  text-shadow: 0 1px 13px rgba(0,0,0,.9);
  pointer-events: none;
}

.field-notes__number { margin: 0 0 8px; font-size: 18px; }

.field-notes__description {
  min-height: 3.8em;
  margin: 0;
  font-size: 11px;
  line-height: 1.55;
}

.field-notes__lead > span { display: block; margin-top: 3px; font-size: 18px; }

.field-notes__focus {
  position: absolute;
  z-index: 8;
  top: 50%;
  left: 50%;
  width: min(36.5vw, 560px);
  min-width: 390px;
  aspect-ratio: 16 / 9;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(255,255,255,.08);
  background: transparent;
  font: inherit;
  cursor: pointer;
}

.field-notes__focus::before,
.field-notes__focus::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 32px;
  height: 1px;
  background: rgba(255,255,255,.84);
  transform: translateX(-50%);
  transition: width .7s cubic-bezier(.22, 1, .36, 1);
}

.field-notes__focus::before { top: 0; }
.field-notes__focus::after { bottom: 0; }
.field-notes__focus:hover::before,
.field-notes__focus:hover::after,
.field-notes__focus:focus-visible::before,
.field-notes__focus:focus-visible::after { width: 92%; }

.field-notes__focus-mark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--field-serif);
  font-size: clamp(54px, 5vw, 76px);
  font-weight: 700;
  text-shadow: 0 4px 20px rgba(0,0,0,.35);
  transition: transform .8s cubic-bezier(.22, 1, .36, 1), letter-spacing .8s;
}

.field-notes__focus-hint {
  position: absolute;
  left: 50%;
  bottom: 11px;
  transform: translateX(-50%) translateY(7px);
  font-family: var(--field-sans);
  font-size: 7px;
  letter-spacing: .22em;
  opacity: 0;
  transition: opacity .45s, transform .6s cubic-bezier(.22, 1, .36, 1);
  white-space: nowrap;
}

.field-notes__focus:hover .field-notes__focus-mark,
.field-notes__focus:focus-visible .field-notes__focus-mark { transform: translate(-50%, -54%) scale(.92); letter-spacing: .08em; }
.field-notes__focus:hover .field-notes__focus-hint,
.field-notes__focus:focus-visible .field-notes__focus-hint { opacity: .8; transform: translateX(-50%) translateY(0); }

.field-notes__meta {
  position: absolute;
  z-index: 10;
  left: 50%;
  bottom: 5.6%;
  width: 460px;
  transform: translateX(-50%);
  text-align: center;
  text-shadow: 0 2px 15px rgba(0,0,0,.92);
  pointer-events: none;
}

.field-notes__category { margin: 0 0 8px; font-size: 11px; }
.field-notes__meta h3 { margin: 0; font-size: clamp(29px, 2.7vw, 42px); font-weight: 400; line-height: 1.2; }
.field-notes__stat { margin: 8px 0 0; font-size: 20px; letter-spacing: -.03em; }

.field-notes__neighbor {
  position: absolute;
  z-index: 7;
  bottom: 5.4%;
  width: 230px;
  opacity: .24;
  text-shadow: 0 2px 12px #000;
  pointer-events: none;
}

.field-notes__neighbor--previous { left: 5.2%; text-align: left; }
.field-notes__neighbor--next { right: 5.2%; text-align: right; }
.field-notes__neighbor p { margin: 0 0 9px; font-size: 11px; }
.field-notes__neighbor h3 { margin: 0; font-size: 28px; font-weight: 400; line-height: 1.2; }
.field-notes__neighbor span { display: block; margin-top: 8px; font-size: 14px; }

.field-notes__travel,
.field-notes__progress {
  position: absolute;
  z-index: 12;
  bottom: 2.6vh;
  display: flex;
  align-items: center;
  font-family: var(--field-sans);
  font-size: 7px;
  letter-spacing: .22em;
  opacity: .62;
  pointer-events: none;
}

.field-notes__travel { left: 5vw; gap: 12px; margin: 0; }
.field-notes__travel span { width: 38px; height: 1px; background: currentColor; }
.field-notes__progress { right: 5vw; gap: 10px; }
.field-notes__progress i { width: 48px; height: 1px; background: rgba(255,255,255,.45); }

.field-notes__step-controls {
  position: absolute;
  z-index: 15;
  top: 50%;
  right: 3vw;
  display: grid;
  gap: 10px;
  transform: translateY(-50%);
}

.field-notes__step-controls button {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255,255,255,.26);
  border-radius: 50%;
  background: rgba(0,0,0,.2);
  font: 16px/1 var(--field-sans);
  cursor: pointer;
  transition: color .25s, background .25s;
}

.field-notes__step-controls button:hover,
.field-notes__step-controls button:focus-visible { color: #070807; background: var(--field-white); }

.field-notes__detail {
  position: absolute;
  z-index: 50;
  inset: 0;
  display: grid;
  grid-template-columns: 54% 46%;
  color: #171713;
  background: #d8d3c9;
  clip-path: inset(50% 50% 50% 50%);
  visibility: hidden;
  pointer-events: none;
  transition: clip-path 1.05s cubic-bezier(.76, 0, .24, 1), visibility 0s 1.05s;
}

.field-notes__detail.is-open {
  clip-path: inset(0 0 0 0);
  visibility: visible;
  pointer-events: auto;
  transition-delay: 0s;
}

.field-notes__detail-close {
  position: absolute;
  z-index: 4;
  top: 36px;
  right: 5vw;
  border: 0;
  background: none;
  font: 20px/1 var(--field-serif);
  cursor: pointer;
}

.field-notes__detail-media {
  background-position: center;
  background-size: cover;
  filter: grayscale(1) contrast(1.05);
}

.field-notes__detail-card { align-self: center; max-width: 520px; padding: 7vw 7vw 5vw 5vw; }
.field-notes__detail-number { font-family: var(--field-sans); font-size: 9px; letter-spacing: .22em; }
.field-notes__detail-card h3 { margin: 38px 0 0; font-size: clamp(40px, 5vw, 78px); font-weight: 400; line-height: 1.05; }
.field-notes__detail-stat { margin: 17px 0 42px; font-size: 27px; }
.field-notes__detail-copy { max-width: 430px; font-size: 14px; line-height: 2; }
.field-notes__detail-card dl { margin-top: 42px; border-top: 1px solid rgba(0,0,0,.38); }
.field-notes__detail-card dl div { display: grid; grid-template-columns: 70px 1fr; padding: 12px 0; border-bottom: 1px solid rgba(0,0,0,.22); }
.field-notes__detail-card dt,
.field-notes__detail-card dd { margin: 0; font-size: 11px; }
.field-notes__detail-card dt { font-family: var(--field-sans); opacity: .6; }

.field-notes__loader {
  position: absolute;
  z-index: 70;
  right: max(20px, 3vw);
  bottom: max(20px, 3vh);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(7,8,7,.66);
  backdrop-filter: blur(8px);
  transition: opacity .45s, visibility 0s .45s;
}

.field-notes__loader span {
  width: 14px;
  height: 14px;
  border: 1px solid rgba(255,255,255,.2);
  border-top-color: white;
  border-radius: 50%;
  animation: field-loader-spin 1.2s linear infinite;
}

.field-notes__loader p { margin: 0; font-family: var(--field-sans); font-size: 7px; letter-spacing: .18em; }
.field-notes.is-ready .field-notes__loader { opacity: 0; visibility: hidden; }
@keyframes field-loader-spin { to { transform: rotate(360deg); } }

@media (max-width: 760px) {
  .field-notes { height: 360vh; min-height: 2300px; }
  .field-notes__head { inset: 52px 0 auto; height: 36px; }
  .field-notes__head h2 { font-size: 9px; }
  .field-notes__ghost { top: 44%; font-size: min(104vw, 470px); }
  .field-notes__lead { top: 13.2%; width: 76vw; }
  .field-notes__number { margin-bottom: 5px; font-size: 14px; }
  .field-notes__description { font-size: 9px; line-height: 1.45; }
  .field-notes__focus { top: 44%; width: 82vw; min-width: 0; }
  .field-notes__focus-mark { font-size: 52px; }
  .field-notes__meta { bottom: 8.8%; width: 84vw; }
  .field-notes__category { margin-bottom: 6px; font-size: 9px; }
  .field-notes__meta h3 { font-size: 29px; }
  .field-notes__stat { margin-top: 5px; font-size: 16px; }
  .field-notes__neighbor { display: none; }
  .field-notes__travel { left: 23px; bottom: 2.4vh; font-size: 6px; }
  .field-notes__travel span { width: 25px; }
  .field-notes__progress { right: 23px; bottom: 2.4vh; }
  .field-notes__progress i { width: 27px; }
  .field-notes__step-controls { top: auto; right: 50%; bottom: 15.5%; grid-auto-flow: column; transform: translateX(50%); }
  .field-notes__step-controls button { width: 38px; height: 38px; }
  .field-notes__detail { grid-template-columns: 1fr; grid-template-rows: 42% 58%; overflow: auto; }
  .field-notes__detail-close { top: 22px; right: 23px; color: white; font-size: 17px; text-shadow: 0 1px 8px #000; }
  .field-notes__detail-card { align-self: start; padding: 24px 25px 50px; }
  .field-notes__detail-card h3 { margin-top: 16px; font-size: 42px; }
  .field-notes__detail-stat { margin: 9px 0 20px; font-size: 20px; }
  .field-notes__detail-copy { font-size: 12px; line-height: 1.8; }
  .field-notes__detail-card dl { margin-top: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  .field-notes { height: 100vh; min-height: 720px; }
  .field-notes *,
  .field-notes *::before,
  .field-notes *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
  .field-notes__grain { display: none; }
}
