/* "Spine & Slash", the look of iko.soy: paper, ink and one red; Unbounded + Onest; no radius, no shadows.
   The fonts come from vendor/fonts.css (assembled by flake.nix). */
:root {
  --paper: #f0ebe2;
  --ink: #141210;
  --muted: #5b564e;
  --red: #d8351f;
  --red-filled: #c42f1a; /* hover on filled buttons */
  --display: "Unbounded", "Arial Black", sans-serif;
  --text: "Onest", "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { background: var(--paper); }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.5 var(--text);
  -webkit-font-smoothing: antialiased;
  text-wrap: pretty;
}
p { margin: 0; }
button { font-family: inherit; }
button:disabled { opacity: .4; cursor: not-allowed; }
::selection { background: var(--red); color: var(--paper); }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

.fa { display: block; flex: none; width: 1.25em; height: 1em; fill: currentColor; }

.sq {
  flex: none; width: 28px; height: 28px; display: grid; place-items: center;
  background: var(--ink); color: var(--paper); font-size: 12px;
  transition: background-color .15s ease;
}
.pulse { display: block; flex: none; width: 10px; height: 10px; background: var(--red); animation: pulse 1s ease-in-out infinite; }
.marker { flex: none; width: 10px; height: 10px; background: var(--red); }
@keyframes pulse { 50% { opacity: .2; } }

/* — layout — */
.root { overflow-x: clip; padding: 0 clamp(20px, 5vw, 32px); }
main {
  display: flex; flex-wrap: wrap; align-items: flex-start; gap: 52px 112px;
  max-width: 960px; margin: 0 auto;
  padding: clamp(40px, 8vw, 104px) 0 clamp(64px, 9vw, 112px);
}

.identity {
  flex: 0 1 auto; min-width: 0;
  display: grid; grid-template-columns: auto minmax(0, clamp(180px, 46vw, 256px)); gap: 18px 20px;
  color: var(--ink); text-decoration: none;
}
.spine {
  grid-column: 1; grid-row: 1; align-self: end; position: relative; z-index: 1;
  writing-mode: vertical-rl; transform: rotate(180deg);
  font: 900 clamp(83px, 14.6vw, 140px)/.74 var(--display); letter-spacing: .03em; text-transform: uppercase;
}
.portrait { grid-column: 2; grid-row: 1; position: relative; isolation: isolate; }
.portrait img {
  display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover;
  filter: grayscale(1) contrast(1.1);
}
.slash {
  position: absolute; z-index: -1; top: calc(50% - 12px); left: -55%; right: -38%; height: 24px;
  background: var(--red); transform: rotate(-31deg);
  animation: slash .9s cubic-bezier(.2, .8, .2, 1) .15s both;
}
@keyframes slash { from { transform: rotate(-31deg) scaleX(0); } }
.caption { grid-column: 2; grid-row: 2; justify-self: start; font-size: 13px; line-height: 1.4; color: var(--muted); }
.identity:hover .caption { color: var(--ink); }

.content { flex: 1 1 352px; min-width: 0; max-width: 576px; }
h1 { margin: 0; font: 600 clamp(26px, 3.1vw, 30px)/1.15 var(--display); letter-spacing: -.01em; text-wrap: balance; }
.lead { margin-top: 40px; font-size: 18px; font-weight: 500; }
section { margin-top: 48px; }
section.wallet { margin-top: 8px; }
.tab {
  display: table; margin: 0 0 16px; padding: .6em .8em .55em;
  background: var(--ink); color: var(--paper);
  font: 600 11px/1 var(--display); letter-spacing: .1em; text-transform: uppercase;
}
#sec-card { margin-bottom: 12px; }

/* — buttons and links — */
.primary {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  width: 100%; min-height: 56px; margin-top: 4px; padding: 0 18px;
  border: 0; border-radius: 0; background: var(--ink); color: var(--paper);
  font-size: 17px; font-weight: 600; text-align: left; cursor: pointer;
  transition: background-color .15s ease;
}
.primary:hover:not(:disabled) { background: var(--red-filled); }

