/* Colors are sampled from the pixel court in koala.js. Scrolling down the
   page runs from the court, through dusk, into night. */
:root {
  --dusk: #2b3a6b;
  --dusk-raised: #34467a;
  --night: #141a36;
  --glow: #fff4e8;
  --haze: #d9ddef;
  --ink: #1d2645;
  --muted: #4f5873;
  --court: #e7e9ee;
  --rule: #cdd2dc;
  --ball: #dd6a2e;
  --gold: #f4c542;
  --peach: #f7cda6;

  --display: "Corinthia", "Snell Roundhand", cursive;
  --body: "Hanken Grotesk", "Helvetica Neue", Arial, sans-serif;

  --gutter: clamp(1rem, 5vw, 4.5rem);
  --measure: 38rem;

  /* Stepped corners, so boxes sit in the same pixel world as the court. */
  --px4: polygon(
    0 4px, 2px 4px, 2px 2px, 4px 2px, 4px 0,
    calc(100% - 4px) 0, calc(100% - 4px) 2px, calc(100% - 2px) 2px, calc(100% - 2px) 4px, 100% 4px,
    100% calc(100% - 4px), calc(100% - 2px) calc(100% - 4px), calc(100% - 2px) calc(100% - 2px), calc(100% - 4px) calc(100% - 2px), calc(100% - 4px) 100%,
    4px 100%, 4px calc(100% - 2px), 2px calc(100% - 2px), 2px calc(100% - 4px), 0 calc(100% - 4px)
  );
  --px2: polygon(
    0 2px, 2px 2px, 2px 0, calc(100% - 2px) 0, calc(100% - 2px) 2px, 100% 2px,
    100% calc(100% - 2px), calc(100% - 2px) calc(100% - 2px), calc(100% - 2px) 100%,
    2px 100%, 2px calc(100% - 2px), 0 calc(100% - 2px)
  );

  --edge-dusk: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 10' shape-rendering='crispEdges'%3E%3Cpath d='M0 10V8H4V7H8V6H12V6H16V5H20V4H24V4H28V5H32V6H36V6H40V7H44V7H48V6H52V5H56V5H60V7H64V10Z' fill='%232b3a6b'/%3E%3C/svg%3E");
  --edge-night: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 10' shape-rendering='crispEdges'%3E%3Cpath d='M0 10V7H4V5H8V4H12V4H16V5H20V7H24V8H28V6H32V4H36V3H40V3H44V4H48V6H52V7H56V8H60V8H64V10Z' fill='%23141a36'/%3E%3C/svg%3E");
  --stars: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64' shape-rendering='crispEdges'%3E%3Crect x='15' y='46' width='1' height='1' fill='%23dfe4f7'/%3E%3Crect x='54' y='45' width='1' height='1' fill='%235d6aa3'/%3E%3Crect x='31' y='14' width='1' height='1' fill='%23dfe4f7'/%3E%3Crect x='55' y='4' width='1' height='1' fill='%23dfe4f7'/%3E%3Crect x='31' y='41' width='1' height='1' fill='%23dfe4f7'/%3E%3Crect x='54' y='30' width='1' height='1' fill='%235d6aa3'/%3E%3Crect x='56' y='5' width='1' height='1' fill='%235d6aa3'/%3E%3Crect x='22' y='48' width='1' height='1' fill='%235d6aa3'/%3E%3Crect x='38' y='30' width='1' height='1' fill='%235d6aa3'/%3E%3C/svg%3E");
}

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

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  background: var(--court);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.125rem;
  line-height: 1.6;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
}

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

a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-color: var(--ball);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 2px solid var(--ball);
  outline-offset: 3px;
}

h1,
h2,
h3,
p,
ul,
ol,
dl,
dd {
  margin: 0;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Hero ------------------------------------------------------------------ */

.hero {
  --hero-fg: var(--glow);
  --hero-soft: var(--haze);
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 34rem;
  max-height: 68rem;
  overflow: hidden;
  background: var(--dusk);
  color: var(--hero-fg);
}

/* Daytime sky is light, so the hero text flips to ink. */
.hero[data-time="day"] {
  --hero-fg: var(--ink);
  --hero-soft: #26304f;
}

#court {
  position: absolute;
  left: 0;
  bottom: 0;
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}

