/* Base — reset, type defaults and the components the header and footer share. */

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

html {
  overflow-x: clip;
  scrollbar-gutter: stable;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  overflow-x: clip;
  min-height: 100dvh;
  background-color: var(--color-paper);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-body);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* The language menu's "中文" / "日本語" labels on an English page. A page in Chinese or Japanese
   gets its fonts from inc/i18n-render.php instead. */
a[lang|="zh"] {
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", var(--font-body);
}

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

address {
  font-style: normal;
}

ul[role="list"],
ol[role="list"] {
  list-style: none;
  padding: 0;
}

a {
  color: inherit;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.2em;
}

img,
svg {
  display: block;
  max-width: 100%;
}

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

button {
  cursor: pointer;
}

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

::selection {
  background-color: var(--color-blue);
  color: var(--color-paper);
}

/* Anchor jumps and focus stop below the fixed header instead of underneath it. */
html {
  scroll-padding-top: calc(var(--header-h) + var(--ruler-offset, 0px) + var(--space-md));
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

/* Lenis (site.js) drives the scroll itself; native smoothing on top of it would stutter. */
html.lenis {
  scroll-behavior: auto;
}

/* Utilities ------------------------------------------------------------ */

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

.skip-link {
  position: fixed;
  inset-block-start: var(--space-sm);
  inset-inline-start: var(--space-sm);
  z-index: var(--z-skip);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-pill);
  background-color: var(--color-ink);
  color: var(--color-paper);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-200%);
}

.skip-link:focus-visible {
  transform: none;
  outline-color: var(--color-blue-soft);
}

/* Loader — the logo separator, played once as the page opens -----------------
 * From animasi_tiga_titik/logo-separator.html: two lines run in from the screen edges and
 * are drawn into the mark (ribbons A and C first, the B lock last), then the panel lifts.
 * Shown only with JS and without reduced motion; once per session (header.php / site.js). */

.loader {
  display: none;
}

html.js:not(.loader-skip) .loader {
  position: fixed;
  inset: 0;
  z-index: calc(var(--z-skip) + 1);
  display: grid;
  align-content: center;
  background-color: var(--color-paper);
  color: var(--color-blue);
}

/* No scrolling under the loader. */
html.js:not(.loader-skip):not(.loader-done) {
  overflow: hidden;
}

.loader.is-leaving {
  translate: 0 -100%;
  transition: translate var(--dur-reveal) var(--ease-in-out);
}

.loader.is-leaving .logo-sep {
  opacity: 0;
  scale: 0.9;
  transition:
    opacity calc(var(--dur-reveal) * 0.5) var(--ease-in),
    scale calc(var(--dur-reveal) * 0.5) var(--ease-in);
}

.logo-sep {
  --size: clamp(4.5rem, 9vw, 7rem); /* the mark */
  --line: 2px;                      /* line thickness */
  --loop-dur: 2.2s;                 /* one pass: lines in, mark drawn */
  position: relative;
  height: var(--size);
}

.logo-sep__mark {
  position: absolute;
  inset-block-start: 0;
  left: 50%;
  width: var(--size);
  height: var(--size);
  overflow: visible;
  translate: -50% 0;
}

.logo-sep__mark g path {
  --from: 1;
  fill: none;
  stroke: currentColor;
  stroke-width: 120;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: logo-sep-draw var(--loop-dur) both;
}

.logo-sep__mark g .logo-sep__b {
  animation-name: logo-sep-draw-late;
}

.logo-sep__mark g .logo-sep__c {
  --from: -1; /* drawn from the end of its path */
}

.logo-sep__line {
  position: absolute;
  inset-block-start: calc(var(--size) * 0.6406 - var(--line) / 2);
  height: var(--line);
  animation: logo-sep-line var(--loop-dur) both;
}

