/* Fonts */

@font-face {
  font-family: 'Pelago';
  font-display: swap;
  font-style: normal;
  font-weight: 400;
  src: url('/assets/private/fonts/pelago-regular-webfont.woff2') format('woff2');
}

@font-face {
  font-family: 'Pelago';
  font-display: swap;
  font-style: normal;
  font-weight: 500;
  src: url('/assets/private/fonts/pelago-medium-webfont.woff2') format('woff2');
}

@font-face {
  font-family: 'Pelago';
  font-display: swap;
  font-style: normal;
  font-weight: 600;
  src: url('/assets/private/fonts/pelago-semibold-webfont.woff2') format('woff2');
}

/* Reset */

*:not(head) {
  margin: 0;
  padding: 0;
  border: 0;
  display: block;
  box-sizing: border-box;
  font-size: 100%;
  font: inherit;
}

ol,
ul {
  list-style: none;
}

a {
  outline: none;
  text-decoration: none;
}

img,
picture,
video,
canvas,
svg {
  max-width: 100%;
}

/* Variables */

@media (prefers-color-scheme: light) {
  :root {
    --brand-base: #f2c11a;
    --brand-strong: #d8aa0c;
    --brand-subtle: #f8df89;
    --brand-accent: #1ab7f2;
    --fg-primary: #050606;
    --fg-secondary: #536767;
    --bg-base: #fafbfb;
    --bg-elevated: #fdfdfd;

    @media (color-gamut: p3) {
      @supports (color: oklch(0 0 0)) {
        --brand-base: oklch(0.8311 0.1757 89.56);
        --brand-strong: oklch(0.7587 0.1658 88.77);
        --brand-subtle: oklch(0.9058 0.1095 93.72);
        --brand-accent: oklch(0.7322 0.168 231.34);
        --fg-primary: oklch(0.1204 0.0025 196.82);
        --fg-secondary: oklch(0.4974 0.024 196.4);
        --bg-base: oklch(0.9873 0.0011 197.14);
        --bg-elevated: oklch(0.994 0 0);
      }
    }
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --brand-base: #f2c11a;
    --brand-strong: #d8aa0c;
    --brand-subtle: #f8df89;
    --brand-accent: #1ab7f2;
    --fg-primary: #fafbfb;
    --fg-secondary: #98adad;
    --bg-base: #081519;
    --bg-elevated: #122e37;

    @media (color-gamut: p3) {
      @supports (color: oklch(0 0 0)) {
        --brand-base: oklch(0.8311 0.1757 89.56);
        --brand-strong: oklch(0.7587 0.1658 88.77);
        --brand-subtle: oklch(0.9058 0.1095 93.72);
        --brand-accent: oklch(0.7322 0.168 231.34);
        --fg-primary: oklch(0.9873 0.0011 197.14);
        --fg-secondary: oklch(0.7315 0.0234 196.65);
        --bg-base: oklch(0.1857 0.0202 219.51);
        --bg-elevated: oklch(0.2838 0.0375 221.61);
      }
    }
  }
}

:root {
  --golden-number: 1.618;

  --size-0: calc(1 / var(--golden-number) * 1rem);
  --size-1: 1rem;
  --size-2: calc((1 + pow(1 / var(--golden-number), 3)) * 1rem);
  --size-3: calc((1 + pow(1 / var(--golden-number), 2)) * 1rem);
  --size-4: calc(var(--golden-number) * 1rem);
  --size-5: calc(pow(var(--golden-number), 2) * 1rem);
  --size-6: calc(pow(var(--golden-number), 3) * 1rem);

  --line-height-0: calc(1 + pow(1 / var(--golden-number), 3));
  --line-height-1: calc(1 + pow(1 / var(--golden-number), 2));
  --line-height-2: var(--golden-number);

  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;

  --border-radius-button: 22px;
  --border-radius-card: 12px;
  --min-height-touch-target: 44px;

  --nav-height: calc(100vh * pow(1 / var(--golden-number), 5));
  --side-padding: calc(100vw * pow(1 / var(--golden-number), 7));

  @media (min-width: 768px) {
    --side-padding: calc(100vw * pow(1 / var(--golden-number), 5));
  }

  --max-width: 1440px;
}

