:root {
  --bg: #030712;
  --bg-deep: #020617;
  --bg-soft: #0f172a;
  --surface: rgba(15, 23, 42, 0.4);
  --surface-strong: rgba(7, 10, 25, 0.9);
  --line: rgba(255, 255, 255, 0.08);
  --text: #f8fafc;
  --muted: #94a3b8;
  --accent: #10b981;
  --accent-secondary: #6366f1;
  --accent-violet: #8b5cf6;
  --shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 12px;
}

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

html {
  scroll-behavior: smooth;
  overflow-x: clip;
}

body {
  margin: 0;
  padding: 0;
  font-family: "Manrope", sans-serif;
  color: var(--text);
  background-color: var(--bg-deep);
  background-image:
    radial-gradient(circle at 0% 0%, rgba(33, 62, 52, 0.1) 0%, transparent 40%),
    radial-gradient(circle at 100% 0%, rgba(99, 102, 241, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 50% 50%, rgba(139, 92, 246, 0.05) 0%, transparent 50%);
  background-attachment: fixed;
  min-height: 100vh;
  overflow-x: clip;
  width: 100%;
}

img {
  max-width: 100%;
  display: block;
}

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

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

p {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

h1,
h2,
h3,
strong,
.brand span,
.eyebrow {
  font-family: "Space Grotesk", sans-serif;
}

h1,
h2,
h3 {
  margin: 0;
  color: #f8fbff;
}

.site-header {
  min-height: 100vh;
  background:
    linear-gradient(rgba(4, 10, 19, 0.7), rgba(4, 10, 19, 0.82)),
    url("img/bg.jpg") center/cover no-repeat;
  position: relative;
}

.site-header::after {
  content: "";
  position: absolute;
  inset: auto -12% -120px auto;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99, 230, 190, 0.35), transparent 65%);
  filter: blur(8px);
}

.navbar,
.section-shell,
.site-footer {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  margin-top: 1rem;
  margin-bottom: 1rem;
  border-radius: var(--radius-sm);
  position: sticky;
  top: 1rem;
  z-index: 100;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
}

.brand img {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.brand span {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-menu a {
  display: inline-flex;
  align-items: center;
  padding: 0.75rem 1rem;
  border-radius: 999px;
  color: #d8e4f7;
  transition: 0.2s ease;
}

.nav-menu a:hover,
.nav-menu a:focus-visible {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.hamburger {
  display: none;
  border: 0;
  background: rgba(255, 255, 255, 0.08);
  width: 48px;
  height: 48px;
  border-radius: 14px;
  cursor: pointer;
  padding: 0;
}

.bar {
  display: block;
  width: 22px;
  height: 2px;
  margin: 5px auto;
  background: #fff;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.hero {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 3rem;
  align-items: center;
  padding: 4.5rem 0 6rem;
  position: relative;
  z-index: 1;
}

.eyebrow {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.82rem;
  margin-bottom: 1rem;
}

.hero h1 {
  font-size: clamp(2.8rem, 5vw, 5.4rem);
  line-height: 0.98;
  max-width: 10ch;
}

.hero-text {
  margin-top: 1.4rem;
  max-width: 58ch;
  font-size: 1.05rem;
}

.hero-actions,
.contact-actions,
.project-links,
.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
}

.hero-actions {
  margin-top: 2rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0.85rem 1.35rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 700;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-3px) scale(1.02);
  filter: brightness(1.1);
}

.button-primary {
  background: linear-gradient(135deg, var(--accent) 0%, #57b4ff 100%);
  color: #05111c;
}

.button-secondary {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--line);
  color: #f6fbff;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 2.2rem;
}

.hero-stats article,
.info-card,
.project-card,
.process-card,
.contact-card,
.portrait-card,
.floating-note {
  border: 1px solid var(--line);
  background: var(--surface);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
}

.hero-stats article {
  padding: 1.2rem;
  border-radius: var(--radius-md);
}

.hero-stats strong {
  display: block;
  font-size: 1.7rem;
  margin-bottom: 0.2rem;
}

.hero-visual {
  position: relative;
  min-height: 520px;
}

.portrait-card {
  width: min(100%, 430px);
  margin-left: auto;
  padding: 1.1rem;
  border-radius: 34px;
  position: relative;
  overflow: hidden;
}

.portrait-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.1), transparent 45%);
  pointer-events: none;
}

.portrait-ring {
  position: absolute;
  inset: 20px;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.portrait {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 28px;
  object-position: center top;
}

.floating-note {
  position: absolute;
  padding: 1rem 1.1rem;
  border-radius: var(--radius-md);
  max-width: 240px;
}

.floating-note span {
  display: block;
  color: var(--muted);
  font-size: 0.83rem;
  margin-bottom: 0.35rem;
}

.floating-note strong {
  font-size: 1rem;
  line-height: 1.4;
}

.note-top {
  top: 28px;
  left: 0;
}

.note-bottom {
  right: 0;
  bottom: 32px;
}

.section-shell {
  padding: 5.5rem 0;
}

.about-grid,
.process-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 2rem;
  align-items: start;
}

