/* About page: globe stage and the past timeline.
   Loaded only by about.html, after the main stylesheet, and built on its tokens. */

/* ---------------------------------------------------------------- globe */
.globe-stage {
  display: grid;
  grid-template-columns: minmax(0, 27rem) minmax(11rem, 1fr);
  align-items: end;
  gap: 8px 28px;
  margin: 28px 0 44px;
}

.globe-canvas {
  display: none;
  width: 100%;
  aspect-ratio: 1;
  cursor: grab;
  /* Sideways drags turn the globe; vertical swipes still scroll the page. */
  touch-action: pan-y;
  border-radius: 50%;
  -webkit-user-select: none;
  user-select: none;
}
.js .globe-canvas { display: block; }
.globe-canvas.is-dragging { cursor: grabbing; }
.globe-canvas:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.globe-caption {
  padding-bottom: 22px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-secondary);
}
.globe-caption p { margin: 0; }
.globe-caption .globe-place {
  color: var(--text-primary);
  font-weight: 550;
  font-size: 15px;
}
.globe-clock {
  display: block;
  margin: 10px 0 8px;
  font-family: var(--font-mono);
  font-size: 34px;
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
.globe-zone {
  font-family: var(--font-mono);
  font-size: 12px;
}
.globe-hint {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border-primary);
  font-size: 13px;
}
/* The clock, the hint and the button describe things only the script draws. */
.globe-live { display: none; }
.js .globe-live { display: block; }

.globe-home {
  margin-top: 14px;
  padding: 6px 12px;
  font: inherit;
  font-size: 13px;
  color: var(--text-primary);
  background: transparent;
  border: 1px solid var(--border-secondary);
  border-radius: 999px;
  cursor: pointer;
}
.globe-home:hover { border-color: var(--text-primary); }
.globe-home:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.globe-home[hidden] { display: none; }

@media (max-width: 760px) {
  .globe-stage {
    grid-template-columns: minmax(0, 1fr);
    margin-bottom: 36px;
  }
  .globe-canvas {
    max-width: 24rem;
    margin: 0 auto;
  }
  .globe-caption { padding-bottom: 0; }
}

/* ------------------------------------------------------------ past line
   Sixteen columns, one per year from 2011 to 2026, so every bar is to scale.
   Each span gets its own lane because they overlap. */
.past-line {
  display: grid;
  grid-template-columns: repeat(16, minmax(0, 1fr));
  margin: 26px 0 30px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-secondary);
}
.past-year {
  grid-row: 1;
  font-family: var(--font-mono);
  font-size: 12px;
  padding-bottom: 6px;
  white-space: nowrap;
}
.past-y2011 { grid-column: 1; }
.past-y2014 { grid-column: 4; }
.past-y2018 { grid-column: 8; }
.past-y2021 { grid-column: 11; }
.past-y2023 { grid-column: 13; }
.past-ynow { grid-column: 16; justify-self: end; }

