/*===== ABOUT =====
  About me, technical skills and coursework, with a Brown shield in the
  background that draws itself as you scroll (its sun rises the first time
  the section opens). Uses terminal.css. */

.ab {
  position: relative;
}

/*===== BROWN SHIELD (background) =====*/
.ab-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: clip;
  pointer-events: none;
}

.ab-logo {
  --p: 0;
  --size: min(520px, 84vw);
  position: sticky;
  top: max(72px, calc(50vh - var(--size) * .5875));
  display: block;
  width: var(--size);
  height: auto;
  aspect-ratio: 400 / 470;
  margin: 0 auto;
  fill: none;
  stroke: var(--ink);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: .1;
}

html[data-ink="night"] .ab-logo {
  opacity: .15;
}

/* each line draws between scroll progress --a and --b */
.ab-logo__draw {
  stroke-dasharray: 1;
  stroke-dashoffset: calc(1 - clamp(0, (var(--p) - var(--a)) / (var(--b) - var(--a)), 1));
}

.ab-logo__horizon {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset .9s ease;
}

.ab-logo__sun {
  transform: translateY(80px);
  transition: transform 2.4s cubic-bezier(.2, .7, .2, 1) .5s;
}

.ab-logo__rays {
  opacity: 0;
  transform-origin: 200px 96px;
  transition: opacity 1s ease 2.2s;
  animation: ab-spin 90s linear infinite;
}

.ab-logo.is-risen .ab-logo__horizon {
  stroke-dashoffset: 0;
}

.ab-logo.is-risen .ab-logo__sun {
  transform: none;
}

.ab-logo.is-risen .ab-logo__rays {
  opacity: 1;
}

@keyframes ab-spin {
  to { transform: rotate(360deg); }
}

/*===== INTRO + PHOTO =====*/
.ab-intro {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  grid-template-areas: "head photo" "text photo";
  gap: 28px clamp(32px, 5vw, 72px);
  align-items: start;
}

.ab-head {
  grid-area: head;
}

.ab-text {
  grid-area: text;
}

.ab-text p {
  margin-bottom: 1.15em;
  max-width: 62ch;
  font: 400 15.5px/1.85 var(--mono);
  color: var(--text);
}

.ab-text p:last-child {
  margin-bottom: 0;
}

.ab-text strong {
  font-weight: 700;
  color: var(--ink);
}

.ab-text .ab-name {
  color: var(--blue);
}

.ab-photo {
  grid-area: photo;
  justify-self: end;
  width: 100%;
  max-width: 360px;
}

.ab-photo__img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

@media screen and (max-width: 860px) {
  .ab-intro {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
    grid-template-areas: "head" "photo" "text";
  }
  .ab-photo {
    justify-self: start;
    max-width: 300px;
  }
}

/*===== TECHNICAL SKILLS =====*/
.ab-group {
  display: grid;
  grid-template-columns: minmax(140px, 210px) minmax(0, 1fr);
  gap: 12px 24px;
  padding: 18px 20px;
}

.ab-group + .ab-group {
  border-top: 1px dashed var(--rule);
}

.ab-group__label {
  padding-top: 8px;
  font: 700 13px/1.4 var(--mono);
}

.ab-group__count {
  margin-left: 6px;
  font-weight: 500;
  color: var(--dim);
}

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

.ab-chip {
  padding: 8px 13px;
  border: 1px solid var(--ink);
  background-color: var(--paper);
  font: 500 13.5px/1.2 var(--mono);
}

@media screen and (max-width: 640px) {
  .ab-group {
    grid-template-columns: minmax(0, 1fr);
    padding: 16px 14px;
  }
  .ab-group__label {
    padding-top: 0;
  }
}

/*===== COURSEWORK =====*/
.ab-courses {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  padding: 20px;
}

.ab-course {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  min-height: 104px;
  padding: 12px 14px;
  border: 1px solid var(--ink);
  background-color: var(--paper);
}

.ab-course__code {
  font: 500 12px var(--mono);
  letter-spacing: .04em;
  color: var(--dim);
}

.ab-course__name {
  font: 700 14.5px/1.35 var(--mono);
}

@media (prefers-reduced-motion: reduce) {
  .ab-logo__rays {
    animation: none;
  }
  .ab-logo__horizon,
  .ab-logo__sun,
  .ab-logo__rays {
    transition: none;
  }
}
