/* Appflank site · the "Signal" direction: near-black, a 10-step gray that never reaches
   white, one teal signal color and one periwinkle for the masked state. Geist throughout,
   Geist Mono for anything that is data. */
:root {
  --bg: #0c0e12; --bg-2: #12151b; --bg-3: #191d25;
  --line: #262b36; --line-2: #343a48;
  --fg-3: #6b7385; --fg-2: #a3aabb; --fg: #dfe3ec;
  --accent: #38d1c1; --accent-ink: #062421; --masked: #7c8cff; --warn: #ffb454;
  --radius: 12px;
  --font: "Geist", system-ui, sans-serif; --mono: "Geist Mono", ui-monospace, monospace;
}
* { box-sizing: border-box; }
html { background: var(--bg); color: var(--fg); font-family: var(--font); scroll-behavior: smooth; }
body { margin: 0; line-height: 1.55; -webkit-font-smoothing: antialiased; }
body::after { /* film grain, very light */
  content: ""; position: fixed; inset: 0; pointer-events: none; opacity: .045; mix-blend-mode: screen;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { letter-spacing: -.03em; line-height: 1.05; margin: 0; font-weight: 600; }
h1 { font-size: clamp(38px, 6vw, 68px); }
h2 { font-size: clamp(24px, 3vw, 30px); margin-top: 88px; }
h3 { font-size: 18px; letter-spacing: -.01em; }
p { margin: 12px 0 0; color: var(--fg-2); max-width: 62ch; }
p.lede { font-size: 19px; }
small, .muted { color: var(--fg-3); }
code, .mono { font-family: var(--mono); font-size: .92em; }
code { background: var(--bg-3); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; color: var(--fg-2); }

/* nav */
nav { display: flex; align-items: center; justify-content: space-between; padding: 22px 0; gap: 16px; flex-wrap: wrap; }
nav .brand { font-weight: 600; color: var(--fg); font-size: 17px; }
nav .brand:hover { text-decoration: none; }
nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 22px; flex-wrap: wrap; }
nav ul a { color: var(--fg-2); font-size: 15px; }
nav ul a[aria-current] { color: var(--fg); }
nav ul a:hover { color: var(--fg); text-decoration: none; }

/* hero */
.hero { padding: 64px 0 24px; }
.hero h1 { max-width: 15ch; }
.hero h1 .l2 { color: var(--fg-2); display: block; }
.btns { display: flex; gap: 10px; margin-top: 28px; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 18px; border-radius: 999px; font-weight: 500; font-size: 15px;
       border: 1px solid var(--line-2); color: var(--fg); background: var(--bg-2); transition: transform .15s ease, border-color .15s ease; }
.btn:hover { transform: translateY(-1px); border-color: var(--fg-3); text-decoration: none; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn.primary:hover { filter: brightness(1.06); }

/* panels and cards */
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2); padding: 24px; margin-top: 20px; overflow: hidden; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin-top: 20px; }
.card { border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; background: linear-gradient(180deg, var(--bg-2), var(--bg)); }
.card p { font-size: 15px; }
.card .n { font-family: var(--mono); font-size: 12px; color: var(--accent); letter-spacing: .08em; margin-bottom: 10px; display: block; }
.pill { display: inline-block; font-family: var(--mono); font-size: 11px; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--fg-2); margin-bottom: 12px; white-space: nowrap; }
.pill.on { color: var(--accent); border-color: rgba(56,209,193,.4); }
.pill.mid { color: var(--warn); border-color: rgba(255,180,84,.4); }

/* figure: the proxy line */
figure { margin: 0; }
figure svg { width: 100%; height: auto; display: block; }
figcaption { font-size: 14px; color: var(--fg-3); margin-top: 12px; }
.lbl { font-family: var(--mono); font-size: 11px; fill: var(--fg-3); letter-spacing: .06em; }
.box { fill: var(--bg-3); stroke: var(--line-2); }
.wire { stroke: var(--line-2); stroke-width: 1.5; fill: none; }
.dot { r: 4; fill: var(--accent); }
.dot.masked { fill: var(--masked); }
@keyframes travel { from { offset-distance: 0%; } to { offset-distance: 100%; } }
.p1 { offset-path: path("M 40 60 H 300"); animation: travel 2.4s linear infinite; }
.p2 { offset-path: path("M 300 60 H 640"); animation: travel 2.4s linear infinite; }
.p3 { offset-path: path("M 300 60 C 340 60 360 130 400 130 H 640"); animation: travel 2.4s linear infinite; }
.p1.d0 { animation-delay: 0s; } .p1.d1 { animation-delay: .8s; } .p1.d2 { animation-delay: 1.6s; }
.p2.d0, .p3.d0 { animation-delay: 1.2s; } .p2.d1, .p3.d1 { animation-delay: 2s; } .p2.d2, .p3.d2 { animation-delay: 2.8s; }

/* reveal on scroll */
.js .rv { opacity: 0; transform: translateY(12px); transition: opacity .5s ease, transform .5s ease; }
.js .rv.in { opacity: 1; transform: none; }

/* tables */
table { border-collapse: collapse; width: 100%; margin-top: 20px; font-size: 15px; }
th, td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--fg-3); font-weight: 500; font-size: 13px; }
td:first-child { color: var(--fg); white-space: nowrap; }
td p { margin: 0; font-size: 15px; }

/* steps */
.steps { counter-reset: s; display: grid; gap: 12px; margin-top: 20px; }
.step { border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2); padding: 20px 22px 20px 64px; position: relative; }
.step::before { counter-increment: s; content: counter(s, decimal-leading-zero); position: absolute; left: 22px; top: 22px; font-family: var(--mono); font-size: 13px; color: var(--accent); }
.step p { font-size: 15px; }

/* masked value demo */
.demo { display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; align-items: center; margin-top: 20px; }
.demo .arrow .v { display: none; }
@media (max-width: 720px) { .demo { grid-template-columns: 1fr; } .demo .arrow .h { display: none; } .demo .arrow .v { display: inline; } .demo pre { font-size: 12px; } }
.demo pre { margin: 0; font-family: var(--mono); font-size: 13px; line-height: 1.6; background: var(--bg-3); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; overflow-x: auto; color: var(--fg-2); scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.demo .raw { color: var(--warn); }
.demo .m { color: var(--masked); }
.demo .arrow { font-family: var(--mono); color: var(--fg-3); text-align: center; }

footer { color: var(--fg-3); font-size: 13px; padding: 48px 0 40px; border-top: 1px solid var(--line); margin-top: 96px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
footer a { color: var(--fg-2); }

@media (prefers-reduced-motion: reduce) { .p1, .p2, .p3 { animation: none; } .rv { opacity: 1; transform: none; } html { scroll-behavior: auto; } }
