@font-face {
  font-family: "Atlas Grotesk";
  src: url("assets/Atlas%20Grotesk/AtlasGrotesk-Regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Atlas Grotesk";
  src: url("assets/Atlas%20Grotesk/AtlasGrotesk-Medium.otf") format("opentype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Atlas Grotesk";
  src: url("assets/Atlas%20Grotesk/AtlasGrotesk-Bold.otf") format("opentype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  font-family: "Atlas Grotesk", Helvetica, Arial, sans-serif;
  color: #000;
  background: #fff;
  --orange: #ff8200;
  --green: #23c268;
  --yellow: #f2ee52;
  --pink: #f7c3ce;
  --blue: #56bcf9;
  --grey: #e4e4e5;
  --light-grey: #efefef;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-size: 17px;
  line-height: 1.5;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 20;
  height: 62px;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgb(255 255 255 / 94%);
}

.course-logo {
  display: flex;
  align-items: center;
  color: inherit;
  font-size: clamp(1.7rem, 3.2vw, 2rem);
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
}

.course-logo:hover {
  color: #9d9d9d;
}

.header-label,
.eyebrow,
.step,
legend,
label > span,
.print-note span,
.worksheet-header p,
.worksheet-footer {
  font-size: 0.69rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.logo-shape {
  position: relative;
  width: 0.6em;
  height: 0.6em;
  margin: 0 0.34em;
  flex: 0 0 auto;
}

.shape {
  position: absolute;
  inset: 0;
  opacity: 0;
  animation: logo-shape-cycle 6s infinite;
}

.shape.triangle {
  background: var(--orange);
  clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
}

.shape.circle {
  border-radius: 50%;
  background: var(--green);
  animation-delay: 2s;
}

.shape.square {
  background: #f062a6;
  animation-delay: 4s;
}

.logo-shape-b .triangle {
  animation-delay: -2s;
}

.logo-shape-b .circle {
  animation-delay: 0s;
}

.logo-shape-b .square {
  animation-delay: 2s;
}

@keyframes logo-shape-cycle {
  0%,
  33.33% {
    opacity: 1;
  }

  33.34%,
  100% {
    opacity: 0;
  }
}

main {
  width: min(100% - 48px, 62rem);
  margin: 0 auto;
  padding: 118px 0 96px;
}

.intro {
  margin-bottom: 3.5rem;
}

.eyebrow,
.step {
  margin: 0 0 0.2rem;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 1.6rem;
  font-size: clamp(2.25rem, 5vw, 4rem);
  line-height: 0.94;
  letter-spacing: -0.055em;
}

h2 {
  margin-bottom: 0;
  font-size: 1.5rem;
  line-height: 1.1;
}

.intro-copy {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  max-width: 50rem;
}

.intro-copy p {
  margin-bottom: 0;
}

.control-panel,
.preview-section {
  border: 2px solid #000;
  border-radius: 18px;
  padding: 2rem;
}

.control-panel {
  background: var(--grey);
}

.preview-section {
  margin-top: 2rem;
}

.section-heading {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.step-marker {
  width: 3.2rem;
  height: 3.2rem;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: var(--orange);
  clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
  padding-top: 0.65rem;
  font-size: 1.1rem;
  font-weight: 700;
}

.step-marker-two {
  border-radius: 50%;
  background: var(--green);
  clip-path: none;
  padding-top: 0;
}

.axis-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 2rem;
}

.letter-controls {
  margin-top: 1rem;
}

.letter-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.letter-fields input {
  font-size: 1.4rem;
  text-align: center;
}

.letter-controls small {
  display: block;
  margin-top: 0.65rem;
  font-size: 0.75rem;
}

fieldset {
  min-width: 0;
  margin: 0;
  padding: 1rem;
  border: 2px solid #000;
  border-radius: 12px;
  background: #fff;
}

legend {
  padding: 0 0.45rem;
}

fieldset label {
  display: block;
}

label > span {
  display: block;
  margin-bottom: 0.2rem;
}

input {
  width: 100%;
  border: 0;
  border-bottom: 2px solid #000;
  border-radius: 0;
  padding: 0.35rem 0;
  background: transparent;
  font-weight: 700;
  outline: 0;
}

input:focus {
  border-color: var(--blue);
  box-shadow: 0 3px 0 var(--blue);
}

.axis-arrow {
  width: 2.35rem;
  height: 2.35rem;
  margin: 0.65rem auto 0.4rem;
  display: grid;
  place-items: center;
  border: 2px solid #000;
  border-radius: 50%;
  background: var(--yellow);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1;
  text-align: center;
}

.row-controls {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 2px solid #000;
}

.row-controls-heading,
.preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.row-controls-heading p {
  margin-bottom: 0;
}

.text-button {
  border: 0;
  padding: 0;
  background: transparent;
  text-decoration: underline;
  cursor: pointer;
}

.sector-controls {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.65rem;
  margin-top: 0.8rem;
}

.sector-control {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.75rem;
  border: 2px solid #000;
  border-radius: 10px;
  background: #fff;
}

.sector-name {
  overflow: hidden;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stepper {
  display: grid;
  grid-template-columns: 2rem 1fr 2rem;
  align-items: center;
  border: 2px solid #000;
  border-radius: 999px;
  overflow: hidden;
}

.stepper button {
  height: 2rem;
  border: 0;
  background: var(--yellow);
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.stepper button:disabled {
  color: #8b8b8b;
  background: var(--light-grey);
  cursor: not-allowed;
}

.stepper output {
  text-align: center;
  font-weight: 700;
}

.preview-toolbar {
  margin-bottom: 1.25rem;
}

.print-button {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  border: 0px solid #000;
  border-radius: 999px;
  padding: 0.7rem 1rem;
  background: var(--grey);
  font-weight: 700;
  cursor: pointer;
}

.print-button:hover {
  background: var(--blue);
}

.print-button svg {
  width: 1.2rem;
  fill: currentColor;
}

.print-note {
  margin: 0 0 1rem;
  padding: 0.65rem 0.9rem;
  border-radius: 8px;
  background: var(--light-grey);
  font-size: 0.8rem;
}

.print-note span {
  margin-right: 0.6rem;
}

.page-stage {
  padding: 2rem;
  overflow: hidden;
  background: var(--grey);
}

.page-wrap {
  position: relative;
  width: min(100%, 700px);
  aspect-ratio: 17 / 11;
  margin: 0 auto;
  container-type: inline-size;
  background: white;
  box-shadow: 0 7px 24px rgb(0 0 0 / 18%);
}

.worksheet {
  position: absolute;
  inset: 0 auto auto 0;
  width: 17in;
  height: 11in;
  padding: 0.35in;
  display: grid;
  grid-template-rows: 0.48in 1fr 0.22in;
  gap: 0.1in;
  overflow: hidden;
  background: #fff;
  transform: scale(calc(100cqw / 17in));
  transform-origin: top left;
}

.worksheet-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  border-bottom: 0.025in solid #000;
}

.worksheet-header h2 {
  font-size: 0.2in;
  letter-spacing: -0.025em;
}

.student-details {
  width: 2.5in;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.05in 0.08in;
  align-items: end;
  padding-top: 0.02in;
  font-size: 0.07in;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.student-details i {
  height: 0.11in;
  border-bottom: 0.01in solid #000;
}

.matrix-shell {
  position: relative;
  min-height: 0;
}

.matrix {
  position: absolute;
  inset: 0.3in 0.38in;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  border: 0.025in solid #000;
}

.matrix-sector {
  position: relative;
  min-width: 0;
  min-height: 0;
}

.matrix-sector:nth-child(odd) {
  border-right: 0.015in solid #000;
}

.matrix-sector:nth-child(-n + 2) {
  border-bottom: 0.015in solid #000;
}

.study-rows {
  height: 100%;
  display: grid;
}

.study-row {
  min-height: 0;
  display: grid;
  grid-template-columns: 0.36in repeat(3, 1fr);
  border-bottom: 0.01in solid #9d9d9d;
}

.study-row:last-child {
  border-bottom: 0;
}

.letter-cell,
.tool-cell {
  position: relative;
  min-width: 0;
  border-right: 0.01in solid #c6c6c6;
}

.letter-cell {
  background-image: linear-gradient(
    to bottom,
    transparent 84%,
    #c6c6c6 84%,
    #c6c6c6 calc(84% + 0.01in),
    transparent calc(84% + 0.01in)
  );
}

.letter-cell:last-child {
  border-right: 0;
}

.letter-cell span {
  position: absolute;
  left: 0.06in;
  bottom: 0.04in;
  color: #aaa;
  font-size: 0.09in;
  font-weight: 700;
}

.axis-label {
  position: absolute;
  z-index: 5;
  max-width: 3.6in;
  overflow: hidden;
  padding: 0.045in 0.08in 0.04in;
  background: #000;
  color: #fff;
  font-size: 0.115in;
  font-weight: 700;
  letter-spacing: 0.07em;
  line-height: 1;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.axis-y-top {
  top: 0.07in;
  left: 50%;
  transform: translateX(-50%);
}

.axis-y-bottom {
  bottom: 0.07in;
  left: 50%;
  transform: translateX(-50%);
}

.axis-x-left {
  bottom: 50%;
  left: 0.03in;
  transform: translate(-50%, 50%) rotate(-90deg);
}

.axis-x-right {
  right: 0.03in;
  bottom: 50%;
  transform: translate(50%, 50%) rotate(90deg);
}

.axis-line {
  position: absolute;
  z-index: 4;
  pointer-events: none;
}

.axis-line::before,
.axis-line::after {
  position: absolute;
  width: 0;
  height: 0;
  content: "";
}

.axis-line-x {
  top: 50%;
  right: 0.2in;
  left: 0.2in;
  border-top: 0.025in solid var(--orange);
}

.axis-line-x::before {
  top: -0.07in;
  left: -0.01in;
  border-top: 0.06in solid transparent;
  border-right: 0.1in solid var(--orange);
  border-bottom: 0.06in solid transparent;
}

.axis-line-x::after {
  top: -0.07in;
  right: -0.01in;
  border-top: 0.06in solid transparent;
  border-bottom: 0.06in solid transparent;
  border-left: 0.1in solid var(--orange);
}

.axis-line-y {
  top: 0.15in;
  bottom: 0.15in;
  left: 50%;
  border-left: 0.025in solid var(--blue);
}

.axis-line-y::before {
  top: -0.01in;
  left: -0.07in;
  border-right: 0.06in solid transparent;
  border-bottom: 0.1in solid var(--blue);
  border-left: 0.06in solid transparent;
}

.axis-line-y::after {
  bottom: -0.01in;
  left: -0.07in;
  border-top: 0.1in solid var(--blue);
  border-right: 0.06in solid transparent;
  border-left: 0.06in solid transparent;
}

.worksheet-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.2in;
  font-size: 0.06in;
}

@media (max-width: 760px) {
  .header-label {
    display: none;
  }

  .site-header {
    padding-inline: 1.25rem;
  }

  main {
    width: min(100% - 24px, 62rem);
    padding-top: 96px;
  }

  .intro-copy,
  .axis-controls {
    grid-template-columns: 1fr;
  }

  .letter-fields {
    gap: 0.6rem;
  }

  .sector-controls {
    grid-template-columns: 1fr 1fr;
  }

  .control-panel,
  .preview-section {
    padding: 1.1rem;
    border-radius: 12px;
  }

  .preview-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .page-stage {
    padding: 0.75rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .shape {
    animation: none;
  }

  .shape.triangle {
    opacity: 1;
  }
}

@page {
  size: tabloid landscape;
  margin: 0;
}

@media print {
  :root,
  body {
    width: 17in;
    height: 11in;
    background: #fff;
  }

  .site-header,
  .intro,
  .control-panel,
  .preview-toolbar,
  .print-note {
    display: none;
  }

  main,
  .preview-section,
  .page-stage,
  .page-wrap {
    width: 17in;
    height: 11in;
    margin: 0;
    padding: 0;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .worksheet {
    transform: none;
  }
}
