:root {
  --bg-main: #00000026;
  --bg-card: #00000026;
  --bg-dark: #00000099;
  --border-color: rgba(255, 255, 255, 0.2);
  --text-primary: #ffffff;
  --text-secondary: #ffffff;
  --text-muted: #878787;
  --accent: #ff7020;
  --accent-hover: #ff8c42;
  --font-heading: 'Old Standard TT', serif;
  --font-body: 'Inter', -apple-system, sans-serif;
}

/*RESET*/
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: 1.6;
  min-height: 100vh;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.bg-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100dvw;
  height: 100dvh;
  z-index: -1;
  pointer-events: none;
}

.bg-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background-color: #00000035;
  transform: scale(1.1);
  transform-origin: center;
}

a,
a:link,
a:visited {
  color: inherit;
  text-decoration: none;
}

/*navbar(mobile-first)*/
.navbar {
  position: fixed;
  width: 100%;
  backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  z-index: 100;
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 5px 10px #00000050;
  background-color: var(--bg-card)
}

.navbar-title {
  align-content: center;
  text-align: center;
  padding-top: 0.75rem;
}

.brand-title {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.nav-links {
  align-content: center;
  text-align: center;
  margin: auto;
}

.nav-links a {
  color: var(--text-secondary);
  border-bottom: var(--accent);
  text-decoration: none;
  font-family: var(--font-heading);
  font-size: clamp(1rem, 2vw, 2rem);
  font-weight: 700;
  letter-spacing: 0.1em;
  margin: clamp(1rem, 2vw, 2rem);
  transition: color 0.4s ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--accent);
}

.social-links {
  display: flex;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  position: relative;
  margin: 2.5rem;
  padding: 1rem;
}

.social-links a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.social-links a:hover {
  color: var(--text-primary);
}

.copyright {
  color: var(--text-muted);
  margin: 0 auto 1rem auto;
}

/*MAIN CONTENT AREA (mobile-first)*/
.main-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin: auto;
  padding: 2vw;
}

.page-spacer {
  margin: 5rem;
}

.blog-post {
  backdrop-filter: blur(8px);
  box-shadow: 0 5px 10px #00000050;
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 0 2.5rem;
  margin: 0rem auto 4rem auto;
  background-color: var(--bg-card)
}

.blog-post-topbar {
  margin-bottom: 1.5rem;
}

.blog-post-header {
  margin: 0.1rem;
}

.blog-post-header .page-title {
  font-size: clamp(2.5rem, 3vw, 4rem);
  letter-spacing: 0.02em;
}

.blog-post-meta {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin: -1rem 0 2rem 0;
}

.blog-post-content {
  color: var(--text-secondary);
}

.blog-post-content p,
.blog-post-content ul,
.blog-post-content ol,
.blog-post-content blockquote {
  margin-bottom: 1.5rem;
  line-height: 1.85;
}

.blog-post-content h2,
.blog-post-content h3,
.blog-post-content h4 {
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.blog-post-content ul,
.blog-post-content ol {
  padding-left: 1.5rem;
}

.blog-post-content li {
  margin-bottom: 0.75rem;
}

.blog-post-content a {
  color: var(--accent);
}

blockquote {
  padding: 0.5rem 1.5rem;
  margin: auto;
  border-left: 7px solid var(--border-color);
  background-color: #00000026;
  font-style: italic;
}

/* Container for the preformatted text block */
pre {
  width: 90%;
  background-color: #000;
  border-radius: 8px;
  padding: 16px;
  margin:auto;
  overflow-x: auto;
  border: 1px solid #333333;
}

/* Individual text properties inside the container */
pre code {
  font-family: 'Fira Code', 'Courier New', Courier, monospace;
  font-size: 14px;
  line-height: 1.5;
  color: #d4d4d4;
  word-break: normal;
  white-space: pre; /* Essential to maintain indentation */
}

:not(pre) > code {
  background-color: #000;
  border-radius: 4px;
  padding: 0.1em 0.5em;
}

.blog-post-content img {
  max-width: 70vw; 
  display: block; 
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  overflow: auto;
}

table {
  table-layout: auto;
  width: 80%;
  margin: auto;
  background-color: #00000026;
  border: 1px solid var(--border-color);
  border-radius: 12px;
}
thead {
  background-color: #ffffff26;
}

th,
td {
  padding: 0.6em;
  border-radius: 8px;
}

.post-item {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1.5rem;
  padding: 1.5rem;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  backdrop-filter: blur(8px);
  box-shadow: 0 5px 10px #00000050;
  background-color: var(--bg-card)
}

a.post-item {
  text-decoration: none;
}

.post-thumbnail-wrapper {
  overflow: hidden;
  border-radius: 18px;
}

.post-thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}
/*BUTTONS*/
.btn {
  display: inline-block;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  text-align: center;
  padding: 0.5rem 1rem;
  border-radius: 18px;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: 0 5px 10px #00000050;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background-color: var(--accent);
  color: #ffffff;
  border-radius: 18px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-primary:hover {
  background-color: var(--accent-hover);
  transform: translateY(-1px);
}

.btn-secondary {
  backdrop-filter: blur(2px);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  transition: all 0.2s ease;
  padding: auto;
}

.btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(4px);
  border-color: var(--accent);
  color: var(--accent);
}
/*HOME PAGE*/
.intro-text {
  font-size: 1.2rem;
  color: var(--text-secondary);
  max-width: 750px;
  line-height: 2.5;
  margin: 2rem auto 5rem auto;
  text-align: center;
}

