/* Adapted from the Symfony CLI Menu Bar website. */

@layer reset, base, bg, topnav, page, content, footer, product;

@property --ring-angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

@layer reset {
  *,
  *::before,
  *::after {
    box-sizing: border-box;
  }
  * {
    margin: 0;
  }
  html {
    color-scheme: light;
    -webkit-text-size-adjust: 100%;
  }
  body {
    min-height: 100vh;
    width: 100vw;
    overflow: hidden;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
  img {
    display: block;
    max-width: 100%;
  }
  a {
    color: inherit;
    text-decoration: none;
  }
  button,
  input {
    font: inherit;
  }
}
@layer base {
  :root {
    --page-bg: oklch(0.994 0.008 80);
    --text: oklch(0.14 0.016 264);
    --text-soft: oklch(0.4 0.01 264);
    --text-faint: oklch(0.58 0.007 264);
    --green: oklch(0.65 0.18 144);
    --blue-mac: oklch(0.47 0.22 252);

    --shadow-btn: 0 1px 1px rgb(0 0 0 / 0.12), 0 4px 16px rgb(0 0 0 / 0.1), inset 0 1px 0 rgb(255 255 255 / 0.16);
    --shadow-soft: 0 1px 2px rgb(0 0 0 / 0.06), 0 4px 16px rgb(0 0 0 / 0.06);

    --pill: 999rem;
    --font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --mono: ui-monospace, "SF Mono", monospace;
    --ease: 150ms ease;

    /* dark-panel shared tokens (popup + submenu) */
    --panel-radius: 0.75rem;
    --panel-pad-x: 1rem;
    --panel-border: oklch(0.32 0.014 264);
    --panel-shadow:
      0 0 0 0.5px oklch(0 0 0 / 0.5), 0 20px 60px oklch(0 0 0 / 0.45), 0 4px 12px oklch(0 0 0 / 0.25),
      inset 0 1px 0 oklch(1 0 0 / 0.07);

    --fs-tiny: 0.66rem;
    --fw-thin: 300;
    --ls-wide: 0.12em;
  }

  html {
    font-family: var(--font);
  }
  body {
    background: var(--page-bg);
    color: var(--text);
  }
}

@layer bg {
  .bg {
    position: fixed;
    inset: -6rem;
    z-index: 0;
    pointer-events: none;
    display: grid;
    place-items: center;
    overflow: hidden;
    filter: blur(4rem);
  }

  .bg__hub {
    position: relative;
    width: 200vmax;
    height: 200vmax;
    animation: bg-spin 110s linear infinite;
    will-change: transform;
  }

  @keyframes bg-spin {
    to {
      transform: rotate(360deg);
    }
  }

  .orb {
    position: absolute;
    border-radius: 50%;
    inline-size: var(--size);
    aspect-ratio: 1;
    background: var(--grad);
    mix-blend-mode: var(--blend);
    contain: strict;
  }
}

@layer topnav {
  .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .topnav {
    position: fixed;
    inset-block-start: 0;
    inset-inline: 0;
    z-index: 100;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.45rem;
    padding: 1.1rem clamp(1.25rem, 2.5vw, 2.5rem);
    pointer-events: none;
    transition: opacity 500ms ease;
  }

  .topnav__btn {
    pointer-events: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5em;
    block-size: 2.75rem;
    inline-size: 2.75rem;
    padding-inline: 0;
    border-radius: var(--pill);
    background: rgb(255 255 255 / 0.52);
    backdrop-filter: blur(14px) saturate(1.8);
    border: 1px solid rgb(255 255 255 / 0.68);
    color: var(--text-soft);
    font-size: 0.82rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    white-space: nowrap;
    box-shadow:
      0 1px 3px rgb(0 0 0 / 0.07),
      inset 0 1px 0 rgb(255 255 255 / 0.72);
    transition:
      background var(--ease),
      transform var(--ease),
      color var(--ease);

    svg {
      display: block;
      flex-shrink: 0;
    }

    &:hover {
      background: rgb(255 255 255 / 0.82);
      color: var(--text);
      transform: translateY(-1px);
    }
  }
}

@layer page {
  .page {
    position: relative;
    z-index: 1;
    min-height: 100dvh;
    display: grid;
    place-items: center;
    padding-block: clamp(5rem, 9vw, 8rem) 5rem;
    padding-inline: clamp(1.5rem, 3vw, 3rem);
    transition: transform 600ms ease;
  }

  .hero {
    width: min(100%, 90rem);
    display: grid;
    grid-template-columns: minmax(18rem, 1fr) minmax(24rem, 1.2fr);
    align-items: center;
    gap: clamp(2rem, 4vw, 6rem);
    transition: gap 600ms ease;
  }
}

@layer content {
  .content {
    justify-self: end;
    max-width: 34rem;
    display: flex;
    flex-direction: column;
  }

  .title {
    font-size: clamp(3.5rem, 6.8vw, 4.5rem);
    line-height: 0.93;
    letter-spacing: -0.042em;
    text-wrap: balance;
    max-width: max-content;
    margin-block-end: 1.875rem;
    transition: margin 500ms ease;

    .t-heavy {
      font-weight: 900;
      display: block;
      white-space: nowrap;
      color: var(--text);
    }

    .t-light {
      font-weight: 300;
      display: flex;
      justify-content: space-between;
      align-items: baseline;
      white-space: nowrap;
      font-size: 0.72em;
      letter-spacing: -0.022em;
      color: var(--text-soft);

      .t-mid {
        font-weight: 200;
        opacity: 0.35;
        font-size: 0.75em;
        align-self: baseline;
      }
    }
  }

  .subtle-link {
    text-decoration: none;
    border-block-end: 1px solid oklch(0.58 0.007 264 / 0.4);
    transition:
      color var(--ease),
      border-color var(--ease);

    &:hover {
      color: var(--text);
      border-block-end-color: var(--text);
    }
  }

  .actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.625rem;
    margin-inline: -5px;
    margin-block-end: 1.5rem;
    align-items: center;
    transition:
      opacity 500ms ease,
      max-height 500ms ease,
      margin 500ms ease;
  }

  @keyframes ring-spin {
    to {
      --ring-angle: 360deg;
    }
  }

  .btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5em;
    min-height: 3.5rem;
    padding-inline: 1.25rem;
    border-radius: var(--pill);
    border: 1px solid transparent;
    font-family: var(--font);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: -0.015em;
    white-space: nowrap;
    cursor: pointer;
    transition:
      transform 400ms ease-out,
      opacity 400ms ease-out,
      border-color 400ms ease-out,
      box-shadow 400ms ease-out,
      background 400ms ease-out;

    &::before {
      content: "";
      position: absolute;
      inset: 1px;
      border-radius: inherit;
      background: linear-gradient(180deg, rgb(255 255 255 / 0.2) 0%, transparent 50%);
      pointer-events: none;
    }

    svg {
      flex-shrink: 0;
      display: block;
    }
    &:hover {
      transform: translateY(-1px);
      transition-duration: 150ms;
    }
    &:active {
      transform: translateY(0);
      opacity: 0.88;
    }
    &:focus-visible {
      outline: 2px solid rgb(99 102 241 / 0.4);
      outline-offset: 2px;
    }

    &.btn--primary {
      color: white;
      background: linear-gradient(180deg, oklch(0.28 0.014 264) 0%, oklch(0.17 0.012 264) 100%);
      border-color: oklch(0.13 0.01 264 / 0.55);
      box-shadow: var(--shadow-btn);
    }

    &.btn--secondary {
      color: var(--text-soft);
      background: linear-gradient(180deg, rgb(255 255 255 / 0.96) 0%, rgb(246 247 250 / 0.9) 100%);
      border-color: rgb(15 23 42 / 0.09);
      box-shadow: var(--shadow-soft);
      &:hover {
        border-color: rgb(15 23 42 / 0.18);
        box-shadow:
          var(--shadow-soft),
          0 0 0 3px rgb(15 23 42 / 0.06);
      }
    }
  }

  .meta {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition:
      opacity 500ms ease,
      max-height 500ms ease,
      margin 500ms ease;
  }

  .disclaimer {
    font-size: 0.84rem;
    line-height: 1.35;
    font-stretch: 70%;
    color: var(--text-faint);
    opacity: 0.75;
    max-width: 26rem;
    text-wrap: pretty;
    margin-block-start: 2rem;
    transition:
      opacity 500ms ease,
      max-height 500ms ease,
      margin 500ms ease;
  }

  .meta-line {
    font-size: 0.78rem;
    color: var(--text-faint);
    letter-spacing: 0.01em;
    text-align: center;

    strong {
      font-weight: 600;
      color: var(--text-soft);
    }

    .subtle-link {
      color: var(--text-faint);
      border-block-end-color: oklch(0.58 0.007 264 / 0.3);
      &:hover {
        color: var(--text-soft);
        border-block-end-color: var(--text-soft);
      }
    }
  }

  .meta-sep {
    display: inline-block;
    margin-inline: 0.5em;
    opacity: 0.4;
  }
}

@layer footer {
  .footer {
    position: fixed;
    inset-inline: 0;
    inset-block-end: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem clamp(1.25rem, 2.5vw, 2.5rem);
    pointer-events: none;
    transition: opacity 500ms ease;
  }

  .footer__left,
  .footer__nav {
    pointer-events: auto;
  }

  .footer__left,
  .footer__link {
    font-size: var(--fs-tiny);
    font-weight: var(--fw-thin);
    font-stretch: semi-condensed;
    letter-spacing: var(--ls-wide);
    text-transform: uppercase;
    color: var(--text-faint);
  }

  .footer__left {
    display: flex;
    align-items: center;
    gap: 0;

    .f-sep {
      margin-inline: 0.5em;
      opacity: 0.4;
    }
  }

  .footer__nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.15rem;
  }

  .footer__link {
    display: inline-flex;
    align-items: center;
    min-height: 1.75rem;
    padding-inline: 0.6rem;
    border-radius: var(--pill);
    transition:
      color var(--ease),
      background var(--ease);

    &:hover {
      color: var(--text-soft);
      background: rgb(255 255 255 / 0.55);
    }
  }
}
