/* Site-specific styles layered on top of Skeleton.
   Skeleton itself is unmodified, so it can be upgraded by dropping in a new file. */

/* Skeleton's palette, so the canvas game can match it */
:root {
  --fg: #222;
  --muted: #777;
  --line: #e1e1e1;
  --bg: #fff;

  /* Skeleton sets a text colour but no background. Without this, a visitor
     whose OS is in dark mode gets a dark canvas under Skeleton's dark text. */
  color-scheme: light;
}

body {
  padding-top: 2rem;
  background: #fff;
  color: #222;
}

/* Header
–––––––––––––––––––––––––––––––––––––––––––––––––– */

.site-header {
  margin-bottom: 4rem;
}

.brand {
  font-weight: 600;
  font-size: 1.8rem;
  color: #222;
  text-decoration: none;
}

.brand:hover {
  color: #33c3f0;
}

.site-header nav {
  text-align: right;
  padding-top: .4rem;
}

.site-header nav a {
  margin-left: 2rem;
  color: #777;
  text-decoration: none;
}

.site-header nav a:hover,
.site-header nav a.is-current {
  color: #33c3f0;
}

hr.soft {
  margin: 2.5rem 0;
  border-top-color: #f0f0f0;
}

/* Page banner
–––––––––––––––––––––––––––––––––––––––––––––––––– */

/* A full-bleed strip of artwork above the header. It sits outside .container so
   it can run edge to edge; the negative top margin cancels body's padding so it
   reaches the very top of the window. */
.page-banner {
  position: relative;
  height: 18rem;
  margin: -2rem 0 3.5rem;
  background-color: #fff;
  background-size: cover;
  background-repeat: no-repeat;
}

/* A white veil over the artwork, thickening towards the bottom. It knocks the
   image back so it reads as a wash rather than a photo, and dissolves the hard
   bottom edge into the page instead of cutting it off in a straight line. */
.page-banner:after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(
    to bottom,
    rgba(255,255,255,.45) 0%,
    rgba(255,255,255,.58) 45%,
    rgba(255,255,255,.88) 82%,
    #fff 100%
  );
}

/* Each banner is offset to keep its subject in the visible band — the strip is
   much wider than it is tall, so most of the source image is cropped away. */
.page-banner--forest {
  background-image: url("../assets/banners/banner-forest.jpg");
  background-position: center 55%;
}

.page-banner--totoro {
  background-image: url("../assets/banners/banner-totoro.jpg");
  background-position: center 43%;
}

.page-banner--pikachu {
  background-image: url("../assets/banners/banner-pikachu.jpg");
  background-position: center 55%;
}

/* Sections
–––––––––––––––––––––––––––––––––––––––––––––––––– */

.hero {
  margin-bottom: 3rem;
}

.hero .lead {
  font-size: 1.8rem;
  color: #555;
  margin-bottom: 2.5rem;
}

section {
  margin-bottom: 3rem;
}

.section-label {
  text-transform: uppercase;
  letter-spacing: .2rem;
  font-size: 1.4rem;
  color: #999;
  margin-bottom: 2rem;
}

.project {
  margin-bottom: 2.5rem;
}

.project h4 {
  font-size: 2.2rem;
  margin-bottom: .5rem;
}

.project h4 a {
  color: #222;
  text-decoration: none;
}

.project h4 a:hover {
  color: #33c3f0;
}

.year,
.tags {
  color: #999;
  font-size: 1.4rem;
}

.tags {
  margin-bottom: 0;
}

.year {
  display: inline-block;
  padding-top: .9rem;
}

.edit {
  border-bottom: 1px dashed #d1d1d1;
}

footer {
  padding: 2rem 0 4rem;
  border-top: 1px solid #e1e1e1;
}

footer p {
  margin-bottom: 0;
}


/* Project lists
–––––––––––––––––––––––––––––––––––––––––––––––––– */

.project ul {
  margin-bottom: 0;
  list-style: none;
  padding-left: 0;
}

.project ul li {
  position: relative;
  padding-left: 1.8rem;
  margin-bottom: .6rem;
  color: #444;
}

.project ul li:before {
  content: "";
  position: absolute;
  left: 0;
  top: .95rem;
  width: 8px;
  height: 1px;
  background: #c9c9c9;
}

.project .links {
  margin: 1.2rem 0 0;
  font-size: 1.4rem;
}

.project .links a {
  text-decoration: none;
  border-bottom: 1px solid #cdeaf7;
  padding-bottom: 1px;
}

