:root {
  --bg: #4fb3dc;
  --bg-dark: #3a9fcb;
  --panel-left: #3f3f3f;
  --panel-right: #222222;
  --nav: #3a3a3a;
  --text: #ffffff;
  --muted: #a8a8a8;
  --accent: #4fb3dc;
  --radius: 22px;
}

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

html, body {
  height: 100%;
}

body {
  font-family: "Poppins", sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
}

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

/* ---------- Background decorations ---------- */
.bg {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: 0;
  background: linear-gradient(135deg, #58bbe3 0%, #4aaed8 50%, #56b8e0 100%);
}

.shape {
  position: absolute;
  background: rgba(255, 255, 255, 0.06);
  transform: skewX(-30deg);
}
.shape-1 { width: 40%; height: 70%; top: 10%; left: 30%; }
.shape-2 { width: 30%; height: 60%; bottom: -10%; left: 5%; background: rgba(0, 0, 0, 0.04); }
.shape-3 { width: 35%; height: 100%; top: 0; right: 5%; background: rgba(255, 255, 255, 0.05); }

.dots {
  position: absolute;
  width: 110px;
  height: 140px;
  background-image: radial-gradient(rgba(255, 255, 255, 0.8) 1.5px, transparent 1.5px);
  background-size: 12px 12px;
}
.dots-1 { top: 9%; left: 2%; }

.stripes {
  position: absolute;
  width: 120px;
  height: 80px;
  background: repeating-linear-gradient(-35deg, rgba(255, 255, 255, 0.4) 0 4px, transparent 4px 12px);
}
.stripes-1 { bottom: 6%; left: 1%; }
.stripes-2 { bottom: 4%; right: 0; transform: scaleX(-1); }

.circle {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
}
.c1 { width: 20px; height: 20px; top: 50%; left: 6%; }
.c2 { width: 10px; height: 10px; top: 68%; left: 3.5%; }
.c3 { width: 12px; height: 12px; top: 63%; right: 5%; }

.square {
  position: absolute;
  width: 28px;
  height: 28px;
  background: rgba(255, 255, 255, 0.35);
  top: 13%;
  right: 9%;
  transform: rotate(15deg);
}

/* ---------- Layout ---------- */
.wrapper {
  position: relative;
  z-index: 1;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 40px 24px;
}

/* ---------- Profile (left) ---------- */
.profile {
  width: 300px;
  height: min(480px, 80vh);
  flex-shrink: 0;
  background: var(--panel-left);
  border-radius: var(--radius) 0 0 var(--radius);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  overflow-y: auto;
  position: relative;
  z-index: 2;
  margin-right: -16px; /* attach to content panel */
}

.profile::-webkit-scrollbar { width: 10px; }
.profile::-webkit-scrollbar-track { background: #d6d6d6; }
.profile::-webkit-scrollbar-thumb { background: #b0b0b0; }

.profile-inner {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 24px 20px;
}

.avatar {
  position: relative;
  width: 145px;
  height: 145px;
  margin-bottom: 26px;
}
.avatar::after {
  content: "";
  position: absolute;
  inset: -6px -10px -12px -6px;
  border-radius: 50%;
  background-image: radial-gradient(rgba(255, 255, 255, 0.35) 1px, transparent 1px);
  background-size: 6px 6px;
  z-index: -1;
}
.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  border-radius: 50%;
  border: 3px solid #fff;
}

.profile-name {
  font-size: 21px;
  white-space: nowrap;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0.5px;
}

.profile-role {
  color: var(--muted);
  font-size: 15px;
  margin-top: 6px;
}

.socials {
  display: flex;
  gap: 16px;
  margin: 16px 0 40px;
  font-size: 15px;
}
.socials a { transition: color 0.2s; }
.socials a:hover { color: var(--accent); }

.btn {
  display: inline-block;
  padding: 8px 26px;
  border: 2px solid #fff;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 500;
  background: transparent;
  color: #fff;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.25s, color 0.25s, border-color 0.25s;
}
.btn:hover {
  background: var(--accent);
  border-color: var(--accent);
}

.copyright {
  font-size: 10px;
  color: var(--muted);
  margin-top: 14px;
}

/* ---------- Content (right) ---------- */
.content {
  position: relative;
  width: min(620px, 100%);
  height: min(480px, 80vh);
  background: var(--panel-right);
  border-radius: 0 var(--radius) var(--radius) 0;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  z-index: 3;
}

.page {
  position: absolute;
  inset: 0;
  padding: 40px 44px;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transform: translateX(40px);
  transition: opacity 0.45s ease, transform 0.45s ease, visibility 0.45s;
}
.page.active {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}
.page.leave-left { transform: translateX(-40px); }

.page::-webkit-scrollbar { width: 6px; }
.page::-webkit-scrollbar-thumb { background: #444; border-radius: 3px; }

/* Home */
.home {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.home-title {
  font-size: clamp(32px, 5vw, 46px);
  font-weight: 600;
}
.home-hello {
  color: var(--accent);
  font-size: 14px;
  letter-spacing: 1px;
  margin-bottom: 4px;
}
.home-sub {
  color: var(--muted);
  font-size: 16px;
  min-height: 24px;
}
.home-sub #typed { color: #e8e8e8; }
.cursor {
  color: var(--accent);
  margin-left: 2px;
  animation: blink 0.8s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.home-desc {
  max-width: 420px;
  margin: 18px auto 0;
  color: #bdbdbd;
  font-size: 14px;
  line-height: 1.8;
}
.home-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 26px;
}
.btn-fill {
  background: var(--accent);
  border-color: var(--accent);
}
.btn-fill:hover {
  background: transparent;
  border-color: #fff;
}

/* Shared */
.page-title {
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 20px;
}
.page-title span { color: var(--accent); }

.sub-title {
  font-size: 17px;
  font-weight: 500;
  margin: 26px 0 14px;
}
.sub-title i { color: var(--accent); margin-right: 6px; }

.lead {
  color: #cfcfcf;
  font-size: 14px;
  line-height: 1.8;
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 20px;
  margin-top: 20px;
  font-size: 13px;
}
.info-grid span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Skills */
.skills { display: grid; gap: 14px; }
.skill p {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 6px;
}
.skill b { color: var(--accent); font-weight: 500; }
.skill small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
  margin-left: 4px;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.badges span {
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 12px;
  color: #e8e8e8;
  background: rgba(79, 179, 220, 0.12);
  border: 1px solid rgba(79, 179, 220, 0.45);
  transition: background 0.2s, color 0.2s;
}
.badges span:hover {
  background: var(--accent);
  color: #fff;
}

/* Activity heatmap */
.activity {
  --cell: 11px;
  --gap: 3px;
  background: #1b1b1b;
  border-radius: 12px;
  padding: 14px;
}
.activity-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 12px;
}
.activity-meta i { color: var(--accent); margin-right: 4px; }
.activity-meta b { color: #fff; font-weight: 600; }

/* rtl makes the scroll start at the most recent weeks (right end) */
.heatmap-scroll {
  overflow-x: auto;
  padding-bottom: 6px;
  direction: rtl;
}
.heatmap-inner {
  direction: ltr;
  width: max-content;
}
.heatmap-scroll::-webkit-scrollbar { height: 5px; }
.heatmap-scroll::-webkit-scrollbar-thumb { background: #444; border-radius: 3px; }

.heatmap-months {
  position: relative;
  height: 16px;
  margin-left: 18px;
  font-size: 10px;
  color: var(--muted);
}
.heatmap-months span { position: absolute; top: 0; }

.heatmap-body { display: flex; gap: 4px; }
.heatmap-days {
  display: grid;
  grid-template-rows: repeat(7, var(--cell));
  gap: var(--gap);
  width: 14px;
  font-size: 9px;
  line-height: var(--cell);
  color: var(--muted);
}
.heatmap {
  display: grid;
  grid-template-rows: repeat(7, var(--cell));
  grid-auto-flow: column;
  grid-auto-columns: var(--cell);
  gap: var(--gap);
}
.heatmap i,
.heatmap-legend i {
  width: var(--cell);
  height: var(--cell);
  border-radius: 3px;
}
.heatmap i { transition: transform 0.15s; }
.heatmap i:hover { transform: scale(1.3); }
.heatmap i.empty { visibility: hidden; }

.l0 { background: #2e2e2e; }
.l1 { background: #1f5f7c; }
.l2 { background: #2e86ae; }
.l3 { background: #4fb3dc; }
.l4 { background: #a8e1f7; }

.heatmap-legend {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
  margin-top: 8px;
  font-size: 10px;
  color: var(--muted);
}
.heatmap-legend i { display: inline-block; }
.bar {
  height: 6px;
  background: #3a3a3a;
  border-radius: 3px;
  overflow: hidden;
}
.bar i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  border-radius: 3px;
  transition: width 1s ease 0.2s;
}
.page.active .bar i { width: var(--w); }

/* Timeline */
.timeline {
  list-style: none;
  border-left: 2px solid #3a3a3a;
  padding-left: 20px;
}
.timeline li {
  position: relative;
  padding-bottom: 18px;
}
.timeline li::before {
  content: "";
  position: absolute;
  left: -27px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--panel-right);
}
.date {
  display: inline-block;
  font-size: 11px;
  color: var(--accent);
  margin-bottom: 4px;
}
.timeline h4 { font-size: 15px; font-weight: 500; }
.timeline p { font-size: 13px; color: var(--muted); }

.points {
  list-style: disc;
  margin: 8px 0 0 16px;
  display: grid;
  gap: 4px;
}
.timeline .points li {
  padding: 0;
  font-size: 12.5px;
  line-height: 1.6;
  color: #c4c4c4;
}
.timeline .points li::before { content: none; }
.points li::marker { color: var(--accent); }

.languages {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.lang {
  background: #2b2b2b;
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  padding: 12px 14px;
}
.lang h4 { font-size: 14px; font-weight: 500; }
.lang span { font-size: 12px; color: var(--accent); }

/* Portfolio */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}
.filter {
  background: none;
  border: 1px solid #444;
  color: var(--muted);
  padding: 5px 14px;
  border-radius: 20px;
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}
.filter.active, .filter:hover {
  color: #fff;
  border-color: var(--accent);
  background: var(--accent);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}
.card {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 10 / 7;
}
.card.hide { display: none; }
.card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s;
}
.overlay {
  position: absolute;
  inset: 0;
  background: rgba(79, 179, 220, 0.88);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s;
}
.overlay h4 { font-size: 14px; font-weight: 600; }
.overlay p { font-size: 11px; }
.card:hover img { transform: scale(1.1); }
.card:hover .overlay { opacity: 1; }

/* Blog */
.blog-list { display: grid; gap: 16px; }
.post {
  display: flex;
  gap: 16px;
  background: #2b2b2b;
  border-radius: 12px;
  overflow: hidden;
}
.post img {
  width: 160px;
  object-fit: cover;
  flex-shrink: 0;
}
.post > div { padding: 14px 14px 14px 0; }
.post h4 { font-size: 15px; font-weight: 500; margin-bottom: 4px; }
.post p { font-size: 13px; color: var(--muted); }

/* Contact */
.contact-info {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  font-size: 13px;
  margin-bottom: 20px;
}
.contact-info i { color: var(--accent); margin-right: 6px; }

.contact-form { display: grid; gap: 12px; }
.contact-form .row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.contact-form input,
.contact-form textarea {
  width: 100%;
  background: #2e2e2e;
  border: 1px solid #3a3a3a;
  border-radius: 8px;
  padding: 10px 14px;
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s;
}
.contact-form input:focus,
.contact-form textarea:focus { border-color: var(--accent); }
.contact-form .btn { justify-self: start; }
.form-msg { font-size: 12px; color: var(--accent); min-height: 16px; }

.link { transition: color 0.2s; }
.link:hover { color: var(--accent); }

/* ---------- Phone modal ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(3px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
}
.modal.open {
  opacity: 1;
  visibility: visible;
}
.modal-box {
  position: relative;
  width: min(320px, 100%);
  background: var(--panel-right);
  border-radius: 18px;
  padding: 28px 24px 24px;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  transform: scale(0.9);
  transition: transform 0.25s;
}
.modal.open .modal-box { transform: scale(1); }
.modal-box h3 { font-size: 18px; font-weight: 600; }
.modal-box p { color: var(--muted); font-size: 14px; margin: 4px 0 20px; }
.modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
}
.modal-close:hover { color: #fff; }
.modal-actions { display: grid; gap: 10px; }
.modal-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px;
  border-radius: 30px;
  font-size: 14px;
  font-weight: 500;
  transition: filter 0.2s;
}
.modal-btn:hover { filter: brightness(1.1); }
.modal-btn.wa { background: #25d366; }
.modal-btn.call { background: var(--accent); }

/* ---------- Project modal ---------- */
.project-box {
  width: min(760px, 100%);
  max-height: 90vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 0;
  overflow: hidden;
  text-align: left;
}
.project-img {
  background: #1b1b1b;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.gallery-main {
  position: relative;
  flex: 1;
  min-height: 280px;
}
.gallery-main img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s;
}
.gallery-nav:hover { background: var(--accent); }
.gallery-nav.prev { left: 10px; }
.gallery-nav.next { right: 10px; }
.gallery-count {
  position: absolute;
  left: 10px;
  bottom: 10px;
  padding: 3px 10px;
  border-radius: 20px;
  background: rgba(0, 0, 0, 0.55);
  font-size: 11px;
  letter-spacing: 0.5px;
}
.gallery-thumbs {
  display: flex;
  gap: 6px;
  padding: 8px;
  overflow-x: auto;
}
.gallery-thumbs button {
  flex: 0 0 56px;
  height: 40px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 6px;
  overflow: hidden;
  background: none;
  opacity: 0.55;
  cursor: pointer;
  transition: opacity 0.2s, border-color 0.2s;
}
.gallery-thumbs button:hover { opacity: 0.85; }
.gallery-thumbs button.active { opacity: 1; border-color: var(--accent); }
.gallery-thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery.single .gallery-nav,
.gallery.single .gallery-count,
.gallery.single .gallery-thumbs { display: none; }
.project-info {
  padding: 32px 28px 28px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.project-cat {
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent);
}
.project-info h3 { font-size: 22px; font-weight: 600; margin: 4px 0 10px; }
.project-box .project-info p {
  color: #c4c4c4;
  font-size: 13.5px;
  line-height: 1.8;
  margin: 0 0 20px;
}
.project-info h4 {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 10px;
}
.project-info .btn {
  align-self: flex-start;
  margin-top: 24px;
}
.project-info .btn i { font-size: 11px; margin-left: 4px; }
.project-box .modal-close {
  z-index: 1;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 16px;
}

@media (max-width: 640px) {
  .project-box {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }
  .gallery-main { flex: none; min-height: 0; height: 220px; }
  .project-info { overflow: visible; padding: 22px; }
}

/* ---------- Side nav ---------- */
.side-nav {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 3vh 0;
  z-index: 3;
}

.menu {
  list-style: none;
  background: var(--nav);
  border-radius: 30px;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}
.menu a,
.arrows button {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  font-size: 17px;
  color: #e8e8e8;
  border-radius: 50%;
  transition: color 0.2s, background 0.2s;
}
.menu a:hover,
.menu a.active { color: var(--accent); }

.arrows {
  background: var(--nav);
  border-radius: 30px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}
.arrows button {
  background: none;
  border: none;
  cursor: pointer;
}
.arrows button:hover { color: var(--accent); }

/* ---------- Portrait mode (non-home pages) ---------- */
.profile,
.content {
  transition: width 0.5s ease, height 0.5s ease;
}

@media (min-width: 901px) {
  .wrapper.portrait .profile,
  .wrapper.portrait .content {
    height: min(680px, 88vh);
  }
  .wrapper.portrait .content {
    width: 440px;
  }
  .wrapper.portrait .post {
    flex-direction: column;
  }
  .wrapper.portrait .post img {
    width: 100%;
    height: 140px;
  }
  .wrapper.portrait .post > div {
    padding: 0 14px 14px;
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  body { overflow: auto; }

  .wrapper {
    height: auto;
    min-height: 100vh;
    flex-direction: column;
    padding: 24px 16px 90px;
  }

  .profile {
    width: 100%;
    max-width: 620px;
    height: auto;
    margin: 0 0 -16px;
    border-radius: var(--radius) var(--radius) 0 0;
    padding-bottom: 16px;
  }

  .content {
    height: auto;
    min-height: 60vh;
    border-radius: 0 0 var(--radius) var(--radius);
    scroll-margin-top: 16px;
  }

  /* Pages flow with the document instead of scrolling inside a fixed box */
  .page,
  .page.active,
  .page.leave-left {
    position: relative;
    inset: auto;
    display: none;
    overflow: visible;
    transform: none;
    padding: 30px 22px;
  }
  .page.active {
    display: block;
    animation: fadeUp 0.4s ease;
  }
  @keyframes fadeUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: none; }
  }

  .home {
    height: auto;
    min-height: 60vh;
    padding: 20px 0;
  }

  .avatar {
    width: 120px;
    height: 120px;
    margin-bottom: 18px;
  }
  .socials { margin: 12px 0 24px; }

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

  .side-nav {
    position: fixed;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 0;
  }
  .menu, .arrows {
    flex-direction: row;
    padding: 8px 12px;
  }
  .menu { gap: 4px; }
}

@media (max-width: 480px) {
  .arrows { display: none; }
  .info-grid,
  .contact-form .row { grid-template-columns: 1fr; }
  .post { flex-direction: column; }
  .post img { width: 100%; height: 140px; }
  .post > div { padding: 0 14px 14px; }
}
