/* ============================================================
   ADP — Agent Deal Profile. Sandbox v0.1 visual design.

   Concept: a signed ledger between two independent machine
   parties. A wax-seal gold marks an honoured agreement; a
   broken-seal red marks a denied one. Everything that is data
   (hashes, signatures, ids) is set in monospace, on purpose —
   this is the one place a monospace face earns its keep: it is
   literally what a machine would read.
   ============================================================ */

@font-face {
  font-family: "Fraunces";
  src: local("Fraunces");
}

:root {
  --ink: #0b0e14;
  --ink-raised: #10141c;
  --surface: #141a24;
  --rule: #262f3d;
  --rule-strong: #3a4557;
  --text: #e8eaf0;
  --muted: #8891a3;
  --faint: #5a6377;

  --seal: #c9a227;       /* wax-seal gold: agreement held */
  --seal-dim: #8a7025;
  --broken: #c1432d;     /* broken seal: agreement violated */
  --broken-dim: #8a3324;

  --rail: 1px;
  --measure: 62ch;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: "Fraunces", Georgia, "Iowan Old Style", serif;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin: 0 0 0.4em;
}

a, button, input { font-family: inherit; }

:focus-visible {
  outline: 2px solid var(--seal);
  outline-offset: 3px;
}

.wrap {
  max-width: 920px;
  margin: 0 auto;
  padding: 56px 20px;
}

.explain .wrap { padding-top: 36px; }

section, header.hero { border-bottom: var(--rail) solid var(--rule); }

p { max-width: var(--measure); }
.wrap > p, .wrap > .lede { margin-left: 0; }

/* ---------- Language switcher ---------- */

.lang-switch {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 20;
}

.lang-switch-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 8px 14px;
  background: var(--ink-raised);
  color: var(--muted);
  border: var(--rail) solid var(--rule);
  border-radius: 999px;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
}

.lang-switch-btn:hover { color: var(--text); border-color: var(--rule-strong); }

.lang-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  margin: 0;
  padding: 6px;
  list-style: none;
  min-width: 160px;
  background: var(--surface);
  border: var(--rail) solid var(--rule-strong);
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(0,0,0,0.4);
  display: none;
  flex-direction: column;
}

.lang-menu.open { display: flex; }

.lang-menu button {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  text-align: left;
  background: transparent;
  color: var(--text);
  border: none;
  border-radius: 6px;
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
}

.lang-menu button:hover,
.lang-menu button:focus-visible { background: var(--ink-raised); }

@media (min-width: 560px) {
  .lang-switch { top: 18px; right: 20px; }
}

/* ---------- Hero ---------- */

.hero { padding-top: 8px; }
.hero .wrap {
  padding-top: 64px;
  padding-bottom: 40px;
  max-width: 1180px;
}

.hero-grid {
  display: grid;
  gap: 32px;
}

@media (min-width: 900px) {
  .hero-grid {
    grid-template-columns: 0.85fr 1.15fr;
    align-items: center;
    gap: 40px;
  }
}

.eyebrow {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.6em;
}

.hero h1.tagline,
.tagline {
  font-family: "Fraunces", serif;
  font-weight: 600;
  font-size: clamp(2.1rem, 4.2vw, 3rem);
  line-height: 1.08;
  color: var(--text);
  margin: 0 0 0.5em;
}

.lede {
  color: var(--muted);
  font-size: 0.98rem;
  max-width: 36ch;
}
.lede .line { display: block; }

.audience-line {
  color: var(--faint);
  font-size: 0.8rem;
  margin: 16px 0 0;
}

.cta-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 26px;
  align-items: flex-start;
}
@media (min-width: 480px) {
  .cta-row { flex-direction: row; flex-wrap: wrap; align-items: center; }
}

