:root {
  color-scheme: dark;
  --bg: #060810;
  --bg-2: #0b0f1f;
  --ink: #eef2ff;
  --muted: #9aa7d8;
  --accent: #66b7ff;
  --accent-2: #8b5bff;
  --accent-3: #44ffd2;
  --glass: rgba(10, 16, 34, 0.6);
  --stroke: rgba(255, 255, 255, 0.12);
  --glow: 0 0 45px rgba(102, 183, 255, 0.25);
  --font-body: "Space Grotesk", "Segoe UI", sans-serif;
  --font-display: "Tektur", "Space Grotesk", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  font-family: var(--font-body);
  background: radial-gradient(circle at 20% 0%, #1b2350 0%, var(--bg) 45%, #04060c 100%);
  color: var(--ink);
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: var(--font-body);
}

.ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(circle at 25% 10%, rgba(102, 183, 255, 0.16), transparent 55%),
    radial-gradient(circle at 80% 85%, rgba(68, 255, 210, 0.12), transparent 60%);
}

.orb {
  position: absolute;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.42;
}

.orb-a {
  background: radial-gradient(circle, rgba(102, 183, 255, 0.35), transparent 70%);
  top: -120px;
  left: -60px;
}

.orb-b {
  background: radial-gradient(circle, rgba(139, 91, 255, 0.3), transparent 70%);
  bottom: -140px;
  right: -40px;
}

.orb-c {
  background: radial-gradient(circle, rgba(68, 255, 210, 0.28), transparent 70%);
  top: 35%;
  right: 10%;
}

.grid {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(circle at 30% 20%, rgba(0, 0, 0, 0.9), transparent 70%);
  overflow: hidden;
}

.grid::before,
.grid::after {
  content: "";
  position: absolute;
  inset: 0;
  mix-blend-mode: screen;
  opacity: 0.35;
  filter: blur(0.4px);
  pointer-events: none;
}

.grid::before {
  background-image: linear-gradient(
    0deg,
    transparent 0%,
    rgba(102, 183, 255, 0.85) 48%,
    rgba(102, 183, 255, 0.85) 52%,
    transparent 100%
  );
  background-size: 100% 240px;
  background-repeat: repeat;
  animation: grid-spark-vertical 3.6s linear infinite;
  -webkit-mask-image: repeating-linear-gradient(
    90deg,
    rgba(0, 0, 0, 1) 0,
    rgba(0, 0, 0, 1) 1px,
    transparent 1px,
    transparent 60px
  );
  mask-image: repeating-linear-gradient(
    90deg,
    rgba(0, 0, 0, 1) 0,
    rgba(0, 0, 0, 1) 1px,
    transparent 1px,
    transparent 60px
  );
}

.grid::after {
  background-image: linear-gradient(
    90deg,
    transparent 0%,
    rgba(139, 91, 255, 0.75) 48%,
    rgba(139, 91, 255, 0.75) 52%,
    transparent 100%
  );
  background-size: 240px 100%;
  background-repeat: repeat;
  animation: grid-spark-horizontal 4.2s linear infinite;
  -webkit-mask-image: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 1) 0,
    rgba(0, 0, 0, 1) 1px,
    transparent 1px,
    transparent 60px
  );
  mask-image: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 1) 0,
    rgba(0, 0, 0, 1) 1px,
    transparent 1px,
    transparent 60px
  );
}
.stars {
  position: absolute;
  inset: 0;
  overflow: hidden;
  animation: star-field 90s linear infinite;
}

.stars span {
  position: absolute;
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.95), transparent 70%);
  opacity: var(--alpha);
  animation: travel-star var(--travel) linear infinite,
    twinkle var(--twinkle) ease-in-out infinite;
}

.stars span:nth-child(odd) {
  filter: blur(0.5px);
}


.site-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  padding: 28px 6vw;
  position: sticky;
  top: 0;
  backdrop-filter: blur(16px);
  background: rgba(7, 7, 12, 0.65);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  z-index: 10;
  gap: 18px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-mark {
  font-family: var(--font-display);
  font-size: 22px;
  padding: 10px 14px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(102, 183, 255, 0.3), rgba(139, 91, 255, 0.35));
  box-shadow: var(--glow);
}

