/* Homepage only. The shared shell owns navigation, typefaces, and brand tokens. */
@property --hp-point-x {
  syntax: '<percentage>';
  inherits: true;
  initial-value: 72.7273%;
}

@property --hp-point-y {
  syntax: '<percentage>';
  inherits: true;
  initial-value: 18.75%;
}

.home-marketing {
  --hp-gutter: clamp(1rem, 4.5vw, 4.5rem);
  --hp-radius: .625rem;
  --hp-stage: #1b1717;
  --hp-stage-ink: #f5f2f2;
  --hp-stage-muted: #d5caca;
  color: var(--emh-ink);
}

.home-marketing .hp-wrap {
  width: min(1320px, calc(100% - var(--hp-gutter) * 2));
  margin-inline: auto;
}

.home-marketing :is(h1, h2, h3, p, figure) { margin: 0; }

.home-marketing p { font-size: 1rem; line-height: 1.65; }

.home-marketing .hp-section-title {
  font-size: clamp(2.15rem, 4.6vw, 4.75rem);
  font-weight: 700;
  letter-spacing: -.068em;
  line-height: .99;
  text-wrap: balance;
}

.home-marketing .hp-hero {
  display: grid;
  grid-template-columns: minmax(0, .87fr) minmax(0, 1.13fr);
  align-items: center;
  gap: clamp(1.75rem, 4.1vw, 4rem);
  padding-block: clamp(2rem, 4.9vw, 4.5rem);
}

.home-marketing .hp-hero .hp-hero-title {
  max-width: 8ch;
  font-size: clamp(3rem, 7.65vw, 7rem);
  font-weight: 700;
  letter-spacing: -.087em;
  line-height: .91;
}

.home-marketing .hp-hero-title em {
  color: var(--emh-primary-text);
  font-style: normal;
}

.home-marketing .hp-hero-copy > p {
  max-width: 42ch;
  margin-top: clamp(1.125rem, 2.15vw, 1.75rem);
  color: var(--emh-muted);
  font-size: clamp(1rem, 1.55vw, 1.25rem);
}

.home-marketing .hp-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem clamp(.75rem, 2.25vw, 2rem);
  margin-top: clamp(1.125rem, 2.4vw, 2rem);
}

.home-marketing .hp-actions > .emh-ui { display: contents; }

.home-marketing .hp-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: .7rem clamp(.85rem, 1.65vw, 1.35rem);
  border: 1px solid transparent;
  border-radius: var(--hp-radius);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.25;
}

.home-marketing .hp-actions .hp-primary-action {
  background: var(--emh-primary);
  color: var(--emh-primary-label);
  text-decoration: none;
}

.home-marketing .hp-actions .hp-secondary-action {
  padding-inline: .125rem;
  color: var(--emh-ink);
  text-decoration: underline;
  text-underline-offset: .28em;
}

.home-marketing .hp-actions a:hover { text-decoration: underline; }

.home-marketing .hp-board {
  --hp-axis-x: 36.3636%;
  --hp-axis-y: 87.5%;
  --hp-point-x: 72.7273%;
  --hp-point-y: 18.75%;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 0;
  padding: clamp(.85rem, 1.8vw, 1.5rem);
  border: 1px solid color-mix(in srgb, var(--emh-primary-text) 25%, transparent);
  border-radius: var(--hp-radius);
  background-color: var(--emh-brand-surface);
  color: var(--emh-brand-label);
}

.home-marketing .hp-board-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem 1rem;
  position: relative;
  z-index: 1;
  font-size: .8125rem;
  font-weight: 600;
}

.home-marketing math { font-family: KaTeX_Main, math; }

.home-marketing .hp-board-caption math { font-size: clamp(.95rem, 1.55vw, 1.2rem); }

.home-marketing .hp-board-art {
  position: relative;
  width: 100%;
  aspect-ratio: 1.3;
  min-height: 12.5rem;
  margin-block: .5rem .375rem;
}

.home-marketing .hp-plot {
  position: absolute;
  inset: 7% 8% 7% 4%;
  background-image:
    linear-gradient(to right, color-mix(in srgb, currentColor 18%, transparent) 1px, transparent 1px),
    linear-gradient(to bottom, color-mix(in srgb, currentColor 18%, transparent) 1px, transparent 1px);
  background-size: calc(100% / 11) calc(100% / 16);
  font: 400 clamp(.7rem, 1.2vw, .9rem)/1 var(--emh-font-mono);
}

