/* =========================================================
   AgentDiary — Landing Page Stylesheet
   Track. Follow. Close.
   ========================================================= */

:root {
  /* Color */
  --ink: #17140F;         /* warm near-black, matches brand mark background */
  --ink-soft: #211D17;    /* raised panels on dark */
  --paper: #F6F1E7;       /* warm ivory, matches brand mark white */
  --stone: #A79E8E;       /* muted secondary text on dark */
  --stone-dim: #6E6656;   /* dimmer labels / captions */
  --gold: #C69A4A;        /* accent — the "close" color */
  --gold-soft: #E7C989;   /* hover / bright accent */
  --line: #3A3327;        /* hairline dividers on dark */
  --line-soft: rgba(246, 241, 231, 0.12);

  /* Type */
  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-body: "IBM Plex Sans", "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", Menlo, monospace;

  /* Scale */
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: 4rem;
  --space-6: 6.5rem;

  --radius-sm: 4px;
  --radius-md: 8px;

  --container: 1180px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
button { font-family: inherit; cursor: pointer; }
h1, h2, h3, p { margin: 0; }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--space-3);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Focus visibility ---------- */
a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* ---------- Brand mark (triangles) ---------- */
.mark {
  display: inline-flex;
  align-items: flex-end;
}
.mark svg { width: 100%; height: 100%; }
.mark .tri { fill: var(--paper); }
.mark--gold .tri { fill: var(--gold); }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(23, 20, 15, 0.86);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line-soft);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2) 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.brand .mark { width: 26px; height: 22px; }
.brand__word {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.nav {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}
.nav__links {
  display: flex;
  gap: var(--space-3);
}
.nav__links a {
  font-size: 0.92rem;
  color: var(--stone);
  transition: color 0.2s ease;
}
.nav__links a:hover { color: var(--paper); }
.nav__actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.72rem 1.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-weight: 600;
  border: 1px solid transparent;
  transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }

.btn--gold {
  background: var(--gold);
  color: var(--ink);
}
.btn--gold:hover { background: var(--gold-soft); }

.btn--ghost {
  background: transparent;
  border-color: var(--line-soft);
  color: var(--paper);
}
.btn--ghost:hover { border-color: var(--gold); color: var(--gold-soft); }

.btn--text {
  background: transparent;
  color: var(--stone);
  padding: 0.72rem 0.4rem;
}
.btn--text:hover { color: var(--paper); }

.btn--block { width: 100%; }
.btn--sm { padding: 0.55rem 1.1rem; font-size: 0.85rem; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: var(--space-6) 0 var(--space-5);
  overflow: hidden;
}
.hero__inner {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: var(--space-5);
  align-items: center;
}
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--gold);
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: var(--gold);
}
.hero h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.4rem, 4.6vw, 3.85rem);
  line-height: 1.06;
  letter-spacing: -0.01em;
  margin: var(--space-2) 0 var(--space-3);
  color: var(--paper);
}
.hero h1 em {
  font-style: italic;
  color: var(--gold);
}
.hero__lede {
  font-size: 1.08rem;
  color: var(--stone);
  max-width: 46ch;
  margin-bottom: var(--space-4);
}
.hero__ctas {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.hero__note {
  margin-top: var(--space-3);
  font-size: 0.85rem;
  color: var(--stone-dim);
}

.hero__art {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1;
}
.hero__art .mark { width: 78%; height: 66%; }
.hero__art .tri {
  animation: rise 900ms cubic-bezier(.2,.8,.2,1) both;
}
.hero__art .tri--peak { animation-delay: 120ms; }
.hero__art .tri--left { animation-delay: 260ms; }
.hero__art .tri--right { animation-delay: 260ms; }
@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}
.hero__ring {
  position: absolute;
  inset: 6%;
  border: 1px solid var(--line-soft);
  border-radius: 50%;
}

/* ---------- Stages (Track / Follow / Close) ---------- */
.stages {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--ink-soft);
}
.stages__row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}
.stage {
  padding: var(--space-4) var(--space-3);
  border-left: 1px solid var(--line);
  display: flex;
  gap: var(--space-2);
  align-items: flex-start;
}
.stage:first-child { border-left: none; }
.stage__mark { width: 30px; height: 26px; flex-shrink: 0; margin-top: 0.2rem; }
.stage__index {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--stone-dim);
  letter-spacing: 0.1em;
}
.stage h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0.15rem 0 0.35rem;
}
.stage p {
  font-size: 0.92rem;
  color: var(--stone);
  max-width: 34ch;
}

