@import url("https://fonts.googleapis.com/css2?family=Architects+Daughter&family=Caveat:wght@500;600;700&family=Coming+Soon&family=Homemade+Apple&family=Kalam:wght@300;400&family=Patrick+Hand&family=Reenie+Beanie&display=swap");

:root {
  --paper: #fbf7e8;
  --paper-deep: #f4ecd2;
  --ink: #2f312c;
  --ink-soft: rgba(47, 49, 44, 0.72);
  --pencil: rgba(40, 41, 37, 0.58);
  --rule: rgba(72, 120, 172, 0.24);
  --highlight: rgba(255, 236, 91, 0.62);
  --highlight-green: rgba(178, 231, 147, 0.36);
  --title-scale: 1;
  --title-lift: 0px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--paper);
}

body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  font-family: "Homemade Apple", "Caveat", "Patrick Hand", cursive;
  background:
    radial-gradient(circle at 62px 50px, rgba(18, 17, 14, 0.9) 0 6.4px, rgba(18, 17, 14, 0.72) 6.8px, transparent 7.2px) 0 20px / 118px 126px repeat-y,
    repeating-linear-gradient(180deg, var(--paper) 0 34px, var(--rule) 35px 36px),
    radial-gradient(circle at 10% 20%, rgba(115, 105, 85, 0.08), transparent 18%),
    linear-gradient(120deg, var(--paper), var(--paper-deep));
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.33;
  background-image:
    radial-gradient(rgba(70, 64, 46, 0.18) 0.7px, transparent 0.8px),
    radial-gradient(rgba(255, 255, 255, 0.42) 0.8px, transparent 0.9px);
  background-position: 0 0, 9px 13px;
  background-size: 18px 18px, 21px 21px;
  mix-blend-mode: multiply;
}

body::after {
  content: none;
}

a {
  color: inherit;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.scroll-story {
  position: relative;
  z-index: 1;
  min-height: 360svh;
}

.notebook-stage {
  position: sticky;
  top: 0;
  height: 100svh;
  overflow: hidden;
  isolation: isolate;
}

.notebook-stage::before,
.notebook-stage::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.notebook-stage::before {
  display: none;
}

.notebook-stage::after {
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.34), transparent 26%, rgba(120, 101, 65, 0.08) 88%, transparent),
    radial-gradient(circle at 52% 45%, rgba(255, 251, 223, 0.38), transparent 28%);
}

.center-title {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 4;
  width: min(88vw, 920px);
  transform: translate(-50%, calc(-50% + var(--title-lift))) scale(var(--title-scale));
  transform-origin: 50% 50%;
  will-change: transform;
  filter:
    drop-shadow(0 1px 0 rgba(255, 255, 255, 0.38))
    drop-shadow(0 0.6px 0.4px rgba(32, 30, 22, 0.08));
}

.title-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.title-strokes {
  transform: translate(-82px, 6px) skewX(-14deg) rotate(-2.15deg);
  transform-box: fill-box;
  transform-origin: 50% 56%;
  filter:
    url("#pencil-line")
    drop-shadow(0.7px 0.4px 0 rgba(40, 41, 37, 0.12));
}

.hand-stroke {
  fill: none;
  stroke: rgba(40, 41, 37, 0.66);
  stroke-width: 4.1;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  opacity: 0;
  animation: draw-stroke 0.4s cubic-bezier(0.52, 0.02, 0.13, 1) calc(0.15s + var(--i) * 0.115s) forwards;
}

.hand-stroke.heavy {
  stroke: rgba(40, 41, 37, 0.74);
  stroke-width: 5.25;
}

.hand-stroke.light {
  stroke: rgba(40, 41, 37, 0.54);
  stroke-width: 3;
}

@keyframes draw-stroke {
  0% {
    opacity: 0;
    stroke-dashoffset: 1;
  }

  8% {
    opacity: 0.94;
  }

  to {
    opacity: 0.94;
    stroke-dashoffset: 0;
  }
}

.branch-map,
.node-cloud {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(96vw, 1040px);
  height: min(80svh, 760px);
  transform: translate(-50%, -50%);
}

.branch-map {
  z-index: 2;
  overflow: visible;
}

.branch {
  fill: none;
  stroke: rgba(55, 56, 50, 0.54);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  opacity: 0;
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.55));
}

.branch:nth-child(2n) {
  stroke-width: 2.5;
}