.home-marketing .hp-axis {
  position: absolute;
  display: block;
  background-color: currentColor;
}

.home-marketing .hp-axis-x { top: var(--hp-axis-y); inset-inline: 0; height: 1px; }
.home-marketing .hp-axis-y { left: var(--hp-axis-x); inset-block: 0; width: 1px; }

.home-marketing .hp-axis::before {
  content: '';
  position: absolute;
  width: .42em;
  height: .42em;
  border-top: 1px solid;
  border-right: 1px solid;
}

.home-marketing .hp-axis-x::before { right: 0; top: 50%; transform: translateY(-50%) rotate(45deg); }
.home-marketing .hp-axis-y::before { top: 0; left: 50%; transform: translateX(-50%) rotate(-45deg); }
.home-marketing .hp-axis-x > span { position: absolute; left: calc(100% + .5em); top: -.55em; }
.home-marketing .hp-axis-y > span { position: absolute; bottom: calc(100% + .12em); left: .42em; }
.home-marketing .hp-origin { position: absolute; left: calc(var(--hp-axis-x) - 1.1em); top: calc(var(--hp-axis-y) + .48em); }

.home-marketing .hp-tick-x,
.home-marketing .hp-tick-y { position: absolute; }

.home-marketing .hp-tick-x { top: calc(var(--hp-axis-y) + .48em); transform: translateX(-50%); }
.home-marketing .hp-tick-two { left: 54.5455%; }
.home-marketing .hp-tick-four { left: 72.7273%; }
.home-marketing .hp-tick-y { right: calc(100% - var(--hp-axis-x) + .4em); transform: translateY(-50%); }
.home-marketing .hp-tick-five { top: 56.25%; }
.home-marketing .hp-tick-ten { top: 25%; }

.home-marketing .hp-plot-line,
.home-marketing .hp-plot-line::before { position: absolute; inset: 0; }

.home-marketing .hp-plot-line::before {
  content: '';
  background-color: currentColor;
  clip-path: polygon(13.3% 100%, 14% 100%, 86.7% 0, 86% 0);
}

.home-marketing .hp-plot-guide { position: absolute; opacity: .58; }
.home-marketing .hp-plot-guide-x {
  left: min(var(--hp-axis-x), var(--hp-point-x));
  width: max(calc(var(--hp-point-x) - var(--hp-axis-x)), calc(var(--hp-axis-x) - var(--hp-point-x)));
  top: var(--hp-point-y);
  border-top: 1px dashed currentColor;
}
.home-marketing .hp-plot-guide-y {
  left: var(--hp-point-x);
  top: var(--hp-point-y);
  height: calc(var(--hp-axis-y) - var(--hp-point-y));
  border-left: 1px dashed currentColor;
}

.home-marketing .hp-plot-point {
  position: absolute;
  top: var(--hp-point-y);
  left: var(--hp-point-x);
  width: .825rem;
  height: .825rem;
  border: 2px solid var(--emh-brand-surface);
  border-radius: 50%;
  background: currentColor;
  outline: 1px solid currentColor;
  transform: translate(-50%, -50%);
}

.home-marketing .hp-plot-point > span {
  position: absolute;
  left: 1.3em;
  top: -.1em;
  white-space: nowrap;
}

.home-marketing .hp-equation-note {
  position: absolute;
  z-index: 1;
  left: 3%;
  bottom: 6%;
  display: grid;
  gap: .25rem;
  padding: .65rem clamp(.625rem, 2vw, 1.45rem);
  border-radius: .25rem;
  background: var(--emh-surface);
  box-shadow: 0 .45rem 1.4rem rgb(0 0 0 / .2);
  color: var(--emh-ink);
  font-size: clamp(1.15rem, 2.65vw, 2.4rem);
  transform: rotate(-7deg);
}

.home-marketing .hp-equation-answer { color: var(--emh-primary-text); }

.home-marketing .hp-walkthrough {
  padding-block: clamp(2.5rem, 5.5vw, 5.75rem);
  background-color: var(--hp-stage);
  color: var(--hp-stage-ink);
  scroll-margin-top: 5rem;
}

.home-marketing .hp-walkthrough-layout {
  display: grid;
  grid-template-columns: minmax(0, .76fr) minmax(0, 1.24fr);
  align-items: start;
  gap: clamp(1.75rem, 5vw, 5rem);
}

