/* padauk.app: the app's Visa Page world (DESIGN.md), ported to plain CSS. Tokens and utilities
   follow web/src/index.css; stamps follow web/src/components/passport/Stamp.tsx. */

@font-face {
  font-family: 'Archivo Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  src: url(fonts/archivo-latin-ext-wdth-normal.woff2) format('woff2-variations');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Archivo Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  src: url(fonts/archivo-latin-wdth-normal.woff2) format('woff2-variations');
  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: 'Martian Mono Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 800;
  font-stretch: 75% 112.5%;
  src: url(fonts/martian-mono-latin-ext-wdth-normal.woff2) format('woff2-variations');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Martian Mono Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 800;
  font-stretch: 75% 112.5%;
  src: url(fonts/martian-mono-latin-wdth-normal.woff2) format('woff2-variations');
  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: 'Noto Sans Thai Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(fonts/noto-sans-thai-thai-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC;
}
@font-face {
  font-family: 'Noto Sans Myanmar';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url(fonts/noto-sans-myanmar-myanmar-400-normal.woff2) format('woff2');
  unicode-range: U+1000-109F, U+200C-200D, U+25CC, U+A92E, U+A9E0-A9FE, U+AA60-AA7F, U+116D0-116E3;
}
@font-face {
  font-family: 'Noto Sans Myanmar';
  font-style: normal;
  font-display: swap;
  font-weight: 600;
  src: url(fonts/noto-sans-myanmar-myanmar-600-normal.woff2) format('woff2');
  unicode-range: U+1000-109F, U+200C-200D, U+25CC, U+A92E, U+A9E0-A9FE, U+AA60-AA7F, U+116D0-116E3;
}
@font-face {
  font-family: 'Noto Sans Myanmar';
  font-style: normal;
  font-display: swap;
  font-weight: 700;
  src: url(fonts/noto-sans-myanmar-myanmar-700-normal.woff2) format('woff2');
  unicode-range: U+1000-109F, U+200C-200D, U+25CC, U+A92E, U+A9E0-A9FE, U+AA60-AA7F, U+116D0-116E3;
}

:root {
  --ink: #1b2030;
  --slate: #505a6c;
  --sheet: #fbfcfa;
  --field-white: #ffffff;
  --cover: #1a2440;
  --cover-ink: #d6dbe6;
  --foil: #d4b26a;
  --violet: #3f3294;
  --violet-deep: #31267a;
  --seal: #1d6b45;
  --ochre: #8f5a0c;
  --red: #b3261e;
  --void: #5f6672;

  --paper: #e9ecf1;
  --guilloche: #4d6a9c;
  --guilloche-ink: #36507c;

  --sans: 'Archivo Variable', 'Noto Sans Thai Variable', 'Noto Sans Myanmar', system-ui, sans-serif;
  --mono: 'Martian Mono Variable', 'Noto Sans Thai Variable', 'Noto Sans Myanmar', ui-monospace, monospace;
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);

  --gutter: 16px;
  --slip-shadow: 0 1px 2px rgb(15 20 35 / 0.08), 0 12px 28px -20px rgb(15 20 35 / 0.4);
  --float-shadow: 0 14px 36px -12px rgb(10 14 30 / 0.5);

  --grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='g'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' seed='11'/><feColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -3.4 2.9'/></filter><rect width='180' height='180' filter='url(%23g)'/></svg>");
  --cloth: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='c'><feTurbulence type='fractalNoise' baseFrequency='0.55 1.8' numOctaves='3' seed='4'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.09 -0.02'/></filter><rect width='220' height='220' filter='url(%23c)'/></svg>");
}

[data-country='TH'] {
  --paper: #e5eeea;
  --guilloche: #2e8b7d;
  --guilloche-ink: #1d6a5f;
}
[data-country='JP'] {
  --paper: #efe8ee;
  --guilloche: #a24f7c;
  --guilloche-ink: #8a3a66;
}

@media (min-width: 640px) {
  :root {
    --gutter: 40px;
  }
}

/* ---------- Base ---------- */

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

html {
  accent-color: var(--violet);
  caret-color: var(--violet);
  scrollbar-color: color-mix(in srgb, var(--slate) 40%, transparent) transparent;
  -webkit-tap-highlight-color: transparent;
  font-synthesis: none;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
}

