/* Fieldnote — concept research archive (Credoark demo).
   Idea: a field notebook beside a globe. Archival paper, ink, one ochre for orientation. */
@font-face { font-family: 'Field Serif'; src: url('../../../assets/fonts/instrument-serif.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Field Serif'; font-style: italic; src: url('../../../assets/fonts/instrument-serif-italic.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Field Sans'; src: url('../../../assets/fonts/inter.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }

:root {
  --paper: #F2F0EA; --sheet: #FBFAF6; --ink: #1D1F1C; --night: #111412;
  --muted: rgba(29, 31, 28, 0.64); --line: rgba(29, 31, 28, 0.14); --ochre: #C8892B;
  --serif: 'Field Serif', Georgia, serif; --sans: 'Field Sans', system-ui, sans-serif;
  --pad: max(4.5vw, 18px); --ease: cubic-bezier(.16, 1, .3, 1);
}
*, *::before, *::after { box-sizing: border-box; min-width: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.6 var(--sans); overflow-x: clip; }
a { color: inherit; } button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--ochre); outline-offset: 3px; }

.concept-bar { display: flex; justify-content: center; flex-wrap: wrap; gap: 0.5rem 1.25rem; padding: 0.55rem var(--pad); background: var(--ink); color: var(--paper); font-size: 0.78rem; text-align: center; }
.concept-bar a { color: #E9B866; text-underline-offset: 3px; }
.header { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1rem var(--pad); border-bottom: 1px solid var(--line); }
.logo { font-family: var(--serif); font-size: 1.9rem; line-height: 1; text-decoration: none; }
.logo em { color: var(--ochre); }
.header nav { display: flex; gap: 1.5rem; font-size: 0.92rem; }
.header nav a { text-decoration: none; color: var(--muted); }
.header nav a:hover { color: var(--ink); }

/* Map view ------------------------------------------------------------------- */
.atlas { display: grid; grid-template-columns: minmax(18rem, 0.8fr) minmax(0, 1.2fr); min-height: calc(100svh - 110px); border-bottom: 1px solid var(--line); }
.atlas__side { display: flex; flex-direction: column; gap: 1.5rem; padding: clamp(2rem, 4vw, 3.5rem) var(--pad); }
.atlas h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(2.8rem, 5vw, 4.8rem); line-height: 0.98; letter-spacing: -0.015em; margin: 0; text-wrap: balance; }
.atlas h1 em { color: var(--ochre); }
.lede { color: var(--muted); font-size: 1.05rem; max-width: 38ch; margin: 0; }
.label { font-size: 0.8rem; font-weight: 600; color: var(--muted); margin: 0 0 0.6rem; }
.chips { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.chip { display: inline-flex; align-items: center; gap: 0.45rem; min-height: 40px; padding: 0 0.85rem; border-radius: 999px; border: 1px solid var(--line); background: var(--sheet); cursor: pointer; font-size: 0.9rem; transition: opacity 200ms, border-color 200ms; }
.chip i { width: 10px; height: 10px; border-radius: 50%; }
.chip span { color: var(--muted); font-size: 0.78rem; font-variant-numeric: tabular-nums; }
.chip[aria-pressed="false"] { opacity: 0.4; }
.chip:hover { border-color: var(--ink); }
.tools { display: grid; grid-template-columns: minmax(0, 1fr) 9rem; gap: 0.6rem; }
.tools input, .tools select { width: 100%; min-height: 44px; padding: 0 0.85rem; border: 1px solid var(--line); border-radius: 10px; background: var(--sheet); font-size: 16px; }
.tools input:focus, .tools select:focus { outline: none; border-color: var(--ochre); }
.count { display: flex; justify-content: space-between; align-items: center; gap: 1rem; font-size: 0.9rem; color: var(--muted); padding-top: 1rem; border-top: 1px solid var(--line); margin-top: auto; }
.link { background: none; border: 0; padding: 0; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; color: var(--ink); }
.globe { position: relative; background: radial-gradient(90% 80% at 50% 45%, #232824 0%, var(--night) 75%); overflow: hidden; }
.globe canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; touch-action: none; }
.globe canvas:active { cursor: grabbing; }
.globe__ui { position: absolute; left: 1.1rem; right: 1.1rem; bottom: 1.1rem; display: flex; justify-content: space-between; align-items: end; gap: 1rem; pointer-events: none; }
.globe__ui > * { pointer-events: auto; }
.globe__hint { color: rgba(242, 240, 234, 0.6); font-size: 0.82rem; }
.globe__legend { display: flex; flex-wrap: wrap; gap: 0.4rem 0.9rem; max-width: 26rem; color: rgba(242, 240, 234, 0.75); font-size: 0.78rem; }
.globe__legend span { display: inline-flex; align-items: center; gap: 0.35rem; }
.globe__legend i { width: 8px; height: 8px; border-radius: 50%; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; min-height: 44px; padding: 0 1.1rem; border-radius: 999px; border: 1px solid var(--ink); background: var(--ink); color: var(--paper); font-size: 0.9rem; font-weight: 500; cursor: pointer; text-decoration: none; transition: background 200ms, color 200ms; }
.btn:hover { background: var(--ochre); border-color: var(--ochre); color: var(--ink); }
.btn--line { background: transparent; color: var(--ink); }
.btn--glass { background: rgba(242, 240, 234, 0.1); border-color: rgba(242, 240, 234, 0.25); color: var(--paper); }

/* Index ---------------------------------------------------------------------- */
.index { padding: clamp(3rem, 6vw, 5rem) var(--pad); }
.index__head { display: flex; justify-content: space-between; align-items: end; gap: 2rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(2.2rem, 4vw, 3.4rem); line-height: 1; margin: 0; }
table { width: 100%; border-collapse: collapse; }
thead th { text-align: left; font-size: 0.78rem; font-weight: 600; color: var(--muted); padding: 0 1rem 0.7rem 0; border-bottom: 1px solid var(--ink); }
tbody tr { cursor: pointer; transition: background 200ms; }
tbody tr:hover, tbody tr:focus-visible { background: var(--sheet); }
td { padding: 1rem 1rem 1rem 0; border-bottom: 1px solid var(--line); vertical-align: top; font-size: 0.94rem; }
td.t b { display: block; font-family: var(--serif); font-weight: 400; font-size: 1.35rem; line-height: 1.15; }
td.t span { display: block; color: var(--muted); font-size: 0.9rem; margin-top: 0.2rem; max-width: 60ch; }
td.y { font-variant-numeric: tabular-nums; text-align: right; padding-right: 0; }
thead th:last-child { text-align: right; padding-right: 0; }
td.none { color: var(--muted); padding: 2rem 0; }
.mat { display: inline-flex; align-items: center; gap: 0.4rem; white-space: nowrap; }
.mat i { width: 9px; height: 9px; border-radius: 50%; }
.method { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; padding: 0 var(--pad) clamp(3rem, 6vw, 5rem); }
.method article { padding: 1.5rem; border-radius: 14px; background: var(--sheet); border: 1px solid var(--line); }
.method h3 { font-family: var(--serif); font-weight: 400; font-size: 1.6rem; margin: 0 0 0.4rem; }
.method p { margin: 0; color: var(--muted); }
.footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; padding: 1.5rem var(--pad); background: var(--ink); color: rgba(242, 240, 234, 0.62); font-size: 0.85rem; }
.footer a { color: #E9B866; }

/* Reading mode --------------------------------------------------------------- */
#reader { width: min(46rem, 100vw); max-width: none; height: 100%; max-height: none; margin: 0 0 0 auto; padding: 0; border: 0; background: var(--sheet); color: var(--ink); }
#reader::backdrop { background: rgba(17, 20, 18, 0.45); }
#reader[open] { animation: slide 480ms var(--ease); }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.reader__bar { position: sticky; top: 0; display: flex; justify-content: space-between; align-items: center; padding: 0.9rem 1.5rem; background: rgba(251, 250, 246, 0.94); border-bottom: 1px solid var(--line); backdrop-filter: blur(6px); }
.reader__bar span { font-family: var(--serif); font-size: 1.3rem; }
.reader__body { height: calc(100% - 66px); overflow-y: auto; padding: clamp(1.5rem, 4vw, 3rem); }
.reader__body article { max-width: 62ch; margin: 0 auto; }
.r__meta { display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; font-size: 0.82rem; color: var(--muted); }
#reader h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(2.2rem, 4vw, 3.2rem); line-height: 1.02; margin: 0.6rem 0 0.8rem; text-wrap: balance; }
.r__lede { font-size: 1.2rem; color: var(--ink) !important; font-family: var(--serif); font-style: italic; }
.reader__body article p { color: rgba(29, 31, 28, 0.82); font-size: 1.06rem; line-height: 1.75; }
.r__note { font-size: 0.85rem !important; color: var(--muted) !important; border-top: 1px solid var(--line); padding-top: 1rem; margin-top: 2rem; }
.r__nav { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; margin-top: 1.5rem; }
.r__nav .btn { justify-content: flex-start; text-align: left; white-space: normal; min-height: 56px; padding: 0.6rem 1rem; border-radius: 12px; }
.r__nav .btn:last-child { justify-content: flex-end; text-align: right; }

@media (max-width: 900px) {
  .atlas { grid-template-columns: 1fr; min-height: auto; }
  .globe { order: -1; height: 72vw; min-height: 340px; }
  .method { grid-template-columns: 1fr; }
  .header nav { display: none; }
  thead { display: none; }
  tbody tr { display: grid; grid-template-columns: 1fr auto; gap: 0.3rem 1rem; padding: 1rem 0; border-bottom: 1px solid var(--line); }
  td { border: 0; padding: 0; }
  td.t { grid-column: 1 / -1; }
  .globe__legend { display: none; }
  .r__nav { grid-template-columns: 1fr; }
  .r__nav .btn:last-child { justify-content: flex-start; text-align: left; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* ===== Fieldnote revamp ================================================== */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.h2 em { color: var(--ochre); }
/* Globe photo peek */
.peek { position: absolute; left: 0; top: 0; z-index: 4; width: 200px; margin: 0; border-radius: 12px; overflow: hidden; background: var(--sheet); box-shadow: 0 24px 50px -16px rgba(0, 0, 0, 0.6); pointer-events: none; opacity: 0; transition: opacity 200ms; will-change: transform; }
.peek.is-on { opacity: 1; }
.peek img { display: block; width: 100%; aspect-ratio: 4 / 5; height: auto; object-fit: cover; }
.peek figcaption { padding: 0.6rem 0.75rem 0.7rem; }
.peek b { display: block; font-family: var(--serif); font-weight: 400; font-size: 1.05rem; line-height: 1.15; }
.peek span { font-size: 0.75rem; color: var(--muted); }

/* Contact sheet */
.sheet { position: relative; background: var(--night); color: var(--paper); }
.sheet__pin { position: sticky; top: 0; height: 100svh; display: flex; flex-direction: column; justify-content: center; gap: clamp(1.4rem, 3vh, 2.4rem); overflow: hidden; padding-block: 2rem; }
.sheet__head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 1rem 3rem; align-items: end; padding-inline: var(--pad); }
.sheet__head .label { grid-column: 1 / -1; margin: 0; color: #E9B866; }
.sheet__head .h2 { margin: 0; }
.sheet__head .lede { color: rgba(242, 240, 234, 0.66); }
.sheet__count { margin: 0; font-family: var(--serif); font-size: 1.4rem; color: rgba(242, 240, 234, 0.5); font-variant-numeric: tabular-nums; }
.sheet__count b { font-weight: 400; font-size: 3rem; color: #fff; }
.sheet__track { display: flex; gap: 1rem; list-style: none; margin: 0; padding: 0 var(--pad); width: max-content; will-change: transform; }
.sheet__track li { flex: none; }
.frame { position: relative; display: block; width: clamp(220px, 21vw, 300px); padding: 10px 10px 46px; border: 0; border-radius: 4px; background: #F7F3EA; cursor: pointer; text-align: left; box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.8); transition: transform 500ms var(--ease); }
.sheet__track li:nth-child(odd) .frame { transform: rotate(-1.2deg); }
.sheet__track li:nth-child(even) .frame { transform: rotate(1deg) translateY(14px); }
.frame:hover { transform: rotate(0) translateY(-8px) !important; }
.frame img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; }
.frame__n { position: absolute; right: 12px; bottom: 14px; font-family: var(--serif); font-size: 1.2rem; color: var(--ochre); }
.frame__cap { position: absolute; left: 12px; right: 44px; bottom: 9px; font-size: 0.72rem; color: var(--muted); line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.frame__cap b { display: block; font-family: var(--serif); font-weight: 400; font-size: 1rem; color: var(--ink); }

/* Index thumbnails */
.t__row { display: flex; gap: 0.9rem; align-items: center; }
.t__img { width: 56px; height: 56px; flex: none; border-radius: 8px; object-fit: cover; }
.t__txt { display: block; color: inherit !important; margin: 0 !important; max-width: none !important; }

/* Reader hero */
.r__hero { margin: 0 0 1.6rem; }
.r__hero img { display: block; width: 100%; height: auto; max-height: 62vh; object-fit: cover; border-radius: 12px; }
.r__hero figcaption { margin-top: 0.5rem; font-size: 0.82rem; color: var(--muted); }

/* Campaign */
.campaign { padding: clamp(3.5rem, 7vw, 6rem) var(--pad); background: var(--sheet); border-top: 1px solid var(--line); }
.campaign__head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem 3rem; align-items: end; margin-bottom: 2.4rem; }
.campaign__head .label { grid-column: 1 / -1; margin: 0; color: var(--ochre); }
.campaign__head .h2 { margin: 0; }
.ads { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; align-items: start; }
.av { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: var(--paper); font-family: var(--serif); flex: none; }
.dispatch { padding: 1.3rem; border-radius: 14px; background: var(--paper); border: 1px solid var(--line); font-family: Georgia, serif; }
.dispatch__k { margin: 0 0 0.8rem; font: 700 0.72rem var(--sans); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ochre); }
.dispatch img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 8px; }
.dispatch h3 { font-family: var(--serif); font-weight: 400; font-size: 1.6rem; line-height: 1.1; margin: 0.9rem 0 0.4rem; }
.dispatch p { margin: 0; color: var(--muted); font-size: 0.95rem; }
.dispatch__cta { display: inline-block; margin-top: 0.9rem; font: 600 0.88rem var(--sans); color: var(--ink); border-bottom: 1px solid var(--ochre); }
.igc, .lin { background: #fff; border-radius: 14px; overflow: hidden; font-family: -apple-system, 'Segoe UI', var(--sans), sans-serif; color: #111; box-shadow: 0 30px 60px -40px rgba(0, 0, 0, 0.45); }
.igc header, .lin header { display: flex; align-items: center; gap: 0.55rem; padding: 0.75rem 0.9rem; font-size: 0.86rem; }
.igc header small { margin-left: auto; color: #737373; font-size: 0.75rem; }
.igc__media { position: relative; }
.igc__media img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; }
.igc__pin { position: absolute; left: 10px; top: 10px; padding: 0.3rem 0.6rem; border-radius: 6px; background: rgba(0, 0, 0, 0.6); color: #fff; font-size: 0.75rem; }
.igc__dots { position: absolute; left: 0; right: 0; bottom: 10px; display: flex; justify-content: center; gap: 4px; }
.igc__dots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(255, 255, 255, 0.55); }
.igc__dots i.on { background: #fff; }
.igc p { margin: 0; padding: 0.75rem 0.9rem 1rem; font-size: 0.84rem; line-height: 1.45; }
.lin header b { display: block; font-size: 0.9rem; }
.lin header small { color: #666; font-size: 0.74rem; }
.lin > p { margin: 0; padding: 0 0.9rem 0.8rem; font-size: 0.86rem; line-height: 1.45; }
.lin img { display: block; width: 100%; height: auto; aspect-ratio: 1.91 / 1; object-fit: cover; }
.lin footer { padding: 0.7rem 0.9rem; background: #F3F2EF; }
.lin footer b { display: block; font-size: 0.88rem; }
.lin footer small { color: #666; font-size: 0.75rem; }
.campaign__note { margin: 1.8rem 0 0; font-size: 0.82rem; color: var(--muted); }

/* Dispatch pop-up */
.pop { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 1rem; background: rgba(17, 20, 18, 0.6); backdrop-filter: blur(4px); animation: fpopIn 400ms var(--ease); }
.pop[hidden] { display: none; }
@keyframes fpopIn { from { opacity: 0; } }
.pop__card { position: relative; display: grid; grid-template-columns: 0.85fr 1.15fr; width: min(760px, 100%); max-height: calc(100svh - 2rem); overflow: auto; border-radius: 18px; background: var(--sheet); box-shadow: 0 40px 100px -30px rgba(0, 0, 0, 0.55); }
.pop__pic { margin: 0; min-height: 100%; }
.pop__pic img { display: block; width: 100%; height: 100%; object-fit: cover; }
.pop__body { padding: clamp(1.4rem, 3vw, 2.4rem); }
.pop__body .label { margin: 0; color: var(--ochre); }
.pop__body h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(2.2rem, 3.6vw, 3rem); line-height: 0.98; margin: 0.5rem 0 0.8rem; }
.pop__body h2 em { color: var(--ochre); }
.pop__body > p { color: var(--muted); margin: 0 0 1.3rem; }
.pop__form { display: grid; gap: 0.7rem; }
.pop__form input[type=email] { min-height: 50px; padding: 0 1rem; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: 16px; }
.pop__form input[type=email]:focus { outline: none; border-color: var(--ochre); }
.pop__consent { display: flex; gap: 0.6rem; align-items: flex-start; font-size: 0.84rem; color: var(--muted); }
.pop__consent input { margin-top: 0.2rem; accent-color: var(--ochre); }
.pop__err { margin: 0; min-height: 1.1em; font-size: 0.84rem; color: #A3361A; }
.pop__x { position: absolute; top: 0.6rem; right: 0.6rem; z-index: 2; width: 40px; height: 40px; border: 0; border-radius: 50%; background: rgba(251, 250, 246, 0.92); font-size: 1.5rem; line-height: 1; cursor: pointer; }

@media (max-width: 900px) {
  .sheet__pin { position: static; height: auto; padding-block: 3.5rem; }
  .sheet__head { grid-template-columns: 1fr; }
  .sheet__count { display: none; }
  .sheet__track { width: auto; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 1.6rem; }
  .sheet__track li { scroll-snap-align: start; }
  .frame { width: 68vw; }
  .campaign__head, .ads { grid-template-columns: 1fr; }
  .peek { display: none; }
  .pop__card { grid-template-columns: 1fr; }
  .pop__pic { height: 150px; min-height: 0; }
}

/* Photo-real Earth layer */
.globe__earth { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.globe.has-earth { background: radial-gradient(70% 60% at 50% 45%, #0E1A26 0%, #070B10 70%, #05070A 100%); }
.globe.has-earth::before { content: ''; position: absolute; inset: 0; background-image: radial-gradient(1px 1px at 12% 18%, rgba(255,255,255,.7), transparent), radial-gradient(1px 1px at 82% 12%, rgba(255,255,255,.55), transparent), radial-gradient(1px 1px at 68% 84%, rgba(255,255,255,.5), transparent), radial-gradient(1px 1px at 22% 72%, rgba(255,255,255,.45), transparent), radial-gradient(1.5px 1.5px at 92% 58%, rgba(255,255,255,.6), transparent), radial-gradient(1px 1px at 40% 8%, rgba(255,255,255,.4), transparent), radial-gradient(1px 1px at 6% 46%, rgba(255,255,255,.5), transparent), radial-gradient(1px 1px at 55% 95%, rgba(255,255,255,.35), transparent); pointer-events: none; }