.home-marketing .hp-walkthrough-copy { padding-top: clamp(0rem, 1.5vw, 1.25rem); }
.home-marketing .hp-walkthrough-copy .hp-section-title { text-wrap: initial; max-width: 13ch; }

.home-marketing .hp-walkthrough-copy > p {
  max-width: 32ch;
  margin-top: 1.25rem;
  color: var(--hp-stage-muted);
  font-size: clamp(1rem, 1.4vw, 1.125rem);
}

.home-marketing .hp-animation {
  position: relative;
  overflow: hidden;
  border: 1px solid #685c5c;
  border-radius: var(--hp-radius);
  background: #f5f2f2;
}

.home-marketing .hp-animation > :is(img, video) {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
}

.home-marketing .hp-animation > video {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.home-marketing .hp-animation > img {
  position: relative;
}

.home-marketing .hp-tools { padding-block: clamp(2.5rem, 6vw, 6rem) clamp(2rem, 4.2vw, 4rem); }
.home-marketing .hp-tools .hp-section-title { text-wrap: initial; }

.home-marketing .hp-features {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1.5rem, 4.25vw, 4.25rem);
  margin-top: clamp(1.5rem, 3.7vw, 3.5rem);
}

.home-marketing .hp-feature-art {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  overflow: hidden;
  overflow: clip;
  width: 100%;
  min-height: 12rem;
  aspect-ratio: 1.78;
  border: 1px solid color-mix(in srgb, var(--emh-primary-text) 17%, var(--emh-line));
  border-radius: var(--hp-radius);
}

.home-marketing .hp-upload-art { background-color: var(--emh-selected); }
.home-marketing .hp-learning-art { background-color: color-mix(in srgb, var(--emh-selected) 46%, var(--emh-soft)); }

.home-marketing .hp-worksheet {
  position: absolute;
  top: 12%;
  left: 14%;
  width: 65%;
  min-height: 110%;
  padding: clamp(.8rem, 2.5vw, 2rem);
  background: var(--emh-paper);
  box-shadow: var(--emh-shadow);
  transform: rotate(-9deg);
}

.home-marketing .hp-sheet-heading {
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--emh-primary-text);
  color: var(--emh-primary-text);
  font-size: clamp(.94rem, 2.06vw, 1.6rem);
  font-weight: 700;
  letter-spacing: -.035em;
}

.home-marketing .hp-worksheet p { margin-top: .55rem; font-size: .875rem; }

.home-marketing .hp-worksheet ol {
  display: grid;
  gap: clamp(.45rem, 1.3vw, 1rem);
  margin: .65rem 0 0;
  padding-inline-start: 1.4em;
  font-size: clamp(.88rem, 1.8vw, 1.45rem);
}

.home-marketing .hp-worksheet math { margin-inline-start: .3rem; }

.home-marketing .hp-pencil {
  position: absolute;
  width: clamp(.625rem, 1.45vw, 1.15rem);
  height: 55%;
  top: 25%;
  right: 13%;
  border-radius: .125rem .125rem .3rem .3rem;
  background: var(--emh-primary);
  box-shadow: inset -.22rem 0 rgb(0 0 0 / .17), .28rem .3rem .55rem rgb(0 0 0 / .18);
  transform: rotate(25deg);
}

