:root {
  --paper: #dff2ff;
  --paper-strong: #fbfdff;
  --ink: #10212f;
  --ink-soft: #38515f;
  --muted: #6b8190;
  --line: rgba(16, 33, 47, 0.12);
  --ring: rgba(16, 33, 47, 0.08);
  --accent: #2d78c4;
  --accent-hot: #de7d66;
  --accent-cool: #5ca5cf;
  --accent-sun: #d5a54a;
  --shadow-border:
    0 0 0 1px rgba(0, 0, 0, 0.06),
    0 1px 2px -1px rgba(16, 33, 47, 0.08),
    0 20px 54px rgba(72, 121, 150, 0.14);
  --shadow-border-hover:
    0 0 0 1px rgba(0, 0, 0, 0.09),
    0 3px 10px -3px rgba(16, 33, 47, 0.14),
    0 28px 78px rgba(72, 121, 150, 0.2);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 16% 11%, rgba(255, 247, 203, 0.55), transparent 20%),
    radial-gradient(circle at 76% 5%, rgba(255, 255, 255, 0.72), transparent 24%),
    linear-gradient(180deg, #9ed5f6 0%, #cceeff 39%, var(--paper) 70%, #f8fcff 100%);
  background-attachment: fixed;
  font-family: "IBM Plex Sans", "Avenir Next", "Helvetica Neue", sans-serif;
  letter-spacing: 0;
}

body.is-tinting {
  --accent: var(--active-accent);
}

body[data-active-tone="schedu"] {
  --active-accent: #238f89;
}

body[data-active-tone="faciognomy"] {
  --active-accent: #de7d66;
}

body[data-active-tone="acorn"] {
  --active-accent: #b9892e;
}

body[data-active-tone="lane"] {
  --active-accent: #2d78c4;
}

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

p {
  text-wrap: pretty;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
  text-wrap: balance;
}

h1 {
  font-family: "Bricolage Grotesque", "IBM Plex Sans", "Avenir Next", sans-serif;
  font-weight: 800;
  line-height: 0.98;
}

h2,
h3 {
  font-family: "IBM Plex Sans", "Avenir Next", "Helvetica Neue", sans-serif;
  font-weight: 700;
  line-height: 1.02;
}

#flowfield {
  position: fixed;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.38;
  mix-blend-mode: soft-light;
}

.sky-clouds {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 0;
  min-height: 1900px;
  overflow: hidden;
  pointer-events: none;
}

.cloud {
  position: absolute;
  display: block;
  width: var(--cloud-width);
  height: var(--cloud-height);
  border-radius: 999px;
  opacity: var(--cloud-opacity);
  filter: blur(var(--cloud-blur));
  background:
    radial-gradient(ellipse at 18% 54%, rgba(255, 255, 255, 0.95) 0 28%, transparent 54%),
    radial-gradient(ellipse at 39% 36%, rgba(255, 255, 255, 0.98) 0 32%, transparent 60%),
    radial-gradient(ellipse at 62% 50%, rgba(255, 255, 255, 0.94) 0 31%, transparent 58%),
    radial-gradient(ellipse at 80% 58%, rgba(255, 255, 255, 0.86) 0 24%, transparent 54%),
    radial-gradient(ellipse at 50% 66%, rgba(219, 238, 250, 0.72) 0 42%, transparent 70%);
  animation: cloudDrift var(--cloud-duration) linear infinite alternate;
}

.cloud-one {
  --cloud-width: 520px;
  --cloud-height: 190px;
  --cloud-opacity: 0.86;
  --cloud-blur: 5px;
  --cloud-duration: 3000ms;
  top: 80px;
  left: -90px;
}

.cloud-two {
  --cloud-width: 650px;
  --cloud-height: 230px;
  --cloud-opacity: 0.72;
  --cloud-blur: 8px;
  --cloud-duration: 3800ms;
  top: 230px;
  right: -160px;
}

.cloud-three {
  --cloud-width: 430px;
  --cloud-height: 170px;
  --cloud-opacity: 0.58;
  --cloud-blur: 10px;
  --cloud-duration: 3400ms;
  top: 590px;
  left: 16%;
}

.cloud-four {
  --cloud-width: 760px;
  --cloud-height: 250px;
  --cloud-opacity: 0.52;
  --cloud-blur: 13px;
  --cloud-duration: 4400ms;
  top: 920px;
  right: -210px;
}

