/* mcp.axelpaul.is — light and calm: Archivo, cool grey and cobalt, one centred
   frame. Tools carry a small tinted letter mark by category. Fragments marked
   data-ui (the questions panel, the setup slip) keep their own small radii. */

@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("/assets/fonts/archivo-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("/assets/fonts/archivo-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --bg: #eef0f3;
  --surface: #e2e5ea;
  --paper: #ffffff;
  --ink: #0b0c0e;
  --muted: #5d6470;
  --accent: #1f2de6;
  --accent-hover: #1522c4;
  --accent-soft: #e3e6fd;
  --accent-ink: #ffffff;

  /* Category tints for the letter marks: soft ground, deep letter. */
  --hue-0-bg: #dbe9f8; --hue-0-fg: #1d5a99; /* weather */
  --hue-1-bg: #dcefe2; --hue-1-fg: #2b6b45; /* libraries */
  --hue-2-bg: #fbe5d6; --hue-2-fg: #a4471c; /* kids */
  --hue-3-bg: #f6dfe7; --hue-3-fg: #9a2f55; /* booking */
  --hue-4-bg: #f6edcc; --hue-4-fg: #82610b; /* food */
  --hue-5-bg: #d9efed; --hue-5-fg: #1f6b66; /* shopping */
  --hue-6-bg: #dfe7f1; --hue-6-fg: #2f4f75; /* transport */
  --hue-7-bg: #e6e7ea; --hue-7-fg: #3c424c; /* finance */

  --font: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --code: ui-monospace, "SF Mono", Menlo, Consolas, monospace; /* taste-skill-ignore: code blocks only */

  --step-small: clamp(0.8125rem, 0.79rem + 0.1vw, 0.875rem);
  --step-body: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  --step-head: clamp(1.75rem, 1.3rem + 1.6vw, 2.75rem);
  --step-display: clamp(2.5rem, 1rem + 4.4vw, 5rem);

  --margin: clamp(1.25rem, 3vw, 2.5rem);
  --frame: 76rem;
  --section: clamp(6rem, 11vw, 10rem);
  --radius: 6px;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --t-press: 140ms;
  --t-hover: 180ms;
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--step-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
p,
ul,
ol {
  margin: 0;
}

h1,
h2,
h3 {
  font-weight: 400;
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 0.07em;
  text-underline-offset: 0.2em;
  text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
  transition: text-decoration-color var(--t-hover) ease, color var(--t-hover) ease;
}

a:hover {
  text-decoration-color: currentColor;
}

button,
input {
  font: inherit;
  color: inherit;
}

code {
  font-family: var(--code);
  font-size: 0.88em;
  overflow-wrap: anywhere;
}

strong {
  font-weight: 600;
}

::selection {
  background: var(--accent);
  color: var(--accent-ink);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.muted {
  color: var(--muted);
}

.skip {
  position: absolute;
  left: var(--margin);
  top: -4rem;
  z-index: 5;
  background: var(--ink);
  color: var(--bg);
  padding: 0.6rem 1rem;
}

.skip:focus {
  top: 1rem;
}

.wrap {
  width: 100%;
  max-width: calc(var(--frame) + 2 * var(--margin));
  margin-inline: auto;
  padding-inline: var(--margin);
}

.button {
  display: inline-flex;
  align-items: center;
  min-height: 3rem;
  padding: 0 1.375rem;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 600;
  transition:
    background-color var(--t-hover) ease,
    transform var(--t-press) var(--ease-out);
}

.button:hover {
  background: var(--accent-hover);
}

.button:active {
  transform: scale(0.97);
}

.textlink {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-thickness: 0.07em;
  text-underline-offset: 0.2em;
  text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
  transition: text-decoration-color var(--t-hover) ease, color var(--t-hover) ease;
}

.textlink:hover {
  text-decoration-color: currentColor;
}

/* ---------- Letter marks ---------- */

.mono {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 1.0625rem;
  line-height: 1;
}

.mono-s {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 6px;
  font-size: 0.8125rem;
}

.hue-0 { background: var(--hue-0-bg); color: var(--hue-0-fg); }
.hue-1 { background: var(--hue-1-bg); color: var(--hue-1-fg); }
.hue-2 { background: var(--hue-2-bg); color: var(--hue-2-fg); }
.hue-3 { background: var(--hue-3-bg); color: var(--hue-3-fg); }
.hue-4 { background: var(--hue-4-bg); color: var(--hue-4-fg); }
.hue-5 { background: var(--hue-5-bg); color: var(--hue-5-fg); }
.hue-6 { background: var(--hue-6-bg); color: var(--hue-6-fg); }
.hue-7 { background: var(--hue-7-bg); color: var(--hue-7-fg); }

/* ---------- Top bar ---------- */

.top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1.5rem;
  padding-top: 2rem;
}

.mark {
  font-weight: 600;
  text-decoration: none;
}

.toplinks {
  display: flex;
  gap: 1.75rem;
  font-size: var(--step-small);
}

.toplinks a {
  text-decoration: none;
  color: var(--muted);
}

.toplinks a:hover {
  color: var(--ink);
}

/* ---------- Hero: words left, the questions panel right ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 3rem clamp(2.5rem, 6vw, 6rem);
  align-items: center;
  padding-block: clamp(3.5rem, 8svh, 6rem) 3rem;
}

.hero h1 {
  font-size: var(--step-display);
  line-height: 1;
  letter-spacing: -0.035em;
}

.lines .line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.08em;
  margin-bottom: -0.08em;
}

.lines [data-line] {
  display: block;
}

.hero-lead {
  margin-top: 1.75rem;
  max-width: 34rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.75rem;
  margin-top: 2.25rem;
}

/* The questions panel (data-ui): real questions and the tool that answers each. */

.ask {
  background: var(--paper);
  border-radius: 14px;
  padding: 1.25rem 1.25rem 1rem;
}

.ask-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
  font-size: var(--step-small);
  padding: 0 0.25rem 0.75rem;
}