.intro-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin: auto;
}

.badge {
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.4rem 0.9rem;
  border-radius: 12px;
  font-size: 0.85rem;
  font-family: var(--font-body);
  font-weight: 600;
  backdrop-filter: blur(8px);
  box-shadow: 0 5px 10px #00000050;
  background-color: var(--bg-card)
}

.cta-group {
  justify-content: center;
  align-content: center;
  gap: 1rem;
}

.section-title {
  font-family: var(--font-body);
  font-size: clamp(1.6rem, 5vh , 2.5rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  margin: 3rem 0 1.5rem;
  padding-bottom: 0;
  text-align: center;
}

.portfolio-grid {
  display: grid;
  gap: 2rem;
  margin-bottom: 1rem;
}

.card {
  position: relative;
  border: 1px solid var(--border-color);
  border-radius: 18px;
  background-color: var(--bg-card);
  box-shadow: 0 5px 10px #00000050;
  backdrop-filter: blur(8px);
  overflow: hidden;
  will-change: transform;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.card::before {
  content: '';
  display: block;
  width: 100%;
  padding-top: 56.25%;
}

.card-link {
  position: absolute;
  inset: 0;
  display: block;
  color: inherit;
  text-decoration: none;
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
}

.card-thumb {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  transition: filter 0.25s ease, transform 0.25s ease;
  background-color: var(--bg-card);
}

.card:hover .card-thumb {
  filter: blur(8px);
  transform: scale(1.02);
}

.card-body {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 14% 1.5rem;
  background: rgba(0, 0, 0, 0.35);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.card:hover .card-body {
  opacity: 1;
  transform: translateY(0);
}

.card-title {
  font-family: var(--font-heading);
  font-size: 300%;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 0.2rem;
  margin-left: -0.1rem;
}

.card-title a {
  color: var(--text-primary);
  text-decoration: none;
}

.card-excerpt {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.2;
}

.post-articles {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin: 2rem 0.5rem 2rem 0.5rem;
}

.post-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.15rem;
}

.post-title {
  flex: 1 1 0;
  min-width: 0;
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 700;
}

.post-title a {
  color: var(--text-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.post-title a:hover {
  color: var(--accent);
}

.post-excerpt {
  color: var(--text-secondary);
  font-size: 0.90em;
  max-width: 750px;
  margin-top: 0;
  padding-top: 0;
}

.card-footer-action {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

/*ABOUT PAGE*/
.page-title {
  font-family: var(--font-heading);
  font-size: 4rem;
  font-weight: 700;
  margin: 2rem;
  text-align: center;
}

.about-grid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  backdrop-filter: blur(2px);
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 2rem;
  margin-bottom: 4rem;
  box-shadow: 0 5px 10px #00000050;
}

.about-grid a {
  text-decoration: underline;
  font-weight: 700;
}

.profile-photo {
  width: clamp(200px, 75%, 320px);
  height: auto;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background-color: var(--bg-card);
}

.bio-text p {
  text-align: justify;
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  line-height: 1.7;
  hyphens: auto;
  -webkit-hyphens: auto;
  -moz-hyphens: auto;
  text-justify: inter-word;
}

.bio-text strong {
  color: var(--text-primary);
}

.skills-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  padding: auto;
}

.skill-card {
  backdrop-filter: blur(8px);
  background-color: var(--bg-card);
  justify-content: center;
  text-align: center;
  border: 1px solid var(--border-color);
  padding: 0.5rem 1rem;
  border-radius: 24px;
  box-shadow: 0 5px 10px #00000050;
  width: clamp(300px, 35vw, 600px);
  margin: 0.25rem auto;
  }

.skill-card h3 {
  font-family: var(--font-heading);
  font-size: clamp(1.1rem, 3vh , 1.5rem);
  color: var(--accent);
  margin: 0.75rem auto;
}

.skill-card ul {
  list-style: none;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.8;
}
/* PROJECTS PAGE */
.page-desc {
  font-size: 1.1rem;
  text-align: center;
  color: var(--text-secondary);
  margin: 1rem auto;
  max-width: 650px;
}
 
.project-block {
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 0.5rem 0.5rem 5px 0.5rem;
  margin-bottom: 1.5rem;
  backdrop-filter: blur(8px);
  background-color: var(--bg-card);
  box-shadow: 0 5px 10px #00000050;
}

.project-block.wide {
  max-width: 1600px;
  margin: 0 auto;
  padding-left: 2.5rem;
  padding-right: 2.5rem;
}

.project-block img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  object-fit: contain;
  object-position: center;
}

.project-header {
  margin-bottom: 1rem;
  margin-right: 1rem;
  margin-left: 1rem;
}

.project-tag {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin: 0.1rem 0 1rem 0;
  display: block;
}
 
.project-title {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 700;
}
 
.project-desc {
  color: var(--text-secondary);
  font-size: 0.75rem;
  letter-spacing: 0.02em;
}

.carousel-wrapper {
  position: relative;
  width: 100%;
  height: auto;
  margin: 0 0 0.25rem 0;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.carousel-wrapper::before {
  content: '';
  display: block;
  width: 100%;
  padding-top: 56.25%;
}

.carousel-track {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  transition: none;
  scrollbar-width: none;
}
 
.carousel-track::-webkit-scrollbar {
  display: none;
}
 
.carousel-slide {
  flex: 0 0 100%;
  scroll-snap-align: start;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(0, 0, 0, 0.1);
  height: 100%;
}
 
.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  background-color: var(--bg-card);
  display: block;
}
 
.slide-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 44px;
  display: flex;
  align-items: center;
  padding: 0 100px 0 1.25rem;
  background: rgba(12, 13, 16, 0.55);
  backdrop-filter: blur(4px);
  color: var(--text-primary);
  font-size: 0.85rem;
  font-family: var(--font-body);
  border-top: 1px solid var(--border-color);
}

.caption-text-wrap {
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  white-space: nowrap;
  position: relative;
}

.caption-text {
  display: inline-block;
}

.caption-text-wrap.marquee .caption-text {
  animation: marquee-scroll 9s linear infinite;
  padding-right: 3rem;
}

.caption-text-wrap.marquee::before,
.caption-text-wrap.marquee::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 16px;
  z-index: 1;
  pointer-events: none;
}

