/* Phoenixtur: security-printed document world */

:root {
  --paper: #edf1ef;
  --paper-deep: #e1e7e4;
  --sheet: #f6f8f7;
  --field: #fcfdfc;
  --ink: #1d171a;
  --ink-2: #463d42;
  --ink-3: #635a5f;
  --placeholder: #6e6569;
  --rule: #b6bfbb;
  --rule-soft: #cdd4d1;
  --garnet: #7a1e22;
  --ember: #c23b0b;
  --ember-deep: #9e2f07;
  --ember-wash: #f6dccb;
  --ok: #1f5a3c;
  --error: #a3221b;

  --g-schengen: #2c4a7a;
  --g-uk-ie: #7a1e22;
  --g-na: #1f5a55;
  --g-other: #6a5524;

  --font-sans: "Archivo", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: light;
}

/* ---------- Base and browser surfaces ---------- */

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 5.5rem;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  font-stretch: 100%;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  scrollbar-color: var(--ink-3) var(--paper-deep);
}

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

input,
textarea,
select {
  caret-color: var(--ember);
}

a {
  text-underline-offset: 0.22em;
  text-decoration-thickness: 1px;
}

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

/* Honeypot field: off-screen for people, still in the form for bots */
.hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Long country names, titles and single long words wrap instead of overflowing */
.t-display,
.t-heading,
.t-title,
.photo-plate-name {
  overflow-wrap: break-word;
  hyphens: auto;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  background: var(--ink);
  color: var(--paper);
  padding: 0.75rem 1rem;
  font-weight: 600;
}

.skip-link:focus {
  top: 1rem;
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

/* ---------- Type ---------- */

.t-display {
  font-stretch: 118%;
  font-weight: 720;
  letter-spacing: -0.025em;
  line-height: 1.02;
  text-wrap: balance;
}

.t-heading {
  font-stretch: 112%;
  font-weight: 680;
  letter-spacing: -0.02em;
  line-height: 1.1;
  font-size: clamp(1.75rem, 1.15rem + 2.1vw, 2.75rem);
  text-wrap: balance;
}

.t-title {
  font-stretch: 108%;
  font-weight: 650;
  letter-spacing: -0.01em;
  line-height: 1.2;
  font-size: 1.25rem;
}

.t-lead {
  font-size: clamp(1.05rem, 0.98rem + 0.35vw, 1.25rem);
  line-height: 1.6;
  color: var(--ink-2);
  max-width: 58ch;
}

.t-body {
  color: var(--ink-2);
  max-width: 66ch;
}

.t-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.t-small {
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--ink-3);
}

/* ---------- Header ---------- */

.record-strip {
  border-bottom: 1px solid var(--rule-soft);
  font-size: 0.8125rem;
  color: var(--ink-2);
}

.record-strip a {
  text-decoration: none;
}

.record-strip a:hover {
  color: var(--ink);
  text-decoration: underline;
}

.nav-bar {
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}

.wordmark {
  font-stretch: 118%;
  font-weight: 760;
  letter-spacing: -0.02em;
  font-size: 1.3rem;
  line-height: 1;
}

.nav-link {
  font-size: 0.9375rem;
  font-weight: 560;
  color: var(--ink-2);
  text-decoration: none;
  padding-block: 0.5rem;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

.nav-link:hover {
  color: var(--ink);
  border-bottom-color: var(--rule);
}

.nav-link[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

.menu-panel a {
  display: flex;
  align-items: center;
  min-height: 3rem;
  border-bottom: 1px solid var(--rule-soft);
  font-weight: 600;
  text-decoration: none;
}

.microtext {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  font-size: 0.4375rem;
  line-height: 1;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--garnet);
  padding-block: 2px;
  user-select: none;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 3rem;
  padding: 0 1.25rem;
  border: 1.5px solid transparent;
  border-radius: 2px;
  font-weight: 650;
  font-size: 0.975rem;
  line-height: 1.1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}

.btn-hot {
  background: var(--ember);
  border-color: var(--ember);
  color: #fff;
}

.btn-hot:hover {
  background: var(--ember-deep);
  border-color: var(--ember-deep);
}

.btn-ink {
  background: transparent;
  border-color: var(--ink);
  color: var(--ink);
}

.btn-ink:hover {
  background: var(--ink);
  color: var(--paper);
}

.btn-solid {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.btn-solid:hover {
  background: var(--ink-2);
  border-color: var(--ink-2);
}

.bg-field {
  background: var(--field);
}

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

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--rule);
}

