:root {
  --paper: #fff;
  --ink: #070707;
  --muted: #555;
  --grid: rgba(0, 0, 0, 0.085);
  --grid-strong: rgba(0, 0, 0, 0.16);
  --study: #564b3c;
  --study-soft: #fefaf1;
  --depths: #d20000;
  --depths-blue: #071f36;
  --cv: #ffb238;
  --contact: #111;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(var(--grid-strong) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-strong) 1px, transparent 1px),
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px),
    var(--paper);
  background-size: 96px 96px, 96px 96px, 24px 24px, 24px 24px;
  font-family: "Space Grotesk", system-ui, sans-serif;
  overflow-x: hidden;
}

body.is-intro {
  overflow: hidden;
}

body.is-intro .landing {
  padding: 0;
}

a {
  color: inherit;
}

.landing {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 18px;
}

.hero {
  width: min(100%, 980px);
  display: grid;
  gap: 24px;
  justify-items: center;
}

body.is-intro .hero {
  width: 100%;
  min-height: 100vh;
  display: grid;
  place-items: center;
}

body.is-intro .portrait-wrap,
body.is-intro .subheading-row,
body.is-intro .portal-grid {
  position: absolute;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.portrait-wrap {
  --portrait-tilt: -1deg;
  width: min(48vw, 188px);
  aspect-ratio: 1 / 1.12;
  display: grid;
  place-items: end center;
  overflow: hidden;
  background: #fff;
  border: 2px solid var(--ink);
  box-shadow: 8px 8px 0 var(--ink);
  transform: rotate(var(--portrait-tilt));
  transition: transform 140ms ease-out;
}

.portrait {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  filter: saturate(0.92) contrast(1.04);
}

.intro {
  text-align: center;
  display: grid;
  gap: 3px;
  justify-items: stretch;
  width: 100%;
  transition:
    transform 820ms cubic-bezier(0.2, 0.9, 0.2, 1),
    opacity 360ms ease;
  will-change: transform;
}

body.is-intro .intro {
  width: min(100%, 980px);
  justify-items: center;
  text-align: center;
  align-self: center;
  transform: translate(0, 0);
}

body.is-transitioning .portrait-wrap,
body.is-transitioning .subheading-row,
body.is-transitioning .portal-grid {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

body.intro-done .portrait-wrap,
body.intro-done .subheading-row,
body.intro-done .portal-grid {
  animation: content-swoosh-in 720ms cubic-bezier(0.2, 0.9, 0.2, 1) both;
}

body.intro-done .portrait-wrap {
  animation-name: portrait-swoosh-in;
}

body.intro-done .subheading-row {
  animation-delay: 90ms;
}

body.intro-done .portal-grid {
  animation-delay: 170ms;
}

.subheading-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px 18px;
  flex-wrap: wrap;
  width: 100%;
}

.eyebrow {
  margin: 0;
  font-size: clamp(0.94rem, 2.15vw, 1.18rem);
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted);
}

.typed-name {
  min-height: 1.02em;
  margin: 0;
  max-width: 100%;
  font-size: clamp(2.28rem, 11.8vw, 7.25rem);
  line-height: 0.92;
  font-weight: 900;
  letter-spacing: 0;
  white-space: nowrap;
}

.caret {
  display: inline-block;
  width: 0.08em;
  height: 0.78em;
  margin-left: 0.06em;
  transform: translateY(0.08em);
  background: var(--ink);
  animation: blink 780ms steps(1) infinite;
}

.typed-name.is-done .caret {
  animation-duration: 1100ms;
}

.linkedin-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  color: #0a66c2;
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
}

.linkedin-mark {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  background: #0a66c2;
  color: #fff;
  font-family: Arial, sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1;
}

.portal-grid {
  width: min(100%, 780px);
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 4px;
}

.portal {
  min-height: 78px;
  position: relative;
  isolation: isolate;
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 15px 18px;
  border: 2px solid var(--ink);
  border-radius: 0;
  overflow: hidden;
  text-decoration: none;
  color: var(--ink);
  background: #fff;
  box-shadow: 5px 5px 0 var(--ink);
  transform: translate(0, 0);
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.portal-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0;
  transition: opacity 160ms ease;
}

.portal-label,
.portal-note {
  position: relative;
  z-index: 2;
}

.portal-label {
  font-size: clamp(1.42rem, 7vw, 2.15rem);
  font-weight: 800;
  line-height: 1;
}

.portal-note {
  color: currentColor;
  font-size: 0.82rem;
  opacity: 0.68;
}

.portal-studybreak {
  grid-template-columns: minmax(0, 1fr) 44px;
  font-family: "Sniglet", "Space Grotesk", sans-serif;
  background: #fff;
  border-color: var(--study);
  color: var(--study);
}

.portal-studybreak .portal-label,
.portal-studybreak .portal-note {
  grid-column: 1;
  z-index: 3;
}

.studybreak-cup {
  position: relative;
  z-index: 4;
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  justify-self: end;
  width: 40px;
  height: 40px;
  object-fit: contain;
  transition: filter 160ms ease, transform 160ms ease;
}

.bean-layer {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}

.bean {
  position: absolute;
  left: var(--bean-x);
  top: -44px;
  width: var(--bean-size);
  height: calc(var(--bean-size) * 1.2);
  background: url("assets/bean.png") center / contain no-repeat;
  opacity: var(--bean-opacity);
  transform: translateY(0) rotate(var(--bean-rotate-start));
  animation: bean-rain var(--bean-duration) linear forwards;
}

