@import url("https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&display=swap");

:root {
  --paper: #f3f0e9;
  --ink: #171715;
  --muted: #706e67;
  --line: rgba(23, 23, 21, 0.22);
  --orange: #ff5a36;
  --serif: "Instrument Serif", Georgia, serif;
  --sans: "Manrope", sans-serif;
  --mono: "DM Mono", monospace;
  --pad-x: clamp(1.25rem, 3.2vw, 3.5rem);
  --pad-y: clamp(1rem, 2.3vh, 1.65rem);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
}

body::selection {
  background: var(--orange);
  color: var(--paper);
}

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

.skip-link {
  position: fixed;
  z-index: 100;
  top: 1rem;
  left: 1rem;
  padding: 0.65rem 0.9rem;
  background: var(--ink);
  color: var(--paper);
  font: 0.68rem var(--mono);
  transform: translateY(-180%);
}

.skip-link:focus {
  transform: translateY(0);
}

.grain {
  position: fixed;
  z-index: 10;
  inset: 0;
  pointer-events: none;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.92' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.75'/%3E%3C/svg%3E");
}

.page-shell {
  display: grid;
  width: 100%;
  height: 100svh;
  grid-template-rows: auto minmax(0, 1fr) auto;
  padding: 0 var(--pad-x);
}

.site-header,
.site-footer {
  display: grid;
  min-width: 0;
  grid-template-columns: 1fr 1.2fr 0.85fr auto;
  align-items: center;
  min-height: clamp(3.9rem, 8vh, 5.2rem);
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: clamp(0.56rem, 0.65vw, 0.68rem);
  text-transform: uppercase;
  letter-spacing: 0.055em;
}

.wordmark {
  width: fit-content;
  font-weight: 500;
  font-size: 0.76rem;
  letter-spacing: 0.12em;
}

.wordmark span {
  margin-left: 0.35rem;
  color: var(--orange);
  font-size: 0.48rem;
  vertical-align: 0.08rem;
}

.site-header p,
.site-footer p {
  margin: 0;
}

.location {
  color: var(--muted);
}

.contact-link {
  display: flex;
  gap: 1rem;
  align-items: center;
  padding: 0.65rem 0 0.55rem;
  border-bottom: 1px solid var(--ink);
  transition: color 200ms ease, border-color 200ms ease;
}

.contact-link:hover,
.contact-link:focus-visible {
  color: var(--orange);
  border-color: var(--orange);
}

.layout {
  display: grid;
  width: 100%;
  min-height: 0;
  min-width: 0;
  grid-template-columns: minmax(0, 1.35fr) minmax(24rem, 0.65fr);
  gap: clamp(3rem, 7vw, 8rem);
  padding: var(--pad-y) 0;
}

.intro {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}

.kicker,
.section-label,
.work-number,
.work-type,
.site-footer {
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.055em;
}

.kicker {
  margin: 0;
  color: var(--muted);
  font-size: clamp(0.56rem, 0.65vw, 0.68rem);
}

h1 {
  position: relative;
  z-index: 2;
  max-width: 8.7ch;
  margin: auto 0;
  padding: 0.3rem 0 0.7rem;
  font-family: var(--serif);
  font-size: clamp(4.6rem, 8.2vw, 9.4rem);
  font-weight: 400;
  line-height: 0.79;
  letter-spacing: -0.055em;
}

h1 .line {
  display: block;
  padding-bottom: 0.08em;
  overflow: hidden;
}