.node-cloud {
  z-index: 3;
  pointer-events: none;
}

.map-node {
  --node-reveal: 0;
  --node-scale: 0.86;
  --tilt: -2deg;
  position: absolute;
  left: var(--left);
  top: var(--top);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 7.2rem;
  min-height: 3.2rem;
  padding: 0.22rem 0.56rem 0.32rem;
  opacity: var(--node-reveal);
  transform: translate(-50%, -50%) rotate(var(--tilt)) scale(var(--node-scale));
  transform-origin: 50% 50%;
  color: rgba(41, 42, 38, 0.86);
  font-family: "Caveat", "Patrick Hand", cursive;
  font-size: clamp(2rem, 3.4vw, 3.3rem);
  font-weight: 700;
  letter-spacing: 0;
  line-height: 0.92;
  text-decoration: none;
  text-align: center;
  white-space: nowrap;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.58);
  filter: blur(var(--node-blur, 2px));
  will-change: opacity, transform, filter;
}

.map-node::before,
.page-link::before,
.back-link::before {
  content: "";
  position: absolute;
  left: -0.18em;
  right: -0.18em;
  top: 50%;
  height: 0.52em;
  z-index: -1;
  border-radius: 0.18em 0.34em 0.16em 0.28em;
  background:
    linear-gradient(90deg, transparent 0 4%, var(--highlight) 13% 72%, var(--highlight-green) 100%),
    linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.25) 45%, transparent);
  transform: scaleX(0) rotate(-1deg);
  transform-origin: left center;
  transition: transform 0.72s cubic-bezier(0.22, 0.75, 0.18, 1);
}

.map-node::after {
  content: "";
  position: absolute;
  inset: 0.38rem 0.2rem 0.1rem;
  z-index: -2;
  border-bottom: 2px solid rgba(42, 42, 37, 0.22);
  transform: rotate(-1deg);
}

.map-node:hover::before,
.map-node:focus-visible::before,
.page-link:hover::before,
.page-link:focus-visible::before,
.back-link:hover::before,
.back-link:focus-visible::before {
  transform: scaleX(1) rotate(-1deg);
}

.map-node:focus-visible,
.page-link:focus-visible,
.back-link:focus-visible {
  outline: 2px solid rgba(61, 81, 113, 0.42);
  outline-offset: 8px;
  border-radius: 0.35rem;
}

.map-node.is-live {
  pointer-events: auto;
}

.node-projects {
  --left: 19%;
  --top: 20%;
  --tilt: -5deg;
}

.node-research {
  --left: 82%;
  --top: 16%;
  --tilt: 4deg;
}

.node-skills {
  --left: 18%;
  --top: 66%;
  --tilt: 3deg;
}

.node-about {
  --left: 82%;
  --top: 66%;
  --tilt: -3deg;
}

.node-contact {
  --left: 50%;
  --top: 90%;
  --tilt: 1deg;
}

.page-body {
  min-height: 100svh;
  font-family: "Caveat", "Patrick Hand", cursive;
}

.page-shell {
  position: relative;
  z-index: 1;
  width: min(1040px, calc(100vw - 46px));
  margin: 0 auto;
  padding: clamp(34px, 8vw, 84px) 0 72px;
}

.back-link {
  position: relative;
  display: inline-block;
  margin-bottom: clamp(36px, 6vw, 64px);
  color: rgba(38, 39, 35, 0.82);
  font-family: "Caveat", "Patrick Hand", cursive;
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 600;
  text-decoration: none;
}

.page-sheet {
  position: relative;
  padding: clamp(18px, 4vw, 34px) clamp(18px, 5vw, 44px) clamp(30px, 6vw, 58px);
}

.page-sheet h1 {
  margin: 0 0 22px;
  color: rgba(38, 39, 35, 0.86);
  font-family: "Caveat", "Patrick Hand", cursive;
  font-size: clamp(3.5rem, 9vw, 6.8rem);
  font-weight: 600;
  letter-spacing: 0;
  line-height: 68px;
}

.page-sheet p {
  max-width: 58ch;
  margin: 0;
  color: var(--ink-soft);
  font-family: "Caveat", "Patrick Hand", cursive;
  font-size: clamp(1.55rem, 3vw, 2.2rem);
  font-weight: 500;
  letter-spacing: 0;
  line-height: 34px;
}

.page-link {
  position: relative;
  color: inherit;
  text-decoration: none;
}