:lang(my) {
  line-height: 1.8;
}
:lang(my) :is(h1, h2, h3) {
  line-height: 1.7;
}
:lang(my) .stamp-count {
  line-height: 1.4;
}

h1,
h2,
h3,
p,
dl,
dd,
figure {
  margin: 0;
}
h1,
h2,
h3 {
  font-weight: 700;
  line-height: 1.2;
  text-wrap: balance;
}

::selection {
  background: color-mix(in srgb, var(--violet) 22%, transparent);
  color: var(--ink);
}

:focus-visible {
  outline: 2px solid var(--violet);
  outline-offset: 2px;
}
.cover :focus-visible {
  outline-color: var(--foil);
}

a {
  color: inherit;
}
button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}
svg {
  display: block;
}

.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;
}

.type-wide {
  font-stretch: 118%;
  letter-spacing: -0.02em;
}
.type-cond {
  font-stretch: 72%;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.mono {
  font-family: var(--mono);
  font-stretch: 87.5%;
  font-variant-numeric: tabular-nums slashed-zero;
  font-weight: 700;
  white-space: nowrap;
}
.label {
  font-stretch: 72%;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--slate);
}

/* ---------- Materials ---------- */

.cover {
  background-color: var(--cover);
  background-image: var(--cloth);
  color: var(--cover-ink);
}

.security-field {
  position: relative;
  isolation: isolate;
}
.security-field::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-color: var(--guilloche);
  mask-image: var(--field);
  -webkit-mask-image: var(--field);
  mask-size: 180px 72px;
  -webkit-mask-size: 180px 72px;
  opacity: var(--field-strength, 0.12);
}

.microprint {
  display: block;
  height: 6px;
  overflow: hidden;
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 5px;
  line-height: 6px;
  letter-spacing: 0.14em;
  color: var(--guilloche-ink);
  opacity: 0.6;
  user-select: none;
}

.ink-grain {
  mask-image: var(--grain);
  -webkit-mask-image: var(--grain);
  mask-size: 180px 180px;
  -webkit-mask-size: 180px 180px;
}

.slip {
  background: var(--sheet);
  border: 1px solid rgb(27 32 48 / 0.12);
  border-radius: 3px;
  box-shadow: var(--slip-shadow);
}

.wrap {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- Controls ---------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 24px;
  border: 0;
  border-radius: 4px;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 150ms ease-out, transform 150ms ease-out;
}
.button:active {
  transform: translateY(1px);
}
.button-primary {
  background: var(--violet);
  color: var(--sheet);
}
.button-primary:hover {
  background: var(--violet-deep);
}
.button svg {
  width: 18px;
  height: 18px;
  stroke-width: 2;
}

.text-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-inline: 4px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: rgb(27 32 48 / 0.3);
  text-underline-offset: 4px;
  transition: text-decoration-color 150ms ease-out;
}
.text-link:hover {
  text-decoration-color: var(--ink);
}

/* ---------- The cover strip ---------- */

.masthead {
  position: sticky;
  top: 0;
  z-index: 30;
}
.masthead-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 60px;
  padding-block: 8px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--foil);
  text-decoration: none;
  border-radius: 4px;
}
.brand svg {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}
.brand-name {
  display: block;
  font-size: 17px;
  font-weight: 700;
  font-stretch: 118%;
  letter-spacing: 0.14em;
  line-height: 1.1;
  text-transform: uppercase;
}
/* Burmese keeps its natural spacing: tracking would pull its stacked clusters apart. */
.brand-native {
  display: block;
  font-size: 12px;
  line-height: 1.5;
  opacity: 0.85;
}
.masthead-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}
.cover-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: rgb(214 219 230 / 0.8);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 150ms ease-out, color 150ms ease-out;
}
.cover-item:hover,
.cover-item[aria-expanded='true'] {
  background: rgb(255 255 255 / 0.07);
  color: #fff;
}
.cover-item svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.75;
  flex-shrink: 0;
}
.cover-item .chevron {
  width: 14px;
  height: 14px;
  transition: transform 150ms ease-out;
}
.cover-item[aria-expanded='true'] .chevron {
  transform: rotate(180deg);
}

