:root {
  --ink: #f8fbff;
  --muted: #b7c2d6;
  --soft: #dce6f7;
  --page: min(1120px, calc(100% - 48px));
  --bg: #070912;
  --panel: rgba(16, 24, 38, 0.78);
  --panel-strong: rgba(21, 32, 51, 0.92);
  --line: rgba(220, 230, 247, 0.16);
  --cyan: #26d9d0;
  --blue: #5d8cff;
  --rose: #ff6f91;
  --amber: #ffc857;
  --green: #7bd88f;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(120deg, rgba(38, 217, 208, 0.12), transparent 28rem),
    linear-gradient(240deg, rgba(255, 111, 145, 0.12), transparent 30rem),
    var(--bg);
  font-family: "Manrope", Arial, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -2;
  content: "";
  pointer-events: none;
  background:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(to bottom, black, transparent 78%);
}

body::after {
  position: fixed;
  inset: 0;
  z-index: -3;
  content: "";
  pointer-events: none;
  background:
    radial-gradient(circle at 14% 12%, rgba(93, 140, 255, 0.34), transparent 21rem),
    radial-gradient(circle at 90% 18%, rgba(255, 200, 87, 0.2), transparent 18rem),
    radial-gradient(circle at 72% 86%, rgba(38, 217, 208, 0.24), transparent 22rem);
}

a { color: inherit; }

::selection {
  color: #061015;
  background: var(--cyan);
}

.section-shell {
  width: var(--page);
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: var(--page);
  min-height: 84px;
  margin: 0 auto;
  backdrop-filter: blur(18px);
}

.site-header::before {
  position: absolute;
  inset: 14px -16px;
  z-index: -1;
  border: 1px solid var(--line);
  border-radius: 8px;
  content: "";
  background: rgba(7, 9, 18, 0.72);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.26);
}

.brand {
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
  letter-spacing: 0;
}

.brand::after {
  color: var(--cyan);
  content: " / portfolio";
  font-family: "DM Mono", monospace;
  font-size: 0.76rem;
  font-weight: 500;
}

.nav-links,
.footer-links,
.social-row {
  display: flex;
  align-items: center;
  gap: 22px;
}

.nav-links a,
.footer-links a,
.social-row a {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-decoration: none;
  transition: color 160ms ease, transform 160ms ease;
}

.nav-links a:hover,
.footer-links a:hover,
.social-row a:hover {
  color: var(--cyan);
  transform: translateY(-1px);
}

.hero {
  display: grid;
  min-height: calc(100svh - 84px);
  grid-template-columns: minmax(0, 1.03fr) minmax(340px, 0.78fr);
  gap: clamp(36px, 7vw, 88px);
  align-items: center;
  padding: 54px 0 96px;
}

.hero-copy-block > * {
  animation: heroRise 720ms ease both;
}

.hero-copy-block > *:nth-child(2) { animation-delay: 90ms; }
.hero-copy-block > *:nth-child(3) { animation-delay: 170ms; }
.hero-copy-block > *:nth-child(4) { animation-delay: 250ms; }
.hero-copy-block > *:nth-child(5) { animation-delay: 340ms; }

h1,
h2,
h3,
p { margin-top: 0; }

.eyebrow {
  margin: 0 0 12px;
  color: var(--cyan);
  font-family: "DM Mono", monospace;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
}

h1 {
  max-width: 780px;
  margin-bottom: 22px;
  font-size: clamp(3.2rem, 7vw, 6.4rem);
  font-weight: 800;
  line-height: 0.96;
  letter-spacing: 0;
}

.hero-tagline {
  margin-bottom: 10px;
  color: var(--amber);
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  font-weight: 800;
}

.hero-copy-block > p:last-of-type {
  max-width: 610px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.03rem;
  font-weight: 600;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 38px;
}

.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  padding: 0 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font: 800 0.86rem "Manrope", Arial, sans-serif;
  text-decoration: none;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease, background 180ms ease;
}

.button.primary {
  border-color: transparent;
  color: #051014;
  background: linear-gradient(90deg, var(--cyan), var(--amber));
  box-shadow: 0 18px 42px rgba(38, 217, 208, 0.18);
}

.button.ghost {
  background: rgba(255, 255, 255, 0.045);
}

