:root {
  --background: #fff;
  --foreground: #0a0a0a;
  --muted: #737373;
  --soft: #f5f5f5;
  --border: #e5e5e5;
  --primary: #171717;
  --primary-foreground: #fafafa;
  --card: #fff;
  --dock: rgba(255, 255, 255, 0.86);
  --toast: rgba(255, 255, 255, 0.94);
}

body.dark {
  --background: #121212;
  --foreground: #fafafa;
  --muted: #a1a1a1;
  --soft: #262626;
  --border: rgba(255, 255, 255, 0.13);
  --primary: #e5e5e5;
  --primary-foreground: #171717;
  --card: #171717;
  --dock: rgba(24, 24, 24, 0.88);
  --toast: rgba(24, 24, 24, 0.94);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  padding-bottom: 108px;
  transition: background 180ms ease, color 180ms ease;
}

a {
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
}

button {
  font: inherit;
}

.page-shell {
  max-width: 672px;
  margin: 0 auto;
  padding: 96px 24px 128px;
}

.portfolio {
  position: relative;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  gap: 56px;
}

.frog-layer {
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: 18;
}

.frog-layer.collecting-active {
  z-index: 320;
}

.frog {
  position: absolute;
  z-index: 18;
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  isolation: isolate;
  pointer-events: auto;
  transition: opacity 220ms ease, transform 240ms ease;
}

.frog img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  user-select: none;
  transition: transform 240ms ease;
}

.frog:hover {
  transform: translateY(-3px) scale(1.08) rotate(-4deg);
}

.frog.collecting {
  z-index: 321;
  overflow: visible;
  pointer-events: none;
  transform: translateY(-20px) scale(1.32) rotate(8deg);
}

.frog.collecting img {
  animation: none;
  transform: translateX(0) scale(1.1);
}

.frog-right.collecting img {
  animation: none;
  transform: translateX(0) scaleX(-1) scale(1.1);
}

.frog.collected {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-26px) scale(0.8) rotate(18deg);
}

.frog-right img {
  transform: scaleX(-1);
}

.frog-left {
  left: -22px;
  overflow: hidden;
}

.frog-left img {
  transform: translateX(-21px);
  animation: frog-peek-left 2.8s ease-in-out infinite;
}

.frog-right {
  right: -22px;
  overflow: hidden;
}

.frog-left.collecting {
  left: -6px;
}

.frog-right.collecting {
  right: -6px;
}

.frog-right img {
  transform: translateX(21px) scaleX(-1);
  animation: frog-peek-right 3.1s ease-in-out infinite;
}

.frog-1 {
  top: 9%;
}

.frog-2 {
  top: 29%;
}

.frog-3 {
  top: 43%;
}

.frog-4 {
  top: 58%;
}

.frog-5 {
  top: 73%;
}

.frog-6 {
  top: 88%;
}

.hero {
  position: relative;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  gap: 24px;
}

.hero-copy {
  order: 1;
}

.hero h1 {
  margin: 0;
  font-size: clamp(30px, 6vw, 48px);
  line-height: 1;
  font-weight: 600;
  letter-spacing: -0.05em;
}

.hero p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.35;
}

.wave {
  display: inline-block;
  margin-left: 0.14em;
  transform-origin: 70% 75%;
  animation: hero-wave 2.2s ease-in-out infinite;
}

.avatar-block {
  order: 2;
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.avatar {
  display: grid;
  width: 128px;
  height: 128px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--soft);
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.frog-hint {
  position: relative;
  display: inline-block;
  margin-top: 3px;
  padding-left: 8px;
  color: var(--muted);
  font-family: "Comic Sans MS", "Bradley Hand", cursive;
  font-size: 13px;
  line-height: 1.25;
  white-space: nowrap;
  transform: rotate(-5deg);
}

.frog-hint::after {
  content: "";
  position: absolute;
  right: 2px;
  bottom: -3px;
  left: 8px;
  height: 6px;
  border-bottom: 2px solid rgba(120, 214, 69, 0.55);
  border-radius: 999px;
}

body.dark .frog-hint {
  color: var(--muted);
}

.frog-hint span {
  color: inherit;
}

.section {
  position: relative;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.section h2,
.contact h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
  font-weight: 700;
}

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

.prose {
  margin: 0;
  font-size: 16px;
  line-height: 1.65;
}

.prose a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.timeline-list {
  display: grid;
  gap: 20px;
}

.resume-row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
}

