/* coryb.info: one page, no build step. Colors and fonts live in the tokens below. */

:root {
  --bg: #ffffff;
  --text: #0b0b0b;
  --muted: #595959;
  --faint: #9a9a9a;
  --rule: #0b0b0b;
  --accent: #1d3bff;
  --on-accent: #ffffff;
  --highlight: #ffe94d;
  --highlight-ink: #0b0b0b;
  --block: #1d3bff;
  --on-block: #ffffff;

  --font: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --maxw: 52rem;
  --label-w: 9.5rem;
  --line: 1.6;

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0b0b;
    --text: #f4f4f2;
    --muted: #a3a3a3;
    --faint: #5e5e5e;
    --rule: #f4f4f2;
    --accent: #8292ff;
    --on-accent: #0b0b0b;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  line-height: var(--line);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--highlight);
  color: var(--highlight-ink);
}

.page {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(3rem, 10vw, 6rem) 1rem 3rem;
  counter-reset: section;
}

@media (min-width: 40rem) {
  .page {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

.print-only {
  display: none;
}

/* Links */

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.2em;
  transition: color 120ms ease;
}

a:hover {
  color: var(--accent);
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

/* Intro */

.intro {
  margin-bottom: clamp(2.5rem, 7vw, 3.5rem);
}

.intro h1 {
  margin: 0;
  font-size: clamp(3.25rem, 13vw, 6.75rem);
  font-weight: 800;
  font-stretch: 125%;
  line-height: 0.88;
  letter-spacing: -0.035em;
  text-transform: uppercase;
}

.tagline {
  display: inline-block;
  margin: 1.4rem 0 0;
  padding: 0.1rem 0.4rem;
  background: var(--highlight);
  color: var(--highlight-ink);
  font-weight: 700;
}

.lede {
  max-width: 38rem;
  margin: 1.25rem 0 0;
  font-size: 1.3125rem;
  font-weight: 500;
  line-height: 1.45;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.5rem;
  margin: 1.75rem 0 0;
  padding: 0;
  list-style: none;
}

.actions a:not(.pill) {
  font-weight: 700;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 0.85rem 1.5rem;
  background: var(--text);
  color: var(--bg);
  font-size: 0.875rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-decoration: none;
  text-transform: uppercase;
  transition: background-color 120ms ease, color 120ms ease;
}

.pill:hover {
  background: var(--accent);
  color: var(--on-accent);
}

/* Sections: a big number and label on the left, content on the right (stacked on phones) */

.section {
  counter-increment: section;
  padding: 1.5rem 0 2.75rem;
  border-top: 3px solid var(--rule);
}

.section h2 {
  margin: 0 0 1.25rem;
  font-size: 0.8125rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.4;
  text-transform: uppercase;
}

.section h2::before {
  content: counter(section, decimal-leading-zero);
  display: block;
  margin-bottom: 0.4rem;
  color: var(--accent);
  font-size: 2.5rem;
  font-stretch: 125%;
  letter-spacing: -0.03em;
  line-height: 1;
}

@media (min-width: 40rem) {
  .section {
    display: grid;
    grid-template-columns: var(--label-w) 1fr;
    gap: 2rem;
  }

  .section h2 {
    margin: 0;
  }
}

.section-body > :first-child {
  margin-top: 0;
}

.section-body > :last-child {
  margin-bottom: 0;
}

.section-body p {
  margin: 0 0 0.75rem;
}

.now-dot {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  margin-right: 0.6rem;
  background: var(--accent);
  vertical-align: 0.1em;
}

/* Entries (projects, schools) */

.entry + .entry {
  margin-top: 1.75rem;
}

.entry-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0 1rem;
  margin-bottom: 0.35rem;
}

.entry h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  line-height: var(--line);
}

.org {
  color: var(--muted);
  font-weight: 400;
}

.when {
  font-size: 0.875rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.section-body ul {
  margin: 0;
  padding-left: 1.1rem;
  list-style: square;
}

.section-body li + li {
  margin-top: 0.35rem;
}

.section-body li::marker {
  color: var(--accent);
}

/* Companies: roles hang off a cobalt rule so promotions read as one run */

.company + .company {
  margin-top: 2.5rem;
}

.company h3 {
  margin: 0 0 0.85rem;
  font-size: 1.625rem;
  font-weight: 800;
  font-stretch: 115%;
  letter-spacing: -0.015em;
  line-height: 1.15;
}

.roles {
  padding-left: 1rem;
  border-left: 3px solid var(--accent);
}

.role + .role {
  margin-top: 1.5rem;
}

.role h4 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  line-height: var(--line);
}

/* "Show N more": extra bullets stay visible without JS and always print */

.more-btn {
  display: none;
}

.js .more-btn {
  display: inline-block;
  margin-top: 0.6rem;
  font-size: 0.875rem;
  font-weight: 700;
}

.js .extra {
  display: none;
}

.js .is-open .extra {
  display: list-item;
}

/* Project cards: the whole card is the link, and it lights up yellow on hover */

.project {
  position: relative;
  padding: 1.25rem 1.25rem 1.1rem;
  border: 3px solid var(--rule);
  transition: background-color 120ms ease, color 120ms ease;
}

.project:hover {
  background: var(--highlight);
  color: var(--highlight-ink);
}

.project .entry-head {
  align-items: center;
  margin-bottom: 0.6rem;
}

.project h3 {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.625rem;
  font-weight: 800;
  font-stretch: 115%;
  letter-spacing: -0.015em;
  line-height: 1.15;
}

.project h3 a {
  text-decoration: none;
}

.project h3 a:hover {
  color: inherit;
}

