:root {
  --bg: #08090a;
  --bg-2: #0e0f10;
  --bg-3: #131415;
  --line: rgba(255,255,255,.08);
  --line-2: rgba(255,255,255,.14);
  --text: #f2f3f4;
  --text-2: #b0b6c2;
  --text-3: #868b94;
  --text-4: #5d6168;
  --green: #4fae84;
  --amber: #d39a4c;
  --blue: #6c8cff;
  --violet: #a08bff;
  --red: #e5735c;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --wrap: 1180px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 16px/1.65 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-weight: 500; margin: 0; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 32px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--text); color: var(--bg); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--text-2); outline-offset: 3px; }

/* Header */
.top { position: sticky; top: 0; z-index: 20; background: rgba(8,9,10,.82); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.top-in { display: flex; align-items: center; height: 64px; gap: 48px; }
.brand { display: flex; align-items: center; }
.brand img { height: 16px; width: auto; display: block; }
nav { display: flex; gap: 32px; font-size: 14px; color: var(--text-3); flex: 1; }
nav a:hover, .top-cta:hover { color: var(--text); }
.top-cta { font-size: 14px; color: var(--text-2); border: 1px solid var(--line-2); padding: 6px 14px; border-radius: 6px; }

/* Shared */
.label { font: 500 12px/1 var(--mono); text-transform: uppercase; letter-spacing: .12em; color: var(--text-3); margin: 0 0 24px; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; font-size: 15px; font-weight: 500; padding: 11px 22px; border-radius: 6px; transition: background .15s, border-color .15s; }
.btn.primary { background: var(--text); color: var(--bg); }
.btn.primary:hover { background: #fff; }
.btn.ghost { color: var(--text); border: 1px solid var(--line-2); }
.btn.ghost:hover { border-color: rgba(255,255,255,.3); }

/* Hero */
.hero { position: relative; padding: 128px 0 0; overflow: hidden; }
.hero::before { content: ""; position: absolute; left: 50%; top: -300px; width: 1100px; height: 700px; transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(150,160,190,.08), transparent); pointer-events: none; }
.hero-in { position: relative; max-width: 860px; }
h1 { font-size: clamp(40px, 6vw, 68px); line-height: 1.06; letter-spacing: -0.035em; font-weight: 500; }
.lede { font-size: clamp(17px, 1.5vw, 19px); color: var(--text-2); max-width: 40em; margin: 28px 0 40px; }

/* App mockup */
.app { position: relative; margin: 96px 0 0; }
.app-frame { position: relative; border: 1px solid var(--line-2); border-bottom: 0; border-radius: 10px 10px 0 0; background: linear-gradient(180deg, #101112, #0b0c0d);
  box-shadow: 0 -30px 90px -40px rgba(150,160,190,.18); overflow: hidden;
  -webkit-mask-image: linear-gradient(180deg, #000 70%, transparent); mask-image: linear-gradient(180deg, #000 70%, transparent); }
.app-bar { display: flex; align-items: center; gap: 7px; height: 38px; padding: 0 16px; border-bottom: 1px solid var(--line); font-size: 12.5px; color: var(--text-3); }
.app-bar i { width: 9px; height: 9px; border-radius: 50%; background: #26272a; }
.app-bar span { margin-left: 12px; }
.app-body { display: grid; grid-template-columns: 196px 1fr 300px; min-height: 440px; font-size: 13px; }
.app-side { border-right: 1px solid var(--line); padding: 14px 10px; color: var(--text-3); }
.side-org { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 500; padding: 6px 8px 14px; }
.sq { width: 14px; height: 14px; border-radius: 3px; background: #2b2d31; border: 1px solid var(--line-2); }
.app-side ul { list-style: none; margin: 0; padding: 0; }
.app-side li { display: flex; align-items: center; padding: 6px 8px; border-radius: 5px; }
.app-side li.on { background: rgba(255,255,255,.06); color: var(--text); }
.app-side li b { margin-left: auto; font-weight: 500; font-size: 11.5px; color: var(--text-3); }
.app-list { border-right: 1px solid var(--line); }
.list-head { display: flex; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); font-weight: 500; }
.list-head span { color: var(--text-3); font-weight: 400; }
.app-list ul { list-style: none; margin: 0; padding: 4px 0; }
.app-list li { display: grid; grid-template-columns: 14px 1fr auto auto; gap: 12px; align-items: center; padding: 10px 18px; color: var(--text-2); }
.app-list li.sel { background: rgba(255,255,255,.035); box-shadow: inset 2px 0 0 var(--text-3); }
.app-list .t { color: var(--text); }
.app-list .m { color: var(--text-4); font-size: 12.5px; }
.st { width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--amber); }
.st.ok { border-color: var(--green); background: var(--green); }
.chip { font-size: 11.5px; padding: 2px 8px; border-radius: 5px; border: 1px solid var(--line-2); color: var(--text-2); }
.chip.ok { color: var(--green); border-color: rgba(79,174,132,.3); }
.app-detail { padding: 16px 18px; }
.d-head { font-weight: 500; font-size: 14px; display: flex; flex-direction: column; gap: 4px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.d-k { font: 500 10.5px var(--mono); letter-spacing: .1em; color: var(--text-4); }
.d-props { margin: 12px 0 16px; }
.d-props div { display: flex; justify-content: space-between; padding: 6px 0; }
.d-props dt { color: var(--text-3); }
.d-props dd { margin: 0; display: flex; align-items: center; gap: 7px; }
.okdot, .warndot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.warndot { background: var(--amber); }
.d-log { list-style: none; margin: 0; padding: 12px 0 0; border-top: 1px solid var(--line); font-family: var(--mono); font-size: 11.5px; color: var(--text-3); }
.d-log li { position: relative; padding: 5px 0 5px 16px; }
.d-log li::before { content: ""; position: absolute; left: 3px; top: 12px; width: 5px; height: 5px; border-radius: 50%; background: var(--text-4); }
.d-log li.now { color: var(--text); }
.d-log li.now::before { background: var(--amber); }
.d-log time { color: var(--text-4); margin-right: 10px; }

/* Colour accents in the mockup */
.chip.ai { color: var(--violet); border-color: rgba(160,139,255,.35); }
.aidot { width: 7px; height: 7px; border-radius: 50%; background: var(--violet); }
.d-log li.rule::before { background: var(--blue); }
.d-log li.now.ai::before { background: var(--violet); box-shadow: 0 0 8px rgba(160,139,255,.7); }
.app-side li.on::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--amber); margin-right: 8px; }

/* Figures */
.figs { padding: 72px 0 0; }
.figs-in { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); }
.fig { margin: 0; padding: 40px 28px 28px; color: var(--text-3); }
.fig + .fig { border-left: 1px solid var(--line); }
.fig svg { display: block; width: 100%; max-width: 280px; height: auto; margin: 0 auto 28px; overflow: visible; }
.fig figcaption { font: 500 11.5px var(--mono); text-transform: uppercase; letter-spacing: .12em; color: var(--text-2); display: flex; gap: 14px; }
.fig figcaption span { color: var(--text-4); }
.acc-green { fill: var(--green); }
.acc-blue { fill: var(--blue); }
.acc-blue-line { stroke: var(--blue); }
.acc-amber-line { stroke: var(--amber); }
.halo { fill: none; stroke: var(--green); stroke-width: 1; opacity: .5; transform-origin: 188px 76px; animation: halo 3.2s ease-out infinite; }
@keyframes halo { from { transform: scale(.4); opacity: .7; } to { transform: scale(1.6); opacity: 0; } }

/* Rules as code */
.code-sec { display: grid; grid-template-columns: 1fr 1.1fr; gap: 72px; align-items: center; }
.code-sec > * { min-width: 0; }
.code-sec .sec-lede { margin-bottom: 0; }
.editor { margin: 0; border: 1px solid var(--line-2); border-radius: 10px; background: var(--bg-2); overflow: hidden; box-shadow: 0 30px 60px -30px rgba(0,0,0,.8); }
.ed-bar { display: flex; justify-content: space-between; align-items: center; height: 38px; padding: 0 16px; border-bottom: 1px solid var(--line); font: 12px var(--mono); color: var(--text-3); }
.ed-tab { color: var(--text-2); }
.ed-ver { color: var(--blue); }
.code { margin: 0; padding: 20px 0; font: 13.5px/1.75 var(--mono); color: var(--text-2); overflow-x: auto; counter-reset: ln; min-height: 260px; }
.code .ln { display: block; padding: 0 20px 0 0; white-space: pre; }
.code .ln::before { counter-increment: ln; content: counter(ln); display: inline-block; width: 44px; padding-right: 16px; text-align: right; color: var(--text-4); }
.code .kw { color: var(--violet); }
.code .str { color: var(--green); }
.code .num { color: var(--amber); }
.code .op { color: var(--red); }
.code .fn { color: var(--blue); }
.code .cm { color: var(--text-4); }
.caret { display: inline-block; width: 7px; height: 1.1em; vertical-align: -2px; background: var(--text); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.ed-out { border-top: 1px solid var(--line); padding: 12px 20px; font: 12.5px var(--mono); color: var(--text-2); display: flex; gap: 10px; align-items: center; transition: opacity .4s; }
.editor.typing .ed-out { opacity: 0; }
.res-ok { color: var(--green); }
.res-arrow { color: var(--text-4); }
.res-time { margin-left: auto; color: var(--text-4); }

/* Sections */
.sec { padding: 136px 0 0; }
.sec-head { max-width: 760px; margin-bottom: 64px; }
h2 { font-size: clamp(30px, 3.6vw, 44px); line-height: 1.12; letter-spacing: -0.03em; font-weight: 500; }
.sec-lede { font-size: 17.5px; color: var(--text-2); margin: 22px 0 0; max-width: 42em; }

.grid { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.grid article { padding: 32px 30px 36px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.grid .n { font: 500 11.5px var(--mono); color: var(--text-4); }
.grid h3 { font-size: 17.5px; letter-spacing: -0.01em; margin: 18px 0 10px; }
.grid p { margin: 0; color: var(--text-3); font-size: 15px; }

.principles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin: 0; }
.principles > div { padding: 0 28px 0 0; }
.principles > div + div { padding-left: 28px; border-left: 1px solid var(--line); }
.principles dt { font-weight: 500; font-size: 16px; margin-bottom: 10px; }
.principles dd { margin: 0; color: var(--text-3); font-size: 15px; }

.timeline { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; position: relative; }
.timeline::before { content: ""; position: absolute; left: 0; right: 0; top: 5px; height: 1px; background: var(--line-2); }
.timeline li { position: relative; padding-top: 34px; }
.timeline li::before { content: ""; position: absolute; top: 0; left: 0; width: 11px; height: 11px; border-radius: 50%; background: var(--bg); border: 1px solid var(--text-3); }
.timeline li.cur::before { background: var(--text); border-color: var(--text); }
.when { font: 500 12px var(--mono); color: var(--text-3); text-transform: uppercase; letter-spacing: .1em; }
.timeline h3 { font-size: 17.5px; margin: 10px 0 8px; letter-spacing: -0.01em; }
.timeline p { margin: 0; color: var(--text-3); font-size: 15px; }

.contact { margin-top: 136px; padding: 96px 0 104px; border-top: 1px solid var(--line); background: var(--bg-2); }
.contact-in { display: grid; grid-template-columns: 1.1fr 1fr; gap: 64px; align-items: start; }
.contact p:not(.label) { color: var(--text-2); font-size: 17.5px; margin: 18px 0 0; }
.contact-list { margin: 0; border-top: 1px solid var(--line); }
.contact-list div { display: grid; grid-template-columns: 140px 1fr; padding: 16px 0; border-bottom: 1px solid var(--line); }
.contact-list dt { color: var(--text-3); font-size: 14px; }
.contact-list dd { margin: 0; }
.contact-list a:hover { text-decoration: underline; text-underline-offset: 3px; }

.foot { border-top: 1px solid var(--line); font-size: 13.5px; color: var(--text-4); background: var(--bg-2); }
.foot-in { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 26px 32px; }
.foot-in span:last-child { display: flex; gap: 22px; }
.foot a:hover { color: var(--text); }

/* Prose page */
main.prose { max-width: 720px; padding: 96px 32px 120px; }
.prose h1 { font-size: clamp(34px, 4.6vw, 52px); margin-bottom: 28px; }
.prose h2 { font-size: 21px; letter-spacing: -0.01em; margin: 44px 0 10px; }
.prose p { color: var(--text-2); }
.prose a { text-decoration: underline; text-decoration-color: var(--text-4); text-underline-offset: 3px; }
.prose .meta { font: 12.5px var(--mono); color: var(--text-4); }

@media (max-width: 1000px) {
  .app-body { grid-template-columns: 1fr 260px; }
  .app-side { display: none; }
  .principles { grid-template-columns: 1fr 1fr; row-gap: 36px; }
  .principles > div:nth-child(3) { padding-left: 0; border-left: 0; }
}
@media (max-width: 760px) {
  .figs-in { grid-template-columns: 1fr; }
  .fig + .fig { border-left: 0; border-top: 1px solid var(--line); }
  .code-sec { grid-template-columns: 1fr; gap: 36px; }
  .code { font-size: 12px; }
  .code .ln::before { width: 32px; padding-right: 12px; }
  .wrap { padding: 0 20px; }
  nav { display: none; }
  .top-in { justify-content: space-between; }
  .hero { padding-top: 72px; }
  .app { margin-top: 56px; }
  .app-body { grid-template-columns: 1fr; min-height: 360px; }
  .app-detail { display: none; }
  .app-list li { grid-template-columns: 14px 1fr auto; }
  .app-list .m { display: none; }
  .sec { padding-top: 96px; }
  .sec-head { margin-bottom: 40px; }
  .grid, .principles, .timeline { grid-template-columns: 1fr; }
  .grid article { padding: 26px 22px 28px; }
  .principles { row-gap: 28px; }
  .principles > div, .principles > div + div { padding: 0; border-left: 0; }
  .timeline { gap: 28px; }
  .timeline::before { left: 5px; right: auto; top: 0; bottom: 0; width: 1px; height: auto; }
  .timeline li { padding: 0 0 0 30px; }
  .timeline li::before { top: 4px; }
  .contact { margin-top: 96px; padding: 72px 0; }
  .contact-in { grid-template-columns: 1fr; gap: 36px; }
  .contact-list div { grid-template-columns: 110px 1fr; }
  .foot-in { padding: 24px 20px; }
  main.prose { padding: 64px 20px 88px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .halo, .caret { animation: none; } }

/* Load animation */
@keyframes rise { from { opacity: 0; transform: translateY(14px); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes rise-app { from { opacity: 0; transform: perspective(1600px) translateY(40px) rotateX(12deg); } to { opacity: 1; transform: perspective(1600px) rotateX(0); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
.hero-in > * { animation: rise .8s cubic-bezier(.2,.7,.2,1) both; }
.hero-in > :nth-child(1) { animation-delay: .05s; }
.hero-in > :nth-child(2) { animation-delay: .15s; }
.hero-in > :nth-child(3) { animation-delay: .28s; }
.hero-in > :nth-child(4) { animation-delay: .4s; }
.app { animation: rise-app 1.2s cubic-bezier(.2,.7,.2,1) .45s both; transform-origin: 50% 0; }
.js .fig svg path:not([stroke-dasharray]), .js .fig svg ellipse:not([stroke-dasharray]), .js .fig svg rect { stroke-dasharray: 600; stroke-dashoffset: 600; }
.js .fig svg circle, .js .fig figcaption { opacity: 0; transition: opacity .6s ease .9s; }
.js .fig.seen svg path:not([stroke-dasharray]), .js .fig.seen svg ellipse:not([stroke-dasharray]), .js .fig.seen svg rect { animation: draw 1.6s cubic-bezier(.4,0,.2,1) forwards; }
.js .fig.seen svg circle, .js .fig.seen figcaption { opacity: 1; }
.js .fig:nth-child(2).seen svg * { animation-delay: .15s; }
.js .fig:nth-child(3).seen svg * { animation-delay: .3s; }
@media (prefers-reduced-motion: reduce) {
  .hero-in > *, .app { animation: none; }
  .js .fig svg * { stroke-dashoffset: 0 !important; animation: none !important; opacity: 1 !important; }
  .js .fig figcaption { opacity: 1; }
}
