/* FX Travel Calc — boarding-pass / bureau de change ticket theme.
   System fonts only. Light by default, optional dark theme. */

:root {
  color-scheme: light;
  --bg: #e7ecef;
  --bg-deep: #dce3e7;
  --surface: #f9fbfc;
  --surface-2: #eef3f5;
  --ink: #16181d;
  --ink-soft: #353b44;
  --muted: #5c6672;
  --line: #c8d2d8;
  --line-strong: #aebac2;
  --accent: #be123c;
  --accent-deep: #991132;
  --accent-soft: #f6e2e7;
  --carbon: #252a31;
  --ticket: #16181d;
  --ticket-2: #1e232a;
  --ticket-text: #f2f5f6;
  --ticket-muted: #a6b0ba;
  --ticket-line: rgba(242, 245, 246, 0.22);
  --focus: rgba(190, 18, 60, 0.28);
  --shadow: 0 18px 36px rgba(22, 24, 29, 0.09);
  --shadow-tight: 0 8px 18px rgba(22, 24, 29, 0.08);
  --radius: 9px;
  --radius-sm: 6px;
  --wrap: 1100px;
  --sans: system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", "Segoe UI Mono", Consolas, monospace;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101317;
  --bg-deep: #0b0e11;
  --surface: #181d23;
  --surface-2: #20262d;
  --ink: #e9eef1;
  --ink-soft: #c3ccd2;
  --muted: #96a1ab;
  --line: #2d353e;
  --line-strong: #414c57;
  --accent: #e11d48;
  --accent-deep: #be123c;
  --accent-soft: #351923;
  --carbon: #dce4e9;
  --ticket: #070a0d;
  --ticket-2: #10151b;
  --ticket-text: #f2f5f6;
  --ticket-muted: #9ba7b2;
  --ticket-line: rgba(242, 245, 246, 0.2);
  --focus: rgba(225, 29, 72, 0.34);
  --shadow: 0 22px 46px rgba(0, 0, 0, 0.34);
  --shadow-tight: 0 8px 20px rgba(0, 0, 0, 0.3);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background-color: var(--bg);
  background-image: radial-gradient(circle at 1px 1px, rgba(22, 24, 29, 0.055) 1px, transparent 1.2px);
  background-size: 22px 22px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

:root[data-theme="dark"] body {
  background-image: radial-gradient(circle at 1px 1px, rgba(233, 238, 241, 0.04) 1px, transparent 1.2px);
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

h1,
h2,
h3,
h4 {
  line-height: 1.18;
  letter-spacing: -0.022em;
  font-weight: 800;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--accent-deep);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.wrap {
  width: min(var(--wrap), calc(100% - 40px));
  margin: 0 auto;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: var(--surface);
  font-weight: 700;
  text-decoration: none;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 12px;
  color: var(--surface);
}

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 22px;
  min-height: 72px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
  flex: 0 0 auto;
}

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

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: var(--accent);
  color: #fff;
  box-shadow: 3px 3px 0 var(--ink);
  flex: 0 0 auto;
}

:root[data-theme="dark"] .brand-mark {
  box-shadow: 3px 3px 0 #000;
}

.brand-mark svg {
  width: 23px;
  height: 23px;
  display: block;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.12;
}

.brand-name {
  font-weight: 850;
  font-size: 17px;
  letter-spacing: -0.02em;
}

.brand-sub {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 3px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  flex-wrap: wrap;
}

.site-nav a {
  display: inline-block;
  padding: 8px 11px;
  border-radius: var(--radius-sm);
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
}

.site-nav a:hover {
  background: var(--surface);
  color: var(--ink);
}

.site-nav a[aria-current="page"] {
  color: var(--accent);
  box-shadow: inset 0 -2px 0 var(--accent);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.icon-button {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-tight);
  flex: 0 0 auto;
  padding: 0;
}

.icon-button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.icon-button svg {
  width: 18px;
  height: 18px;
  grid-area: 1 / 1;
  transition: opacity 0.2s ease, transform 0.25s ease;
}

.icon-button .icon-sun {
  opacity: 0;
  transform: rotate(-45deg) scale(0.7);
}

:root[data-theme="dark"] .icon-button .icon-moon {
  opacity: 0;
  transform: rotate(45deg) scale(0.7);
}

