:root {
  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface-soft: #f1f1f3;
  --text: #111111;
  --muted: #6e6e73;
  --accent: #000000;
  --accent-strong: #333333;
  --line: rgba(0, 0, 0, 0.1);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.1);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #ffffff 0%, var(--bg) 46%, #ffffff 100%);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(0, 0, 0, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.018) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: linear-gradient(to bottom, black, transparent 54%);
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-strong);
}

nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  background: rgba(255, 255, 255, 0.78);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

nav a {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 999px;
  transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

nav a:hover {
  color: var(--text);
  background: rgba(0, 0, 0, 0.06);
  transform: translateY(-1px);
}

nav .logo {
  margin-right: auto;
  color: var(--text);
  background: transparent;
  font-size: 1rem;
}

.hero,
section,
footer {
  width: min(1120px, calc(100% - 40px));
  margin-inline: auto;
}

.hero {
  position: relative;
  width: 100%;
  margin-inline: 0;
  min-height: 78vh;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  align-items: center;
  gap: 64px;
  padding: 86px max(20px, calc((100% - 1120px) / 2)) 66px;
  overflow: hidden;
  isolation: isolate;
}

.dot-field {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  opacity: 0.95;
  pointer-events: none;
}

.hero-copy {
  position: relative;
  z-index: 1;
  max-width: 710px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 16px;
  font-size: clamp(2.35rem, 5.6vw, 4.4rem);
  line-height: 1.02;
  letter-spacing: 0;
}

h1 span {
  color: var(--text);
}

#tagline {
  max-width: 640px;
  margin-bottom: 30px;
  color: var(--muted);
  font-size: clamp(1.04rem, 2vw, 1.28rem);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 999px;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button.primary {
  color: #ffffff;
  background: var(--accent);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.16);
}

.button.primary:hover {
  color: #ffffff;
  background: #1d1d1f;
}

.button.secondary {
  color: var(--text);
  background: rgba(255, 255, 255, 0.74);
  backdrop-filter: blur(14px);
}

.profile {
  justify-self: center;
  position: relative;
  z-index: 1;
}

.profile::before {
  content: "";
  position: absolute;
  inset: 22px -24px -22px 24px;
  z-index: -1;
  border-radius: 30px;
  background: linear-gradient(145deg, #f5f5f7, #e8e8ed);
}

.profile img {
  width: min(340px, 74vw);
  aspect-ratio: 1;
  object-fit: cover;
  border: 8px solid #ffffff;
  border-radius: 28px;
  box-shadow: var(--shadow);
  transform: rotate(2deg);
}

section {
  padding: 78px 0;
  border-top: 1px solid var(--line);
}

.section-heading {
  max-width: 720px;
  margin-bottom: 30px;
}

section h2 {
  margin-bottom: 0;
  font-size: clamp(2rem, 4vw, 3.1rem);
  line-height: 1.08;
  letter-spacing: 0;
}

.split {
  display: grid;
  grid-template-columns: minmax(240px, 0.55fr) minmax(0, 1fr);
  gap: 34px;
  align-items: center;
}

.about-content {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) minmax(280px, 0.9fr);
  gap: clamp(30px, 5vw, 56px);
  align-items: center;
}

.stack-container {
  position: relative;
  width: 100%;
  max-width: 470px;
  min-height: clamp(340px, 38vw, 460px);
  perspective: 700px;
}

.card-rotate {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
  transform-style: preserve-3d;
  transition: transform 520ms cubic-bezier(0.2, 0.8, 0.2, 1), opacity 260ms ease;
}

.card-rotate.is-dragging {
  cursor: grabbing;
  transition: none;
}

.photo-stack-card {
  width: 100%;
  height: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 16px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.14);
}

.photo-stack-card img,
.card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.section-img {
  width: 100%;
  max-height: 410px;
  display: block;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.12);
}

.experience-content {
  display: grid;
  grid-template-columns: minmax(240px, 0.55fr) minmax(320px, 1fr);
  gap: 42px;
  align-items: center;
}

.experience-copy {
  max-width: 380px;
  color: var(--muted);
}

