/*
MIT License

Copyright (c) 2025 Spell UI

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/

@font-face {
  font-family: "SB Sans Display";
  src: url("deslop/fonts/SBSansDisplay-SemiBold.woff2") format("woff2");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --site-page-container-width: min(100%, 1280px);
  --site-page-pad: clamp(48px, 4.6875vw, 60px);
  --font-display: "SB Sans Display", system-ui, sans-serif;
  background: #000;
  color: var(--primary);
  font-family: var(--ui-font-interface);
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
}

.hero {
  display: flex;
  box-sizing: border-box;
  flex-direction: column;
  align-items: center;
  inline-size: var(--site-page-container-width);
  block-size: 100svh;
  margin-inline: auto;
  overflow-x: clip;
  padding-block-end: calc(80px + env(safe-area-inset-bottom));
  padding-inline: var(--site-page-pad);
  text-align: center;
}

.hero-icon {
  display: block;
  margin-block-end: var(--ui-space-24);
}

.hero-demo {
  position: relative;
  inline-size: min(100%, 26rem, max(12rem, calc(90svh - 25rem)));
  min-block-size: 0;
  aspect-ratio: 1;
  margin-block-end: var(--ui-space-24);
  overflow-y: clip;
}

.hero-demo video {
  display: block;
  position: absolute;
  inset: 0;
  inline-size: 100%;
  block-size: 100%;
  object-fit: contain;
  object-position: center top;
  transform: scale(1.3);
  transform-origin: center bottom;
}

.hero-demo::after {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  block-size: 60%;
  background: linear-gradient(to bottom, #000, transparent);
  pointer-events: none;
}

.hero-copy {
  display: flex;
  flex: none;
  flex-direction: column;
  align-items: center;
  max-inline-size: 100%;
}

.hero :is(h1, p) {
  max-inline-size: min(100%, 26rem);
  text-wrap: balance;
}

.hero h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: calc(var(--ui-title-24-font-size) + 2px);
  font-weight: 600;
  line-height: calc((var(--ui-title-24-line-height) + 4px) * 1.1 * 0.9);
  letter-spacing: var(--ui-title-24-letter-spacing);
}

.hero p {
  margin: var(--ui-space-12) 0 0;
  color: var(--primary-60);
  font-size: var(--ui-body-font-size);
  font-weight: var(--ui-body-font-weight);
  line-height: 1.4;
}

@media (width < 900px), (max-height: 500px) and (pointer: coarse) {
  :root {
    --site-page-container-width: min(100%, 620px);
    --site-page-pad: max(var(--ui-space-24), env(safe-area-inset-left), env(safe-area-inset-right));
  }

  .hero {
    block-size: auto;
    min-block-size: 100dvh;
    padding-block-end: max(var(--ui-space-32), env(safe-area-inset-bottom));
  }

  .hero-demo {
    flex: 1 0 0;
    inline-size: calc(100% + 2 * var(--site-page-pad));
    min-block-size: min(8rem, 20dvh);
    aspect-ratio: auto;
  }

  .hero-demo video {
    object-position: center bottom;
    transform: scale(1.4);
  }
}

@media (width < 900px) and (height <= 600px), (max-height: 500px) and (pointer: coarse) {
  .hero-demo,
  .hero-icon {
    margin-block-end: var(--ui-space-16);
  }

  .hero-icon {
    inline-size: 48px;
    block-size: 48px;
  }

  .hero .hero-cta {
    margin-block-start: var(--ui-space-16);
  }
}

@media (width >= 900px) and ((height > 500px) or (pointer: fine)) {
  .hero-demo {
    inline-size: min(100%, calc(26rem * 1.5));
  }
}

/* Pop Button adapted from Spell UI: https://spell.sh/docs/pop-button */
.hero-cta {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  block-size: 48px;
  gap: var(--ui-space-8);
  margin-block-start: var(--ui-space-32);
  padding: var(--ui-space-8) var(--ui-space-16);
  border: 2px solid oklch(0.439 0 0);
  border-block-end-width: 4px;
  border-radius: var(--ui-radius-14);
  background: oklch(0.269 0 0);
  color: oklch(0.97 0 0);
  font-family: var(--ui-font-interface);
  font-size: var(--ui-body-font-size);
  font-weight: 600;
  line-height: 1.5;
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transform-origin: bottom;
  transition: background-color 150ms cubic-bezier(0.4, 0, 0.2, 1),
    border-block-end-width 150ms cubic-bezier(0.4, 0, 0.2, 1),
    scale 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.hero-cta:hover {
  background: oklch(0.371 0 0);
}

.hero-cta:focus-visible {
  outline: 2px solid var(--white);
  outline-offset: var(--ui-space-2);
}

.hero-cta:active {
  border-block-end-width: 2px;
  scale: 1 0.95;
}

.hero-cta-icon {
  inline-size: 20px;
  block-size: 20px;
  flex: none;
  background: currentColor;
  -webkit-mask: url("assets/apple.svg") center / contain no-repeat;
  mask: url("assets/apple.svg") center / contain no-repeat;
}

@media (prefers-reduced-motion: reduce) {
  .hero-cta {
    transition: none;
  }

  .hero-cta:active {
    scale: 1;
  }
}