/* Language menu: a white slip that drops from the cover. */
.lang {
  position: relative;
}
.lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 40;
  min-width: 200px;
  margin: 0;
  padding: 4px;
  list-style: none;
  background: var(--sheet);
  border: 1px solid rgb(27 32 48 / 0.12);
  border-radius: 4px;
  box-shadow: var(--float-shadow);
  animation: menu-down 0.22s var(--ease-out-expo) both;
  transform-origin: top right;
}
.lang-menu[hidden] {
  display: none;
}
.lang-menu button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  text-align: left;
}
.lang-menu button:hover {
  background: rgb(27 32 48 / 0.06);
}
.lang-menu svg {
  width: 16px;
  height: 16px;
  color: var(--violet);
  stroke-width: 2.25;
  visibility: hidden;
}
.lang-menu [aria-current='true'] {
  font-weight: 600;
}
.lang-menu [aria-current='true'] svg {
  visibility: visible;
}
@keyframes menu-down {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.96);
  }
}

/* ---------- The first page ---------- */

.opening {
  padding-block: 40px 64px;
}
.opening-grid {
  display: grid;
  gap: 44px;
  align-items: center;
}
.opening h1 {
  font-size: clamp(2.125rem, 1.3rem + 2.7vw, 3.375rem);
  line-height: 1.05;
  font-stretch: 118%;
  letter-spacing: -0.025em;
}
:lang(th) .opening h1,
:lang(ja) .opening h1,
:lang(ko) .opening h1,
:lang(zh-Hans) .opening h1,
:lang(zh-Hant) .opening h1 {
  line-height: 1.25;
  max-width: 16em;
}
.opening .lede {
  margin-top: 20px;
  max-width: 52ch;
  font-size: 18px;
  color: var(--slate);
}
.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  margin-top: 32px;
}
.time-note {
  margin-top: 14px;
  font-size: 14px;
  color: var(--slate);
}

/* The specimen: a sample page of the app, overprinted as a sample. */
.specimen {
  min-width: 0;
}
.specimen-sheet {
  --field-strength: 0.22;
  position: relative;
  overflow: hidden;
  padding: 36px 20px 76px;
}
.specimen-sheet .specimen-mark {
  top: auto;
  bottom: 14px;
  translate: -50% 0;
  rotate: -3deg;
  font-size: 40px;
}
.specimen-mark {
  position: absolute;
  left: 50%;
  top: 50%;
  translate: -50% -50%;
  rotate: -14deg;
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
  font-size: 52px;
  font-weight: 700;
  font-stretch: 72%;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgb(95 102 114 / 0.13);
}
.specimen-stamps {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 24px 28px;
}
.specimen-arrow {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  color: rgb(80 90 108 / 0.6);
  stroke-width: 1.5;
}
.deadline-slot {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: center;
  gap: 20px 24px;
  min-width: 236px;
  min-height: 188px;
}
.specimen figcaption {
  margin-top: 14px;
  max-width: 56ch;
  font-size: 14px;
  color: var(--slate);
}
.specimen figcaption .mono {
  font-weight: 700;
  color: var(--ink);
}

/* ---------- Stamps (web/src/components/passport/Stamp.tsx) ---------- */

.stamp-ink-violet {
  color: var(--violet);
}
.stamp-ink-seal {
  color: var(--seal);
}
.stamp-ink-ochre {
  color: var(--ochre);
}
.stamp-ink-red {
  color: var(--red);
}
.stamp-ink-void {
  color: var(--void);
}

.crossing {
  display: flex;
  flex-shrink: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 164px;
  min-height: 108px;
  padding: 12px 16px;
  text-align: center;
  transform: rotate(var(--tilt, 0deg));
  border: 2px solid currentColor;
  outline: 1px solid currentColor;
  outline-offset: -6px;
}
.crossing-entry {
  color: var(--violet);
  border-radius: 12px;
}
.crossing-exit {
  color: rgb(27 32 48 / 0.85);
  border-radius: 3px;
}
.crossing-open {
  color: var(--slate);
  border: 2px dashed rgb(80 90 108 / 0.55);
  border-radius: 12px;
  outline: 0;
}
.crossing-place {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 4px;
  max-width: 100%;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.25;
}
.crossing-place svg {
  width: 12px;
  height: 12px;
  margin-top: 1px;
  flex-shrink: 0;
  stroke-width: 2.25;
}
.crossing-date {
  font-size: 15px;
  line-height: 1;
}
.crossing-caption {
  font-size: 10px;
  font-weight: 600;
  line-height: 1.25;
}

