/* Shared by the landing page and the static pages (About, Privacy, Terms). */

/* Self-hosted Nunito (variable weight, upright only), so text renders without waiting for Google Fonts. */
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 200 1000;
  font-display: swap;
  src: url('/assets/fonts/nunito-latin.woff2') format('woff2');
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC,
    U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 200 1000;
  font-display: swap;
  src: url('/assets/fonts/nunito-latin-ext.woff2') format('woff2');
  unicode-range:
    U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F,
    U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Tokens copied from the app's styles.scss, so the page follows the system theme like the app's System mode. */
:root {
  color-scheme: light dark;

  --font-family: 'Nunito';
  --border-radius: 1rem;
  --border-radius-sm: 0.5rem;
  --border-radius-lg: 1.25rem;

  --color-background-panel: light-dark(#dddfe3, #2a2a36);
  --color-background-content: light-dark(#d2d4da, #20212d);
  --color-background-column: light-dark(#c7c9d1, #1d1d28);
  --color-background-app: light-dark(#c5c7cf, #181922);
  --color-background-tile: light-dark(#d3d5db, #20212d);
  --color-accent: #7e7cc7;
  --color-accent-2: #eb625e;
  --color-accent-3: #de874b;
  --color-accent-4: #bcc3db;
  --color-accent-5: light-dark(#3b5a4a, #86b099);
  --color-sick: light-dark(#4f8fb0, #6fb0d0);
  --color-text: light-dark(#2e2f34, #dedede);
  --color-text-alt: light-dark(#ffffff, #20212d);
  --color-sub-text: light-dark(#6b6e7d, #7b8191);
  --color-border-panel: light-dark(#b5b7c0, #383945);
  --color-border-panel-2: light-dark(rgb(181 183 192 / 0.5), rgb(255 255 255 / 0.1));
  --color-border-hover: light-dark(#847ea6, #ada9bb);
  --color-button-secondary-bg: light-dark(rgb(126 124 199 / 0.12), rgb(126 124 199 / 0.15));
  --color-button-secondary-text: var(--color-accent);
  --color-button-secondary-border: light-dark(rgb(126 124 199 / 0.3), rgb(126 124 199 / 0.25));
  --color-button-transparent-text: light-dark(var(--color-text), #b0b3c1);
  --color-button-transparent-border: light-dark(var(--color-border-panel), rgb(255 255 255 / 0.12));
  --color-button-transparent-bg-hover: light-dark(rgb(0 0 0 / 0.05), rgb(255 255 255 / 0.07));
  --color-button-transparent-border-hover: light-dark(var(--color-border-hover), rgb(255 255 255 / 0.2));
  --color-background-summary: light-dark(#bdc0c9, #363746);
  --color-border-summary: light-dark(var(--color-border-panel), rgb(255 255 255 / 0.18));

  --activity-level-0: light-dark(#cbcdd5, #363746);
  --activity-level-1: light-dark(#c3c2e8, #4a4880);
  --activity-level-2: light-dark(#a3a1dc, #6260a8);
  --work-hours-target: light-dark(#4f9a72, #6fa587);

  --code-bg: light-dark(#f4f5f7, #1d1e29);
  --code-header-bg: light-dark(#e9eaee, #262735);
  --code-border: light-dark(#c7c9d1, rgb(255 255 255 / 0.08));
  --code-text: light-dark(#383a42, #f8f8f2);
  --code-comment: light-dark(#a0a1a7, #6272a4);
  --code-keyword: light-dark(#a626a4, #8be9fd);
  --code-function: light-dark(#4078f2, #f1fa8c);
  --code-string: light-dark(#50a14f, #50fa7b);
  --code-font: ui-monospace, 'SFMono-Regular', 'JetBrains Mono', Menlo, Consolas, monospace;

  --page-width: 72rem;
}

* {
  box-sizing: border-box;
}

html {
  scroll-padding-top: 5rem;
}

/* Set once the page has loaded, so arriving at /#pricing jumps there and only in-page links glide. */
html.smooth-scroll {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background-color: var(--color-background-app);
  color: var(--color-text);
  font-family: var(--font-family), sans-serif;
  font-size: 1rem;
  line-height: 1.5;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

a {
  color: var(--color-accent);
  text-decoration: none;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

svg.icon {
  width: 1em;
  height: 1em;
  flex: none;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.wrap {
  width: 100%;
  max-width: var(--page-width);
  margin-inline: auto;
  padding-inline: 1.5rem;
}

/* Buttons, as app-button */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  padding: 0.5em 1em;
  border: 1px solid var(--color-border-panel);
  border-radius: 30px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: bold;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background-color 0.2s ease-in-out,
    border 0.2s ease-in-out,
    outline-color 0.25s ease-in-out;

  &:hover {
    outline: 1px solid var(--color-border-hover);
    outline-offset: 1px;
  }

  &.button--danger {
    border-color: var(--color-accent-2);
    background-color: var(--color-accent-2);
    color: var(--color-text-alt);
  }

  &.button--primary {
    background-color: var(--color-accent);
    color: var(--color-text);
  }

  &.button--secondary {
    border-color: var(--color-button-secondary-border);
    background-color: var(--color-button-secondary-bg);
    color: var(--color-button-secondary-text);
  }

  &.button--transparent {
    border-color: var(--color-button-transparent-border);
    background-color: transparent;
    color: var(--color-button-transparent-text);

    &:hover {
      border-color: var(--color-button-transparent-border-hover);
      background-color: var(--color-button-transparent-bg-hover);
    }
  }

  &.button--large {
    padding: 0.8em 1.6em;
    font-size: 1.0625rem;
  }

  &.button--small {
    padding: 0.25em 0.875em;
    font-size: 0.9375rem;
  }
}

/* Badges, as app-badge */
.badge {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 0.25rem;
  padding: 0.125rem 0.5rem;
  border-radius: 100vw;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;

  &.badge--accent {
    background-color: var(--color-button-secondary-bg);
    color: var(--color-accent);
  }

  &.badge--danger {
    background-color: color-mix(in srgb, var(--color-accent-2) 18%, transparent);
    color: var(--color-accent-2);
  }

  &.badge--vacation {
    background-color: color-mix(in srgb, var(--color-accent-3) 18%, transparent);
    color: var(--color-accent-3);
  }

  &.badge--sick {
    background-color: color-mix(in srgb, var(--color-sick) 18%, transparent);
    color: var(--color-sick);
  }

  &.badge--neutral {
    background-color: color-mix(in srgb, var(--color-sub-text) 16%, transparent);
    color: var(--color-sub-text);
  }

  &.badge--pro {
    background-color: var(--color-accent);
    color: #ffffff;
    font-weight: 800;
    letter-spacing: 0.04em;
  }
}

.dot {
  flex: none;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
}

.eyebrow {
  color: var(--color-accent);
  font-size: 0.8125rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  /* No backdrop blur: with the dots and clocks animating beneath, browsers let the content flicker through it. */
  background-color: color-mix(in srgb, var(--color-background-app) 92%, transparent);
  border-bottom: 1px solid var(--color-border-panel-2);

  .wrap {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    height: 4rem;
  }
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--color-text);
  font-size: 1.25rem;
  font-weight: 800;

  svg {
    width: 2rem;
    height: 2rem;
  }
}

.site-nav {
  display: flex;
  gap: 1.25rem;
  margin-right: auto;

  a {
    color: var(--color-sub-text);
    font-weight: 700;
    white-space: nowrap;
    transition: color 150ms ease;

    &:hover,
    &.is-current {
      color: var(--color-text);
    }

    &.is-current {
      /* Longhands, since Safari ignores the thickness and color in the text-decoration shorthand. */
      text-decoration-line: underline;
      text-decoration-thickness: 2px;
      text-decoration-color: var(--color-accent);
      text-underline-offset: 0.4rem;
    }
  }
}

.site-header__actions {
  display: flex;
  margin-left: auto;
  align-items: center;
  gap: 0.5rem;
}

/* Footer */
.site-footer {
  padding-block: 2.5rem 3rem;
  border-top: 1px solid var(--color-border-panel-2);
  color: var(--color-sub-text);
  font-size: 0.9375rem;

  .wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
  }

  nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.25rem;
  }

  .site-footer__profiles {
    display: flex;
    gap: 1rem;
  }

  .site-footer__profile svg {
    display: block;
    width: 1.25rem;
    height: 1.25rem;
    fill: currentColor;
  }

  a {
    color: var(--color-sub-text);

    &:hover,
    &[aria-current='page'] {
      color: var(--color-text);
    }

    &[aria-current='page'] {
      /* Longhands, since Safari ignores the thickness and color in the text-decoration shorthand. */
      text-decoration-line: underline;
      text-decoration-thickness: 2px;
      text-decoration-color: var(--color-accent);
      text-underline-offset: 0.4rem;
    }
  }
}

/* The person icon only shows on phones, where the label makes room for the section title. */
.site-header__sign-in svg {
  display: none;
  flex: none;
  width: 1.125rem;
  height: 1.125rem;
}

/* The full nav, Sign in and Try Pro need about 775px, so narrower screens get the phone header. */
@media (width <= 820px) {
  .site-nav {
    display: none;
  }

  .site-header__actions {
    gap: 0.375rem;
  }

  /* The account icon sits in the corner, where the app keeps the profile button. */
  .site-header__sign-in {
    order: 1;
    width: 2.125rem;
    height: 2.125rem;
    padding: 0;

    svg {
      display: block;
    }

    span {
      display: none;
    }
  }
}

@media (width <= 700px) {
  .site-footer {
    .wrap {
      flex-direction: column-reverse;
      gap: 0.75rem;
    }

    nav {
      justify-content: center;
    }
  }
}

/* About, Privacy and Terms */
.prose {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 46rem;
  margin-inline: auto;
  padding-block: 3.5rem 5rem;
  line-height: 1.65;

  h1 {
    margin-bottom: 0.5rem;
    font-size: clamp(2rem, 4.2vw, 2.5rem);
    font-weight: 900;
    line-height: 1.15;
  }

  h2 {
    margin-top: 1.25rem;
    font-size: 1.25rem;
    font-weight: 800;
  }

  p,
  li {
    color: var(--color-sub-text);
  }

  .prose__lead {
    color: var(--color-text);
    font-size: 1.1875rem;
  }

  strong {
    color: var(--color-text);
  }

  ul {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    padding-left: 1.25rem;
    list-style: disc;
  }

  a {
    text-decoration: underline;
    text-underline-offset: 0.2em;
  }
}
