﻿:root {
  --bg: #090b11;
  --bg-soft: #111723;
  --bg-soft-2: #151f2d;
  --line: #243043;
  --text: #f2f6ff;
  --muted: #9fb0c8;
  --accent-a: #00e0b8;
  --accent-b: #7ad7ff;
  --accent-c: #ffb864;
  --shadow: 0 24px 42px rgba(2, 8, 18, 0.45);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--text);
  font-family: "Outfit", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 10% 10%, rgba(122, 215, 255, 0.16), transparent 38%),
    radial-gradient(circle at 90% 80%, rgba(0, 224, 184, 0.14), transparent 40%),
    linear-gradient(165deg, #0b0f18 0%, #080b12 48%, #070a10 100%);
  line-height: 1.65;
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  width: min(44vw, 560px);
  aspect-ratio: 1;
  border-radius: 30% 70% 64% 36% / 36% 47% 53% 64%;
  pointer-events: none;
  z-index: -2;
  filter: blur(24px);
  animation: floatBlob 16s ease-in-out infinite alternate;
}

body::before {
  top: -14vw;
  left: -12vw;
  background: radial-gradient(circle, rgba(122, 215, 255, 0.22), rgba(122, 215, 255, 0));
}

body::after {
  right: -10vw;
  bottom: -18vw;
  background: radial-gradient(circle, rgba(0, 224, 184, 0.2), rgba(0, 224, 184, 0));
  animation-delay: 1.6s;
}

@keyframes floatBlob {
  from { transform: translate(0, 0) rotate(0deg) scale(1); }
  to { transform: translate(26px, -18px) rotate(16deg) scale(1.07); }
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 14px 5.5vw;
  border-bottom: 1px solid #2430438f;
  background: rgba(8, 12, 20, 0.76);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-size: 1.1rem;
  font-weight: 700;
}

.brand img {
  width: 34px;
  height: 34px;
  object-fit: cover;
  border-radius: 10px;
}

.main-nav {
  justify-self: center;
  display: flex;
  gap: 18px;
}

.main-nav a {
  color: #d9e3f4;
  text-decoration: none;
  font-size: 0.93rem;
  font-weight: 600;
  position: relative;
}

.main-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-a), var(--accent-b));
  transition: width .26s ease;
}

.main-nav a:hover::after,
.main-nav a.active::after { width: 100%; }

.menu-toggle {
  display: none;
  justify-self: end;
  border: 1px solid #cde8ff4a;
  background: rgba(21, 29, 42, 0.82);
  color: #eaf5ff;
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 600;
}

main { padding: 0 5.5vw 64px; }

.section-head {
  display: grid;
  grid-template-columns: 120px 1fr;
  align-items: end;
  gap: 20px;
  margin-bottom: 18px;
}

.section-head p {
  margin: 0;
  color: #8ea3bf;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

h1, h2, h3 {
  margin: 0;
  line-height: 1.2;
  font-family: "Outfit", "Segoe UI", sans-serif;
}

h1 {
  font-size: clamp(2.4rem, 5.2vw, 5rem);
  max-width: 1000px;
  font-weight: 800;
  animation: heroRise 0.8s ease both;
}

h2 {
  font-size: clamp(1.8rem, 3.4vw, 3.1rem);
  font-weight: 700;
}

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

.hero {
  padding: 72px 0 42px;
  border-bottom: 1px solid #223247;
  position: relative;
}

.hero::before {
  content: "";
  position: absolute;
  right: 4%;
  top: 16%;
  width: min(30vw, 360px);
  aspect-ratio: 1;
  border: 1px solid rgba(122, 215, 255, 0.4);
  background: radial-gradient(circle at 28% 22%, rgba(122, 215, 255, 0.24), rgba(122, 215, 255, 0));
  border-radius: 36% 64% 54% 46% / 44% 42% 58% 56%;
  animation: morph 11s linear infinite;
}

@keyframes morph {
  0% { transform: rotate(0deg); border-radius: 36% 64% 54% 46% / 44% 42% 58% 56%; }
  50% { transform: rotate(180deg); border-radius: 58% 42% 48% 52% / 58% 36% 64% 42%; }
  100% { transform: rotate(360deg); border-radius: 36% 64% 54% 46% / 44% 42% 58% 56%; }
}

.hero-kicker {
  margin: 0 0 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-size: 0.78rem;
  color: #95abc7;
  animation: fadeUp .7s .1s ease both;
}

.hero-lead {
  max-width: 780px;
  margin: 18px 0 24px;
  color: var(--muted);
  font-size: 1.1rem;
  animation: fadeUp .7s .2s ease both;
}

.hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  animation: fadeUp .7s .3s ease both;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border-radius: 999px;
  padding: 10px 18px;
  font-weight: 700;
  border: 1px solid transparent;
  transition: transform .23s ease, box-shadow .23s ease, filter .23s ease;
}

.btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 22px rgba(2, 8, 18, 0.4);
  filter: brightness(1.05);
}

