@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@300;400&family=Newsreader:opsz,wght@6..72,300;6..72,400;6..72,500&display=swap');

:root {
  --paper: #fff;
  --ink: #181816;
  --muted: #77736b;
  --hairline: rgb(24 24 22 / 22%);
  --cyan: #157e83;
  --red: #a63d37;
  --serif: "Newsreader", Georgia, serif;
  --mono: "DM Mono", "Courier New", monospace;
}

* { box-sizing: border-box; }

html {
  min-width: 280px;
  min-height: 100%;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
}

body {
  margin: 0;
  min-height: 100svh;
  overflow: hidden;
}

button,
input { font: inherit; }

button,
a,
input { -webkit-tap-highlight-color: transparent; }

#optical-field {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.18'/%3E%3C/svg%3E");
  opacity: .015;
  mix-blend-mode: multiply;
}

.identity {
  position: fixed;
  z-index: 4;
  top: clamp(1.25rem, 4vw, 3.5rem);
  left: clamp(1.25rem, 5vw, 5rem);
  display: block;
  width: clamp(16rem, 30vw, 27rem);
  max-width: calc(100vw - 2.5rem);
  pointer-events: none;
}

.identity__lockup {
  display: block;
  width: 100%;
  height: auto;
}

.identity > div {
  margin-top: .15rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.tagline,
.byline {
  margin: 0;
  font-family: var(--mono);
  font-size: clamp(.72rem, .8vw, .82rem);
  letter-spacing: .04em;
}

.tagline { margin-top: 0; }
.byline { margin-top: .22rem; color: var(--muted); }
.collection-note { max-width: 36ch; margin-top: 1.2rem; font: .65rem/1.6 var(--mono); color: var(--muted); }
.collection-note p { margin: 0; }
.collection-note p:first-child { font-size: .72rem; margin-bottom: .4rem; }

main { min-height: 100svh; }

.idea-field,
.ideas {
  position: fixed;
  inset: 0;
}

.ideas { z-index: 2; }

.idea {
  --x: 50;
  --y: 50;
  --drift-x: 0px;
  --drift-y: 0px;
  --relevance: 1;
  position: absolute;
  left: calc(var(--x) * 1%);
  top: calc(var(--y) * 1%);
  display: grid;
  grid-template-columns: 5rem minmax(9rem, 18rem);
  align-items: center;
  gap: 1.1rem;
  min-width: 44px;
  min-height: 44px;
  color: var(--ink);
  text-decoration: none;
  transform: translate(calc(-50% + var(--drift-x)), calc(-50% + var(--drift-y))) scale(calc(.82 + var(--relevance) * .18));
  opacity: calc(.14 + var(--relevance) * .86);
  filter: blur(calc((1 - var(--relevance)) * 5px));
  transition: opacity 600ms ease, filter 700ms ease, transform 800ms cubic-bezier(.2,.65,.2,1);
}

.idea:focus-visible {
  outline: 1px solid var(--ink);
  outline-offset: .7rem;
}

.idea[data-match="false"] { pointer-events: none; }

.idea__visual {
  position: relative;
  display: block;
  width: 5rem;
  aspect-ratio: 1;
  transition: transform 600ms cubic-bezier(.2,.65,.2,1);
}

.idea:hover .idea__visual,
.idea:focus-visible .idea__visual { transform: rotate(-4deg) scale(1.08); }

.idea__copy {
  opacity: .72;
  transition: opacity 250ms ease, transform 400ms ease;
}

.idea:hover .idea__copy,
.idea:focus-visible .idea__copy,
body.is-searching .idea[data-match="true"] .idea__copy { opacity: 1; transform: translateX(.2rem); }

.idea__title {
  display: block;
  font-size: clamp(1.2rem, 2vw, 1.75rem);
  line-height: 1;
  letter-spacing: -.025em;
}

.idea__description {
  display: block;
  margin-top: .5rem;
  max-width: 34ch;
  color: var(--muted);
  font-family: var(--mono);
  font-size: .72rem;
  line-height: 1.5;
}

.visual--split-orbit::before,
.visual--split-orbit::after {
  content: "";
  position: absolute;
  border: 1px solid currentColor;
}

.visual--split-orbit::before {
  inset: 12%;
  border-width: 5px 1px 1px 5px;
  transform: rotate(17deg);
}

.visual--split-orbit::after {
  inset: 27% 4% 4% 27%;
  border-radius: 50%;
  border-right-color: transparent;
  transform: rotate(-24deg);
}

.visual--bent-grid {
  background:
    linear-gradient(90deg, transparent 48%, currentColor 49%, currentColor 51%, transparent 52%) 0 0 / 1.05rem 100%,
    linear-gradient(0deg, transparent 48%, currentColor 49%, currentColor 51%, transparent 52%) 0 0 / 100% 1.05rem;
  clip-path: polygon(15% 0, 100% 12%, 82% 100%, 0 78%);
  opacity: .78;
  transform: perspective(8rem) rotateY(-18deg) rotate(4deg);
}

.visual--bent-grid::after {
  content: "";
  position: absolute;
  inset: 18% -8% -10% 26%;
  border: 5px solid currentColor;
  border-left-width: 1px;
  transform: skew(-16deg) rotate(-8deg);
}

.visual--thread-net {
  color: #a65776;
  background: repeating-linear-gradient(32deg, transparent 0 12px, currentColor 12px 13px, transparent 13px 17px), repeating-linear-gradient(118deg, transparent 0 14px, currentColor 14px 15px, transparent 15px 19px);
  clip-path: polygon(7% 18%, 80% 0, 100% 74%, 20% 100%);
  opacity: .7;
}

.visual--thread-net::after {
  content: "";
  position: absolute;
  top: 49%;
  left: 50%;
  width: 5px;
  height: 5px;
  background: var(--ink);
  border-radius: 50%;
}

.search {
  position: fixed;
  z-index: 5;
  left: 50%;
  bottom: clamp(1.25rem, 5vw, 4.25rem);
  width: min(42rem, calc(100vw - 2.5rem));
  transform: translateX(-50%);
}

.search label {
  display: block;
  margin-bottom: .55rem;
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.search__line {
  position: relative;
  border-bottom: 1px solid var(--ink);
}

.search input {
  width: 100%;
  min-height: 48px;
  padding: .1rem 5rem .3rem 0;
  border: 0;
  border-radius: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(1.25rem, 2.6vw, 2rem);
  font-weight: 300;
}

.search input::placeholder { color: rgb(24 24 22 / 38%); }
.search__line:focus-within { border-bottom-width: 2px; }

#clear-search {
  position: absolute;
  right: 0;
  bottom: .45rem;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-family: var(--mono);
  font-size: .62rem;
  text-transform: uppercase;
  cursor: pointer;
}

#clear-search:focus-visible { outline: 1px solid currentColor; outline-offset: .2rem; }

.search__status {
  min-height: 1rem;
  margin: .55rem 0 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: .65rem;
}

.empty-state {
  position: fixed;
  inset: 48% auto auto 50%;
  z-index: 2;
  margin: 0;
  transform: translate(-50%, -50%);
  color: var(--muted);
  font-size: clamp(1.3rem, 3vw, 2.2rem);
  font-style: italic;
}

.no-script {
  position: fixed;
  z-index: 8;
  right: 1rem;
  top: 1rem;
  max-width: 20rem;
  padding: 1rem;
  background: var(--paper);
  border: 1px solid var(--ink);
}

.no-script a { display: block; margin-top: .5rem; color: inherit; }

@media (max-width: 700px) {
  .idea {
    width: calc(100vw - 3rem);
    max-width: 24rem;
    grid-template-columns: 3.4rem minmax(0, 1fr);
    gap: .7rem;
  }

  .idea__title { overflow-wrap: anywhere; line-height: 1.15; }
  .idea__visual { width: 3.4rem; }
  .idea__description { display: none; }
  .idea:nth-child(1) { --x: 50 !important; --y: 44 !important; }
  .idea:nth-child(2) { --x: 50 !important; --y: 63 !important; }
}

@media (max-height: 650px) and (max-width: 700px) {
  .identity { width: 14rem; top: 1rem; }
  .identity__lockup { width: 10rem; }
  .collection-note { margin-top: .8rem; }
  .idea:nth-child(1) { --y: 50 !important; }
  .idea:nth-child(2) { --y: 67 !important; }
}

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