:root {
  --bg: #070807;
  --ink: #f4f7f5;
  --body: #c9d7ce;
  --muted: #8ea497;
  --green: #1fa36a;
  --green-2: #8ee0b4;
  --line: rgba(143, 196, 164, 0.28);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  overflow-x: clip;
}

body {
  min-height: 100%;
  color: var(--body);
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }

button, input { font: inherit; color: inherit; }

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--green-2);
  outline-offset: 3px;
}

::selection {
  background: #14643f;
  color: #f4fff8;
}

.stage {
  display: grid;
  grid-template-columns: minmax(240px, 34vw) minmax(0, 1fr);
  min-height: 100vh;
}

.mark {
  position: sticky;
  top: 0;
  height: 100vh;
  display: grid;
  place-items: center;
  padding: 36px 28px 32px;
  border-right: 1px solid var(--line);
}

.mark img {
  width: min(520px, 94%);
  max-height: 74vh;
  object-fit: contain;
  object-position: center;
  margin: 0;
}

.where {
  position: absolute;
  left: 28px;
  bottom: 28px;
}

.where {
  margin: 0;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.dhivehi {
  font-family: "Noto Sans Thaana", "MV Boli", sans-serif;
  font-size: 18px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--green-2);
  margin-right: 8px;
}

.sheet {
  padding: 28px 56px 48px;
  max-width: 820px;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 48px;
}

.brand {
  color: var(--ink);
  text-decoration: none;
  font-family: "Instrument Serif", Georgia, serif;
  font-size: 28px;
  letter-spacing: -0.03em;
}

.brand em {
  font-style: italic;
  color: var(--green-2);
}

.order {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--green);
  color: #062015;
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  padding: 12px 16px;
}

.order:hover { background: #2cbc7c; }

.order.wide {
  margin-top: 22px;
}

h1, h2, p { margin: 0; }

h1 {
  margin-top: 36px;
  max-width: 11em;
  color: var(--ink);
  font-family: "Instrument Serif", Georgia, serif;
  font-weight: 400;
  font-size: clamp(3rem, 5vw, 4.6rem);
  line-height: 0.96;
  letter-spacing: -0.03em;
}

.lede {
  margin-top: 22px;
  max-width: 38em;
  font-size: 1.05rem;
}

.quiet {
  margin-top: 12px;
  color: var(--muted);
  max-width: 38em;
}

.ledger {
  margin-top: 36px;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  border-top: 1px solid var(--green);
  border-bottom: 1px solid var(--line);
}

.ledger-rate,
.ledger-calc {
  padding: 18px 0 20px;
  min-width: 0;
}

.ledger-calc {
  padding-left: 28px;
  border-left: 1px solid var(--line);
}

.pairline {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.pairline img {
  width: 36px;
  height: 36px;
  min-width: 36px;
  flex: 0 0 36px;
}

.pairline p {
  color: var(--ink);
  font-weight: 500;
}

.pairline span { color: var(--muted); font-weight: 400; }

.unit,
.ledger-calc label,
#result-label,
.meta,
.refresh {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.figure,
.result {
  color: var(--green-2);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1.1;
}

.figure {
  margin-top: 6px;
  font-size: clamp(2rem, 3vw, 2.7rem);
  min-height: 1.15em;
}

.breakdown {
  margin-top: 8px;
  font-size: 13px;
  max-width: 28em;
}

.ledger-calc label,
#result-label { display: block; }

.line {
  margin: 8px 0 18px;
  border-bottom: 1px solid var(--green-2);
}

.line input {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 1.7rem;
  padding: 6px 0 8px;
}

.line input:focus { outline: none; }

.result {
  margin-top: 6px;
  font-size: 1.45rem;
  min-height: 1.2em;
  color: var(--ink);
}

.meta {
  margin-top: 14px;
  text-transform: none;
  letter-spacing: 0;
  font-size: 12px;
  line-height: 1.45;
  max-width: 36em;
}

.refresh {
  margin-top: 8px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--green-2);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.refresh:disabled {
  color: var(--muted);
  cursor: default;
}

.how { margin-top: 48px; }

.about { margin-top: 48px; }

.about p {
  margin-top: 14px;
  max-width: 40em;
}

h2 {
  color: var(--ink);
  font-family: "Instrument Serif", Georgia, serif;
  font-weight: 400;
  font-size: 2rem;
  letter-spacing: -0.03em;
}

.steps {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
}

.steps li {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 8px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

.steps li:last-child { border-bottom: 1px solid var(--line); }

.steps span {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  color: var(--green);
  font-size: 13px;
  padding-top: 3px;
}

.steps strong {
  color: var(--ink);
  font-weight: 600;
}

footer {
  margin-top: 28px;
  color: var(--muted);
  font-size: 13px;
  max-width: 62ch;
}

footer a { color: var(--body); }

@media (max-width: 860px) {
  .stage { grid-template-columns: 1fr; }

  .mark {
    position: relative;
    height: auto;
    flex-direction: row;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .mark img {
    width: 54px;
    height: 54px;
    max-height: none;
    margin: 0;
  }

  .where { position: static; }

  .sheet { padding: 22px 20px 40px; }

  h1 {
    margin-top: 22px;
    font-size: 2.45rem;
  }

  .ledger { grid-template-columns: 1fr; }

  .ledger-calc {
    padding-left: 0;
    border-left: 0;
    border-top: 1px solid var(--line);
  }
}