.ask-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
  50% {
    opacity: 0.35;
  }
}

.ask-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* While the conversation runs, the list keeps one height and is anchored to the
   bottom, so new messages push older ones up instead of resizing the panel. */
.ask-list.is-live {
  height: 25rem;
  justify-content: flex-end;
  overflow: hidden;
  mask-image: linear-gradient(to bottom, transparent 0, #000 1rem); /* taste-skill-ignore: soft top edge inside the data-ui panel */
}

.ask-list li {
  flex: none;
}

.ask-list li[hidden] {
  display: none;
}

.ask-list a {
  display: grid;
  gap: 0.5rem;
  text-decoration: none;
}

.ask-q {
  justify-self: end;
  max-width: 88%;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 0.65rem 0.9rem;
  border-radius: 14px 14px 4px 14px;
  line-height: 1.4;
  transition: background-color var(--t-hover) ease;
}

.ask-list a:hover .ask-q {
  background: var(--accent-hover);
}

.ask-tool {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  justify-self: start;
  color: var(--muted);
  font-size: var(--step-small);
  background: var(--bg);
  padding: 0.3rem 0.65rem 0.3rem 0.3rem;
  border-radius: 999px;
}

.typing {
  display: inline-flex;
  gap: 4px;
  justify-self: start;
  padding: 0.6rem 0.75rem;
  background: var(--bg);
  border-radius: 999px;
}

.typing i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
  opacity: 0.35;
  animation: typing 1.2s ease-in-out infinite;
}

.typing i:nth-child(2) {
  animation-delay: 0.15s;
}

.typing i:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes typing {
  30% {
    opacity: 1;
    transform: translateY(-2px);
  }
}

/* ---------- Service strip ---------- */

.strip-wrap {
  padding-bottom: 1rem;
}

.strip {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
}

.strip a {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.35rem 0.9rem 0.35rem 0.35rem;
  background: var(--paper);
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.9375rem;
  transition:
    transform var(--t-press) var(--ease-out),
    background-color var(--t-hover) ease;
}

.strip a:hover {
  background: var(--accent-soft);
}

.strip a:active {
  transform: scale(0.97);
}

.strip .mono {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 999px;
  font-size: 0.8125rem;
}

/* ---------- The tools: a white band, heading beside the list ---------- */

h2 {
  font-size: var(--step-head);
  line-height: 1.08;
  letter-spacing: -0.025em;
}

.tools {
  margin-top: clamp(3rem, 6vw, 5rem);
  background: var(--paper);
  padding-block: clamp(3.5rem, 6vw, 5.5rem);
}

.tools-grid {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  gap: 2.5rem clamp(2.5rem, 6vw, 6rem);
  align-items: start;
}

.tools-side {
  position: sticky;
  top: 2.5rem;
}

.section-lead {
  margin-top: 1.25rem;
  max-width: 24rem;
  color: var(--muted);
}

.group + .group {
  margin-top: 2.75rem;
}

.group-name {
  color: var(--muted);
  font-size: var(--step-small);
  margin-bottom: 0.5rem;
}