.button {
  display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 18px;
  border: 2px solid var(--ink); border-radius: 0; background: transparent; color: var(--ink);
  font-size: 16px; font-weight: 600; cursor: pointer;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.button:hover { background: var(--ink); color: var(--paper); }
.button-primary { background: var(--ink); color: var(--paper); }
.button-primary:hover { background: var(--red-filled); border-color: var(--red-filled); }
.buttons { display: flex; flex-wrap: wrap; gap: 8px; }

.text-button, .link {
  color: var(--ink); font-size: 15px; font-weight: 500;
  text-decoration: underline 1px; text-underline-offset: .25em;
}
.text-button { min-height: 44px; padding: 0; border: 0; background: none; cursor: pointer; }
.text-button:hover, .link:hover { text-decoration-color: var(--red); text-decoration-thickness: 2px; }

.square-button {
  flex: none; width: 40px; height: 40px; display: grid; place-items: center; padding: 0;
  border: 0; border-radius: 0; background: var(--ink); color: var(--paper); font-size: 15px; cursor: pointer;
  transition: background-color .15s ease;
}
.square-button:hover { background: var(--red-filled); }

/* Row links: "By card" and the wallet picker. */
.row {
  display: flex; align-items: center; gap: 16px; min-height: 44px; padding: 4px 0;
  color: var(--ink); text-decoration: none; font-size: 18px; line-height: 1.5; font-weight: 500;
}
.row .arrow, .row .arrow-r { display: inline-block; color: var(--muted); transition: transform .15s ease, color .15s ease; }
.row .arrow { margin-left: -10px; }
.row:not(:disabled):hover .sq { background: var(--red); }
.row:not(:disabled):hover .label { text-decoration: underline 2px var(--red); text-underline-offset: .25em; }
.row:not(:disabled):hover .arrow { color: var(--red); transform: translate(.12em, -.12em); }
.row:not(:disabled):hover .arrow-r { color: var(--red); transform: translateX(.15em); }

/* — with a wallet — */
.wallet-row { display: flex; align-items: center; gap: 16px; min-height: 44px; margin-bottom: 12px; }
.wallet-tag { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 17px; font-weight: 500; }
.disconnect { flex: none; font-size: 14px; color: var(--muted); }
.disconnect:hover { color: var(--ink); }

.form { display: flex; flex-direction: column; gap: 12px; }
.amount-group { display: flex; flex-direction: column; gap: 8px; }
.amount { position: relative; }
.amount span {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  font-size: 22px; font-weight: 600; line-height: 1; pointer-events: none;
}
.amount input {
  display: block; width: 100%; height: 56px; margin: 0; padding: 0 16px 0 36px;
  border: 2px solid var(--ink); border-radius: 0; outline: none; background: transparent;
  color: var(--ink); caret-color: var(--red);
  font: 600 22px var(--text); font-variant-numeric: tabular-nums;
}
.amount input:focus { border-color: var(--red); }

/* Segmented controls: radio groups whose 2px borders overlap so every divider stays 2px. */
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); padding-left: 2px; }
.seg label {
  position: relative; min-width: 0; min-height: 44px; margin-left: -2px; padding: 0 14px;
  display: flex; align-items: center; border: 2px solid var(--ink);
  font-size: 15px; font-weight: 500; cursor: pointer;
}
.tokens label { font-weight: 600; }
.seg input { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }
.seg label:not(:has(input:disabled)):hover { box-shadow: inset 0 0 0 999px rgba(20, 18, 16, .08); }
.seg label:has(input:checked) { background: var(--ink); color: var(--paper); }
.seg label:has(input:disabled) { color: var(--muted); cursor: not-allowed; }
.seg label:has(input:focus-visible) { z-index: 1; outline: 2px solid var(--red); outline-offset: 2px; }

.summary, .notice, .pair-status { display: flex; align-items: center; gap: 8px; font-size: 15px; line-height: 24px; }
.summary { color: var(--muted); }
.notice, .pair-status { font-weight: 600; }

