/* Mobile app features and product pages */
.app--calc {
  --app-accent: #4c6140;
  --app-halo: #d1ddaf;
  --app-ring: #71805436;
  --app-shell: #555c51;
  --app-screen: #242b27;
}

.app--study {
  --app-accent: #68419c;
  --app-halo: #e4d5f3;
  --app-ring: #8d6faa38;
  --app-shell: #6f6377;
  --app-screen: #f4edfc;
}

[data-theme="dark"] .app--calc {
  --app-accent: #b8cf9d;
  --app-halo: #35432a;
  --app-ring: #b8cf9d36;
}

[data-theme="dark"] .app--study {
  --app-accent: #d0baf0;
  --app-halo: #3f2e56;
  --app-ring: #d0baf03a;
}

 .app-product-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(0, 1.12fr);
  align-items: center;
  column-gap: clamp(30px, 6vw, 90px);
}

.app-showcase-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(18px, 2.5vw, 32px);
}

.app-showcase-row {
  display: flex;
  flex-direction: column;
  padding: clamp(24px, 3vw, 42px);
  border: 1px solid var(--hairline-strong);
  border-radius: 18px;
  background: var(--surface);
  overflow: hidden;
}

.app-showcase-row > div:first-child {
  display: flex;
  flex-direction: column;
  flex: 1;
  align-items: flex-start;
}

.app-showcase-row .app-device-stage {
  order: -1;
  --device-width: clamp(150px, 16vw, 215px);
  margin-bottom: 25px;
}

.app-showcase-row .app-name {
  font-size: clamp(2.8rem, 4.5vw, 4.8rem);
}

.app-showcase-row .app-actions {
  margin-top: auto;
  padding-top: 24px;
}

.app-kicker {
  color: var(--app-accent);
  font: 500 0.8125rem / 1.5 var(--font-mono);
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.app-name {
  margin-block: 14px 18px;
  font: 400 clamp(3rem, 6.2vw, 6.15rem) / 0.96 var(--font-serif);
  letter-spacing: -0.04em;
}

.app-name em {
  color: var(--app-accent);
}

.app-description {
  max-width: 39ch;
  color: var(--ink-muted);
  font-size: clamp(1rem, 1.55vw, 1.26rem);
  line-height: 1.6;
}

.app-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 23px;
  margin-top: 25px;
}

.app-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 45px;
  padding: 10px 19px;
  border-radius: 100px;
  background: var(--ink);
  color: var(--canvas);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 180ms ease;
}

.app-action:hover {
  background: var(--app-accent);
}

.app-text-link {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 600;
  text-underline-offset: 0.28em;
  text-decoration-color: var(--hairline-strong);
}

.app-text-link:hover {
  text-decoration-color: currentColor;
}

.app-product {
  overflow: clip;
}

.app-product-hero {
  min-height: min(760px, calc(100svh - 80px));
  padding-block: clamp(36px, 6vw, 92px);
}

.app-product-hero .app-name {
  font-size: clamp(3.8rem, 8.3vw, 8.5rem);
}

.app-product-hero .app-description {
  max-width: 35ch;
}

.app-product-footer {
  border-top: 1px solid var(--hairline);
}

.app-product-footer .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 20px;
  padding-block: 16px;
  color: var(--ink-muted);
  font-size: 0.875rem;
}

.app-release-note {
  margin-top: 13px;
  color: var(--ink-muted);
  font-size: 0.875rem;
}

.app-beta {
  margin-top: 29px;
  scroll-margin-top: 96px;
}

.app-beta .app-actions {
  margin-top: 18px;
}

.app-beta .app-release-note {
  margin-top: 0;
}

.app-page-nav .nav-controls {
  gap: clamp(8px, 2vw, 20px);
}

/* The stages and all phone hardware are drawn in CSS. */
.app-device-stage {
  --device-width: clamp(176px, 18.5vw, 246px);
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  min-width: 0;
  padding-block: 25px;
}

.app-product-hero .app-device-stage {
  --device-width: clamp(225px, 24vw, 316px);
}

.app-device-stage::before {
  content: "";
  position: absolute;
  z-index: -2;
  inset: -8% -2%;
  background: radial-gradient(ellipse at 50% 52%, var(--app-halo), transparent 68%);
}

.app-device-stage::after {
  content: "";
  position: absolute;
  z-index: -1;
  width: min(96%, 36rem);
  height: 69%;
  border: 1px solid var(--app-ring);
  border-radius: 50%;
  transform: rotate(-17deg);
}

.app--study .app-device-stage::after {
  transform: rotate(17deg);
}