.day-stamp {
  position: relative;
  flex-shrink: 0;
  padding: 16px 20px 0 0;
}
.day-stamp-frame {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-width: 216px;
  padding: 28px 28px 24px;
  text-align: center;
  transform: rotate(var(--tilt, 0deg));
  border: 2.5px solid currentColor;
  border-radius: 4px;
  outline: 1px solid currentColor;
  outline-offset: -7px;
}
.stamp-count {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.1em;
  font-family: var(--mono);
  font-stretch: 87.5%;
  font-variant-numeric: tabular-nums slashed-zero;
  font-weight: 700;
  font-size: 72px;
  line-height: 0.9;
  letter-spacing: -0.025em;
}
.stamp-count-long {
  font-size: 60px;
}
.stamp-count .unit {
  font-size: 0.4em;
  letter-spacing: normal;
}
.day-stamp-name {
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.25;
  font-stretch: 72%;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.day-stamp-sm {
  padding: 12px 12px 0 0;
}
.day-stamp-sm .day-stamp-frame {
  min-width: 132px;
  gap: 8px;
  padding: 18px 16px 14px;
}
.day-stamp-sm .stamp-count {
  font-size: 34px;
}
.day-stamp-sm .day-stamp-due {
  font-size: 11px;
}
.day-stamp-due {
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
}
.day-stamp-status {
  position: absolute;
  right: 0;
  top: 0;
  transform: rotate(var(--tilt, 7deg));
}

.ink-stamp {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  font-weight: 700;
  line-height: 1;
  font-stretch: 72%;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 5px 8px;
  font-size: 11px;
}
.ink-stamp-lg {
  padding: 8px 12px;
  font-size: 13px;
}
.ink-stamp svg {
  width: 8px;
  height: 8px;
  flex-shrink: 0;
}
.ink-stamp-frame,
.ink-stamp-double {
  border: 1.5px solid currentColor;
  border-radius: 3px;
  background: var(--sheet);
}
.ink-stamp-double {
  outline: 1px solid currentColor;
  outline-offset: 2px;
}
.ink-stamp-block {
  border: 1.5px solid transparent;
  background: var(--red);
  color: var(--sheet);
  clip-path: polygon(3px 0, calc(100% - 3px) 0, 100% 3px, 100% calc(100% - 3px), calc(100% - 3px) 100%, 3px 100%, 0 calc(100% - 3px), 0 3px);
}
.ink-stamp-lg.ink-stamp-block {
  clip-path: polygon(5px 0, calc(100% - 5px) 0, 100% 5px, 100% calc(100% - 5px), calc(100% - 5px) 100%, 5px 100%, 0 calc(100% - 5px), 0 5px);
}
.coming-soon {
  --tilt: -2deg;
  transform: rotate(var(--tilt));
}
/* Waits, unpressed, until its chapter scrolls into view (site.js armScrollStamps). */
.awaiting-press {
  opacity: 0;
}

/* The stamp press: drops from above, bites in wet ink, settles. Once, on load. */
@keyframes stamp-press {
  0% {
    opacity: 0;
    transform: translateY(-10px) scale(1.7) rotate(calc(var(--tilt, 0deg) - 7deg));
    filter: blur(2px);
  }
  50% {
    opacity: 1;
    transform: scale(0.94) rotate(var(--tilt, 0deg));
    filter: blur(0.5px) saturate(1.5) brightness(0.8);
  }
  75% {
    transform: scale(1.02) rotate(var(--tilt, 0deg));
  }
  100% {
    transform: scale(1) rotate(var(--tilt, 0deg));
    filter: none;
  }
}
.stamp-press {
  animation: stamp-press 0.6s cubic-bezier(0.3, 0.7, 0.2, 1) both;
}
.stamp-press-late {
  animation-delay: 180ms;
}

/* ---------- Sections ---------- */

.chapter {
  position: relative;
  padding-block: 56px 64px;
}
.chapter > .microprint {
  position: absolute;
  inset-inline: var(--gutter);
  top: 0;
}
.chapter-head {
  max-width: 62ch;
}
.chapter-head h2 {
  font-size: clamp(1.625rem, 1.2rem + 1.6vw, 2.375rem);
  line-height: 1.1;
  font-stretch: 118%;
  letter-spacing: -0.02em;
}
.chapter-head p {
  margin-top: 12px;
  font-size: 17px;
  color: var(--slate);
}

/* Printed records: no boxes, a microprint rule above each. */
.entries {
  margin-top: 36px;
}
.entry {
  position: relative;
  padding-block: 32px 28px;
}
.entry > .microprint {
  position: absolute;
  inset-inline: 0;
  top: 0;
}
.entry h3 {
  font-size: 20px;
  font-stretch: 118%;
  letter-spacing: -0.02em;
}
.entry p {
  margin-top: 8px;
  max-width: 62ch;
  font-size: 15px;
  color: var(--slate);
}
.entry p .mono {
  color: var(--ink);
}

/* A rule drawn to scale: days along a ruled line, the way the engine counts them. */
.ruler {
  --span: 100;
  position: relative;
  height: 64px;
  margin-top: 22px;
  max-width: 720px;
}
.ruler-line {
  position: absolute;
  inset-inline: 0;
  top: 30px;
  height: 1.5px;
  background: rgb(27 32 48 / 0.55);
}
.ruler-band {
  position: absolute;
  top: 22px;
  height: 18px;
  left: calc(var(--from) / var(--span) * 100%);
  width: calc((var(--to) - var(--from)) / var(--span) * 100%);
  border-radius: 2px;
}
.ruler-band-online {
  background: color-mix(in srgb, var(--seal) 18%, transparent);
  border: 1.5px solid color-mix(in srgb, var(--seal) 70%, transparent);
}
.ruler-band-person {
  background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--ink) 16%, transparent) 0 2px, transparent 2px 6px);
  border: 1.5px solid rgb(27 32 48 / 0.45);
}
.ruler-tick {
  position: absolute;
  top: 0;
  left: calc(var(--at) / var(--span) * 100%);
  translate: -50% 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.ruler-tick::after {
  content: '';
  width: 1.5px;
  height: 20px;
  background: currentColor;
  order: 2;
}
.ruler-tick .mono {
  order: 1;
  font-size: 12px;
  line-height: 1;
}
.ruler-tick-due {
  color: var(--ochre);
}
.ruler-tick-entry {
  color: var(--violet);
}
.ruler-key {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-top: 6px;
  font-size: 13px;
  color: var(--slate);
}
.ruler-key span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.ruler-key i {
  display: inline-block;
  width: 18px;
  height: 10px;
  border-radius: 2px;
}

.status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 20px 32px;
  margin-top: 22px;
}
.status-row figure {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}
.status-row figcaption {
  font-size: 13px;
  color: var(--slate);
}