.button:hover {
  border-color: rgba(38, 217, 208, 0.5);
  transform: translateY(-2px);
}

.hero-showcase {
  position: relative;
  align-self: center;
  justify-self: center;
  overflow: hidden;
  width: 100%;
  max-width: 460px;
  aspect-ratio: 4 / 5;
  border: 2px solid rgba(38, 217, 208, 0.5);
  border-radius: 16px;
  background: transparent;
  box-shadow:
    0 0 0 5px rgba(38, 217, 208, 0.06),
    0 20px 50px rgba(0, 0, 0, 0.25);
}

.hero-showcase img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center bottom;
  filter: saturate(0.95) contrast(1.04);
}

.showcase-panel {
  position: absolute;
  right: 18px;
  bottom: 18px;
  left: 18px;
  z-index: 1;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(7, 9, 18, 0.76);
  backdrop-filter: blur(14px);
}

.showcase-panel span {
  display: block;
  margin-bottom: 8px;
  color: var(--cyan);
  font: 500 0.72rem "DM Mono", monospace;
  text-transform: uppercase;
}

.showcase-panel strong {
  display: block;
  font-size: 1rem;
  line-height: 1.45;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  padding: 0 0 88px;
}

.stats div,
.skill-card-grid article,
.project-card,
.certificate-card,
.timeline article,
.contact-form {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, var(--panel-strong), rgba(10, 14, 24, 0.86));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.stats div {
  min-height: 112px;
  padding: 22px;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.stats div:hover,
.skill-card-grid article:hover,
.timeline article:hover,
.certificate-card:hover,
.project-card:hover {
  border-color: rgba(38, 217, 208, 0.54);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.22);
  transform: translateY(-4px);
}

.stats strong {
  display: block;
  color: var(--amber);
  font: 500 1.9rem "DM Mono", monospace;
}

.stats span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.about,
.skills,
.projects,
.education,
.certificates,
.contact {
  padding: 92px 0;
}

.section-heading {
  width: min(780px, 100%);
  margin: 0 auto 54px;
  text-align: center;
}

.section-title {
  margin: 0;
  font-size: clamp(2.15rem, 4.7vw, 4.6rem);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: 0;
}

.about-grid {
  width: min(780px, 100%);
  margin: 0 auto;
}

.about-content h3,
.certificate-content h3 {
  margin-bottom: 16px;
  color: var(--soft);
  font-size: clamp(1.55rem, 3vw, 2.2rem);
  line-height: 1.15;
}

.about-content p,
.project-card p,
.timeline p,
.certificate-content p:not(.eyebrow) {
  color: var(--muted);
}

.about-tags,
.project-tags,
.tech-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.about-tags {
  margin-top: 28px;
}

.about-tags span,
.project-tags span,
.tech-strip span {
  border: 1px solid rgba(38, 217, 208, 0.26);
  border-radius: 999px;
  color: var(--soft);
  background: rgba(38, 217, 208, 0.07);
  font: 700 0.75rem "DM Mono", monospace;
}

.about-tags span {
  padding: 10px 14px;
}

.skill-card-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.skill-card-grid article {
  min-height: 210px;
  padding: 24px;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.skill-card-grid span {
  color: var(--cyan);
  font: 500 0.78rem "DM Mono", monospace;
}

.skill-card-grid h3,
.project-card h3,
.timeline h3 {
  margin: 10px 0;
  font-size: 1.14rem;
}

.skill-card-grid p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.tech-strip {
  justify-content: center;
  margin-top: 34px;
}

.tech-strip span,
.project-tags span {
  padding: 8px 12px;
}

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

.project-card {
  display: flex;
  overflow: hidden;
  min-height: 100%;
  flex-direction: column;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.project-card.featured {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
}

.project-preview {
  position: relative;
  overflow: hidden;
  min-width: 0;
  min-height: 250px;
  aspect-ratio: 16 / 10;
  background:
    linear-gradient(135deg, rgba(38, 217, 208, 0.16), rgba(255, 200, 87, 0.1)),
    var(--panel);
}

.project-card:not(.featured) .project-preview {
  min-height: 220px;
}

.project-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  transition: filter 420ms ease;
}

.project-preview > .image-trigger {
  position: absolute;
  inset: 0;
  min-height: 0;
  padding: 12px;
}

.image-trigger {
  display: block;
  width: 100%;
  height: 100%;
  min-height: inherit;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  cursor: zoom-in;
}

.image-trigger img {
  pointer-events: none;
}

.project-card:hover .project-preview img {
  filter: saturate(1.08) contrast(1.05);
}

.project-abstract {
  display: grid;
  place-items: center;
  background:
    linear-gradient(135deg, rgba(255, 200, 87, 0.24), rgba(255, 111, 145, 0.16)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.06) 0 1px, transparent 1px 34px),
    #151822;
}

