/* Learn */

#learn {
  position: relative;
  height: 100vh;
  overflow: hidden;
  overflow-x: clip;
}

.learn-head {
  position: absolute;
  left: 6vw;
  top: 8vh;
  z-index: 3;
  max-width: 560px;
}

.learn-head .h-serif {
  font-size: clamp(1.9rem, 3.2vw, 3rem);
}

.meter {
  position: absolute;
  right: 6vw;
  top: 9vh;
  z-index: 3;
  width: min(360px, 30vw);
}

.meter .lbl {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  margin-bottom: 10px;
  font-family: var(--ui);
  font-weight: 500;
  letter-spacing: 0.14em;
  font-size: 12px;
}

.meter .lbl b {
  color: var(--accent-soft);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.meter .bar {
  height: 2px;
  background: var(--w10);
  position: relative;
  overflow: visible;
}

.meter .bar i {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 100%;
  box-shadow: 0 0 14px var(--accent-50);
  background: linear-gradient(90deg, var(--cool), var(--accent));
  transform: scaleX(0);
  transform-origin: left center;
}

.meter .badges {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.meter .bd {
  padding: 6px 10px;
  border-radius: 100px;
  border: 1px solid var(--w10);
  color: var(--muted);
  transform: scale(0.94);
  transition: all 0.6s var(--ease);
  opacity: 0.5;
  font-family: var(--ui);
  font-weight: 500;
  letter-spacing: 0.06em;
  font-size: 12px;
}

.meter .bd.on {
  opacity: 1;
  transform: none;
  border-color: var(--accent-50);
  color: var(--accent-soft);
  background: var(--accent-05);
  box-shadow: 0 0 22px var(--accent-12);
}

.learn-grid {
  position: absolute;
  left: 6vw;
  right: 6vw;
  top: 29vh;
  bottom: 8vh;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 32px;
  z-index: 2;
}

.term {
  position: relative;
  border-radius: 22px;
  border: 1px solid var(--w10);
  background: rgba(8, 8, 10, 0.72);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  overflow: hidden;
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
}

.term::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 3px);
  mix-blend-mode: overlay;
}

.term .bar-t {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--w05);
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.14em;
  font-weight: 500;
  font-family: var(--mono);
}

.term .bar-t i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--w18);
}

.term .bar-t i:nth-child(1) {
  background: #ff5f57;
}

.term .bar-t i:nth-child(2) {
  background: #febc2e;
}

.term .bar-t i:nth-child(3) {
  background: #28c840;
}

.term .bar-t span {
  margin-left: 10px;
}

.term .bar-t em {
  margin-left: auto;
  font-style: normal;
  color: var(--accent);
  opacity: 0.8;
}

.term .log {
  flex: 1;
  padding: 22px 26px;
  overflow: hidden;
  line-height: 1.75;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  mask-image: linear-gradient(180deg, transparent, #000 14%);
  color: rgba(242, 239, 233, 0.86);
  font-size: clamp(12px, 1vw, 14.5px);
  font-family: var(--mono);
}

.mod {
  opacity: 0;
  transition: opacity 0.4s;
  font-family: var(--mono);
}

.mod.on {
  opacity: 1;
}

.mod.past {
  opacity: 0.55;
}

.mod .c {
  color: rgba(242, 239, 233, 0.6);
}

.mod .cmd {
  color: #fff;
  white-space: pre-wrap;
  word-break: break-all;
  font-family: var(--mono);
}

.mod .cmd::before {
  content: "$ ";
  color: var(--accent);
}

.mod .cmd.typing::after {
  content: "▍";
  color: var(--accent);
  animation: blink 1s steps(2) infinite;
}

.mod .out {
  display: none;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: var(--mono);
}

.mod .out.show {
  display: block;
  animation: lineIn 0.35s var(--ease);
}

.mod .out.ok {
  color: #8ee6b6;
}

.mod .out.ok::before {
  content: "✔ ";
}

.mod .out.dim {
  color: rgba(242, 239, 233, 0.66);
}

.mod .out.cool {
  color: var(--cool-soft);
}

.mods {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0;
  padding-left: 34px;
}

.mods::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 6%;
  bottom: 6%;
  width: 1px;
  background: var(--w10);
  opacity: 0.8;
}

.mods .line {
  position: absolute;
  left: 8px;
  top: 6%;
  width: 1px;
  height: 88%;
  box-shadow: 0 0 12px var(--accent-50);
  background: linear-gradient(90deg, var(--cool), var(--accent));
  transform: scaleY(0);
  transform-origin: center top;
}

.mi {
  position: relative;
  padding: 12px 0;
  transition: padding 0.5s var(--ease);
}

.mi::before {
  content: "";
  position: absolute;
  left: -30px;
  top: 19px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--w30);
  transition: all 0.5s var(--ease);
}

.mi.on::before {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 16px var(--accent);
}

.mi.done::before {
  background: var(--cool);
  border-color: var(--cool);
}

.mi .t {
  display: flex;
  align-items: baseline;
  gap: 14px;
  transition:
    color 0.4s,
    font-size 0.5s var(--ease);
  color: rgba(242, 239, 233, 0.66);
  font-family: var(--ui);
  font-weight: 400;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
}

.mi .t b {
  font-family: var(--ui);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--accent-pale);
  opacity: 0.8;
}

.mi.on .t {
  color: #fff;
  font-family: var(--serif);
  font-size: 1.7rem;
}

.mi .d {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition:
    max-height 0.6s var(--ease),
    opacity 0.5s,
    margin 0.5s;
}

.mi.on .d {
  max-height: 260px;
  opacity: 1;
  margin-top: 10px;
}

.mi .d ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0 0 12px;
}

.mi .d li {
  line-height: 1.5;
  padding-left: 16px;
  position: relative;
  color: var(--text);
  font-size: 1rem;
}

.mi .d li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 6px;
  height: 1px;
  background: var(--accent);
}

.mi .d .ship {
  font-family: var(--ui);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--accent-pale);
}

.mi .d .ship b {
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--text);
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

@keyframes lineIn {
  from {
    opacity: 0;
    transform: translateX(-6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 1000px) {
  #learn {
    height: auto;
    min-height: 100vh;
    padding: 14vh 6vw 10vh;
  }

  .learn-head {
    position: static;
    width: auto;
    max-width: none;
    margin-bottom: 24px;
  }

  .meter {
    position: static;
    width: auto;
    max-width: none;
    margin-bottom: 28px;
  }

  .learn-grid {
    position: static;
    width: auto;
    max-width: none;
    display: flex;
    flex-direction: column;
    gap: 24px;
  }

  .meter .badges {
    justify-content: flex-start;
  }

  .term {
    height: 52vh;
  }

  .mi.on .t {
    font-size: 1.3rem;
  }
}

@media (max-width: 600px) {
  #learn {
    padding: 12vh 20px 8vh;
  }

  .term {
    height: 46vh;
    border-radius: 16px;
  }

  .term .log {
    padding: 16px 16px;
    font-size: 11.5px;
  }

  .mods {
    padding-left: 26px;
  }

  .mi.on .t {
    font-size: 1.35rem;
  }

  .mi .d li {
    font-size: 0.95rem;
  }

  .meter .badges {
    display: none;
  }
}
