:root {
  --bg: #0b0b0c;
  --bg-soft: #121214;
  --panel: #141417;
  --border: #232327;
  --border-hover: #343439;
  --fg: #ededee;
  --fg-dim: #a1a1a6;
  --fg-faint: #6b6b70;
  --accent: #86c06a;          /* money green, from the pfp */
  --accent-bright: #b6f09c;   /* cat-eye highlight */
  --accent-soft: rgba(134, 192, 106, 0.13);
  --accent-glow: rgba(134, 192, 106, 0.45);
  --radius: 12px;
  --maxw: 680px;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* opt-in light mode for folks who prefer it */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #fbfbfa;
    --bg-soft: #f3f3f1;
    --panel: #ffffff;
    --border: #e6e6e2;
    --border-hover: #d4d4cf;
    --fg: #16161a;
    --fg-dim: #55555c;
    --fg-faint: #8a8a90;
    --accent: #3f8f4f;
    --accent-bright: #2f7a3e;
    --accent-soft: rgba(63, 143, 79, 0.1);
    --accent-glow: rgba(63, 143, 79, 0.3);
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  padding: 0 20px;
}

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.025;
  background-image: radial-gradient(var(--fg) 0.5px, transparent 0.5px);
  background-size: 3px 3px;
}

a {
  color: var(--fg);
  text-decoration: none;
  transition: color 0.18s ease;
}
a:hover { color: var(--accent); }

/* layout shell */
.nav, main, .footer {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* nav */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 0 0;
  z-index: 50; /* keep the brand's Discord popover above the hero */
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
}
.brand-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.brand:hover { color: var(--fg); }
.brand:hover .brand-avatar { transform: translateY(-1px); border-color: var(--accent); }

.links {
  display: flex;
  gap: 22px;
  font-family: var(--mono);
  font-size: 14px;
  color: var(--fg-dim);
}
.links a { color: var(--fg-dim); }
.links a:hover { color: var(--accent); }

/* hero */
.hero { padding: 92px 0 64px; }
.title {
  font-size: clamp(2rem, 6vw, 3rem);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.03em;
}
.accent {
  color: var(--accent-bright);
  text-shadow: 0 0 20px var(--accent-glow);
}
.lede {
  margin-top: 22px;
  color: var(--fg-dim);
  font-size: 1.0625rem;
  max-width: 54ch;
}
.meta {
  margin-top: 26px;
  font-family: var(--mono);
  font-size: 13.5px;
  color: var(--fg-faint);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.meta a { color: var(--fg-dim); }
.meta a:hover { color: var(--accent); }
.dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.15);
  display: inline-block;
}
.sep { color: var(--border-hover); }

/* discord presence — hover popover anchored to the brand */
.brand-wrap { position: relative; }
.dc-popover {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  z-index: 40;
  width: 300px;
  max-width: 78vw;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px) scale(0.98);
  transform-origin: top left;
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
  pointer-events: none;
}
/* invisible bridge so the mouse can travel from brand to card */
.dc-popover::before {
  content: "";
  position: absolute;
  top: -12px;
  left: 0;
  right: 0;
  height: 12px;
}
/* arrow */
.dc-popover::after {
  content: "";
  position: absolute;
  top: -5px;
  left: 20px;
  width: 10px;
  height: 10px;
  background: var(--panel);
  border-left: 1px solid var(--border);
  border-top: 1px solid var(--border);
  transform: rotate(45deg);
}
/* reveal only once Lanyard data has loaded */
.brand-wrap:hover .dc-popover.dc-ready,
.brand-wrap:focus-within .dc-popover.dc-ready {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.dc-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 15px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 14px 40px -12px rgba(0, 0, 0, 0.55),
    0 0 20px -10px var(--accent-glow);
  transition: border-color 0.2s ease, background 0.2s ease;
}
.dc-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-soft);
}
.dc-avatar-wrap { position: relative; flex-shrink: 0; }
.dc-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-soft);
}
.dc-status-dot {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--s, #747f8d);
  border: 3px solid var(--panel);
  box-shadow: 0 0 8px -1px var(--s);
}
.dc-body { min-width: 0; flex: 1; }
.dc-name {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 15px;
  color: var(--fg);
}
.dc-handle { color: var(--fg-faint); font-weight: 400; }
.dc-custom {
  font-size: 13.5px;
  color: var(--fg-dim);
  margin-top: 2px;
}
.dc-activity {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.45;
}
.dc-act1 { color: var(--accent); }
.dc-act2 { color: var(--fg-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dc-muted { color: var(--fg-faint); }

/* work */
.work { padding-bottom: 72px; }
.section-h {
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--fg-faint);
  margin-bottom: 22px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.projects { list-style: none; display: flex; flex-direction: column; gap: 10px; }

.project {
  display: block;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}
.project:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  background: var(--bg-soft);
}
.project:hover .p-arrow { transform: translate(3px, -3px); color: var(--accent); }

.p-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
}
.p-name {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 15.5px;
  color: var(--fg);
  letter-spacing: -0.01em;
}
.p-arrow {
  color: var(--fg-faint);
  font-family: var(--mono);
  transition: transform 0.2s ease, color 0.2s ease;
  flex-shrink: 0;
}
.p-desc {
  margin-top: 7px;
  color: var(--fg-dim);
  font-size: 0.9375rem;
  max-width: 58ch;
}
.p-tags {
  margin-top: 14px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.tag {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--fg-faint);
  padding: 3px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
}
.tag.lang::before {
  content: "";
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--tag-color, var(--accent));
  margin-right: 6px;
  vertical-align: middle;
}

