:root {
  --bg: #040405;
  --bg-2: #0b0b0d;
  --bg-3: #121216;
  --panel: #232127c9;
  --panel-strong: #18171cbf;
  --text: #e8e8ed;
  --muted: #adafb9;
  --line: #8c8d9624;
  --tone-a: #b4b6c5;
  --tone-b: #ececf2;
  --accent: #b9bac8;
  --glow: #b2b8c71f;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  scroll-behavior: smooth;
}

.noise::before{
    position: fixed;
    top: 0;
    left: 0;
    
    width: 100vw;
    height: 100vh;
    content: "";
    /* you can control opacity of noise  */
    opacity: .1;  
    z-index: 1000;
    pointer-events: none;
    background: url(noise.gif) ;
}
body {
  font-family: "Manrope", sans-serif;
  color: var(--text);
  
  background:
    radial-gradient(circle at 12% 20%, #2b272d2e 0, transparent 42%),
    radial-gradient(circle at 88% 76%, #23212830 0, transparent 38%),
    radial-gradient(circle at 50% 62%, #13131658 0, transparent 56%),
    linear-gradient(130deg, var(--bg), var(--bg-2) 44%, var(--bg-3));
  background-color: #232128;
  overflow-x: hidden;
}

.bg-stars {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 8% 16%, #e0e2eb55 2px, transparent 3px),
    radial-gradient(circle at 28% 76%, #d3d6e053 2px, transparent 3px),
    radial-gradient(circle at 64% 18%, #c8cbd74a 1.5px, transparent 3px),
    radial-gradient(circle at 87% 54%, #d8dbe551 2px, transparent 3px),
    radial-gradient(circle at 74% 84%, #e6d9ef45 1.8px, transparent 3px),
    radial-gradient(circle at 46% 39%, #c4c8d34e 1.4px, transparent 3px);
  opacity: 0.52;
}

.bg-noise {
  position: fixed;
  inset: -50%;
  z-index: 1;
  pointer-events: none;
  opacity: 0.22;
  mix-blend-mode: overlay;
  background-image: url("noise.svg");
  background-size: 230px 230px;
  background-repeat: repeat;
  filter: contrast(165%) brightness(120%);
  animation: noiseShift 0.22s steps(3, end) infinite;
}

.page {
  width: min(1240px, 94vw);
  margin: 4vh auto;
  min-height: 92vh;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.1rem;
  position: relative;
  z-index: 2;
}

.card {
  border: 1px solid #a5a5af33;
  border-radius: 34px;
  background: linear-gradient(165deg, var(--panel), var(--panel-strong));
  box-shadow: inset 0 1px 0 #ffffff16, 0 20px 80px #03070f75;
  backdrop-filter: blur(8px);
}

.hero {
  padding: clamp(1.2rem, 2vw, 2.2rem);
  min-height: 50vh;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background-image: url("/bg.png");
  background-position: center;
  background-size: cover;
}

.brand-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  margin: 0;
  letter-spacing: 0.22em;
  font-weight: 700;
  font-family: "Space Grotesk", sans-serif;
  color: #e0e2ea;
}

.status-dot {
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid #a6aaba66;
  color: #c8cbd8;
  font-size: 0.76rem;
}

.hero h1 {
  font-size: clamp(2rem, 4vw, 3.25rem);
  line-height: 1.08;
  margin: 1rem 0 0.9rem;
  max-width: 18ch;
}

.hero-copy {
  margin: 0;
  max-width: 48ch;
  color: var(--muted);
  font-size: clamp(0.97rem, 1.3vw, 1.12rem);
}

.hero-actions {
  margin-top: 1.5rem;
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.btn {
  text-decoration: none;
  font-weight: 700;
  padding: 0.72rem 1.1rem;
  border-radius: 14px;
  border: 1px solid #ffffff20;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

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

.btn-primary {
  color: #eaebf2;
  background: linear-gradient(145deg, #3d3c42, #2f3036);
  border-color: #92929d6e;
  box-shadow: 0 8px 30px #10111585;
}

.btn-ghost {
  color: #d3d5df;
  background: #242429a1;
  border-color: #8c8f9c4f;
}

.floating-nav {
  position: fixed;
  left: max(0.7rem, calc((100vw - min(1240px, 94vw)) / 2 - 4.6rem));
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  gap: 0.6rem;
  padding: 0.6rem;
  border-radius: 999px;
  border: 1px solid #a0a0aa35;
  background: #24252d8f;
  z-index: 1102;
}

.icon-chip {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.icon-chip svg {
  width: 20px;
  height: 20px;
}

.icon-chip:hover,
.icon-chip.active {
  background: #32343bb8;
  border-color: #acadb872;
}

.projects {
  display: grid;
  grid-template-rows: auto auto;
  gap: 1rem;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  justify-items: stretch;
  align-items: start;
  gap: 0.75rem;
  min-height: 0;
}

.project-card {
  position: relative;
  width: 100%;
  max-width: none;
  aspect-ratio: 424 / 356;
  min-height: 208px;
  overflow: hidden;
}

.project-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(155deg, #ffffff4d, #ffffff10);
  -webkit-mask: url("mask.svg") center / 100% 100% no-repeat;
  mask: url("mask.svg") center / 100% 100% no-repeat;
  pointer-events: none;
}

.project-surface {
  position: absolute;
  inset: 1px;
  background: linear-gradient(165deg, #302e34da, #252329ed 64%, #1f2026eb);
  -webkit-mask: url("mask.svg") center / 100% 100% no-repeat;
  mask: url("mask.svg") center / 100% 100% no-repeat;
}

.project-card::after {
  content: "";
  position: absolute;
  inset: 1px;
  background:
    radial-gradient(circle at 78% 84%, #a7a9b720, transparent 44%),
    radial-gradient(circle at 18% 18%, #ffffff0d, transparent 42%);
  -webkit-mask: url("mask.svg") center / 100% 100% no-repeat;
  mask: url("mask.svg") center / 100% 100% no-repeat;
  pointer-events: none;
}

.project-content {
  position: absolute;
  inset: 0;
  z-index: 2;
  padding: 25px 30px;
  padding-right: clamp(4.2rem, 5.1vw, 5rem);
  display: flex;
  flex-direction: column;
  gap: 0.42rem;
}

.project-content h2 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1rem, 1.05vw, 1.24rem);
  line-height: 1.08;
  letter-spacing: 0.01em;
  max-width: 14ch;
  min-height: 2.2em;
}

.project-content p {
  color: #c3c5cf;
  margin: 0;
  max-width: 200ch;
  line-height: 1.33;
  font-size: clamp(0.74rem, 0.72vw, 0.86rem);
  display: -webkit-box;
  -webkit-line-clamp: 10;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.project-icon {
  position: absolute;
  z-index: 3;
  inset-block-start: 0;
  right: clamp(0.96rem, 3.4%, 0.88rem);
  width: clamp(48px, 24%, 54px);
  aspect-ratio: 1;
  border-radius: 15px;
  display: grid;
  place-items: center;
  border: 1px solid #a7aab84a;
  box-shadow: inset 0 1px 0 #ffffff1f, 0 8px 24px #0f101652;
  background: linear-gradient(165deg, #333238cf, #27282fc4);
}

.project-icon svg {
  width: 48%;
  height: 48%;
  display: block;
}

.tone-a {
  fill: var(--tone-a);
  stroke: var(--tone-a);
  stroke-width: 1.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tone-b {
  fill: var(--tone-b);
  stroke: var(--tone-b);
  stroke-width: 1.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.socials-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
}

.social-card {
  text-decoration: none;
  color: var(--text);
  padding: 1rem 1.1rem;
  min-height: 96px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.social-card span {
  font-weight: 700;
}

.social-card small {
  margin-top: 0.35rem;
  color: var(--muted);
}

.social-card:hover {
  transform: translateY(-3px);
  border-color: #a3a6b37c;
}

.card,
.social-card,
.project-card,
.hero {
  animation: rise 0.55s ease both;
}

@keyframes noiseShift {
  0% {
    transform: translate3d(0, 0, 0);
    background-position: 0 0;
  }
  25% {
    transform: translate3d(-0.9%, 1.2%, 0);
    background-position: 12px -7px;
  }
  50% {
    transform: translate3d(1.2%, -1.1%, 0);
    background-position: -9px 9px;
  }
  75% {
    transform: translate3d(-1.1%, -1.3%, 0);
    background-position: 8px 11px;
  }
  100% {
    transform: translate3d(0, 0, 0);
    background-position: 0 0;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1120px) {
  .projects-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .hero {
    min-height: 56vh;
  }

  .projects {
    grid-template-rows: auto auto;
  }

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

@media (max-width: 700px) {
  .page {
    width: min(95vw, 95vw);
    margin: 2vh auto 4vh;
  }

  .hero {
    padding: 1rem;
  }

  .floating-nav {
    left: 0.45rem;
    padding: 0.45rem;
    gap: 0.45rem;
  }

  .icon-chip {
    width: 38px;
    height: 38px;
  }

  .projects-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }

  .socials-row {
    grid-template-columns: 1fr;
  }
}