.about-grid h2,
.section-heading h2,
.process-grid h2,
.contact-card h2 {
  font-size: clamp(2rem, 3vw, 3.2rem);
  line-height: 1.08;
  max-width: 14ch;
}

.about-cards,
.process-list,
.projects-grid {
  display: grid;
  gap: 1rem;
}

.about-cards {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.info-card,
.process-card,
.project-card,
.contact-card {
  border-radius: var(--radius-lg);
}

.info-card,
.process-card {
  padding: 1.4rem;
}

.info-card h3,
.process-card h3,
.project-card h3 {
  font-size: 1.2rem;
  margin-bottom: 0.8rem;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
  margin-bottom: 1.6rem;
}

.inline-link {
  color: #f6fbff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  padding-bottom: 0.15rem;
}

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

.project-card {
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), border-color 0.3s ease;
}

.project-card:hover {
  transform: translateY(-8px) scale(1.01);
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(30, 41, 59, 0.5);
}

.project-card::after {
  content: "";
  position: absolute;
  inset: auto -40px -60px auto;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  opacity: 0.22;
  filter: blur(4px);
}

.accent-sky::after {
  background: #57b4ff;
}

.accent-rose::after {
  background: #ff7eb3;
}

.accent-gold::after {
  background: #f8c15c;
}

.accent-mint::after {
  background: #63e6be;
}

.accent-slate::after {
  background: #bcccdc;
}

.accent-lilac::after {
  background: #b69cff;
}

.accent-violet::after {
  background: #8b5cf6;
}

.project-top {
  margin-bottom: 0.8rem;
}

.project-badge {
  display: inline-flex;
  margin-bottom: 0.9rem;
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #f2f7ff;
  font-size: 0.82rem;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.2rem;
}

.tag-list li,
.project-links a {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
}

.tag-list li {
  padding: 0.45rem 0.75rem;
  color: #d9e7fa;
  font-size: 0.85rem;
}

.project-links {
  margin-top: 1.35rem;
}

.project-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.65rem 1rem;
  font-weight: 700;
}

.process-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.process-card span {
  display: inline-flex;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  background: rgba(99, 230, 190, 0.1);
  color: var(--accent);
  font-weight: 800;
}

.contact-shell {
  padding-top: 2rem;
  padding-bottom: 6rem;
}

.contact-card {
  padding: 2rem;
}

.contact-card p + .contact-actions {
  margin-top: 1.8rem;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 0 2rem;
}

.social-links a {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
}

@media (max-width: 960px) {
  .hero,
  .about-grid,
  .process-grid,
  .about-cards,
  .process-list,
  .projects-grid,
  .hero-stats {
    grid-template-columns: 1fr;
  }

  .hero h1,
  .about-grid h2,
  .section-heading h2,
  .process-grid h2,
  .contact-card h2 {
    max-width: unset;
  }

  .hero {
    padding-top: 3rem;
  }

  .hero-visual {
    min-height: auto;
  }

  .portrait-card {
    margin: 0 auto;
  }

  .floating-note {
    position: static;
    margin-top: 1rem;
    max-width: 100%;
  }

  .section-heading,
  .site-footer {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 760px) {
  html {
    font-size: 14px;
  }

  /* --- Performance Patch for Old Phones --- */
  body {
    background-attachment: scroll !important;
  }

  .navbar,
  .info-card,
  .project-card,
  .process-card,
  .contact-card,
  .portrait-card,
  .floating-note {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background-color: var(--surface-strong) !important;
    box-shadow: none !important;
  }

  .project-card::after,
  .site-header::after {
    display: none !important; /* Hide heavy blur pseudo-elements */
  }
  /* ---------------------------------------- */

  .navbar {
    padding-top: 1rem;
  }

  .hamburger {
    display: inline-block;
    z-index: 30;
    margin-left: auto;
  }

  .nav-menu {
    position: absolute;
    top: calc(100% + 0.8rem);
    right: 0;
    width: min(320px, 100%);
    padding: 0.8rem;
    flex-direction: column;
    align-items: stretch;
    background: var(--surface-strong);
    border: 1px solid var(--line);
    border-radius: 24px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-12px);
    transition: 0.25s ease;
  }

  .nav-menu.active {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }

  .nav-menu a {
    width: 100%;
  }

  .hamburger.active .bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .hamburger.active .bar:nth-child(2) {
    opacity: 0;
  }

  .hamburger.active .bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .hero {
    padding-top: 2rem;
    padding-bottom: 4.5rem;
  }

  .eyebrow {
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    margin-bottom: 0.8rem;
    opacity: 0.8;
  }

  .hero h1 {
    font-size: clamp(2rem, 10vw, 2.8rem);
    line-height: 1.1;
    margin-bottom: 1.2rem;
  }

  .button,
  .project-links a {
    width: 100%;
  }

  .contact-actions .button {
    width: auto;
  }

  .contact-actions {
    flex-direction: column;
  }
}