.home-marketing .hp-pencil::before {
  content: '';
  position: absolute;
  inset: auto 0 100%;
  height: 1em;
  background: linear-gradient(to bottom, var(--emh-ink) 32%, #eacbac 32%);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

.home-marketing .hp-course {
  position: relative;
  width: min(82%, 29rem);
  min-width: 0;
  padding: clamp(.625rem, 1.8vw, 1.25rem) clamp(.8rem, 2vw, 1.4rem) .3rem;
  border: 1px solid var(--emh-line);
  border-radius: var(--hp-radius);
  background-color: var(--emh-paper);
  box-shadow: var(--emh-shadow);
}

.home-marketing .hp-course-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: .5rem;
  padding-bottom: .55rem;
  font-size: clamp(.95rem, 2vw, 1.35rem);
  font-weight: 700;
}

.home-marketing .hp-course-title > span {
  color: var(--emh-muted);
  font-size: .6875rem;
  font-weight: 500;
  white-space: nowrap;
}

.home-marketing .hp-course ul { list-style: none; margin: 0; padding: 0; }

.home-marketing .hp-course li {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: .6rem;
  padding-block: clamp(.35rem, .7vw, .6rem);
  border-top: 1px solid var(--emh-line);
  font-size: clamp(.75rem, 1.2vw, .92rem);
  font-weight: 600;
}

.home-marketing .hp-course li::before {
  content: '';
  width: .65rem;
  height: .65rem;
  border: 1px solid var(--emh-primary-text);
  border-radius: 50% 50% 50% 0;
}

.home-marketing .hp-course small {
  display: block;
  margin-top: .1rem;
  color: var(--emh-muted);
  font-size: .75rem;
  font-weight: 400;
}

.home-marketing .hp-feature > h3 {
  margin-top: clamp(.875rem, 1.8vw, 1.45rem);
  font-size: clamp(1.5rem, 3vw, 2.55rem);
  font-weight: 700;
  line-height: 1.09;
}

.home-marketing .hp-feature > p { margin-top: .65rem; color: var(--emh-muted); }

.home-marketing .hp-text-link {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  min-height: 44px;
  color: var(--emh-primary-text);
  font-size: .975rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: .25em;
}

.home-marketing .hp-text-link > span { display: inline-block; }
.home-marketing .hp-feature > .hp-text-link { margin-top: .3rem; }

.home-marketing .hp-calculators {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  align-items: center;
  gap: .5rem 1.5rem;
  padding-block: clamp(.9rem, 2.5vw, 2.2rem);
  border-block: 1px solid var(--emh-line);
}

.home-marketing .hp-calculators h2 { font-size: clamp(1.65rem, 3.35vw, 3rem); line-height: 1.1; }

.home-marketing .hp-faq {
  display: grid;
  grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr);
  gap: clamp(1.25rem, 5.1vw, 5rem);
  padding-block: clamp(2.5rem, 6vw, 6rem);
}

.home-marketing .hp-faq .hp-section-title { max-width: 12ch; text-wrap: initial; }

.home-marketing .hp-faq :is(details, [data-slot='accordion-item']) {
  border-bottom: 1px solid var(--emh-line);
}

.home-marketing .hp-faq :is(summary, [data-slot='accordion-trigger']) {
  width: 100%;
  min-height: 58px;
  padding: .9rem .125rem;
  border-radius: .25rem;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  cursor: pointer;
}

.home-marketing .hp-faq [data-slot='accordion-trigger'] { gap: 1rem; align-items: center; }
.home-marketing .hp-faq [data-slot='accordion-content'] > div { padding: 0; height: auto; }

.home-marketing .hp-faq p {
  max-width: 65ch;
  padding: 0 .125rem 1.1rem;
  color: var(--emh-muted);
  font-size: .9375rem;
}

.home-marketing .hp-final {
  background: var(--emh-brand-surface);
  color: var(--emh-brand-label);
}

.home-marketing .hp-final-layout {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem 2.25rem;
  padding-block: clamp(2rem, 4vw, 4rem);
}

.home-marketing .hp-final .hp-section-title { text-wrap: initial; }
.home-marketing .hp-final .hp-actions { margin: 0; }
.home-marketing .hp-final .hp-actions .hp-primary-action { background: var(--emh-paper); color: var(--emh-primary-text); }

:root[data-theme] body .home-marketing .hp-final a:focus-visible {
  outline-color: var(--emh-brand-label);
}

.home-marketing-footer {
  width: min(1320px, calc(100% - clamp(1rem, 4.5vw, 4.5rem) * 2));
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem 1.5rem;
  margin: 0 auto;
  padding: 1.65rem 0 2rem;
  color: var(--emh-muted);
}

.home-marketing-footer .hp-footer-brand {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: .65rem;
  min-height: 44px;
  color: var(--emh-ink);
  font-size: .9rem;
  font-weight: 600;
  text-decoration: none;
}

.home-marketing-footer .hp-footer-brand img { flex-shrink: 0; object-fit: contain; }
.home-marketing-footer nav { display: flex; align-items: center; flex-wrap: wrap; column-gap: 1.3rem; }
.home-marketing-footer nav a { display: inline-flex; align-items: center; min-height: 44px; color: var(--emh-muted); font-size: .875rem; text-underline-offset: .25em; }
.home-marketing-footer > p { grid-column: 1 / -1; margin: 0; font-size: .8125rem; }

@media (max-width: 900px) {
  .home-marketing .hp-hero { gap: 1.5rem; }
  .home-marketing .hp-footer-brand { justify-self: start; }
}