.logo-text {
  font-family: var(--font-display);
  font-size: 18px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: #eef5ff;
  text-shadow: 0 0 18px rgba(102, 183, 255, 0.35);
}

.site-nav {
  display: flex;
  gap: 26px;
  font-size: 15px;
  color: var(--muted);
}

.header-social {
  justify-self: center;
  display: flex;
  gap: 12px;
}

.header-social a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.04);
  font-size: 13px;
}

.header-social svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  opacity: 0.9;
}

.site-nav a {
  position: relative;
  padding-bottom: 6px;
}

.site-nav a::before {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
  transition: width 0.3s ease;
}

.site-nav a:hover::before {
  width: 100%;
}

.external {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.external::after {
  content: "↗";
  font-size: 12px;
  color: var(--accent);
  opacity: 0.9;
}


main {
  display: flex;
  flex-direction: column;
  gap: 120px;
  padding: 40px 6vw 120px;
}

section {
  scroll-margin-top: 120px;
}

.hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 60px;
  align-items: center;
  padding-top: 40px;
}

.hero-kicker {
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-size: 12px;
  color: var(--accent);
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 4vw, 4.2rem);
  line-height: 1.05;
  margin: 16px 0;
}

.hero-lede {
  font-size: 18px;
  line-height: 1.7;
  color: var(--muted);
  max-width: 520px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  margin: 28px 0 36px;
  flex-wrap: wrap;
}

.btn {
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn.primary {
  background: linear-gradient(120deg, var(--accent), var(--accent-3));
  color: #05090f;
  box-shadow: 0 12px 32px rgba(102, 183, 255, 0.35);
}

.btn.ghost {
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--ink);
}

.btn:hover {
  transform: translateY(-2px);
}


.manifesto h2,
.posts h2,
.projects h2 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  margin-bottom: 24px;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 26px;
  margin-top: 32px;
}

.media-grid.is-single {
  grid-template-columns: minmax(0, 1fr);
}

.media-card {
  display: grid;
  gap: 12px;
  padding: 22px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(10, 12, 20, 0.75);
  align-content: start;
}

.media-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.media-title h3 {
  margin: 0;
}
.media-title h3 {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.media-icon svg {
  width: 26px;
  height: 26px;
  fill: currentColor;
  opacity: 0.9;
  display: block;
}
.media-frame {
  position: relative;
  padding-top: 56.25%;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.media-frame iframe,
.media-frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: cover;
}

.media-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.media-list a {
  color: var(--accent);
  font-size: 14px;
}

.youtube-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.youtube-grid a {
  display: grid;
  gap: 8px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 10px;
  background: rgba(12, 13, 22, 0.6);
}

.youtube-thumb {
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: #000;
}

.youtube-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.youtube-grid span {
  font-size: 12px;
  color: var(--muted);
}

.github-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.github-grid a {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(12, 13, 22, 0.6);
  min-height: 120px;
}

.github-grid strong {
  font-size: 14px;
  color: var(--ink);
}

.github-grid span {
  font-size: 12px;
  color: var(--muted);
}

.github-grid em {
  font-size: 12px;
  color: var(--accent);
  font-style: normal;
}

@media (max-width: 900px) {
  .github-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

@media (max-width: 900px) {
  .youtube-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

.media-mini-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.media-mini-grid img,
.media-mini-grid .media-placeholder {
  width: 100%;
  height: 140px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  object-fit: cover;
}

.media-placeholder {
  display: grid;
  place-items: center;
  background: rgba(12, 14, 26, 0.6);
  color: var(--muted);
  font-size: 13px;
  padding: 12px;
  text-align: center;
}

.link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 26px;
}

.link-row a {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.04);
}

.social-link {
  gap: 8px;
}

.social-link svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  opacity: 0.9;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  flex-wrap: wrap;
}