.page-grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.18;
  background-image:
    repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, 0.2) 0,
      rgba(255, 255, 255, 0.2) 1px,
      transparent 1px,
      transparent 5px
    );
  mix-blend-mode: screen;
}

main,
.site-footer {
  position: relative;
  z-index: 2;
}

.hero {
  display: grid;
  width: min(1120px, calc(100% - 32px));
  min-height: 72svh;
  margin: 0 auto;
  padding: 92px 0 38px;
  place-items: center;
}

.hero-copy {
  max-width: 980px;
  text-align: center;
}

.eyebrow,
.section-label,
.project-url,
.site-footer {
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0;
}

.eyebrow,
.section-label {
  margin: 0 0 22px;
  color: var(--accent);
}

h1 {
  max-width: 1100px;
  margin: 0 auto;
  font-size: clamp(2.8rem, 5.6vw, 4.95rem);
}

.hero-intro {
  max-width: 720px;
  margin: 28px auto 0;
  color: var(--ink-soft);
  font-size: clamp(1.1rem, 2vw, 1.36rem);
  line-height: 1.58;
}

.projects-section {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 72px 0 126px;
}

.section-heading-row {
  display: grid;
  max-width: 720px;
  gap: 12px;
  align-items: center;
  margin: 0 auto 34px;
  text-align: center;
}

.section-heading-row h2 {
  font-size: clamp(2.4rem, 6vw, 4.6rem);
  letter-spacing: 0;
}

.section-heading-row p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 1.12rem;
  line-height: 1.62;
}

.project-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  align-items: start;
}

.project-card {
  --card-surface: linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(248, 252, 255, 0.58));
  --card-offset: 0px;
  --card-rotate: 0deg;
  --hover-x: 0px;
  --hover-rotate: 0deg;
  --icon-rotate: 0deg;
  --icon-hover-rotate: 0deg;
  --icon-hover-x: 0px;
  --blob-rotate: -8deg;
  --blob-hover-rotate: 7deg;
  position: relative;
  display: grid;
  min-height: 250px;
  grid-template-columns: minmax(0, 1fr) clamp(120px, 14vw, 156px);
  gap: 24px;
  align-items: end;
  padding: 30px 30px 62px;
  overflow: hidden;
  border-radius: 8px;
  background: var(--card-surface);
  box-shadow:
    0 0 0 1px rgba(16, 33, 47, 0.08),
    0 16px 40px rgba(28, 83, 118, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(16px);
  opacity: 0;
  filter: blur(8px);
  animation: cardReveal 700ms cubic-bezier(0.2, 0, 0, 1) forwards;
  animation-delay: calc(var(--card-index, 0) * 120ms);
  translate: 0 var(--card-offset);
  transform: rotate(var(--card-rotate));
  transition-property: translate, scale, transform, box-shadow, background-color;
  transition-duration: 260ms;
  transition-timing-function: cubic-bezier(0.2, 0, 0, 1);
}

.project-card::before {
  position: absolute;
  top: 18px;
  right: 18px;
  content: "";
  width: clamp(150px, 18vw, 210px);
  height: clamp(150px, 18vw, 210px);
  border-radius: 38% 62% 53% 47% / 45% 40% 60% 55%;
  opacity: 0.42;
  background:
    radial-gradient(circle at 34% 34%, rgba(255, 255, 255, 0.86), transparent 26%),
    linear-gradient(135deg, color-mix(in srgb, var(--card-accent) 34%, white), transparent 72%);
  transform: rotate(var(--blob-rotate));
  transition-property: opacity, scale, transform;
  transition-duration: 260ms;
  transition-timing-function: cubic-bezier(0.2, 0, 0, 1);
}

.project-card:active {
  scale: 0.96;
}

.project-card[data-tone="schedu"] {
  --card-accent: #238f89;
  --card-surface: linear-gradient(145deg, rgba(238, 255, 251, 0.82), rgba(250, 254, 255, 0.6));
  --card-index: 1;
  --card-rotate: 0.2deg;
  --hover-x: -8px;
  --hover-rotate: -0.5deg;
  --icon-hover-rotate: 5deg;
  --icon-hover-x: -3px;
  --blob-rotate: 8deg;
  --blob-hover-rotate: -6deg;
  --arrow-rotate: -8deg;
}