.btn {
  background: transparent;
  border: var(--rail) solid var(--rule-strong);
  color: var(--text);
  padding: 13px 22px;
  border-radius: 2px;
  cursor: pointer;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  min-height: 46px;
  width: 100%;
  transition: border-color 150ms ease, background 150ms ease, color 150ms ease;
}
@media (min-width: 480px) { .btn { width: auto; } }

.btn:hover { border-color: var(--seal); color: var(--seal); }
.btn.primary {
  background: var(--seal);
  border-color: var(--seal);
  color: #16130a;
  font-weight: 600;
}
.btn.primary:hover { background: #ddb43a; color: #16130a; }
.btn.danger { border-color: var(--broken); color: var(--broken); }
.btn.danger:hover { background: var(--broken); color: var(--ink); }

.btn-tertiary {
  display: inline-block;
  margin-top: 14px;
  background: none;
  border: none;
  padding: 4px 0;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: var(--rule-strong);
  text-underline-offset: 3px;
}
.btn-tertiary:hover { color: var(--seal); text-decoration-color: var(--seal); }

/* ---------- Hero visual: the agent concept image, then the deal
   diagram beneath it as the textual propose/accept reinforcement.
   Image is masked into the dark background (no hard stock-photo
   rectangle) with a soft gold glow behind it. ---------- */

.hero-visual {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.hero-image-frame {
  position: relative;
  max-width: 360px;
  margin: 0 auto;
}

.hero-image-frame::before {
  content: "";
  position: absolute;
  inset: -10%;
  background: radial-gradient(ellipse at center, rgba(201, 162, 39, 0.22) 0%, rgba(201, 162, 39, 0) 70%);
  z-index: 0;
  pointer-events: none;
}

.hero-image {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: auto;
  max-height: 440px;
  object-fit: cover;
  object-position: center 30%;
  border-radius: 6px;
  -webkit-mask-image: linear-gradient(to bottom, black 78%, transparent 100%);
  mask-image: linear-gradient(to bottom, black 78%, transparent 100%);
}

@media (min-width: 900px) {
  .hero-image-frame { max-width: 100%; }
  .hero-image { max-height: 480px; }
}

/* ---------- Deal diagram (two independent agents + the agreement that
   joins them). This is the hero's one bold element -- everything else on
   the page stays quiet so this reads immediately as "two parties agree,
   the agreement is the thing in the middle". ---------- */

.deal-diagram {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: stretch;
}

@media (min-width: 540px) {
  /* Desktop/tablet: requester -- agreement -- provider, left to right,
     so reading order matches the propose/accept direction. minmax floors
     stop a long German/French label forcing one-word-per-line wrapping. */
  .deal-diagram {
    grid-template-columns: minmax(150px, 1fr) minmax(150px, 0.9fr) minmax(150px, 1fr);
    gap: 0;
  }
}

.agent-node {
  position: relative;
  padding: 24px 20px;
  background: var(--surface);
  border: var(--rail) solid var(--rule);
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 108px;
}
@media (min-width: 540px) {
  .agent-node.requester { border-right: 0; }
  .agent-node.provider { border-left: 0; }
}

.agent-node-role {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--faint);
  margin-bottom: 8px;
}
.agent-node-name {
  font-family: "Fraunces", serif;
  font-size: 1.1rem;
  line-height: 1.32;
  color: var(--text);
  overflow-wrap: break-word;
  hyphens: auto;
}

.deal-center {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 22px 16px;
  background: var(--ink-raised);
  border: var(--rail) solid var(--seal-dim);
}

.deal-seal {
  width: 52px; height: 52px;
  border: 2px solid var(--seal);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: "Fraunces", serif;
  color: var(--seal);
  font-size: 1rem;
  margin: 0 auto 8px;
  background: var(--ink);
}
.deal-seal-label {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--muted);
}

/* Two small directional lines: proposal flows one way, acceptance the
   other -- a static (no animation) cue that this is a two-party
   back-and-forth, not just three boxes in a row. */