.project-abstract span {
  color: var(--amber);
  font: 800 clamp(2rem, 5vw, 4rem) "Manrope", Arial, sans-serif;
}

.project-carousel > .image-trigger {
  padding: 12px 12px 48px;
}

.project-carousel > .image-trigger[hidden] {
  display: none;
}

.carousel-arrow {
  position: absolute;
  top: 50%;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(38, 217, 208, 0.5);
  border-radius: 50%;
  color: var(--ink);
  background: rgba(7, 9, 18, 0.85);
  font: 400 2rem/1 Arial, sans-serif;
  cursor: pointer;
  transform: translateY(-50%);
}

.carousel-prev { left: 12px; }
.carousel-next { right: 12px; }

.carousel-arrow:hover {
  color: var(--cyan);
  border-color: var(--cyan);
  background: var(--bg);
}

.carousel-counter {
  position: absolute;
  bottom: 12px;
  left: 50%;
  padding: 4px 12px;
  border: 1px solid var(--line);
  border-radius: 20px;
  color: var(--ink);
  background: rgba(7, 9, 18, 0.85);
  font: 500 0.75rem/1.6 "DM Mono", monospace;
  pointer-events: none;
  transform: translateX(-50%);
}

.project-iot-card .project-body > p:not(.project-meta) {
  flex: 0;
}

.project-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 24px;
}

.project-meta {
  margin-bottom: 8px;
  color: var(--cyan);
  font: 500 0.72rem "DM Mono", monospace;
  text-transform: uppercase;
}

.project-card > .project-body > p:not(.project-meta) {
  flex: 1;
  margin-bottom: 18px;
  font-size: 0.94rem;
}

.card-actions {
  display: flex;
  gap: 12px;
  margin-top: 22px;
}

.card-actions a,
.social-row a {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(38, 217, 208, 0.28);
  border-radius: 8px;
  color: var(--cyan);
  background: rgba(255, 255, 255, 0.035);
  font-size: 0.78rem;
  font-weight: 800;
  text-decoration: none;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.card-actions a {
  min-width: 126px;
  padding: 0 16px;
}

.card-actions a:hover,
.social-row a:hover {
  border-color: rgba(38, 217, 208, 0.62);
  background: rgba(38, 217, 208, 0.08);
  box-shadow: 0 14px 36px rgba(38, 217, 208, 0.12);
}

.timeline {
  display: grid;
  gap: 16px;
  max-width: 860px;
  margin: 0 auto;
}

.timeline article {
  padding: 24px;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.timeline span {
  display: block;
  margin-bottom: 10px;
  color: var(--amber);
  font: 500 0.82rem "DM Mono", monospace;
}

.timeline p { margin-bottom: 0; }

.certificate-card {
  display: grid;
  grid-template-columns: 0.86fr 1fr;
  gap: clamp(24px, 5vw, 58px);
  align-items: center;
  max-width: 960px;
  margin: 0 auto;
  padding: clamp(18px, 3vw, 26px);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.certificate-preview {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.certificate-preview img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.certificate-preview .image-trigger {
  min-height: 100%;
}

.certificate-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 0;
}

.certificate-details div {
  padding: 16px;
  border: 1px solid rgba(38, 217, 208, 0.24);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.certificate-details dt {
  color: var(--cyan);
  font: 500 0.72rem "DM Mono", monospace;
  text-transform: uppercase;
}

.certificate-details dd {
  margin: 4px 0 0;
  color: var(--ink);
  font-weight: 800;
}

.contact-form {
  display: grid;
  gap: 20px;
  width: min(690px, 100%);
  margin: 0 auto;
  padding: clamp(22px, 5vw, 42px);
}

.contact-form label {
  display: grid;
  gap: 8px;
}

.contact-form span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(7, 9, 18, 0.72);
  font: inherit;
  outline: none;
}

.contact-form input {
  min-height: 48px;
  padding: 0 15px;
}

.contact-form textarea {
  min-height: 170px;
  padding: 14px 15px;
  resize: vertical;
}

.contact-form input:focus,
.contact-form textarea:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 4px rgba(38, 217, 208, 0.12);
}

.contact-form button { justify-self: end; }

.social-row {
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 34px;
}

.social-row a {
  min-width: 86px;
  padding: 0 16px;
}

body.lightbox-open {
  overflow: hidden;
}

.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.image-lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 5, 10, 0.82);
  backdrop-filter: blur(14px);
}