.btn-solid {
  color: #07211d;
  background: linear-gradient(100deg, var(--accent-a), var(--accent-b));
}

.btn-line {
  border-color: #84d9ff66;
  color: #d8ebff;
  background: rgba(18, 30, 45, 0.58);
}

.hero-meta {
  margin-top: 30px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  animation: fadeUp .7s .4s ease both;
}

.hero-meta > div {
  padding: 18px;
  border: 1px solid #2e45639b;
  border-radius: 24px;
  background: linear-gradient(160deg, rgba(27, 41, 60, 0.86), rgba(17, 28, 42, 0.72));
  box-shadow: var(--shadow);
  animation: bob 4s ease-in-out infinite;
}

.hero-meta > div:nth-child(2) { animation-delay: .35s; }
.hero-meta > div:nth-child(3) { animation-delay: .7s; }

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.meta-label {
  margin: 0;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #95abc7;
}

.meta-value {
  margin: 7px 0 0;
  color: #f3fbff;
  font-weight: 600;
}

.about,
.stack-game,
.projects,
.approach,
.contact {
  padding: 56px 0;
  border-bottom: 1px solid #203045;
}

.about-grid,
.contact-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 16px;
}

.about-grid article,
.contact-grid article {
  padding: 22px;
  border: 1px solid #304766;
  border-radius: 26px;
  background: linear-gradient(170deg, rgba(18, 29, 43, 0.9), rgba(13, 22, 34, 0.88));
  box-shadow: var(--shadow);
  transition: transform .25s ease, border-color .25s ease;
}

.about-grid article:hover,
.contact-grid article:hover {
  transform: translateY(-4px);
  border-color: #7ad7ff8d;
}

.about-grid p,
.contact-grid p {
  margin-top: 0;
  color: var(--muted);
}

.about-grid h3 {
  margin-bottom: 10px;
  font-size: 1.1rem;
}

.about-grid ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.about-grid li { margin: 8px 0; }

.about-grid a,
.contact-grid a {
  color: #e9f6ff;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.about-grid a:hover,
.contact-grid a:hover { border-bottom-color: #e9f6ff; }

.stack-game-head {
  margin-bottom: 18px;
}

.stack-arena {
  position: relative;
  min-height: 540px;
  border: 1px solid #304766;
  border-radius: 26px;
  overflow: hidden;
  box-shadow: var(--shadow);
  background:
    radial-gradient(circle at 18% 14%, rgba(122, 215, 255, 0.14), rgba(122, 215, 255, 0) 34%),
    radial-gradient(circle at 82% 86%, rgba(0, 224, 184, 0.12), rgba(0, 224, 184, 0) 34%),
    linear-gradient(170deg, rgba(18, 29, 43, 0.9), rgba(13, 22, 34, 0.88));
}

.stack-arena::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    repeating-linear-gradient(
      135deg,
      rgba(122, 215, 255, 0.02) 0,
      rgba(122, 215, 255, 0.02) 2px,
      rgba(122, 215, 255, 0) 2px,
      rgba(122, 215, 255, 0) 10px
    );
  pointer-events: none;
}

.stack-bubble {
  position: absolute;
  width: clamp(88px, 8.8vw, 118px);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid #365272;
  background:
    radial-gradient(circle at 30% 26%, rgba(235, 247, 255, 0.12), rgba(235, 247, 255, 0) 38%),
    linear-gradient(160deg, rgba(27, 41, 60, 0.9), rgba(17, 28, 42, 0.86));
  color: #f6f8ff;
  font-size: clamp(0.86rem, 1.2vw, 1.04rem);
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: grab;
  user-select: none;
  touch-action: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 3px;
  transform-origin: center;
  box-shadow:
    0 10px 18px rgba(3, 12, 22, 0.34),
    inset 0 1px 0 rgba(227, 245, 255, 0.12);
  transition: box-shadow .2s ease, border-color .2s ease, filter .2s ease, transform .2s ease, background .2s ease;
  contain: layout paint;
  will-change: left, top, transform;
  overflow: hidden;
}

.stack-bubble::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    linear-gradient(180deg, rgba(235, 249, 255, 0.13), rgba(235, 249, 255, 0) 34%);
  pointer-events: none;
}

.stack-bubble::after {
  content: "";
  position: absolute;
  inset: auto 16% 10% 16%;
  height: 24%;
  border-radius: inherit;
  background: radial-gradient(ellipse at center, rgba(122, 215, 255, 0.28), rgba(122, 215, 255, 0) 70%);
  pointer-events: none;
  opacity: 0.5;
  transition: opacity .2s ease;
}

.stack-bubble:hover {
  filter: brightness(1.06);
  transform: translateY(-2px);
  border-color: #7ad7ff8d;
  background: linear-gradient(160deg, rgba(31, 48, 70, 0.92), rgba(19, 33, 49, 0.9));
  box-shadow:
    0 14px 24px rgba(4, 11, 20, 0.38),
    inset 0 1px 0 rgba(233, 246, 255, 0.16);
}