:root[data-theme="dark"] .icon-button .icon-sun {
  opacity: 1;
  transform: none;
}

/* ---------- shared bits ---------- */

main {
  padding: 36px 0 64px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.eyebrow::before {
  content: "";
  width: 18px;
  height: 2px;
  background: var(--accent);
}

.lede {
  color: var(--ink-soft);
  font-size: 17px;
  line-height: 1.65;
  max-width: 62ch;
}

.small {
  font-size: 13.5px;
  color: var(--muted);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 11px 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 14.5px;
  font-weight: 750;
  letter-spacing: 0.01em;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 3px 3px 0 var(--ink);
}

.button-primary:hover {
  background: var(--accent-deep);
  color: #fff;
  box-shadow: 4px 4px 0 var(--ink);
}

:root[data-theme="dark"] .button-primary {
  color: #fff;
  box-shadow: 3px 3px 0 #000;
}

.button-secondary {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--ink);
}

.button-secondary:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.button-quiet {
  background: transparent;
  border-color: transparent;
  color: var(--ink-soft);
  box-shadow: none;
}

.button-quiet:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.button .arrow {
  font-size: 16px;
  line-height: 1;
}

.text-link {
  font-weight: 700;
}

/* ---------- hero ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(300px, 0.92fr);
  gap: 46px;
  align-items: center;
  padding: 22px 0 54px;
}

.hero h1 {
  font-size: clamp(36px, 5.1vw, 60px);
  max-width: 12.5ch;
  margin-bottom: 20px;
}

.hero .lede {
  max-width: 54ch;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 28px;
}

.hero-actions .small {
  max-width: 27ch;
}

/* specimen ticket */

.specimen {
  position: relative;
  background: var(--ticket);
  color: var(--ticket-text);
  border-radius: var(--radius);
  padding: 24px 24px 20px;
  box-shadow: 10px 10px 0 color-mix(in srgb, var(--accent) 82%, #000), var(--shadow);
  transform: rotate(-1.2deg);
}

.specimen::after {
  content: "";
  position: absolute;
  inset: 9px;
  border: 1px solid rgba(242, 245, 246, 0.14);
  border-radius: 4px;
  pointer-events: none;
}

.specimen-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px dashed var(--ticket-line);
}

.specimen-kicker {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ticket-muted);
}

.specimen-code {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--accent);
}

.specimen-pair {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 0 14px;
  font-family: var(--mono);
}

.specimen-pair strong {
  font-family: var(--sans);
  font-size: 30px;
  font-weight: 850;
  letter-spacing: -0.03em;
}

.specimen-pair span {
  color: var(--ticket-muted);
  font-size: 12px;
}

.specimen-lines {
  display: grid;
  gap: 7px;
  padding: 14px 0;
  border-top: 1px solid var(--ticket-line);
  border-bottom: 1px dashed var(--ticket-line);
  font-size: 13px;
}

.specimen-line {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  color: var(--ticket-muted);
  font-family: var(--mono);
  font-size: 11.5px;
}

.specimen-line b {
  color: var(--ticket-text);
  font-weight: 600;
}

.specimen-total {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  padding-top: 16px;
}

.specimen-total span {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ticket-muted);
  padding-bottom: 5px;
}

.specimen-total strong {
  font-size: 34px;
  line-height: 1;
  font-weight: 850;
  letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums;
}

.barcode {
  display: flex;
  align-items: stretch;
  gap: 3px;
  height: 24px;
  margin-top: 16px;
  opacity: 0.72;
}

.barcode i {
  display: block;
  background: var(--ticket-text);
  width: 2px;
}

.barcode i:nth-child(3n) {
  width: 4px;
}
.barcode i:nth-child(5n) {
  width: 1px;
}
.barcode i:nth-child(7n) {
  width: 6px;
}

/* ---------- home sections ---------- */

.section {
  padding: 46px 0;
  border-top: 1px solid var(--line);
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.section-head h2 {
  font-size: clamp(24px, 3vw, 32px);
  max-width: 22ch;
}

.section-head p {
  color: var(--muted);
  max-width: 42ch;
  font-size: 14.5px;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  counter-reset: step;
}

.step {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 20px 20px;
  box-shadow: var(--shadow-tight);
}

.step::before {
  counter-increment: step;
  content: "0" counter(step);
  display: block;
  margin-bottom: 18px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--accent);
}

