/* ==========================================================================
   What you will learn: price chart, animated table, 9 learning cards
   ========================================================================== */

.curriculum {
  border-radius: var(--radius-section) var(--radius-section) 0 0;
  background: var(--c-bg);
}

.curriculum__inner {
  display: flex;
  flex-direction: column;
  gap: 52px;
}

.curriculum__body {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* --------------------------------------------------------------------------
   Price chart
   -------------------------------------------------------------------------- */
.price-chart {
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: 400px;
  font-size: 10px;
  line-height: 10px;
  color: #4c4c4c;
}

.price-chart__frame {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 0;
}

.price-chart__y-title {
  flex: none;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  white-space: pre;
}

.price-chart__area {
  flex: 1 1 auto;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.price-chart__grid {
  position: relative;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.price-chart__row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.price-chart__row span {
  flex: 0 0 40px;
}

.price-chart__row::after {
  content: "";
  flex: 1 1 auto;
  height: 10px;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.2) 50%, transparent 50%) left bottom / 8px 1px repeat-x;
}

/* The plot sits over the grid, starting after the 40px labels + 12px gap */
.price-chart__plot {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 52px;
  right: 0;
  overflow: visible;
}

.price-chart__svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.price-chart__x {
  position: relative;
  height: 10px;
  margin-left: 52px;
}

.price-chart__x span {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  color: #acacac;
  white-space: nowrap;
}

.price-chart__x span.is-month {
  color: #000;
}

.price-chart__legend {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 32px;
}

.price-chart__legend li {
  display: flex;
  align-items: center;
  gap: 4px;
}

.legend-key {
  flex: none;
  display: block;
}

.legend-key--spot {
  width: 12px;
  height: 2px;
  background: #44a150;
}

.legend-key--coupon {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--c-orange);
}

.legend-key--barrier,
.legend-key--autocall {
  width: 11px;
  height: 2px;
  background: linear-gradient(90deg, currentColor 3px, transparent 3px) left center / 4px 2px repeat-x;
}

.legend-key--barrier {
  color: #fc5b5b;
}

.legend-key--autocall {
  color: #296ebc;
}

/* SVG marks */
.pc-spot {
  fill: none;
  stroke: #44a150;
  stroke-width: 1.2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.pc-level {
  fill: none;
  stroke-width: 2;
  stroke-dasharray: 4 3;
  shape-rendering: crispEdges;
}

.pc-level--barrier {
  stroke: #fc5b5b;
}

.pc-level--autocall {
  stroke: #296ebc;
}

.pc-coupon {
  fill: var(--c-orange);
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 0.35s var(--ease), opacity 0.35s var(--ease);
}

.pc-coupon.is-hidden {
  opacity: 0;
  transform: scale(0);
}

.pc-cursor-line {
  stroke: rgba(17, 24, 42, 0.15);
  stroke-width: 1;
}

.pc-cursor {
  fill: #44a150;
  stroke: var(--c-white);
  stroke-width: 2;
}

.price-chart:not(.is-playing) .pc-cursor,
.price-chart:not(.is-playing) .pc-cursor-line {
  opacity: 0;
}

/* --------------------------------------------------------------------------
   Data table (window of 4 rows scrolling through the data set)
   -------------------------------------------------------------------------- */
.note-table {
  position: relative;
  height: 289px;
  border-radius: 16px;
  background: var(--c-white);
  overflow: hidden;
  color: #000;
}

.note-table__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 56px;
  padding: 4px 24px;
  border-bottom: 1px solid #ededed;
}

.note-table__row>* {
  flex: 1 1 0;
  padding: 12px;
  min-width: 0;
  font-size: 15px;
  line-height: 1.5;
  white-space: nowrap;
}

.note-table__head {
  position: relative;
  z-index: 2;
  height: 65px;
  padding: 12px 24px;
  background: var(--c-white);
}

.note-table__head>* {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
}

.note-table__viewport {
  position: relative;
  height: 224px;
  overflow: hidden;
}

.note-table__body {
  transition: transform 0.45s var(--ease);
}

.note-table__body .note-table__row {
  transition: background-color 0.3s var(--ease), color 0.3s var(--ease);
}

.note-table__body .note-table__row.is-active {
  position: relative;
  z-index: 1;
  border-radius: 8px;
  background: var(--c-orange);
  box-shadow: 8px 42px 52px rgba(181, 63, 0, 0.4);
  color: var(--c-white);
}

.note-table__body .note-table__row.is-active>* {
  font-size: 16px;
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   Learning grid (9 cards, 3 x 3)
   -------------------------------------------------------------------------- */
.learn-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px 12px;
}

.learn-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 32px 20px 20px;
  border-radius: 16px;
  background: var(--c-white);
  transition: background-color 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

.learn-card__num {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 6px;
  border-radius: 333px;
  background: rgba(0, 0, 0, 0.03);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--c-orange);
  transition: background-color 0.35s var(--ease), color 0.35s var(--ease);
}

.learn-card__title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--c-dark);
  transition: color 0.35s var(--ease);
}

.learn-card.is-active {
  position: relative;
  z-index: 1;
  /* keep the glow above the next row */
  background: var(--c-orange);
  box-shadow: 8px 42px 52px rgba(181, 63, 0, 0.4);
}

.learn-card.is-active .learn-card__num {
  background: var(--c-white);
  color: #000;
}

.learn-card.is-active .learn-card__title {
  color: var(--c-white);
}

/* ==========================================================================
   Curriculum: tablet / mobile
   ========================================================================== */
@media (max-width: 1199px) {
  .curriculum__inner {
    gap: 40px;
  }

  .note-table {
    height: 258px;
  }

  .note-table__row {
    height: 52px;
    padding-left: 16px;
    padding-right: 16px;
  }

  .note-table__head {
    height: 50px;
  }

  .note-table__viewport {
    height: 208px;
  }

  .learn-card {
    padding: 16px;
  }

  /* 9 cards in two columns, filled top to bottom (01–05 | 06–09) */
  .learn-grid {
    display: block;
    columns: 2;
    column-gap: 12px;
  }

  .learn-card {
    break-inside: avoid;
    margin-bottom: 12px;
  }
}

@media (max-width: 767px) {
  .curriculum__body {
    gap: 24px;
  }

  .price-chart {
    height: auto;
  }

  .price-chart__frame {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    height: 360px;
  }

  .price-chart__y-title {
    writing-mode: horizontal-tb;
    transform: none;
    white-space: normal;
  }

  .price-chart__legend {
    justify-content: space-between;
    gap: 8px;
  }

  .price-chart__x {
    font-size: 9px;
  }

  /* Mobile table: Spot, Coupon Event, Barrier, Autocall-Trigger */
  .note-table {
    height: 176px;
  }

  .note-table__row> :nth-child(2),
  .note-table__row> :nth-child(3) {
    display: none;
  }

  .note-table__row,
  .note-table__head {
    height: 44px;
    padding: 0;
  }

  .note-table__row>* {
    padding: 0 16px;
    font-size: 14px;
  }

  .note-table__row> :first-child {
    flex-grow: 0.9;
  }

  .note-table__row> :nth-child(4) {
    flex-grow: 1.1;
  }

  .note-table__row> :last-child {
    flex-grow: 1.3;
  }

  .note-table__head>* {
    font-size: 11px;
  }

  .note-table__viewport {
    height: 132px;
  }

  .note-table__body .note-table__row.is-active>* {
    font-size: 14px;
  }

  .learn-grid {
    columns: 1;
  }

  .learn-card.is-active {
    box-shadow: none;
  }
}