/* the inner end of each line stops exactly at the end of its ribbon */
.logo-sep__line--l {
  left: 0;
  right: calc(50% + var(--size) * 0.31);
  transform-origin: right;
  background: linear-gradient(to right, transparent, currentColor 45%);
}

.logo-sep__line--r {
  right: 0;
  left: calc(50% + var(--size) * 0.3025);
  transform-origin: left;
  background: linear-gradient(to left, transparent, currentColor 45%);
}

@keyframes logo-sep-line {
  0%,
  18% {
    transform: scaleX(1);
    animation-timing-function: cubic-bezier(0.6, 0, 0.3, 1);
  }

  62%,
  100% {
    transform: scaleX(0);
  }
}

@keyframes logo-sep-draw {
  0%,
  18% {
    stroke-dashoffset: var(--from);
    animation-timing-function: cubic-bezier(0.6, 0, 0.3, 1);
  }

  62%,
  100% {
    stroke-dashoffset: 0;
  }
}

@keyframes logo-sep-draw-late {
  0%,
  32% {
    stroke-dashoffset: var(--from);
    animation-timing-function: cubic-bezier(0.6, 0, 0.3, 1);
  }

  76%,
  100% {
    stroke-dashoffset: 0;
  }
}

/* Rulers — design-tool rulers on the top and left edges ---------------------
 * Ticks are dots (small every 10px, large every 100px). The top ruler measures the screen;
 * the side ruler measures the page and scrolls with it, with section names sliding by.
 * A blue dot + readout follows the cursor on each. site.js adds html.has-rulers on
 * desktop with a mouse; the header and banner then step in by --ruler-offset. */

:root {
  --ruler: 1.375rem;
  --ruler-offset: 0px;
}

html.has-rulers {
  --ruler-offset: var(--ruler);
}

.rulers {
  display: none;
}

html.has-rulers .rulers {
  display: block;
}

html.has-rulers.is-menu-open .rulers {
  display: none;
}

.ruler {
  --ruler-bg: color-mix(in oklch, var(--color-paper) 88%, transparent);
  position: fixed;
  z-index: calc(var(--z-sticky) + 10);
  overflow: hidden;
  background-color: var(--ruler-bg);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: var(--color-muted);
  font-size: 0.5625rem; /* 9px — ruler numbers are meant to be tiny */
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  pointer-events: none;
}

/* Horizontal rulers (top + bottom): screen x. Dots sit on the tick positions (centre of
 * each 10px tile), on the side of the ruler that faces the page (--tick). */
.ruler--x {
  --tick: 70%;
  inset-inline: var(--ruler);
  height: var(--ruler);
  background-image:
    radial-gradient(circle, var(--color-muted) 1.6px, transparent 2.1px),
    radial-gradient(circle, var(--color-rule) 1px, transparent 1.5px);
  background-size: 100px 100%, 10px 100%;
  background-position: calc(-1 * var(--ruler) - 50px) var(--tick), calc(-1 * var(--ruler) - 5px) var(--tick);
  background-repeat: repeat-x;
}

.ruler--top {
  inset-block-start: 0;
  border-block-end: var(--rule-hair) solid var(--color-rule);
}

.ruler--bottom {
  --tick: 30%;
  inset-block-end: 0;
  border-block-start: var(--rule-hair) solid var(--color-rule);
}

/* Vertical rulers (left + right): page y — the tick pattern scrolls with the page
 * (--ry, set by site.js). */
.ruler--y {
  --tick: 70%;
  inset-block: var(--ruler);
  width: var(--ruler);
  background-image:
    radial-gradient(circle, var(--color-muted) 1.6px, transparent 2.1px),
    radial-gradient(circle, var(--color-rule) 1px, transparent 1.5px);
  background-size: 100% 100px, 100% 10px;
  background-position: var(--tick) calc(var(--ry, 0px) - var(--ruler) - 50px), var(--tick) calc(var(--ry, 0px) - var(--ruler) - 5px);
  background-repeat: repeat-y;
}

