:root {
  color-scheme: light;
  --ink: #111113;
  --muted: #60646c;
  --line: #dedfe3;
  --paper: #f7f7f5;
  --surface: rgba(255, 255, 255, 0.66);
  --surface-strong: rgba(255, 255, 255, 0.88);
  --accent: #0071e3;
  --accent-dark: #0057b8;
  --shadow: rgba(24, 26, 30, 0.14);
  --radius: 8px;
  --max: 1180px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family:
    -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "Helvetica Neue", Arial, sans-serif;
  letter-spacing: 0;
}

body::selection {
  background: #cfe5ff;
}

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

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

.ambient {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 20% 8%, rgba(255, 255, 255, 0.98), transparent 30%),
    radial-gradient(circle at 92% 12%, rgba(215, 235, 255, 0.78), transparent 26%),
    linear-gradient(180deg, #fbfbfa 0%, #f0f0ed 100%);
  transform: translate3d(calc(var(--mouse-x, 0) * 10px), calc(var(--mouse-y, 0) * 10px), 0);
  transition: transform 600ms var(--ease-out);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max);
  margin: 0 auto;
  padding: 18px 24px;
  backdrop-filter: blur(20px);
}

.brand {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(17, 17, 19, 0.08);
  border-radius: 50%;
  background: var(--surface);
  font-size: 13px;
  font-weight: 700;
}

.nav {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 5px;
  border: 1px solid rgba(17, 17, 19, 0.08);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: 0 10px 30px rgba(20, 22, 26, 0.05);
}

.nav a {
  padding: 9px 13px;
  border-radius: 999px;
  color: #34363a;
  font-size: 13px;
  line-height: 1;
  transition:
    background 180ms ease,
    color 180ms ease;
}

.nav a:hover {
  background: var(--ink);
  color: var(--paper);
}

main {
  overflow: hidden;
}

.hero,
.about,
.section,
.projects,
.stack,
.principles,
.experience,
.talks,
.contact {
  max-width: var(--max);
  margin: 0 auto;
  scroll-margin-top: 86px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.92fr);
  gap: clamp(28px, 6vw, 82px);
  align-items: center;
  min-height: min(820px, calc(100vh - 74px));
  padding: 48px 24px 64px;
}

.hero-copy {
  max-width: 710px;
  animation: hero-rise 900ms var(--ease-out) both;
}

.kicker {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

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

h1 {
  max-width: 850px;
  margin-bottom: 24px;
  font-size: clamp(56px, 7.2vw, 104px);
  font-weight: 740;
  letter-spacing: 0;
  line-height: 0.9;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(34px, 4.8vw, 62px);
  font-weight: 720;
  line-height: 1.02;
}

h3 {
  letter-spacing: 0;
}

.hero-text {
  max-width: 680px;
  margin-bottom: 18px;
  color: #3f4247;
  font-size: clamp(21px, 2.35vw, 30px);
  line-height: 1.18;
}

.motto {
  margin-bottom: 34px;
  color: var(--ink);
  font-size: clamp(22px, 2.7vw, 32px);
  font-weight: 700;
  line-height: 1.1;
}

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

.button {
  display: inline-flex;
  min-height: 45px;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 620;
  transition:
    transform 260ms var(--ease-out),
    box-shadow 260ms var(--ease-out),
    background 260ms var(--ease-out),
    color 260ms var(--ease-out);
}

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

.primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 12px 26px rgba(0, 113, 227, 0.22);
}

.primary:hover {
  background: var(--accent-dark);
}

.ghost {
  background: var(--surface-strong);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(17, 17, 19, 0.1);
}

.text {
  min-height: 45px;
  padding: 0 4px;
  color: var(--muted);
}

.text:hover {
  color: var(--ink);
}

.hero-visual {
  position: relative;
  aspect-ratio: 0.9;
  margin: 0;
  overflow: hidden;
  border-radius: var(--radius);
  background: #d9d9d6;
  box-shadow: 0 34px 80px var(--shadow);
  animation: visual-rise 1100ms 120ms var(--ease-out) both;
  transform:
    perspective(1200px)
    rotateX(calc(var(--tilt-y, 0) * -4deg))
    rotateY(calc(var(--tilt-x, 0) * 5deg))
    translate3d(0, 0, 0);
  transition:
    box-shadow 420ms var(--ease-out),
    transform 420ms var(--ease-out);
  will-change: transform;
}