.project-card[data-tone="faciognomy"] {
  --card-accent: #de7d66;
  --card-surface: linear-gradient(145deg, rgba(255, 236, 230, 0.82), rgba(252, 252, 255, 0.58));
  --card-index: 2;
  --card-rotate: -0.3deg;
  --hover-x: 7px;
  --hover-rotate: 0.6deg;
  --icon-hover-rotate: -5deg;
  --icon-hover-x: 4px;
  --blob-rotate: -12deg;
  --blob-hover-rotate: 10deg;
  --arrow-rotate: 7deg;
}

.project-card[data-tone="acorn"] {
  --card-accent: #b9892e;
  --card-surface: linear-gradient(145deg, rgba(255, 247, 213, 0.84), rgba(251, 253, 255, 0.62));
  --card-index: 3;
  --card-rotate: 0.35deg;
  --hover-x: -6px;
  --hover-rotate: 0.7deg;
  --icon-hover-rotate: 8deg;
  --icon-hover-x: -2px;
  --blob-rotate: 16deg;
  --blob-hover-rotate: -8deg;
  --arrow-rotate: -5deg;
}

.project-card[data-tone="lane"] {
  --card-accent: #2d78c4;
  --card-surface: linear-gradient(145deg, rgba(226, 247, 255, 0.84), rgba(251, 253, 255, 0.62));
  --card-index: 0;
  --card-rotate: -0.15deg;
  --hover-x: 9px;
  --hover-rotate: -0.7deg;
  --icon-hover-rotate: -4deg;
  --icon-hover-x: 5px;
  --blob-rotate: -7deg;
  --blob-hover-rotate: 9deg;
  --arrow-rotate: 8deg;
}

.project-card:nth-child(2),
.project-card:nth-child(4) {
  --card-offset: 34px;
}

.project-copy,
.project-url,
.project-blurb,
.project-card h3,
.project-icon,
.project-arrow {
  position: relative;
  z-index: 1;
}

.project-copy {
  display: grid;
  align-self: end;
  gap: 10px;
  min-width: 0;
}

.project-card h3 {
  color: var(--ink);
  font-size: clamp(2rem, 4.1vw, 3.25rem);
  line-height: 0.95;
}

.project-url {
  display: block;
  max-width: 100%;
  color: var(--card-accent);
  font-size: 0.92rem;
  font-weight: 700;
}

.project-blurb {
  max-width: 34ch;
  color: var(--ink-soft);
  font-size: 1.03rem;
  line-height: 1.48;
  text-wrap: pretty;
}

.project-icon {
  display: grid;
  width: clamp(116px, 14vw, 150px);
  height: clamp(116px, 14vw, 150px);
  place-items: center;
  justify-self: end;
  align-self: start;
  overflow: visible;
  rotate: var(--icon-rotate);
  transition-property: scale, translate, rotate, filter;
  transition-duration: 260ms;
  transition-timing-function: cubic-bezier(0.2, 0, 0, 1);
}

.project-icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
  filter: drop-shadow(0 20px 18px rgba(32, 71, 95, 0.16));
}

.icon-lane img {
  scale: 1.55;
}

.icon-schedu img {
  scale: 1.18;
}