.link-arrow:hover {
  text-decoration-color: var(--ink);
}

/* ---------- The sheet (issued document surface) ---------- */

.sheet {
  position: relative;
  background-color: var(--sheet);
  background-image: url("../img/print/underprint.svg");
  background-size: 240px 48px;
  border: 1px solid var(--ink);
  /* Paper lying on the desk: a tight contact shadow, no soft glow */
  box-shadow:
    inset 0 0 0 5px var(--sheet),
    inset 0 0 0 6px var(--rule),
    0 1px 1px rgba(29, 23, 26, 0.08),
    0 3px 6px -3px rgba(29, 23, 26, 0.22);
}

.sheet-plain {
  background-image: none;
}

.doc-head {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1.25rem 0.75rem;
  border-bottom: 1px solid var(--rule);
}

.guilloche-band {
  flex: 1;
  height: 22px;
  background: url("../img/print/band.svg") repeat-x center / 200px 22px;
}

.guilloche-rule {
  height: 22px;
  background: url("../img/print/band.svg") repeat-x center / 200px 22px;
}

/* ---------- Form fields ---------- */

.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.field-input {
  width: 100%;
  min-height: 3rem;
  padding: 0.65rem 0.85rem;
  background: var(--field);
  border: 1px solid var(--rule);
  border-bottom: 2px solid var(--ink);
  border-radius: 0;
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
  appearance: none;
}

.field-input::placeholder {
  color: var(--placeholder);
}

.field-input:hover {
  border-color: var(--ink-3);
  border-bottom-color: var(--ink);
}

.field-input:focus {
  outline: none;
  border-color: var(--ember);
  box-shadow: 0 2px 0 0 var(--ember);
}

select.field-input {
  padding-right: 2.5rem;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--ink) 50%),
    linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position:
    calc(100% - 1.15rem) 52%,
    calc(100% - 0.8rem) 52%;
  background-size: 0.35rem 0.35rem;
  background-repeat: no-repeat;
}

textarea.field-input {
  min-height: 8rem;
  resize: vertical;
}

.field-input[aria-invalid="true"] {
  border-bottom-color: var(--error);
}

.field-error {
  font-size: 0.875rem;
  color: var(--error);
  font-weight: 550;
}

.field-hint {
  font-size: 0.8125rem;
  color: var(--ink-3);
}

/* ---------- Photo field (35:45, like a passport photo) ---------- */

.photo-field {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.photo-frame {
  position: relative;
  aspect-ratio: 35 / 45;
  border: 1px solid var(--ink);
  padding: 5px;
  background: var(--sheet);
  overflow: hidden;
}

.photo-field--wide .photo-frame {
  aspect-ratio: 16 / 10;
}

.photo-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

[data-photo-img],
[data-value] {
  transition: opacity 0.3s var(--ease-out);
}

.is-swapping {
  opacity: 0;
}

.photo-caption {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.photo-plate {
  position: absolute;
  inset: 5px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0.35rem;
  padding: 0.9rem;
  background-color: var(--paper-deep);
  background-image: url("../img/print/underprint.svg");
  background-size: 180px 36px;
}

.photo-plate-name {
  font-stretch: 118%;
  font-weight: 720;
  font-size: clamp(1.1rem, 0.9rem + 1vw, 1.6rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

/* Ghost image: the line-screened duplicate printed beside the photo */
.ghost {
  position: relative;
  aspect-ratio: 35 / 45;
  overflow: hidden;
}

.ghost img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.7) brightness(1.08);
  mix-blend-mode: multiply;
  opacity: 0.55;
}

/* Line screen: the ghost prints as fine horizontal lines, like a passport's second portrait */
.ghost::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg, var(--sheet) 0 1.5px, transparent 1.5px 3px);
}

/* ---------- Seal: guilloche rosette holding the phoenix ---------- */

.seal {
  position: relative;
  aspect-ratio: 1;
}