.project .links a:hover { border-bottom-color: #33c3f0; }

.stack {
  color: #999;
  font-size: 1.3rem;
  margin-bottom: 0;
}

h6 {
  font-size: 1.4rem;
  letter-spacing: .05rem;
  margin-bottom: .8rem;
}

.contact-list a {
  line-height: 2.4;
}

/* Art slideshow
–––––––––––––––––––––––––––––––––––––––––––––––––– */

/* No frame around the paintings — they sit straight on the page, since most of
   them already have a strong border of their own. */
.slideshow {
  position: relative;
  outline: none;
  padding: 0 4.5rem;
  margin-bottom: 1.5rem;
}

.slide-viewport { overflow: hidden; }

.slide-track {
  display: flex;
  will-change: transform;
}

.slide {
  flex: 0 0 100%;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* A fixed image height keeps the page from jumping as portrait and landscape
   paintings follow one another. */
.slide-img {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 32rem;
  width: 100%;
}

.slide-img a {
  display: block;
  height: 100%;
  line-height: 0;
}

.slide img {
  max-height: 32rem;
  max-width: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.slide figcaption {
  text-align: center;
  font-size: 1.3rem;
  line-height: 1.5;
  color: #999;
  padding-top: 1.2rem;
}

.slide-nav {
  position: absolute;
  top: 16rem;
  transform: translateY(-50%);
  width: 3.6rem;
  height: 3.6rem;
  padding: 0;
  margin: 0;
  border: 1px solid #e1e1e1;
  border-radius: 50%;
  background: #fff;
  color: #888;
  font-size: 2rem;
  line-height: 3.4rem;
  cursor: pointer;
  z-index: 2;
}

.slide-nav:hover { color: #222; border-color: #bbb; }

.slide-prev { left: 0; }
.slide-next { right: 0; }

.slideshow:focus-visible .slide-nav { border-color: #33c3f0; color: #33c3f0; }

.slide-dots {
  display: flex;
  justify-content: center;
  gap: .7rem;
  padding-top: 1.6rem;
}

.slide-dot {
  width: 7px;
  height: 7px;
  padding: 0;
  margin: 0;
  border: none;
  border-radius: 50%;
  background: #dcdcdc;
  cursor: pointer;
  transition: background .3s ease, transform .3s ease;
}

.slide-dot:hover { background: #b0b0b0; }

.slide-dot.is-active { background: #33c3f0; transform: scale(1.35); }

/* Dragapult Drift
–––––––––––––––––––––––––––––––––––––––––––––––––– */

.game {
  border: 1px solid #e1e1e1;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 1rem;
  background: #fff;
}

.hud {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #e1e1e1;
  font-size: 1.3rem;
  color: #999;
  font-variant-numeric: tabular-nums;
}

.hud span { margin-right: 2.2rem; }
.hud b { color: #222; font-weight: 600; }

.stage { position: relative; }

#dp-canvas {
  display: block;
  width: 100%;
  height: auto;
  cursor: crosshair;
  touch-action: none;
  background: #0f1720;
}

/* The stage holds its shape before the 3D canvas exists, so pressing Play
   doesn't make the page jump. */
#dp-stage {
  aspect-ratio: 760 / 460;
  background: #0f1720;
}

.dp-loading {
  width: 100%;
  max-width: 26rem;
  height: 4px;
  background: rgba(255,255,255,.14);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 1.6rem;
}

.dp-loading i {
  display: block;
  height: 100%;
  width: 0;
  background: #7fe3ff;
  transition: width .25s ease;
}

#dp .overlay {
  background: rgba(15,23,32,.94);
}

#dp .overlay h5 { color: #eaf6ff; }
#dp .overlay > p { color: #9fb6c6; }

#dp .hud {
  background: #0f1720;
  border-bottom-color: #22303c;
  color: #7f97a8;
}

#dp .hud b { color: #eaf6ff; }

#dp .d-hint {
  background: #0f1720;
  border-top-color: #22303c;
  color: #6b8291;
}

#dp.game { background: #0f1720; border-color: #22303c; }

.d-hint {
  margin: 0;
  padding: 1rem 1.5rem;
  border-top: 1px solid #e1e1e1;
  font-size: 1.2rem;
  color: #aaa;
}

.overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.96);
  text-align: center;
  padding: 2rem;
}

.overlay[hidden] { display: none; }

.overlay h5 { margin-bottom: .4rem; }

.overlay > p {
  color: #777;
  font-size: 1.4rem;
  max-width: 38rem;
  margin-bottom: 1.6rem;
}

.overlay .button { margin-bottom: 0; }

/* Small screens
–––––––––––––––––––––––––––––––––––––––––––––––––– */

@media (max-width: 550px) {
  .page-banner {
    height: 10rem;
    margin-bottom: 2.5rem;
  }

  .site-header nav {
    text-align: left;
    padding-top: 1.5rem;
  }

  .site-header nav a {
    margin-left: 0;
    margin-right: 1.8rem;
    line-height: 2.4;
  }

  .year { padding-top: 0; }

  .project .four.columns { margin-bottom: 1rem; }

  .hud span { margin-right: 1.4rem; font-size: 1.2rem; }


  .slideshow { padding: 0 3.4rem; }
  .slide-img, .slide img { height: 21rem; max-height: 21rem; }
  .slide figcaption { font-size: 1.2rem; }
  .slide-nav { width: 2.8rem; height: 2.8rem; font-size: 1.6rem; line-height: 2.6rem; top: 10.5rem; }

  .overlay { padding: 1rem; }
  .overlay h5 { font-size: 1.6rem; margin-bottom: .3rem; }
  .overlay p { font-size: 1.2rem; line-height: 1.4; margin-bottom: 1rem; }
  .overlay .button { height: 3rem; line-height: 3rem; padding: 0 1.6rem; font-size: 1rem; }
  .overlay > p { font-size: 1.15rem; margin-bottom: .8rem; }
  .d-hint { display: none; }
}