.content-page {
  color: rgba(39, 40, 36, 0.84);
}

.page-kicker {
  margin-bottom: clamp(28px, 5vw, 46px) !important;
  font-size: clamp(1.85rem, 3.3vw, 2.65rem) !important;
  line-height: 34px !important;
}

.project-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(24px, 4vw, 42px) clamp(30px, 5vw, 58px);
  align-items: start;
}

.feature-note {
  grid-column: 1 / -1;
  max-width: 920px;
}

.wide-note {
  grid-column: 1 / -1;
  max-width: 920px;
}

.research-list {
  grid-template-columns: 1fr;
  max-width: 900px;
}

.note-card {
  position: relative;
  padding: 0 0 clamp(20px, 3vw, 30px);
  border-bottom: 0;
}

.note-card header {
  margin-bottom: 10px;
}

.note-eyebrow {
  display: inline-block;
  margin-bottom: 2px;
  margin-right: 14px;
  color: rgba(47, 49, 44, 0.54);
  font-size: clamp(1.25rem, 2.2vw, 1.65rem);
  font-weight: 500;
  line-height: 34px;
}

.pending-note {
  display: inline-block;
  color: rgba(47, 49, 44, 0.62);
  font-size: clamp(1.2rem, 2.1vw, 1.55rem);
  font-weight: 500;
  line-height: 34px;
}

.heading-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.title-note-row {
  align-items: flex-start;
  flex-wrap: wrap;
  position: relative;
  padding-right: 13rem;
  min-height: 68px;
}

.title-note-row .pending-note {
  position: absolute;
  right: 0;
  top: 0;
  max-width: 12rem;
  transform: rotate(3deg);
}

.note-card h2,
.two-column-note h2 {
  margin: 0;
  color: rgba(37, 38, 34, 0.86);
  font-family: "Caveat", "Patrick Hand", cursive;
  font-size: clamp(2.1rem, 4vw, 3.5rem);
  font-weight: 600;
  letter-spacing: 0;
  line-height: 34px;
}

.note-card p,
.about-note p,
.two-column-note p {
  max-width: none;
  font-size: clamp(1.5rem, 2.5vw, 2.05rem);
  font-weight: 500;
  line-height: 34px;
}

.note-card p + p,
.about-note p + p {
  margin-top: 16px;
}

.note-points {
  display: grid;
  gap: 8px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  color: rgba(47, 49, 44, 0.68);
  font-size: clamp(1.38rem, 2.2vw, 1.85rem);
  font-weight: 500;
  line-height: 34px;
}

.note-points li {
  position: relative;
  padding-left: 1.1em;
}

.note-points li::before {
  content: "";
  position: absolute;
  left: 0.16em;
  top: 0.52em;
  width: 0.34em;
  height: 0.34em;
  border-radius: 50%;
  background: rgba(47, 49, 44, 0.54);
}

.note-links,
.contact-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  margin-top: 18px;
  font-size: clamp(1.55rem, 2.8vw, 2.15rem);
  font-weight: 600;
}

.soft-note {
  margin-top: 14px !important;
  color: rgba(47, 49, 44, 0.58) !important;
}

.compact-page {
  max-width: 880px;
}

.skill-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 18px;
  margin: 6px 0 clamp(34px, 6vw, 54px);
}

.skill-cloud span {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0.04em 0.28em 0.1em;
  color: rgba(39, 40, 36, 0.82);
  font-size: clamp(1.55rem, 3.2vw, 2.2rem);
  font-weight: 500;
  line-height: 34px;
}

.skill-cloud span::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.08em;
  height: 0.42em;
  z-index: -1;
  background: rgba(255, 236, 91, 0.28);
  transform: rotate(-1deg);
}

.two-column-note {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(26px, 5vw, 52px);
}

.two-column-note section {
  min-width: 0;
}

.about-note {
  display: grid;
  gap: 0;
  max-width: 760px;
}

.highlight-word {
  position: relative;
  display: inline-block;
}

.highlight-word::after {
  content: "";
  position: absolute;
  left: -0.05em;
  right: -0.05em;
  bottom: 0.18em;
  height: 0.38em;
  z-index: -1;
  background: rgba(178, 231, 147, 0.34);
  transform: rotate(-1deg);
}

.contact-item {
  display: inline-block;
}