.portal-depths {
  padding-left: 82px;
  font-family: "Red Hat Display", system-ui, sans-serif;
  background: #fff;
  color: #101010;
  border-color: #101010;
}

.portal-depths .portal-label {
  font-family: "Righteous", "Red Hat Display", sans-serif;
  font-size: clamp(1.45rem, 6vw, 1.92rem);
  font-weight: 400;
  white-space: nowrap;
}

.portal-depths .portal-bg {
  background: var(--depths-blue);
}

.hook-mark {
  position: absolute;
  left: 18px;
  top: -2px;
  z-index: 3;
  width: 31px;
  height: 74px;
  transform: none;
  overflow: visible;
  display: block;
  pointer-events: none;
}

.hook-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center top;
  display: block;
  transition: opacity 140ms ease;
}

.hook-img-white {
  opacity: 0;
}

.fish-layer,
.fish-layer::before,
.fish-layer::after {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.fish-layer {
  overflow: hidden;
}

.fish {
  position: absolute;
  right: -34px;
  top: var(--fish-y);
  width: var(--fish-w);
  height: calc(var(--fish-w) * 0.42);
  opacity: var(--fish-o);
  transform: translateX(0);
  animation: fish-swim var(--fish-d) linear forwards;
}

.fish::before {
  content: "";
  position: absolute;
  left: 0;
  top: 18%;
  width: 76%;
  height: 64%;
  background: currentColor;
  border-radius: 50%;
}

.fish::after {
  content: "";
  position: absolute;
  right: 0;
  top: 0;
  width: 40%;
  height: 100%;
  background: currentColor;
  clip-path: polygon(0 50%, 100% 0, 78% 50%, 100% 100%);
}

.portal-cv {
  border-color: #8a5a00;
  color: #17130b;
}

.portal-contact {
  border-color: #111;
  color: #111;
  background: #fff;
}

@media (hover: hover) and (pointer: fine) {
  .portal:hover {
    transform: translate(-2px, -2px);
    box-shadow: 8px 8px 0 var(--ink);
  }

  .portal:hover .portal-bg {
    opacity: 1;
  }

  .portal-studybreak:hover {
    background: var(--study);
    color: #fff;
    border-color: var(--study);
  }

  .portal-studybreak:hover .studybreak-cup {
    transform: translateY(-1px);
  }

  .portal-depths:hover {
    background: var(--depths-blue);
    border-color: var(--depths-blue);
    color: #fff;
  }

  .portal-depths:hover .hook-mark img {
    filter: none;
  }

  .portal-depths:hover .hook-img-black {
    opacity: 0;
  }

  .portal-depths:hover .hook-img-white {
    opacity: 1;
  }

  .portal-cv:hover {
    background: #ffb238;
    border-color: #8a5a00;
    color: #17130b;
  }

  .portal-contact:hover {
    background:
      repeating-linear-gradient(135deg, #111 0 10px, #2c2c2c 10px 20px);
    border-color: #111;
    color: #fff;
  }

  .portal:active {
    transform: translate(1px, 1px);
    box-shadow: 2px 2px 0 var(--ink);
  }
}

@media (min-width: 720px) {
  .landing {
    padding: 48px;
  }

  .hero {
    grid-template-columns: 180px minmax(0, 1fr);
    align-items: center;
    justify-items: stretch;
    gap: 28px 40px;
  }

  body.is-intro .hero {
    grid-template-columns: 1fr;
  }

  .portrait-wrap {
    grid-row: 1 / span 2;
    width: 180px;
  }

  .intro {
    text-align: left;
    align-self: end;
  }

  .subheading-row {
    justify-content: space-between;
  }

  .portal-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-self: start;
  }
}

@media (min-width: 1040px) {
  .hero {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .portrait-wrap {
    width: 220px;
  }

  .portal {
    min-height: 96px;
    padding: 20px 22px;
  }

  .portal-depths {
    padding-left: 96px;
  }

  .hook-mark {
    left: 24px;
    width: 35px;
    height: 86px;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #101010;
    --ink: #f7f7f0;
    --muted: #b7b7ac;
    --grid: rgba(255, 255, 255, 0.075);
    --grid-strong: rgba(255, 255, 255, 0.14);
  }

  .portrait-wrap,
  .portal {
    background: #101010;
  }

  .portrait-wrap {
    border-color: #f7f7f0;
    box-shadow: 8px 8px 0 #f7f7f0;
  }

  .portal {
    border-color: #f7f7f0;
    box-shadow: 5px 5px 0 #f7f7f0;
  }

  .portal-cv {
    color: #f7f7f0;
  }

  .portal-studybreak,
  .portal-depths,
  .portal-contact {
    color: #f7f7f0;
  }

  .portal-depths .hook-img-black {
    opacity: 0;
  }

  .portal-depths .hook-img-white {
    opacity: 1;
  }
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

@keyframes fish-swim {
  from {
    transform: translateX(0) translateY(var(--fish-drift-start));
  }

  to {
    transform: translateX(calc(-100% - 430px)) translateY(var(--fish-drift-end));
  }
}

@keyframes bean-rain {
  from {
    transform: translateY(-24px) rotate(var(--bean-rotate-start));
  }

  to {
    transform: translateY(calc(100% + 132px)) rotate(var(--bean-rotate-end));
  }
}

@keyframes content-swoosh-in {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.96);
    filter: blur(5px);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

@keyframes portrait-swoosh-in {
  from {
    opacity: 0;
    filter: blur(5px);
  }

  to {
    opacity: 1;
    filter: blur(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}
