:root {
  --bg: #1a2d47;
  --ink: #eef4ff;
  --muted: #b7c6df;
  --brand: #0099ff;
  --panel: rgba(16, 28, 48, 0.7);
  --panel-border: rgba(120, 160, 210, 0.35);
  --glow: rgba(0, 153, 255, 0.2);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(700px 300px at 15% 20%, rgba(0, 153, 255, 0.22) 0%, transparent 70%),
    radial-gradient(520px 420px at 75% 55%, rgba(255, 51, 51, 0.18) 0%, transparent 70%),
    var(--bg);
  min-height: 100vh;
  overflow-x: hidden;
}

.page {
  width: 100%;
  display: flex;
  flex-direction: column;
}

.navbar {
  position: sticky;
  top: 0;
  z-index: 10;
  width: 100%;
  background: rgba(10, 18, 32, 0.55);
  border-bottom: 1px solid rgba(120, 160, 210, 0.2);
  backdrop-filter: blur(8px);
}

.navbar__inner {
  width: min(1100px, 100%);
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px 24px;
  align-items: center;
  justify-content: space-between;
}

.navbar__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.navbar__logo,
.navbar__title {
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.4px;
}

.navbar__logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.navbar__logo-image {
  display: block;
  width: 32px;
  height: 32px;
}

.navbar__title {
  font-family: "Palatino Linotype", "Book Antiqua", serif;
  font-size: 18px;
  line-height: 1;
}

.navbar__links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 18px;
}

.navbar__toggle {
  display: none;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(140, 180, 230, 0.4);
  background: rgba(8, 16, 30, 0.75);
  color: var(--ink);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 10px;
}

.navbar__toggle-bar {
  display: block;
  width: 100%;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.navbar__links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  user-select: none;
  transition: color 0.3s ease;
}

.navbar__links a:hover,
.navbar__links a:focus {
  color: var(--ink);
}

.main {
  width: 100%;
  display: flex;
  flex-direction: column;
}

.hero {
  min-height: 95vh !important;
  margin: 0 auto 0;
  padding: 0 56px;
  display: grid;
  gap: 32px;
  width: min(1100px, 100%);
}

.hero__inner {
  display: grid;
  gap: 32px;
  align-items: center;
}

.hero__left {
  display: grid;
  gap: 20px;
}

.hero__eyebrow {
  font-weight: 700;
  color: var(--brand);
  letter-spacing: 0.6px;
  text-transform: uppercase;
  font-size: 12px;
}

.hero__title {
  font-family: "Palatino Linotype", "Book Antiqua", serif;
  font-size: clamp(32px, 4vw, 50px);
  line-height: 1.1;
  margin: 0;
}

.hero__lead {
  margin: 0;
  font-size: 18px;
  line-height: 1.6;
  color: var(--muted);
  max-width: 520px;
}

.hero__right {
  background: transparent;
  border-radius: 24px;
  padding: 0;
  box-shadow: none;
  min-height: 360px;
  min-width: 360px;
}

.hero__canvas {
  width: 100%;
  height: 100%;
  display: block;
  background-color: transparent;
}

.section {
  min-height: 100vh;
  display: flex;
  align-items: center;
}

.section__inner {
  width: min(1100px, 100%);
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  gap: 32px;
}

.section__header {
  display: grid;
  gap: 12px;
  max-width: 640px;
}

.section__eyebrow {
  font-weight: 700;
  color: var(--brand);
  letter-spacing: 0.6px;
  text-transform: uppercase;
  font-size: 12px;
}

.section__title {
  font-family: "Palatino Linotype", "Book Antiqua", serif;
  font-size: clamp(26px, 3vw, 38px);
}

.section__lead {
  color: var(--muted);
  line-height: 1.6;
}

.about__content {
  display: grid;
  gap: 28px;
}

.about__photo {
  background: linear-gradient(140deg, rgba(0, 153, 255, 0.18), rgba(255, 180, 120, 0.12));
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  min-height: 280px;
  padding: 10px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 13px;
  animation: float-in 0.9s ease both;
}

.about__photo img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: 16px;
}

.about__text {
  display: grid;
  gap: 16px;
  color: var(--muted);
  line-height: 1.7;
}

.dev-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.dev-grid__card {
  padding: 24px;
  display: grid;
  animation: float-in 0.9s ease both;
}

.dev-grid__card:nth-child(2) {
  animation-delay: 0.1s;
}

.dev-grid__card:nth-child(3) {
  animation-delay: 0.2s;
}

.dev-grid__card:nth-child(4) {
  animation-delay: 0.3s;
}

.dev-grid__card:nth-child(5) {
  animation-delay: 0.4s;
}

.dev-grid__card:nth-child(6) {
  animation-delay: 0.5s;
}

.dev-grid__icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: rgba(0, 153, 255, 0.2);
  border: 1px solid rgba(120, 170, 230, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--ink);
}

.icon-image {
  display: block;
  width: 100%;
  height: auto;
}

.dev-grid__icon .icon-image,
.project-card__logo .icon-image,
.contact-card__icon .icon-image {
  width: 30px;
}

.dev-grid__title {
  font-size: 18px;
  font-weight: 700;
}

.dev-grid__text {
  color: var(--muted);
  line-height: 1.6;
}

.projects__controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.projects__arrow {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid rgba(140, 180, 230, 0.4);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}

.projects__arrow:hover,
.projects__arrow:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(0, 153, 255, 0.2);
  transform: translateY(-1px);
}