.project-arrow {
  position: absolute;
  right: 24px;
  bottom: 22px;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  color: var(--paper-strong);
  background: color-mix(in srgb, var(--card-accent) 78%, #10212f);
  font-size: 0;
  opacity: 0;
  filter: blur(4px);
  scale: 0.25;
  transition-property: opacity, filter, scale, transform;
  transition-duration: 300ms;
  transition-timing-function: cubic-bezier(0.2, 0, 0, 1);
}

.project-arrow::before {
  content: "\2197\FE0E";
  font-family: "IBM Plex Sans", "Avenir Next", "Helvetica Neue", sans-serif;
  font-size: 1.02rem;
  font-weight: 500;
  line-height: 1;
  transform: translateY(-1px);
}

.project-card:focus-visible .project-arrow {
  opacity: 1;
  filter: blur(0);
  scale: 1;
  transform: rotate(var(--arrow-rotate, 0deg));
}

@media (hover: hover) and (pointer: fine) {
  .project-card:hover {
    translate: var(--hover-x) var(--card-offset);
    transform: rotate(var(--hover-rotate));
    background: var(--card-surface);
    box-shadow:
      0 0 0 1px color-mix(in srgb, var(--card-accent) 28%, rgba(16, 33, 47, 0.08)),
      0 24px 54px rgba(28, 83, 118, 0.18),
      inset 0 1px 0 rgba(255, 255, 255, 0.82);
  }

  .project-card:hover::before {
    opacity: 0.66;
    scale: 1.07;
    transform: rotate(var(--blob-hover-rotate));
  }

  .project-card:hover .project-icon {
    translate: var(--icon-hover-x) 0;
    rotate: var(--icon-hover-rotate);
    scale: 1.04;
    filter: drop-shadow(0 24px 22px rgba(32, 71, 95, 0.18));
  }

  .project-card:hover .project-arrow {
    opacity: 1;
    filter: blur(0);
    scale: 1;
    transform: rotate(var(--arrow-rotate, 0deg));
  }
}

@media (hover: none), (pointer: coarse) {
  .project-card:active {
    scale: 0.98;
  }

  .project-arrow {
    opacity: 1;
    filter: blur(0);
    scale: 1;
  }
}

.site-footer {
  display: flex;
  width: min(1120px, calc(100% - 32px));
  min-height: 36svh;
  align-items: flex-end;
  justify-content: center;
  margin: 0 auto;
  padding: 78px 0 34px;
  color: var(--muted);
}

.stagger-item {
  opacity: 0;
  filter: blur(4px);
  translate: 0 12px;
  animation: enterSoftly 520ms cubic-bezier(0.2, 0, 0, 1) forwards;
  animation-delay: calc(var(--stagger-index, 0) * 95ms);
}

@keyframes enterSoftly {
  to {
    opacity: 1;
    filter: blur(0);
    translate: 0 0;
  }
}

@keyframes cloudDrift {
  from {
    transform: translate3d(-42px, 0, 0) scale(1);
  }
  to {
    transform: translate3d(74px, -18px, 0) scale(1.04);
  }
}

@keyframes cardReveal {
  from {
    opacity: 0;
    filter: blur(8px);
    transform: translateY(18px) scale(0.98);
  }
  to {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 1000px) {
  .hero {
    min-height: 76svh;
    padding-top: 88px;
  }

  h1 {
    font-size: 3.8rem;
  }

  .section-heading-row {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .project-list {
    max-width: 760px;
    grid-template-columns: 1fr;
    margin: 0 auto;
  }

  .project-card:nth-child(2),
  .project-card:nth-child(4) {
    --card-offset: 0px;
  }
}

@media (max-width: 680px) {
  .hero {
    width: calc(100% - 24px);
    min-height: 86svh;
    padding-top: 118px;
    padding-bottom: 36px;
    gap: 28px;
  }

  h1 {
    font-size: 2.75rem;
  }

  .hero-intro {
    font-size: 1.08rem;
  }

  .projects-section,
  .site-footer {
    width: calc(100% - 24px);
  }

  .projects-section {
    padding: 56px 0 80px;
  }

  .section-heading-row h2 {
    font-size: 2.55rem;
  }

  .project-card {
    min-height: 158px;
    grid-template-columns: minmax(0, 1fr) 78px;
    gap: 14px;
    padding: 18px 16px 18px 18px;
  }

  .cloud-one {
    --cloud-width: 340px;
    --cloud-height: 140px;
    top: 88px;
    left: -130px;
  }

  .cloud-two {
    --cloud-width: 420px;
    --cloud-height: 160px;
    top: 250px;
    right: -210px;
  }

  .cloud-three {
    --cloud-width: 300px;
    --cloud-height: 130px;
    top: 560px;
    left: -60px;
  }

  .project-card h3 {
    font-size: 1.44rem;
  }

  .project-url {
    font-size: 0.86rem;
  }

  .project-blurb {
    font-size: 0.94rem;
  }

  .project-icon {
    width: 78px;
    height: 78px;
    border-radius: 18px;
  }

  .project-arrow {
    right: 16px;
    bottom: 14px;
    width: 34px;
    height: 34px;
  }

  .project-arrow::before {
    font-size: 0.96rem;
  }

  .site-footer {
    min-height: 32svh;
    padding: 70px 0 30px;
  }

}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }

  .stagger-item {
    opacity: 1;
    filter: none;
    translate: 0 0;
  }
}