@keyframes expand-answer {
  from {
    line-height: 0;
    padding-top: 0;
    opacity: 0;
  }

  to {
    line-height: var(--line-height-0);
    padding-top: var(--size-0);
    opacity: 100%;
  }
}

@keyframes collapse-answer {
  from {
    line-height: var(--line-height-0);
    padding-top: var(--size-0);
    opacity: 100%;
  }

  to {
    line-height: 0;
    padding-top: 0;
    opacity: 0;
  }
}

/* Styles */

html {
  width: 100vw;
  height: 100vh;
  z-index: 0;
  overflow-x: hidden;
  overflow-y: auto;
  scroll-behavior: smooth;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-family: 'Pelago', 'Helvetica', 'Arial', sans-serif;
  font-size: 10px;
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-0);
  text-wrap: pretty;
  text-rendering: geometricPrecision;
  white-space: wrap;
  vertical-align: middle;

  @media (min-width: 450px) {
    font-size: 12px;
  }

  @media (min-width: 768px) {
    font-size: 14px;
  }

  @media (min-width: 900px) {
    font-size: 16px;
  }
}

a {
  user-select: none;
  -webkit-user-select: none;
  cursor: pointer;
  color: inherit;
  line-height: inherit;
}

a.icon {
  height: auto;
  width: auto;
  max-height: fit-content;
  max-width: fit-content;
}

a.cta {
  min-width: calc(2 * var(--min-height-touch-target));
  min-height: var(--min-height-touch-target);
  padding: 0 var(--size-2);
  display: flex;
  justify-content: center;
  align-items: center;
  border: none;
  border-radius: var(--border-radius-button);
  background-color: var(--brand-base);
  color: var(--fg-primary);
  font-size: var(--size-3);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-0);
  text-align: center;
  text-wrap: nowrap;
  white-space: nowrap;
  @media (min-width: 768px) {
    font-size: var(--size-2);
  }

  @media (prefers-color-scheme: light) {
    box-shadow:
      0.6rem 0.6rem 1rem rgba(0, 0, 0, 0.1),
      -0.6rem -0.6rem 1rem var(--bg-elevated);
  }
}

@media (any-hover: hover) {
  a.cta:hover {
    background-color: var(--brand-strong);
    color: var(--bg-elevated);
  }
}

body {
  width: 100%;
  height: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  background-color: var(--bg-base);
  color: var(--fg-primary);
}

nav,
.coming-soon,
header,
main,
footer {
  width: 100%;
  padding: 0
    max(var(--side-padding), calc((100vw - var(--max-width)) / 2 + var(--side-padding)));
}

nav {
  height: var(--nav-height);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: var(--font-weight-medium);
  background-color: var(--bg-elevated);
  position: fixed;
  top: 0;
  z-index: 5;
  @media (prefers-color-scheme: light) {
    box-shadow: 0 0 3rem rgba(0, 0, 0, 0.1);
  }

  @media (prefers-color-scheme: dark) {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  a:has(img) {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--size-4);
    font-size: var(--size-5);
    font-weight: var(--font-weight-semibold);
    text-wrap: nowrap;
    white-space: nowrap;

    @media (min-width: 768px) {
      font-size: var(--size-4);
    }
  }

  img {
    width: var(--size-5);
    height: var(--size-5);

    @media (min-width: 768px) {
      width: var(--size-4);
      height: var(--size-4);
    }
  }

  ol {
    display: none;
  }
}

@media (min-width: 900px) {
  nav {
    ol {
      display: flex;
      justify-content: space-evenly;
      align-items: center;
      gap: var(--size-3);
      color: var(--fg-secondary);
      font-size: var(--size-2);
      text-wrap: nowrap;
      white-space: nowrap;

      @media (any-hover: hover) {
        a:hover {
          color: var(--brand-accent);
        }
      }
    }
  }
}