.ruler--left {
  inset-inline-start: 0;
  border-inline-end: var(--rule-hair) solid var(--color-rule);
}

.ruler--right {
  --tick: 30%;
  inset-inline-end: 0;
  border-inline-start: var(--rule-hair) solid var(--color-rule);
}

.ruler__corner {
  position: fixed;
  z-index: calc(var(--z-sticky) + 11);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: var(--ruler);
  height: var(--ruler);
  background-color: var(--color-paper);
}

.ruler__corner--tl {
  inset: 0 auto auto 0;
  border-inline-end: var(--rule-hair) solid var(--color-rule);
  border-block-end: var(--rule-hair) solid var(--color-rule);
}

.ruler__corner--tr {
  inset: 0 0 auto auto;
  border-inline-start: var(--rule-hair) solid var(--color-rule);
  border-block-end: var(--rule-hair) solid var(--color-rule);
}

.ruler__corner--bl {
  inset: auto auto 0 0;
  border-inline-end: var(--rule-hair) solid var(--color-rule);
  border-block-start: var(--rule-hair) solid var(--color-rule);
}

.ruler__corner--br {
  inset: auto 0 0 auto;
  border-inline-start: var(--rule-hair) solid var(--color-rule);
  border-block-start: var(--rule-hair) solid var(--color-rule);
}

.ruler__corner i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background-color: var(--color-blue);
}

/* Numbers every 100px (built by site.js). */
.ruler__num {
  position: absolute;
  color: var(--color-muted);
}

/* Numbers sit on the outer side of each ruler; the dots face the page. */
.ruler--x .ruler__num {
  inset-block-start: 2px;
  translate: 3px 0;
}

.ruler--bottom .ruler__num {
  inset-block: auto 2px;
}

.ruler--y .ruler__num {
  inset-inline-start: 2px;
  writing-mode: vertical-rl;
  rotate: 180deg;
  translate: 0 calc(-100% - 3px);
}

.ruler--right .ruler__num {
  inset-inline: auto 2px;
}

/* Section names sliding past on the side ruler. */
.ruler__section {
  position: absolute;
  inset-inline-start: 0;
  width: 100%;
  padding-block: 0.35rem;
  border-block-start: 2px solid var(--color-blue);
  background-color: var(--color-paper);
  color: var(--color-blue);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
  writing-mode: vertical-rl;
  rotate: 180deg;
}

/* Cursor marker: a blue dot on the ruler with the coordinate beside it. */
.ruler__marker {
  position: absolute;
  inset-block-start: 0;
  inset-inline-start: 0;
  opacity: 0;
  transition: opacity var(--dur-short) var(--ease-out);
}

.rulers.is-tracking .ruler__marker {
  opacity: 1;
}

.ruler__marker::before {
  content: "";
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--color-blue);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--color-blue) 22%, transparent);
}

.ruler--x .ruler__marker {
  height: 100%;
  translate: var(--mx, 0px) 0;
}

.ruler--x .ruler__marker::before {
  inset-block-start: calc(var(--tick) - 3px);
  inset-inline-start: -3px;
}

.ruler--y .ruler__marker {
  width: 100%;
  translate: 0 var(--my, 0px);
}

.ruler--y .ruler__marker::before {
  inset-inline-start: calc(var(--tick) - 3px);
  inset-block-start: -3px;
}

.ruler__readout {
  position: absolute;
  padding: 2px 4px;
  border-radius: 3px;
  background-color: var(--color-blue);
  color: var(--color-paper);
  font-weight: 700;
  white-space: nowrap;
}

.ruler--x .ruler__readout {
  inset-block-start: 3px;
  inset-inline-start: 7px;
}

.ruler--bottom .ruler__readout {
  inset-block: auto 3px;
}

.ruler--y .ruler__readout {
  inset-inline-start: 3px;
  inset-block-start: 7px;
  writing-mode: vertical-rl;
  rotate: 180deg;
}

