:root {
  --blue: #4a8cf0;
  --blue-deep: #2f6fe0;
  --ink: #0a0c10;
  --body: #45505f;
  --muted: #667085;
  --bg: #ffffff;
  --bg-soft: #f4f7fc;
  --panel: #eef3fb;
  --border: rgba(10, 12, 16, 0.08);
  --shadow: 0 30px 80px -30px rgba(26, 60, 120, 0.35);
  --radius: 20px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
          "Helvetica Neue", "Segoe UI", Roboto, Arial, sans-serif;
  --mono: "SF Mono", ui-monospace, "JetBrains Mono", "Menlo", "Consolas", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #f4f6fa;
    --body: #b6c0cf;
    --muted: #7a8698;
    --bg: #0b0d12;
    --bg-soft: #10131b;
    --panel: #151925;
    --border: rgba(255, 255, 255, 0.09);
    --shadow: 0 40px 100px -30px rgba(0, 0, 0, 0.8);
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--body);
  /* Tall enough to still be there behind the screenshots. The deck sits about
     700px down and runs another 600 past that, and a 600px-high wash centred
     above the fold had finished long before any of it. */
  background:
    radial-gradient(1600px 1850px at 50% -300px, rgba(74, 140, 240, 0.2), transparent 72%),
    var(--bg);
  background-repeat: no-repeat;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

