:root {
  color-scheme: light;
  --ink: #142142;
  --muted: #485776;
  --line: #d1dbef;
  --blue: #2143ac;
  --pale: #eff4ff;
  --green: #d7f59d;
  font: 100%/1.55 system-ui,sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: radial-gradient(ellipse at 90% 0,#dfe9ff,transparent 50rem),linear-gradient(170deg,#f7faff,#eff4ff 62%,#edf6f0);
  color: var(--ink);
}

[hidden] {
  display: none!important;
}

button,input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  opacity: .66;
  cursor: wait;
}

a {
  color: var(--blue);
  text-underline-offset: .2em;
}

a:focus-visible,button:focus-visible,summary:focus-visible,input:focus-visible {
  outline: 3px solid #5e42c4;
  outline-offset: 3px;
}

.skip {
  position: absolute;
  top: .6rem;
  left: 1rem;
  transform: translateY(-180%);
  padding: .5rem;
  background: white;
  z-index: 2;
}

.skip:focus {
  transform: none;
}

.frame {
  width: min(100% - 3rem,76rem);
  margin-inline: auto;
}

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 5.25rem;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  color: var(--ink);
  font-size: 1.03rem;
  font-weight: 800;
  text-decoration: none;
}

.masthead nav {
  display: flex;
  gap: clamp(.7rem,4vw,2rem);
  font-size: .94rem;
  font-weight: 700;
}

.masthead nav a {
  text-decoration: none;
}

.masthead nav a:hover {
  text-decoration: underline;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0,.88fr) minmax(0,1.12fr);
  align-items: start;
  gap: clamp(1.5rem,5.5vw,5.5rem);
  padding-block: clamp(2rem,6vw,5.6rem);
}

.intro {
  padding-top: 1rem;
}

.eyebrow {
  margin: 0 0 .6rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: #31509b;
  font-size: .875rem;
  font-weight: 830;
}

h1,h2,h3 {
  margin: 0;
  letter-spacing: -.045em;
  line-height: 1.1;
}

h1 {
  font-size: clamp(3.3rem,7.4vw,7.5rem);
  line-height: .96;
}

h1 em {
  font-style: normal;
  color: #244cbd;
  display: block;
}

h2 {
  font-size: clamp(1.7rem,3.1vw,2.9rem);
}

h3 {
  font-size: 1.15rem;
}

.intro>p:not(.eyebrow) {
  font-size: clamp(1.06rem,2vw,1.22rem);
  color: var(--muted);
  max-width: 29rem;
  margin: 1.4rem 0;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.85rem;
  border: 1px solid var(--blue);
  border-radius: .55rem;
  padding: .55rem .95rem;
  background: var(--blue);
  color: #fff;
  font-weight: 750;
  text-decoration: none;
}

.button:hover {
  background: #153187;
}

.topics {
  margin-top: 2.4rem;
}

.topics h2 {
  font-size: 1.15rem;
  letter-spacing: -.025em;
  margin-bottom: .65rem;
}

.examples {
  display: flex;
  gap: .48rem;
  flex-wrap: wrap;
}

.example {
  padding: .4rem .68rem;
  border: 1px solid #c4d0e8;
  border-radius: .45rem;
  background: #f9fbff;
  color: var(--ink);
  font-size: .875rem;
  font-weight: 660;
}

.example[aria-pressed=true] {
  background: #e0eaff;
  border-color: #416ac5;
  color: #173894;
}

.example:hover {
  border-color: #506bac;
}

.workspace {
  scroll-margin-top: 1rem;
  min-width: 0;
  overflow: hidden;
  background: #fff;
  border: 1px solid #becde9;
  border-radius: 1.2rem;
  box-shadow: 0 18px 50px #152b651b;
}

