:root {
  --bg: #08080c;
  --panel: rgba(16, 16, 23, 0.62);
  --ink: #f2f0eb;
  --muted: #8e8c99;
  --line: rgba(242, 240, 235, 0.09);
  --yellow: #ffcb00;
  --gutter: clamp(20px, 3.6vw, 56px);
  --sans: "Space Grotesk", system-ui, sans-serif;
  --serif: "Instrument Serif", Georgia, serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 400 15px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
a:focus-visible { outline: 2px solid var(--yellow); outline-offset: 3px; border-radius: 6px; }
em { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -0.01em; }

/* full-screen background network */
#field { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; }
body::after {
  /* darken the lower part so the cards sit on a calm surface */
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(120% 70% at 75% 15%, transparent 40%, rgba(8, 8, 12, .55) 100%),
    linear-gradient(to bottom, transparent 55%, rgba(8, 8, 12, .85) 100%);
}

/* the whole site is one screen */
.screen {
  position: relative; z-index: 1;
  min-height: 100svh;
  display: flex; flex-direction: column;
  padding: 0 var(--gutter);
}
main { flex: 1; display: flex; flex-direction: column; justify-content: space-between; gap: 5vh; padding: 4vh 0 3vh; }

/* nav */
.nav { display: flex; justify-content: space-between; align-items: center; padding: 22px 0; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 500; font-size: 15px; letter-spacing: -0.01em; }
.dots { display: inline-flex; gap: 3px; }
.dots i { width: 7px; height: 7px; border-radius: 50%; display: block; }
.dots i:nth-child(1) { background: #ff3d57; }
.dots i:nth-child(2) { background: var(--yellow); }
.dots i:nth-child(3) { background: #00ca72; }
.pill {
  display: inline-block; padding: 8px 18px; border-radius: 999px; font-size: 14px; font-weight: 500;
  border: 1px solid rgba(242, 240, 235, .22);
  background: rgba(8, 8, 12, .4); backdrop-filter: blur(8px);
  transition: background .25s, color .25s, border-color .25s;
}
.pill:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* intro */
.intro { margin-top: auto; max-width: 760px; }
.eyebrow { font-size: 13px; color: var(--muted); margin-bottom: 20px; letter-spacing: .02em; }
h1 {
  font-size: clamp(34px, min(4.6vw, 7.6vh), 68px);
  line-height: 1.04; letter-spacing: -0.035em; font-weight: 500;
}
h1 em { color: var(--yellow); }
.lede { margin-top: 22px; max-width: 36em; font-size: clamp(15px, 1.1vw, 17px); color: #bebcc7; }

/* portfolio */
.portfolio-head {
  display: flex; justify-content: space-between; align-items: baseline;
  padding-bottom: 14px; margin-bottom: 14px; border-bottom: 1px solid var(--line);
}
h2 { font-size: 14px; font-weight: 500; letter-spacing: 0; }
.portfolio-head p { font-size: 13px; color: var(--muted); }

.grid { list-style: none; display: grid; gap: 12px; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.card { display: flex; }
.card a {
  flex: 1; position: relative; isolation: isolate; overflow: hidden;
  display: flex; flex-direction: column; gap: clamp(16px, 3vh, 32px);
  padding: 18px;
  background: var(--panel); backdrop-filter: blur(14px);
  border: 1px solid var(--line); border-radius: 16px;
  transition: border-color .4s, transform .4s cubic-bezier(.2, .7, .2, 1);
}
.card a::before {
  /* soft brand-colored light that follows the cursor */
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(260px circle at var(--x, 50%) var(--y, 0%), color-mix(in srgb, var(--c) 24%, transparent), transparent 65%);
  opacity: 0; transition: opacity .4s;
}
.card a:hover, .card a:focus-visible { border-color: color-mix(in srgb, var(--c) 45%, transparent); transform: translateY(-3px); outline: none; }
.card a:hover::before, .card a:focus-visible::before { opacity: 1; }

.card .top { display: flex; justify-content: space-between; align-items: start; gap: 8px; }
.logo { width: 36px; height: 36px; border-radius: 10px; overflow: hidden; flex: none; outline: 1px solid var(--line); outline-offset: -1px; }
.logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.logo.padded img { object-fit: contain; padding: 5px; }
.domain { font-size: 12px; color: var(--muted); transition: color .3s; white-space: nowrap; }
.card a:hover .domain { color: var(--ink); }
.card h3 { font-size: 16px; font-weight: 500; letter-spacing: -0.015em; margin-bottom: 4px; }
.card p {
  font-size: 13px; line-height: 1.5; color: var(--muted);
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}

/* footer */
.footer {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 16px 0 20px; font-size: 12px; color: var(--muted);
}
.footer a:hover { color: var(--ink); }

/* one-time page-load sequence */
.intro > *, .portfolio-head, .card { animation: rise .9s cubic-bezier(.2, .7, .2, 1) both; }
.intro > :nth-child(2) { animation-delay: .08s; }
.intro > :nth-child(3) { animation-delay: .16s; }
.portfolio-head { animation-delay: .3s; }
.card:nth-child(1) { animation-delay: .36s; }
.card:nth-child(2) { animation-delay: .42s; }
.card:nth-child(3) { animation-delay: .48s; }
.card:nth-child(4) { animation-delay: .54s; }
.card:nth-child(5) { animation-delay: .60s; }
.card:nth-child(6) { animation-delay: .66s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* lock to a single screen wherever it fits */
@media (min-width: 1100px) and (min-height: 620px) {
  body { overflow: hidden; }
  .screen { height: 100svh; }
}
@media (max-width: 1099px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .grid { grid-template-columns: 1fr; }
  .card a { flex-direction: row; align-items: center; gap: 16px; padding: 16px; }
  .card .top { display: contents; }
  .card .top .domain { display: none; }
  .card p { -webkit-line-clamp: unset; }
  main { gap: 48px; padding-top: 12vh; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