.resume-row img {
  width: 40px;
  height: 40px;
  flex: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  object-fit: contain;
}

.logo-initial {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--primary);
  color: var(--primary-foreground);
  font-size: 14px;
  font-weight: 800;
}

.resume-row h3 {
  margin: 0;
  font-size: 14px;
  line-height: 1.1;
  font-weight: 650;
}

.resume-row p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.resume-row .resume-note {
  max-width: 380px;
  margin-top: 6px;
  color: #8a8a8a;
  font-size: 12px;
  line-height: 1.45;
}

.resume-row time {
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
  padding-top: 3px;
}

.skills {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.skills span {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  gap: 5px;
  border: 1px solid #e8e8e8;
  border-radius: 999px;
  background: var(--soft);
  padding: 3px 9px;
  color: var(--foreground);
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.skills img {
  width: 13px;
  height: 13px;
  object-fit: contain;
}

.projects-section {
  position: relative;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.label-wrap {
  display: grid;
  width: min(100%, 360px);
  grid-template-columns: minmax(40px, 1fr) auto minmax(40px, 1fr);
  align-items: center;
  gap: 12px;
}

.label-wrap::before,
.label-wrap::after {
  display: block;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--border));
  content: "";
}

.label-wrap::after {
  background: linear-gradient(to right, var(--border), transparent);
}

.section-kicker {
  display: inline-flex;
  width: max-content;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--primary);
  padding: 6px 14px;
  color: var(--primary-foreground);
  font-size: 13px;
  font-weight: 650;
}

.projects-section h2 {
  margin: 10px 0 0;
  font-size: 32px;
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.05em;
  text-align: center;
}

.center-text {
  margin: 8px 0 18px;
  text-align: center;
}

.project-grid {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.bottom-dock {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100vw - 24px);
  border: 1px solid rgba(229, 229, 229, 0.9);
  border-radius: 999px;
  background: var(--dock);
  padding: 9px 18px;
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.92);
  transform: translateX(-50%);
  backdrop-filter: blur(18px);
}

.dock-item {
  position: relative;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #858585;
  cursor: pointer;
  text-decoration: none;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}

.dock-item svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.dock-item:hover,
.dock-item:focus-visible {
  background: var(--soft);
  color: var(--foreground);
  outline: none;
  transform: scale(1.14) translateY(-3px);
}

.dock-item::before {
  position: absolute;
  bottom: calc(100% + 14px);
  left: 50%;
  border-radius: 13px;
  background: #171717;
  padding: 8px 13px;
  color: #fff;
  content: attr(data-tooltip);
  font-size: 12px;
  font-weight: 650;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(6px);
  transition: opacity 160ms ease, transform 160ms ease;
  white-space: nowrap;
}

.dock-item::after {
  position: absolute;
  bottom: calc(100% + 7px);
  left: 50%;
  width: 13px;
  height: 13px;
  background: #171717;
  content: "";
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(6px) rotate(45deg);
  transition: opacity 160ms ease, transform 160ms ease;
}

.dock-item:hover::before,
.dock-item:hover::after,
.dock-item:focus-visible::before,
.dock-item:focus-visible::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.dock-item:hover::after,
.dock-item:focus-visible::after {
  transform: translateX(-50%) translateY(0) rotate(45deg);
}

