@font-face {
  font-family: "Jost";
  src: url("fonts/jost.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --paper: #ffffff;
  --ink: #231f21;         /* warm near-black */
  --ink-soft: #7a6e73;    /* gray tinted toward the petal, not blue */
  --petal: #f2b8c6;       /* pale sakura */
  --petal-deep: #c98da0;  /* blossom center */
  --accent: #a04b62;      /* fallback link tone */
  --geo: "Jost", "Avenir Next", "Century Gothic", Futura, sans-serif;

  /* one hue per project: pale for the morph field, deep for its link text */
  --hue-riss:  #f0a98f; --hue-riss-deep:  #b25436;
  --hue-fed:   #b9c2ee; --hue-fed-deep:   #4f5aa8;
  --hue-ovim:  #a9dcc0; --hue-ovim-deep:  #2f7d59;
  --hue-blog:  #e2849f; --hue-blog-deep:  #a04b62;
  --hue-piano: #a5cfec; --hue-piano-deep: #33709f;
  --hue-chess: #e6c98d; --hue-chess-deep: #8a6524;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--geo);
  min-height: 100dvh;
}

main { padding: 0 24px; }

.projects {
  display: flex;
  flex-direction: column;
  max-width: 700px;
  margin-top: 3rem;
  gap: 40px;
}

@media (max-width: 600px) {
  .projects { grid-template-columns: 1fr; }
}

.project {
  display: block;
  text-decoration: none;
  color: inherit;
  --hue: var(--petal);
  --hue-deep: var(--accent);
}
.project:nth-child(1) { --hue: var(--hue-fed);   --hue-deep: var(--hue-fed-deep); }
.project:nth-child(2) { --hue: var(--hue-ovim);  --hue-deep: var(--hue-ovim-deep); }
.project:nth-child(3) { --hue: var(--hue-riss);  --hue-deep: var(--hue-riss-deep); }
.project:nth-child(4) { --hue: var(--hue-piano); --hue-deep: var(--hue-piano-deep); }
.project:nth-child(5) { --hue: var(--hue-chess); --hue-deep: var(--hue-chess-deep); }
.project:nth-child(6) { --hue: var(--hue-blog);  --hue-deep: var(--hue-blog-deep); }

.project .name {
  display: block;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  padding-left: 0.22em; /* optically recenter: offsets the trailing tracking */
  transition: color 0.18s ease-out;
}
.project .desc {
  display: block;
  margin-top: 6px;
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--ink-soft);
  line-height: 1.6;
}
.project .url {
  display: block;
  margin-top: 6px;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  color: var(--hue-deep);
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 4px;
  transition: text-decoration-color 0.18s ease-out;
}
.project:hover .name,
.project:focus-visible .name { color: var(--hue-deep); }
.project:hover .url,
.project:focus-visible .url { text-decoration-color: var(--hue); }

:focus-visible { outline: 2px solid var(--petal-deep); outline-offset: 4px; }

/* one quiet moment: the page settles in, top to bottom */
@media (prefers-reduced-motion: no-preference) {
  .project {
    opacity: 0;
    transform: translateY(10px);
    animation: settle 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  }
  .project:nth-child(1) { animation-delay: 0.1s; }
  .project:nth-child(2) { animation-delay: 0.18s; }
  .project:nth-child(3) { animation-delay: 0.26s; }
  .project:nth-child(4) { animation-delay: 0.34s; }
  .project:nth-child(5) { animation-delay: 0.42s; }
  .project:nth-child(6) { animation-delay: 0.5s; }
  @keyframes settle {
    to { opacity: 1; transform: none; }
  }
}

/* --- morph field ---
   Four layered organic shapes on the right half, continuously morphing
   (liquid border-radius morph + slow counter-rotations, multiply-blended).
   Their color is --tint; hovering a link on the left retints the field to
   that link's own hue (the same hue the link text wears). */
.animation {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(52vw, 760px);
  pointer-events: none;
  z-index: -1;
  --tint: var(--petal);
}
.animation span {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--s);
  height: var(--s);
  margin: calc(var(--s) / -2) 0 0 calc(var(--s) / -2);
  background: var(--tint);
  opacity: var(--o);
  mix-blend-mode: multiply;
  filter: blur(var(--b, 0px));
  animation:
    morph var(--mt) ease-in-out infinite alternate,
    turn var(--tt) linear infinite var(--dir, normal);
  animation-delay: var(--d), var(--d);
  transition: background-color 0.45s ease;
}
/* the same four-state loop, entered at different phases via delays */
@keyframes morph {
  0%   { border-radius: 67% 33% 74% 26% / 39% 68% 32% 61%; scale: 1 0.92; }
  33%  { border-radius: 28% 72% 39% 61% / 74% 29% 71% 26%; scale: 0.88 1.06; }
  66%  { border-radius: 73% 27% 58% 42% / 27% 66% 34% 73%; scale: 1.05 0.9; }
  100% { border-radius: 33% 67% 26% 74% / 63% 36% 64% 37%; scale: 0.94 1.02; }
}
@keyframes turn {
  to { transform: rotate(1turn); }
}
.animation span:nth-child(1) { --x: 52%; --y: 42%; --s: 340px; --o: 0.5;  --mt: 9s;  --tt: 52s; --d: -3s; }
.animation span:nth-child(2) { --x: 62%; --y: 56%; --s: 460px; --o: 0.3;  --mt: 12s; --tt: 74s; --d: -8s; --b: 28px; --dir: reverse; }
.animation span:nth-child(3) { --x: 38%; --y: 60%; --s: 250px; --o: 0.6;  --mt: 7s;  --tt: 44s; --d: -5s; --dir: reverse; }
.animation span:nth-child(4) { --x: 70%; --y: 28%; --s: 170px; --o: 0.75; --mt: 6s;  --tt: 36s; --d: -1s; }

/* each link wears its own hue; hovering pushes it into the field */
main:has(.project:nth-child(1):hover) .animation { --tint: var(--hue-fed); }
main:has(.project:nth-child(2):hover) .animation { --tint: var(--hue-ovim); }
main:has(.project:nth-child(3):hover) .animation { --tint: var(--hue-riss); }
main:has(.project:nth-child(4):hover) .animation { --tint: var(--hue-piano); }
main:has(.project:nth-child(5):hover) .animation { --tint: var(--hue-chess); }
main:has(.project:nth-child(6):hover) .animation { --tint: var(--hue-blog); }

@media (max-width: 800px) {
  .animation { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .animation span { animation: none; border-radius: 58% 42% 63% 37% / 47% 62% 38% 53%; }
}