.seal .rosette {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* The seal's face carries live data: the destination's local time */
.seal-face {
  position: absolute;
  inset: 22%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.1rem;
  border-radius: 50%;
  background: var(--sheet);
  box-shadow: 0 0 0 1px var(--garnet), 0 0 0 4px var(--sheet), 0 0 0 5px var(--rule);
  text-align: center;
  container-type: inline-size;
}

.seal-label {
  font-size: clamp(0.5rem, 9cqi, 0.6875rem);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.seal-time {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  font-size: clamp(1.1rem, 26cqi, 2.4rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
  color: var(--ink);
  transition: opacity 0.3s var(--ease-out);
}

.seal-city {
  max-width: 90%;
  font-size: clamp(0.6rem, 10cqi, 0.8125rem);
  font-weight: 600;
  color: var(--garnet);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: opacity 0.3s var(--ease-out);
}

/* Small seals (phones): the short label keeps the clock named */
.seal-label-short {
  display: none;
}

@container (max-width: 96px) {
  .seal-label-long {
    display: none;
  }

  .seal-label-short {
    display: inline;
  }
}

.seal-year {
  font-stretch: 118%;
  font-weight: 720;
  font-size: clamp(1.6rem, 30cqi, 3.2rem);
  line-height: 1;
  letter-spacing: -0.03em;
}

.rosette use,
.rosette .rosette-rim {
  fill: none;
  vector-effect: non-scaling-stroke;
  stroke-width: 0.6;
}

.rosette-outer use {
  stroke: #8fa2b8;
}

.rosette-inner use {
  stroke: #6f958f;
}

.rosette-core use {
  stroke: #9a3a33;
}

.rosette .rosette-rim {
  stroke: var(--garnet);
  stroke-width: 0.8;
}

@media (prefers-reduced-motion: no-preference) {
  .rosette use {
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    animation: guilloche-draw 1.9s var(--ease-out) forwards;
    animation-delay: calc(var(--i, 0) * 70ms);
  }
}

@keyframes guilloche-draw {
  to {
    stroke-dashoffset: 0;
  }
}

/* ---------- Data fields (label: value) ---------- */

.data-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--ink);
  margin: 0;
}

.data-grid--wide {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.data-grid--three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (min-width: 640px) {
  .data-grid--wide {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.datum {
  padding: 0.6rem 0.75rem 0.65rem 0;
  border-bottom: 1px solid var(--rule);
  min-width: 0;
}

.datum dt {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.datum dd {
  margin: 0.15rem 0 0;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 0.975rem;
  color: var(--ink);
  overflow-wrap: anywhere;
}

/* Field row: lettered fields side by side, like a document's ruled boxes */
.field-row {
  display: grid;
  margin: 0;
  border-top: 1px solid var(--ink);
}

.field-row > div {
  padding: 1rem 0;
  border-bottom: 1px solid var(--rule);
}

.field-row dt {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.field-row dd {
  margin: 0.4rem 0 0;
  color: var(--ink);
  font-weight: 560;
  font-size: 1.0625rem;
  line-height: 1.4;
}

@media (min-width: 768px) {
  .field-row {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .field-row > div {
    padding: 1.1rem 1.25rem 1.25rem;
    border-bottom: 0;
  }

  .field-row > div:first-child {
    padding-left: 0;
  }

  .field-row > div + div {
    border-left: 1px solid var(--rule);
  }
}

/* Terms ledger: label on the left, plain-language value on the right */
.terms {
  margin: 0;
  border-top: 1px solid var(--ink);
}

.terms > div {
  display: grid;
  grid-template-columns: minmax(7.5rem, 0.38fr) minmax(0, 1fr);
  gap: 1rem;
  padding: 0.95rem 0;
  border-bottom: 1px solid var(--rule);
}

.terms dt {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding-top: 0.2rem;
}

.terms dd {
  margin: 0;
  color: var(--ink);
  font-weight: 560;
  font-size: 1.0625rem;
}

/* ---------- Group legend ---------- */

.group-mark {
  display: inline-block;
  width: 0.6rem;
  height: 0.6rem;
  flex: none;
  background: var(--g-other);
}

[data-group="schengen"] .group-mark,
.group-mark[data-group="schengen"] {
  background: var(--g-schengen);
}

[data-group="uk-ie"] .group-mark,
.group-mark[data-group="uk-ie"] {
  background: var(--g-uk-ie);
  border-radius: 50%;
}

[data-group="na"] .group-mark,
.group-mark[data-group="na"] {
  background: var(--g-na);
  transform: rotate(45deg) scale(0.85);
}

[data-group="other"] .group-mark,
.group-mark[data-group="other"] {
  background: transparent;
  box-shadow: inset 0 0 0 2px var(--g-other);
}

.legend-filter {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.5rem;
  padding: 0 0.85rem;
  border: 1px solid var(--rule);
  background: var(--field);
  font-size: 0.875rem;
  font-weight: 560;
  color: var(--ink-2);
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s, color 0.15s;
}

.legend-filter:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.legend-filter[aria-pressed="true"] {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.legend-filter[aria-pressed="true"] .group-mark[data-group="other"] {
  box-shadow: inset 0 0 0 2px var(--paper);
}

/* ---------- Ledger (ruled table and lists) ---------- */

.ledger {
  width: 100%;
  border-collapse: collapse;
}

.ledger th {
  text-align: left;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding: 0.7rem 0.75rem;
  border-bottom: 1px solid var(--ink);
}

.ledger td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--rule);
  vertical-align: middle;
}

.ledger tbody tr {
  transition: background-color 0.12s;
}

.ledger tbody tr:hover {
  background: var(--paper);
}

.ledger-list > li {
  border-bottom: 1px solid var(--rule);
}

.ledger-list > li:first-child {
  border-top: 1px solid var(--ink);
}

/* Flags: one uniform 4:3 size, a hairline edge so white flags still read */
.flag {
  display: block;
  flex: none;
  width: 2rem;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 2px;
  background: var(--paper-deep);
  box-shadow: 0 0 0 1px rgba(29, 23, 26, 0.14);
}

.step-num {
  font-family: var(--font-mono);
  font-size: 2.25rem;
  line-height: 1;
  font-weight: 500;
  color: var(--garnet);
}

/* ---------- Perforated stub ---------- */

.stub {
  position: relative;
  border-top: 2px dashed var(--ink-3);
}

.stub::before,
.stub::after {
  content: "";
  position: absolute;
  top: -0.8rem;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: var(--paper);
  border: 1px solid var(--ink);
}

.stub::before {
  left: -0.8rem;
  clip-path: inset(0 0 0 50%);
}

.stub::after {
  right: -0.8rem;
  clip-path: inset(0 50% 0 0);
}

.phone-big {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  letter-spacing: -0.03em;
  font-size: clamp(1.75rem, 1.2rem + 2.4vw, 2.9rem);
  line-height: 1;
  color: var(--ink);
  text-decoration: none;
}

.phone-big:hover {
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

/* ---------- Partner ledger ---------- */

.partners {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--ink);
  border-left: 1px solid var(--rule);
}

@media (min-width: 768px) {
  .partners {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.partner {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 4.75rem;
  padding: 1rem;
  border-bottom: 1px solid var(--rule);
  border-right: 1px solid var(--rule);
}

.partner img {
  max-height: 1.4rem;
  width: auto;
  max-width: 100%;
  filter: grayscale(1) contrast(1.25) brightness(0.7);
  mix-blend-mode: multiply;
}

.partner--tursab {
  flex-direction: column;
  gap: 0.2rem;
  text-align: center;
}

/* ---------- Bands, notices, stamp ---------- */

.band-deep {
  background-color: var(--paper-deep);
  background-image: url("../img/print/underprint.svg");
  background-size: 240px 48px;
  border-block: 1px solid var(--rule);
}

/* Microtext rule between modules, the same printed line as under the header */
.microtext-rule {
  border-block: 1px solid var(--rule-soft);
}

/* Form field number: the sheet's fields are numbered like a document */
.field-no {
  font-family: var(--font-mono);
  font-weight: 500;
  letter-spacing: 0;
  color: var(--garnet);
  margin-right: 0.35rem;
}

.doc-title {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-2);
  white-space: nowrap;
}

/* Featured destination: a small issued data page, photo field beside its fields */
.mini-doc {
  display: grid;
  grid-template-columns: minmax(0, 0.42fr) minmax(0, 1fr);
  gap: 1.25rem;
  padding: 1rem;
  border: 1px solid var(--ink);
  background-color: var(--sheet);
  background-image: url("../img/print/underprint.svg");
  background-size: 240px 48px;
}

.mini-doc .data-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 479px) {
  .mini-doc {
    grid-template-columns: minmax(0, 0.48fr) minmax(0, 1fr);
    gap: 0.9rem;
    padding: 0.75rem;
  }

  .mini-doc .data-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Process steps: three ruled columns, read left to right */
.steps {
  display: grid;
  border-top: 1px solid var(--ink);
}

.steps > li {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--rule);
}

@media (min-width: 768px) {
  .steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .steps > li {
    padding: 1.75rem 1.75rem 0.5rem;
    border-bottom: 0;
  }

  .steps > li:first-child {
    padding-left: 0;
  }

  .steps > li + li {
    border-left: 1px solid var(--rule);
  }
}

.notice {
  border: 1px solid var(--ink);
  background: var(--field);
  padding: 0.9rem 1rem;
  font-weight: 550;
}

.stamp {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0.7rem 1.4rem;
  border: 2.5px solid var(--ok);
  outline: 1px solid var(--ok);
  outline-offset: 3px;
  color: var(--ok);
  font-stretch: 112%;
  font-weight: 720;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transform: rotate(-4deg);
}

.stamp small {
  font-family: var(--font-mono);
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  font-size: 0.75rem;
}

@media (prefers-reduced-motion: no-preference) {
  .stamp {
    animation: stamp-press 0.55s var(--ease-out) both;
  }
}

@keyframes stamp-press {
  from {
    transform: rotate(-4deg) scale(1.35);
    opacity: 0;
  }
  to {
    transform: rotate(-4deg) scale(1);
    opacity: 1;
  }
}

/* ---------- Reading content ---------- */

.prose-doc {
  max-width: 68ch;
  color: var(--ink-2);
  font-size: 1.0625rem;
  line-height: 1.75;
}

.prose-doc > * + * {
  margin-top: 1.1em;
}

.prose-doc h2,
.prose-doc h3,
.prose-doc h4 {
  color: var(--ink);
  font-stretch: 110%;
  font-weight: 680;
  letter-spacing: -0.015em;
  line-height: 1.2;
  margin-top: 2em;
}

.prose-doc h2 {
  font-size: 1.6rem;
}

.prose-doc h3 {
  font-size: 1.3rem;
}

.prose-doc a {
  color: var(--ember-deep);
  text-decoration: underline;
}

.prose-doc ul,
.prose-doc ol {
  padding-left: 1.3rem;
}

.prose-doc ul {
  list-style: square;
}

.prose-doc ol {
  list-style: decimal;
}

.prose-doc li + li {
  margin-top: 0.4em;
}

.prose-doc strong {
  color: var(--ink);
}

.prose-doc img {
  border: 1px solid var(--ink);
  padding: 4px;
  background: var(--sheet);
}

.prose-doc blockquote {
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  padding: 0.8rem 0;
  color: var(--ink);
}

.prose-doc table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.prose-doc th,
.prose-doc td {
  border-bottom: 1px solid var(--rule);
  padding: 0.5rem 0.4rem;
  text-align: left;
}

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

.colophon {
  background: var(--paper-deep);
  border-top: 1px solid var(--ink);
}

.colophon a {
  text-decoration: none;
}

/* Touch-size footer links on phones and tablets only */
@media (max-width: 1023px) {
  .colophon li > a {
    display: inline-flex;
    align-items: center;
    gap: 0.35em;
    min-height: 2.75rem;
  }
}

.colophon a:hover {
  text-decoration: underline;
}

/* ---------- Mobile dock ---------- */

.wa-glyph {
  color: #25d366;
}

/* Desktop: WhatsApp pinned to the bottom-right corner */
.wa-float {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  z-index: 55;
  display: none;
  align-items: center;
  gap: 0.6rem;
  min-height: 3.25rem;
  padding: 0 1.2rem 0 1rem;
  border-radius: 2px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 650;
  text-decoration: none;
  box-shadow: 0 12px 28px -12px rgba(29, 23, 26, 0.55);
  transition: background-color 0.15s;
}

.wa-float .wa-glyph {
  font-size: 1.6rem;
}

.wa-float:hover {
  background: var(--ink-2);
}

/* Steps aside while a stub that already offers WhatsApp, or the footer, is on screen */
.wa-float.is-tucked {
  opacity: 0;
  transform: translateY(0.75rem);
  pointer-events: none;
}

.wa-float {
  transition: background-color 0.15s, opacity 0.25s var(--ease-out), transform 0.25s var(--ease-out);
}

@media (min-width: 1024px) {
  .wa-float {
    display: inline-flex;
  }
}

.mobile-dock {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 60;
  display: grid;
  grid-template-columns: 1fr 1.25fr 1fr;
  background: var(--ink);
  border-top: 1px solid var(--ink);
  padding-bottom: env(safe-area-inset-bottom);
}

.mobile-dock a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 3.5rem;
  color: var(--paper);
  font-weight: 650;
  font-size: 0.95rem;
  text-decoration: none;
  border-right: 1px solid var(--ink-2);
}

.mobile-dock a.is-hot {
  background: var(--ember);
}

.mobile-dock a:last-child {
  border-right: 0;
}

@media (min-width: 1024px) {
  .mobile-dock {
    display: none;
  }
}

@media (max-width: 1023px) {
  body {
    padding-bottom: calc(3.5rem + env(safe-area-inset-bottom));
  }
}

@media print {
  .mobile-dock,
  .nav-bar,
  .record-strip {
    display: none;
  }
}