.dock-devpost span {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 7px;
  background: #858585;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.dock-devpost:hover span,
.dock-devpost:focus-visible span {
  background: var(--foreground);
  color: var(--background);
}

.dock-frog {
  width: 46px;
  height: 46px;
  background: #d9ffb7;
}

.dock-frog img {
  width: 30px;
  height: 30px;
  object-fit: contain;
}

.dock-count {
  min-width: 42px;
  color: #6f6f6f;
  font-size: 25px;
  line-height: 1;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.dock-divider {
  width: 1px;
  height: 30px;
  background: #e6e6e6;
  margin: 0 6px;
}

.project-card {
  position: relative;
  display: flex;
  min-height: 442px;
  overflow: hidden;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
}

.project-card > img {
  width: 100%;
  aspect-ratio: 1.42;
  border-bottom: 1px solid var(--border);
  object-fit: cover;
}

.project-links {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: flex-end;
}

.project-links a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 999px;
  background: var(--primary);
  padding: 5px 10px;
  color: var(--primary-foreground);
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
}

.project-links a[href*="github"]::before {
  width: 13px;
  height: 13px;
  background: currentColor;
  content: "";
  mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M12 .5A12 12 0 0 0 8.2 23.9c.6.1.8-.3.8-.6v-2.1c-3.3.7-4-1.4-4-1.4-.5-1.4-1.3-1.8-1.3-1.8-1.1-.7.1-.7.1-.7 1.2.1 1.8 1.2 1.8 1.2 1.1 1.8 2.8 1.3 3.5 1 .1-.8.4-1.3.8-1.6-2.7-.3-5.5-1.3-5.5-5.9 0-1.3.5-2.4 1.2-3.2-.1-.3-.5-1.6.1-3.2 0 0 1-.3 3.3 1.2a11.4 11.4 0 0 1 6 0c2.3-1.5 3.3-1.2 3.3-1.2.6 1.6.2 2.9.1 3.2.8.8 1.2 1.9 1.2 3.2 0 4.6-2.8 5.6-5.5 5.9.4.4.8 1.1.8 2.2v3.2c0 .3.2.7.8.6A12 12 0 0 0 12 .5Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.project-body {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  padding: 16px;
}

.project-body h3 {
  margin: 0;
  font-size: 14px;
  line-height: 1.1;
  font-weight: 700;
}

.project-body p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.project-body ul {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: auto 0 0;
  padding: 14px 0 0;
  list-style: none;
}

.project-body li {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--soft);
  padding: 5px 10px;
  color: var(--foreground);
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
}

.frog-toast {
  position: fixed;
  right: 24px;
  bottom: 104px;
  z-index: 180;
  width: min(470px, calc(100vw - 32px));
  border: 1px solid var(--border);
  border-radius: 30px;
  background: var(--toast);
  padding: 14px 16px 15px 64px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 220ms ease, transform 220ms ease;
  backdrop-filter: blur(16px);
}

.frog-toast.complete {
  border-color: #88e64a;
}

.frog-toast-friend {
  position: absolute;
  left: 13px;
  top: 21px;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 999px;
  background: #d9ffb7;
}

.frog-toast-friend img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  animation: toast-frog-bob 900ms ease-in-out infinite;
}

.frog-toast.visible {
  opacity: 1;
  transform: translateY(0);
}

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

.frog-toast-title {
  display: block;
  color: var(--foreground);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.15;
}

.frog-toast-subtitle {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.25;
}

.frog-toast-count {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.frog-finds {
  display: flex;
  gap: 12px;
  min-height: 58px;
  margin-top: 12px;
}

.frog-finds img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border: 2px dashed #dedede;
  border-radius: 999px;
  padding: 11px;
  background: rgba(245, 245, 245, 0.6);
  opacity: 0.42;
  filter: grayscale(1);
  transform: scale(0.96);
  transition: background 180ms ease, border-color 180ms ease, filter 180ms ease, opacity 180ms ease, transform 180ms ease;
}

.frog-finds img.found {
  border-style: solid;
  border-color: #88e64a;
  background: #efffde;
  opacity: 1;
  filter: grayscale(0);
  transform: scale(1.02);
}

.contact {
  position: relative;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding-top: 30px;
  text-align: center;
}

.contact a {
  color: var(--muted);
  text-decoration: none;
}

