:root {
  /* Change the whole look here. */
  --background: #f5efe0;
  --ink: #1f1d19;
  --muted: #6b6557;

  --serif: "Instrument Serif", Georgia, serif;
  --mono: "DM Mono", ui-monospace, Consolas, monospace;
  --gutter: clamp(20px, 4vw, 48px);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);

  color-scheme: light;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: var(--gutter);
  background: var(--background);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 300;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

:focus-visible {
  outline: 1px solid var(--ink);
  outline-offset: 4px;
}

/* Header */

.top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.logo {
  display: inline-flex;
  font-family: var(--serif);
  font-style: italic;
  font-size: 44px;
  line-height: 1;
  transition: opacity 0.2s ease;
}

.logo-s {
  transition: transform 0.45s var(--ease);
}

.logo-j {
  margin-left: -0.13em;
  transform: translateY(0.14em);
  transition: transform 0.45s var(--ease);
}

@media (hover: hover) {
  .logo:hover .logo-s {
    transform: translateX(-0.05em);
  }

  .logo:hover .logo-j {
    transform: translate(0.05em, 0);
  }
}

/* Projects button and dropdown */

.nav {
  display: flex;
  align-items: center;
  gap: 18px;
  padding-top: 8px;
}

.nav-item {
  position: relative;
}

.person-button {
  padding-left: 4px;
}

.person {
  display: block;
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.1;
  stroke-linecap: round;
  transition: transform 0.3s var(--ease);
}

.person-button:hover .person,
.person-button[aria-expanded="true"] .person {
  transform: translateY(-1px);
}

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

.nav-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0 8px 12px;
  margin: -8px 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  cursor: pointer;
}

.nav-label,
.text-link,
.menu-link .menu-name {
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0 1px;
  padding-bottom: 2px;
  transition: background-size 0.3s var(--ease);
}

@media (hover: hover) {
  .nav-button:hover .nav-label,
  .text-link:hover,
  .menu-link:hover .menu-name {
    background-size: 100% 1px;
  }
}

.caret {
  width: 6px;
  height: 6px;
  margin-top: -3px;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.3s var(--ease), margin 0.3s var(--ease);
}

.nav-button[aria-expanded="true"] .caret {
  margin-top: 3px;
  transform: rotate(225deg);
}

.menu {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 10;
  min-width: 220px;
  max-height: 70vh;
  margin: 12px 0 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
  text-align: right;
  visibility: hidden;
  transition: visibility 0s linear 0.2s;
}

.menu.open {
  visibility: visible;
  transition-delay: 0s;
}

.menu li {
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.menu.open li {
  opacity: 1;
  transform: none;
  transition: opacity 0.3s ease, transform 0.4s var(--ease);
  transition-delay: calc(var(--i) * 45ms);
}

.menu-link,
.menu-item {
  display: flex;
  justify-content: flex-end;
  align-items: baseline;
  gap: 14px;
  padding: 7px 0;
  white-space: nowrap;
}

#personal-menu {
  opacity: 0;
  transform: translateY(-6px);
  transition: visibility 0s linear 0.2s, opacity 0.16s ease, transform 0.16s ease;
}

#personal-menu.open {
  opacity: 1;
  transform: none;
  transition: opacity 0.3s ease, transform 0.4s var(--ease);
}

.menu-action {
  display: block;
  width: 100%;
  padding: 7px 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-align: right;
  white-space: nowrap;
  cursor: pointer;
}

.menu-action[hidden] {
  display: none;
}

.menu-action .menu-name {
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0 1px;
  padding-bottom: 2px;
  transition: background-size 0.3s var(--ease);
}

@media (hover: hover) {
  .menu-action:hover .menu-name {
    background-size: 100% 1px;
  }
}

.login {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 4px 0;
  border-bottom: 1px solid var(--ink);
}

.login[hidden] {
  display: none;
}

.login input {
  width: 100%;
  min-width: 0;
  padding: 2px 0;
  border: 0;
  outline: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-size: 16px;
  letter-spacing: inherit;
  text-align: right;
}

.login input::placeholder {
  color: var(--muted);
}

.login button {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.login-message {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.login-message:empty {
  display: none;
}

.menu-note {
  color: var(--muted);
  font-size: 11px;
}

.menu-item .menu-name {
  color: var(--muted);
}

/* Name */

.hero {
  align-self: end;
  padding: 64px 0 40px;
}

.hero h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(52px, 11vw, 148px);
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: -0.02em;
}

.hero p {
  margin: 16px 0 0;
  color: var(--muted);
}

/* Footer */

.bottom {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  color: var(--muted);
  font-size: 12px;
}

/* First load */

.top,
.hero,
.bottom {
  animation: rise 0.8s var(--ease) both;
}

.hero {
  animation-delay: 0.08s;
}

.bottom {
  animation-delay: 0.16s;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