.workspace-header {
  padding: 1.15rem clamp(1rem,3vw,1.7rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .85rem;
  border-bottom: 1px solid var(--line);
}

.workspace-header .eyebrow {
  margin: 0 0 .28rem;
  font-size: .813rem;
}

.workspace-header h2 {
  font-size: clamp(1.4rem,2.7vw,2rem);
}

.chip {
  color: #314e20;
  background: var(--green);
  border-radius: 2rem;
  padding: .24rem .62rem;
  font-size: .82rem;
  font-weight: 800;
}

.workspace-body {
  padding: clamp(1rem,3vw,1.7rem);
}

.equation-board {
  border: 1px solid #dce5f7;
  border-radius: .72rem;
  display: flex;
  flex-direction: column;
  gap: .25rem;
  background: linear-gradient(#e1e9fb66 1px,transparent 1px),linear-gradient(90deg,#e1e9fb66 1px,transparent 1px),#f7faff;
  background-size: 1.2rem 1.2rem;
  padding: clamp(.85rem,2vw,1.25rem);
  margin-bottom: .85rem;
}

.equation-board span {
  font-size: .875rem;
  font-weight: 700;
  color: var(--muted);
}

.equation-board strong {
  font-size: clamp(1.53rem,3.2vw,2.55rem);
  font-weight: 760;
  overflow-wrap: anywhere;
  line-height: 1.19;
  letter-spacing: -.045em;
}

.custom summary {
  color: var(--blue);
  font-size: .925rem;
  font-weight: 700;
  cursor: pointer;
}

.custom form {
  padding-top: .65rem;
}

.workspace form label {
  display: block;
  font-weight: 750;
  margin-bottom: .42rem;
}

.row {
  display: flex;
  align-items: stretch;
  gap: .55rem;
}

.row button {
  flex: none;
}

.row input {
  min-width: 0;
  width: 100%;
  border: 1px solid #a7b8d9;
  border-radius: .55rem;
  padding: .56rem .6rem;
  background: #fafcff;
  color: var(--ink);
}

.row input::placeholder {
  color: #5e6a81;
}

.secondary {
  border: 1px solid #bfcae5;
  border-radius: .55rem;
  padding: .55rem .78rem;
  background: #f3f7ff;
  color: #203e8a;
  font-weight: 740;
  min-height: 2.65rem;
}

.secondary:hover {
  background: #e8efff;
  border-color: #6481be;
}

#step-form {
  margin: 1rem 0 0;
}

small {
  display: block;
  margin-top: .3rem;
  color: var(--muted);
  font-size: .86rem;
}

.tools {
  display: flex;
  gap: .75rem;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 1.1rem;
}

.text-button {
  padding: .5rem .2rem;
  border: 0;
  background: none;
  color: var(--blue);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: .18em;
}

.ai-settings {
  margin: .8rem 0 0;
  font-size: .875rem;
  color: var(--muted);
  display: flex;
}

.ai-settings label {
  display: flex;
  gap: .4rem;
  align-items: baseline;
}

.ai-settings input {
  accent-color: var(--blue);
}

.trail {
  padding-top: .8rem;
}

.trail ol,.feedback ol {
  margin: .4rem 0 0;
  padding-left: 1.45rem;
}

.trail li,.feedback li {
  overflow-wrap: anywhere;
}

.feedback {
  margin-top: .85rem;
  padding: .7rem .85rem;
  border-radius: .6rem;
  background: #e9f0ff;
  color: #1b3575;
}

.feedback[data-kind=retry],.feedback[data-kind=error] {
  background: #fff0ef;
  color: #832c26;
}

.feedback[data-kind=solved] {
  background: #eaf5dd;
  color: #28481e;
}

.feedback p {
  margin: .18rem 0 0;
}

.method {
  border-top: 1px solid var(--line);
  padding: 2rem 0 2.5rem;
  scroll-margin-top: 1rem;
}

.method-grid {
  margin-top: 1.35rem;
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 1rem;
}

.method-grid div {
  border-left: .23rem solid #9eaff0;
  padding: .2rem 0 .25rem .8rem;
}

.method-grid p {
  margin: .45rem 0 0;
  color: var(--muted);
}

.footer {
  border-top: 1px solid var(--line);
  padding: 1.4rem 0 2.3rem;
  display: flex;
  justify-content: space-between;
  gap: .9rem;
  color: var(--muted);
  font-size: .92rem;
}

.footer p {
  margin: 0;
}

.footer div {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.privacy {
  max-width: 48rem;
  padding-block: 3rem;
}

.privacy h1 {
  font-size: clamp(2.7rem,5vw,4rem);
}

.privacy h2 {
  font-size: 1.55rem;
  margin-top: 1.6rem;
}

@media(max-width:820px) {
  .layout {
    grid-template-columns: 1fr;
  }
  .intro {
    padding-top: 0;
  }
  .topics {
    margin-top: 1.5rem;
  }
  h1 {
    letter-spacing: -.065em;
  }
  h1 em {
    display: inline;
  }
  .intro>p:not(.eyebrow) {
    max-width: 36rem;
  }
  .method-grid {
    grid-template-columns: 1fr;
  }
}

@media(max-width:450px) {
  .frame {
    width: calc(100% - 2rem);
  }
  .masthead {
    min-height: 4.4rem;
  }
  .masthead nav {
    gap: .7rem;
    font-size: .8rem;
  }
  .brand {
    font-size: .94rem;
    line-height: 1.15;
  }
  .brand img {
    width: 31px;
    height: 31px;
  }
  .row {
    gap: .4rem;
  }
  .row button {
    padding-inline: .65rem;
    font-size: .9rem;
  }
  .footer {
    flex-direction: column;
  }
  .intro-link {
    display: none;
  }
}

@media(prefers-reduced-motion:reduce) {
  html {
    scroll-behavior: auto;
  }
}