@keyframes marquee-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.carousel-nav {
  position: absolute;
  bottom: 0;
  right: 0.75rem;
  height: 44px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  z-index: 5;
}
 
.carousel-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  width: 30px;
  height: 30px;
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  line-height: 0;
  font-size: 0;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.carousel-btn svg {
  width: 14px;
  height: 14px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
 
.carousel-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

img {
  max-width: 100%;
  -webkit-user-drag: none;
  user-select: none;
  cursor: pointer;
}

.image-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(8px);
  cursor: zoom-out;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.5s ease;
}

.close-btn {
  position: absolute;
  top: 20px;
  right: 25px;
  z-index: 10000;
  padding: 5px 10px;
  background: transparent;
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 35px;
  font-weight: bold;
  line-height: 1;
  cursor: pointer;
  user-select: none;
  transition: color 0.2s ease, transform 0.2s ease;
}

.close-btn:hover,
.close-btn:focus {
  color: #bbb;
  transform: scale(1.1);
  outline: none;
}

.image-modal img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  cursor: default;
  transform: scale(0.85);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.image-modal.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.image-modal.open img {
  transform: scale(1); 
}

.site-footer {
  padding-top: 1rem;
  text-align: center;
}

.site-footer .social-links {
  border-top: 1px solid var(--border-color);
  margin: 1rem auto 0 auto;
  padding: 2rem;
  justify-content: center;
}

/* ======================================= DESKTOP ======== */
@media (min-width: 580px) {
  .main-content {
    padding: 2.5rem 5rem;
    max-width: clamp(678px, 85vw, 1080px);
  }

  .navbar {
    height: 4rem;
    flex-direction: row;
    justify-content: space-evenly;
  }

  .navbar-title {
    padding: 0 2rem;
  }

  .nav-links, .nav-links a {
    margin-right: 1rem;
    font-size: 1.25rem;
  }

  .profile-photo {
    width: 320px;
    max-width: 100%;
  }

  .bio-text {
    align-self: center;
  }

  .post-articles {
    gap: 0.5rem;
    margin: 2rem auto 2rem auto;
  }

  .blog-post {
    text-align: justify;
  }
}

@media (min-width: 860px){
  .post-item {
    flex-direction: row;
    align-items: center;
    max-height: clamp(500px, 50vh, 100%);
    margin: 0.5rem 0 0.5rem 0;
    justify-content: space-between;
  }

  .post-title {
    margin-top: auto;
  }

  .post-thumbnail-wrapper {
    width: 220px;
    height: 180px;
    flex-shrink: 0;
  }

  .blog-post-meta {
    margin: 0.5rem 0 2rem 0;
  }

}