*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --font-sans: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'SF Pro Display', system-ui, sans-serif;
}

html {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.home-page,
body.download-page {
  --home-edge: 59px;
  --home-top: 48px;
  --home-bottom: 30px;
  --home-logo-width: 62px;
  --home-logo-height: 21px;
  --home-logo-top: 4px;
  --home-tagline-width: 385px;
  --home-tagline-size: 18px;
  --home-tagline-top: 12px;
  --home-download-height: 37px;
  --home-download-y: 2px;
  --home-download-x: 15px;
  --home-download-gap: 10px;
  --home-download-radius: 7px;
  --home-download-font: 13px;
  --home-download-icon: 12px;
  --home-preview-width: min(74.025vw, 1066px);
  --home-preview-safe-gap: clamp(4px, 0.6vh, 12px);
  --home-preview-lift: clamp(-22px, calc(640px - 100svh), 0px);
  --home-preview-offset: clamp(36px, 6vh, 72px);
  --home-footer-right: 19px;
  --home-footer-bottom: 30px;
  --home-footer-link-width: 98px;
  --home-footer-link-height: 32px;
  width: 100%;
  height: 100svh;
  min-height: 100svh;
  overflow: hidden;
  overscroll-behavior: none;
  background-color: #f6f6f6;
  background-image: url('/images/soba-back.jpg');
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  color: #000000;
  font-family: var(--font-sans);
}

.home-shell {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: 100%;
  height: 100svh;
  min-height: 100svh;
  overflow: hidden;
  margin: 0 auto;
  padding: var(--home-top) var(--home-edge) var(--home-bottom);
  row-gap: var(--home-preview-safe-gap);
}

.home-header {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  gap: 24px;
}

.home-wordmark {
  grid-column: 1;
  grid-row: 1;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  width: var(--home-logo-width);
  height: var(--home-logo-height);
  margin-top: var(--home-logo-top);
}

.home-wordmark:hover {
  opacity: 0.7;
}

.home-wordmark img {
  display: block;
  width: 100%;
  height: 100%;
}

.home-header h1 {
  grid-column: 2;
  grid-row: 1;
  justify-self: center;
  width: min(100%, var(--home-tagline-width));
  margin: var(--home-tagline-top) 0 0;
  font-size: var(--home-tagline-size);
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0;
  text-align: center;
  white-space: nowrap;
}

.download-button {
  display: inline-flex;
  align-items: center;
  gap: var(--home-download-gap);
  min-height: var(--home-download-height);
  padding: var(--home-download-y) var(--home-download-x);
  border-radius: var(--home-download-radius);
  background: #99ff00;
  color: #000000;
  font-size: var(--home-download-font);
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
}

.home-header .download-button {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
}

.download-button:hover {
  background: #8dee00;
}

.download-button:focus-visible {
  outline: 2px solid #000000;
  outline-offset: 3px;
}

.download-button img {
  display: block;
  width: var(--home-download-icon);
  height: var(--home-download-icon);
}

.app-preview {
  position: relative;
  z-index: 1;
  grid-row: 2;
  justify-self: center;
  align-self: center;
  display: block;
  width: var(--home-preview-width);
  height: 100%;
  max-height: 100%;
  margin: 0;
  text-decoration: none;
  transform: translateY(var(--home-preview-lift));
}

.app-preview:focus-visible {
  outline: 2px solid #000000;
  outline-offset: 8px;
  border-radius: 16px;
}

.app-preview img {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0 auto;
  object-fit: contain;
}

.home-links {
  position: absolute;
  z-index: 2;
  right: var(--home-footer-right);
  bottom: var(--home-footer-bottom);
  display: flex;
  align-items: center;
}

.home-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--home-footer-link-width);
  min-height: var(--home-footer-link-height);
  color: #9f9f9f;
  font-size: var(--home-download-font);
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0;
  text-align: center;
  text-decoration: none;
}

.home-links a:hover {
  color: #000000;
}

.download-shell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100svh;
  max-width: 560px;
  margin: 0 auto;
  padding: 48px 24px;
  text-align: center;
}

.download-wordmark {
  margin: 0 0 36px;
}

.download-shell h1 {
  margin-bottom: 12px;
  font-size: 24px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0;
}

.download-shell p {
  max-width: 430px;
  margin-bottom: 28px;
  color: #666666;
  font-size: 15px;
  line-height: 1.5;
}

.download-shell .download-button {
  justify-self: auto;
}

@media (max-width: 1024px) {
  body.home-page,
  body.download-page {
    --home-edge: 5.762vw;
    --home-top: 4.688vw;
    --home-bottom: 2.93vw;
    --home-logo-width: 6.055vw;
    --home-logo-height: 2.051vw;
    --home-logo-top: 0.391vw;
    --home-tagline-width: 37.598vw;
    --home-tagline-size: 1.758vw;
    --home-tagline-top: 1.172vw;
    --home-download-height: 3.613vw;
    --home-download-y: 0.195vw;
    --home-download-x: 1.465vw;
    --home-download-gap: 0.977vw;
    --home-download-radius: 0.684vw;
    --home-download-font: 1.27vw;
    --home-download-icon: 1.172vw;
    --home-preview-width: 74.025vw;
    --home-preview-safe-gap: clamp(4px, 0.586vw, 12px);
    --home-preview-lift: clamp(-2.148vw, calc(62.5vw - 100svh), 0px);
    --home-preview-offset: 6vw;
    --home-footer-right: 1.855vw;
    --home-footer-bottom: 2.93vw;
    --home-footer-link-width: 9.57vw;
    --home-footer-link-height: 3.125vw;
  }
}

@media (max-width: 800px) {
  body.home-page,
  body.download-page {
    --home-edge: 24px;
    --home-top: 32px;
    --home-bottom: 28px;
    --home-logo-width: 58px;
    --home-logo-height: 20px;
    --home-logo-top: 0;
    --home-tagline-width: min(420px, calc(100vw - 48px));
    --home-tagline-size: 16px;
    --home-tagline-top: 0;
    --home-download-height: 34px;
    --home-download-y: 2px;
    --home-download-x: 14px;
    --home-download-gap: 8px;
    --home-download-radius: 7px;
    --home-download-font: 12px;
    --home-download-icon: 11px;
    --home-preview-width: 97.2vw;
    --home-preview-offset: clamp(76px, 10.8vw, 92px);
    --home-footer-right: 0;
    --home-footer-bottom: 24px;
    --home-footer-link-width: 104px;
    --home-footer-link-height: 32px;
  }

  .home-shell {
    display: flex;
    flex-direction: column;
    row-gap: 0;
  }

  .home-header {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 18px;
  }

  .home-wordmark,
  .home-header .download-button,
  .home-header h1 {
    grid-column: auto;
    grid-row: auto;
    justify-self: center;
  }

  .home-header h1 {
    width: var(--home-tagline-width);
    line-height: 1.2;
    white-space: normal;
  }

  .app-preview {
    position: static;
    z-index: auto;
    align-self: center;
    height: auto;
    max-height: none;
    margin: auto 0;
    transform: translateY(var(--home-preview-offset));
  }

  .app-preview img {
    width: 100%;
    height: auto;
    max-height: none;
    object-fit: initial;
    object-position: initial;
  }

  .home-links {
    position: static;
    justify-content: center;
    margin-top: 42px;
  }
}

@media (max-width: 520px) {
  body.home-page,
  body.download-page {
    --home-edge: 20px;
    --home-top: 28px;
    --home-preview-width: 97.2vw;
    --home-preview-offset: clamp(38px, 7.2vw, 49px);
  }

  .home-links {
    margin-top: 30px;
  }
}