.doodle,
.mini-doodle {
  flex: 0 0 auto;
  fill: none;
  stroke: rgba(40, 41, 37, 0.68);
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cat-doodle {
  width: 82px;
  height: 62px;
}

.hopping-cat {
  animation: cat-hop 5.2s ease-in-out infinite;
  transform-origin: 50% 80%;
}

.mini-doodle {
  width: 42px;
  height: 32px;
  stroke-width: 2.5;
}

.cute-about {
  position: relative;
  padding-top: 10px;
  padding-right: 160px;
  max-width: 940px;
}

.about-cat {
  position: absolute;
  width: 72px;
  height: 56px;
  opacity: 0.72;
}

.left-cat {
  right: 74px;
  top: -12px;
  transform: rotate(-8deg);
}

.right-cat {
  right: 0;
  top: 42px;
  transform: rotate(7deg);
}

.about-icons {
  display: flex;
  gap: 18px;
  margin: 2px 0;
  height: 34px;
  align-items: center;
}

@keyframes cat-hop {
  0%,
  64%,
  100% {
    transform: translateY(0) rotate(-2deg);
  }

  70% {
    transform: translateY(-12px) rotate(4deg);
  }

  76% {
    transform: translateY(0) rotate(-3deg);
  }

  82% {
    transform: translateY(-7px) rotate(3deg);
  }
}

@media (max-width: 760px) {
  body {
    background:
      radial-gradient(circle at 27px 44px, rgba(18, 17, 14, 0.9) 0 5.2px, rgba(18, 17, 14, 0.72) 5.6px, transparent 6px) 0 18px / 54px 112px repeat-y,
      repeating-linear-gradient(180deg, var(--paper) 0 30px, var(--rule) 31px 32px),
      linear-gradient(120deg, var(--paper), var(--paper-deep));
  }

  body::after {
    content: none;
  }

  .notebook-stage::before {
    display: none;
  }

  .center-title {
    width: 94vw;
  }

  .title-strokes {
    transform: translate(-82px, 6px) skewX(-14deg) rotate(-2.15deg);
  }

  .page-shell {
    width: auto;
    margin-left: 58px;
    margin-right: 18px;
  }

  .page-sheet h1 {
    font-size: clamp(3.25rem, 15vw, 5.2rem);
    line-height: 60px;
  }

  .page-sheet p,
  .page-kicker,
  .note-card p,
  .about-note p,
  .two-column-note p,
  .note-points,
  .note-eyebrow,
  .pending-note,
  .skill-cloud span {
    line-height: 30px !important;
  }

  .project-list,
  .two-column-note {
    grid-template-columns: 1fr;
  }

  .note-card {
    padding-bottom: 24px;
  }

  .heading-row {
    align-items: flex-start;
  }

  .title-note-row {
    display: block;
    padding-right: 0;
    min-height: 0;
  }

  .title-note-row .pending-note {
    position: static;
    display: block;
    max-width: none;
    transform: none;
  }

  .cat-doodle {
    width: 64px;
    height: 50px;
  }

  .about-cat {
    position: relative;
    right: auto;
    top: auto;
    display: inline-block;
    margin: -8px 12px 10px 0;
  }

  .cute-about {
    padding-right: 0;
  }

  .branch-map,
  .node-cloud {
    width: 110vw;
    height: 74svh;
  }

  .map-node {
    min-width: 5.4rem;
    min-height: 2.65rem;
    font-size: clamp(1.72rem, 8vw, 2.65rem);
  }

  .node-projects {
    --left: 29%;
    --top: 18%;
  }

  .node-research {
    --left: 72%;
    --top: 17%;
  }

  .node-skills {
    --left: 29%;
    --top: 66%;
  }

  .node-about {
    --left: 72%;
    --top: 66%;
  }

  .node-contact {
    --top: 89%;
  }
}

@media (max-width: 480px) {
  .scroll-story {
    min-height: 390svh;
  }

  .center-title {
    width: 94vw;
  }

  .title-strokes {
    transform: translate(-82px, 6px) skewX(-14deg) rotate(-2.15deg);
  }

  .branch {
    stroke-width: 2.4;
  }

  .node-cloud {
    width: 114vw;
  }

  .map-node {
    min-width: 4.8rem;
    padding-inline: 0.3rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hand-stroke {
    animation-duration: 0.01ms;
    animation-delay: 0s;
  }

  .map-node::before,
  .page-link::before,
  .back-link::before {
    transition-duration: 0.01ms;
  }
}