h1 .line > span {
  display: block;
  transform: translateY(115%);
  animation: title-in 900ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

h1 .line:nth-child(2) > span {
  animation-delay: 90ms;
}

h1 .line:nth-child(3) > span {
  animation-delay: 180ms;
}

h1 em {
  color: var(--orange);
  font-weight: 400;
}

@keyframes title-in {
  to { transform: translateY(0); }
}

.summary {
  position: relative;
  z-index: 2;
  max-width: 39rem;
  margin: 0;
  color: var(--muted);
  font-size: clamp(0.78rem, 1.05vw, 1rem);
  line-height: 1.55;
}

.motion-mark {
  --tilt-x: 0deg;
  --tilt-y: 0deg;
  position: absolute;
  right: 3%;
  bottom: 5%;
  width: clamp(11rem, 19vw, 19rem);
  aspect-ratio: 1;
  opacity: 0.92;
  transform: perspective(700px) rotateX(var(--tilt-x)) rotateY(var(--tilt-y));
  transition: transform 220ms ease-out;
}

.ring {
  position: absolute;
  border: 1px solid var(--ink);
  border-radius: 50%;
}

.ring-one {
  inset: 0;
  animation: spin 18s linear infinite;
}

.ring-two {
  inset: 18%;
  border-color: var(--orange);
  animation: spin-reverse 12s linear infinite;
}

.ring i {
  position: absolute;
  top: 48%;
  left: -0.26rem;
  width: 0.52rem;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--ink);
}

.ring-two i {
  top: 9%;
  right: 7%;
  left: auto;
  background: var(--orange);
}

.mark-core {
  position: absolute;
  inset: 36%;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  font: clamp(0.42rem, 0.55vw, 0.55rem)/1.45 var(--mono);
  text-align: center;
  letter-spacing: 0.08em;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes spin-reverse {
  to { transform: rotate(-360deg); }
}

.resume {
  display: grid;
  min-height: 0;
  min-width: 0;
  grid-template-rows: 1.25fr 0.75fr;
  border-left: 1px solid var(--line);
}

.resume-section {
  min-height: 0;
  min-width: 0;
  padding-left: clamp(1.4rem, 2.4vw, 2.8rem);
}

.resume-section + .resume-section {
  padding-top: clamp(1rem, 2.2vh, 1.8rem);
  border-top: 1px solid var(--line);
}

.section-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: clamp(0.9rem, 2vh, 1.45rem);
  color: var(--muted);
  font-size: clamp(0.5rem, 0.58vw, 0.6rem);
}

.section-label h2 {
  margin: 0;
  color: var(--ink);
  font: inherit;
}

.work-list {
  min-width: 0;
  border-top: 1px solid var(--ink);
}

.work-item {
  display: grid;
  min-width: 0;
  grid-template-columns: 2rem 1fr auto;
  gap: 0.7rem;
  align-items: center;
  min-height: clamp(4.15rem, 8.5vh, 5.5rem);
  border-bottom: 1px solid var(--line);
  transition: padding 250ms ease, background 250ms ease;
}

.work-item:hover {
  padding: 0 0.7rem;
  background: rgba(255, 90, 54, 0.07);
}

.work-number,
.work-type {
  color: var(--muted);
  font-size: clamp(0.48rem, 0.55vw, 0.58rem);
}

.work-item h3 {
  margin: 0 0 0.15rem;
  font-family: var(--serif);
  font-size: clamp(1.45rem, 2.1vw, 2.1rem);
  font-weight: 400;
  line-height: 1;
}

.work-item > div {
  min-width: 0;
}

.work-item p {
  margin: 0;
  color: var(--muted);
  font-size: clamp(0.58rem, 0.75vw, 0.75rem);
  line-height: 1.4;
}

