/* Field Guide — wearefieldguide.com
   AI-first agency. Dark editorial: warm ink ground, bone type, clay accent.
   Playfair Display (display) + DM Sans (body) + DM Mono (labels). */

@font-face {
  font-family: 'Playfair Display';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/assets/fonts/playfair-var.woff2') format('woff2');
}
@font-face {
  font-family: 'Playfair Display';
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
  src: url('/assets/fonts/playfair-italic-var.woff2') format('woff2');
}
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 100 1000;
  font-display: swap;
  src: url('/assets/fonts/dmsans-var.woff2') format('woff2');
}
@font-face {
  font-family: 'DM Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/dmmono-400.woff2') format('woff2');
}
@font-face {
  font-family: 'DM Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/assets/fonts/dmmono-500.woff2') format('woff2');
}

:root {
  --ink: #161511;
  --ink-raised: #1E1C16;
  --bone: #EFE9DB;
  --bone-dim: #A9A395;
  --clay: #C98F5E;
  --clay-deep: #B07A4F;
  --line: rgba(239, 233, 219, 0.14);
  --line-strong: rgba(239, 233, 219, 0.32);
  --serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --sans: 'DM Sans', -apple-system, 'Helvetica Neue', sans-serif;
  --mono: 'DM Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --space-section: clamp(5rem, 3.5rem + 6vw, 9.5rem);

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --reveal-duration: 0.9s;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  background: var(--ink);
  color: var(--bone);
  font-family: var(--sans);
  font-weight: 330;
  font-size: var(--text-base);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  position: relative;
}

/* film grain: absolute (scrolls with the page, painted once), never fixed */
body::before {
  content: "";
  position: absolute; inset: 0; z-index: 0;
  pointer-events: none; opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.wrap { max-width: 1220px; margin: 0 auto; padding: 0 clamp(20px, 4vw, 44px); position: relative; z-index: 1; }
.dot { color: var(--clay); }
em { font-style: italic; }

::selection { background: var(--clay-deep); color: var(--ink); }

/* ---------- type utilities ---------- */
.label {
  font-family: var(--mono);
  font-weight: 400;
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--clay);
}
.mono-dim {
  font-family: var(--mono);
  font-weight: 400;
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bone-dim);
}

/* ---------- nav ---------- */
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--bone); color: var(--ink); padding: 10px 18px;
  font-size: 0.85rem; text-decoration: none;
}
.skip-link:focus { left: 12px; top: 12px; }

nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(22, 21, 17, 0.86);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
}
nav.scrolled { border-color: var(--line); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 76px; }
.wordmark {
  font-family: var(--sans); font-weight: 600;
  letter-spacing: 0.16em; font-size: 0.95rem;
  text-transform: uppercase; color: var(--bone); text-decoration: none;
}
.nav-links { display: flex; gap: 34px; align-items: center; }
.nav-links a {
  color: var(--bone-dim); text-decoration: none;
  font-size: 0.85rem; letter-spacing: 0.03em; font-weight: 400;
  transition: color 0.2s;
}
.nav-links a:hover, .nav-links a:focus-visible { color: var(--bone); }
.nav-cta {
  border: 1px solid var(--line-strong); border-radius: 40px;
  padding: 9px 20px; color: var(--bone) !important;
  transition: background 0.25s, color 0.25s, border-color 0.25s;
}
.nav-cta:hover, .nav-cta:focus-visible { background: var(--bone); border-color: var(--bone); color: var(--ink) !important; }
a:focus-visible { outline: 2px solid var(--clay); outline-offset: 3px; }
@media (max-width: 760px) { .nav-links a:not(.nav-cta) { display: none; } }

/* ---------- hero ---------- */
.hero { padding: clamp(80px, 9vw, 140px) 0 clamp(60px, 7vw, 100px); }
.hero-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(230px, 300px);
  gap: clamp(40px, 6vw, 90px); align-items: end;
}
.hero .label { margin-bottom: 34px; display: block; }
.hero h1 {
  font-family: var(--serif); font-weight: 470;
  font-size: clamp(2.9rem, 7.6vw, 6.2rem);
  line-height: 1.02; letter-spacing: -0.015em;
  max-width: 13ch;
}
.hero h1 em { color: var(--clay); }
.hero .lede {
  font-size: clamp(1.05rem, 1.5vw, 1.2rem); line-height: 1.68;
  max-width: 54ch; margin-top: 36px; color: var(--bone-dim);
}
.hero .lede strong { color: var(--bone); font-weight: 450; }
.hero-actions { margin-top: 44px; display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }

/* index block: the guidebook conceit */
.contents { border-top: 2px solid var(--bone); padding-top: 22px; font-size: 0.85rem; }
.contents .label { color: var(--bone); margin-bottom: 16px; display: block; }
.contents ol { list-style: none; }
.contents li { border-bottom: 1px solid var(--line); }
.contents a {
  display: flex; justify-content: space-between; align-items: baseline; gap: 14px;
  padding: 11px 2px; color: var(--bone-dim); text-decoration: none;
  transition: color 0.2s, padding-left 0.25s var(--ease-out);
}
.contents a:hover, .contents a:focus-visible { color: var(--bone); padding-left: 8px; }
.contents .t { font-family: var(--serif); font-size: 1.02rem; font-weight: 480; }
.contents .n { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.1em; color: var(--clay); }
@media (max-width: 860px) { .hero-grid { grid-template-columns: 1fr; } .contents { max-width: 380px; } }

.btn {
  display: inline-flex; align-items: center; gap: 11px;
  background: var(--bone); color: var(--ink);
  text-decoration: none; padding: 16px 30px; border-radius: 44px;
  font-size: 0.95rem; font-weight: 480; letter-spacing: 0.01em;
  transition: transform 0.25s var(--ease-out), background 0.25s, color 0.25s;
}
.btn:hover, .btn:focus-visible { background: var(--clay); color: var(--ink); transform: translateY(-2px); }
.btn .arrow { transition: transform 0.25s var(--ease-out); }
.btn:hover .arrow, .btn:focus-visible .arrow { transform: translateX(4px); }

/* ---------- stat strip ---------- */
.stats {
  border-top: 1px solid var(--line);
  background-image:
    repeating-linear-gradient(0deg, rgba(239, 233, 219, 0.03) 0 1px, transparent 1px 56px),
    repeating-linear-gradient(90deg, rgba(239, 233, 219, 0.03) 0 1px, transparent 1px 56px);
}
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.stat {
  padding: clamp(28px, 3.4vw, 44px) clamp(18px, 2.4vw, 34px);
  border-left: 1px solid var(--line);
}
.stat:first-child { border-left: none; padding-left: 0; }
.stat .big {
  font-family: var(--mono); font-weight: 500;
  font-size: clamp(1.8rem, 3.1vw, 2.7rem); line-height: 1;
}
.stat p { margin-top: 12px; font-size: 0.86rem; color: var(--bone-dim); line-height: 1.5; max-width: 24ch; }
@media (max-width: 860px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(3) { border-left: none; padding-left: 0; }
  .stat:nth-child(1), .stat:nth-child(2) { border-bottom: 1px solid var(--line); }
}
@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr; }
  .stat { border-left: none; padding-left: 0; border-bottom: 1px solid var(--line); }
  .stat:last-child { border-bottom: none; }
}

/* ---------- section frame ---------- */
section.entry { padding: var(--space-section) 0; border-top: 1px solid var(--line); }
.entry-head { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: clamp(20px, 4vw, 60px); }
.entry-head .side { padding-top: 8px; }
.entry-head h2 {
  font-family: var(--serif); font-weight: 470;
  font-size: clamp(1.9rem, 3.6vw, 3rem);
  line-height: 1.12; letter-spacing: -0.01em; max-width: 22ch;
}
.entry-head h2 em { color: var(--clay); }
.entry-body { margin-top: clamp(36px, 5vw, 60px); }
@media (max-width: 760px) { .entry-head { grid-template-columns: 1fr; gap: 16px; } }

/* ---------- problem / prose columns ---------- */
.prose-cols { display: grid; grid-template-columns: 170px minmax(0, 60ch); gap: clamp(20px, 4vw, 60px); }
.prose-cols .filler { min-height: 1px; }
.prose p { color: var(--bone-dim); font-size: clamp(1.02rem, 1.4vw, 1.15rem); line-height: 1.7; }
.prose p + p { margin-top: 1.3em; }
.prose strong { color: var(--bone); font-weight: 460; }
@media (max-width: 760px) { .prose-cols { grid-template-columns: 1fr; } }