.where {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-top: 28px;
  font-size: 15px;
  color: var(--slate);
}
.where .mono {
  color: var(--guilloche-ink);
  font-size: 15px;
}

/* The stay: a visa page of Thai security paper, with its sticker and crossing stamps. */
.spread {
  --field-strength: 0.2;
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 32px;
  margin-top: 36px;
  padding: 28px 20px 36px;
  background: var(--paper);
  border: 1px solid rgb(27 32 48 / 0.12);
  border-radius: 3px;
  box-shadow: var(--slip-shadow);
}
.spread .specimen-mark {
  font-size: 56px;
}
.sticker-wrap {
  position: relative;
  min-width: 0;
  max-width: 460px;
  padding: 16px 12px 0 0;
}
.sticker {
  --field-strength: 0.2;
  position: relative;
  overflow: hidden;
  background: var(--sheet);
  border: 1px solid color-mix(in srgb, var(--guilloche) 45%, transparent);
  border-radius: 6px;
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.7), 0 1px 2px rgb(15 20 35 / 0.1), 0 14px 30px -22px rgb(15 20 35 / 0.45);
}
.sticker-body {
  display: flex;
  gap: 20px;
  padding: 20px;
}
.rosette-box {
  position: relative;
  display: grid;
  place-items: center;
  width: 84px;
  height: 84px;
  flex-shrink: 0;
}
.rosette {
  position: absolute;
  inset: 0;
  color: var(--guilloche);
}
.rosette svg {
  width: 100%;
  height: 100%;
}
.rosette-code {
  position: relative;
  padding: 0 4px;
  border-radius: 2px;
  background: rgb(251 252 250 / 0.9);
  font-size: 12px;
}
.sticker-title {
  padding-right: 48px;
  font-size: 18px;
  line-height: 1.3;
  font-stretch: 118%;
  letter-spacing: -0.02em;
}
.sticker-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 32px;
  margin-top: 16px;
}
.sticker-fields dt {
  font-stretch: 72%;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--slate);
}
.sticker-fields dd {
  margin-top: 4px;
  font-size: 15px;
}
.sticker-mrz {
  padding: 12px 20px;
  border-top: 1px solid color-mix(in srgb, var(--guilloche) 30%, transparent);
  background: rgb(251 252 250 / 0.85);
  color: var(--slate);
}
.sticker-mrz svg {
  width: 100%;
  height: auto;
  font-family: var(--mono);
  font-stretch: 87.5%;
  font-weight: 500;
  font-size: 12.5px;
}
/* The grant, pressed onto the sticker's corner. */
.seal {
  position: absolute;
  right: 0;
  top: 0;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 78px;
  height: 78px;
  padding: 10px;
  border: 2px solid currentColor;
  border-radius: 50%;
  outline: 1px solid currentColor;
  outline-offset: -6px;
  background: rgb(251 252 250 / 0.6);
  transform: rotate(var(--tilt, 0deg));
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  font-stretch: 72%;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}
.seal svg {
  width: 8px;
  height: 8px;
  flex-shrink: 0;
}
.crossings {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 16px;
}
.crossings .crossing {
  width: 148px;
  min-height: 96px;
}