/* ---------- Section shell ---------- */
.section {
  padding: var(--space-6) 0;
}
.section--tight { padding: var(--space-5) 0; }
.section__head {
  max-width: 60ch;
  margin-bottom: var(--space-5);
}
.section__head .eyebrow { margin-bottom: var(--space-2); }
.section__head h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.9rem, 3vw, 2.5rem);
  letter-spacing: -0.01em;
  margin-bottom: var(--space-2);
}
.section__head p {
  color: var(--stone);
  font-size: 1.02rem;
}

/* ---------- Services ledger ---------- */
.ledger {
  border-top: 1px solid var(--line);
}
.ledger__row {
  display: grid;
  grid-template-columns: 90px 1fr 1fr;
  gap: var(--space-4);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--line);
  align-items: start;
}
.ledger__code {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--stone-dim);
  padding-top: 0.3rem;
}
.ledger__title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--paper);
}
.ledger__desc {
  color: var(--stone);
  font-size: 0.96rem;
  max-width: 48ch;
}
.ledger__row:hover { background: var(--line-soft); }

/* ---------- Field note / quote strip ---------- */
.fieldnote {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--ink-soft);
}
.fieldnote__inner {
  padding: var(--space-5) 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-4);
  align-items: center;
}
.fieldnote .mark { width: 46px; height: 40px; }
.fieldnote blockquote {
  margin: 0;
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.25rem, 2.2vw, 1.6rem);
  line-height: 1.45;
  color: var(--paper);
  max-width: 58ch;
}
.fieldnote cite {
  display: block;
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--stone-dim);
  margin-top: var(--space-2);
}

/* ---------- Demo CTA ---------- */
.demo {
  text-align: center;
}
.demo__inner {
  max-width: 640px;
  margin: 0 auto;
}
.demo h2 {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 3vw, 2.6rem);
  font-weight: 600;
  margin-bottom: var(--space-2);
}
.demo p {
  color: var(--stone);
  margin-bottom: var(--space-4);
}
.demo__ctas {
  display: flex;
  justify-content: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: var(--space-4) 0;
}
.site-footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.site-footer .brand__word { font-size: 1.05rem; }
.site-footer .brand .mark { width: 20px; height: 17px; }
.footer__links {
  display: flex;
  gap: var(--space-4);
  font-size: 0.88rem;
  color: var(--stone);
}
.footer__links a:hover { color: var(--paper); }
.footer__meta {
  font-size: 0.8rem;
  color: var(--stone-dim);
  font-family: var(--font-mono);
}

/* =========================================================
   Demo Request Modal
   ========================================================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 9, 7, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-3);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.modal-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}
.modal {
  width: 100%;
  max-width: 460px;
  background: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  transform: translateY(14px);
  transition: transform 0.25s ease;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-overlay.is-open .modal { transform: translateY(0); }

.modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}
.modal__head h3 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}
.modal__head p {
  color: var(--stone);
  font-size: 0.9rem;
}
.modal__close {
  background: none;
  border: none;
  color: var(--stone);
  font-size: 1.4rem;
  line-height: 1;
  padding: 0.2rem;
}
.modal__close:hover { color: var(--paper); }

.field {
  margin-bottom: var(--space-3);
}
.field label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--stone-dim);
  margin-bottom: 0.4rem;
}
.field input {
  width: 100%;
  padding: 0.68rem 0.8rem;
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--paper);
  font-size: 0.95rem;
  font-family: var(--font-body);
}
.field input::placeholder { color: var(--stone-dim); }
.field input:focus {
  outline: none;
  border-color: var(--gold);
}
.field--error input { border-color: #B8543F; }
.field__error {
  display: none;
  color: #E08A73;
  font-size: 0.78rem;
  margin-top: 0.35rem;
}
.field--error .field__error { display: block; }

.modal__foot {
  margin-top: var(--space-2);
}
.modal__note {
  margin-top: var(--space-2);
  font-size: 0.78rem;
  color: var(--stone-dim);
  text-align: center;
}

/* ---------- Utility ---------- */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero__inner { grid-template-columns: 1fr; }
  .hero__art { order: -1; max-width: 260px; margin: 0 auto var(--space-3); }
  .nav__links { display: none; }
  .stages__row { grid-template-columns: 1fr; }
  .stage { border-left: none; border-top: 1px solid var(--line); }
  .stage:first-child { border-top: none; }
  .ledger__row { grid-template-columns: 1fr; gap: var(--space-1); }
  .ledger__code { padding-top: 0; }
  .fieldnote__inner { grid-template-columns: 1fr; text-align: center; justify-items: center; }
  .site-footer__inner { flex-direction: column; align-items: flex-start; text-align: left; }
}

@media (max-width: 560px) {
  .hero { padding: var(--space-5) 0 var(--space-4); }
  .hero__ctas { flex-direction: column; align-items: stretch; }
  .hero__ctas .btn { width: 100%; }
  .demo__ctas { flex-direction: column; }
  .demo__ctas .btn { width: 100%; }
}