:root {
  --ew-ink: #1e2039;
  --ew-muted: #51536c;
  --ew-accent: #514984;
  --ew-deep: #27254b;
  --ew-line: #dedbea;
  --ew-heading: "Manrope", system-ui, sans-serif;
  --ew-width: 1240px;
  --ew-gutter: clamp(18px, 4vw, 58px);
}

.ew-container, .ew-top-inner {
  width: min(calc(100% - 2 * var(--ew-gutter)), var(--ew-width));
  margin-inline: auto;
}

.ew-header {
  position: sticky;
  top: 0;
  z-index: 18;
  background: #fff;
  color: var(--ew-ink);
  box-shadow: 0 1px 0 var(--ew-line);
}

.ew-top-inner {
  display: grid;
  grid-template-columns: minmax(158px, 1fr) auto minmax(96px, 1fr);
  position: relative;
  align-items: center;
  min-height: 79px;
  column-gap: 20px;
}

.ew-brand, .ew-header-faq, .ew-nav a { text-decoration: none; }
.ew-brand { justify-self: start; display: inline-flex; align-items: center; padding-block: 6px; }
.ew-brand .wordmark { font-size: 24px; color: var(--ew-ink); }
.ew-brand .wordmark strong { color: var(--ew-accent); }
.ew-nav { display: flex; align-items: stretch; justify-content: center; gap: clamp(4px, 1.6vw, 24px); align-self: stretch; }
.ew-nav-menu { display: flex; align-items: stretch; margin: 0; }
.ew-nav > a, .ew-nav-menu > summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  height: 100%;
  gap: 9px;
  padding-inline: 10px;
  border: 0;
  border-bottom: 3px solid transparent;
  border-top: 3px solid transparent;
  background: none;
  border-radius: 0;
  color: var(--ew-ink);
  font-size: 16px;
  font-weight: 720;
  line-height: 1.15;
  cursor: pointer;
  white-space: nowrap;
}

.ew-nav-menu > summary::marker { content: ""; }
.ew-nav-menu > summary::-webkit-details-marker { display: none; }
.ew-nav > a:hover, .ew-nav-menu > summary:hover, .ew-nav-menu[open] > summary {
  color: var(--ew-accent);
  border-bottom-color: var(--ew-accent);
}

.ew-chevron {
  width: 7px;
  height: 7px;
  border-right: 1.5px solid;
  border-bottom: 1.5px solid;
  transform: translateY(-2px) rotate(45deg);
}
.ew-nav-menu[open] .ew-chevron { transform: translateY(2px) rotate(225deg); }