.projects__status {
  color: var(--muted);
  font-size: 14px;
  letter-spacing: 0.3px;
}

.projects__list {
  display: grid;
  place-items: center;
  gap: 24px;
}

.project-card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  padding: 32px;
  display: grid;
  grid-area: 1 / 1;
  gap: 16px;
  box-shadow: 0 20px 46px rgba(5, 10, 20, 0.35);
  width: min(720px, 100%);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.project-card--active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  animation: float-in 0.9s ease forwards;
}

.project-card__logo {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  background: rgba(255, 197, 130, 0.2);
  border: 1px solid rgba(255, 197, 130, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.project-card__title {
  font-size: 22px;
  font-weight: 700;
}

.project-card__text {
  color: var(--muted);
  line-height: 1.7;
}

.project-card__link {
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
}

.project-card__link:hover,
.project-card__link:focus {
  color: var(--brand);
}

.project-card__stack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.project-card__chip {
  border: 1px solid rgba(140, 180, 230, 0.35);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 12px;
  color: var(--muted);
}

.contact-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.contact-card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 20px;
  padding: 22px;
  display: flex;
  align-items: center;
  gap: 16px;
  text-decoration: none;
  color: var(--ink);
  box-shadow: 0 18px 40px rgba(5, 10, 20, 0.3);
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.contact-card:hover,
.contact-card:focus {
  border-color: rgba(0, 153, 255, 0.6);
  box-shadow: 0 18px 40px rgba(5, 10, 20, 0.25), 0 0 24px rgba(0, 153, 255, 0.3);
  transform: translateY(-2px);
  animation: contact-glow 0.6s ease-in-out;
}

.contact-card__icon {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  border-radius: 16px;
  background: rgba(0, 153, 255, 0.2);
  border: 1px solid rgba(140, 180, 230, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.contact-card__body {
  min-width: 0;
}

.contact-card__title {
  font-size: 18px;
  font-weight: 700;
}

.contact-card__text {
  color: var(--muted);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.footer {
  width: 100%;
  padding: 24px 0 32px;
}

.footer__inner {
  width: min(1100px, 100%);
  margin: 0 auto;
  padding: 0 24px;
  color: var(--muted);
  text-align: center;
}

.external-link {
  color: white;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

@keyframes contact-glow {
  from {
    box-shadow: 0 18px 40px rgba(5, 10, 20, 0.3);
  }
  to {
    box-shadow: 0 18px 40px rgba(5, 10, 20, 0.25), 0 0 24px rgba(0, 153, 255, 0.3);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .about__photo,
  .dev-grid__card,
  .project-card,
  .contact-card {
    animation: none;
  }

  .projects__arrow,
  .contact-card {
    transition: none;
  }
}

@media (max-width: 380px) {
  body {
    font-size: 10px;
  }
}

@media (max-width: 365px) {
  .navbar__title {
    display: none;
  }

  .navbar__inner {
    justify-content: space-between;
  }
}

@media (max-width: 720px) {
  body {
    font-size: 12px;
  }

  .navbar__inner {
    gap: 12px;
  }

  .navbar__toggle {
    display: inline-flex;
    flex-direction: column;
    margin-left: auto;
  }

  .navbar__links {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 0 4px;
  }

  .navbar__links.navbar__links--open {
    display: flex;
  }

  .navbar__links a {
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(12, 22, 38, 0.6);
  }

  .hero {
    padding: 0 20px;
  }

  .section {
    padding: 64px 0;
  }

  .section__inner {
    gap: 24px;
  }

  .projects__controls {
    gap: 12px;
  }

  .project-card {
    padding: 24px;
  }
}

@media (max-width: 350px) {
  body {
    font-size: 11px;
  }

  .navbar__inner {
    gap: 10px;
  }

  .navbar__toggle {
    width: 40px;
    height: 40px;
    border-radius: 10px;
  }

  .navbar__links {
    gap: 8px;
    padding: 10px 0 2px;
  }

  .navbar__links a {
    padding: 8px 10px;
  }

  .hero {
    min-height: auto;
    gap: 18px;
    padding: 0 12px;
  }

  .hero__inner {
    gap: 18px;
  }

  .hero__left {
    gap: 14px;
  }

  .hero__title {
    font-size: 26px;
  }

  .hero__lead {
    font-size: 15px;
  }

  .hero__right {
    width: min(100%, 220px);
    max-width: 220px;
    min-width: 0;
    min-height: 0;
    aspect-ratio: 1 / 1;
    justify-self: center;
  }

  .section {
    padding: 40px 0;
  }

  .section__inner {
    gap: 20px;
    padding: 0 12px;
  }

  .section__title {
    font-size: 24px;
  }

  .section__lead {
    font-size: 15px;
  }

  .projects__controls {
    gap: 10px;
  }

  .projects__status {
    font-size: 13px;
    text-align: center;
  }

  .project-card {
    padding: 18px;
    border-radius: 20px;
  }

  .project-card__title {
    font-size: 20px;
  }

  .contact-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .contact-card {
    padding: 18px;
    gap: 12px;
  }

  .footer__inner {
    padding: 0 14px;
  }
}

@media (min-width: 820px) {
  .about__content {
    grid-template-columns: 0.9fr 1.1fr;
    align-items: center;
  }
}

@media (min-width: 960px) {
  .hero {
    padding: 0 56px;
  }

  .section__inner {
    padding: 0 56px;
  }

  .hero__inner {
    grid-template-columns: 1.1fr 0.9fr;
  }

  .hero__right {
    min-height: 640px;
    min-width: 640px;
  }
}
