/* Agent Brick public site: same light system as the analyst app.
   Lightly derived from IFC's identity: navy #002345, blue #0071BC, sky #00ADE4, light grey #F0F2F4. */
:root {
  --bg: #f4f6f8;
  --card: #ffffff;
  --navy: #002345;
  --ink: #1b2a3a;
  --ink-2: #4a5a6c;
  --muted: #6b7a8c;
  --line: #dde3ea;
  --line-2: #c9d2dc;
  --blue: #0071bc;
  --sky: #00ade4;
  --ok: #1e7f4f;
  --ok-soft: #e7f4ec;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --r: 6px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}
* { box-sizing: border-box; }
html { background: var(--bg); scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--bg); font: 17px/1.65 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--blue); }
svg { max-width: 100%; }
[hidden] { display: none !important; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
h1, h2, h3 { color: var(--navy); letter-spacing: -.02em; }
h2 { font-size: 28px; line-height: 1.2; margin: 0 0 10px; }
h3 { font-size: 17px; line-height: 1.3; margin: 0 0 4px; letter-spacing: -.01em; }
.lede { font-size: 19px; color: var(--ink-2); max-width: 38em; margin: 0; }
.muted { color: var(--muted); }

/* ---------- header ---------- */
.top { position: sticky; top: 0; z-index: 10; background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px);
       border-bottom: 1px solid var(--line); transition: box-shadow .25s var(--ease); }
.top.scrolled { box-shadow: 0 6px 20px rgba(0, 35, 69, .06); }
.top::after { content: ""; position: absolute; left: 0; bottom: -1px; height: 2px; width: min(420px, 50%);
              background: linear-gradient(90deg, var(--sky), rgba(0, 173, 228, 0)); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; padding-top: 14px; padding-bottom: 14px; flex-wrap: wrap; }