.scroll-list-container {
  position: relative;
  width: 100%;
  min-width: 0;
  border-radius: var(--radius);
}

.scroll-list-container:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 5px;
}

.scroll-list {
  max-height: 430px;
  overflow-y: auto;
  padding: 16px;
  scroll-behavior: smooth;
}

.scroll-list::-webkit-scrollbar {
  width: 8px;
}

.scroll-list::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.04);
  border-radius: 999px;
}

.scroll-list::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.28);
  border-radius: 999px;
}

.animated-item {
  cursor: pointer;
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 0.24s ease, transform 0.24s ease;
}

.animated-item.is-visible {
  opacity: 1;
  transform: scale(1);
}

.item {
  padding: 18px;
  margin-bottom: 1rem;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.07);
  backdrop-filter: blur(18px);
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.item:hover,
.item.selected {
  background: #111111;
  border-color: #111111;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.16);
  transform: translateY(-2px);
}

.item-text {
  margin: 0;
  color: var(--text);
}

.item-text strong,
.item-text span {
  display: block;
}

.item-text strong {
  font-size: 1rem;
  line-height: 1.35;
}

.item-text span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.item:hover .item-text,
.item:hover .item-text span,
.item.selected .item-text,
.item.selected .item-text span {
  color: #ffffff;
}