.step h3 {
  font-size: 18px;
  margin-bottom: 8px;
}

.step p {
  color: var(--muted);
  font-size: 14px;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.86fr);
  gap: 34px;
  align-items: start;
}

.note-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 20px;
  box-shadow: var(--shadow-tight);
}

.note-card h3 {
  font-size: 16px;
  margin-bottom: 7px;
}

.note-card p {
  color: var(--muted);
  font-size: 14px;
}

.note-card p + p {
  margin-top: 10px;
}

/* ---------- inner pages ---------- */

.page-intro {
  padding: 18px 0 30px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 34px;
}

.page-intro h1 {
  font-size: clamp(32px, 4.6vw, 50px);
  max-width: 18ch;
  margin-bottom: 16px;
}

.page-intro .lede {
  max-width: 68ch;
}

.prose {
  max-width: 74ch;
}

.prose h2 {
  font-size: 23px;
  margin: 34px 0 12px;
  padding-top: 18px;
  border-top: 1px dashed var(--line);
}

.prose h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.prose h3 {
  font-size: 17px;
  margin: 22px 0 8px;
}

.prose p,
.prose ul,
.prose ol {
  color: var(--ink-soft);
  margin-bottom: 13px;
}

.prose ul,
.prose ol {
  padding-left: 21px;
}

.prose li {
  margin-bottom: 6px;
}

.prose li::marker {
  color: var(--accent);
}

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

.prose code {
  font-family: var(--mono);
  font-size: 0.9em;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 5px;
}

.prose .callout {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 17px 19px;
  margin: 22px 0;
  font-size: 14.5px;
}

.prose .callout p:last-child {
  margin-bottom: 0;
}

.formula {
  display: block;
  overflow-x: auto;
  background: var(--ticket);
  color: var(--ticket-text);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  margin: 18px 0;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.9;
  white-space: pre;
  box-shadow: var(--shadow-tight);
}

.formula .hl {
  color: #fb7185;
}

.formula .dim {
  color: var(--ticket-muted);
}

/* ---------- calculator ---------- */

.calc-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 26px;
}

.calc-head h1 {
  font-size: clamp(30px, 4.3vw, 46px);
  max-width: 16ch;
}

.calc-head p {
  max-width: 38ch;
  color: var(--muted);
  font-size: 14px;
}

.calc-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(330px, 0.82fr);
  gap: 24px;
  align-items: start;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.form-panel {
  padding: 24px;
  position: relative;
}

.form-panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 22px;
  right: 22px;
  height: 3px;
  background: repeating-linear-gradient(
    90deg,
    var(--accent) 0 18px,
    transparent 18px 26px
  );
  border-radius: 0 0 2px 2px;
}

.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.panel-kicker {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.panel-title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.015em;
}

.field {
  margin-bottom: 16px;
}

.field-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
}

.field label,
.field-label label {
  display: block;
  font-size: 12.5px;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.field-hint {
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.field-hint-error {
  color: var(--accent-deep);
  font-weight: 650;
}

:root[data-theme="dark"] .field-hint-error {
  color: #fda4af;
}

.input-shell {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 0 13px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.input-shell:focus-within {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--focus);
}

.input-prefix {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
  flex: 0 0 auto;
}

.input-suffix {
  font-size: 13px;
  color: var(--muted);
  flex: 0 0 auto;
}

.input-shell input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  padding: 13px 0;
  font-size: 16px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.amount-shell input {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.amount-shell {
  padding: 2px 15px;
}

.currency-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px minmax(0, 1fr);
  gap: 9px;
  align-items: end;
  margin-bottom: 14px;
}

.select-shell {
  position: relative;
}

.select-shell select {
  width: 100%;
  appearance: none;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background-color: var(--surface-2);
  color: var(--ink);
  padding: 12px 34px 12px 12px;
  font-size: 14px;
  font-weight: 650;
  outline: 0;
  cursor: pointer;
  text-overflow: ellipsis;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.select-shell select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus);
}

.select-shell::after {
  content: "▾";
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-52%);
  color: var(--muted);
  font-size: 12px;
  pointer-events: none;
}