.rows {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.row {
  position: relative;
  background: var(--bg);
  border-radius: 12px;
  scroll-margin-top: 2rem;
  transition: background-color var(--t-hover) ease;
}

.row:hover,
.row:has(details[open]) {
  background: #e8ebf0;
}

.row summary {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 8.5rem 1rem 1rem;
  cursor: pointer;
  list-style: none;
}

.row summary::-webkit-details-marker {
  display: none;
}

.row-name {
  flex: 1;
  min-width: 0;
  font-weight: 600;
}

.row-what {
  display: block;
  font-weight: 400;
  color: var(--muted);
}

.row-val {
  flex: none;
  color: var(--muted);
  font-size: var(--step-small);
}

/* Add toggle, pinned top-right of the row. */
.add {
  position: absolute;
  top: 50%;
  right: 1rem;
  translate: 0 -50%;
  display: inline-flex;
  align-items: center;
  min-height: 2.25rem;
  padding: 0 0.875rem;
  border-radius: 999px;
  background: var(--paper);
  font-size: var(--step-small);
  font-weight: 600;
  cursor: pointer;
  transition:
    background-color var(--t-hover) ease,
    color var(--t-hover) ease,
    transform var(--t-press) var(--ease-out);
}

/* An open row is tall; keep the toggle beside the summary, not mid-row. */
.row:has(details[open]) .add {
  top: 1.75rem;
  translate: none;
}

.add:hover {
  background: var(--accent-soft);
}

.add:active {
  transform: scale(0.95);
}

.add input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.add:has(input:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.add-on {
  display: none;
}

.add:has(input:checked) {
  background: var(--accent);
  color: var(--accent-ink);
}

.add:has(input:checked) .add-on {
  display: inline;
}

.add:has(input:checked) .add-off {
  display: none;
}

.add-na {
  background: transparent;
  color: var(--muted);
  font-weight: 400;
  cursor: default;
}

.add-na:hover {
  background: transparent;
}

.row-more {
  padding: 0 1rem 1.75rem 4.5rem;
}

.row-more > p:first-child {
  max-width: 40rem;
}

.row-more h3 {
  font-size: var(--step-body);
  font-weight: 600;
  margin: 1.75rem 0 0.5rem;
}

.asks {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.asks li {
  background: var(--paper);
  border-radius: 14px 14px 14px 4px;
  padding: 0.45rem 0.8rem;
}

.note {
  margin-top: 0.5rem;
  color: var(--muted);
  font-size: var(--step-small);
}

.code {
  margin: 0;
  font-family: var(--code);
  font-size: 0.8125rem;
  line-height: 1.6;
  background: var(--paper);
  border-radius: var(--radius);
  padding: 0.75rem 4.5rem 0.75rem 0.875rem;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}

.code code {
  font-size: inherit;
}

.tok {
  display: inline-block;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.copy-wrap,
.slip-code {
  position: relative;
}

.copy {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  border: 0;
  background: var(--bg);
  color: var(--ink);
  font-size: var(--step-small);
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition:
    background-color var(--t-hover) ease,
    transform var(--t-press) var(--ease-out);
}

.copy:hover {
  background: var(--surface);
}

.copy:active {
  transform: scale(0.95);
}

.copy:disabled {
  opacity: 0.4;
  cursor: default;
}

.table-wrap {
  overflow-wrap: anywhere;
}

.row-more table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--step-small);
}

.row-more th,
.row-more td {
  text-align: left;
  vertical-align: top;
  padding: 0.45rem 1rem 0.45rem 0;
  border-bottom: 1px solid var(--surface);
}

.row-more th {
  font-weight: 400;
}

.row-more td:nth-child(2) {
  color: var(--muted);
  white-space: nowrap;
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin-top: 1.5rem;
}

/* ---------- Set up: text beside the slip ---------- */

.setup {
  margin-top: var(--section);
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 3rem clamp(2.5rem, 6vw, 6rem);
  align-items: start;
}

.setup-text p {
  margin-top: 1.25rem;
  max-width: 26rem;
  color: var(--muted);
}

.os {
  display: flex;
  gap: 1.25rem;
}

.os .textlink {
  color: var(--muted);
}

.os .textlink[aria-pressed="true"] {
  color: var(--ink);
  text-decoration-color: currentColor;
}

.slip-ground {
  background: var(--accent);
  padding: clamp(1.5rem, 4vw, 3.5rem);
  border-radius: 16px;
}

.slip {
  max-width: 32rem;
  margin-inline: auto;
  background: var(--paper);
  padding: 1.75rem 1.75rem 2.5rem;
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
  clip-path: polygon(
    0 0, 100% 0, 100% calc(100% - 10px),
    95% 100%, 90% calc(100% - 10px), 85% 100%, 80% calc(100% - 10px), 75% 100%, 70% calc(100% - 10px),
    65% 100%, 60% calc(100% - 10px), 55% 100%, 50% calc(100% - 10px), 45% 100%, 40% calc(100% - 10px),
    35% 100%, 30% calc(100% - 10px), 25% 100%, 20% calc(100% - 10px), 15% 100%, 10% calc(100% - 10px),
    5% 100%, 0 calc(100% - 10px)
  );
}

.slip-head {
  font-weight: 600;
  margin-top: 1.75rem;
  margin-bottom: 0.5rem;
}

.slip-head:first-child {
  margin-top: 0;
}

.slip-rows {
  list-style: none;
  padding: 0;
}

.slip-row {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.slip-row + .slip-row {
  margin-top: 0.25rem;
}

.dots {
  flex: 1;
  min-width: 1.5rem;
  height: 4px;
  align-self: center;
  margin-top: 0.35em;
  background-image: radial-gradient(circle, var(--muted) 1.2px, transparent 1.6px); /* taste-skill-ignore: dotted leader on the receipt */
  background-size: 8px 4px;
  opacity: 0.6;
}

.slip-code {
  margin-top: 0.625rem;
}

.slip-code .code {
  background: var(--bg);
}

.slip-code .copy {
  background: var(--paper);
}

.slip-final {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 1.75rem -1.75rem 0;
  min-height: 2.75rem;
  padding: 0 1.75rem;
  background: var(--ink);
  color: var(--paper);
  font-weight: 600;
}

/* ---------- Questions as reading text ---------- */

.faq {
  margin-top: var(--section);
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  gap: 2rem clamp(2.5rem, 6vw, 6rem);
  align-items: start;
}

.faq-text {
  columns: 2;
  column-gap: 3rem;
}

.faq-text p {
  break-inside: avoid;
  margin-bottom: 1.5rem;
}

/* ---------- Footer ---------- */

.foot {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: baseline;
  gap: 1rem;
  margin-top: var(--section);
  padding-block: 2rem 2.5rem;
  font-size: var(--step-small);
}

.foot-links {
  display: flex;
  gap: 1.5rem;
}

.foot-year {
  text-align: right;
}

/* ---------- Narrower screens ---------- */

@media (max-width: 60rem) {
  .hero,
  .tools-grid,
  .setup,
  .faq {
    grid-template-columns: minmax(0, 1fr);
  }

  .ask-list {
    min-height: 0;
  }

  .tools-side {
    position: static;
  }
}

@media (max-width: 40rem) {
  .ask-list.is-live {
    height: 28rem;
  }

  .toplinks a:not(:last-child) {
    display: none;
  }

  .hero {
    padding-top: 3.5rem;
  }

  .row summary {
    align-items: flex-start;
    padding: 0.875rem 1rem 3.5rem;
    gap: 0.875rem;
    flex-wrap: wrap;
  }

  .row-val {
    position: absolute;
    left: 4.375rem;
    bottom: 1.4rem;
  }

  .add {
    top: auto;
    bottom: 0.875rem;
    translate: none;
  }

  .row:has(details[open]) .add {
    top: auto;
  }

  .row-more {
    padding: 0 1rem 1.5rem;
  }

  .row-more tr {
    display: grid;
  }

  .row-more th,
  .row-more td {
    padding: 0.125rem 0;
    border: 0;
    white-space: normal;
  }

  .row-more tr + tr th {
    padding-top: 0.75rem;
  }

  .faq-text {
    columns: 1;
  }

  .foot {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .foot-year {
    text-align: left;
  }

  .slip {
    padding-inline: 1.25rem;
  }

  .slip-final {
    margin-inline: -1.25rem;
    padding-inline: 1.25rem;
  }
}

/* ---------- Motion: content stays visible without script or with reduced motion ---------- */

@media (prefers-reduced-motion: no-preference) {
  .js .lines [data-line] {
    transform: translateY(105%);
    animation: line-up 900ms var(--ease-out) forwards;
    animation-delay: calc(var(--i, 0) * 110ms + 150ms);
  }

  .js [data-rise] {
    opacity: 0;
    transform: translateY(16px);
    animation: rise 800ms var(--ease-out) forwards;
    animation-delay: calc(var(--i, 0) * 110ms + 300ms);
  }

  .js .ask {
    opacity: 0;
    transform: translateY(24px);
    animation: rise 900ms var(--ease-out) 500ms forwards;
  }

  .js [data-reveal] {
    opacity: 0;
    transform: translateY(20px);
    transition:
      opacity 700ms var(--ease-out),
      transform 900ms var(--ease-out);
  }

  .js [data-reveal].is-in {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .typing i,
  .ask-dot {
    animation: none;
  }
}

@keyframes line-up {
  to {
    transform: none;
  }
}

@keyframes rise {
  to {
    opacity: 1;
    transform: none;
  }
}