.contact p {
  margin: 28px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.reveal {
  animation: settle-in 650ms ease both;
}

.reveal:nth-of-type(2) {
  animation-delay: 80ms;
}

.reveal:nth-of-type(3) {
  animation-delay: 150ms;
}

.reveal:nth-of-type(4) {
  animation-delay: 220ms;
}

.reveal:nth-of-type(5) {
  animation-delay: 290ms;
}

.reveal:nth-of-type(6) {
  animation-delay: 360ms;
}

@keyframes settle-in {
  from {
    opacity: 0;
    filter: blur(6px);
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
  }
}

@keyframes hero-wave {
  0% {
    transform: rotate(0);
  }
  12.5% {
    transform: rotate(14deg);
  }
  25% {
    transform: rotate(-10deg);
  }
  37.5% {
    transform: rotate(12deg);
  }
  50% {
    transform: rotate(-8deg);
  }
  62.5% {
    transform: rotate(10deg);
  }
  75%,
  100% {
    transform: rotate(0);
  }
}

@keyframes toast-frog-bob {
  0%,
  100% {
    transform: translateY(0) rotate(-3deg);
  }
  50% {
    transform: translateY(-3px) rotate(4deg);
  }
}

@keyframes frog-peek-left {
  0%,
  100% {
    transform: translateX(-23px) translateY(0) rotate(-2deg);
  }
  50% {
    transform: translateX(-16px) translateY(-3px) rotate(4deg);
  }
}

@keyframes frog-peek-right {
  0%,
  100% {
    transform: translateX(23px) translateY(0) scaleX(-1) rotate(-2deg);
  }
  50% {
    transform: translateX(16px) translateY(-3px) scaleX(-1) rotate(4deg);
  }
}

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

@media (max-width: 720px) {
  .page-shell {
    padding: 48px 24px 96px;
  }

  .portfolio {
    gap: 54px;
  }

  .hero {
    flex-direction: column;
  }

  .hero-copy {
    order: 2;
  }

  .avatar-block {
    order: 1;
  }

  .avatar {
    width: 96px;
    height: 96px;
  }

  .avatar img {
    width: 100%;
    height: 100%;
  }

  .hero p {
    font-size: 14px;
  }

  .project-grid {
    grid-template-columns: 1fr;
  }

  .project-card {
    min-height: 480px;
  }

  .bottom-dock {
    bottom: 18px;
    gap: 5px;
    padding: 8px 12px;
  }

  .dock-item {
    width: 38px;
    height: 38px;
  }

  .dock-item svg {
    width: 24px;
    height: 24px;
  }

  .dock-devpost span {
    width: 27px;
    height: 27px;
    border-radius: 6px;
    font-size: 18px;
  }

  .dock-frog {
    width: 42px;
    height: 42px;
  }

  .dock-frog img {
    width: 28px;
    height: 28px;
  }

  .dock-count {
    min-width: 34px;
    font-size: 22px;
  }

  .dock-divider {
    height: 26px;
    margin: 0 4px;
  }

  .dock-item::before,
  .dock-item::after {
    display: none;
  }
}

@media (max-width: 520px) {
  .page-shell {
    padding-inline: 20px;
  }

  .frog {
    width: 52px;
    height: 52px;
  }

  .frog img {
    width: 36px;
    height: 36px;
  }

  .frog-left {
    left: -24px;
  }

  .frog-right {
    right: -24px;
  }

  .frog-left.collecting {
    left: -8px;
  }

  .frog-right.collecting {
    right: -8px;
  }

  .resume-row {
    grid-template-columns: 36px minmax(0, 1fr) auto;
    gap: 10px;
  }

  .resume-row img {
    width: 36px;
    height: 36px;
  }

  .logo-initial {
    width: 36px;
    height: 36px;
    font-size: 13px;
  }

  .resume-row h3 {
    font-size: 12px;
  }

  .resume-row p,
  .resume-row time {
    font-size: 10px;
  }

  .resume-row .resume-note {
    max-width: 210px;
    font-size: 10px;
    line-height: 1.35;
  }

  .projects-section h2 {
    font-size: 28px;
  }

  .frog-toast {
    right: 16px;
    bottom: 86px;
    width: min(342px, calc(100vw - 32px));
    border-radius: 24px;
    padding-left: 56px;
  }

  .frog-toast-friend {
    left: 10px;
    width: 36px;
    height: 36px;
  }

  .frog-toast-friend img {
    width: 25px;
    height: 25px;
  }

  .frog-finds {
    gap: 8px;
    min-height: 46px;
    flex-wrap: wrap;
  }

  .frog-finds img {
    width: 44px;
    height: 44px;
    padding: 8px;
  }
}