/* ---------- foundations / steps ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(30px, 4vw, 52px); }
.step { border-top: 1px solid var(--line-strong); padding-top: 24px; }
.step .num {
  font-family: var(--mono); font-weight: 400;
  font-size: 0.74rem; letter-spacing: 0.14em;
  color: var(--clay); margin-bottom: 22px;
}
.step h3 { font-family: var(--serif); font-weight: 500; font-size: 1.45rem; line-height: 1.2; margin-bottom: 13px; }
.step p { font-size: 0.98rem; color: var(--bone-dim); line-height: 1.65; }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; gap: 38px; } }

/* ---------- timeline ---------- */
.timeline { list-style: none; border-left: 1px solid var(--line); margin-left: 6px; position: relative; }
.timeline-progress {
  position: absolute; left: -1px; top: 0; width: 1px; height: 100%;
  background: var(--clay); transform-origin: top; transform: scaleY(0);
  will-change: transform;
}
.timeline li { position: relative; padding: 0 0 clamp(34px, 4vw, 48px) clamp(26px, 3.4vw, 44px); }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before {
  content: ""; position: absolute; left: -5px; top: 8px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--line-strong); box-shadow: 0 0 0 4px var(--ink);
  transition: background 0.4s;
}
.timeline li.passed::before { background: var(--clay); }
.timeline .when { display: block; margin-bottom: 10px; }
.timeline h3 { font-family: var(--serif); font-weight: 500; font-size: 1.45rem; line-height: 1.2; margin-bottom: 10px; }
.timeline p { font-size: 0.98rem; color: var(--bone-dim); line-height: 1.65; max-width: 58ch; }

/* ---------- interlude aphorism ---------- */
.aphorism { text-align: center; padding: clamp(70px, 8vw, 105px) 0; border-top: 1px solid var(--line); }
.aphorism p {
  font-family: var(--serif); font-style: italic; font-weight: 430;
  font-size: clamp(1.5rem, 3.2vw, 2.4rem); line-height: 1.35;
  max-width: 26ch; margin: 0 auto;
}
.aphorism p .dot { font-style: normal; }

/* ---------- field notes ---------- */
.notes-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.note {
  background: var(--ink); padding: clamp(24px, 3vw, 36px);
  min-height: 210px; display: flex; flex-direction: column; justify-content: space-between; gap: 26px;
  transition: background 0.3s;
}
.note:hover { background: var(--ink-raised); }
.note .sector { display: block; margin-bottom: 14px; }
.note h3 { font-family: var(--serif); font-weight: 500; font-size: 1.3rem; line-height: 1.25; }
.note p { font-size: 0.93rem; color: var(--bone-dim); line-height: 1.6; }
.note .status {
  font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--bone-dim);
  border-top: 1px solid var(--line); padding-top: 14px;
}
.note .status b { color: var(--clay); font-weight: 400; }
@media (max-width: 860px) { .notes-grid { grid-template-columns: 1fr; } .note { min-height: 0; } }

/* ---------- clients ---------- */
.clients { padding: clamp(48px, 6vw, 68px) 0; border-top: 1px solid var(--line); }
.client-row {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center;
  column-gap: clamp(26px, 4.5vw, 56px); row-gap: 18px;
}
.client-row span {
  font-family: var(--mono); font-weight: 400; font-size: 0.76rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--bone); opacity: 0.42;
  transition: opacity 0.25s; white-space: nowrap;
}
.client-row span:hover { opacity: 1; }