.nav {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 1.5rem var(--gutter) 0;
  font-size: 1rem;
}

.nav a {
  text-decoration: none;
  color: var(--hero-soft);
}

.nav a:hover {
  color: var(--hero-fg);
  text-decoration: underline;
  text-decoration-color: var(--peach);
}

.nav-name {
  font-weight: 500;
}

/* The hero already says the name; phones need the room for section links. */
@media (max-width: 34rem) {
  .nav {
    justify-content: flex-end;
  }

  .nav-name {
    display: none;
  }
}

.nav ul {
  display: flex;
  gap: clamp(1rem, 3vw, 2rem);
  padding: 0;
  list-style: none;
}

.hero-copy {
  position: relative;
  padding: clamp(2.5rem, 9vh, 6.5rem) var(--gutter) 0;
  pointer-events: none;
}

.hero-copy h1 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(4.5rem, 11vw, 10rem);
  line-height: 0.85;
  margin-left: -0.04em;
  color: var(--hero-fg);
}

.hero-copy p {
  max-width: 31rem;
  margin-top: 1.5rem;
  font-size: clamp(1.0625rem, 1.4vw, 1.25rem);
  line-height: 1.55;
  color: var(--hero-soft);
}

.hero-play {
  position: absolute;
  left: var(--gutter);
  right: var(--gutter);
  bottom: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.875rem;
  color: var(--ink);
  font-size: 0.9375rem;
}

.hero-play button {
  flex: none;
  padding: 0.5rem 0.9rem 0.55rem;
  border: 0;
  background: var(--ink);
  color: var(--court);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  clip-path: var(--px4);
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}

.hero-play button:hover {
  background: var(--dusk);
}

.hero-play button:active {
  transform: translateY(1px);
}

.hero-play button:focus-visible {
  outline: none;
  background: var(--ball);
  color: var(--ink);
}

#scoreboard {
  display: block;
  flex: none;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.hero-hint {
  color: var(--muted);
  line-height: 1.35;
}

@media (max-width: 34rem) {
  .hero-hint {
    display: none;
  }
}

/* Bands ----------------------------------------------------------------- */

.band {
  position: relative;
  scroll-margin-top: 0;
}

.wrap {
  max-width: 92rem;
  padding-inline: var(--gutter);
}

.band h2,
.display-heading {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(3.5rem, 6.5vw, 4.75rem);
  line-height: 0.9;
  margin-bottom: clamp(1.5rem, 3vw, 2.25rem);
}

/* Pixel hills that the next band rises out of. */
.band-dusk::before,
.band-twilight::before,
.band-night::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  height: 40px;
  background-repeat: repeat-x;
  background-position: left bottom;
  background-size: 256px 40px;
  image-rendering: pixelated;
  pointer-events: none;
}

.band-dusk::before {
  background-image: var(--edge-dusk);
}

.band-twilight::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 10' shape-rendering='crispEdges'%3E%3Cpath d='M0 10V6H4V7H8V7H12V6H16V5H20V5H24V6H28V7H32V8H36V8H40V7H44V6H48V6H52V5H56V4H60V5H64V10Z' fill='%23202b55'/%3E%3C/svg%3E");
}

.band-night::before {
  background-image: var(--edge-night);
}

/* About ----------------------------------------------------------------- */

.band-court {
  padding: clamp(3rem, 6vw, 4.5rem) 0 clamp(4.5rem, 8vw, 6rem);
}

.about-grid {
  display: grid;
  gap: 2.5rem;
  align-items: start;
}

@media (min-width: 60rem) {
  .about-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: clamp(3rem, 6vw, 5.5rem);
  }
}

.prose {
  max-width: var(--measure);
  font-size: 1.1875rem;
}

.prose p + p {
  margin-top: 1em;
}


.badges {
  display: grid;
  gap: 1.25rem 1.75rem;
  padding: 0;
  list-style: none;
}

