/* Wren's site: plain CSS, no build step, and a script only where a page needs one (the gallery's viewer, the checkout);
   each page works without it. It must render in Wren itself, so it sticks to what the engine implements (flex, grid,
   custom properties, media queries, gradients, filters, border-radius, box-shadow) and degrades quietly elsewhere.
   No color-mix, no :has: the engine may not know them yet. */

:root {
  color-scheme: dark;
  --edge: #0b0b0b;          /* what the page sits on, outside the column */
  --bg: #121212;
  --surface: #1a1a1a;
  --surface-2: #222222;
  --line: rgba(255, 255, 255, 0.09);
  --line-2: rgba(255, 255, 255, 0.16);
  --text: #e9eaec;
  --muted: #9aa0a6;
  --soft: #6f7377;
  --accent: #4cc2ff;
  --accent-ink: #06202e;
  --accent-dim: #16303d;
  --amber: #f39a2e;
  --ok: #6cd38f;
  --no: #ff8a7a;
  --wide: 1060px;
  --sans: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Code", "Cascadia Mono", Consolas, ui-monospace, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: var(--edge);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }

/* Screenshots sit in a box that has the image's aspect ratio (set inline) and fill it. Wren 0.1.0 computes the height
   of an image under max-width: 100% / height: auto from its natural size, not from its clamped width. */
.frame { position: relative; display: block; overflow: hidden; }
.frame img { position: absolute; left: 0; top: 0; width: 100%; height: 100%; max-width: none; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, .btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

code, pre, kbd { font-family: var(--mono); font-size: 0.86em; }
code {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.06em 0.36em;
}

h1, h2, h3 { margin: 0 0 0.5em; line-height: 1.15; letter-spacing: -0.015em; }
h1 { font-size: 64px; line-height: 0.98; letter-spacing: -0.03em; }
h2 { font-size: 38px; }
h3 { font-size: 19px; letter-spacing: -0.005em; }
p { margin: 0 0 1em; }
strong, b { color: var(--text); font-weight: 650; }

.eyebrow {
  margin: 0 0 14px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 8px 14px;
  z-index: 40;
}
.skip:focus { top: 12px; }

.wrap { max-width: var(--wide); margin: 0 auto; padding: 0 28px; }

/* header */
.top {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid var(--line);
  background: rgba(18, 18, 18, 0.86);
  backdrop-filter: blur(20px) saturate(1.15);
}
.top .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 24px;
  padding-top: 11px;
  padding-bottom: 11px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 650;
  font-size: 17px;
  letter-spacing: -0.01em;
}
.brand img { width: 30px; height: 30px; }
.brand:hover { text-decoration: none; }
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 20px; margin: 0; padding: 0; list-style: none; }
.nav a { color: var(--muted); font-size: 13px; font-weight: 650; letter-spacing: 0.005em; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); text-decoration: none; }
.nav .nav-dl { min-height: 32px; padding: 6px 14px; font-size: 13px; border-radius: 7px; }
.nav .nav-dl:hover { background: #7ad3ff; border-color: #7ad3ff; color: var(--accent-ink); text-decoration: none; }

/* the menu on narrow screens: a checkbox and a burger, no script */
.menu-check { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.burger { display: none; }
.menu-check:focus-visible + .burger { outline: 2px solid var(--accent); outline-offset: 4px; }

/* hero */
.hero { padding: 44px 0 40px; text-align: center; background: linear-gradient(180deg, #16232c 0%, #121212 70%); }
.lockup { display: flex; align-items: center; justify-content: center; gap: 14px; margin-bottom: 12px; }
.lockup .logo { width: 64px; height: 64px; margin: 0; }
.lockup h1 { margin: 0; font-size: 56px; letter-spacing: -0.035em; }
.tagline { font-size: 20px; color: var(--text); margin-bottom: 0.35em; letter-spacing: -0.01em; }
.lede { max-width: 720px; margin: 0 auto 1.15em; color: var(--muted); font-size: 17.5px; }
.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-bottom: 10px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}
.btn:hover { text-decoration: none; background: var(--surface-2); border-color: rgba(255, 255, 255, 0.28); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: #7ad3ff; border-color: #7ad3ff; }
.btn:disabled { opacity: 0.55; cursor: default; }
/* a button named in the text, drawn as a small copy of the real one (not clickable) */
.mini-btn { display: inline-block; padding: 0 9px; border-radius: 5px; line-height: 1.5; font-size: 0.88em; font-weight: 600;
  background: var(--accent); border: 1px solid var(--accent); color: var(--accent-ink); white-space: nowrap; cursor: default; }
.fine { color: var(--soft); font-size: 13.5px; }

.shot {
  margin: 40px auto 0;
  max-width: 1000px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}
.caption { color: var(--soft); font-size: 13px; margin-top: 12px; text-align: center; }

/* hero preview: real captures of Wren. Each tab in the picture is a hotspot that shows the capture of that tab. */
.shot-stage {
  position: relative;
  max-width: 1000px;
  margin: 26px auto 0;
  border: 1px solid var(--line-2);
  border-radius: 0;
  overflow: hidden;
  background: var(--surface);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}
.shot-radio { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.shot-panel { display: none; margin: 0; }
.shot-panel img { display: block; width: 100%; height: auto; }

#shot-1:checked ~ .shot-panel-1,
#shot-2:checked ~ .shot-panel-2,
#shot-3:checked ~ .shot-panel-3,
#shot-4:checked ~ .shot-panel-4 { display: block; }

/* the hotspots sit on the tabs of the picture (percentages of its box) */
.shot-hot { position: absolute; top: 0.2%; height: 4%; display: block; cursor: pointer; border-radius: 5px 5px 0 0; }
.shot-hot:hover { background: rgba(255, 255, 255, 0.08); }
.hot-1 { left: 2.06%; width: 14%; }
.hot-2 { left: 16.13%; width: 14%; }
.hot-3 { left: 30.19%; width: 14%; }
.hot-4 { left: 44.25%; width: 14%; }

#shot-1:focus-visible ~ .shot-hot.hot-1,
#shot-2:focus-visible ~ .shot-hot.hot-2,
#shot-3:focus-visible ~ .shot-hot.hot-3,
#shot-4:focus-visible ~ .shot-hot.hot-4 { outline: 2px solid var(--accent); outline-offset: -2px; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* sections */
.section { padding: 88px 0; border-top: 1px solid var(--line); }
.section.alt { background: #161616; }
.intro { color: var(--muted); max-width: 780px; margin-bottom: 36px; font-size: 18px; }

.three {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 14px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
}
.card h3 { margin-bottom: 0.45em; }
.card p { color: var(--muted); margin: 0; font-size: 15px; line-height: 1.55; }
.card .num { color: var(--accent); font-weight: 700; }
.idea h3 { font-size: 20px; }

/* the idea, as three quiet paragraphs: one column, left-aligned, no boxes */
.rows { display: grid; gap: 44px; }
.row { max-width: 680px; }
.row .eyebrow { margin-bottom: 8px; }
.row h3 { font-size: 27px; margin-bottom: 0.35em; letter-spacing: -0.015em; }
.row p { margin: 0; color: var(--muted); font-size: 18px; }

/* gallery */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.gallery figure { margin: 0; }
.gallery a {
  display: block;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
}
.gallery a:hover { border-color: var(--accent); }
.gallery figcaption { color: var(--muted); font-size: 13px; margin-top: 10px; line-height: 1.45; }
.gallery.large { grid-template-columns: repeat(auto-fill, minmax(440px, 1fr)); gap: 28px; }
.gallery.large .frame { border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.gallery.large a.frame { cursor: zoom-in; scroll-margin-top: 76px; }
.more { margin-top: 26px; }

/* the gallery's viewer (gallery.js): one picture at a time, as large as the window allows */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 50;   /* above the sticky header, also where a dialog's top layer does not lift it */
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 16px;
  border: 0;
  background: var(--edge);
  color: var(--text);
}
.lightbox[open] { display: flex; flex-direction: column; gap: 12px; }
.lightbox::backdrop { background: var(--edge); }
html.lightbox-open { overflow: hidden; }
.lightbox-stage { position: relative; flex: 1 1 auto; min-height: 0; cursor: zoom-out; }
.lightbox-stage img { position: absolute; left: 0; top: 0; width: 100%; height: 100%; max-width: none; object-fit: contain; }
.lightbox-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; }
.lightbox-caption { flex: 1 1 320px; margin: 0; color: var(--muted); font-size: 14px; line-height: 1.45; }
.lightbox-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.lightbox-count { margin-right: 6px; color: var(--soft); font-size: 13.5px; font-variant-numeric: tabular-nums; }
.lightbox .btn { font-family: inherit; }
.lightbox .btn:hover { text-decoration: none; }

/* works / not yet */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.list { margin: 0; padding: 0; list-style: none; }
.list li { padding: 10px 0 10px 26px; border-top: 1px solid var(--line); position: relative; font-size: 15px; }
.list li:first-child { border-top: 0; }
.list li::before { position: absolute; left: 0; top: 10px; font-weight: 700; }
.list.yes li::before { content: "+"; color: var(--ok); }
.list.no li::before { content: "\2013"; color: var(--no); }
.list li span { color: var(--muted); }

table { border-collapse: collapse; width: 100%; font-size: 15px; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 700; font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; }
td.n { font-family: var(--mono); white-space: nowrap; font-size: 13px; }
.table-box { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }

/* code */
.steps { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; }
.steps > div { min-width: 0; }
.code {
  margin: 0 0 18px;
  background: #0f0f0f;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.code .file {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.code pre { margin: 0; padding: 15px 16px; overflow-x: auto; line-height: 1.55; font-size: 13px; tab-size: 4; }
.code code { background: none; border: 0; padding: 0; font-size: 1em; }
.k { color: #c792ea; }
.s { color: #c3e88d; }
.c { color: #7f8a93; }
.f { color: #82aaff; }
.t { color: #ffcb6b; }

/* architecture diagram: rows of boxes, top (what the user sees) to bottom (the platform) */
.diagram { display: grid; gap: 10px; }
.layer {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 10px;
  align-items: stretch;
}
.layer .name {
  display: flex;
  align-items: center;
  color: var(--soft);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.boxes { display: flex; flex-wrap: wrap; gap: 8px; }
.box {
  flex: 1 1 180px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 14px;
}
.box b { display: block; color: var(--text); font-family: var(--mono); font-size: 13px; font-weight: 600; }
.box span { color: var(--muted); }
.box.wasm { border-color: #35657e; background: #15262f; }
.box.wasm b { color: var(--accent); }
.box.ext { border-style: dashed; }
.arrow { text-align: center; color: #4a4a4a; font-size: 13px; line-height: 1; }
.legend { color: var(--soft); font-size: 13px; margin-top: 16px; }
.legend i { display: inline-block; width: 12px; height: 12px; vertical-align: -1px; margin-right: 5px; border: 1px solid var(--line); border-radius: 3px; background: var(--surface); }
.legend i.wasm { background: #15262f; border-color: #35657e; }
.legend i.ext { border-style: dashed; }

.rules { counter-reset: rule; margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.rules li {
  counter-increment: rule;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px 18px 16px 54px;
  position: relative;
  color: var(--muted);
  font-size: 15px;
}
.rules li::before {
  content: counter(rule);
  position: absolute;
  left: 18px;
  top: 15px;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--accent-dim);
  color: var(--accent);
  font-weight: 700;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 22px;
  text-align: center;
}
.rules b { color: var(--text); }

/* changelog: one card per version on a rail, the latest lit */
.timeline { position: relative; margin-top: 6px; }
.timeline::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 8px;
  bottom: 46px;
  width: 1px;
  background: var(--line);
}
.release { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 18px; }
.release .rail { position: relative; }
.release .dot {
  position: absolute;
  top: 7px;
  left: 8px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--line-2);
}
.release.latest .dot { background: var(--accent); box-shadow: 0 0 0 4px rgba(76, 194, 255, 0.14); }
.release-body { padding-bottom: 38px; }
.release-date {
  margin: 0 0 6px;
  color: var(--soft);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.release-title { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 10px; }
.release-title h3 { margin: 0; font-size: 34px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--accent-dim);
  color: #a8dcf7;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.badge.fix { background: #3a2a1a; color: var(--amber); }
.badge.milestone { background: var(--surface-2); color: var(--text); }
.badge.first { background: var(--surface-2); color: var(--muted); }
.release-list { margin: 0 0 12px; padding-left: 18px; color: var(--muted); font-size: 15.5px; }
.release-list li { margin-bottom: 7px; }
.release-list li:last-child { margin-bottom: 0; }
.release-list strong { color: var(--text); }
.release-links { margin: 0; font-size: 13.5px; }
.release-links a { font-weight: 650; }

/* credits */
.credits { columns: 2; column-gap: 32px; margin: 0; padding: 0; list-style: none; }
.credits li { break-inside: avoid; padding: 7px 0; color: var(--muted); font-size: 15px; }
.credits a { font-weight: 600; }

.foot {
  border-top: 1px solid var(--line);
  padding: 30px 0 44px;
  color: var(--soft);
  font-size: 13.5px;
}
.foot .wrap { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px 22px; text-align: center; }
.foot a { color: var(--text); font-weight: 650; }
.foot a:hover { color: var(--accent); }

/* The maker's mark, as on about:wren: the studio's logo to the left of its name, in bold and linked to its site. */
.maker { white-space: nowrap; }
.maker img { display: inline-block; width: 18px; height: 18px; vertical-align: -4px; margin: 0 6px 0 2px; }
.maker a { color: var(--text); font-weight: 700; }
.foot .maker img { width: 16px; height: 16px; vertical-align: -3px; }

.page-head { padding: 76px 0 28px; }
.page-head h1 { font-size: 54px; margin-bottom: 0.2em; }
.page-head .intro { margin-bottom: 0; }

/* legal pages: a narrow reading column, hairline sections, quiet text */
.legal .section { padding: 44px 0; }
.legal h2 { font-size: 26px; margin-bottom: 0.4em; }
.legal p, .legal li { max-width: 800px; color: var(--muted); font-size: 16px; }
.legal p strong { color: var(--text); }
.legal ul { max-width: 800px; margin: 0 0 1em; padding-left: 20px; color: var(--muted); font-size: 16px; }
.legal li { margin-bottom: 6px; }
.legal .intro { font-size: 19px; }
.legal a { font-weight: 600; }
.todo { color: var(--amber); border-bottom: 1px dashed var(--amber); }

/* site footer: the brand line, then the commercial and legal links */
.site-foot {
  border-top: 1px solid var(--line);
  padding: 36px 0 46px;
  color: var(--soft);
  font-size: 13.5px;
}
.site-foot .wrap { display: grid; gap: 14px; justify-items: center; text-align: center; }
.foot-line { margin: 0; }
.foot-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 20px; }
.foot-links a { color: var(--muted); font-weight: 650; }
.foot-links a:hover { color: var(--text); text-decoration: none; }

@media (max-width: 760px) {
  .burger {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 34px;
    margin-left: auto;
    padding: 0 8px;
    cursor: pointer;
  }
  .burger span { display: block; height: 2px; border-radius: 2px; background: var(--text); }
  .nav { display: none; }
  .menu-check:checked ~ .nav {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 0;
    padding: 6px 0 2px;
  }
  .menu-check:checked ~ .nav li { border-top: 1px solid var(--line); }
  .menu-check:checked ~ .nav a { display: block; padding: 11px 2px; font-size: 14.5px; }
  .menu-check:checked ~ .nav .nav-dl { margin: 10px 0 6px; text-align: center; }
}

@media (max-width: 880px) {
  .three, .split, .steps { grid-template-columns: minmax(0, 1fr); }
  .credits { columns: 1; }
  .layer { grid-template-columns: 1fr; }
  .layer .name { padding-top: 6px; }
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  .wrap { padding: 0 20px; }
  .hero { padding: 30px 0 32px; }
  .hero h1 { font-size: 44px; }
  .lockup { gap: 10px; margin-bottom: 10px; }
  .lockup .logo { width: 46px; height: 46px; }
  .lockup h1 { font-size: 38px; }
  .row h3 { font-size: 23px; }
  .row p { font-size: 17px; }
  .tagline { font-size: 19px; }
  .lede { font-size: 17px; }
  h1 { font-size: 40px; }
  h2 { font-size: 28px; }
  .section { padding: 56px 0; }
  .page-head { padding: 52px 0 20px; }
  .page-head h1 { font-size: 40px; }
  .cards, .gallery, .gallery.large { grid-template-columns: minmax(0, 1fr); }
}
