@font-face {
  font-family: "Fa Sans";
  src: url("/fonts/sans-regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Fa Sans";
  src: url("/fonts/sans-bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: min(1.05vw, 13.66px);
}

@media (max-width: 768px) {
  html {
    font-size: min(2.65vw, 16px);
  }
}

html,
body {
  min-height: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  font-family: "Fa Sans", Helvetica, Arial, sans-serif;
  background: #f5be49;
  color: #000;
  -webkit-font-smoothing: antialiased;
}

a,
a:link,
a:visited {
  color: inherit;
}

.home main {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 5.4rem 4rem 5.4rem;
  text-align: center;
}

.stage {
  width: min(78rem, 100%);
  max-width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stage-primary {
  display: contents;
}

.chart-panel {
  width: min(58rem, 100%);
  max-width: 100%;
  min-width: 0;
  margin-top: 4.4rem;
  text-align: left;
  user-select: none;
  -webkit-user-select: none;
}

.chart-kicker {
  font-weight: 700;
  font-size: 1.22rem;
  line-height: 1.4;
}

.chart-kicker-en {
  font-size: 1.05rem;
  line-height: 1.4;
  opacity: 0.72;
  margin-top: 0.05rem;
}

.chart-readout {
  margin-top: 0.45rem;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.75rem 1.1rem;
}

.chart-readout-value {
  font-weight: 700;
  font-size: 3.1rem;
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.chart-readout-meta {
  font-size: 1.05rem;
  opacity: 0.72;
}

.chart-svg {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: auto;
  margin-top: 0.4rem;
  overflow: visible;
  cursor: default;
  touch-action: none;
  outline: none;
}

.chart-svg:focus-visible {
  outline: 2px solid #000;
  outline-offset: 6px;
}

.chart-hit {
  fill: transparent;
}

.chart-grid {
  stroke: rgba(0, 0, 0, 0.14);
  stroke-width: 1;
  pointer-events: none;
}

.chart-ytick,
.chart-xtick {
  fill: #000;
  font-size: 13px;
  font-family: "Fa Sans", Helvetica, Arial, sans-serif;
  opacity: 0.55;
  pointer-events: none;
}

.chart-area {
  fill: rgba(0, 0, 0, 0.07);
  pointer-events: none;
}

.chart-line {
  fill: none;
  stroke: #000;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.chart-dot {
  fill: #f5be49;
  stroke: #000;
  stroke-width: 2;
  pointer-events: none;
}

.chart-dot.is-notable {
  stroke-width: 2.3;
}

.chart-rule {
  stroke: #000;
  stroke-width: 1.2;
  opacity: 0;
  pointer-events: none;
}

.chart-active {
  fill: #000;
  stroke: #f5be49;
  stroke-width: 3;
  opacity: 0;
  pointer-events: none;
}

.chart-svg.is-active .chart-rule,
.chart-svg.is-active .chart-active {
  opacity: 1;
}

@media (min-width: 1080px) {
  .home main {
    padding-top: 6.2rem;
  }

  .hero {
    transform: translateY(-40px);
  }

  .stage {
    display: grid;
    grid-template-columns: 22rem minmax(0, 1fr);
    gap: 3.2rem 4.8rem;
    align-items: center;
  }

  .chart-panel {
    margin-top: 0;
    width: 100%;
  }

  .notes {
    grid-column: 2;
    width: 100%;
    margin-top: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .chart-line {
    transition: none !important;
  }
}

.coin {
  width: 17.2rem;
  max-width: 72vw;
}

.coin img {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
}

.price {
  margin-top: 2.1rem;
}

.amount {
  font-weight: 700;
  font-size: clamp(1.45rem, 7.4vw, 3.2rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.fehu {
  display: inline-block;
  width: 0.64em;
  height: 0.95em;
  margin: 0 0.08em -0.08em 0.04em;
  vertical-align: -0.1em;
  overflow: visible;
}

.fehu path {
  fill: none;
  stroke: currentColor;
  stroke-width: 3.35;
  stroke-linecap: butt;
  stroke-linejoin: miter;
}

.price-caption {
  margin-top: 0.45rem;
  font-size: 0.95rem;
  font-weight: 400;
  line-height: 1.35;
  letter-spacing: 0;
  color: rgba(0, 0, 0, 0.48);
}

.price-caption + .price-caption {
  margin-top: 0.12rem;
}

.home:not(.price-ready) .amount,
.chart-readout-value:has([data-readout-price]:empty) {
  visibility: hidden;
}

.notes {
  width: min(58rem, 100%);
  max-width: 100%;
  min-width: 0;
  margin-top: 3.2rem;
  font-size: 1rem;
  line-height: 1.45;
  text-align: left;
  text-wrap: pretty;
}

.notes .block + .block {
  margin-top: 2.6rem;
}

.calc {
  font-size: 16px;
}

.calc-wrap {
  width: min(92rem, calc(100% - 2.4rem));
  margin: 0 auto;
  padding: 2.4rem 0 4rem;
}

.calc-cols {
  display: grid;
  gap: 3.2rem;
}

.calc-intro {
  margin-bottom: 1.4rem;
}

.calc-products {
  font-size: 0.95rem;
}

.product-pair {
  display: grid;
  gap: 1.2rem;
  align-items: stretch;
  border-bottom: 1px solid rgba(0, 0, 0, 0.18);
}

.product-side {
  display: grid;
  grid-template-columns: minmax(5.5rem, 1.2fr) minmax(5rem, 1.3fr) 4.2rem 6.2rem 6.2rem;
  gap: 0.35rem 0.65rem;
  padding: 0.55rem 0;
  align-items: start;
}

.product-side > div {
  min-width: 0;
}

.product-head .product-side {
  font-weight: 700;
}

.product-head .product-side > .num {
  white-space: normal;
}

.product-totals .product-side {
  font-weight: 700;
}

.product-totals {
  border-bottom-width: 2px;
  border-bottom-color: rgba(0, 0, 0, 0.42);
}

.product-label {
  grid-column: 1 / 4;
}

.product-side .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

@media (max-width: 1079px) {
  .home main {
    padding: 0 12px 2.4rem;
    width: 100%;
    overflow-x: hidden;
  }

  .stage-primary {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    width: 100%;
    min-height: 100svh;
    padding: max(1.2rem, env(safe-area-inset-top, 0px)) 0 1.6rem;
  }

  .chart-panel,
  .notes {
    width: 100%;
    max-width: 100%;
    align-self: stretch;
  }

  .chart-panel {
    margin-top: 2.2rem;
  }

  .price-caption {
    font-size: 14px;
  }

  .notes {
    font-size: 18px;
    line-height: 1.5;
    overflow-wrap: break-word;
  }

  .product-side {
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.1fr) 3.6em 5.6em 5.6em;
    gap: 0.3rem 0.45rem;
    font-size: 13px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.18);
  }

  .calc-wrap {
    display: flex;
    flex-direction: column;
  }

  .calc-intro,
  .calc-products,
  .calc-foot,
  .product-pair {
    display: contents;
  }

  .back {
    order: 0;
  }

  .calc-col[lang="sv"],
  .product-side:first-child,
  .meta[lang="sv"] {
    order: 1;
  }

  .calc-col[lang="en"],
  .product-side:last-child,
  .meta[lang="en"] {
    order: 2;
  }

  .calc-col[lang="en"] {
    margin-top: 3.6rem;
    padding-top: 2.8rem;
    border-top: 1px solid rgba(0, 0, 0, 0.18);
  }

  .product-side {
    border-bottom: 1px solid rgba(0, 0, 0, 0.18);
  }

  .product-totals .product-side {
    border-bottom-width: 2px;
    border-bottom-color: rgba(0, 0, 0, 0.42);
  }
}

@media (max-width: 1079px) and (max-height: 620px) {
  .stage-primary {
    min-height: 0;
    justify-content: flex-start;
  }
}

@media (min-width: 1080px) {
  .calc-cols {
    grid-template-columns: 1fr 1fr;
    gap: 0 4rem;
    align-items: start;
  }

  .calc-intro {
    grid-template-rows: auto auto auto auto;
  }

  .calc-intro .calc-col {
    display: grid;
    grid-template-rows: subgrid;
    grid-row: span 4;
  }

  .calc-col[lang="en"],
  .product-side:last-child,
  .calc-foot .meta[lang="en"] {
    padding-left: 2.4rem;
    border-left: 1px solid rgba(0, 0, 0, 0.18);
  }

  .product-pair {
    grid-template-columns: 1fr 1fr;
    gap: 0 4rem;
  }
}

.calc-wrap h1 {
  font-size: 2rem;
  line-height: 1.15;
  margin-bottom: 0.8rem;
}

.calc-wrap .lede,
.calc-wrap .formula {
  line-height: 1.45;
}

.calc-wrap .lede {
  margin-bottom: 1.2rem;
}

.formula {
  font-weight: 700;
  margin: 1rem 0 1.6rem;
}

.formula code {
  font-family: inherit;
}

.table-wrap {
  overflow-x: auto;
  margin: 1.4rem 0 1.8rem;
}

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

th,
td {
  text-align: left;
  padding: 0.55rem 0.7rem;
  vertical-align: top;
  border-bottom: 1px solid rgba(0, 0, 0, 0.18);
}

th {
  font-weight: 700;
  white-space: nowrap;
}

td.num,
th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

th.num {
  white-space: normal;
  max-width: 7.5rem;
}

tbody tr.totals {
  font-weight: 700;
}

.item-note {
  display: block;
  font-size: 0.78rem;
  opacity: 0.75;
  font-weight: 400;
  margin-top: 0.15rem;
}

.meta {
  margin-top: 1rem;
  font-size: 0.78rem;
  line-height: 1.45;
  opacity: 0.62;
}

.back {
  display: inline-block;
  margin-bottom: 1.4rem;
  font-weight: 700;
}

.err {
  margin: 1rem 0;
}