.ew-nav-panel {
  position: absolute;
  top: 100%;
  inset-inline: 0;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  width: min(710px, 100%);
  max-height: min(67vh, 540px);
  margin-inline: auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-radius: 0 0 12px 12px;
  background: #545079;
  color: #fff;
  box-shadow: 0 12px 28px #25214930;
}
.ew-menu-group { padding: 21px 27px; background: var(--ew-deep); }
.ew-menu-group p { margin: 0 0 8px; color: #e0d6f7; font-weight: 750; font-size: 15px; }
.ew-menu-group ul, .ew-shortcuts ul, .ew-resource-directory ul { margin: 0; padding: 0; list-style: none; }
.ew-menu-group a { display: flex; align-items: center; min-height: 44px; color: #fff; font-size: 17px; }
.ew-menu-group a:hover { text-decoration: underline; text-underline-offset: 3px; }
.ew-header-faq, .ew-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-height: 44px;
  padding: 8px 17px;
  border-radius: 7px;
  background: var(--ew-accent);
  color: #fff;
  font: inherit;
  font-weight: 750;
  text-decoration: none;
}
.ew-header-faq { justify-self: end; }
.ew-header-faq:hover, .ew-primary:hover { background: var(--ew-deep); color: #fff; }
.ew-arrow { font-size: 1.16em; line-height: 1; }

.refinement-v1 .ew-preview-status {
  width: 100%;
  max-width: none;
  padding: 5px max(var(--ew-gutter), calc((100% - var(--ew-width)) / 2));
  background: #f6f4fb;
  border-color: var(--ew-line);
}

.ew-home { max-width: none; width: 100%; margin: 0; padding: 0; background: #fff; color: var(--ew-ink); }
.ew-home h1, .ew-home h2 { font-family: var(--ew-heading); }
.ew-home h2 { margin: 0; font-size: clamp(24px, 2.8vw, 33px); line-height: 1.18; letter-spacing: -.045em; }

.ew-hero {
  display: flex;
  align-items: center;
  min-height: clamp(211px, 23vw, 306px);
  padding-block: 24px;
  background:
    repeating-linear-gradient(130deg, #7065a916 0 1px, transparent 1px 26px),
    linear-gradient(102deg, #dcdaf1 3%, #ede9f6 46%, #dddff3 100%);
}
.ew-title-band {
  width: 100%;
  background: linear-gradient(100deg, #2d2853 7%, #514984 65%, #464072);
  border-block: 1px solid #a199c1;
  padding-block: clamp(22px, 3.4vw, 45px);
  color: #fff;
  text-align: center;
}
.ew-home h1 {
  margin: 0;
  color: inherit;
  font-size: clamp(32px, 4.8vw, 64px);
  line-height: 1.05;
  letter-spacing: -.053em;
  text-wrap: balance;
}
.ew-title-band p { margin: 12px auto 0; max-width: 56ch; color: #f1eefb; font-size: clamp(16px, 1.7vw, 22px); line-height: 1.35; }

.ew-home-content { padding-bottom: 55px; }
.ew-shortcuts { text-align: center; padding-block: 32px 34px; }
.ew-shortcuts ul, .ew-resource-directory ul { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.ew-shortcuts ul { margin-top: 21px; }
.ew-shortcut, .ew-tile {
  color: var(--ew-ink);
  text-decoration: none;
  border: 1px solid transparent;
}
.ew-shortcut {
  display: flex;
  min-height: 142px;
  height: 100%;
  flex-direction: column;
  align-items: center;
  padding: 9px 8px 13px;
  border-radius: 10px;
}
.ew-shortcut:hover { color: var(--ew-ink); border-color: var(--ew-line); background: #faf9fd; }
.ew-shortcut-icon {
  display: grid;
  place-items: center;
  width: 66px;
  height: 66px;
  background: var(--task-color);
  color: #fff;
  border-radius: 50%;
  transition: transform .16s ease;
}
.ew-shortcut:hover .ew-shortcut-icon { transform: translateY(-3px); }
.ew-shortcut-icon svg { width: 34px; height: 34px; }
.ew-shortcut-name { margin-top: 11px; font-size: 20px; font-weight: 750; line-height: 1.16; }
.ew-shortcut-note { display: block; margin-top: 5px; color: var(--ew-muted); font-size: 16px; line-height: 1.25; }
.ew-violet { --task-color: #554787; --task-light: #efebf8; }
.ew-blue { --task-color: #40578a; --task-light: #eaf0fb; }
.ew-rose { --task-color: #71506e; --task-light: #f6ebf3; }
.ew-mint { --task-color: #35645f; --task-light: #e6f2ef; }

.ew-spotlight {
  display: grid;
  grid-template-columns: minmax(210px, .73fr) minmax(0, 1.27fr);
  align-items: stretch;
  overflow: hidden;
  border: 1px solid var(--ew-line);
  border-radius: 14px;
  background: #f8f7fc;
}
.ew-spotlight-visual {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 225px;
  isolation: isolate;
  background: radial-gradient(ellipse at 37% 42%, #e7e2f5, #c6c3e6);
}
.ew-paper { position: absolute; width: 103px; height: 135px; border-radius: 12px; border: 1px solid #aaa3cf; }
.ew-paper-back { background: #b2acd9; transform: translate(-24px, 2px) rotate(-17deg); }
.ew-paper-front {
  display: grid;
  place-items: center;
  background: #fbfafe;
  color: var(--ew-accent);
  box-shadow: 0 6px 22px #29244c28;
  transform: translate(15px, -4px) rotate(9deg);
}
.ew-paper-front svg { width: 54px; height: 54px; }
.ew-spotlight-copy { align-self: center; padding: clamp(22px, 4vw, 43px); }
.ew-spotlight-copy p { margin: 9px 0 16px; max-width: 54ch; font-size: 18px; line-height: 1.42; color: var(--ew-muted); }
.ew-spotlight-copy .ew-kicker { margin: 0 0 7px; color: var(--ew-accent); font-size: 15px; font-weight: 750; }
.ew-primary { font-size: 17px; }

.ew-resource-directory { padding-top: 35px; }
.ew-section-heading { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 8px 20px; margin-bottom: 17px; }
.ew-section-heading a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--ew-accent); font-size: 17px; font-weight: 730; text-underline-offset: 3px; }
.ew-tile {
  display: grid;
  grid-template-columns: 1fr auto;
  align-content: space-between;
  align-items: center;
  gap: 12px 4px;
  height: 100%;
  min-height: 111px;
  padding: 14px 16px;
  border-radius: 8px;
  border-color: var(--ew-line);
  background: var(--task-light);
  font-size: 17px;
  font-weight: 750;
  line-height: 1.18;
}
.ew-tile:hover { border-color: var(--task-color); color: var(--ew-ink); text-decoration: underline; text-underline-offset: 3px; }
.ew-tile-icon { grid-column: 1 / -1; color: var(--task-color); }
.ew-tile-icon svg { display: block; width: 27px; height: 27px; }
.ew-tile .ew-arrow { color: var(--task-color); }
.ew-header :focus-visible, .ew-home :focus-visible { outline: 3px solid #6351ad; outline-offset: 3px; }
.ew-menu-group a:focus-visible { outline-color: #e7ddff; outline-offset: 1px; }
#try-a-task, #grade-range, #articles, #staff-training { scroll-margin-top: 140px; }

@media (max-width: 800px) {
  .ew-top-inner {
    grid-template-columns: 1fr auto;
    column-gap: 8px;
    min-height: 0;
    padding-top: 7px;
  }
  .ew-brand .wordmark { font-size: 21px; }
  .ew-header-faq { grid-column: 2; grid-row: 1; }
  .ew-nav { grid-column: 1 / -1; justify-content: space-between; gap: 2px; }
  .ew-nav > a, .ew-nav-menu > summary { padding-inline: 5px; font-size: 15px; gap: 6px; }
  .ew-shortcuts ul, .ew-resource-directory ul { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
}

@media (max-width: 495px) {
  .ew-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; }
  .ew-nav > a, .ew-nav-menu > summary { min-width: 0; width: 100%; }
  .ew-menu-group { padding: 12px 13px; }
  .ew-menu-group a { font-size: 15px; line-height: 1.18; padding-block: 6px; }
  .ew-menu-group p { font-size: 13px; }
  .ew-hero { min-height: 212px; }
  .ew-shortcuts { padding-block: 25px; }
  .ew-shortcuts ul { margin-top: 15px; }
  .ew-shortcut { min-height: 0; padding: 7px 3px 12px; }
  .ew-shortcut-icon { width: 53px; height: 53px; }
  .ew-shortcut-icon svg { width: 26px; height: 26px; }
  .ew-shortcut-name { font-size: 17px; }
  .ew-shortcut-note { font-size: 14px; }
  .ew-spotlight { grid-template-columns: 1fr; }
  .ew-spotlight-visual { min-height: 140px; }
  .ew-paper { width: 70px; height: 90px; }
  .ew-paper-front svg { width: 38px; height: 38px; }
  .ew-resource-directory { padding-top: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  .ew-shortcut-icon { transition: none; }
}