.stack-bubble.is-dragging {
  cursor: grabbing;
  transform: scale(1.04);
  box-shadow:
    0 20px 34px rgba(3, 10, 18, 0.5),
    0 0 0 2px rgba(122, 215, 255, 0.14);
  border-color: rgba(122, 215, 255, 0.82);
  z-index: 10;
}

.stack-bubble.is-colliding {
  animation: bubblePulse .26s cubic-bezier(.22, 1.2, .35, 1);
}

.stack-icon {
  font-size: clamp(1.45rem, 2.2vw, 2rem);
  line-height: 1;
}

.stack-icon:not(.colored) {
  color: #f2f6ff;
}

.stack-icon-img {
  width: clamp(21px, 3vw, 30px);
  height: clamp(21px, 3vw, 30px);
  object-fit: contain;
  filter: drop-shadow(0 2px 5px rgba(3, 8, 18, 0.28));
}

.stack-text-icon {
  font-family: "Outfit", "Segoe UI", sans-serif;
  font-size: clamp(0.92rem, 1.25vw, 1.06rem);
  letter-spacing: 0.05em;
}

.stack-label {
  font-size: clamp(0.54rem, 0.78vw, 0.7rem);
  color: #d8ebff;
  opacity: 0.92;
  letter-spacing: 0.025em;
}

@keyframes bubblePulse {
  0% { transform: scale(1); }
  40% { transform: scale(1.09); }
  100% { transform: scale(1); }
}

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

.project-list article {
  padding: 19px;
  border: 1px solid #304766;
  border-radius: 26px;
  background: linear-gradient(160deg, rgba(20, 33, 48, 0.92), rgba(11, 20, 31, 0.9));
  position: relative;
  overflow: hidden;
  transform: translateY(0) scale(1);
  transition: transform .28s ease, box-shadow .28s ease, border-color .28s ease;
  animation: riseStagger .7s ease both;
}

.project-list article:nth-child(1) { animation-delay: .02s; }
.project-list article:nth-child(2) { animation-delay: .06s; }
.project-list article:nth-child(3) { animation-delay: .1s; }
.project-list article:nth-child(4) { animation-delay: .14s; }
.project-list article:nth-child(5) { animation-delay: .18s; }
.project-list article:nth-child(6) { animation-delay: .22s; }
.project-list article:nth-child(7) { animation-delay: .26s; }
.project-list article:nth-child(8) { animation-delay: .3s; }

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

.project-list article::before {
  content: "";
  position: absolute;
  inset: -100% auto auto -120%;
  width: 100%;
  height: 250%;
  background: linear-gradient(90deg, transparent, rgba(122, 215, 255, 0.2), transparent);
  transform: rotate(16deg);
  transition: left .45s ease;
}

.project-list article:hover {
  transform: translateY(-5px) scale(1.01);
  box-shadow: var(--shadow);
  border-color: #7ad7ff8e;
}

.project-list article:hover::before { left: 160%; }

.project-list h3 { font-size: 1.06rem; }
.project-list p { margin: 8px 0 0; color: var(--muted); }

.timeline { display: grid; gap: 10px; }

.timeline article {
  padding: 19px 20px;
  border: 1px solid #304766;
  border-radius: 22px;
  background: linear-gradient(170deg, rgba(18, 28, 42, 0.94), rgba(12, 20, 31, 0.9));
  box-shadow: var(--shadow);
  transition: transform .26s ease, border-color .26s ease;
  position: relative;
}

.timeline article::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 14px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(120deg, var(--accent-a), var(--accent-b));
}

.timeline article:hover {
  transform: translateX(6px);
  border-color: #84d9ffa8;
}

.timeline h3 { font-size: 1rem; padding-left: 16px; }
.timeline p { margin: 8px 0 0; color: var(--muted); padding-left: 16px; }

.contact-label {
  margin: 0;
  color: #95abc7;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.contact-grid a {
  display: inline-block;
  margin: 4px 0 14px;
  font-size: 1.03rem;
  font-weight: 700;
}

.contact-note { font-size: 1.05rem; line-height: 1.8; }

.site-footer {
  padding: 22px 5.5vw 30px;
  color: #9fb0c8;
  text-align: center;
}

.reveal {
  opacity: 0;
  transform: translateY(22px);
  filter: blur(4px);
  transition: opacity .75s ease, transform .75s ease, filter .75s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}

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

@media (max-width: 980px) {
  .section-head {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .hero-meta,
  .project-list,
  .about-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .hero::before { display: none; }

  .stack-arena {
    min-height: 500px;
  }
}

@media (max-width: 860px) {
  .site-header { grid-template-columns: auto auto; }

  .menu-toggle { display: inline-flex; }

  .main-nav {
    grid-column: 1 / -1;
    justify-self: stretch;
    display: none;
    flex-direction: column;
    gap: 10px;
    padding: 14px;
    border: 1px solid #304766;
    border-radius: 18px;
    background: rgba(12, 20, 31, 0.95);
  }

  .main-nav.open {
    display: flex;
    animation: fadeUp .28s ease;
  }
}