/* The data page: a passport's printed page, laid on the paper. The photo box stays empty. */
.data-page {
  --field-strength: 0.16;
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 20px 24px;
  max-width: 600px;
  margin-top: 36px;
  padding: 24px;
}
.data-page-head {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-size: 12px;
  font-weight: 700;
  color: var(--slate);
}
.photo-box {
  display: grid;
  place-items: center;
  width: 112px;
  height: 144px;
  padding: 10px;
  border: 1.5px dashed rgb(27 32 48 / 0.3);
  border-radius: 2px;
  font-size: 11.5px;
  line-height: 1.35;
  text-align: center;
  color: var(--slate);
}
:lang(my) .photo-box {
  font-size: 13px;
  line-height: 1.55;
}
.data-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 20px;
  align-content: start;
}
.data-fields dt {
  font-stretch: 72%;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--slate);
}
.data-fields dd {
  margin-top: 4px;
  font-size: 15px;
  font-weight: 600;
}
.data-fields dd.mono {
  font-size: 15px;
}
.data-page .specimen-mark {
  font-size: 44px;
}

/* In your language: each language names itself, as a passport prints its title in several. */
.languages {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin-top: 32px;
  padding: 0;
  list-style: none;
}
.languages button {
  min-height: 48px;
  padding: 4px 14px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--slate);
  font-size: clamp(1.25rem, 1rem + 1vw, 1.75rem);
  font-weight: 700;
  font-stretch: 118%;
  letter-spacing: -0.01em;
  transition: color 150ms ease-out, background-color 150ms ease-out;
}
.languages button:hover {
  color: var(--ink);
  background: rgb(27 32 48 / 0.05);
}
.languages [aria-pressed='true'] {
  color: var(--ink);
  border-color: rgb(27 32 48 / 0.25);
  background: var(--sheet);
}

/* Ready now and coming next, as ledger lines. */
.ledger-line {
  display: grid;
  gap: 8px 32px;
}
.ledger-line h3 {
  font-size: 18px;
}
.ledger-line p {
  margin-top: 0;
}
.ledger-line .ink-stamp {
  justify-self: start;
}

/* ---------- The back cover ---------- */

