:root {
  --ink: #050505;
  --paper: #ffffff;
  --sky: rgba(82, 148, 176, 0.42);
  --focus: #f4d35e;
  --panel-shadow: rgba(0, 0, 0, 0.24);
  --sidebar-width: 400px;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  color: var(--ink);
  background: var(--paper);
  font-family: "Source Code Pro", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 20px;
}

button,
input {
  font: inherit;
}

.site-shell {
  display: flex;
  min-height: 100vh;
  width: 100vw;
}

.sidebar {
  position: relative;
  z-index: 5;
  display: flex;
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  min-height: 100vh;
  flex-direction: column;
  align-items: stretch;
  border-right: 6px solid var(--ink);
  background: var(--paper);
  padding-top: 15px;
  text-align: center;
}

.portrait-link {
  display: block;
  margin: 0 100px 12px;
  line-height: 0;
  border-radius: 999px;
  outline-offset: 6px;
}

.portrait {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  border-radius: 999px;
  object-fit: cover;
}

.nav-links {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.link {
  display: block;
  width: 100%;
  min-height: 40px;
  border: 0;
  border-radius: 0;
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  font-size: 20px;
  font-weight: 700;
  line-height: 30px;
  padding: 5px 10px;
  text-align: center;
  text-decoration: none;
  transition: background-color 140ms ease, color 140ms ease;
}

.link:hover,
.link:focus-visible {
  background: var(--ink);
  color: var(--paper);
}

.link-button {
  appearance: none;
}

.site-year {
  display: flex;
  flex: 1;
  align-items: flex-end;
  justify-content: center;
  padding: 16px 0;
  font-weight: 300;
}

.stage {
  position: relative;
  isolation: isolate;
  flex: 1;
  min-width: 0;
  min-height: 100vh;
  overflow: hidden;
  background-color: var(--sky);
  background-image:
    url("assets/palms.png"),
    url("assets/skater.png"),
    url("assets/la-skyline.webp"),
    url("assets/clouds.webp");
  background-position: 0 100%, 0 100%, 0 100%, 0 0;
  background-repeat: repeat-x;
  background-size: auto 100%, auto 100%, auto 100%, 400px 260px;
  animation: para 50s infinite linear;
}

.scene-glow {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0) 34%),
    linear-gradient(90deg, rgba(255, 244, 184, 0.28), rgba(173, 226, 230, 0) 38%);
  pointer-events: none;
}

.contact-card {
  position: absolute;
  inset: 50% auto auto 50%;
  width: min(440px, calc(100vw - var(--sidebar-width) - 48px));
  transform: translate(-50%, -50%);
  border: 5px solid var(--ink);
  background: var(--paper);
  box-shadow: 12px 12px 0 var(--panel-shadow);
  padding: 24px 24px 26px;
}

.contact-card[hidden] {
  display: none;
}

.contact-card h1 {
  margin: 0 40px 20px 0;
  font-size: 24px;
  line-height: 1.2;
}

.contact-card form {
  display: grid;
  gap: 14px;
}

.contact-card label {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  font-weight: 600;
}

.contact-card input {
  width: 100%;
  min-width: 0;
  border: 3px solid var(--ink);
  border-radius: 0;
  background: var(--paper);
  color: var(--ink);
  padding: 5px 8px;
}

.contact-card input:focus-visible,
.close-button:focus-visible,
.submit-button:focus-visible,
.portrait-link:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.submit-button,
.close-button {
  appearance: none;
  border-radius: 0;
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  font-weight: 700;
}

.submit-button {
  justify-self: start;
  margin-top: 10px;
  border: 3px solid var(--ink);
  padding: 5px 35px;
}

.close-button {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 3px solid var(--ink);
  font-size: 26px;
  line-height: 1;
}

.submit-button:hover,
.close-button:hover {
  background: var(--ink);
  color: var(--paper);
}

@keyframes para {
  100% {
    background-position: -500px 95%, 800px 100%, -180px 100%, 400px 0;
  }
}

@media (max-width: 760px) {
  :root {
    --sidebar-width: 124px;
  }

  body {
    font-size: 16px;
  }

  .sidebar {
    border-right-width: 5px;
    padding-top: 12px;
  }

  .portrait-link {
    margin: 0 12px 10px;
  }

  .link {
    min-height: 38px;
    font-size: 15px;
    line-height: 24px;
    padding: 7px 6px;
    overflow-wrap: anywhere;
  }

  .stage {
    background-position: center 100%, center 100%, center 100%, 0 0;
    background-size: auto 100%, auto 100%, auto 100%, 340px 220px;
  }

  .contact-card {
    left: calc(var(--sidebar-width) + ((100vw - var(--sidebar-width)) / 2));
    width: min(360px, calc(100vw - var(--sidebar-width) - 22px));
    padding: 20px 16px 22px;
  }

  .contact-card label {
    grid-template-columns: 1fr;
    gap: 6px;
    font-size: 15px;
  }

  .contact-card h1 {
    font-size: 21px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .stage {
    animation: none;
  }

  .link {
    transition: none;
  }
}
