/* Round 4: today's site, modernised. Each rule is one change on top of style.css and docs.css. */

/* Text at 4.5:1 or more: today's faint grey is 4.0:1 on the ground and 3.6:1 on a panel. */
:root { --faint: #728a9e; }

/* Nav: one line at 1024, every link a 44 px target. */
.nav { padding: 4px 24px; gap: 24px; }
.nav nav { gap: 16px; }
.nav nav a { display: inline-flex; align-items: center; min-height: 44px; white-space: nowrap; }
.nav .brand { min-height: 44px; }
.pill { flex: none; white-space: nowrap; }

/* Phone and tablet: a Menu button for the nine links (hidden below 960 px today). */
.menu { display: none; position: relative; }
.menu summary {
  display: grid; place-items: center; width: 44px; height: 44px;
  list-style: none; border: 1px solid var(--line-2); border-radius: 11px; color: var(--text); cursor: pointer;
}
.menu summary svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.menu summary::-webkit-details-marker { display: none; }
.menu-list {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 20; width: 220px;
  display: grid; padding: 6px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--panel);
}
.menu-list a { display: flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 8px; color: var(--text); text-decoration: none; }
@media (max-width: 960px) {
  .menu { display: block; }
  .pill { margin-left: auto; }
}
@media (max-width: 560px) { .nav { gap: 12px; } }

/* The status card: what state seawall is in, from the build. */
.status {
  display: grid; gap: 6px; max-width: 34em; margin: 0 0 30px; padding: 14px 16px;
  border: 1px solid var(--line-2); border-radius: 11px; background: rgba(8, 19, 31, .6);
}
.status p { margin: 0; display: flex; align-items: center; gap: 10px; color: var(--text); font-size: 15.5px; font-weight: 600; line-height: 1.45; }
.status .dot { flex: none; }
.status .status-meta { flex-wrap: wrap; gap: 0 16px; font: 400 13px/1.6 var(--mono); color: var(--muted); }
.status-meta span { white-space: nowrap; }

/* Nothing under 12 px. */
.chip, .soon, .cmd-go { font-size: 12px; }

/* 44 px targets. */
.tabs button { min-height: 44px; }
.cmd { min-height: 44px; }
.rm-btn { width: 44px; height: 44px; }
.pick { min-height: 44px; padding: 0 12px; }
.foot .brand { min-height: 44px; }

/* Screenshots on a phone: the full-size image, where its text can be read. */
.shot .full { display: none; }
@media (max-width: 560px) {
  .shot .full { display: inline-flex; align-items: center; min-height: 44px; color: var(--teal); }
  /* Long lines wrap instead of running off the right edge. */
  .demo-out { white-space: pre-wrap; overflow-wrap: anywhere; }
  .term.small .term-body { white-space: pre-wrap; overflow-wrap: anywhere; }
}

/* The roadmap on a phone: one list down the page, no sideways scroll. */
@media (max-width: 640px) {
  .rm-controls, .rm-progress { display: none; }
  .rm-viewport { overflow: visible; -webkit-mask-image: none; mask-image: none; cursor: auto; }
  .rm-track { flex-direction: column; gap: 18px; width: auto; padding: 8px 24px 0; }
  .rm-item, .rm-here { width: auto; padding: 0 0 0 38px; }
  .rm-item::before, .rm-here::before { left: 7px; right: auto; top: 4px; bottom: -22px; width: 2px; height: auto; }
  .rm-item.now::before, .rm-item.next::before, .rm-item.later::before {
    background: repeating-linear-gradient(180deg, var(--line-2) 0 8px, transparent 8px 14px);
  }
  .rm-item:last-child::before { display: none; }
  .rm-here::before { left: 7px; top: 22px; background: linear-gradient(180deg, var(--teal), var(--line-2)); }
  .rm-here .rm-node, .rm-here::after { left: -5px; top: -2px; }
  .rm-here-label { position: static; display: block; padding-top: 3px; }
  .rm-here-text { position: static; margin-top: 4px; }
  .rm-card { margin-top: 0; min-height: 0; }
}