.hero-visual::before {
  position: absolute;
  inset: -40%;
  z-index: 1;
  content: "";
  background: linear-gradient(
    115deg,
    transparent 35%,
    rgba(255, 255, 255, 0.42) 48%,
    transparent 61%
  );
  opacity: 0;
  transform: translateX(-42%) rotate(8deg);
  transition:
    opacity 360ms var(--ease-out),
    transform 1100ms var(--ease-out);
  pointer-events: none;
}

.hero-visual::after {
  position: absolute;
  inset: 0;
  z-index: 2;
  content: "";
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0) 55%, rgba(8, 9, 11, 0.18)),
    linear-gradient(90deg, rgba(247, 247, 245, 0.1), rgba(247, 247, 245, 0));
}

.hero-visual:hover {
  box-shadow: 0 42px 96px rgba(24, 26, 30, 0.2);
}

.hero-visual:hover::before {
  opacity: 1;
  transform: translateX(42%) rotate(8deg);
}

.hero-visual img {
  height: 100%;
  object-fit: cover;
  filter: saturate(0.82) contrast(1.06);
  transform: scale(1.035) translate3d(calc(var(--tilt-x, 0) * -8px), calc(var(--tilt-y, 0) * -8px), 0);
  transition: transform 500ms var(--ease-out);
  will-change: transform;
}

.about,
.section,
.projects,
.stack,
.principles,
.experience,
.talks,
.contact {
  padding: 78px 24px;
}

.section-heading {
  display: grid;
  grid-template-columns: 0.46fr 1fr;
  gap: 28px;
  margin-bottom: 34px;
  border-top: 1px solid var(--line);
  padding-top: 28px;
}

.about-copy {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  border-top: 1px solid var(--line);
  padding-top: 28px;
}

.about-copy p,
.signal-grid p,
.capability-grid p,
.project p,
.stack-grid p,
.principle-list span,
.role p,
.talk p {
  color: var(--muted);
  font-size: 17px;
  line-height: 1.5;
}