.top-gradient,
.bottom-gradient {
  position: absolute;
  left: 0;
  right: 8px;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.top-gradient {
  top: 0;
  height: 52px;
  opacity: 0;
  background: linear-gradient(to bottom, #f5f5f7, rgba(245, 245, 247, 0));
}

.bottom-gradient {
  bottom: 0;
  height: 92px;
  opacity: 1;
  background: linear-gradient(to top, #f5f5f7, rgba(245, 245, 247, 0));
}

.work-item,
.contact-card {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.07);
  backdrop-filter: blur(18px);
}

.works-showcase {
  display: grid;
  grid-template-columns: minmax(240px, 0.68fr) minmax(420px, 1fr);
  gap: 42px;
  align-items: center;
  min-height: 520px;
}

.works-intro {
  max-width: 360px;
  color: var(--muted);
}

.card-swap-container {
  position: relative;
  width: min(100%, 560px);
  height: 430px;
  justify-self: end;
  perspective: 900px;
  transform-style: preserve-3d;
  overflow: visible;
}

.work-item {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.work-item:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow);
}

.card-swap-container .work-item {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(420px, 82vw);
  height: 350px;
  transform: translate(-50%, -50%);
  transform-origin: center center;
  transform-style: preserve-3d;
  will-change: transform, opacity;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.card-swap-container .work-item:hover {
  box-shadow: var(--shadow);
}

.card-swap-container .work-item.is-moving {
  transition: transform 950ms cubic-bezier(0.23, 1, 0.32, 1), opacity 950ms ease;
}

.card-swap-container .work-item.is-flipping {
  transition: transform 520ms cubic-bezier(0.2, 0.8, 0.2, 1), opacity 520ms ease;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.18);
}

.card-swap-container .work-item.is-dropping {
  opacity: 0.45;
}

.work-item img {
  width: 100%;
  height: 220px;
  border-radius: 0;
  box-shadow: none;
}

.work-item h3,
.work-item p,
.work-item .text-link {
  margin-inline: 18px;
}

.work-item h3 {
  margin-top: 18px;
  margin-bottom: 8px;
  font-size: 1.12rem;
  line-height: 1.3;
}

.work-item p {
  color: var(--muted);
  font-size: 0.94rem;
}

.text-link {
  margin-top: auto;
  margin-bottom: 18px;
  font-weight: 700;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tag-list span {
  padding: 9px 12px;
  color: var(--text);
  background: rgba(0, 0, 0, 0.045);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 700;
}

#contact {
  border-top: 0;
}

.contact-card {
  padding: clamp(28px, 5vw, 54px);
  background:
    linear-gradient(135deg, rgba(0, 0, 0, 0.055), rgba(255, 255, 255, 0.92)),
    var(--surface);
}

.contact-card h2 {
  margin-bottom: 14px;
}

footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 26px 0 42px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

footer p {
  margin: 0;
}

.logoloop {
  position: relative;
  width: min(620px, 100%);
  overflow: hidden;
  --logoloop-gap: 18px;
  --logoloop-logoHeight: 18px;
  --logoloop-fadeColorAuto: #ffffff;
}

.logoloop--scale-hover {
  padding-top: calc(var(--logoloop-logoHeight) * 0.18);
  padding-bottom: calc(var(--logoloop-logoHeight) * 0.18);
}

.logoloop__track {
  display: flex;
  width: max-content;
  will-change: transform;
  user-select: none;
  position: relative;
  z-index: 0;
}

.logoloop__list {
  display: flex;
  align-items: center;
  margin: 0;
  padding: 0;
  list-style: none;
}

.logoloop__item {
  flex: 0 0 auto;
  margin-right: var(--logoloop-gap);
  font-size: var(--logoloop-logoHeight);
  line-height: 1;
}

.logoloop__item:last-child {
  margin-right: var(--logoloop-gap);
}

.logoloop__node {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.logoloop--scale-hover .logoloop__item {
  overflow: visible;
}

.logoloop--scale-hover .logoloop__item:hover .logoloop__node {
  transform: scale(1.12);
  transform-origin: center center;
}

.logoloop__link {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 14px;
  color: var(--text);
  background: rgba(0, 0, 0, 0.045);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 999px;
  text-decoration: none;
  transition: opacity 0.2s ease, background 0.2s ease;
}

.logoloop__link:hover {
  background: rgba(0, 0, 0, 0.08);
  opacity: 0.9;
}

.logoloop__link:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.logoloop--fade::before,
.logoloop--fade::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: clamp(24px, 12%, 92px);
  pointer-events: none;
  z-index: 10;
}

.logoloop--fade::before {
  left: 0;
  background: linear-gradient(
    to right,
    var(--logoloop-fadeColor, var(--logoloop-fadeColorAuto)) 0%,
    rgba(255, 255, 255, 0) 100%
  );
}

.logoloop--fade::after {
  right: 0;
  background: linear-gradient(
    to left,
    var(--logoloop-fadeColor, var(--logoloop-fadeColorAuto)) 0%,
    rgba(255, 255, 255, 0) 100%
  );
}

@media (prefers-reduced-motion: reduce) {
  .logoloop__track {
    transform: translate3d(0, 0, 0) !important;
  }

  .logoloop__node {
    transition: none !important;
  }
}

@media (max-width: 820px) {
  nav {
    justify-content: flex-start;
    overflow-x: auto;
  }

  nav .logo {
    margin-right: 0;
  }

  .hero {
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 34px;
    padding-top: 52px;
  }

  .profile {
    justify-self: start;
  }

  .profile img {
    width: min(300px, 82vw);
  }

  .split,
  .about-content,
  .experience-content,
  .works-showcase {
    grid-template-columns: 1fr;
  }

  .stack-container {
    max-width: 460px;
    min-height: 430px;
  }

  .works-showcase {
    min-height: 680px;
  }

  .works-intro {
    max-width: none;
  }

  .card-swap-container {
    justify-self: center;
    width: 100%;
    height: 450px;
    transform: scale(0.92);
  }

  .work-item img {
    height: 240px;
  }

  footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .logoloop {
    width: 100%;
  }
}

@media (max-width: 520px) {
  section,
  footer {
    width: min(100% - 28px, 1120px);
  }

  .hero {
    width: 100%;
    padding-inline: 14px;
  }

  nav {
    padding: 10px 14px;
  }

  nav a {
    padding: 7px 10px;
    font-size: 0.84rem;
    white-space: nowrap;
  }

  h1 {
    font-size: 2.45rem;
  }

  .stack-container {
    min-height: 350px;
  }

  section {
    padding: 56px 0;
  }

  .hero-actions,
  .button {
    width: 100%;
  }

  .work-item img {
    height: 210px;
  }

  .works-showcase {
    min-height: 610px;
  }

  .card-swap-container {
    height: 410px;
    transform: scale(0.78);
  }

  .card-swap-container .work-item {
    width: min(390px, 92vw);
    height: 340px;
  }
}