.past-bar {
  height: 10px;
  border-radius: 5px;
  background: var(--text-primary);
  transform-origin: left center;
  transition: transform 1.1s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.past-bar-blog { grid-row: 2; grid-column: 1 / span 10; }
.past-bar-school { grid-row: 4; grid-column: 4 / span 4; transition-delay: 0.35s; }
.past-bar-rmt { grid-row: 6; grid-column: 8 / span 5; transition-delay: 0.7s; }
.past-bar-now {
  grid-row: 8;
  grid-column: 13 / span 4;
  background: var(--accent);
  /* Still going: the right end is left open. */
  border-radius: 5px 0 0 5px;
  transition-delay: 1.05s;
}
.js .past-line:not(.is-in) .past-bar { transform: scaleX(0); }

.docs-article .past-label {
  margin: 6px 0 16px;
  transition: opacity 0.5s 0.3s;
}
.past-label strong { color: var(--text-primary); }
.past-label-blog { grid-row: 3; grid-column: 1 / -1; }
.past-label-school { grid-row: 5; grid-column: 4 / -1; transition-delay: 0.65s; }
.past-label-rmt { grid-row: 7; grid-column: 8 / -1; transition-delay: 1s; }
.past-label-now { grid-row: 9; grid-column: 1 / -1; text-align: right; transition-delay: 1.35s; }
.docs-article .past-label-now { margin-bottom: 0; }
.js .past-line:not(.is-in) .past-label { opacity: 0; }

@media (max-width: 620px) {
  .past-label-rmt { grid-column: 1 / -1; text-align: right; }
  .past-y2021,
  .past-y2014 { visibility: hidden; }
}

@media (prefers-reduced-motion: reduce) {
  .past-bar,
  .docs-article .past-label { transition: none; }
}

/* ------------------------------------------------------------ how I learned
   Two things side by side: the error, search, answer loop that taught a
   generation of programmers, which the visitor can run, and the grade from
   the four years of formal study. */
.learn {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 16px;
  margin: 22px 0 30px;
}
.learn-loop,
.gpa {
  padding: 16px;
  border: 1px solid var(--border-primary);
  border-radius: 5px;
  background: var(--background-paper);
}
.docs-article .learn p { margin: 0; }
.docs-article .learn .learn-label {
  margin-bottom: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
}

/* The error, as a terminal would print it. */
.docs-article .learn .learn-error {
  padding: 10px 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
  color: var(--error-main);
  background: var(--background-default);
  border: 1px solid var(--border-primary);
  border-left: 3px solid var(--error-main);
  overflow-wrap: anywhere;
}

/* The search box the error gets pasted into. */
.docs-article .learn .learn-search {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  margin-top: 10px;
  padding: 0 12px;
  font-size: 13px;
  color: var(--text-primary);
  background: var(--background-default);
  border: 1px solid var(--border-secondary);
  border-radius: 999px;
}
.learn-glass {
  flex: none;
  width: 11px;
  height: 11px;
  border: 1.5px solid var(--text-secondary);
  border-radius: 50%;
  box-shadow: 5px 5px 0 -4px var(--text-secondary);
}
.learn-query { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
/* A caret while the query is being typed. */
.learn-loop.is-typing .learn-query::after {
  content: '';
  display: inline-block;
  width: 1px;
  height: 1em;
  margin-left: 2px;
  vertical-align: -0.15em;
  background: var(--text-primary);
  animation: learn-caret 0.8s steps(1, end) infinite;
}
@keyframes learn-caret {
  50% { opacity: 0; }
}

/* The accepted answer. */
.docs-article .learn .learn-answer {
  display: flex;
  gap: 10px;
  margin-top: 10px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--background-default);
  border: 1px solid var(--border-primary);
  border-left: 3px solid var(--success-main);
}
.learn-tick {
  flex: none;
  width: 6px;
  height: 11px;
  margin: 2px 2px 0 3px;
  border: solid var(--success-main);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.docs-article .learn .learn-answer.is-new { animation: learn-arrive 0.4s cubic-bezier(0.2, 0.7, 0.2, 1); }
@keyframes learn-arrive {
  from { opacity: 0; transform: translateY(8px); }
}
/* With the script running, the loop starts at the error: nothing searched yet. */
.js .learn-loop:not(.is-asked) .learn-search { color: var(--text-secondary); }
.js .learn-loop:not(.is-answered) .learn-answer { visibility: hidden; }

.learn-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
}
.learn-go {
  display: none;
  padding: 7px 14px;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  color: var(--primary-contrastText);
  background: var(--primary-main);
  border: 1px solid var(--primary-main);
  border-radius: 999px;
  cursor: pointer;
}
.js .learn-go { display: inline-block; }
.learn-go:hover { background: var(--primary-light); }
.learn-go:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.learn-go[disabled] { opacity: 0.5; cursor: default; }
.learn-count {
  display: none;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
}
.js .learn-count { display: inline; }

/* The grade: a bar on a 0 to 4 scale that fills when it scrolls into view. */
.gpa { display: flex; flex-direction: column; }
.docs-article .learn .gpa-read {
  margin-top: auto;
  font-size: 13px;
  color: var(--text-secondary);
}
.gpa-num {
  display: block;
  font-family: var(--font-mono);
  font-size: 44px;
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
.gpa-bar {
  height: 10px;
  margin-top: 14px;
  background: var(--secondary-light);
}
.gpa-bar i {
  display: block;
  width: 84%; /* 3.36 of 4.00 */
  height: 100%;
  background: var(--accent);
  transform-origin: left center;
  transition: transform 1.2s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.js .gpa:not(.is-in) .gpa-bar i { transform: scaleX(0); }
.gpa-scale {
  display: flex;
  justify-content: space-between;
  margin-top: 5px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
}

/* ------------------------------------------------------------ certificates
   The eight courses of one program, a bar of eight that is full, and each
   course with its date and a link to Coursera's own page for checking it. */
.certs {
  margin: 22px 0 30px;
  border: 1px solid var(--border-primary);
  border-radius: 5px;
  background: var(--background-paper);
}
.certs-head {
  padding: 16px;
  border-bottom: 1px solid var(--border-primary);
}
.docs-article .certs p { margin: 0; }
.docs-article .certs .certs-label {
  margin-bottom: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
}
.docs-article .certs .certs-read {
  font-size: 13px;
  color: var(--text-secondary);
}
.certs-num {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 300;
  line-height: 1;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
.certs-bar {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 3px;
  height: 10px;
  margin-top: 12px;
}
.certs-bar i { display: block; background: var(--accent); }
.docs-article .certs .certs-list {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: cert;
}
.docs-article .certs .certs-list li {
  display: grid;
  grid-template-columns: 2.2em 7.5em minmax(0, 1fr) auto;
  gap: 4px 12px;
  align-items: baseline;
  margin: 0;
  padding: 10px 16px;
  font-size: 14px;
  counter-increment: cert;
}
.docs-article .certs .certs-list li + li { border-top: 1px solid var(--border-primary); }
.docs-article .certs .certs-list li::before {
  content: counter(cert, decimal-leading-zero);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
}
.certs-date {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
}
.certs-name { color: var(--text-primary); }
.certs-verify {
  font-family: var(--font-mono);
  font-size: 12px;
  white-space: nowrap;
}
.certs-verify::after { content: " \2197"; }

@media (max-width: 620px) {
  .learn { grid-template-columns: minmax(0, 1fr); }
  .past-label-school { grid-column: 1 / -1; }
  .docs-article .certs .certs-list li { grid-template-columns: 2.2em minmax(0, 1fr) auto; }
  .certs-date { grid-column: 2; grid-row: 1; }
  .certs-name { grid-column: 2 / -1; grid-row: 2; }
  .certs-verify { grid-column: 3; grid-row: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .gpa-bar i { transition: none; }
  .docs-article .learn .learn-answer.is-new,
  .learn-loop.is-typing .learn-query::after { animation: none; }
}