.back-cover {
  padding-block: 64px 40px;
}
.back-cover-inner {
  display: grid;
  gap: 36px;
  align-items: center;
}
.back-cover .crest {
  width: 96px;
  height: 96px;
  color: var(--foil);
}
.close-slip {
  max-width: 560px;
  padding: 24px;
  color: var(--ink);
}
.close-slip h2 {
  font-size: clamp(1.5rem, 1.2rem + 1.1vw, 2rem);
  line-height: 1.15;
  font-stretch: 118%;
  letter-spacing: -0.02em;
}
.close-slip .actions {
  margin-top: 20px;
}
.not-government {
  margin-top: 40px;
  font-size: 13px;
  color: rgb(214 219 230 / 0.7);
}

/* ---------- Wider screens ---------- */

@media (min-width: 640px) {
  .masthead-inner {
    min-height: 68px;
  }
  .opening {
    padding-block: 64px 88px;
  }
  .specimen-sheet {
    padding: 44px 36px 92px;
  }
  .specimen-mark {
    font-size: 76px;
  }
  .specimen-sheet .specimen-mark {
    font-size: 52px;
  }
  .stamp-count {
    font-size: 92px;
  }
  .stamp-count.stamp-count-long {
    font-size: 70px;
  }
  .day-stamp-frame {
    min-width: 252px;
  }
  .deadline-slot {
    min-width: 272px;
    min-height: 212px;
  }
  .chapter {
    padding-block: 72px 80px;
  }
  .ledger-line {
    grid-template-columns: minmax(0, 15rem) minmax(0, 1fr) auto;
    align-items: baseline;
  }
  .close-slip {
    padding: 32px;
  }
  .spread {
    padding: 36px 32px 44px;
  }
  .crossings .crossing {
    width: 156px;
    min-height: 104px;
  }
}

@media (min-width: 1024px) {
  .opening-grid {
    grid-template-columns: minmax(0, 6fr) minmax(0, 6fr);
    gap: 64px;
    align-items: start;
  }
  /* The promise lines up with the try-it's first question, not the middle of the tall sheet. */
  .opening-grid > :first-child {
    padding-top: 52px;
  }
  /* Each chapter reads like a passport page: its heading on the left, its records on the right. */
  .chapter {
    display: grid;
    grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
    column-gap: 64px;
    align-items: start;
  }
  .chapter > * {
    grid-column: 2;
  }
  /* The rule above a chapter spans the page, not just its records' column. */
  .chapter > .microprint {
    grid-column: 1 / -1;
    inset-inline: 0;
  }
  .chapter > .chapter-head {
    grid-column: 1;
    grid-row: 1 / span 4;
    position: sticky;
    top: 108px;
  }
  .chapter > .entries,
  .chapter > .data-page,
  .chapter > .languages {
    margin-top: 0;
  }
  .entries > .entry:first-child {
    padding-top: 6px;
  }
  .entries > .entry:first-child > .microprint {
    display: none;
  }
  .ledger-line {
    grid-template-columns: minmax(0, 11rem) minmax(0, 1fr) auto;
  }
  .chapter > .spread {
    margin-top: 0;
  }
  .chapter > .spread .crossing {
    width: 140px;
  }
  .back-cover-inner {
    grid-template-columns: auto 1fr;
    gap: 48px;
  }
}


@media (max-width: 639px) {
  .sticker-wrap {
    padding: 0 0 28px;
  }
  .sticker-title {
    padding-right: 0;
  }
  .seal {
    top: auto;
    bottom: 0;
    right: 8px;
  }
  .brand-native {
    font-size: 11px;
    line-height: 1.4;
  }
  .cover-item .lang-label {
    display: none;
  }
  .specimen-arrow {
    display: none;
  }
  .data-page {
    grid-template-columns: 1fr;
  }
  .photo-box {
    width: 96px;
    height: 124px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .stamp-press,
  .lang-menu {
    animation: fade-in 0.15s linear both;
  }
  .button,
  .cover-item,
  .text-link {
    transition: none;
  }
}
@keyframes fade-in {
  from {
    opacity: 0;
  }
}


/* ---------- Try it ---------- */

.try {
  margin-bottom: 16px;
}
.try-hint {
  font-size: 15px;
  font-weight: 600;
}
.try-fields {
  display: grid;
  align-items: end;
  gap: 12px 16px;
  margin-top: 10px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.field-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--slate);
}
.control {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid rgb(27 32 48 / 0.25);
  border-bottom: 2px solid rgb(27 32 48 / 0.55);
  border-radius: 0;
  background: var(--field-white);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  transition: border-color 150ms ease-out;
}
.control.mono {
  font-family: var(--mono);
  font-weight: 700;
}
.control:hover {
  border-color: rgb(27 32 48 / 0.45);
  border-bottom-color: rgb(27 32 48 / 0.7);
}
.control:focus {
  border-color: var(--violet);
}
select.control {
  appearance: none;
  padding-right: 36px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23505a6c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='m6 9 6 6 6-6'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
}
.try-error {
  margin-top: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--red);
}