.deal-flow {
  margin-top: 10px;
  font-size: 0.68rem;
  letter-spacing: 0.02em;
  color: var(--faint);
}
.deal-flow .deal-flow-arrow { color: var(--seal); margin-right: 4px; }
.deal-flow.reverse { margin-top: 3px; }

/* Connecting lines between the two agent nodes and the agreement, drawn
   as borders on the pseudo-elements so they size with the layout instead
   of being hand-positioned absolute divs that could clip at odd widths. */
@media (min-width: 540px) {
  .deal-center::before,
  .deal-center::after {
    content: "";
    position: absolute;
    top: 50%;
    height: var(--rail);
    background: var(--rule-strong);
    width: 16px;
  }
  .deal-center::before { left: -16px; }
  .deal-center::after { right: -16px; }
}

/* ---------- Explain / flow ---------- */

.flow {
  display: grid;
  gap: 0;
  margin: 1.4em 0 1.6em;
  border: var(--rail) solid var(--rule);
}
@media (min-width: 760px) {
  .flow { grid-template-columns: repeat(5, 1fr); }
}

.flow-step {
  padding: 16px 16px;
  border-top: var(--rail) solid var(--rule);
  position: relative;
}
.flow-step:first-child { border-top: 0; }
@media (min-width: 760px) {
  .flow-step { border-top: 0; border-left: var(--rail) solid var(--rule); }
  .flow-step:first-child { border-left: 0; }
}
.flow-step .seq { font-size: 0.72rem; color: var(--faint); letter-spacing: 0.08em; }
.flow-step .title { font-family: "Fraunces", serif; font-size: 1.05rem; margin: 2px 0 2px; }
.flow-step .sub { font-size: 0.82rem; color: var(--muted); }
.flow-step.emphasis { background: var(--surface); }
.flow-step.emphasis .title { color: var(--seal); }

.defs {
  list-style: none;
  padding: 0;
  margin: 1.2em 0;
  display: grid;
  gap: 6px;
}
.defs li { color: var(--muted); }
.defs strong { color: var(--text); }

.note {
  color: var(--faint);
  font-size: 0.82rem;
  border-left: 2px solid var(--rule-strong);
  padding-left: 12px;
  margin-top: 1.2em;
  max-width: var(--measure);
}

/* ---------- Demo ---------- */

.example-box {
  border: var(--rail) solid var(--rule);
  background: var(--surface);
  padding: 16px 18px;
  margin: 18px 0 22px;
  font-size: 0.88rem;
}
.example-box strong { color: var(--seal); font-weight: 600; }

.steps { margin-top: 24px; display: flex; flex-direction: column; gap: 0; }
.step-card {
  border-top: var(--rail) solid var(--rule);
  padding: 14px 0;
}
.step-card:first-child { border-top: var(--rail) solid var(--rule); }
.step-card .step-title { font-weight: 600; color: var(--text); margin-bottom: 4px; }
.step-card .step-detail { color: var(--muted); font-size: 0.92rem; }

details.crypto {
  margin-top: 8px;
  border: var(--rail) dashed var(--rule-strong);
  padding: 8px 12px;
}
details.crypto summary {
  cursor: pointer;
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}
details.crypto summary:hover { color: var(--seal); }
.mono {
  font-size: 0.78rem;
  color: var(--muted);
  word-break: break-all;
  margin-top: 6px;
}
.mono b { color: var(--text); }

.decision-allowed, .decision-denied {
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 2px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.decision-allowed { color: var(--seal); border: 1px solid var(--seal); }
.decision-denied { color: var(--broken); border: 1px solid var(--broken); }
.decision-allowed::before { content: "✓"; }
.decision-denied::before { content: "✕"; }

.tamper-section {
  margin-top: 28px;
  padding: 20px;
  border: var(--rail) solid var(--broken-dim);
  background: var(--ink-raised);
}
.tamper-section h3 { margin-top: 0; }
.tamper-section .field-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 14px 0;
}
@media (min-width: 560px) {
  .tamper-section .field-row { flex-direction: row; align-items: flex-end; flex-wrap: wrap; }
}
.tamper-section label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.82rem;
  color: var(--muted);
}
.tamper-section input {
  background: var(--ink);
  border: var(--rail) solid var(--rule-strong);
  color: var(--text);
  padding: 10px;
  width: 110px;
  min-height: 44px;
  font-family: inherit;
}