.swap-button {
  width: 42px;
  height: 42px;
  align-self: end;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
  font-size: 18px;
  line-height: 1;
  padding: 0;
  transition: transform 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.swap-button:hover {
  transform: rotate(180deg);
  border-color: var(--accent);
  color: var(--accent);
}

.favorites {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 12px 0 22px;
  min-height: 30px;
}

.rate-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.4;
  transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.rate-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.rate-chip-code {
  font-weight: 700;
  color: var(--ink-soft);
}

.rate-chip:hover .rate-chip-code {
  color: var(--accent);
}

.field-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 22px 0 16px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.field-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: repeating-linear-gradient(
    90deg,
    var(--line-strong) 0 7px,
    transparent 7px 12px
  );
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px;
}

.field-grid .field {
  margin-bottom: 0;
}

.form-error {
  margin-top: 15px;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 44%, var(--line));
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-size: 13.5px;
  font-weight: 600;
}

:root[data-theme="dark"] .form-error {
  color: #fda4af;
}

.form-error[hidden] {
  display: none;
}

.form-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-top: 22px;
}

.form-actions .button {
  width: 100%;
}

.rate-source {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}

.rate-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--muted);
}

.rate-status::before {
  content: "";
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 1px;
  background: var(--line-strong);
}

.rate-status[data-state="reference"]::before {
  background: var(--accent);
}

.rate-status[data-state="fallback"] {
  color: var(--accent);
}

.rate-status[data-state="fallback"]::before {
  background: var(--accent);
}

.rate-status[data-state="error"] {
  color: var(--accent);
}

.rate-note {
  margin-top: 7px;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--muted);
}

.rate-note[hidden] {
  display: none;
}

/* result ticket */

.result-panel {
  position: relative;
  overflow: hidden;
  background: var(--ticket);
  color: var(--ticket-text);
  border: 0;
  border-radius: var(--radius);
  padding: 25px 24px 22px;
  box-shadow: 8px 8px 0 color-mix(in srgb, var(--accent) 76%, #000), var(--shadow);
}

.result-panel::after {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(242, 245, 246, 0.12);
  border-radius: 4px;
  pointer-events: none;
}

.result-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 13px;
  border-bottom: 1px dashed var(--ticket-line);
}

.result-kicker {
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ticket-muted);
}

.result-pair {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.result-main {
  font-size: clamp(34px, 4.5vw, 47px);
  line-height: 1.06;
  font-weight: 850;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  padding: 22px 0 6px;
  word-break: break-word;
}

.result-sub {
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--ticket-muted);
  min-height: 2.6em;
}

.result-breakdown {
  margin-top: 18px;
  padding-top: 15px;
  border-top: 1px dashed var(--ticket-line);
  display: grid;
  gap: 8px;
}

.result-breakdown[hidden] {
  display: none;
}

.breakdown-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 14px;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

.breakdown-label {
  color: var(--ticket-muted);
}

.breakdown-value {
  font-family: var(--mono);
  font-size: 12px;
  text-align: right;
  color: var(--ticket-text);
}

.breakdown-row.is-total {
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid var(--ticket-line);
  font-weight: 700;
}

.breakdown-row.is-total .breakdown-label {
  color: var(--ticket-text);
}

.breakdown-row.is-convert .breakdown-value {
  color: #fda4af;
  font-weight: 700;
}

.result-meta {
  margin-top: 17px;
  padding-top: 12px;
  border-top: 1px solid var(--ticket-line);
  font-family: var(--mono);
  font-size: 10.5px;
  line-height: 1.6;
  color: var(--ticket-muted);
}

.result-meta[hidden] {
  display: none;
}

.result-foot {
  margin-top: 16px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.result-stamp {
  display: inline-block;
  border: 1px solid rgba(253, 164, 175, 0.62);
  border-radius: 3px;
  padding: 4px 7px;
  color: #fda4af;
  font-family: var(--mono);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  transform: rotate(-2deg);
}

.result-bars {
  display: flex;
  gap: 2px;
  align-items: flex-end;
  height: 18px;
  opacity: 0.55;
}

.result-bars i {
  display: block;
  width: 2px;
  height: 100%;
  background: var(--ticket-text);
}

.result-bars i:nth-child(2n) {
  height: 62%;
}
.result-bars i:nth-child(3n) {
  width: 4px;
  height: 82%;
}

.result-panel[data-state="success"] .result-main {
  color: #fff;
}

.result-panel[data-state="error"] .result-main {
  color: #fda4af;
}

.calc-footnote {
  margin-top: 20px;
  font-size: 12.5px;
  color: var(--muted);
  max-width: 82ch;
}

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg-deep) 72%, transparent);
  padding: 30px 0 34px;
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) auto;
  gap: 26px;
  align-items: start;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 9px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.footer-brand .brand-mark {
  width: 27px;
  height: 27px;
  box-shadow: 2px 2px 0 var(--ink);
  border-radius: 5px;
}

