/* Page layout and defaults */
:root {
  --font-segoe: "Segoe UI Variable", "Segoe UI", Arial, sans-serif;
  --font-montserrat: "Montserrat", var(--font-segoe);
  --font-alikin: "Alkin", "Alikin", var(--font-montserrat);
}

main {
  --curve-gray: #6d6d6d;
  --content-width: 1320px;
  width: 100%;
  container-type: inline-size;
}
.content-width {
  width: 100%;
  max-width: var(--content-width);
  margin-inline: auto;
  container-type: inline-size;
}

* {
  box-sizing: border-box;
}
body {
  margin: 0;
  color: #000;
  font-family: var(--font-segoe);
  font-weight: 300;
}
a {
  color: inherit;
}

/* Hero and navigation */
header {
  --welcome-size: min(121px, 9.167cqw, 18vh);
  --welcome-top: 29.8%;
  --welcome-line-height: 0.77;
  --brand-enter-offset: 52vw;
  height: 100vh;
  height: 90dvh;
  position: relative;
  overflow: hidden;
  background: var(--curve-gray);
}
.hero-content {
  position: relative;
  height: 100%;
}
.curve {
  position: absolute;
  background: black;
  inset: -9% -40% -7% 20.5%;
  border-radius: 50% 0 0 50%;
}
@supports (clip-path: shape(from 0 0, line to 100% 100%, close)) {
  .curve {
    inset: 0;
    border-radius: 0;
    clip-path: shape(
      from 50% 0,
      line to 100% 0,
      line to 100% 100%,
      line to 50% 100%,
      curve to var(--s-bend, 20.5%) 50% with 38% calc(100% - 6cqw) / var(--s-bend, 20.5%) 72%,
      curve to 50% 0 with var(--s-bend, 20.5%) 28% / 38% 6cqw,
      close
    );
  }
}
.letter {
  --b-span: 30%;
  position: absolute;
  inset: 0 0 0 auto;
  width: var(--b-span);
  background: black;
  scale: -1 1;
}
.letter:before,
.letter:after {
  content: "";
  position: absolute;
  background: white;
  left: 0;
  border-radius: 0 55% 55% 0 / 0 50% 50% 0;
}
.letter:before {
  top: 0;
  width: calc(94% * var(--b-scale, 1));
  height: 50.5%;
}
.letter:after {
  bottom: 0;
  width: calc(100% * var(--b-scale, 1));
  height: 54%;
  border-bottom-right-radius: 100% 50%;
}
.hero-navigation,
h1,
.introduction {
  position: absolute;
}
.hero-navigation {
  --logo-width: clamp(54px, 5.9cqw, 78px);
  inset-block-start: clamp(4px, 0.8cqw, 10px);
  inset-inline-start: clamp(12px, 1.5cqw, 20px);
  display: grid;
  justify-items: start;
  gap: clamp(8px, 1cqw, 14px);
}
.hero-logo {
  /* The PNG has transparent padding to the left of the mark. */
  margin-inline-start: calc(var(--logo-width) * -0.135);
}
.logo {
  display: block;
  width: var(--logo-width);
  height: auto;
}
nav {
  display: grid;
  gap: clamp(6px, 0.75cqw, 10px);
  font-family: var(--font-montserrat);
  font-size: clamp(16px, 2.1cqw, 28px);
}
nav a {
  text-decoration: none;
}
nav a:hover,
nav [aria-current] {
  text-decoration: underline;
  text-underline-offset: 0.14em;
}
nav.nav-fixed {
  position: fixed;
  z-index: 2;
  inset: 0 0 auto;
  display: flex;
  justify-content: center;
  gap: clamp(0.75rem, 4vw, 2rem);
  padding: 0.75rem 1rem;
  background: #fff;
  font-size: 1rem;
}
#work,
#contact {
  scroll-margin-top: 3.5rem;
}
h1 {
  top: var(--welcome-top);
  left: 50%;
  font-family: var(--font-alikin);
  font-size: var(--welcome-size);
  line-height: var(--welcome-line-height);
  font-weight: 400;
  margin: 0;
  color: white;
  mix-blend-mode: difference;
}
.welcome-lead,
.welcome-brand {
  display: block;
}
@media (prefers-reduced-motion: no-preference) {
  #home {
    --intro-enter-duration: 480ms;
    --brand-enter-duration: 700ms;
    --welcome-drop-start: calc(var(--intro-enter-duration) + var(--brand-enter-duration));
    --welcome-drop-duration: 980ms;
  }

  .intro,
  .name {
    animation: intro-enter var(--intro-enter-duration) ease-out both;
  }

  .welcome-brand {
    animation: shahbytes-enter var(--brand-enter-duration)
      cubic-bezier(0.2, 0.7, 0.3, 1) var(--intro-enter-duration) both;
  }

  .welcome-lead {
    animation: welcome-drop var(--welcome-drop-duration) var(--welcome-drop-start) both;
  }

  .letter {
    animation: letter-enter 700ms cubic-bezier(0.2, 0.7, 0.3, 1)
      calc(var(--welcome-drop-start) + var(--welcome-drop-duration)) both;
  }
}
@keyframes letter-enter {
  from {
    translate: 101% 0;
  }
  to {
    translate: 0 0;
  }
}
@keyframes intro-enter {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes shahbytes-enter {
  from {
    transform: translateX(var(--brand-enter-offset));
  }
  to {
    transform: translateX(0);
  }
}
@keyframes welcome-drop {
  from {
    transform: translateY(-60vh);
    animation-timing-function: ease-in;
  }
  52%,
  80% {
    transform: translateY(0);
    animation-timing-function: ease-out;
  }
  66% {
    transform: translateY(-0.32em);
    animation-timing-function: ease-in;
  }
  90% {
    transform: translateY(-0.1em);
    animation-timing-function: ease-in;
  }
  to {
    transform: translateY(0);
  }
}
.welcome-to {
  position: relative;
}
.heading-baseline {
  display: inline-block;
  width: 0;
  height: 0;
}
.introduction {
  --intro-size: min(3.45cqw, 6vh);
  top: calc(var(--welcome-top) + 2 * var(--welcome-line-height) * var(--welcome-size));
  inset-inline: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: calc(var(--intro-size) * 1.22);
  column-gap: 2.4cqw;
  align-items: baseline;
  color: white;
}
.intro {
  grid-column: 1;
  justify-self: end;
  font-size: var(--intro-size);
  line-height: 1.22;
}
.intro:nth-child(3) {
  grid-row: 3;
}
.social {
  margin: 0;
  padding: 0;
  list-style: none;
}
.social:not([hidden]) {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(6px, 0.6cqw, 8px);
}
.social a,
.social img {
  display: block;
}
.social a:focus-visible {
  outline: 2px solid #767676;
  outline-offset: -2px;
}
.social img {
  width: clamp(24px, 2.5cqw, 33px);
  aspect-ratio: 1;
  object-fit: contain;
}
.name {
  grid-area: 3 / 2;
  font-size: min(4.85cqw, 8vh);
  /* Keep the larger name on the baseline without shifting the "is" line. */
  line-height: 0;
  white-space: nowrap;
  mix-blend-mode: difference;
}
/* Shared backgrounds */
.about,
footer {
  background: #202020;
  color: white;
  position: relative;
  isolation: isolate;
  overflow: hidden;
}
.about::before,
footer::before,
footer::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  clip-path: polygon(
    0 0,
    50% 0,
    74% 17%,
    91% 33%,
    97% 46%,
    94% 59%,
    83% 72%,
    72% 85%,
    69% 100%,
    45% 100%,
    26% 76%,
    10% 48%,
    0 32%
  );
  clip-path: shape(
    from 0 0,
    line to 50% 0,
    curve to 97% 46% with var(--curve-entry, 68% 12%) / 97% 28%,
    curve to 69% 100% with 97% 66% / 69% 75%,
    line to 45% 100%,
    curve to 0 32% with 25% 81% / 9% 52%,
    close
  );
}
footer::before {
  background: white;
}
.about::before,
footer::after {
  background: var(--curve-gray);
}
.about::before {
  --curve-entry: 62% 6cqw;
}
footer::after {
  transform: translate(-4px, 3px);
}
footer::before,
footer::after {
  rotate: 180deg;
}
/* About */
.about {
  /* Match the hero under the antialiased top edge of the clip path. */
  background:
    linear-gradient(to right, var(--curve-gray) 50%, black 50%) top / 100% 2px
      no-repeat,
    black;
  padding-block: min(4cqw, calc(var(--content-width) * 0.04));
  text-align: center;
  line-height: 1.36;
}
.about p {
  margin: 0;
  padding-inline: 5.6cqw;
  font-size: 3.55cqw;
}
.about p + p {
  margin-top: 6cqw;
}
/* Technology stack */
.stack {
  overflow: hidden;
  padding-block: min(2.25cqw, calc(var(--content-width) * 0.0225));
}
.ticker {
  overflow: hidden;
  font-size: min(3.5cqw, calc(var(--content-width) * 0.035));
}
.ticker:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: -2px;
}
.ticker-track {
  display: grid;
}
.ticker-track--moving {
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  width: max-content;
  min-width: 200%;
  animation: technology-scroll 22s linear infinite;
}
.ticker:hover .ticker-track,
.ticker:focus-within .ticker-track {
  animation-play-state: paused;
}
.ticker-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-around;
  gap: 0.25em 0.75em;
  margin: 0;
  padding: 0 0.375em;
  list-style: none;
}
.ticker-list li {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  white-space: nowrap;
}
.ticker-list img {
  width: 1em;
  height: 1em;
  object-fit: contain;
}
.ticker-track--moving .ticker-list {
  flex-wrap: nowrap;
}
.ticker-track--moving li::after {
  content: "·" / "";
  margin-inline-start: 0.4em;
}
@keyframes technology-scroll {
  to {
    transform: translateX(-50%);
  }
}
@media (prefers-reduced-motion: reduce) {
  .ticker-track--moving {
    width: auto;
    min-width: 0;
    animation: none;
  }
  .ticker-track--moving .ticker-list {
    flex-wrap: wrap;
  }
  .ticker-list[aria-hidden="true"] {
    display: none;
  }
}
/* Work and contact */
.footer-content {
  min-height: min(68cqw, calc(var(--content-width) * 0.68));
  padding-block: min(9cqw, calc(var(--content-width) * 0.09));
  padding-inline: min(8%, calc(var(--content-width) * 0.08));
  display: grid;
  align-content: start;
  gap: min(4cqw, calc(var(--content-width) * 0.04));
}
footer section {
  background: #202020;
  padding: 1.3rem 2rem;
  max-width: 35rem;
}
#work {
  min-width: 0;
  max-width: none;
}
.contact-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.contact-field {
  display: grid;
  align-content: start;
  gap: 0.4rem;
}
.contact-form input:not([type="hidden"]),
.contact-form textarea {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid #999;
  border-radius: 0;
  color: white;
  background: black;
  font: inherit;
}
.contact-form textarea {
  resize: vertical;
}
.contact-message,
.contact-actions,
.contact-status,
.contact-form noscript {
  grid-column: 1 / -1;
}
.contact-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
}
.contact-actions button {
  padding: 0.65rem 1rem;
  border: 1px solid white;
  border-radius: 0;
  background: white;
  color: black;
  font: inherit;
  cursor: pointer;
}
.contact-actions button:disabled {
  opacity: 0.6;
  cursor: default;
}
.contact-form :focus-visible {
  outline: 2px solid white;
  outline-offset: 3px;
}
.contact-status {
  margin: 0;
  font-size: 0.9rem;
}
.contact-error {
  font-size: 0.85rem;
}
footer h2 {
  font-size: 2rem;
  font-weight: 300;
  margin: 0 0 0.7rem;
}
summary {
  cursor: pointer;
}
.work-gallery {
  min-width: 0;
  margin-top: 0.9rem;
  background: black;
  color: white;
}
.work-slides {
  --work-columns: 3;
  --work-gap: 0.75rem;
  display: flex;
  gap: var(--work-gap);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.work-slides::-webkit-scrollbar {
  display: none;
}
.work-card {
  flex: 0 0 calc((100% - (var(--work-columns) - 1) * var(--work-gap)) / var(--work-columns));
  min-width: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid white;
  scroll-snap-align: start;
  text-decoration: none;
}
.work-card:focus-visible {
  outline: 2px solid white;
  outline-offset: -4px;
}
.work-card:hover strong,
.work-card:focus-visible strong {
  text-decoration: underline;
  text-underline-offset: 0.18em;
}
.work-card-copy {
  display: grid;
  gap: 0.4rem;
  padding: 0.75rem 0.85rem;
}
.work-card-copy span {
  font-size: 0.9rem;
  line-height: 1.4;
}
.work-preview-image {
  display: block;
  width: 100%;
  aspect-ratio: 2 / 1;
  object-fit: cover;
  object-position: top;
  filter: grayscale(1);
}
.work-preview {
  aspect-ratio: 2 / 1;
  overflow: hidden;
  padding: 6%;
  background: white;
  color: black;
}
.preview-dashboard {
  display: grid;
  grid-template-columns: 1fr 4fr;
  gap: 7%;
}
.preview-sidebar {
  background: black;
}
.preview-bars {
  display: flex;
  align-items: end;
  justify-content: space-evenly;
  border-bottom: 1px solid black;
}
.preview-bars i {
  width: 12%;
  height: 48%;
  background: black;
}
.preview-bars i:nth-child(2n) {
  height: 70%;
}
.preview-bars i:nth-child(3n) {
  height: 57%;
}
.preview-bars i:last-child {
  height: 92%;
}
.preview-terminal {
  display: grid;
  align-content: center;
  gap: 0.3em;
  border: 1px solid white;
  background: black;
  color: white;
  font: clamp(11px, 1.65cqw, 18px) / 1.1 monospace;
}
.preview-journal {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 5%;
  font: clamp(1.1rem, 3.8cqw, 3rem) / 0.95 Georgia, serif;
}
.preview-journal i {
  width: min(100%, 8rem);
  justify-self: center;
  aspect-ratio: 1;
  border-radius: 50%;
  background: repeating-linear-gradient(-42deg, black 0 5px, white 5px 10px);
}
.preview-catalog {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: center;
  gap: 6%;
}
.preview-catalog i {
  aspect-ratio: 3 / 4;
  border: 1px solid black;
  background: radial-gradient(circle, black 30%, transparent 31%);
}
.preview-layout {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 6%;
}
.preview-layout i {
  background: black;
}
.preview-layout i:first-child {
  grid-area: span 2 / span 2;
}
.preview-layout i:last-child {
  grid-column: span 2;
}
.preview-dashboard[data-variant="alternate"] .preview-bars,
.preview-layout[data-variant="alternate"] {
  direction: rtl;
}
.preview-journal[data-variant="alternate"] i {
  border-radius: 0;
}
.preview-catalog[data-variant="alternate"] i {
  background: linear-gradient(white 48%, black 48%);
}
.work-gallery-controls:not([hidden]) {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  padding-block: 0.35rem;
}
.work-gallery-dots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}
.work-gallery-dots button {
  display: grid;
  place-items: center;
  width: clamp(15px, 2.4cqw, 28px);
  height: 1.75rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: white;
  background: transparent;
  cursor: pointer;
}
.work-gallery-dots button::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border: 1px solid currentColor;
  border-radius: 50%;
}
.work-gallery-dots button[aria-current="true"]::before {
  background: currentColor;
}
.work-gallery-dots button:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: -2px;
}
.work-gallery-controls > button,
.project-dialog button {
  min-height: 2rem;
  background: black;
  color: white;
  border: 1px solid white;
  padding-inline: clamp(0.25rem, 1cqw, 0.65rem);
  font: inherit;
  cursor: pointer;
}
.work-gallery-controls > button {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 0;
}
.work-gallery-controls > button:hover {
  color: black;
  background: white;
}
.work-gallery-controls[data-static] > button {
  display: none;
}
.gallery-arrow {
  position: relative;
  width: 1rem;
  height: 0.75rem;
}
.gallery-arrow::before,
.gallery-arrow::after {
  content: "";
  position: absolute;
  top: 50%;
}
.gallery-arrow::before {
  inset-inline: 1px;
  height: 1px;
  background: currentColor;
  transform: translateY(-50%);
}
.gallery-arrow::after {
  right: 2px;
  width: 0.4rem;
  height: 0.4rem;
  border-top: 1px solid currentColor;
  border-right: 1px solid currentColor;
  transform: translateY(-50%) rotate(45deg);
}
[data-gallery-step="-1"] .gallery-arrow {
  transform: scaleX(-1);
}
.project-dialog {
  width: min(48rem, calc(100% - 2rem));
  max-height: calc(100dvh - 2rem);
  padding: clamp(1rem, 3vw, 2rem);
  color: white;
  background: black;
  border: 1px solid white;
}
.project-dialog::backdrop {
  background: rgb(0 0 0 / 0.75);
}
.project-dialog-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
}
.project-dialog h2 {
  margin: 0;
  font-size: clamp(1.4rem, 4vw, 2rem);
  font-weight: 400;
}
.project-category,
.project-technologies {
  font-size: 0.9rem;
}
.project-description {
  line-height: 1.5;
}
.project-links:not([hidden]) {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  margin-block: 1rem;
}
.project-images {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: 1rem;
  margin-top: 1rem;
}
.project-images figure {
  min-width: 0;
  margin: 0;
  border: 1px solid white;
}
.project-images .work-preview-image {
  object-fit: contain;
}
.project-images figcaption {
  padding: 0.5rem 0.7rem;
  font-size: 0.9rem;
}
.footer-content > a {
  width: fit-content;
  background: #202020;
  padding: 0.6rem;
}
@media (max-width: 920px) {
  #home {
    --welcome-size: min(16cqw, 96px);
    --brand-enter-offset: 105vw;
    height: auto;
    background: white;
  }
  .curve,
  .letter {
    display: none;
  }
  .hero-content {
    height: auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: clamp(1.6rem, 6cqw, 3.5rem);
    padding: 1rem clamp(1rem, 4cqw, 2.5rem) clamp(2rem, 6cqw, 3.5rem);
  }
  .hero-navigation {
    position: relative;
    inset: auto;
    z-index: 1;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 0.5rem clamp(0.6rem, 2cqw, 1.5rem);
    background: white;
  }
  .hero-navigation nav:not(.nav-fixed) {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-self: end;
    justify-content: flex-end;
    column-gap: clamp(0.6rem, 2cqw, 1.25rem);
    row-gap: 0;
  }
  .hero-navigation .social {
    grid-area: 2 / 2;
    justify-self: end;
  }
  .hero-navigation nav:not(.nav-fixed) a {
    display: flex;
    align-items: center;
    min-height: 2.5rem;
    white-space: nowrap;
  }
  #home h1 {
    position: relative;
    inset: auto;
    color: black;
    mix-blend-mode: normal;
  }
  .introduction {
    position: static;
    display: block;
    color: black;
  }
  .intro {
    font-size: clamp(1rem, 2.6cqw, 1.4rem);
  }
  .name {
    display: block;
    margin-top: 0.25rem;
    font-size: clamp(1.5rem, 5.4cqw, 2.65rem);
    line-height: 1.15;
    white-space: normal;
    mix-blend-mode: normal;
  }
  .about p {
    font-size: clamp(18px, 3.55cqw, 30px);
  }
  #contact {
    max-width: none;
  }
  .work-slides {
    --work-columns: 2;
  }
}
/* Mobile layout */
@media (max-width: 600px) {
  .contact-form {
    grid-template-columns: 1fr;
  }
  .work-slides {
    --work-columns: 1;
  }
  .about {
    padding-block: 10cqw;
  }
  .about p {
    font-size: clamp(18px, 4.8cqw, 28px);
    padding-inline: 6cqw;
  }
  .ticker {
    font-size: 5cqw;
  }
  .footer-content {
    gap: 1rem;
    padding: 3rem 5%;
  }
  #work,
  #contact {
    padding-inline: 1rem;
  }
}