.profile > p {
  max-width: 34rem;
  margin: 0 0 clamp(1rem, 2vh, 1.5rem);
  font-family: var(--serif);
  font-size: clamp(1.15rem, 1.55vw, 1.55rem);
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.profile dl {
  margin: 0;
  border-top: 1px solid var(--line);
}

.profile dl div {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  padding: clamp(0.45rem, 1vh, 0.75rem) 0;
  border-bottom: 1px solid var(--line);
  font: clamp(0.48rem, 0.56vw, 0.58rem) var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.profile dt {
  color: var(--muted);
}

.profile dd {
  margin: 0;
}

.site-footer {
  min-height: clamp(2.7rem, 5.5vh, 3.6rem);
  border-top: 1px solid var(--line);
  border-bottom: 0;
  color: var(--muted);
}

.site-footer a {
  color: var(--ink);
  text-transform: lowercase;
}

.intro-item {
  opacity: 0;
  transform: translateY(0.7rem);
  animation: item-in 700ms 300ms ease forwards;
}

.resume.intro-item {
  animation-delay: 500ms;
}

.site-footer.intro-item {
  animation-delay: 650ms;
}

@keyframes item-in {
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 850px) {
  .site-header {
    grid-template-columns: 1fr auto;
  }

  .role,
  .location {
    display: none;
  }

  .layout {
    grid-template-columns: 1fr;
    grid-template-rows: 0.9fr 1.1fr;
    gap: var(--pad-y);
  }

  .intro {
    border-bottom: 1px solid var(--line);
  }

  h1 {
    margin: auto 0;
    font-size: clamp(3.7rem, 15vw, 6.8rem);
  }

  .summary {
    max-width: 28rem;
    margin-bottom: var(--pad-y);
  }

  .motion-mark {
    right: 2%;
    bottom: 4%;
    width: clamp(8rem, 31vw, 13rem);
    opacity: 0.45;
  }

  .resume {
    grid-template-columns: 1.2fr 0.8fr;
    grid-template-rows: 1fr;
    border-left: 0;
  }

  .resume-section {
    padding-left: 0;
    padding-right: 1.2rem;
  }

  .resume-section + .resume-section {
    padding-top: 0;
    padding-right: 0;
    padding-left: 1.2rem;
    border-top: 0;
    border-left: 1px solid var(--line);
  }

  .site-footer {
    grid-template-columns: 1fr auto;
  }

  .site-footer p:nth-child(2) {
    display: none;
  }
}

@media (max-width: 560px) {
  .page-shell {
    padding: 0 1rem;
  }

  .site-header {
    min-height: 3.4rem;
  }

  .site-header .contact-link {
    max-width: 5.5rem;
    justify-self: end;
    gap: 0.45rem;
    font-size: 0.47rem;
  }

  .layout {
    grid-template-rows: minmax(15rem, 0.86fr) minmax(0, 1.14fr);
    gap: 0.7rem;
    padding: 0.7rem 0;
  }

  .kicker {
    font-size: 0.48rem;
  }

  h1 {
    max-width: 10ch;
    padding: 0.15rem 0 0.35rem;
    font-size: clamp(3.25rem, 16vw, 4.8rem);
    line-height: 0.8;
  }

  .summary {
    max-width: 24rem;
    margin-bottom: 0.7rem;
    padding-right: 4rem;
    font-size: 0.68rem;
    line-height: 1.42;
  }

  .motion-mark {
    right: -0.5rem;
    bottom: 0.4rem;
    width: 7.5rem;
  }

  .resume {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto;
  }

  .resume-section {
    padding-right: 0;
  }

  .resume-section + .resume-section {
    padding: 0.65rem 0 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .section-label {
    margin-bottom: 0.45rem;
    font-size: 0.45rem;
  }

  .work-item {
    grid-template-columns: 1.5rem 1fr auto;
    min-height: 3.55rem;
  }

  .work-item h3 {
    font-size: 1.35rem;
  }

  .work-item p {
    font-size: 0.53rem;
  }

  .work-number,
  .work-type {
    font-size: 0.43rem;
  }

  .profile .section-label,
  .profile dl {
    display: none;
  }

  .profile > p {
    max-width: 100%;
    margin: 0;
    padding-right: 0.2rem;
    font-size: 0.86rem;
    line-height: 1.15;
  }

  .site-footer {
    min-height: 2.5rem;
    font-size: 0.48rem;
  }

  .site-footer a {
    justify-self: end;
    font-size: 0.45rem;
  }
}

@media (max-height: 680px) and (min-width: 851px) {
  h1 {
    font-size: clamp(4.2rem, 7.1vw, 7.5rem);
  }

  .work-item {
    min-height: 3.75rem;
  }

  .profile > p {
    font-size: 1.05rem;
    margin-bottom: 0.7rem;
  }

  .section-label {
    margin-bottom: 0.65rem;
  }
}

@media (max-height: 700px) and (max-width: 560px) {
  .layout {
    grid-template-rows: minmax(12rem, 0.72fr) minmax(0, 1.28fr);
  }

  h1 {
    font-size: 3rem;
  }

  .summary,
  .profile {
    display: none;
  }

  .resume {
    display: block;
  }

  .work-item {
    min-height: 3.25rem;
  }
}

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

  h1 .line > span,
  .intro-item {
    opacity: 1;
    transform: none;
  }
}