/* Footer: where to go next. */
.foot-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px 24px; }
.foot-links { display: flex; flex-wrap: wrap; column-gap: 20px; justify-self: end; }
.foot-links a { display: inline-flex; align-items: center; min-height: 44px; color: var(--muted); font-size: 15px; text-decoration: none; }
.foot-row > p:last-child { grid-column: 1 / -1; justify-self: end; }
.heart { color: #f9a8d4; }
@media (max-width: 640px) {
  .foot-row { grid-template-columns: minmax(0, 1fr); }
  .foot-links, .foot-row > p:last-child { justify-self: start; }
}

/* Docs: Find is a search field at the top of the list; every link a 44 px target. */
.docs-side { position: sticky; top: 72px; align-self: start; }
.docs-side nav { position: static; max-height: calc(100vh - 150px); }
.docs-side .find { justify-content: flex-start; gap: 10px; min-height: 44px; margin: 0 0 12px; padding: 0 8px 0 12px; font-size: 15px; color: var(--muted); border-radius: 10px; }
.docs-side .find svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.docs-side .find kbd { margin-left: auto; }
.docs-side a { display: flex; align-items: center; min-height: 44px; padding: 0 12px; }
.docs-side .side-sub a { min-height: 40px; padding: 0 10px; }
.docs-side .side-group { margin: 14px 0 2px; }
.docs-sec td:first-child a { display: inline-flex; align-items: center; min-height: 44px; margin: -10px 0; }

/* A breadcrumb above the title. */
.docs-body .crumbs { margin: 0; }
.crumbs a { display: inline-flex; align-items: center; min-height: 44px; }
.docs-body .crumbs + h1 { margin-top: 2px; }

/* Command blocks: a bar with the copy button (always shown), $ before each command, long lines wrapped. */
.code { margin: 14px 0; border: 1px solid var(--line); border-radius: 10px; background: rgba(234, 247, 255, .03); overflow: hidden; }
.code-bar { display: flex; align-items: center; justify-content: space-between; padding: 0 6px 0 16px; border-bottom: 1px solid var(--line); font: 12px var(--mono); color: var(--faint); }
.docs-body .code pre { margin: 0; border: 0; border-radius: 0; background: none; }
.docs-body .code-bar .copy {
  position: static; opacity: 1; min-height: 44px; padding: 0 12px;
  font: 13px var(--mono); color: var(--teal); background: none; border: 0; cursor: pointer;
}
.cl { display: block; padding-left: 2ch; text-indent: -2ch; white-space: pre-wrap; overflow-wrap: anywhere; }
.cl::before { content: "$ "; color: var(--teal); }

/* On this page, for phones (the side list's sections are hidden there). */
.toc { display: none; }

/* Previous and next. */
.pager { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 48px; padding-top: 28px; border-top: 1px solid var(--line); }
.pager a {
  display: grid; gap: 4px; min-height: 44px; padding: 14px 18px;
  border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--panel);
  color: var(--text); text-decoration: none; font: 650 17px/1.3 var(--display);
}
.pager span { font: 600 12px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--faint); }
.pager .next { grid-column: 2; text-align: right; }

/* The page list on a phone: one button that opens it (24 links pushed the title down). */
.side-fold { display: none; }
@media (max-width: 820px) {
  .docs-side { position: static; }
  .docs-side nav { display: none; }
  .docs-side .find { margin-bottom: 8px; }
  .side-fold { display: block; }
  .side-fold summary {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; padding: 0 14px;
    list-style: none; border: 1px solid var(--line-2); border-radius: 10px; background: var(--panel);
    font-size: 15px; color: var(--text); cursor: pointer;
  }
  .side-fold summary::-webkit-details-marker { display: none; }
  .side-fold summary span:last-child { color: var(--muted); font: 13px var(--mono); }
  .side-fold summary span:last-child::after { content: " ▾"; color: var(--teal); }
  .side-fold-list { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 0 4px; }
  .side-fold-list .side-group { width: 100%; margin: 6px 0 0; padding: 0; }
  .toc { display: grid; margin: 20px 0 0; padding: 4px 14px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--panel); }
  .toc p { margin: 10px 0 2px; font: 600 12px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--faint); }
  .toc a { display: flex; align-items: center; min-height: 44px; color: var(--text); text-decoration: none; border-top: 1px solid var(--line); }
  .toc p + a { border-top: 0; }
  .pager { grid-template-columns: minmax(0, 1fr); }
  .pager .next { grid-column: 1; }
}