/* ---------- How it works ---------- */

.steps {
  display: grid;
  gap: 28px;
  margin: 36px 0 0;
  padding: 0;
  list-style: none;
}
.step-count {
  display: block;
  font-size: 56px;
  line-height: 0.9;
  letter-spacing: -0.03em;
  color: var(--ink);
}
.step-count span {
  font-size: 0.4em;
  letter-spacing: normal;
  color: var(--slate);
}
.step h3 {
  margin-top: 16px;
  font-size: 19px;
  font-stretch: 118%;
  letter-spacing: -0.02em;
}
.step p {
  margin-top: 8px;
  font-size: 15px;
  color: var(--slate);
}

/* ---------- The official forms ---------- */

.forms {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  margin: 36px 0 0;
  padding: 0;
  list-style: none;
}
.form-thumb {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 16px 20px;
  background: var(--sheet);
  border: 1px solid rgb(27 32 48 / 0.12);
  border-radius: 2px;
  box-shadow: 0 6px 14px -8px rgb(15 20 35 / 0.35);
}
.form-code {
  font-size: clamp(19px, 1rem + 0.6vw, 24px);
  line-height: 1;
}
.form-name {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--slate);
}
.form-fields {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1.5px solid rgb(27 32 48 / 0.55);
}
.form-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.form-field-label {
  font-size: 11px;
  font-weight: 600;
  line-height: 1.25;
  font-stretch: 72%;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--slate);
}
.form-box {
  height: 22px;
  background: var(--field-white);
  border: 1px solid rgb(27 32 48 / 0.25);
  border-bottom: 2px solid rgb(27 32 48 / 0.45);
}
/* Where the applicant signs. */
.form-sign {
  height: 34px;
  margin-top: 8px;
  border-bottom: 1px solid rgb(27 32 48 / 0.45);
}
.form-thumb .coming-soon {
  --tilt: -8deg;
  position: absolute;
  right: 14px;
  bottom: 18px;
}

/* ---------- Questions ---------- */

.faq {
  margin-top: 28px;
}
.faq-item {
  border-top: 1px solid rgb(27 32 48 / 0.12);
}
.faq-item:last-child {
  border-bottom: 1px solid rgb(27 32 48 / 0.12);
}
.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 60px;
  padding-block: 14px;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.faq-item summary::-webkit-details-marker {
  display: none;
}
.faq-item summary svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--slate);
  transition: transform 150ms ease-out;
}
.faq-item[open] summary svg {
  transform: rotate(180deg);
}
.faq-item summary:hover span {
  text-decoration: underline;
  text-decoration-color: rgb(27 32 48 / 0.3);
  text-underline-offset: 4px;
}
.faq-item p {
  max-width: 62ch;
  padding-bottom: 20px;
  font-size: 15px;
  color: var(--slate);
}

@media (min-width: 640px) {
  .forms {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .try-fields {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  }
  .steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 32px;
  }
}
@media (min-width: 1024px) {
  .chapter > .steps,
  .chapter > .forms,
  .chapter > .faq {
    margin-top: 0;
  }
}

/* Tall Script Rule, last so no heading's own leading outranks it: Burmese stacks vowel signs
   and medials about 1.5em tall, so its headings need 1.7 to clear the line above. */
html:lang(my) :is(h1, h2, h3) {
  line-height: 1.7;
}