.coming-soon {
  margin-top: var(--nav-height);
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: var(--font-weight-semibold);
  background-color: var(--brand-strong);
  color: var(--bg-elevated);
  line-height: var(--line-height-2);
}

header,
section {
  padding-top: var(--nav-height);

  @media (min-width: 900px) {
    padding-top: calc(var(--nav-height) * var(--golden-number));
  }
}

header {
  display: flex;
  flex-direction: column;
  align-items: center;

  .headlines {
    padding: var(--nav-height) 0;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .headlines h1 {
    text-align: center;
    font-size: var(--size-6);
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-2);
  }

  .headlines h1 + p {
    text-align: center;
    font-size: var(--size-4);
    line-height: var(--line-height-2);
  }

  .headlines .cta {
    margin-top: var(--size-4);
    font-size: var(--size-3);
    @media (prefers-color-scheme: light) {
      box-shadow:
        0.6rem 0.6rem 1rem rgba(0, 0, 0, 0.1),
        -0.6rem -0.6rem 1rem var(--bg-base);
    }
  }

  img {
    z-index: 1;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: var(--border-radius-card);
    mask: linear-gradient(var(--bg-base) 76%, transparent 100%);
    overflow: hidden;
    @media (prefers-color-scheme: light) {
      box-shadow:
        1rem 1rem 3rem rgba(0, 0, 0, 0.1),
        -1rem -1rem 3rem var(--bg-base);
    }
  }
}