@media (min-width: 36rem) {
  .badges {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

.badge {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 0.9rem;
  align-items: start;
}

.badge-art {
  display: block;
  width: 52px;
  height: 56px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.badge-name {
  font-weight: 600;
  line-height: 1.3;
}

.badge-desc {
  font-size: 0.9375rem;
  line-height: 1.45;
  color: var(--muted);
}


/* Experience ------------------------------------------------------------ */

.band-dusk {
  padding: clamp(2.5rem, 5vw, 3.5rem) 0 clamp(4.5rem, 8vw, 6rem);
  background: var(--dusk);
  color: var(--glow);
}

/* Timeline: newest first. Dates on the left, a rail with the logos as
   stops, then the work, then the stack. Phones fold the date and stack into
   the content column. */
.timeline {
  --rail: #4a5a92;
  --stop-gap: 3rem;
  display: grid;
  gap: var(--stop-gap);
  max-width: 68rem;
  padding: 0;
  list-style: none;
}

.stop {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  grid-template-areas:
    "node when"
    "node body"
    "node stack";
  column-gap: 1.25rem;
}

.stop-when {
  grid-area: when;
  color: var(--haze);
  font-size: 0.9375rem;
  font-variant-numeric: tabular-nums;
}

.stop-year {
  margin-right: 0.3rem;
  color: var(--gold);
  font-weight: 600;
}

.stop-node {
  grid-area: node;
  position: relative;
}

/* A frame around each logo. */
.stop-node .job-logo {
  box-sizing: content-box;
  padding: 4px;
  background-color: var(--dusk-raised);
  background-clip: border-box;
}

/* Solid rail from this logo down to the next one. Nothing after the last. */
.stop:not(:last-child) .stop-node::after {
  content: "";
  position: absolute;
  left: 26px;
  top: calc(56px + 8px);
  bottom: calc(-1 * var(--stop-gap) + 8px);
  width: 4px;
  background: var(--rail);
}

.stop-body {
  grid-area: body;
}

.stop-stack {
  grid-area: stack;
}

@media (min-width: 64rem) {
  .stop {
    grid-template-columns: 7.5rem 56px minmax(0, 1fr) 13rem;
    grid-template-areas: "when node body stack";
    column-gap: 1.75rem;
  }

  .stop-when {
    padding-top: 0.6rem;
    text-align: right;
  }

  .stop-year {
    display: block;
    margin: 0 0 0.2rem;
    font-size: 1.625rem;
    line-height: 1;
  }

  .stop-body {
    padding-top: 0.55rem;
  }

  .stop-stack {
    align-content: flex-start;
    margin-top: 0;
    padding-top: 0.7rem;
  }
}

.job-logo {
  display: block;
  width: 48px;
  height: 48px;
  object-fit: cover;
  background: #fff;
  clip-path: var(--px4);
}

.job-logo-dark {
  background: #0f1040;
}

.project-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.25rem 1rem;
}

.stop h3,
.project h3 {
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.015em;
}

.job-when {
  font-size: 0.9375rem;
  color: var(--haze);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.job-role {
  color: var(--haze);
}

.job-summary {
  margin-top: 0.75rem;
}

.job-points {
  margin-top: 0.75rem;
  padding: 0;
  list-style: none;
}

.job-points li {
  position: relative;
  padding-left: 1.4rem;
}

.job-points li + li {
  margin-top: 0.45rem;
}

/* Square bullets, one art pixel each. */
.job-points li::before {
  content: "";
  position: absolute;
  left: 0.15rem;
  top: 0.62em;
  width: 6px;
  height: 6px;
  background: var(--ball);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 1.1rem;
  padding: 0;
  list-style: none;
}

.chips li {
  padding: 0.2rem 0.6rem 0.25rem;
  background: var(--dusk-raised);
  color: var(--haze);
  font-size: 0.875rem;
  font-weight: 500;
  clip-path: var(--px2);
}

/* Auto-publish flow, inside the Roblox stop ----------------------------- */

.flow {
  margin-top: 1rem;
}

.flow-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 36rem) {
  .flow-steps {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

.flow-steps li {
  position: relative;
}

/* Thin rail from each step to the next. */
.flow-steps li:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 17px;
  left: calc(50% + 20px);
  right: calc(-50% + 20px - 0.5rem);
  height: 2px;
  background: #4a5a92;
}

@media (max-width: 35.99rem) {
  .flow-steps li:nth-child(3)::after {
    display: none;
  }
}

.flow-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: var(--haze);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: default;
}

.flow-step canvas {
  display: block;
  box-sizing: content-box;
  width: 24px;
  height: 24px;
  padding: 6px;
  background: var(--dusk-raised);
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  clip-path: var(--px2);
  transition: background-color 150ms ease;
}

.flow-step:hover,
.flow-step:focus-visible,
.flow-step.is-on {
  color: var(--glow);
}

.flow-step:hover canvas,
.flow-step:focus-visible canvas,
.flow-step.is-on canvas {
  background: var(--ball);
}

.flow-step:focus-visible {
  outline: none;
}

.flow-detail {
  min-height: 2.9em;
  margin-top: 0.6rem;
  font-size: 0.9375rem;
  line-height: 1.45;
  color: var(--haze);
}

/* Projects -------------------------------------------------------------- */

.band-twilight {
  --dusk-raised: #2c3970;
  padding: clamp(2.5rem, 5vw, 3.5rem) 0 clamp(4.5rem, 8vw, 6rem);
  background: #202b55;
  color: var(--glow);
}

.projects {
  display: grid;
  gap: clamp(3rem, 6vw, 4.5rem);
}

.project {
  display: grid;
  gap: 1.5rem;
  align-items: center;
}

@media (min-width: 60rem) {
  .project {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: clamp(2.5rem, 5vw, 4rem);
  }

  .project-flip .project-shot {
    order: 2;
  }
}

/* Screenshots sit in a stepped frame, like a window in the pixel world. */
.project-shot {
  display: block;
  padding: 6px;
  background: var(--dusk-raised);
  clip-path: var(--px4);
  transition: background-color 150ms ease;
}

.project-shot:hover {
  background: var(--gold);
}

.project-shot img {
  display: block;
  width: 100%;
  height: auto;
  clip-path: var(--px2);
}

.project h3 {
  font-size: 2rem;
}

.project-what {
  margin-top: 0.5rem;
}

.project-links {
  margin-top: 1rem;
  font-weight: 500;
}

.project-links a {
  text-decoration-color: var(--peach);
}

/* Contact --------------------------------------------------------------- */

.band-night {
  padding-top: clamp(2.5rem, 5vw, 3.5rem);
  background: var(--night) var(--stars) repeat;
  background-size: 192px 192px;
  image-rendering: pixelated;
  color: var(--glow);
}

.contact-lead {
  color: var(--haze);
}

.contact-email {
  margin-top: 0.4rem;
  font-size: clamp(1.75rem, 4.5vw, 3rem);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

.contact-email a {
  text-decoration-color: var(--peach);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.18em;
}

.contact-links {
  display: flex;
  gap: 1.75rem;
  margin-top: 1.5rem;
  padding: 0;
  list-style: none;
}

.contact-links a {
  text-decoration-color: var(--peach);
}

#night {
  display: block;
  margin-top: 1.5rem;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  cursor: pointer;
}

/* Footer ---------------------------------------------------------------- */

.footer {
  padding: 2rem 0 2.5rem;
  background: #1c2347;
  color: var(--haze);
  font-size: 0.875rem;
}

.footer-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1.25rem 3rem;
}

.footer-eggs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 2.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-eggs li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}

/* Keyboard tricks mean nothing on a phone. */
@media (hover: none) and (pointer: coarse) {
  .footer-eggs {
    display: none;
  }
}

.keys {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.footer kbd {
  display: inline-grid;
  place-items: center;
  min-width: 1.6rem;
  height: 1.6rem;
  padding: 0 0.35rem;
  background: #2a3260;
  color: var(--glow);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  clip-path: var(--px2);
}