header {
  padding: 40px 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.wordmark img {
  width: 52px;
  height: 52px;
  display: block;
  filter: drop-shadow(0 6px 14px rgba(47, 111, 224, 0.28));
}
.wordmark span {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}

/* The language picker is a <details>, so it opens and closes with no script and
   holds real links to the other forty-two pages. */
.lang {
  position: relative;
  flex: none;
}
.lang summary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px 8px 11px;
  font-size: 0.88rem;
  color: var(--body);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.lang summary::-webkit-details-marker { display: none; }
.lang summary:hover { border-color: rgba(74, 140, 240, 0.45); color: var(--ink); }
.lang summary:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.lang .chev {
  width: 15px; height: 15px;
  fill: var(--muted);
  flex: none;
  transition: transform 0.18s ease;
}
.lang[open] .chev { transform: rotate(180deg); }

.lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  inset-inline-end: 0;
  z-index: 40;
  width: 236px;
  max-height: min(60vh, 420px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 24px 50px -18px rgba(26, 60, 120, 0.35);
}
@media (prefers-color-scheme: dark) {
  .lang-menu { box-shadow: 0 24px 50px -18px rgba(0, 0, 0, 0.85); }
}
.lang-menu a {
  display: block;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.9rem;
  color: var(--body);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lang-menu a:hover { background: var(--bg-soft); color: var(--ink); }
.lang-menu a[aria-current="page"] {
  color: var(--ink);
  font-weight: 600;
  background: var(--panel);
}

.hero {
  text-align: center;
  padding: 48px 0 8px;
}
.hero h1 {
  margin: 0 auto;
  max-width: 18ch;
  font-size: clamp(2.1rem, 6vw, 3.6rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  font-weight: 700;
  color: var(--ink);
}
.hero h1 .accent {
  white-space: nowrap;
  background: linear-gradient(120deg, var(--blue), var(--blue-deep));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.swap { white-space: nowrap; }
.swap-slot {
  display: inline-block;
  text-align: left;
  white-space: pre;
}
.swap-word {
  position: relative;
  display: inline-block;
}

.swap-word::before {
  content: "";
  position: absolute;
  inset: 0.06em -0.07em 0.08em -0.07em;
  border-radius: 4px;
  background: rgba(74, 140, 240, 0.28);
  transform: scaleX(0);
  transform-origin: left center;
  opacity: 0;
  z-index: -1;
}
.swap.is-selecting .swap-word::before {
  transform: scaleX(1);
  opacity: 1;
  transition: transform 0.24s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.1s ease;
}

.swap-caret {
  display: inline-block;
  width: 0.055em;
  height: 0.8em;
  margin-left: 0.035em;
  vertical-align: -0.04em;
  background: var(--blue);
  border-radius: 1px;
  animation: caret-blink 1.06s steps(1, end) infinite;
}
.swap.is-typing .swap-caret { animation: none; opacity: 1; }
.swap.is-done .swap-caret { animation: none; opacity: 0; transition: opacity 0.5s ease 0.5s; }
@keyframes caret-blink { 0%, 55% { opacity: 1; } 56%, 100% { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .swap-caret { animation: none; opacity: 0; }
}

.hero p.sub {
  margin: 22px auto 0;
  max-width: 46ch;
  font-size: clamp(1.02rem, 2.4vw, 1.2rem);
  color: var(--body);
}
.hero p.sub + p.sub { margin-top: 8px; }

.cta {
  margin: 30px 0 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.download {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: #000;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  padding: 11px 18px 11px 16px;
  transition: box-shadow 0.15s ease;
  box-shadow: 0 8px 24px -10px rgba(0, 0, 0, 0.5);
}
.download:hover { box-shadow: 0 12px 28px -12px rgba(0, 0, 0, 0.55); }
.download svg { width: 26px; height: 26px; fill: #fff; flex: none; }
.download strong { font-size: 1.18rem; font-weight: 600; letter-spacing: -0.01em; }
.version { font-size: 0.85rem; color: var(--muted); letter-spacing: 0.01em; }

.download:hover .arrow { animation: arrow-drop 0.45s ease; }
@keyframes arrow-drop {
  45% { transform: translateY(3.5px); }
  75% { transform: translateY(-1px); }
  100% { transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .download:hover .arrow { animation: none; }
}

/* The deck runs edge to edge, out of the 1080px column the rest of the page
   keeps to. A screenshot of a window wants to be as big as it can be, and the
   strip reads as something to push sideways precisely because it does not stop
   where the paragraphs stop. */
.deck {
  margin: 20px 0 0;
  width: 100vw;
  margin-inline: calc(50% - 50vw);
}

/* Half a viewport, less half a card: the padding is what centres the first and
   last shots rather than leaving them jammed against the edge, and it is what
   scroll snapping measures its stops against. */
.rail {
  --card: min(880px, 84vw);
  display: flex;
  align-items: flex-start;
  gap: 30px;
  /* The vertical padding is doing two jobs: it is the room the screenshots need
     to sit in the blue rather than be clipped by it, and it is what the drop
     shadow falls into - a scroll container clips at its padding edge, so a
     shadow with nothing under it is a shadow cut off in a straight line. */
  padding: 56px max(8vw, calc(50vw - var(--card) / 2)) 76px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 3%, #000 97%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 3%, #000 97%, transparent);
}
.rail::-webkit-scrollbar { display: none; }

.shot {
  flex: 0 0 auto;
  width: var(--card);
  margin: 0;
  scroll-snap-align: center;
  opacity: 0.45;
  transition: opacity 0.4s ease;
}
.shot[data-active] { opacity: 1; }

/* A drop-shadow filter rather than a box-shadow: the screenshots are windows
   with rounded corners and transparent outside them, and only the filter
   follows that shape - a box shadow would draw the corners back on as squares. */
.shot img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 10px;
  filter: drop-shadow(0 26px 55px rgba(26, 60, 120, 0.3));
}
@media (prefers-color-scheme: dark) {
  .shot img { filter: drop-shadow(0 26px 60px rgba(0, 0, 0, 0.75)); }
}

.rail:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: -2px;
  border-radius: 6px;
}

@media (prefers-reduced-motion: reduce) {
  .shot { transition: none; }
  .rail { scroll-behavior: auto; }
}

/* The deck stays left-to-right on a right-to-left page. The shots are of an app
   whose windows read left to right, they are in a sequence somebody chose, and
   a horizontal scroller that runs the other way makes `scrollLeft` count
   backwards from zero - so the strip keeps its direction. */
[dir="rtl"] .rail { direction: ltr; }

.features {
  padding: 88px 0 24px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.card {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 26px 24px;
  transition: border-color 0.15s ease;
}
.card:hover { border-color: rgba(74, 140, 240, 0.4); }
.card .ic {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--blue), var(--blue-deep));
  color: #fff;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 16px;
  box-shadow: 0 8px 18px -8px rgba(47, 111, 224, 0.6);
}
.card h2 {
  margin: 0 0 6px;
  font-size: 1.06rem;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.card p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--body);
}
.card code {
  font-family: var(--mono);
  font-size: 0.85em;
  background: var(--panel);
  padding: 1px 5px;
  border-radius: 5px;
}

.definition {
  padding: 64px 0 8px;
}
.entry {
  max-width: 680px;
  margin: 0 auto;
}
.entry .headword {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 4px;
}
.entry .headword b {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.entry .pron {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--muted);
}
.entry .pos {
  font-style: italic;
  font-size: 0.9rem;
  color: var(--muted);
}
.entry p {
  margin: 14px 0 0;
  font-size: 0.98rem;
}
.entry p.sense {
  margin-top: 10px;
  color: var(--ink);
}
.entry ol {
  margin: 14px 0 0;
  padding-left: 20px;
}
.entry li {
  margin-bottom: 10px;
  font-size: 0.95rem;
}
.entry li:last-child { margin-bottom: 0; }
.entry li b { color: var(--ink); font-weight: 600; }
.entry .glyph {
  font-family: var(--mono);
  font-size: 0.9em;
  background: var(--panel);
  padding: 1px 6px;
  border-radius: 5px;
}
.entry a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  text-decoration-color: rgba(74, 140, 240, 0.45);
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}
.entry a:hover { color: var(--blue); text-decoration-color: var(--blue); }

footer {
  margin-top: 80px;
  padding: 34px 0 48px;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--muted);
  font-size: 0.88rem;
}
footer a {
  color: var(--body);
  transition: color 0.15s ease;
}
footer a:hover { color: var(--blue); }

@media (max-width: 720px) {
  .grid { grid-template-columns: 1fr; }
  header { padding-top: 28px; }
  .hero { padding-top: 30px; }
  .features { padding-top: 60px; }
  .rail { --card: 88vw; gap: 18px; }
}