.ruler--right .ruler__readout {
  inset-inline: auto 3px;
}

/* Keep the end of the page clear of the bottom ruler. */
html.has-rulers .site-footer {
  padding-block-end: calc(max(var(--space-lg), env(safe-area-inset-bottom)) + var(--ruler-offset));
}

/* Scroll progress — a ring in the bottom-left corner ----------------------------
 * Fills as you read with the percentage inside; at the very end it becomes an arrow.
 * Always a link to the top. Appears once you've started scrolling (site.js). */

.scroll-progress {
  --size: 3.5rem;
  position: fixed;
  inset-block-end: calc(var(--space-md) + var(--ruler-offset, 0px));
  /* Bottom left: the bottom right belongs to the chat and WhatsApp buttons. */
  inset-inline-start: calc(var(--space-md) + var(--ruler-offset, 0px));
  z-index: calc(var(--z-sticky) - 2);
  display: grid;
  place-items: center;
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  background-color: var(--color-paper);
  color: var(--color-blue);
  box-shadow: 0 0.75rem 1.5rem -0.75rem var(--color-shadow), 0 0 0 var(--rule-hair) var(--color-rule);
  text-decoration: none;
  opacity: 0;
  scale: 0.8;
  pointer-events: none;
  transition:
    opacity var(--dur-short) var(--ease-out),
    scale var(--dur-short) var(--ease-out);
}

.scroll-progress.is-visible {
  opacity: 1;
  scale: 1;
  pointer-events: auto;
}

html.is-menu-open .scroll-progress {
  opacity: 0;
  pointer-events: none;
}

.scroll-progress > * {
  grid-area: 1 / 1;
}

.scroll-progress__ring {
  width: 100%;
  height: 100%;
  rotate: -90deg; /* start filling from 12 o'clock */
}

.scroll-progress__track,
.scroll-progress__bar {
  fill: none;
  stroke-width: 4;
}

.scroll-progress__track {
  stroke: var(--color-paper-2);
}

/* Gradient along the ring: brand blue into the soft blue. */
.scroll-progress__stop-a {
  stop-color: var(--color-blue);
}

.scroll-progress__stop-b {
  stop-color: var(--color-blue-soft);
}

.scroll-progress__bar {
  stroke-linecap: round;
  stroke-dasharray: 100;
  stroke-dashoffset: calc(100 - var(--progress, 0));
}

.scroll-progress__value {
  color: var(--color-ink);
  font-size: var(--text-xs);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  transition: opacity var(--dur-short) var(--ease-out), scale var(--dur-short) var(--ease-out);
}

.scroll-progress__arrow {
  width: 1.4rem;
  height: 1.4rem;
  fill: none;
  stroke: var(--color-blue);
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
  scale: 0.6;
  translate: 0 0.4rem;
  transition:
    opacity var(--dur-short) var(--ease-out),
    scale var(--dur-short) var(--ease-out),
    translate var(--dur-long) var(--ease-out);
}

/* At the bottom: the number gives way to the arrow. */
.scroll-progress.is-done .scroll-progress__value {
  opacity: 0;
  scale: 0.6;
}

.scroll-progress.is-done .scroll-progress__arrow {
  opacity: 1;
  scale: 1;
  translate: 0 0;
}

@media (hover: hover) {
  .scroll-progress:hover {
    scale: 1.06;
  }

  .scroll-progress.is-done:hover .scroll-progress__arrow {
    translate: 0 -0.15rem;
  }
}

/* Chat buttons (plugins) — one column in the bottom-right corner ----------------
 * Chatway's bubble (size M = 60px) takes the corner, as far in from the edges as the
 * scroll ring on the left (inside the rulers on desktop), never closer than 20px.
 * Its chat window opens 10px above it. Chaty's WhatsApp button (also 60px: Chaty →
 * widget size) sits 16px above the bubble on the same centre line; the button is 4px
 * in from Chaty's wrapper. Both plugins write their offsets inline, hence !important. */