main {
  display: flex;
  flex-direction: column;

  section {
    display: flex;
    flex-direction: column;
    align-items: center;

    h2 {
      font-size: var(--size-5);
      font-weight: var(--font-weight-medium);
      line-height: var(--line-height-2);
      text-align: center;
    }

    h2 + p {
      text-align: center;
      font-size: var(--size-4);
      line-height: var(--line-height-0);
      color: var(--fg-secondary);
      margin-bottom: calc(var(--nav-height) / var(--golden-number));
    }

    .card-row,
    .card-column {
      display: flex;
      flex-direction: column;
      justify-content: center;
      gap: var(--size-4);
    }

    .card-grid {
      display: grid;
      grid-template-columns: 1fr;
      grid-template-rows: auto;
      gap: var(--size-4);
    }

    @media (min-width: 768px) {
      .card-row {
        flex-direction: row;
      }

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

    .card {
      flex: 1;
      display: flex;
      flex-direction: column;
      background-color: var(--bg-elevated);
      border-radius: var(--border-radius-card);
      z-index: 1;
      @media (max-width: 768px) {
        min-width: calc(pow(var(--golden-number), 7) * 1rem);
      }

      @media (prefers-color-scheme: light) {
        box-shadow:
          1rem 1rem 3rem rgba(0, 0, 0, 0.1),
          -1rem -1rem 3rem var(--bg-base);
      }

      @media (prefers-color-scheme: dark) {
        border: 1px solid rgba(255, 255, 255, 0.1);
      }

      h3 {
        font-size: var(--size-4);
        font-weight: var(--font-weight-medium);
        color: var(--fg-primary);
        line-height: var(--line-height-2);
      }

      p {
        font-size: var(--size-2);
        line-height: var(--line-height-1);
        color: var(--fg-secondary);
      }
    }

    .image.card {
      img {
        width: 100%;
        height: auto;
        border: 1px solid rgba(0, 0, 0, 0.1);
        border-radius: var(--border-radius-card) var(--border-radius-card) 0 0;
        object-fit: cover;
        object-position: center;
        overflow: hidden;
      }

      div {
        padding: var(--size-4);
      }
    }

    .text.card {
      padding: var(--size-4);
    }

    .price.card {
      padding: var(--size-4);
      justify-content: space-between;
      gap: var(--size-4);

      span {
        display: flex;
        align-items: center;
        gap: var(--size-1);
      }

      em {
        font-size: var(--size-5);
      }

      .cta {
        margin-top: var(--size-2);
      }
    }

    .suggested.price.card {
      background-color: var(--brand-subtle);

      @media (prefers-color-scheme: light) {
        .cta {
          box-shadow:
            0.6rem 0.6rem 1rem rgba(0, 0, 0, 0.12),
            -0.6rem -0.6rem 1rem var(--brand-subtle);
        }
      }

      @media (prefers-color-scheme: dark) {
        h3,
        em {
          color: var(--brand-strong);
        }

        p {
          color: var(--bg-elevated);
        }
      }
    }

    .question.card {
      padding: var(--size-4);
      display: grid;
      align-items: center;
      grid-template-areas:
        'toggle question'
        '. answer';
      grid-template-columns: auto 1fr;
      max-width: calc(var(--max-width) / var(--golden-number));
      column-gap: var(--size-4);
      user-select: none;
      -webkit-user-select: none;
      cursor: pointer;

      h3 {
        grid-area: question;
        margin-bottom: 0;
        font-size: var(--size-2);
      }

      p {
        grid-area: answer;
        font-size: var(--size-2);
        overflow: hidden;
      }
    }

    .question.card::before {
      grid-area: toggle;
      content: '+';
      font-size: var(--size-5);
      color: var(--brand-base);
      line-height: 1;
      font-family: monospace;
    }

    .question.card:not([data-expanded]) {
      p {
        line-height: 0;
        padding-top: 0;
        opacity: 0;
        animation: collapse-answer 0.2s cubic-bezier(0, 0, 0, 1);
      }
    }

    .question.card[data-expanded] {
      p {
        line-height: var(--line-height-0);
        padding-top: var(--size-0);
        opacity: 100%;
        animation: expand-answer 0.2s cubic-bezier(0, 0, 0, 1);
      }
    }

    .question.card[data-expanded]::before {
      content: '-';
      color: var(--brand-strong);
    }
  }
}

footer {
  margin-top: calc(2 * var(--nav-height));
  padding-bottom: var(--size-4);
  min-height: calc(100vh * pow(1 / var(--golden-number), 2));
  display: grid;
  align-items: center;
  grid-template-areas:
    'company company social'
    'line line line'
    'legal legal legal'
    'copyright copyright copyright';
  grid-template-columns: 1fr 1fr var(--min-height-touch-target);
  grid-template-rows: 1fr 1px auto auto;
  gap: var(--size-4);
  background-color: var(--bg-elevated);
  z-index: 5;
  @media (prefers-color-scheme: light) {
    box-shadow: 0 0 3rem rgba(0, 0, 0, 0.1);
  }

  @media (prefers-color-scheme: dark) {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }

  @media (min-width: 768px) {
    grid-template-areas:
      'company social'
      'line line'
      'copyright legal';
  }

  .company {
    grid-area: company;

    h2 {
      font-size: var(--size-4);
      font-weight: var(--font-weight-medium);
      line-height: var(--line-height-2);
      color: var(--fg-primary);
    }

    p {
      font-size: var(--size-3);
      line-height: var(--line-height-0);
      color: var(--fg-secondary);
    }
  }

  .social {
    grid-area: social;
    display: flex;
    justify-content: center;

    @media (min-width: 768px) {
      justify-content: flex-end;
    }

    img {
      width: var(--size-4);
      height: var(--size-4);
      opacity: 91%;

      @media (prefers-color-scheme: dark) {
        filter: invert(1);
      }
    }
  }

  hr {
    grid-area: line;
    height: 1px;
    background-color: var(--fg-secondary);
    opacity: 91%;
  }

  .copyright {
    grid-area: copyright;
    display: flex;
    justify-content: center;
    font-size: var(--size-1);
    line-height: 1;
    color: var(--fg-secondary);
    @media (min-width: 768px) {
      justify-content: flex-start;
    }
  }

  .legal {
    grid-area: legal;
    display: flex;
    justify-content: center;
    gap: var(--size-2);
    color: var(--fg-secondary);
    @media (min-width: 768px) {
      justify-content: flex-end;
    }

    @media (any-hover: hover) {
      a:hover {
        color: var(--brand-accent);
      }
    }
  }
}