.signal-grid,
.capability-grid,
.project-list,
.stack-grid {
  display: grid;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.signal-grid {
  grid-template-columns: repeat(3, 1fr);
}

.capability-grid {
  grid-template-columns: repeat(3, 1fr);
}

.project-list {
  grid-template-columns: repeat(3, 1fr);
}

.stack-grid {
  grid-template-columns: repeat(4, 1fr);
}

.signal-grid article,
.capability-grid article,
.project,
.stack-grid article {
  min-height: 218px;
  padding: 24px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  transition:
    background 260ms var(--ease-out),
    border-color 260ms var(--ease-out),
    box-shadow 260ms var(--ease-out),
    transform 260ms var(--ease-out);
}

.signal-grid article:hover,
.capability-grid article:hover,
.project:hover,
.stack-grid article:hover {
  background: rgba(255, 255, 255, 0.38);
  box-shadow: 0 18px 44px rgba(24, 26, 30, 0.07);
  transform: translateY(-4px);
}

.signal-grid span,
.capability-grid span,
.project span {
  display: block;
  margin-bottom: 46px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.signal-grid h3,
.capability-grid h3,
.project h3,
.stack-grid h3,
.role h3,
.talk h3 {
  margin-bottom: 14px;
  font-size: 23px;
  font-weight: 680;
  line-height: 1.14;
}

.project.featured {
  grid-column: span 2;
}

.project:hover h3 {
  color: var(--accent);
}

.principle-list {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.principle-list li {
  display: grid;
  grid-template-columns: 0.42fr 1fr;
  gap: 28px;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}

.principle-list strong {
  font-size: 21px;
  line-height: 1.2;
}

.timeline {
  border-top: 1px solid var(--line);
}

.role {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 36px;
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
}

.role-date,
.talk-date {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.role-company {
  margin-bottom: 12px;
  color: var(--ink);
  font-weight: 620;
}

.role p:last-child {
  max-width: 820px;
  margin-bottom: 0;
}

.talks-writing {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
}

.talk-list,
.articles {
  display: grid;
  align-content: start;
  border-top: 1px solid var(--line);
}

.talk {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 28px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}

.talk p {
  margin-bottom: 0;
}

.articles a {
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 18px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-size: 20px;
  font-weight: 650;
  line-height: 1.25;
}

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

.articles span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.contact {
  min-height: 54vh;
  padding-bottom: 120px;
}

.contact h2 {
  max-width: 980px;
  margin-bottom: 34px;
}

.contact-link {
  display: inline-flex;
  color: var(--accent);
  font-size: clamp(25px, 4vw, 48px);
  font-weight: 700;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.contact-link:hover {
  color: var(--accent-dark);
}

.site-link {
  display: block;
  width: fit-content;
  margin-top: 18px;
  color: var(--muted);
  font-size: 18px;
  font-weight: 580;
}

.site-link:hover {
  color: var(--ink);
}

.footer {
  display: flex;
  justify-content: space-between;
  max-width: var(--max);
  margin: 0 auto;
  padding: 28px 24px 40px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.footer a {
  color: var(--ink);
}

.js .reveal {
  opacity: 0;
  transform: translateY(28px) scale(0.985);
  transition:
    opacity 760ms var(--ease-out),
    transform 760ms var(--ease-out);
  transition-delay: calc(var(--stagger, 0) * 70ms);
  will-change: opacity, transform;
}

.js .reveal.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.js .section-heading.reveal {
  transform: translateY(20px);
}

@keyframes hero-rise {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.99);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes visual-rise {
  from {
    opacity: 0;
    transform: perspective(1200px) rotateX(0) rotateY(0) translateY(24px) scale(0.985);
  }

  to {
    opacity: 1;
    transform:
      perspective(1200px)
      rotateX(calc(var(--tilt-y, 0) * -4deg))
      rotateY(calc(var(--tilt-x, 0) * 5deg))
      translate3d(0, 0, 0);
  }
}

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

  .ambient,
  .hero-visual,
  .hero-visual img {
    transform: none !important;
  }
}

@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding: 24px 16px 42px;
  }

  .hero-visual {
    aspect-ratio: 1.46;
    order: -1;
  }

  .about,
  .section,
  .projects,
  .stack,
  .principles,
  .experience,
  .talks,
  .contact {
    padding: 62px 16px;
  }

  .section-heading,
  .talks-writing {
    grid-template-columns: 1fr;
  }

  .signal-grid,
  .capability-grid,
  .stack-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .project-list {
    grid-template-columns: repeat(2, 1fr);
  }

  .project.featured {
    grid-column: span 2;
  }

  .principle-list li,
  .role,
  .talk {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

@media (max-width: 620px) {
  .site-header {
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
  }

  .brand {
    width: 34px;
    height: 34px;
  }

  .nav {
    max-width: calc(100vw - 74px);
    gap: 0;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .nav::-webkit-scrollbar {
    display: none;
  }

  .nav a {
    padding: 9px 10px;
    white-space: nowrap;
    font-size: 12px;
  }

  h1 {
    font-size: clamp(46px, 13vw, 64px);
  }

  h2 {
    font-size: clamp(32px, 10vw, 46px);
  }

  .hero-text {
    font-size: 20px;
  }

  .motto {
    margin-bottom: 24px;
    font-size: 24px;
  }

  .hero-actions {
    width: 100%;
  }

  .button {
    flex: 1 1 138px;
  }

  .text {
    flex: 0 1 auto;
  }

  .signal-grid,
  .capability-grid,
  .project-list,
  .stack-grid {
    grid-template-columns: 1fr;
  }

  .project.featured {
    grid-column: span 1;
  }

  .signal-grid article,
  .capability-grid article,
  .project,
  .stack-grid article {
    min-height: auto;
  }

  .signal-grid span,
  .capability-grid span,
  .project span {
    margin-bottom: 34px;
  }

  .articles a {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .footer {
    gap: 18px;
    flex-direction: column;
  }
}