/* ---------- faq ---------- */
.faq-list { border-top: 1px solid var(--line-strong); max-width: 62ch; }
.faq-list details { border-bottom: 1px solid var(--line); }
.faq-list summary {
  cursor: pointer; list-style: none;
  display: flex; justify-content: space-between; align-items: baseline; gap: 20px;
  padding: 20px 2px;
  font-family: var(--serif); font-weight: 490; font-size: 1.2rem; line-height: 1.3;
  transition: color 0.2s;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after {
  content: "+"; font-family: var(--mono); font-size: 1rem; color: var(--clay);
  transition: transform 0.25s var(--ease-out); flex-shrink: 0;
}
.faq-list details[open] summary::after { transform: rotate(45deg); }
.faq-list summary:hover { color: var(--clay); }
.faq-list .a { padding: 0 2px 24px; color: var(--bone-dim); font-size: 0.98rem; line-height: 1.68; max-width: 56ch; }

/* ---------- close ---------- */
.close {
  border-top: 1px solid var(--line);
  padding: clamp(90px, 11vw, 150px) 0; text-align: center;
  position: relative; overflow: hidden;
}
.close::after {
  content: ""; position: absolute; left: 50%; bottom: -260px; transform: translateX(-50%);
  width: 720px; height: 520px; border-radius: 50%;
  background: radial-gradient(circle, rgba(201, 143, 94, 0.22), transparent 68%);
  pointer-events: none;
}
.close .wrap { position: relative; z-index: 2; }
.close .label { display: block; }
.close h2 {
  font-family: var(--serif); font-weight: 460;
  font-size: clamp(2.6rem, 6.5vw, 5rem); line-height: 1.03;
  letter-spacing: -0.01em; margin: 20px 0 18px;
}
.close p { font-size: clamp(1rem, 1.5vw, 1.15rem); color: var(--bone-dim); margin-bottom: 42px; }

/* ---------- footer ---------- */
footer { padding: 52px 0 60px; border-top: 1px solid var(--line); }
.foot-inner {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 30px; flex-wrap: wrap;
  font-size: 0.8rem; color: var(--bone-dim); letter-spacing: 0.01em; line-height: 1.9;
}
.foot-inner .wordmark { font-size: 0.9rem; }
.sys { margin-top: 8px; }
.sys-dot {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--clay); margin-right: 7px; vertical-align: 1px;
  animation: pulse 2.4s ease-in-out infinite;
}
#sys-status { color: var(--clay); }
@keyframes pulse { 0%, 100% { opacity: 0.3; } 50% { opacity: 1; } }
.foot-meta { text-align: right; }
.foot-meta a { color: var(--bone-dim); text-decoration: none; border-bottom: 1px solid var(--clay-deep); transition: color 0.2s; }
.foot-meta a:hover { color: var(--bone); }
@media (max-width: 640px) { .foot-meta { text-align: left; } }

/* ---------- 404 ---------- */
.notfound { min-height: 80vh; display: flex; align-items: center; }
.notfound .label { margin-bottom: 28px; display: block; }
.notfound h1 {
  font-family: var(--serif); font-weight: 470;
  font-size: clamp(2.6rem, 7vw, 5.5rem); line-height: 1.03;
  letter-spacing: -0.015em; max-width: 14ch;
}
.notfound h1 em { color: var(--clay); }
.notfound p { font-size: 1.1rem; color: var(--bone-dim); margin-top: 28px; max-width: 44ch; }
.notfound .actions { margin-top: 40px; }

/* ---------- machine details ---------- */
.cursor {
  display: inline-block; width: 0.52em; height: 0.95em;
  background: var(--clay); vertical-align: text-bottom; margin-left: 6px;
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.sys { margin-top: 14px; }

/* ---------- motion ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity var(--reveal-duration) var(--ease-out), transform var(--reveal-duration) var(--ease-out); }
.reveal.in { opacity: 1; transform: none; }
.hero .rise { opacity: 0; transform: translateY(26px); animation: rise 1s var(--ease-out) forwards; }
.hero .rise-1 { animation-delay: 0.1s; }
.hero .rise-2 { animation-delay: 0.22s; }
.hero .rise-3 { animation-delay: 0.42s; }
.hero .rise-4 { animation-delay: 0.58s; }
.hero .rise-5 { animation-delay: 0.74s; }
@keyframes rise { to { opacity: 1; transform: translateY(0); } }

html.static .reveal, html.static .hero .rise { opacity: 1; transform: none; animation: none; transition: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal, .hero .rise { opacity: 1; transform: none; animation: none; transition: none; }
  .btn, .btn .arrow, .contents a { transition: none; }
  .cursor, .sys-dot { animation: none; }
}