.footer-brand .brand-mark svg {
  width: 17px;
  height: 17px;
}

.footer-copy {
  color: var(--muted);
  font-size: 12.5px;
  max-width: 58ch;
}

.footer-copy a {
  color: var(--ink-soft);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  justify-content: flex-end;
  font-size: 13px;
}

.footer-links a {
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 600;
}

.footer-links a:hover {
  color: var(--accent);
}

.footer-legal {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px dashed var(--line);
  display: flex;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 11.5px;
  font-family: var(--mono);
  letter-spacing: 0.02em;
}

/* ---------- 404 ---------- */

.not-found {
  max-width: 660px;
  padding: 34px 0 20px;
}

.not-found h1 {
  font-size: clamp(38px, 6vw, 64px);
  margin-bottom: 16px;
}

.not-found .lede {
  margin-bottom: 24px;
}

.not-found-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.not-found-ticket {
  margin-top: 34px;
  max-width: 420px;
  background: var(--ticket);
  color: var(--ticket-text);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: 7px 7px 0 color-mix(in srgb, var(--accent) 76%, #000);
}

.not-found-ticket .specimen-line {
  font-size: 12px;
}

.not-found-ticket strong {
  display: block;
  margin-top: 13px;
  padding-top: 12px;
  border-top: 1px dashed var(--ticket-line);
  font-family: var(--mono);
  font-size: 16px;
  letter-spacing: 0.06em;
  color: #fda4af;
}

/* ---------- responsive ---------- */

@media (min-width: 901px) {
  .result-panel {
    position: sticky;
    top: 96px;
  }
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .hero h1 {
    max-width: 16ch;
  }

  .specimen {
    max-width: 440px;
    transform: none;
  }

  .calc-layout,
  .split {
    grid-template-columns: 1fr;
  }

  .result-panel {
    box-shadow: 6px 6px 0 color-mix(in srgb, var(--accent) 76%, #000), var(--shadow);
  }

  .steps {
    grid-template-columns: 1fr;
  }

  .section-head {
    display: block;
  }

  .section-head p {
    margin-top: 9px;
  }
}

@media (max-width: 720px) {
  .calc-head {
    display: block;
  }

  .calc-head p {
    margin-top: 10px;
    max-width: none;
  }

  .header-inner {
    min-height: 64px;
    gap: 12px;
    flex-wrap: wrap;
    padding: 10px 0;
  }

  .brand-sub {
    display: none;
  }

  .site-nav {
    order: 3;
    width: 100%;
    gap: 2px;
    margin-left: 0;
    padding-top: 4px;
    border-top: 1px dashed var(--line);
    overflow-x: auto;
  }

  .site-nav a {
    padding: 7px 9px;
    font-size: 13px;
  }

  .icon-button {
    margin-left: auto;
  }

  main {
    padding-top: 26px;
  }

  .page-intro {
    padding-top: 8px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .footer-links {
    justify-content: flex-start;
  }
}

@media (max-width: 520px) {
  .wrap {
    width: calc(100% - 28px);
  }

  .hero h1 {
    font-size: 38px;
  }

  .form-panel {
    padding: 20px 16px;
  }

  .result-panel {
    padding: 22px 17px 19px;
  }

  .field-grid {
    grid-template-columns: 1fr;
  }

  .currency-row {
    grid-template-columns: minmax(0, 1fr) 38px;
    grid-template-areas:
      "from swap"
      "to   swap";
  }

  .currency-row .from-field {
    grid-area: from;
  }

  .currency-row .to-field {
    grid-area: to;
  }

  .swap-button {
    grid-area: swap;
    align-self: center;
    width: 38px;
    height: 38px;
  }

  .form-actions {
    grid-template-columns: 1fr;
  }

  .amount-shell input {
    font-size: 25px;
  }

  .result-main {
    font-size: 33px;
  }

  .hero-actions {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .hero-actions .small {
    max-width: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
