/* AutoFrame AI: a plain, light project page. */
:root {
  --paper: #f7f7f5;
  --panel: #ffffff;
  --tint: #f1f4fb;
  --line: #e2e3de;
  --line-2: #c9cbc4;
  --text: #1c1d1a;
  --text-2: #4d5057;
  --muted: #6d7078;
  --accent: #2456c9;
  --good: #1a7f4b;
  --grid: #ececea;
  --stage: #eef0f3;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--text); font: 16px/1.6 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-underline-offset: 3px; }
img, svg, canvas { max-width: 100%; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
.mono { font-family: var(--mono); }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* top bar */
.top { position: sticky; top: 0; z-index: 30; background: rgba(247, 247, 245, 0.94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; gap: 24px; height: 56px; }
.brand { color: var(--text); text-decoration: none; font-weight: 600; white-space: nowrap; }
.top nav { display: flex; gap: 2px; margin-left: auto; align-items: center; }
.top nav a { color: var(--text-2); text-decoration: none; font-size: 14.5px; padding: 7px 12px; border-radius: 6px; white-space: nowrap; }
.top nav a:hover { color: var(--text); background: #ecece8; }
.top nav a.on { color: var(--text); font-weight: 600; }
@media (max-width: 640px) {
  .top .wrap { gap: 8px; padding: 0 14px; }
  .top nav a { padding: 7px 8px; font-size: 13.5px; }
  .top nav a.hide-s { display: none; }
}

/* hero */
.hero { border-bottom: 1px solid var(--line); }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr); gap: 28px; align-items: center; padding-top: 44px; padding-bottom: 40px; }
.kicker { font: 500 12px var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.hero h1 { font-size: clamp(30px, 4vw, 44px); line-height: 1.12; letter-spacing: -0.02em; margin: 14px 0 16px; font-weight: 600; }
.hero p.lede { font-size: 18px; color: var(--text-2); max-width: 520px; margin: 0 0 24px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 600; font-size: 15px; padding: 10px 16px; border-radius: 8px; border: 1px solid transparent; }
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { background: #1d49ae; }
.btn.line { border-color: var(--line-2); color: var(--text); background: var(--panel); }
.btn.line:hover { border-color: var(--text); }
.stage { position: relative; aspect-ratio: 4 / 3; min-height: 330px; }
.stage canvas { position: absolute; inset: 0 0 26px 0; width: 100%; height: calc(100% - 26px); display: block; cursor: grab; }
.stage canvas:active { cursor: grabbing; }
.stage .caption { position: absolute; left: 0; bottom: 0; font: 12px var(--mono); color: var(--muted); }
.stage .caption { right: 0; }
@media (max-width: 900px) {
  .hero .wrap { grid-template-columns: minmax(0, 1fr); padding-top: 30px; }
  .stage { aspect-ratio: auto; min-height: 0; height: min(92vw, 440px); }
  .stage canvas { inset: 0 0 44px 0; height: calc(100% - 44px); }
}

/* headline numbers */
.strip { background: var(--panel); border-bottom: 1px solid var(--line); }
.strip .wrap { display: grid; grid-template-columns: repeat(4, 1fr); }
.strip .cell { padding: 20px 20px 20px 0; border-right: 1px solid var(--line); margin-right: 20px; }
.strip .cell:last-child { border-right: 0; margin-right: 0; }
.strip b { display: block; font: 600 28px/1.1 var(--mono); letter-spacing: -0.02em; }
.strip span { display: block; margin-top: 6px; color: var(--text-2); font-size: 13.5px; line-height: 1.4; }
@media (max-width: 800px) { .strip .wrap { grid-template-columns: 1fr 1fr; } .strip .cell { border-right: 0; } }

/* sections */
section.block { padding: 60px 0 8px; }
.label { font: 500 12px var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
h2 { font-size: clamp(24px, 2.7vw, 30px); line-height: 1.2; letter-spacing: -0.015em; margin: 10px 0 12px; font-weight: 600; max-width: 760px; }
h3 { font-size: 18px; margin: 0 0 6px; font-weight: 600; }
p.intro { color: var(--text-2); font-size: 17px; max-width: 720px; margin: 0 0 26px; }
.note { color: var(--muted); font-size: 13.5px; }

/* the loop */
.loop { display: grid; grid-template-columns: repeat(7, 1fr); margin-top: 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); overflow: hidden; }
.loop .step { padding: 18px 16px 20px; border-right: 1px solid var(--line); }
.loop .step:last-child { border-right: 0; }
.loop .step i { font: 500 11px var(--mono); color: var(--muted); font-style: normal; letter-spacing: 0.08em; }
.loop .step b { display: block; font-size: 15.5px; margin: 6px 0 6px; }
.loop .step p { margin: 0; font-size: 13.5px; color: var(--text-2); line-height: 1.45; }
.loop .step.back { background: var(--tint); }
.looptag { margin-top: 12px; color: var(--text-2); font-size: 14px; }
@media (max-width: 1000px) { .loop { grid-template-columns: 1fr 1fr; } .loop .step { border-bottom: 1px solid var(--line); } }

/* building cards */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 960px) { .cards { grid-template-columns: 1fr; } }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; display: flex; flex-direction: column; }
.card .mini { background: var(--stage); aspect-ratio: 16 / 11; position: relative; border-bottom: 1px solid var(--line); }
.card .mini canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.card .body { padding: 18px 18px 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card .tag { font: 500 11px var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.card p { margin: 0; color: var(--text-2); font-size: 14.5px; flex: 1; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; margin: 4px 0 6px; }
.facts div span { display: block; font-size: 12px; color: var(--muted); }
.facts div b { font: 600 16px var(--mono); }
.more { font-weight: 600; font-size: 14.5px; text-decoration: none; }
.more:hover { text-decoration: underline; }

.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 900px) { .split { grid-template-columns: minmax(0, 1fr); } }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 22px; }
.panel p { color: var(--text-2); font-size: 15px; }
.big { font: 600 36px/1 var(--mono); letter-spacing: -0.03em; margin: 12px 0 8px; }
.big small { font-size: 16px; font-weight: 500; letter-spacing: 0; color: var(--muted); }
.pill { display: inline-block; font: 500 11px var(--mono); letter-spacing: 0.06em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; background: var(--tint); color: #2c4170; }
.pill.warn { background: #fbf1dc; color: #7a5200; }

.outs { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; }
@media (max-width: 900px) { .outs { grid-template-columns: minmax(0, 1fr); } }
.sheet { background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.sheet .frame { background: #fff; padding: 10px; cursor: zoom-in; }
.sheet .frame img { display: block; width: 100%; height: auto; }
.sheet figcaption { padding: 10px 14px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.tbl th { text-align: left; font: 500 11px var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.tbl td { padding: 8px 12px; border-bottom: 1px solid #efefeb; }
table.tbl td.r, table.tbl th.r { text-align: right; }
table.tbl td.r { font-family: var(--mono); font-variant-numeric: tabular-nums; }
table.tbl tr:last-child td { border-bottom: 0; }
table.tbl tr.pick td { background: var(--tint); font-weight: 600; }
.tablewrap { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow: auto; }
ul.ticks { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
ul.ticks li { padding-left: 26px; position: relative; color: var(--text-2); font-size: 15px; }
ul.ticks li::before { content: ""; position: absolute; left: 2px; top: 8px; width: 12px; height: 6px; border-left: 2px solid var(--good); border-bottom: 2px solid var(--good); transform: rotate(-45deg); }
ul.ticks li b { color: var(--text); }

.callout { margin-top: 20px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 20px 22px; display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.callout h3 { font-size: 19px; margin: 0 0 4px; }
.callout p { margin: 0; color: var(--text-2); max-width: 620px; }
.callout .btn { margin-left: auto; }

.scope { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
@media (max-width: 800px) { .scope { grid-template-columns: minmax(0, 1fr); } }
.scope ul { margin: 8px 0 0; padding-left: 18px; color: var(--text-2); font-size: 15px; }
.scope li { margin: 5px 0; }

footer { margin-top: 72px; border-top: 1px solid var(--line); padding: 24px 0 38px; color: var(--muted); font-size: 13.5px; }
footer .wrap { display: flex; gap: 18px; flex-wrap: wrap; justify-content: space-between; }

/* buildings page */
.subhead { padding: 34px 0 0; border-bottom: 1px solid var(--line); }
.subhead h1 { font-size: clamp(26px, 3vw, 34px); margin: 8px 0 8px; letter-spacing: -0.015em; font-weight: 600; }
.subhead p { color: var(--text-2); max-width: 760px; margin: 0 0 20px; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: -1px; }
.tabs a { color: var(--text-2); text-decoration: none; padding: 9px 15px; font-size: 14.5px; border-bottom: 2px solid transparent; }
.tabs a:hover { color: var(--text); }
.tabs a.on { color: var(--text); font-weight: 600; border-bottom-color: var(--accent); }
.viewer { position: relative; background: var(--stage); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; height: min(68vh, 620px); min-height: 420px; }
.viewer canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; }
.viewer canvas:active { cursor: grabbing; }
.vbar { position: absolute; left: 14px; top: 14px; display: flex; gap: 8px; flex-wrap: wrap; z-index: 2; }
.seg { display: inline-flex; background: var(--panel); border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; }
.seg button { background: transparent; border: 0; color: var(--text-2); font: 500 13px var(--sans); padding: 7px 12px; cursor: pointer; }
.seg button.on { background: var(--text); color: #fff; }
.legend { position: absolute; left: 14px; bottom: 14px; z-index: 2; color: var(--text-2); font-size: 12.5px; display: flex; gap: 14px; flex-wrap: wrap; align-items: center; background: rgba(255, 255, 255, 0.9); border: 1px solid var(--line); padding: 7px 10px; border-radius: 8px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.legend .ramp { width: 130px; height: 10px; border-radius: 3px; background: linear-gradient(90deg, #cfe0f5, #4f8ad8, #103a7c); margin: 0 8px; }
.hint { position: absolute; right: 14px; bottom: 14px; z-index: 2; color: var(--muted); font: 12px var(--mono); }
@media (max-width: 800px) { .hint { display: none; } }
.tip, .ctip { position: fixed; z-index: 50; pointer-events: none; background: #fff; color: var(--text); border: 1px solid var(--line-2); border-radius: 8px; padding: 9px 11px; font-size: 12.5px; line-height: 1.45; max-width: 280px; box-shadow: 0 6px 20px rgba(20, 24, 32, 0.12); display: none; }
.tip b, .ctip b { font: 600 13px var(--mono); }
.ctip b { display: block; }
.tip span, .ctip span { color: var(--text-2); }
.kv { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--panel); border: 1px solid var(--line); border-radius: 10px; margin-top: 16px; overflow: hidden; }
.kv div { padding: 16px 18px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.kv div span { display: block; font-size: 12.5px; color: var(--muted); }
.kv div b { font: 600 20px var(--mono); letter-spacing: -0.01em; }
.kv div small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
@media (max-width: 800px) { .kv { grid-template-columns: 1fr 1fr; } }
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 900px) { .gallery { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .gallery { grid-template-columns: 1fr; } }
.lightbox { position: fixed; inset: 0; z-index: 60; background: rgba(247, 247, 245, 0.97); display: none; padding: 28px; overflow: auto; cursor: zoom-out; }
.lightbox.open { display: block; }
.lightbox img { display: block; margin: 0 auto; background: #fff; width: min(1700px, 220%); max-width: none; border: 1px solid var(--line-2); }
.lightbox .x { position: fixed; top: 14px; right: 18px; color: var(--text); font: 600 14px var(--sans); background: #fff; border: 1px solid var(--line-2); border-radius: 8px; padding: 8px 12px; cursor: pointer; }

/* charts */
.figure { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 22px 22px 16px; margin: 0 0 16px; }
.figure h3 { font-size: 17px; margin: 0 0 4px; }
.figure .sub { color: var(--text-2); font-size: 14.5px; margin: 0 0 14px; max-width: 760px; }
.figure .foot { color: var(--muted); font-size: 13px; margin: 12px 0 0; }
.chart { position: relative; overflow-x: auto; }
@media (max-width: 700px) { .chart svg { min-width: 520px; } }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart text { font-family: var(--sans); fill: var(--text-2); font-size: 12px; }
.chart text.v { font-family: var(--mono); fill: var(--text); font-size: 12px; font-weight: 600; }
.chart .grid { stroke: var(--grid); stroke-width: 1; }
.chart .axis { stroke: var(--line-2); stroke-width: 1; }
.chart .mark { transition: opacity 0.12s; }
.chart .mark:hover, .chart .mark:focus { opacity: 0.8; outline: none; }
.keys { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--text-2); margin: 0 0 8px; }
.keys i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
details.data { margin-top: 10px; font-size: 13px; color: var(--muted); overflow-x: auto; }
details.data summary { cursor: pointer; }
details.data table { margin-top: 8px; }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 26px 0 8px; }
@media (max-width: 900px) { .tiles { grid-template-columns: 1fr 1fr; } }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 18px; }
.tile b { display: block; font: 600 30px/1.05 var(--mono); letter-spacing: -0.02em; }
.tile span { display: block; margin-top: 8px; color: var(--text-2); font-size: 13.5px; line-height: 1.4; }
.pagehead { padding: 40px 0 30px; border-bottom: 1px solid var(--line); }
.pagehead h1 { font-size: clamp(28px, 3.4vw, 38px); margin: 10px 0 10px; letter-spacing: -0.02em; font-weight: 600; max-width: 820px; line-height: 1.14; }
.pagehead p { color: var(--text-2); max-width: 720px; margin: 0; font-size: 17px; }
.toc { display: flex; gap: 6px 18px; flex-wrap: wrap; margin-top: 18px; font-size: 14.5px; }
.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
@media (max-width: 900px) { .two { grid-template-columns: minmax(0, 1fr); } }
