:root {
  --bg: #0a0a0f;
  --bg-elevated: #12121a;
  --bg-soft: #15151f;
  --text: #e8e8ef;
  --text-muted: #9a9ab0;
  --accent: #39ff8a;
  --accent-dim: #1a9960;
  --accent-cool: #7aa8ff;
  --border: #252535;
  --max-width: 960px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  position: relative;
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

#bg-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: auto;
}

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

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.site-header {
  padding: 4rem 0 2.5rem;
  background: linear-gradient(180deg, rgba(15, 15, 24, 0.6) 0%, rgba(10, 10, 15, 0.2) 100%);
}

.brand {
  margin: 0 0 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
}

h1 {
  margin: 0 0 0.5rem;
  max-width: 720px;
  font-size: clamp(2rem, 7vw, 4.5rem);
  line-height: 0.95;
  font-weight: 700;
  letter-spacing: 0;
}

.meta {
  margin: 0 0 1.25rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.intro {
  margin: 0 0 2rem;
  max-width: 560px;
  font-size: 1.05rem;
  color: var(--text-muted);
}

.toc {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
}

.toc ol {
  margin: 0;
  padding-left: 1.25rem;
}

.toc li {
  margin-bottom: 0.35rem;
  break-inside: avoid;
}

.toc a {
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
}

.toc a:hover {
  color: var(--accent);
}

main {
  padding: 1rem 0 3.5rem;
}

section {
  margin-bottom: 2.5rem;
}

h2 {
  margin: 0 0 1rem;
  font-size: clamp(1.35rem, 3vw, 2rem);
  line-height: 1.1;
  font-weight: 600;
  color: var(--text);
  scroll-margin-top: 1.5rem;
}

h2::before {
  content: "";
  display: inline-block;
  width: 3px;
  height: 1em;
  margin-right: 0.6rem;
  vertical-align: -0.1em;
  background: var(--accent);
  border-radius: 2px;
}

p {
  margin: 0 0 1rem;
}

.portfolio-section {
  margin-bottom: 3.5rem;
}

.section-heading {
  margin-bottom: 1.25rem;
}

.eyebrow {
  margin: 0 0 0.45rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-cool);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.project-card {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(18, 18, 26, 0.85);
  backdrop-filter: blur(2px);
}

.project-media {
  display: block;
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--bg-soft);
}

.project-media a {
  display: block;
  width: 100%;
  height: 100%;
}

.project-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 180ms ease;
}

.project-media:hover img {
  transform: scale(1.03);
}

.project-content {
  padding: 1rem;
}

.creator-block {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
  text-decoration: none;
}

.creator-logo {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-soft);
  flex-shrink: 0;
}

/* Hide the broken-image icon while the logo hasn't loaded yet (no src,
   or the YouTube API call hasn't returned/failed) */
.creator-logo:not([src]) {
  visibility: hidden;
}

.project-client {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-cool);
}

.creator-block:hover .project-client {
  color: var(--accent);
}

.project-content h3 {
  margin: 0 0 0.6rem;
  font-size: 1.1rem;
  line-height: 1.2;
}

.video-stats {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.stat {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.stat svg {
  width: 16px;
  height: 16px;
  fill: var(--text-muted);
}

.project-grid--compact {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.project-card--compact .project-content {
  padding: 0.75rem;
}

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

.project-card--compact .stat {
  font-size: 0.75rem;
}

.badge {
  position: absolute;
  bottom: 0.5rem;
  left: 0.5rem;
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--bg);
  background: var(--accent);
  pointer-events: none;
}

.portfolio-note {
  max-width: 720px;
}

.portfolio-note p {
  color: var(--text-muted);
}

.x-embed-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
  align-items: start;
}

.x-embed-grid .twitter-tweet {
  margin: 0 !important;
}

.x-embed-slot {
  min-height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-size: 0.85rem;
}

.x-embed-slot:has(.twitter-tweet) {
  min-height: 0;
  display: block;
  border: none;
  background: transparent;
}

ul {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
}

li {
  margin-bottom: 0.4rem;
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

a:hover {
  color: #6bffb0;
}

strong {
  color: var(--text);
  font-weight: 600;
}

.contact-list {
  list-style: none;
  padding-left: 0;
}

.contact-list li {
  margin-bottom: 0.5rem;
}

.site-footer {
  padding: 1.5rem 0 2.5rem;
  background: rgba(6, 6, 10, 0.78);
  backdrop-filter: blur(6px);
}

.footer-inner {
  display: block;
}

.footer-contact {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
  justify-content: center;
}

.footer-bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1rem;
}

.footer-contact-label {
  color: var(--text);
  font-weight: 600;
}

.site-footer p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-muted);
  text-align: center;
}

.site-credit {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-decoration: none;
}

.site-credit:hover {
  color: var(--accent);
}

.footer-contact {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.65rem;
}

.footer-contact-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.contact-copy {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0;
  border: 0;
  color: var(--text-muted);
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-size: 0.8rem;
}

.contact-copy:hover,
.contact-copy:focus-visible,
.contact-copy.is-copied {
  color: var(--accent);
}

.contact-copy svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
}

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

  .project-grid--compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .toc ol {
    columns: 1;
  }

  .site-header {
    padding: 2.5rem 0 1.5rem;
  }

  .site-credit,
  .site-footer p {
    padding-top: 0.75rem;
    font-size: 0.75rem;
  }

  .footer-bottom-row {
    gap: 0.75rem;
  }
}