.app-device {
  position: relative;
  width: min(88%, var(--device-width));
  aspect-ratio: 9 / 18.7;
  padding: 7px;
  border: 1px solid #9b9690;
  border-radius: 14.5% / 7%;
  background: linear-gradient(138deg, #92968b 0%, #242725 13%, #111514 42%, var(--app-shell) 88%, #1d201d);
  box-shadow:
    0 0 0 1px #2c2a2b,
    inset 0 0 0 2px #b2aca75c,
    14px 28px 40px #18181e35,
    3px 7px 13px #18181e45;
  transform: rotate(-7deg);
}

.app--study .app-device {
  transform: rotate(7deg);
}

.app-device::before,
.app-device::after {
  content: "";
  position: absolute;
  width: 3px;
  right: -4px;
  border-radius: 0 2px 2px 0;
  background: linear-gradient(90deg, #232426, var(--app-shell));
}

.app-device::before {
  top: 22%;
  height: 12%;
}

.app-device::after {
  top: 37%;
  height: 7%;
}

.app-device-screen {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  container-type: inline-size;
  border-radius: 12% / 6%;
  background: var(--app-screen);
  color: #e8f0e6;
  font-family: var(--font-sans);
}

.app--study .app-device-screen {
  color: #261d35;
}

.app-device-screen::before {
  content: "";
  position: absolute;
  top: 2.05%;
  left: 50%;
  width: 4.6%;
  aspect-ratio: 1;
  border: 1px solid #090911;
  border-radius: 50%;
  background: radial-gradient(circle at 60% 35%, #3c415f, #121426 46%, #08080d 63%);
  transform: translateX(-50%);
}

.app-device-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4cqw 8cqw 0;
  font-size: 4.4cqw;
  font-weight: 600;
}

.app-device-battery {
  display: block;
  width: 8cqw;
  height: 3.6cqw;
  border: 1px solid currentColor;
  border-radius: 1cqw;
  background: linear-gradient(90deg, currentColor 72%, transparent 72%) center / 85% 65% no-repeat;
}

.app-device-gesture {
  position: absolute;
  left: 31%;
  right: 31%;
  bottom: 2%;
  height: 1cqw;
  border-radius: 6px;
  background: currentColor;
  opacity: 0.58;
}

.calc-preview {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 5cqw 6cqw 8cqw;
  min-height: 0;
}

.calc-preview-display {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-end;
  padding: 6cqw;
  border-radius: 7cqw;
  background: #202621;
  box-shadow: inset 2px 4px 8px #1016119c, inset -2px -2px 5px #6b79642b;
}

.calc-preview-mode {
  align-self: flex-start;
  margin-bottom: auto;
  color: #a9b6a5;
  font: 500 3.8cqw / 1.4 var(--font-mono);
}

.calc-preview-expression {
  color: #b6c1b3;
  font-size: 5.9cqw;
}

.calc-preview-result {
  color: #e4f0d9;
  font: 600 23cqw / 1.05 var(--font-sans);
  letter-spacing: -0.055em;
}

.calc-preview-keys {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: 11cqw;
  gap: 2cqw;
  margin-top: 5cqw;
}

.calc-preview-keys span {
  display: grid;
  place-items: center;
  border-radius: 3cqw;
  background: #303a32;
  font-size: 6.4cqw;
  font-weight: 500;
  line-height: 1;
}

.calc-preview-keys span:nth-child(-n+12) {
  background: #28312a;
  color: #bdd4b3;
  font-size: 5.2cqw;
}

.calc-preview-keys span:nth-child(4n),
.calc-preview-keys span:nth-child(12) {
  color: #d4e9c1;
}

.calc-preview-keys span:nth-last-child(3) {
  grid-column: span 2;
}

.calc-preview-keys span:last-child {
  background: #d0e3b2;
  color: #26351d;
}

.study-preview {
  padding: 6.5cqw 7cqw;
}

.study-preview-brand {
  color: #382650;
  font-size: 8cqw;
  font-weight: 700;
  letter-spacing: -0.045em;
}

.study-preview-brand b {
  color: #6a42a3;
  font-weight: 500;
}

.study-preview-topic {
  display: grid;
  margin-top: 7cqw;
  padding: 7cqw;
  border-radius: 7cqw;
  background: linear-gradient(145deg, #56378b, #372357);
  color: #fcf8ff;
}

.study-preview-topic span,
.study-preview-quiz > span {
  font: 500 4.2cqw / 1.5 var(--font-mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.study-preview-topic strong {
  margin-top: 3cqw;
  font: 400 15cqw / 0.92 var(--font-serif);
}

.study-preview-note {
  display: grid;
  gap: 1.3cqw;
  padding: 7cqw 2cqw;
  font-size: 5.8cqw;
  line-height: 1.42;
}

.study-preview-note span {
  color: #584a66;
}

.study-preview-quiz {
  display: grid;
  gap: 2cqw;
  padding: 6cqw;
  border-radius: 6cqw;
  background: #e7d9f5;
  color: #382650;
  font-size: 5.6cqw;
  line-height: 1.35;
}

.study-preview-quiz > span {
  color: #624390;
}

@media (max-width: 710px) {
  .app-product-hero {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 18px;
  }

  .app-showcase-grid {
    grid-template-columns: 1fr;
  }

  .app-product-hero {
    min-height: 0;
  }

  .app-device-stage {
    --device-width: 180px;
  }

  .app-product-hero .app-device-stage {
    --device-width: clamp(190px, 55vw, 268px);
  }

  .app-device-stage::after {
    width: min(92%, 420px);
  }

  .app-page-nav .nav-container {
    height: 66px;
  }
}

@media (max-width: 380px) {
  .app-page-nav .nav-brand-title {
    display: none;
  }
}