/* teaser / coming-soon card */
.project.soon {
  position: relative;
  cursor: default;
  border-color: transparent;
  background:
    linear-gradient(var(--panel), var(--panel)) padding-box,
    linear-gradient(110deg, var(--accent), var(--accent-bright), var(--accent)) border-box;
  background-size: 100% 100%, 220% 100%;
  box-shadow: 0 0 22px -8px var(--accent-glow);
}
/* soft glow pool behind the card */
.project.soon::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(120% 140% at 15% 0%, var(--accent-soft), transparent 60%);
  pointer-events: none;
}
.project.soon:hover {
  transform: translateY(-3px);
  box-shadow: 0 0 34px -6px var(--accent-glow);
}
@keyframes borderflow {
  0% { background-position: 0 0, 0% 0; }
  100% { background-position: 0 0, 220% 0; }
}
.scribble {
  position: relative;
  color: var(--fg-dim);
  user-select: none;
}
.scribble .scribble-text {
  font-family: var(--mono);
  letter-spacing: 0.04em;
  color: var(--accent);
  text-shadow: 0 0 10px var(--accent-glow);
}
.p-name.scribble .scribble-text {
  color: var(--accent-bright);
  font-weight: 700;
  text-shadow: 0 0 14px var(--accent-glow), 0 0 26px var(--accent-glow);
}
.soon-badge {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  border-radius: 999px;
  padding: 3px 10px;
  flex-shrink: 0;
  white-space: nowrap;
}
@media (prefers-reduced-motion: no-preference) {
  .soon-badge { animation: pulse 2.4s ease-in-out infinite; }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

.more {
  margin-top: 26px;
  font-family: var(--mono);
  font-size: 13.5px;
  color: var(--fg-faint);
}
.more a { color: var(--fg-dim); }
.more a:hover { color: var(--accent); }

/* footer */
.footer {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 28px 0 44px;
  border-top: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 13px;
  color: var(--fg-faint);
}
.footer a { color: var(--fg-dim); }
.footer a:hover { color: var(--accent); }

/* entrance */
@media (prefers-reduced-motion: no-preference) {
  /* fill-mode both => holds the hidden "from" during the delay, then ends
     at the visible "to" and stays there. No persistent opacity:0 base, so a
     non-running animation can never leave content invisible. */
  .hero > *, .section-h, .project, .more {
    animation: rise 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
  }
  .hero > *:nth-child(1) { animation-delay: 0.05s; }
  .hero > *:nth-child(2) { animation-delay: 0.12s; }
  .hero > *:nth-child(3) { animation-delay: 0.19s; }
  .section-h { animation-delay: 0.24s; }
  .project { animation-delay: calc(0.28s + var(--i, 0) * 0.05s); }
  /* teaser fades in AND keeps its flowing border */
  .project.soon {
    animation: rise 0.6s cubic-bezier(0.22, 1, 0.36, 1) both,
               borderflow 4s linear infinite;
  }
  .more { animation-delay: 0.6s; }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

@media (max-width: 560px) {
  .hero { padding: 64px 0 48px; }
  .p-desc { font-size: 0.9rem; }
}