.progress { display: flex; flex-direction: column; gap: 20px; }
.big-amount { font: 600 30px/1.15 var(--display); letter-spacing: -.01em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.sub { margin-top: 4px; font-size: 15px; color: var(--muted); }
.sweep { position: relative; height: 3px; overflow: hidden; background: rgba(20, 18, 16, .14); }
.sweep::after {
  content: ""; position: absolute; top: 0; left: 0; width: 30%; height: 100%;
  background: var(--red); animation: sweep 1.3s cubic-bezier(.6, 0, .4, 1) infinite;
}
@keyframes sweep { from { transform: translateX(-100%); } to { transform: translateX(340%); } }
.steps { list-style: none; margin: -6px 0 0; padding: 0; }
.steps li { display: flex; align-items: center; gap: 16px; min-height: 44px; font-size: 17px; line-height: 1.4; }
.steps li > :last-child { font-weight: 500; color: var(--muted); }
.steps .done > :last-child, .steps .active > :last-child { color: var(--ink); }
.step-sq {
  flex: none; width: 28px; height: 28px; display: grid; place-items: center;
  border: 2px solid rgba(20, 18, 16, .3); color: var(--muted); font: 600 10px var(--display);
}
.step-sq .fa, .steps .done .step-sq span, .steps .active .step-sq span { display: none; }
.steps .done .step-sq { border: 0; background: var(--ink); color: var(--paper); font-size: 12px; }
.steps .done .step-sq .fa { display: block; }
.steps .active .step-sq { border: 0; background: var(--red); animation: breathe 1.4s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .45; } }

.result { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; }
.result h3 { margin: 0; font: 600 22px/1.2 var(--display); letter-spacing: -.01em; }
.result .thanks { font: 900 clamp(36px, 4.6vw, 46px)/.95 var(--display); letter-spacing: .01em; text-transform: uppercase; }
.done-line { font-size: 18px; }
.result-line { font-size: 17px; }
#done .button { margin-top: 4px; }

/* — directly — */
.addresses, .rows { list-style: none; margin: 0; padding: 0; }
.addresses { display: flex; flex-direction: column; gap: 24px; }
.addresses li { position: relative; padding-left: 44px; }
.addresses .sq { position: absolute; left: 0; top: 0; font-size: 13px; }
.network { font-size: 18px; line-height: 28px; font-weight: 500; }
.send-line { font-size: 14px; color: var(--muted); }
.address {
  margin-top: 8px; font-size: 15px; line-height: 1.55; letter-spacing: .02em; word-spacing: .15em;
  overflow-wrap: anywhere; font-variant-numeric: tabular-nums;
}
.address strong { font-weight: 600; }
.actions { display: flex; flex-wrap: wrap; gap: 0 20px; }
.qr { display: block; width: 176px; max-width: 100%; aspect-ratio: 1; margin-top: 4px; color: var(--ink); shape-rendering: crispEdges; }

/* — wallet picker — */
dialog {
  width: min(440px, 100% - 32px); max-width: none; max-height: calc(100vh - 32px); overflow: auto;
  padding: 0; border: 0; border-radius: 0; background: var(--paper); color: var(--ink);
}
dialog::backdrop { background: rgba(20, 18, 16, .62); }
.dialog-body, .wallet-groups, .pairing { display: flex; flex-direction: column; gap: 20px; }
.dialog-body { padding: 24px; }
.dialog-head { display: flex; align-items: center; gap: 12px; }
.dialog-head .tab { min-width: 0; margin: 0; }
.dialog-head .close { margin-left: auto; }
#picker:has(#pairing:not([hidden])) .tab { line-height: 1.2; }
.group-label {
  margin-bottom: 4px; color: var(--muted);
  font: 600 10px/1.6 var(--display); letter-spacing: .1em; text-transform: uppercase;
}
.picker-row { width: 100%; min-height: 48px; border: 0; border-radius: 0; background: none; font-size: 17px; text-align: left; cursor: pointer; }
.picker-row .label { flex: 1 1 auto; min-width: 0; }
.approve { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.pair-qr { width: 100%; max-width: 240px; margin: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