:root {
  --chat-edge: max(1.25rem, calc(var(--space-md) + var(--ruler-offset, 0px)));
}

.chatway--container .chatway--trigger-container {
  right: var(--chat-edge) !important;
  bottom: var(--chat-edge) !important;
}

.chatway--container .chatway--frame-container {
  bottom: calc(var(--chat-edge) + 60px + 10px) !important;
}

/* Up to 600px Chatway's window spans the screen; only wider ones sit by the bubble. */
@media (min-width: 601px) {
  .chatway--container .chatway--frame-container {
    right: var(--chat-edge) !important;
  }
}

.chaty .chaty-widget.right-position {
  right: calc(var(--chat-edge) - 4px) !important;
  bottom: calc(var(--chat-edge) + 60px + 16px) !important;
}

/* Section headings — shared by every page ---------------------------------- */

.section-head {
  display: grid;
  gap: var(--space-md);
  max-width: 52rem;
}

.section-title {
  min-width: 0;
  font-family: var(--font-display);
  font-size: var(--text-display);
  font-style: normal;
  font-weight: 400;
  line-height: var(--leading-tight);
  letter-spacing: 0.005em;
  text-transform: uppercase;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

/* The full stop in a heading is a brand-blue dot — a "titik". */
.title-dot {
  color: var(--color-blue);
}

.section-lede {
  max-width: 40ch;
  color: var(--color-muted);
  font-size: var(--text-md);
  line-height: 1.5;
}

.text-link {
  color: var(--color-blue-deep);
  font-weight: 700;
  white-space: nowrap;
  transition: text-decoration-color var(--dur-short) var(--ease-out);
}

@media (hover: hover) {
  .text-link:hover {
    text-decoration-thickness: 0.16em;
  }
}

/* Dot grid (home banner + morph, contact banner). The faint grey dots are this CSS background, so they
 * show everywhere — touch, reduced motion, no JS. On a mouse, site.js paints blue dots on
 * the canvas exactly over them where the cursor passes, and lets them fade back to grey. */
.dot-grid {
  --grid-step: 1.5rem; /* site.js reads the resolved background-size, so this is the only source */
  --grid-dot: var(--color-rule); /* resting dots */
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  color: var(--color-blue); /* the lit dots; site.js reads the computed colour */
  background-image: radial-gradient(circle, var(--grid-dot) 0 1.25px, transparent 1.75px);
  background-size: var(--grid-step) var(--grid-step);
  pointer-events: none;
}

/* Frame — a faint graph-paper grid behind a heading block ------------------
 * Square cells, aligned so the block's top-left corner sits on a grid crossing. The grid
 * fades in above the block, is clearest behind the text, and fades out again below (and
 * softly at the sides). Text keeps its place; decoration only.
 * Colour per surface: --frame-color (blue on paper, paper on blue / ink). */

.frame {
  --frame-color: color-mix(in oklch, var(--color-blue) 16%, transparent);
  --frame-cell: 3.5rem;
  /* How far the grid may run below the block. Every framed block is followed by a
   * --space-2xl gap, so this stops short of the next element (rules, logo wall, form). */
  --frame-below: calc(var(--space-2xl) - var(--space-sm));
  position: relative;
  isolation: isolate;
}

.frame::before {
  content: "";
  position: absolute;
  z-index: -1;
  /* Whole cells above and to the sides, so grid lines meet the block's top-left corner. */
  inset: calc(-2 * var(--frame-cell)) calc(-1 * var(--frame-cell)) calc(-1 * var(--frame-below));
  background-image:
    linear-gradient(to right, var(--frame-color) 1px, transparent 1px),
    linear-gradient(to bottom, var(--frame-color) 1px, transparent 1px);
  background-size: var(--frame-cell) var(--frame-cell);
  /* Faded above, clear behind the text, gone before the bottom edge; soft at the sides. */
  -webkit-mask-image:
    linear-gradient(to bottom, transparent, var(--color-ink) calc(1.5 * var(--frame-cell)), var(--color-ink) calc(100% - 1.5 * var(--frame-below)), transparent calc(100% - 0.25 * var(--frame-below))),
    linear-gradient(to right, transparent, var(--color-ink) var(--frame-cell), var(--color-ink) calc(100% - var(--frame-cell)), transparent);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(to bottom, transparent, var(--color-ink) calc(1.5 * var(--frame-cell)), var(--color-ink) calc(100% - 1.5 * var(--frame-below)), transparent calc(100% - 0.25 * var(--frame-below))),
    linear-gradient(to right, transparent, var(--color-ink) var(--frame-cell), var(--color-ink) calc(100% - var(--frame-cell)), transparent);
  mask-composite: intersect;
  pointer-events: none;
}

/* Buttons --------------------------------------------------------------- */

/* Hover / keyboard focus, two things at once:
 *  1. Fill — a dot appears where the pointer came in (site.js sets --fx / --fy) and grows
 *     slowly until it fills the button; on the way out it shrinks toward where the pointer
 *     left. Keyboard focus grows it from the left. The "titik" turning into the new colour.
 *  2. Roll — site.js splits the label into letters (.btn--roll); each letter slides up and
 *     out while its twin rises in from below in the fill colour, one after another.
 * Each variant sets the colour it fills with (--btn-fill) and its label on that fill
 * (--btn-fill-text). */
.btn {
  --btn-fill: var(--color-ink);
  --btn-fill-text: var(--color-paper);
  --btn-in: calc(var(--dur-reveal) * 1.1);  /* ~700ms: fill growing */
  --btn-out: var(--dur-long);                /* ~420ms: fill shrinking */
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  min-height: 2.75rem;
  padding: 0 var(--space-lg);
  border: 0;
  border-radius: var(--radius-pill);
  font-size: var(--text-base);
  font-weight: 650;
  line-height: 1;
  letter-spacing: -0.005em;
  text-decoration: none;
  white-space: nowrap;
  transition:
    color var(--btn-out) var(--ease-in-out),
    scale 140ms var(--ease-out);
}

.btn::before {
  content: "";
  position: absolute;
  inset-block-start: var(--fy, 50%);
  inset-inline-start: var(--fx, var(--space-md));
  z-index: -1;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background-color: var(--btn-fill);
  translate: -50% -50%;
  scale: 0;
  pointer-events: none;
  transition: scale var(--btn-out) var(--ease-in-out);
}

.btn:active {
  scale: 0.96;
}

.btn:focus-visible::before {
  scale: 80; /* 0.5rem × 80 covers even the widest button from any point inside it */
  transition: scale var(--btn-in) var(--ease-out);
}

/* Plain buttons (not split into letters) just change colour with the fill. */
.btn:not(.btn--roll):focus-visible {
  color: var(--btn-fill-text);
  transition: color var(--btn-in) var(--ease-out), scale 140ms var(--ease-out);
}

@media (hover: hover) {
  .btn:hover::before {
    scale: 80;
    transition: scale var(--btn-in) var(--ease-out);
  }

  .btn:not(.btn--roll):hover {
    color: var(--btn-fill-text);
    transition: color var(--btn-in) var(--ease-out), scale 140ms var(--ease-out);
  }
}

/* Letter roll (markup added by site.js; the original label stays in an .sr-only span). */
.btn__roll {
  display: inline-grid;
  overflow: clip;
  padding-block: 0.22em; /* room for descenders inside the clip */
  margin-block: -0.22em;
}

.btn__line {
  grid-area: 1 / 1;
  display: block;
}

.btn__line--next {
  color: var(--btn-fill-text);
}

.btn__char {
  display: inline-block;
  white-space: pre;
  transition: translate calc(var(--btn-in) * 0.75) var(--ease-out);
  transition-delay: calc(var(--i, 0) * 22ms);
}

.btn__line--next .btn__char {
  translate: 0 135%;
}

.btn--roll:focus-visible .btn__line--now .btn__char {
  translate: 0 -135%;
}

.btn--roll:focus-visible .btn__line--next .btn__char {
  translate: 0 0;
}

@media (hover: hover) {
  .btn--roll:hover .btn__line--now .btn__char {
    translate: 0 -135%;
  }

  .btn--roll:hover .btn__line--next .btn__char {
    translate: 0 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .btn__char {
    transition: none;
  }
}

.btn--primary {
  background-color: var(--color-blue);
  color: var(--color-paper);
}

.btn--light {
  --color-focus: var(--color-paper);
  background-color: var(--color-paper);
  color: var(--color-blue-deep);
}

/* Large: the footer's main actions. Grows past phone width so long labels still fit. */
.btn--lg {
  min-height: 3.25rem;
  padding-inline: var(--space-lg);
}

@media (min-width: 40rem) {
  .btn--lg {
    min-height: 3.75rem;
    padding-inline: var(--space-xl);
    font-size: var(--text-md);
  }
}

/* Outline button for secondary actions on light surfaces. */
.btn--ghost {
  background-color: transparent;
  box-shadow: inset 0 0 0 var(--rule-hair) var(--color-ink);
  color: var(--color-ink);
}

.btn[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn[data-state="loading"] {
  opacity: 0.8;
  cursor: progress;
}

/* No fill for a button that can't be used right now. */
.btn[aria-disabled="true"]::before,
.btn[data-state="loading"]::before {
  display: none;
}

/* Language switcher — a small segmented pill ----------------------------- */

.lang__list {
  display: flex;
  gap: var(--space-3xs);
  padding: var(--space-3xs);
  border: var(--rule-hair) solid var(--lang-rule, var(--color-rule));
  border-radius: var(--radius-pill);
}

.lang__link {
  display: grid;
  place-items: center;
  min-width: 2.5rem;
  min-height: 2.25rem;
  padding: 0 var(--space-xs);
  border-radius: var(--radius-pill);
  color: var(--lang-fg, var(--color-muted));
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background-color var(--dur-short) var(--ease-out),
    color var(--dur-short) var(--ease-out);
}

.lang__link[aria-current="true"] {
  background-color: var(--lang-active-bg, var(--color-ink));
  color: var(--lang-active-fg, var(--color-paper));
}

@media (hover: hover) {
  .lang__link:not([aria-current="true"]):hover {
    color: var(--lang-hover, var(--color-ink));
  }
}

.lang--on-dark {
  --lang-rule: var(--color-rule-dark);
  --lang-fg: var(--color-muted-dark);
  --lang-hover: var(--color-paper);
  --lang-active-bg: var(--color-paper);
  --lang-active-fg: var(--color-ink);
  --color-focus: var(--color-blue-soft);
}

.lang--on-blue {
  --lang-rule: var(--color-blue-tint);
  --lang-fg: var(--color-blue-tint);
  --lang-hover: var(--color-paper);
  --lang-active-bg: var(--color-paper);
  --lang-active-fg: var(--color-blue-deep);
  --color-focus: var(--color-paper);
}

/* Logo -------------------------------------------------------------------- */

.logo {
  fill: currentColor;
  overflow: visible;
}

.logo__dot {
  fill: var(--logo-dot, currentColor);
  transform-box: fill-box;
  transform-origin: 50% 100%;
}

.logo__mark {
  transform-box: fill-box;
  transform-origin: 49.85% 45.9%; /* the mark's centroid — it is 3-fold symmetric around this point */
  transition: transform var(--dur-reveal) var(--ease-out);
}

/* Reduced motion --------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 150ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 150ms !important;
    transition-delay: 0ms !important;
  }
}