.tamper-sequence {
  display: grid;
  gap: 0;
  margin-top: 16px;
  border: var(--rail) solid var(--rule);
}
@media (min-width: 640px) {
  .tamper-sequence { grid-template-columns: 1fr 1fr; }
}
.tamper-sequence > div {
  padding: 12px 14px;
  border-top: var(--rail) solid var(--rule);
  font-size: 0.82rem;
}
.tamper-sequence > div:nth-child(-n+2) { border-top: 0; }
@media (min-width: 640px) {
  .tamper-sequence > div:nth-child(2n) { border-left: var(--rail) solid var(--rule); }
}
.tamper-sequence .k { color: var(--faint); display: block; margin-bottom: 4px; }
.tamper-break {
  padding: 14px;
  text-align: center;
  background: var(--ink);
}

.divider { height: var(--rail); background: var(--rule); margin: 36px 0; border: 0; }

h3.sub-heading { font-size: 1.05rem; color: var(--muted); font-weight: 500; }

/* ---------- Connect / Partner ---------- */

.connect ul, .partner ul { list-style: none; padding: 0; margin: 1em 0; display: grid; gap: 6px; }
.connect li::before, .partner li::before { content: "— "; color: var(--faint); }

.quote {
  font-family: "Fraunces", serif;
  font-style: italic;
  color: var(--text);
  border-left: 2px solid var(--seal);
  padding-left: 16px;
  margin: 1.2em 0;
  max-width: var(--measure);
}

/* ---------- Results ---------- */

.results ul { list-style: none; padding: 0; display: grid; gap: 8px; margin: 1em 0; }
.results li { padding-left: 1.3em; position: relative; }
.results li::before { content: "✓"; position: absolute; left: 0; color: var(--seal); }

/* ---------- Counters ---------- */

.counter-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
  border: var(--rail) solid var(--rule);
  margin-top: 8px;
}
@media (min-width: 640px) { .counter-row { grid-template-columns: repeat(4, 1fr); } }
.counter-row > div {
  padding: 16px;
  border-top: var(--rail) solid var(--rule);
  font-size: 0.8rem;
  color: var(--muted);
}
.counter-row > div:nth-child(-n+2) { border-top: 0; }
.counter-row > div:nth-child(2n) { border-left: var(--rail) solid var(--rule); }
@media (min-width: 640px) {
  .counter-row > div { border-top: 0; border-left: var(--rail) solid var(--rule); }
  .counter-row > div:first-child { border-left: 0; }
}
.counter-row strong { display: block; font-family: "Fraunces", serif; font-size: 1.5rem; color: var(--text); }

footer { color: var(--faint); font-size: 0.78rem; text-align: center; border-bottom: 0; }

/* ---------- Motion: one orchestrated hero reveal only ----------
   Deliberately transform-only (never opacity-from-0): content must be
   fully visible and readable even if the animation never runs or paint
   is captured mid-flight (e.g. a screenshot taken before the first
   frame), per the explicit "no opacity:0 without JS activation" check. */

.eyebrow, .tagline, .lede, .cta-row, .hero-visual {
  animation: rise 420ms ease both;
}
.tagline { animation-delay: 60ms; }
.lede { animation-delay: 100ms; }
.cta-row { animation-delay: 140ms; }
.hero-visual { animation-delay: 90ms; }

@keyframes rise {
  from { transform: translateY(8px); }
  to { transform: translateY(0); }
}

.pulse-once { animation: pulse 700ms ease; }
@keyframes pulse {
  0% { background-color: var(--surface); }
  40% { background-color: var(--ink-raised); }
  100% { background-color: transparent; }
}