.section-kicker {
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-size: 12px;
  color: var(--accent-2);
}

.posts-grid,
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  margin-top: 32px;
}

.post,
.project-card {
  padding: 22px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(12, 13, 22, 0.75);
  transition: transform 0.3s ease, border 0.3s ease;
}

.post:hover,
.project-card:hover {
  transform: translateY(-6px);
  border-color: rgba(62, 243, 193, 0.4);
}

.post-meta {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--muted);
  margin-bottom: 12px;
}

.post-media {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  aspect-ratio: 3 / 2;
  margin-bottom: 14px;
  max-height: 180px;
}

.post-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.post-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.post a {
  display: inline-flex;
  color: var(--accent);
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.project-tags span {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
}

.post-detail {
  max-width: 920px;
  margin: 0 auto;
}

.post-detail-card {
  padding: 0;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(12, 13, 22, 0.8);
  overflow: hidden;
}

.post-detail-media {
  border-radius: 0;
  overflow: hidden;
  border: 0;
  aspect-ratio: 3 / 2;
  max-height: 420px;
  width: 100%;
}

.post-detail-content {
  padding: 28px;
}

.post-detail-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.post-detail-meta {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  color: var(--accent-2);
  margin-bottom: 12px;
}

.post-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  color: var(--accent);
  font-size: 13px;
}

.post-detail h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 3vw, 3rem);
  margin: 0 0 18px;
}

.post-body {
  color: var(--ink);
  line-height: 1.7;
}

.post-body p {
  margin: 0 0 16px;
}

.post-body img {
  max-width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.post-body pre {
  background: rgba(4, 8, 18, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 16px 18px;
  color: #c7d7ff;
  font-size: 14px;
  line-height: 1.6;
  overflow-x: auto;
  font-family: Consolas, "Courier New", monospace;
}

.post-body pre code {
  font-family: inherit;
}


.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 26px 6vw 40px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--muted);
}

.footer-links {
  display: flex;
  gap: 18px;
}


@keyframes drift {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(-12%, 8%, 0);
  }
}

@keyframes twinkle {
  0%,
  100% {
    opacity: var(--alpha);
  }
  50% {
    opacity: calc(var(--alpha) * 0.4);
  }
}

@keyframes travel-star {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(var(--travel-x), var(--travel-y), 0);
  }
}

@keyframes star-field {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(-2vw, 1.5vh, 0);
  }
}

@keyframes grid-spark-vertical {
  0% {
    background-position: 0 -240px;
    opacity: 0.2;
  }
  100% {
    background-position: 0 240px;
    opacity: 0.45;
  }
}

@keyframes grid-spark-horizontal {
  0% {
    background-position: -240px 0;
    opacity: 0.2;
  }
  100% {
    background-position: 240px 0;
    opacity: 0.4;
  }
}


@media (max-width: 900px) {
  .site-header {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 16px;
  }

  .site-nav {
    flex-wrap: wrap;
    justify-content: center;
  }

  .header-social {
    order: 2;
  }

  .site-footer {
    flex-direction: column;
    text-align: center;
  }

  .site-footer .footer-links {
    order: -1;
  }

  .media-card-github {
    order: 1;
  }

  .media-card-youtube {
    order: 2;
  }

  section,
  .hero-surface .card,
  .post,
  .project-card,
  .media-card {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
    z-index: 1;
  }
}

@media (max-width: 700px) {
  main {
    padding-left: 0;
    padding-right: 0;
  }

  section {
    padding-left: 6vw;
    padding-right: 6vw;
  }

  .hero-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .post-back {
    margin-left: 10px;
  }

  .post-detail {  
    margin: 0;
    padding-left: 0;
    padding-right: 0;
  }

  .post-detail-card {
    border-radius: 0;
  }

  .post-detail-media {
    margin: 0 0 18px;
    width: 100%;
    border-radius: 0;
  }

  .post-detail-content {
    padding: 22px;
  }
}

@keyframes float-in {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.reveal {
  animation: float-in 0.8s ease forwards;
}

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