.lightbox-dialog {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 12px;
  width: min(1080px, 100%);
  max-height: min(86vh, 820px);
  margin: 0;
  padding: 14px;
  border: 1px solid rgba(220, 230, 247, 0.22);
  border-radius: 8px;
  background: rgba(7, 9, 18, 0.94);
  box-shadow: 0 30px 110px rgba(0, 0, 0, 0.58);
}

.lightbox-toolbar {
  display: inline-flex;
  width: fit-content;
  max-width: calc(100% - 56px);
  gap: 8px;
  align-items: center;
  padding-right: 52px;
}

.lightbox-toolbar button {
  display: grid;
  min-width: 42px;
  height: 38px;
  place-items: center;
  padding: 0 12px;
  border: 1px solid rgba(220, 230, 247, 0.24);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.055);
  font: 800 0.84rem "Manrope", Arial, sans-serif;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.lightbox-toolbar button:hover {
  border-color: rgba(38, 217, 208, 0.62);
  background: rgba(38, 217, 208, 0.16);
  transform: translateY(-1px);
}

.lightbox-image-stage {
  overflow: auto;
  display: grid;
  max-height: calc(86vh - 144px);
  min-height: 220px;
  place-items: center;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
}

.lightbox-dialog img {
  display: block;
  width: 100%;
  max-height: calc(86vh - 154px);
  object-fit: contain;
  transition: width 160ms ease;
}

.lightbox-dialog figcaption {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}

.lightbox-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(220, 230, 247, 0.24);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(7, 9, 18, 0.88);
  font: 800 0.95rem "Manrope", Arial, sans-serif;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.lightbox-close:hover {
  border-color: rgba(38, 217, 208, 0.62);
  background: rgba(38, 217, 208, 0.16);
  transform: translateY(-1px);
}

.site-footer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 26px;
  width: var(--page);
  margin: 70px auto 0;
  padding: 46px 0;
  border-top: 1px solid var(--line);
}

.site-footer span {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.78rem;
}

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 640ms ease, transform 640ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 4px;
}

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

@media (max-width: 960px) {
  :root { --page: min(100% - 32px, 1120px); }

  .hero,
  .about-grid,
  .project-card.featured,
  .certificate-card {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    padding-top: 38px;
  }

  .hero-showcase {
    max-width: 420px;
  }

  .stats,
  .skill-card-grid,
  .project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .section-heading {
    text-align: left;
  }
}

@media (max-width: 680px) {
  .site-header {
    position: static;
    align-items: flex-start;
    flex-direction: column;
    gap: 16px;
    padding: 20px 0;
  }

  .site-header::before {
    inset: 10px -10px;
  }

  .nav-links,
  .footer-links {
    width: 100%;
    gap: 14px;
    overflow-x: auto;
    padding-bottom: 4px;
    white-space: nowrap;
  }

  h1 { font-size: clamp(2.65rem, 13vw, 4.4rem); }

  .hero-actions,
  .button,
  .contact-form button {
    width: 100%;
  }

  .stats,
  .skill-card-grid,
  .project-grid,
  .certificate-details,
  .site-footer {
    grid-template-columns: 1fr;
  }

  .project-card:not(.featured) .project-preview,
  .project-preview {
    min-height: 190px;
  }

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

  .image-lightbox {
    padding: 14px;
  }

  .lightbox-dialog {
    padding: 10px;
  }

  .lightbox-close {
    top: 10px;
    right: 10px;
    width: 38px;
    height: 38px;
  }

  .site-footer {
    justify-items: start;
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