/* ---------- Simple example (MILO / BYTE / Chihuahua) ----------
   A concrete, memorable story told with the same restrained, serious
   visual language as the rest of the site -- no cartoon treatment. */

.simple-sub { color: var(--muted); margin-top: -0.4em; }

.simple-story {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin: 1.6em 0;
}
@media (min-width: 760px) {
  .simple-story { grid-template-columns: 1fr 1.1fr 1fr; align-items: stretch; }
}

.simple-card {
  background: var(--surface);
  border: var(--rail) solid var(--rule);
  padding: 20px;
}
.simple-card-label {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--faint);
  margin-bottom: 10px;
}
.simple-card-body { color: var(--text); font-size: 0.92rem; }
.simple-quote {
  display: block;
  margin-top: 8px;
  font-family: "Fraunces", serif;
  font-style: italic;
  color: var(--text);
  font-size: 1.02rem;
}

.simple-agreement {
  background: var(--ink-raised);
  border-color: var(--seal-dim);
  text-align: center;
}
.simple-card-label.seal {
  color: var(--seal);
  font-weight: 700;
  font-size: 0.8rem;
}
.simple-card-sublabel {
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  color: var(--faint);
  margin-bottom: 14px;
}
.simple-agreement-intro { color: var(--muted); font-size: 0.88rem; margin: 0 0 0.6em; }
.simple-criteria {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 6px;
  text-align: left;
  color: var(--text);
  font-size: 0.9rem;
}
.simple-criteria span[aria-hidden] { color: var(--seal); margin-right: 4px; }

.simple-verification {
  margin-top: 4px;
  border: var(--rail) solid var(--broken-dim);
  background: var(--ink-raised);
  padding: 18px 20px;
}
.simple-verification-flag {
  display: inline-block;
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  color: var(--broken);
  border: 1px solid var(--broken);
  padding: 3px 8px;
  margin-bottom: 10px;
}
.simple-verification-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  font-size: 0.9rem;
  border-top: var(--rail) solid var(--rule);
}
.simple-verification-row:first-of-type { border-top: 0; }
.simple-verification-row .k { color: var(--faint); }
.simple-verification-row .v.broken { color: var(--broken); font-weight: 600; }

/* ---------- Without / With ADP comparison ---------- */

.comparison-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  margin-top: 1.2em;
  border: var(--rail) solid var(--rule);
}
@media (min-width: 700px) {
  .comparison-grid { grid-template-columns: 1fr 1fr; }
}
.comparison-col { padding: 22px; }
.comparison-col.without { border-bottom: var(--rail) solid var(--rule); }
@media (min-width: 700px) {
  .comparison-col.without { border-bottom: 0; border-right: var(--rail) solid var(--rule); }
}
.comparison-col h3 { font-size: 1rem; letter-spacing: 0.04em; margin-bottom: 0.7em; }
.comparison-col.without h3 { color: var(--faint); }
.comparison-col.with h3 { color: var(--seal); }
.comparison-line { font-size: 0.92rem; color: var(--text); margin: 0.4em 0; }
.comparison-problem {
  margin-top: 1em;
  font-size: 0.86rem;
  color: var(--muted);
  border-left: 2px solid var(--broken-dim);
  padding-left: 12px;
}
.comparison-problem .k { color: var(--broken); display: block; font-size: 0.74rem; letter-spacing: 0.04em; margin-bottom: 4px; }
.comparison-criteria {
  list-style: none;
  padding: 0;
  margin: 0.8em 0;
  display: grid;
  gap: 6px;
  color: var(--text);
  font-size: 0.9rem;
}
.comparison-criteria li::before { content: "✓ "; color: var(--seal); }

/* ---------- For builders (technical-content intro) ---------- */

.builders-intro {
  color: var(--muted);
  font-size: 0.95rem;
  max-width: var(--measure);
  margin: 0.3em 0 1.2em;
}
