/* Page layouts: sign-in, home, lessons and the resource pages. */

/* ---------- Sign-in ---------- */
.signin {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 88px 24px;
  overflow: hidden;
}

.signin__grid {
  display: grid;
  grid-template-columns: minmax(280px, 400px) minmax(320px, 440px);
  align-items: center;
  gap: clamp(32px, 6vw, 72px);
}

.signin__grid > * {
  animation: rise 700ms var(--ease) both;
}

.signin__grid > :last-child {
  animation-delay: 120ms;
}

.viewport {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border: 1px solid var(--art-line);
  border-radius: 28px;
  background:
    radial-gradient(120% 80% at 70% 15%, rgba(243, 158, 33, 0.11), transparent 60%),
    var(--art-bg);
  box-shadow: 0 50px 90px -50px rgba(0, 0, 0, 0.9);
}

.viewport__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.viewport__label {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #8193a3;
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.viewport__label--tl { top: 24px; left: 26px; }
.viewport__label--tr { top: 24px; right: 26px; color: #fdc346; }
.viewport__label--bl { bottom: 24px; left: 26px; }

.live {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #f39e21;
  animation: pulse 1.6s ease-in-out infinite;
}

@keyframes pulse {
  50% {
    opacity: 0.25;
  }
}

.signin__card {
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: color-mix(in oklab, var(--surface) 92%, transparent);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.signin__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.signin__top .eyebrow {
  margin: 0;
}

.signin__logo {
  display: flex;
  align-items: center;
  gap: 14px;
}

.signin__logo > span {
  color: var(--accent);
  font-size: clamp(44px, 6vw, 58px);
  font-weight: 300;
  font-stretch: 125%;
  letter-spacing: 0.06em;
  line-height: 1;
}

.signin__role {
  margin: 14px 0 6px;
  color: var(--ink);
  font-size: 19px;
  font-weight: 500;
  font-stretch: 110%;
  letter-spacing: 0.02em;
}

.signin__disciplines {
  margin-bottom: 18px;
  color: var(--blue);
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.signin__hint {
  margin-bottom: 20px;
  font-size: 15px;
}

.field {
  margin-bottom: 14px;
}

.field label {
  display: block;
  margin-bottom: 6px;
  color: var(--mute);
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.field input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: var(--bg);
  color: var(--ink);
  font-size: 15.5px;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.field input::placeholder {
  color: var(--mute);
  opacity: 0.8;
}

.field input:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.field input[aria-invalid='true'] {
  border-color: var(--danger);
}

.field__error {
  margin-top: 6px;
  color: var(--danger);
  font-size: 13.5px;
}

.field__error:empty {
  display: none;
}

.check--inline {
  margin: 4px 0 18px;
  padding: 0;
  border: 0;
  background: none;
}

.signin__author {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 22px;
  color: var(--ink);
  font-size: 17px;
  font-stretch: 105%;
}

.signin__author::before,
.signin__author::after {
  content: '';
  flex: none;
  width: 52px;
  height: 8px;
  background-color: var(--accent);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='52' height='8'%3E%3Cpath d='M4 .5 7.5 4 4 7.5.5 4Z'/%3E%3Cpath d='M8 3.5h44v1H8z'/%3E%3C/svg%3E") no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='52' height='8'%3E%3Cpath d='M4 .5 7.5 4 4 7.5.5 4Z'/%3E%3Cpath d='M8 3.5h44v1H8z'/%3E%3C/svg%3E") no-repeat;
}

.signin__author::after {
  transform: scaleX(-1);
}

/* Map furniture in the corners, from the banner. */
.hud-corner {
  position: absolute;
  display: flex;
  gap: 12px;
  color: var(--mute);
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  pointer-events: none;
}

.hud-corner--tl {
  top: 30px;
  left: 34px;
  align-items: flex-end;
}

.north {
  display: grid;
  justify-items: center;
  gap: 2px;
  color: var(--accent);
}

.north small {
  color: var(--text);
  font-size: 10px;
}

.scalebar {
  display: flex;
  height: 7px;
  margin-bottom: 3px;
  border: 1px solid var(--mute);
}

.scalebar span {
  width: 30px;
}

.scalebar span:nth-child(odd) {
  background: var(--accent);
}

.hud-corner--tr {
  top: 26px;
  right: 34px;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  color: var(--text);
}

.hud-corner--tr .icon {
  margin-bottom: 8px;
  color: var(--ink);
}

.hud-corner--bl {
  bottom: 28px;
  left: 34px;
  flex-direction: column;
  gap: 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--mute);
}

.ticks {
  width: 120px;
  height: 12px;
  background: repeating-linear-gradient(90deg, var(--accent) 0 1.5px, transparent 1.5px 13px);
}

@media (max-width: 900px) {
  .signin {
    padding: 72px 16px 40px;
  }

  .signin__grid {
    grid-template-columns: minmax(0, 440px);
  }

  .viewport {
    aspect-ratio: 16 / 9;
  }

  .hud-corner--tr,
  .hud-corner--bl {
    display: none;
  }

  .hud-corner--tl {
    top: 22px;
    left: 18px;
  }
}

/* ---------- Home ---------- */
.home {
  max-width: 1180px;
  margin: 0 auto;
}

.home__hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 32px;
  margin-bottom: 36px;
}

.home__title {
  font-size: clamp(2.5rem, 1.5rem + 3.6vw, 4.3rem);
  font-weight: 300;
  font-stretch: 112%;
  letter-spacing: -0.01em;
  line-height: 1;
}

.home__title .accent {
  color: var(--accent);
  font-weight: 400;
}

.home__intro {
  max-width: 62ch;
  margin-top: 18px;
  font-size: 17px;
  line-height: 1.65;
}

.ring {
  position: relative;
  width: 148px;
  height: 148px;
}

.ring__svg {
  width: 100%;
  height: 100%;
}

.ring__tick {
  stroke: var(--line-2);
  stroke-width: 1;
}

.ring__tick--long {
  stroke: var(--accent);
  stroke-width: 1.5;
}

.ring__track,
.ring__value {
  fill: none;
  stroke-width: 6;
}

.ring__track {
  stroke: var(--line);
}

.ring__value {
  stroke: var(--accent);
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: 70px 70px;
  transition: stroke-dasharray 800ms var(--ease);
}

.ring__label {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
}

.ring__label strong {
  font-size: 30px;
  font-weight: 500;
  line-height: 1;
}

.ring__label span {
  margin-top: 4px;
  color: var(--mute);
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.home__grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 16px;
}

.home__grid > :nth-child(1) {
  grid-column: span 4;
}

.home__grid > :nth-child(n + 2) {
  grid-column: span 2;
}

.card--continue {
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 236px;
  padding: 26px 28px;
  overflow: hidden;
  border-color: rgba(243, 158, 33, 0.35);
  background: linear-gradient(135deg, #0b1d33, #050d19 70%);
  color: #c9d3de;
  text-decoration: none;
  transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}

.card--continue:hover {
  border-color: #f39e21;
  color: #c9d3de;
  transform: translateY(-2px);
}

.continue__terrain {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  -webkit-mask: linear-gradient(to left, #000 35%, transparent 90%);
  mask: linear-gradient(to left, #000 35%, transparent 90%);
}

.card--continue .eyebrow {
  color: #fdc346;
}

.continue__title {
  max-width: 22ch;
  color: #eef2f6;
  font-size: clamp(24px, 1.2rem + 1vw, 31px);
  font-weight: 500;
  font-stretch: 106%;
}

.continue__meta {
  margin-top: 10px;
  color: #8193a3;
  font-family: var(--f-mono);
  font-size: 12px;
}

.home__grid .card--link {
  display: flex;
  flex-direction: column;
}

.home__grid .card--link .eyebrow {
  margin-bottom: auto;
  padding-bottom: 22px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 16px 0 52px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
}

.stat {
  display: grid;
  gap: 4px;
  padding: 20px 22px;
}

.stat + .stat {
  border-left: 1px solid var(--line);
}

.stat strong {
  color: var(--accent);
  font-size: 42px;
  font-weight: 300;
  font-stretch: 115%;
  line-height: 1;
}

.stat span {
  color: var(--mute);
  font-size: 14px;
}

.modules__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.modules__head h2 {
  font-size: 26px;
  font-weight: 600;
  font-stretch: 105%;
}

.modules__count {
  color: var(--mute);
  font-family: var(--f-mono);
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.modules__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
}

.modcard {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}

.modcard:hover {
  border-color: var(--accent-line);
  color: var(--text);
  transform: translateY(-2px);
}

.modcard__num {
  color: var(--accent);
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
}

.modcard h3 {
  min-height: 2.3em;
  font-size: 17px;
  font-weight: 600;
}

.modcard p {
  color: var(--mute);
  font-family: var(--f-mono);
  font-size: 11.5px;
}

@media (max-width: 1100px) {
  .home__grid > :nth-child(1) {
    grid-column: span 6;
  }

  .home__grid > :nth-child(n + 2) {
    grid-column: span 3;
  }
}

@media (max-width: 720px) {
  .home__hero {
    grid-template-columns: minmax(0, 1fr);
  }

  .ring {
    width: 120px;
    height: 120px;
  }

  .home__grid > :nth-child(n) {
    grid-column: span 6;
  }

  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stat:nth-child(3) {
    border-left: 0;
  }

  .stat:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }
}

/* ---------- Lesson ---------- */
.lesson,
.page {
  max-width: 780px;
  margin: 0 auto;
}

.page--pipelines,
.page--gallery {
  max-width: 1180px;
}

.lesson__head,
.page__head {
  margin-bottom: 32px;
}

.lesson h1,
.page h1 {
  font-size: clamp(2.1rem, 1.5rem + 2.2vw, 3.2rem);
  font-weight: 600;
  font-stretch: 104%;
  letter-spacing: -0.015em;
  line-height: 1.04;
}

.lesson__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 14px;
  color: var(--mute);
  font-family: var(--f-mono);
  font-size: 12px;
}

.lesson__meta span + span::before {
  content: '';
  display: inline-block;
  width: 5px;
  height: 5px;
  margin: 0 18px 2px 0;
  background: var(--accent);
  transform: rotate(45deg);
}

.page__intro {
  max-width: 64ch;
  margin-top: 14px;
  font-size: 17px !important;
}

.lesson__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 56px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}

.lesson__pager {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pager {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: 280px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  text-decoration: none;
}

.pager:hover {
  border-color: var(--accent-line);
  color: var(--ink);
}

.pager small {
  display: block;
  color: var(--mute);
  font-family: var(--f-mono);
  font-size: 10.5px;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.pager--next {
  text-align: right;
}

.pager .icon {
  flex: none;
  color: var(--accent);
}

/* ---------- Resources ---------- */
.pipes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 20px;
}

.pipe {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.pipe .art__frame {
  aspect-ratio: 4 / 3;
  border: 0;
  border-bottom: 1px solid var(--art-line);
  border-radius: 0;
}

.pipe__body {
  display: grid;
  gap: 10px;
  padding: 18px 20px 20px;
}

.page .pipe__body p {
  font-size: 15px;
  line-height: 1.6;
}

.slug {
  color: var(--accent) !important;
  font-family: var(--f-mono);
  font-size: 11px !important;
  letter-spacing: 0.12em;
}

.pipe h2 {
  font-size: 21px;
  font-weight: 600;
}

.pipe details {
  border-top: 1px solid var(--line);
}

.pipe details .list,
.pipe details p {
  margin-bottom: 12px;
  font-size: 14.5px;
}

.pipe__actions {
  display: flex;
  gap: 10px;
  padding-top: 6px;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
}

.shot {
  margin: 0;
}

.shot .art__frame {
  aspect-ratio: 4 / 5;
}

.shot figcaption {
  display: grid;
  gap: 4px;
  margin-top: 12px;
}

.shot figcaption strong {
  font-size: 16px;
}

.shot figcaption span:last-child {
  color: var(--mute);
  font-size: 14px;
}

.dl {
  padding: 20px 22px 8px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
}

.dl__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}

.dl__file {
  color: var(--accent) !important;
  font-family: var(--f-mono);
  font-size: 13px !important;
}

.dl h2 {
  font-size: 19px;
  font-weight: 600;
}

.page .dl > p {
  font-size: 15px;
}

.dl__view {
  margin-top: 8px;
  border-top: 1px solid var(--line);
}

.dl__preview {
  max-height: 380px;
  margin-bottom: 14px;
  overflow: auto;
  border-radius: 10px;
  white-space: pre;
}

.trouble td:first-child {
  width: 36%;
}

.updates {
  margin: 0;
  padding: 0;
  list-style: none;
}

.updates li {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 18px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.updates time {
  padding-top: 4px;
  color: var(--accent);
  font-family: var(--f-mono);
  font-size: 12px;
}

@media (max-width: 600px) {
  .updates li {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }

  .dl__head {
    flex-direction: column;
  }

  .pipes {
    grid-template-columns: minmax(0, 1fr);
  }
}
