@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: 16px;
}

html,
body {
  min-height: 100%;
  max-width: 100%;
  overflow-x: hidden;
  background: #ece9e2;
  color: #111110;
}

body {
  font-family: "Fa Sans", Helvetica, Arial, sans-serif;
  -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: stretch;
  padding: max(1.5rem, env(safe-area-inset-top, 0px)) 1.25rem 2.6rem;
  text-align: left;
}

.stage {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

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

.stage-primary {
  display: contents;
}

.chart-panel {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin-top: 2.1rem;
  padding: 1.35rem 1.15rem 1.05rem;
  background: #f7f5f0;
  border: 1px solid rgba(17, 17, 16, 0.08);
  text-align: left;
  user-select: none;
  -webkit-user-select: none;
}

.chart-kicker {
  font-family: "Fraunces", "Times New Roman", serif;
  font-optical-sizing: auto;
  font-weight: 500;
  font-size: 1.55rem;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.chart-kicker-en {
  font-size: 0.88rem;
  font-weight: 400;
  line-height: 1.4;
  opacity: 0.5;
  margin-top: 0.15rem;
}

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

.chart-readout-value {
  font-family: "Fraunces", "Times New Roman", serif;
  font-optical-sizing: auto;
  font-weight: 500;
  font-size: 2rem;
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.chart-readout-meta {
  font-size: 0.88rem;
  opacity: 0.45;
}

.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 #111110;
  outline-offset: 6px;
}

.chart-hit {
  fill: transparent;
}

.chart-grid {
  stroke: rgba(17, 17, 16, 0.1);
  stroke-width: 1;
  pointer-events: none;
}

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

.chart-area {
  fill: rgba(17, 17, 16, 0.05);
  pointer-events: none;
}

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

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

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

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

.chart-active {
  fill: #111110;
  stroke: #ece9e2;
  stroke-width: 2.5;
  opacity: 0;
  pointer-events: none;
}

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

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

.coin {
  width: min(10.125rem, 43.5vw);
  filter: drop-shadow(0 16px 28px rgba(20, 16, 8, 0.16));
}

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

.price {
  margin-top: 1.35rem;
}

.amount {
  font-family: "Fraunces", "Times New Roman", serif;
  font-optical-sizing: auto;
  font-weight: 500;
  font-size: clamp(2.15rem, 9.2vw, 3.05rem);
  line-height: 0.95;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.amount-one {
  font-weight: 700;
}

.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.88rem;
  font-weight: 400;
  line-height: 1.35;
  letter-spacing: 0;
  color: rgba(17, 17, 16, 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;
}

.stack {
  display: none;
}

.calc .stack {
  display: block;
  position: relative;
  height: 6rem;
  overflow: hidden;
}

.calc .stack picture {
  position: absolute;
  inset: 0;
}

.calc .stack img {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 6rem;
  height: 100vw;
  max-width: none;
  object-fit: cover;
  object-position: 50% 20%;
  transform: translate(-50%, -50%) rotate(90deg);
}

@media (max-width: 1279px) {
  .home main {
    padding-bottom: 0;
  }

  .home .stack {
    display: block;
    position: relative;
    order: 10;
    margin: 2rem -1.25rem 0;
    height: 6rem;
    overflow: hidden;
  }

  .home .stack picture {
    position: absolute;
    inset: 0;
  }

  .home .stack img {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 6rem;
    height: 100vw;
    max-width: none;
    object-fit: cover;
    object-position: 50% 20%;
    transform: translate(-50%, -50%) rotate(90deg);
  }
}

.notes {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin-top: 2rem;
  padding-top: 1.6rem;
  border-top: 1px solid rgba(17, 17, 16, 0.12);
  font-size: 0.95rem;
  line-height: 1.5;
  text-align: left;
  text-wrap: pretty;
  color: rgba(17, 17, 16, 0.72);
}

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

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

.notes a {
  color: #111110;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
}

.calc {
  font-size: 16px;
}

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

.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;
}

.delta {
  display: inline-block;
  width: 0.68em;
  height: 0.54em;
  margin-left: 0.35em;
  vertical-align: 0.15em;
  overflow: visible;
}

.delta path {
  fill: currentColor;
}

.delta-up {
  color: #c42b24;
}

.delta-down {
  color: #1d8a45;
}

.delta-flat {
  color: rgba(17, 17, 16, 0.42);
}

.delta-gap {
  visibility: hidden;
}

@media (max-width: 899px) {
  .home .chart-readout {
    margin-top: 0.7rem;
  }

  .home .chart-svg {
    margin-top: 0.55rem;
  }
}

@media (min-width: 560px) and (max-width: 899px) {
  .hero {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    column-gap: 1.5rem;
  }

  .home .price {
    margin-top: 0;
  }
}

@media (min-width: 900px) {
  html {
    font-size: clamp(16px, 1.05vw, 18px);
  }

  .home main {
    min-height: 100vh;
    padding: 3.2rem 4.5rem 4.5rem;
    align-items: stretch;
  }

  .home .stage-primary,
  .home .hero {
    display: contents;
  }

  .home .stage {
    width: min(108rem, 100%);
    display: grid;
    grid-template-columns: minmax(13.5rem, 18rem) minmax(0, 1fr);
    grid-template-areas:
      "coin price"
      "chart chart"
      "notes notes"
      "photo photo";
    column-gap: 1.8rem;
    row-gap: 0.35rem;
    align-items: start;
  }

  .home .coin {
    grid-area: coin;
    width: 18rem;
    max-width: none;
    margin-top: 1.8rem;
    margin-left: -3.4rem;
    filter: drop-shadow(0 22px 40px rgba(20, 16, 8, 0.18));
  }

  .home .price {
    grid-area: price;
    margin-top: 1.8rem;
    margin-left: -3.4rem;
    justify-self: start;
    align-self: center;
    text-align: left;
    padding-top: 0;
  }

  .home .amount {
    font-size: clamp(3.6rem, 6.2vw, 5.6rem);
  }

  .home .price-caption {
    font-size: 0.92rem;
  }

  .home .chart-panel {
    grid-area: chart;
    width: 100%;
    max-width: none;
    margin-top: 2.8rem;
    padding: 2.2rem 2.4rem 1.6rem;
  }

  .home .chart-kicker {
    font-size: 2.1rem;
  }

  .home .chart-kicker-en {
    font-size: 0.95rem;
    margin-top: 0.2rem;
  }

  .home .chart-readout {
    margin-top: 0.85rem;
  }

  .home .chart-readout-value {
    font-size: 2.6rem;
  }

  .home .chart-readout-meta {
    font-size: 0.95rem;
  }

  .home .chart-svg {
    margin-top: 0.8rem;
    width: 100%;
  }

  .home .stack {
    grid-area: photo;
    order: unset;
    margin: 2.4rem -4.5rem 0;
  }

  .home .notes {
    grid-area: notes;
    width: 100%;
    max-width: none;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 4.5rem;
    margin-top: 2.8rem;
    padding-top: 2.2rem;
    font-size: 1.05rem;
    line-height: 1.55;
  }

  .home .notes .block + .block {
    margin-top: 0;
  }

  .home .notes a {
    color: #111110;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.22em;
  }
}

@media (min-width: 1280px) {
  .home main {
    padding: 0 0 0 4.5rem;
    min-height: 100vh;
  }

  .home .stage {
    width: 100%;
    min-height: 100vh;
    grid-template-columns: minmax(13.5rem, 18rem) minmax(0, 1fr) 6rem;
    grid-template-areas:
      "coin price photo"
      "chart chart photo"
      "notes notes photo";
    column-gap: 2.2rem;
    align-items: stretch;
  }

  .home .coin,
  .home .price {
    margin-top: 3.2rem;
  }

  .home .stack {
    display: block;
    position: relative;
    grid-area: photo;
    margin: 0;
    height: auto;
    min-height: 100vh;
    align-self: stretch;
    overflow: hidden;
  }

  .home .stack picture,
  .home .stack img {
    display: block;
    width: 100%;
    height: 100%;
  }

  .home .stack picture {
    position: absolute;
    inset: 0;
  }

  .home .stack img {
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    object-position: 50% 20%;
    transform: none;
  }

  .home .chart-panel {
    margin-top: 2.4rem;
  }

  .home .notes {
    margin-top: 2.4rem;
    margin-bottom: 3.2rem;
  }
}

@media (max-width: 1079px) {
  .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(17, 17, 16, 0.12);
    scroll-margin-top: 1.2rem;
  }

  .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 (min-width: 1080px) {
  .calc-cols {
    grid-template-columns: 1fr 1fr;
    gap: 0 4.8rem;
    align-items: start;
  }

  .calc-intro {
    grid-template-rows: auto auto auto auto;
    margin-bottom: 2.2rem;
  }

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

  .calc-col[lang="sv"],
  .product-side:first-child,
  .calc-foot .meta[lang="sv"] {
    padding-right: 1.2rem;
  }

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

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

.calc-wrap h1 {
  font-family: "Fraunces", "Times New Roman", serif;
  font-optical-sizing: auto;
  font-weight: 500;
  font-size: clamp(1.85rem, 7vw, 2.4rem);
  letter-spacing: -0.035em;
  line-height: 1.08;
  margin-bottom: 0.85rem;
}

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

.calc-wrap .lede {
  margin-bottom: 1.1rem;
  color: rgba(17, 17, 16, 0.72);
}

.formula {
  font-family: "Fraunces", "Times New Roman", serif;
  font-optical-sizing: auto;
  font-weight: 500;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  margin: 1rem 0 1.4rem;
}

.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.82rem;
  line-height: 1.45;
  color: rgba(17, 17, 16, 0.48);
}

.back {
  display: inline-block;
  margin-bottom: 1.6rem;
  font-weight: 400;
  color: rgba(17, 17, 16, 0.5);
  text-decoration: none;
}

.back:hover {
  color: #111110;
}

.err {
  margin: 1rem 0;
}

@media (min-width: 900px) {
  .calc-wrap {
    width: min(108rem, calc(100% - 9rem));
    padding: 3.2rem 0 2.6rem;
  }

  .calc .back {
    margin-bottom: 2.2rem;
  }

  .calc-wrap h1 {
    font-size: clamp(2.4rem, 4vw, 3.4rem);
    margin-bottom: 1rem;
  }

  .calc-wrap .lede {
    font-size: 1.05rem;
    line-height: 1.55;
  }

  .calc .formula {
    font-size: 1.12rem;
    margin: 1.2rem 0 1.4rem;
  }

  .calc .product-pair {
    border-bottom-color: rgba(17, 17, 16, 0.1);
  }

  .calc .product-head .product-side {
    font-weight: 400;
    font-size: 0.72rem;
    line-height: 1.25;
    color: rgba(17, 17, 16, 0.48);
  }

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

  .calc .product-side > div:first-child {
    white-space: nowrap;
  }

  .calc .product-totals {
    border-bottom-color: rgba(17, 17, 16, 0.22);
  }

  .calc .product-totals .product-side {
    font-family: "Fraunces", "Times New Roman", serif;
    font-weight: 500;
  }

  .calc .product-totals .product-side > div:first-child {
    white-space: normal;
  }

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

@media (min-width: 1080px) {
  .calc-cols {
    gap: 0;
  }

  .calc-products {
    background: #f7f5f0;
    border: 1px solid rgba(17, 17, 16, 0.08);
    padding: 0.2rem 1.1rem 0.4rem;
    margin-top: 0.4rem;
  }

  .calc .product-side {
    grid-template-columns: minmax(6.5rem, 1.15fr) minmax(5.5rem, 1fr) 4rem 5.4rem 5.6rem;
    gap: 0.3rem 0.55rem;
  }

  .calc .product-head {
    border-bottom-color: rgba(17, 17, 16, 0.12);
  }

  .calc .product-head .product-side {
    padding-top: 0.85rem;
    padding-bottom: 0.7rem;
  }
}