.project h3 a::before {
  content: "";
  position: absolute;
  inset: 0;
}

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

.project:hover .project-icon {
  color: var(--block);
}

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

.arrow {
  display: inline-block;
  margin-left: 0.25em;
  color: var(--faint);
  font-weight: 400;
  transition: transform 150ms ease, color 150ms ease;
}

.project:hover .arrow {
  color: inherit;
  transform: translate(2px, -2px);
}

.stack {
  color: var(--muted);
  font-size: 0.875rem;
}

.project:hover .stack {
  color: inherit;
}

/* Skills */

.skills {
  margin: 0;
}

.skills div {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.4rem;
}

.skills div + div {
  margin-top: 1rem;
}

@media (min-width: 40rem) {
  .skills div {
    grid-template-columns: 8.5rem 1fr;
    gap: 1rem;
    align-items: baseline;
  }

  .skills div + div {
    margin-top: 0.75rem;
  }
}

.skills dt {
  font-weight: 700;
}

.skills dd {
  margin: 0;
}

.section-body .chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0;
  list-style: none;
}

.chips li,
.chips li + li {
  margin: 0;
  padding: 0.1rem 0.55rem;
  border: 2px solid var(--rule);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.6;
}

/* Say hello */

.hello-card {
  margin: 0.5rem 0 2.5rem;
  padding: clamp(1.5rem, 5vw, 2.5rem);
  background: var(--block);
  color: var(--on-block);
}

.hello-card h2 {
  margin: 0;
  font-size: clamp(2.25rem, 7vw, 3.5rem);
  font-weight: 800;
  font-stretch: 125%;
  letter-spacing: -0.03em;
  line-height: 0.92;
  text-transform: uppercase;
}

.hello-card p {
  max-width: 32rem;
  margin: 0.9rem 0 1.5rem;
}

.hello-card .pill {
  background: var(--highlight);
  color: var(--highlight-ink);
  letter-spacing: 0;
  text-transform: none;
}

.hello-card .pill:hover {
  background: #ffffff;
  color: var(--highlight-ink);
}

/* Footer */

.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  padding-top: 1.25rem;
  border-top: 3px solid var(--rule);
  font-size: 0.875rem;
  font-weight: 500;
}

.foot p {
  margin: 0;
}

.text-btn {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.2em;
  cursor: pointer;
}

.text-btn:hover {
  color: var(--accent);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
  }
}

/* Print / Save as PDF: a black-on-white resume */

@media print {
  :root {
    --bg: #fff;
    --text: #000;
    --muted: #444;
    --faint: #777;
    --rule: #000;
    --accent: #000;
    --highlight: transparent;
    --block: transparent;
    --on-block: #000;
    --line: 1.4;
  }

  @page {
    margin: 0.55in 0.6in;
  }

  body {
    font-size: 10pt;
  }

  .page {
    max-width: none;
    padding: 0;
  }

  .print-only {
    display: inline;
  }

  .intro {
    margin-bottom: 1rem;
  }

  .intro h1 {
    font-size: 26pt;
    line-height: 1;
  }

  .tagline {
    margin-top: 0.4rem;
    padding: 0;
    font-weight: 600;
  }

  .lede {
    max-width: none;
    margin-top: 0.5rem;
    font-size: 10.5pt;
    font-weight: 400;
  }

  .actions {
    gap: 0.25rem 1.5rem;
    margin-top: 0.5rem;
  }

  .actions a,
  .pill {
    padding: 0;
    background: none;
    color: var(--text);
    font-size: inherit;
    font-weight: 400;
    letter-spacing: 0;
    text-decoration: none;
    text-transform: none;
  }

  a[data-print]::after {
    content: " " attr(data-print);
    color: var(--muted);
    font-weight: 400;
  }

  .section {
    display: block;
    padding: 0.7rem 0;
    border-top-width: 1.5px;
  }

  .section h2 {
    margin: 0 0 0.45rem;
  }

  .section h2::before {
    display: inline;
    margin: 0 0.6em 0 0;
    color: var(--text);
    font-size: inherit;
    font-stretch: 100%;
    letter-spacing: inherit;
  }

  .section h2,
  .company h3,
  .entry-head {
    break-after: avoid;
  }

  .entry,
  .section-body li,
  .skills div {
    break-inside: avoid;
  }

  .entry h3,
  .role h4 {
    font-size: 10.5pt;
  }

  .company h3,
  .project h3 {
    font-size: 12pt;
  }

  .section h2,
  .when,
  .stack,
  .foot {
    font-size: 9pt;
  }

  .js .extra {
    display: list-item;
  }

  .section-body li + li {
    margin-top: 0.1rem;
  }

  .company + .company {
    margin-top: 1rem;
  }

  .company h3 {
    margin-bottom: 0.4rem;
  }

  .roles {
    border-left-width: 2px;
  }

  .role + .role {
    margin-top: 0.75rem;
  }

  .project {
    padding: 0;
    border: 0;
  }

  .project h3 a::before {
    display: none;
  }

  .section-body .chips {
    display: block;
  }

  .chips li,
  .chips li + li {
    display: inline;
    padding: 0;
    border: 0;
    font-size: inherit;
    font-weight: 400;
  }

  .chips li:not(:last-child)::after {
    content: ", ";
  }

  .foot {
    padding-top: 0.75rem;
    border-top-width: 1.5px;
  }

  /* Last, so nothing above can show these again */
  .screen-only,
  .arrow,
  .now-dot,
  .project-icon,
  .print-btn,
  .web-only,
  .js .more-btn {
    display: none;
  }
}