@media (max-width: 700px) {
  .home-marketing .hp-hero,
  .home-marketing .hp-walkthrough-layout,
  .home-marketing .hp-faq,
  .home-marketing-footer { grid-template-columns: 1fr; }

  .home-marketing .hp-hero { gap: 1.75rem; padding-block: 1.75rem 2rem; }

  .home-marketing .hp-hero .hp-hero-title {
    max-width: 11ch;
    font-size: clamp(3.25rem, 9.6vw, 4.75rem);
  }

  .home-marketing .hp-board-art { aspect-ratio: 1.36; min-height: 11.75rem; }
  .home-marketing .hp-plot { right: 10%; }
  .home-marketing .hp-equation-note { font-size: clamp(1.2rem, 4.25vw, 1.85rem); }
  .home-marketing .hp-walkthrough-layout { gap: 1.35rem; }
  .home-marketing .hp-walkthrough-copy > p { margin-top: .8rem; }
  .home-marketing .hp-faq .hp-section-title { max-width: none; }
  .home-marketing-footer { gap: .45rem; }
}

@media (max-width: 540px) {
  .home-marketing .hp-features,
  .home-marketing .hp-calculators { grid-template-columns: minmax(0, 1fr); }
  .home-marketing .hp-features { gap: 1.5rem; }
  .home-marketing .hp-calculators { row-gap: .125rem; }
  .home-marketing .hp-calculators h2 { margin-bottom: .4rem; }
}

@media (max-width: 370px) {
  .home-marketing .hp-plot-point > span { left: .92em; }
}

@media (prefers-reduced-motion: no-preference) {
  .home-marketing .hp-animation > video.has-played + img { visibility: hidden; }

  .home-marketing .hp-board { animation: hp-find-point 3.45s both cubic-bezier(.34, .02, .22, 1); }
  .home-marketing .hp-plot-line { animation: hp-trace-line 1.15s .12s both cubic-bezier(.24, .7, .27, 1); }

  .home-marketing :is(.hp-plot-point, .hp-plot-guide) {
    animation: hp-mark-point .4s .9s both ease-out;
  }

  .home-marketing .hp-plot-point > span { animation: hp-mark-point .3s 2.9s both ease-out; }
  .home-marketing .hp-equation-note { animation: hp-place-note .48s 2.9s both ease-out; }

  .home-marketing .hp-text-link > span { transition: transform .18s ease; }
  .home-marketing .hp-text-link:hover > span { transform: translateX(.25em); }

  @supports (animation-timeline: view()) {
    .home-marketing .hp-upload-art { view-timeline-name: --hp-upload; }
    .home-marketing .hp-learning-art { view-timeline-name: --hp-learning; }

    .home-marketing .hp-worksheet {
      animation: hp-sheet-in linear both;
      animation-timeline: --hp-upload;
      animation-range: entry 0% entry 100%;
    }

    .home-marketing .hp-pencil {
      animation: hp-pencil-in linear both;
      animation-timeline: --hp-upload;
      animation-range: entry 0% entry 100%;
    }

    .home-marketing .hp-course {
      animation: hp-course-in linear both;
      animation-timeline: --hp-learning;
      animation-range: entry 0% entry 100%;
    }
  }
}

/* The plot covers x = -4 to 7 and y = -2 to 14. The point moves from (1, 5) to (4, 11). */
@keyframes hp-find-point {
  0%, 31% { --hp-point-x: 45.4545%; --hp-point-y: 56.25%; }
  84%, 100% { --hp-point-x: 72.7273%; --hp-point-y: 18.75%; }
}

@keyframes hp-trace-line {
  from { clip-path: inset(100% 0 0); }
  to { clip-path: inset(0); }
}

@keyframes hp-mark-point { from { opacity: 0; } }

@keyframes hp-place-note {
  from { opacity: 0; transform: translateY(.8rem) rotate(-12deg); }
  to { opacity: 1; transform: rotate(-7deg); }
}

@keyframes hp-sheet-in {
  from { transform: translateY(24%) rotate(-17deg); }
  to { transform: rotate(-9deg); }
}

@keyframes hp-pencil-in {
  from { transform: translate(65%, 28%) rotate(42deg); }
  to { transform: rotate(25deg); }
}

@keyframes hp-course-in {
  from { transform: translateY(34%) rotate(3deg); }
  to { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .home-marketing * { animation: none !important; transition: none !important; }
}
