/* mess site. Warm near-black, flat hairlines, one blue. */

:root {
  --bg: #131211;
  --panel: #1b1a18;
  --panel-2: #232120;
  --line: #2c2a27;
  --line-2: #3a3733;
  --text: #ece9e3;
  --lede: #b3ada4;
  --muted: #9a958d;
  --dim: #7d786f;
  --accent: #4f8bf2;
  --solid: #e8e4dc;
  --radius: 10px;
  --pad: 24px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

a { color: var(--text); text-decoration: none; }
a:hover { color: var(--accent); }
::selection { background: var(--accent); color: var(--bg); }
img, video { display: block; width: 100%; height: auto; }

.wrap { width: min(1100px, 100% - var(--pad) * 2); margin-inline: auto; }

/* ---------- top bar ---------- */

header.bar {
  position: sticky; top: 0; z-index: 40;
  background: rgb(19 18 17 / 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 180ms ease;
}
header.bar.scrolled { border-bottom-color: var(--line); }
.bar-in { display: flex; align-items: center; gap: 18px; padding: 11px 0; }
.brand { display: flex; align-items: center; gap: 9px; }
.brand svg { width: 22px; height: 22px; flex: none; }
.brand strong { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.bar nav { margin-left: auto; display: flex; gap: 20px; align-items: center; font-size: 13.5px; }
.bar nav a { color: var(--muted); }
.bar nav a:hover, .bar nav a.active { color: var(--text); }
.bar nav a.cta {
  border: 1px solid var(--line-2); color: var(--text);
  padding: 6px 13px; border-radius: 6px; font-weight: 500;
}
.bar nav a.cta:hover { background: var(--solid); color: var(--bg); border-color: var(--solid); }
@media (max-width: 620px) { .bar nav a.hide-s { display: none; } }

/* ---------- type ---------- */

h1 {
  font-size: clamp(38px, 5.6vw, 62px);
  line-height: 1.04; letter-spacing: -0.035em;
  font-weight: 600; margin: 0 0 18px;
}
h2 {
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.1; letter-spacing: -0.03em;
  font-weight: 600; margin: 0 0 8px;
}
h3 { font-size: 18px; font-weight: 600; letter-spacing: -0.015em; margin: 0 0 8px; }
h4 { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; margin: 0 0 7px; }
.lede { font-size: clamp(17px, 1.9vw, 20px); line-height: 1.5; color: #b3ada4; margin: 0 0 26px; }
.sub { font-size: 16.5px; line-height: 1.55; color: #b3ada4; max-width: 60ch; margin: 0 0 32px; }
.kicker {
  font-size: 11.5px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--accent); font-weight: 600; margin: 0 0 12px;
}
.meta { font-size: 12.5px; color: var(--dim); margin: 14px 0 0; }
p { text-wrap: pretty; }

section { padding: clamp(56px, 8vw, 104px) 0 0; }
section.first { padding-top: clamp(48px, 7vw, 88px); }
section.last { padding-bottom: clamp(48px, 7vw, 88px); }
.center { text-align: center; }
.center .lede { margin-inline: auto; max-width: 52ch; }

/* ---------- buttons ---------- */

.btn {
  display: inline-block;
  border: 1px solid var(--line-2); background: var(--panel);
  color: var(--text); padding: 11px 20px; border-radius: 7px;
  font-size: 14.5px; font-weight: 500; cursor: pointer;
  font-family: inherit;
}
.btn:hover { border-color: var(--muted); color: var(--text); }
.btn-solid { background: var(--solid); border-color: var(--solid); color: var(--bg); }
.btn-solid:hover { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.center .actions { justify-content: center; }

/* ---------- app window ---------- */

.window {
  border: 1px solid var(--line-2); border-radius: 11px;
  overflow: hidden; background: var(--panel);
}
.window-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px; border-bottom: 1px solid var(--line-2);
  background: var(--panel-2);
}
.window-bar i {
  width: 11px; height: 11px; border-radius: 50%; background: var(--line-2);
  display: flex; align-items: center; justify-content: center;
  font-style: normal; font-size: 9px; line-height: 1; color: transparent;
  cursor: pointer; user-select: none; transition: background 150ms ease;
}
/* real colours + glyphs once the pointer is anywhere on the bar, macOS-style */
.window-bar:hover i:nth-of-type(1) { background: #ff5f57; }
.window-bar:hover i:nth-of-type(2) { background: #febc2e; }
.window-bar:hover i:nth-of-type(3) { background: #28c840; }
.window-bar i:hover { color: rgb(0 0 0 / 0.55); }
.window-bar i:nth-of-type(1):hover::before { content: '×'; }
.window-bar i:nth-of-type(2):hover::before { content: '−'; }
.window-bar i:nth-of-type(3):hover::before { content: '+'; }
/* the window itself animates: closed shrinks away, minimized keeps only the
   bar, zoomed stretches to the viewport width */
.window { transition: transform 420ms cubic-bezier(0.32, 0.72, 0, 1), opacity 420ms ease, max-width 420ms cubic-bezier(0.32, 0.72, 0, 1); }
.window.closing { transform: scale(0.03) translateY(40vh); opacity: 0; }
#hero-anim { transition: height 380ms cubic-bezier(0.32, 0.72, 0, 1); }
.window.zoomed { max-width: 96vw !important; }
.window-bar span { margin-left: 8px; font-size: 12px; color: #8c877e; }
.caption { margin: 10px 2px 0; font-size: 13px; color: var(--dim); }

/* ---------- tl;dr ---------- */

.cols-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: clamp(20px, 3vw, 44px); }
.prose p { font-size: 16.5px; line-height: 1.6; color: var(--lede); margin: 0 0 16px; }
.prose p:last-child { margin-bottom: 0; color: var(--muted); }
.list-label { font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--dim); margin: 0 0 10px; }
ul.ruled { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
ul.ruled li {
  border-bottom: 1px solid var(--line); padding: 8px 0;
  font-size: 15px; line-height: 1.5; color: var(--lede);
}

/* ---------- cards ---------- */

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 20px;
}
.card p { margin: 0; font-size: 14.5px; line-height: 1.55; color: var(--muted); }
.card code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.86em; background: var(--panel-2); padding: 1px 5px; border-radius: 4px;
}

/* ---------- alternating shot rows ---------- */

.shots { display: flex; flex-direction: column; gap: clamp(28px, 4vw, 48px); }
.shot { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; align-items: center; }
.shot p { margin: 0; font-size: 15.5px; line-height: 1.6; color: var(--muted); }
.shot .plate { border: 1px solid var(--line-2); border-radius: 9px; overflow: hidden; background: var(--panel); }
.shot .plate.dark { background: #111; }
.shot.flip .copy { order: 2; }
@media (max-width: 700px) { .shot.flip .copy { order: 0; } }

/* ---------- definition rows (features page) ---------- */

.defs { border-top: 1px solid var(--line); }
.def {
  display: grid; grid-template-columns: minmax(150px, 260px) 1fr;
  gap: 8px 28px; border-bottom: 1px solid var(--line); padding: 14px 0;
}
.def p { margin: 0; font-size: 15.5px; line-height: 1.55; color: var(--muted); }
.def h4 { margin: 0; }
@media (max-width: 640px) { .def { grid-template-columns: 1fr; } }

.toc { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 0; }
.toc a {
  font-size: 13px; color: var(--muted);
  border: 1px solid var(--line); background: var(--panel);
  padding: 6px 12px; border-radius: 6px;
}
.toc a:hover { color: var(--text); border-color: var(--line-2); }

/* ---------- keyboard sheet ---------- */

.keys {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 6px 20px 16px;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 36px;
}
.kgroup h5 {
  margin: 16px 0 4px; font-size: 11.5px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--accent); font-weight: 600;
}
.krow { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 14px; padding: 4px 0; }
.krow kbd, kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px; color: var(--text); font-weight: 400;
}
.krow span { color: var(--muted); }

/* ---------- plates (showcase page) ---------- */

.case { margin-bottom: clamp(36px, 5vw, 64px); }
.case .plate { border: 1px solid var(--line-2); border-radius: 9px; overflow: hidden; background: #111; }
.case figcaption {
  display: grid; grid-template-columns: minmax(120px, 170px) 1fr; gap: 10px 24px;
  border-top: 1px solid var(--line); margin-top: 10px; padding-top: 10px;
}
.case .stamp {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px; letter-spacing: 0.08em; color: var(--dim); line-height: 1.6;
}
.case .note { font-size: 15.5px; line-height: 1.55; color: var(--muted); max-width: 64ch; }
.case .note b { color: var(--text); font-weight: 600; }
@media (max-width: 640px) { .case figcaption { grid-template-columns: 1fr; } }

/* ---------- closing block + newsletter ---------- */

.cta-panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: clamp(26px, 4vw, 44px);
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px; align-items: center;
}
.cta-panel p { margin: 0; font-size: 15.5px; line-height: 1.6; color: var(--muted); max-width: 52ch; }
.cta-panel h2 { font-size: clamp(22px, 2.6vw, 30px); }
form.sub-form { display: flex; gap: 8px; margin-top: 16px; max-width: 360px; }
form.sub-form input[type="email"] {
  flex: 1 1 auto; min-width: 0;
  border: 1px solid var(--line-2); border-radius: 7px; background: var(--panel);
  padding: 10px 12px; font-size: 14.5px; font-family: inherit; color: var(--text); outline: none;
}
form.sub-form input[type="email"]:focus { border-color: #8c877e; }
form.sub-form input[type="email"]::placeholder { color: var(--dim); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.form-msg { margin: 8px 0 0; font-size: 12.5px; color: var(--dim); min-height: 18px; }
.form-msg.ok { color: var(--accent); }
.form-msg.err { color: #d9705a; }

/* ---------- footer ---------- */

footer { border-top: 1px solid var(--line); margin-top: clamp(56px, 8vw, 104px); }
.wordmark { display: flex; align-items: flex-end; gap: 7px; padding: 36px 0 10px; }
.wordmark strong {
  font-size: clamp(64px, 12vw, 148px); font-weight: 600;
  letter-spacing: -0.05em; line-height: 0.82;
}
.wordmark i {
  width: clamp(15px, 2.6vw, 32px); height: clamp(15px, 2.6vw, 32px);
  background: var(--accent); display: block; margin-bottom: clamp(5px, 1vw, 12px);
}
footer .cols {
  padding: 18px 0 40px; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: 14px; justify-content: space-between;
  font-size: 12.5px; color: var(--dim);
}
footer .cols a { color: var(--muted); }

/* ---------- reveal ---------- */

.reveal { opacity: 0; transform: translateY(12px); transition: opacity 500ms ease, transform 500ms ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* the sticky header is ~57px tall: without this every anchor jump lands
   with the section title hidden underneath it */
html { scroll-padding-top: 84px; }

/* ---------- hero live table (hero-anim.js) ---------- */
#hero-anim {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1440 / 900;
  background: #161618;
}

/* live reproductions in plates (table-anim.js) */
.table-anim { position: relative; overflow: hidden; aspect-ratio: 16 / 10; background: #161618; }

/* ---------- phone: the page must scan, not read like a wall ---------- */
details.fold > summary { cursor: pointer; list-none: none; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::after { content: ' +'; color: #8c877e; }
details.fold[open] > summary::after { content: ''; }
@media (min-width: 641px) {
  details.fold > summary { pointer-events: none; }
  details.fold > summary::after { content: ''; }
}
@media (max-width: 640px) {
  section { padding: 40px 0; }
  /* a keyboard map is desktop reading — the features page still has it */
  #keys { display: none; }
  .card p { font-size: 14px; }
  /* Real tables becomes a swipe deck: media first, title, one-line caption */
  .shots {
    flex-direction: row;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 14px;
    margin: 0 calc(-1 * var(--pad, 20px));
    padding: 0 var(--pad, 20px) 8px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .shots::-webkit-scrollbar { display: none; }
  .shot {
    display: block;
    flex: 0 0 86%;
    scroll-snap-align: center;
  }
  .shot .plate { margin-bottom: 10px; }
  .shot .copy { order: 0; }
  .shot h3 { margin: 0 0 4px; font-size: 15px; }
  .shot p {
    font-size: 13.5px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  /* media above the words, whichever order the markup has; stretch children
     (the base rule's align-items:center collapses the aspect-ratio plates) */
  .shot { display: flex; flex-direction: column; align-items: stretch; }
  .shot .plate { order: -1; }
}