.brand { font: 700 19px/1 var(--sans); color: var(--navy); text-decoration: none; letter-spacing: -.01em; }
nav { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
nav a { color: var(--ink-2); text-decoration: none; font-size: 15px; font-weight: 500; transition: color .15s; }
nav a:hover, nav a[aria-current="page"] { color: var(--navy); }

/* sliding underline for text links */
a.ul { position: relative; text-decoration: none; }
a.ul::after { content: ""; position: absolute; left: 0; right: 0; bottom: -3px; height: 1.5px; background: currentColor;
              transform: scaleX(0); transform-origin: right; transition: transform .25s var(--ease); }
a.ul:hover::after, a.ul[aria-current="page"]::after { transform: scaleX(1); transform-origin: left; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; font: 600 16px/1 var(--sans); text-decoration: none; padding: 14px 22px;
       border-radius: var(--r); transition: background .2s, transform .2s var(--ease), box-shadow .2s var(--ease); }
.btn.primary { background: var(--navy); color: #fff; box-shadow: 0 1px 2px rgba(0, 35, 69, .12); }
.btn.primary:hover { background: #003466; transform: translateY(-1px); box-shadow: 0 8px 20px rgba(0, 35, 69, .18); }
.btn:active { transform: translateY(0) scale(.98); box-shadow: 0 1px 2px rgba(0, 35, 69, .12); }
.btn.secondary { background: var(--card); color: var(--navy); border: 1px solid var(--line-2); }
.btn.small { padding: 9px 14px; font-size: 14px; }
nav .btn.primary { color: #fff; }
.btn .arr { display: inline-block; transition: transform .25s var(--ease); }
.btn:hover .arr { transform: translateX(4px); }
.btn:focus-visible, nav a:focus-visible, a.ul:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }

/* ---------- sections ---------- */
section { padding: 88px 0; }
section.alt { background: var(--card); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { margin-bottom: 32px; }

/* ---------- hero with globe ---------- */
.hero { padding: 56px 0 64px; overflow: hidden; }
.hero .wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
.hero h1 { font-size: clamp(36px, 5vw, 54px); line-height: 1.07; margin: 0 0 20px; }
.hero .cta { margin-top: 32px; }
.hero .note { margin-top: 12px; font-size: 14px; color: var(--muted); }

.globe { position: relative; margin: 0; display: grid; justify-items: center; }
.globe canvas { display: block; touch-action: pan-y; max-width: 100%; }
.globe figcaption { margin-top: 6px; font-size: 13px; color: var(--muted); letter-spacing: .01em; }
.globe-tip { position: absolute; left: 0; top: 0; pointer-events: none; white-space: nowrap; padding: 7px 11px; border-radius: var(--r);
             background: var(--navy); color: #fff; font-size: 13px; line-height: 1.3; box-shadow: 0 6px 18px rgba(0, 35, 69, .2);
             opacity: 0; transition: opacity .15s; }
.globe-tip.on { opacity: 1; }
.globe-tip b { display: block; font-weight: 600; }
.globe-tip span { color: #c9d8e8; }

/* ---------- diagram ---------- */
.diagram { background: var(--bg); border: 1px solid var(--line); border-radius: var(--r); padding: 28px 24px 18px; }
.diagram .v { display: none; }
@keyframes march { to { stroke-dashoffset: -22; } }

/* ---------- example + checks ---------- */
.checks-split { display: grid; grid-template-columns: .9fr 1.1fr; gap: 56px; align-items: center; }
.sample { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: 0 16px 40px rgba(0, 35, 69, .08); padding: 20px 22px; }
.sample .tag { font-size: 12px; font-weight: 600; color: var(--muted); }
.sample .q { font-weight: 600; color: var(--navy); margin: 4px 0 12px; }
.sample .a { border: 1px solid var(--line); border-left: 3px solid var(--ok); border-radius: 4px; transition: border-color .4s; position: relative; overflow: hidden; }
.sample .a-head { font-size: 12px; font-weight: 600; color: var(--ok); background: var(--ok-soft); padding: 6px 12px; border-bottom: 1px solid var(--line); transition: color .4s, background .4s; }
.sample .a-body { padding: 10px 12px; font-size: 15px; transition: color .4s; }
.sample .a-body strong { color: var(--navy); }
.sample .a.draft { border-left-color: var(--sky); }
.sample .a.draft .a-head { color: #00668a; background: #f2fafd; }
.sample .a.draft .a-body { color: var(--muted); }
.sample .a.draft::before { content: ""; position: absolute; left: 0; top: 0; height: 2px; width: 35%; background: var(--sky); animation: slide 1.3s ease-in-out infinite; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(300%); } }
.sample .checks { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; }
.sample .checks span { font-size: 12px; font-weight: 600; color: var(--muted); border-top: 3px solid var(--line); padding-top: 6px; transition: color .3s, border-color .3s; }
.sample .checks span::before { content: "○ "; color: var(--line-2); }
.sample .checks span.ok { color: var(--ink); border-top-color: var(--ok); }
.sample .checks span.ok::before { content: "✓ "; color: var(--ok); display: inline-block; animation: pop .35s var(--ease); }
@keyframes pop { 0% { transform: scale(.4); opacity: 0; } 70% { transform: scale(1.25); } 100% { transform: scale(1); opacity: 1; } }
.sample .conf { display: flex; align-items: center; gap: 10px; margin-top: 12px; font-size: 13px; color: var(--muted); }
.sample .conf b { font-size: 20px; color: var(--navy); font-variant-numeric: tabular-nums; min-width: 3.2em; }
.sample .bar { flex: 1; height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.sample .bar i { display: block; height: 100%; width: 100%; background: var(--ok); transition: width .9s var(--ease); }

.grid2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; }
.card p { margin: 0; color: var(--ink-2); font-size: 16px; }
.check-card { border-top: 3px solid var(--ok); transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s; }
.check-card:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(0, 35, 69, .08); }
.after { margin: 24px 0 0; color: var(--ink-2); max-width: 40em; }
.after b { color: var(--navy); font-weight: 600; }

/* ---------- motion (only when JS confirms motion is welcome) ---------- */
.motion .rise, .motion .reveal { opacity: 0; transform: translateY(14px); }
.motion .rise { animation: rise .8s var(--ease) forwards; }
.motion .rise.d1 { animation-delay: .08s; } .motion .rise.d2 { animation-delay: .16s; } .motion .rise.d3 { animation-delay: .24s; }
@keyframes rise { to { opacity: 1; transform: none; } }
.motion .reveal { transition: opacity .7s var(--ease), transform .7s var(--ease); }
.motion .reveal.in { opacity: 1; transform: none; }
.motion .reveal.d1 { transition-delay: .05s; } .motion .reveal.d2 { transition-delay: .12s; }
.motion .reveal.d3 { transition-delay: .19s; } .motion .reveal.d4 { transition-delay: .26s; }
.motion .globe { opacity: 0; transform: scale(.96); transition: opacity 1.2s var(--ease), transform 1.2s var(--ease); }
.motion .globe.ready { opacity: 1; transform: none; }

/* diagram: steps appear in order, arrows draw, the feedback loop flows */
.motion .diagram .node { opacity: 0; transform: translateY(8px); transition: opacity .5s var(--ease), transform .5s var(--ease); transform-box: fill-box; }
.motion .diagram .flow { stroke-dasharray: 60; stroke-dashoffset: 60; transition: stroke-dashoffset .45s var(--ease); }
.motion .diagram .loop { opacity: 0; transition: opacity .6s var(--ease); }
.motion .diagram.in .node { opacity: 1; transform: none; }
.motion .diagram.in .n2 { transition-delay: .35s; } .motion .diagram.in .n3 { transition-delay: .7s; } .motion .diagram.in .n4 { transition-delay: 1.05s; }
.motion .diagram.in .flow { stroke-dashoffset: 0; }
.motion .diagram.in .f1 { transition-delay: .2s; } .motion .diagram.in .f2 { transition-delay: .55s; } .motion .diagram.in .f3 { transition-delay: .9s; }
.motion .diagram.in .loop { opacity: 1; transition-delay: 1.3s; }
.motion .diagram.in .loop path { animation: march 1.4s linear infinite 1.9s; }
.motion .diagram .node rect { transition: filter .2s; }
.motion .diagram .node:hover rect { filter: drop-shadow(0 4px 10px rgba(0, 35, 69, .12)); }

/* ---------- about page ---------- */
.page { padding: 64px 0 80px; }
.prose { max-width: 680px; }
.prose h1 { font-size: 36px; line-height: 1.15; margin: 0 0 14px; }
.prose h2 { font-size: 21px; margin: 36px 0 8px; }
.prose p, .prose li { color: var(--ink-2); }
.prose ul { padding-left: 20px; }
.prose li { margin: 6px 0; }
.prose strong { color: var(--navy); }
.cta-line { margin-top: 32px; }
.notice { margin-top: 28px; font-size: 14px; color: var(--muted); }

footer { border-top: 1px solid var(--line); background: var(--card); color: var(--muted); font-size: 14px; }
footer .wrap { padding-top: 20px; padding-bottom: 20px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
footer a { color: var(--ink-2); }

.not-found { min-height: 60vh; display: grid; place-items: center; text-align: center; }

@media (max-width: 900px) {
  .hero .wrap { grid-template-columns: 1fr; gap: 24px; }
  .hero-text { order: 1; }
  .globe { order: 2; max-width: 460px; margin: 0 auto; width: 100%; }
  .checks-split { grid-template-columns: 1fr; gap: 36px; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  section { padding: 56px 0; }
  .hero { padding: 40px 0 48px; }
  .wrap { padding: 0 16px; }
  h2 { font-size: 24px; }
  .lede { font-size: 17px; }
  nav { gap: 16px; }
  .grid2 { grid-template-columns: 1fr; }
  .diagram .h { display: none; }
  .diagram .v { display: block; max-width: 340px; margin: 0 auto; }
  .sample .checks { grid-template-columns: repeat(2, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
