:root {
  --radius-xl: 20px;
  --radius-lg: 16px;
  --radius-sm: 8px;

  --fs-1: 24px;
  --fs-2: 20px;
  --fs-3: 16px;
  --fs-4: 15px;
  --fs-5: 14px;
  --fs-6: 14px;

  --bg: #000;
  --bg-accent: #1e1e1e;
  --text: #e6e9ef;
  --text-dim: #b9c0d0;

  --card: rgba(255,255,255,0.06);
  --header-bg: rgba(0,0,0,0.3);
  --border: rgba(255,255,255,0.14);
  --hover: rgba(255,255,255,0.08);

  --shadow: 0 10px 30px rgba(0,0,0,0.35);
  --card-shadow: 0 0px 10px rgba(255,255,255,0.35);
  --shadow-small: 0px 0px 3px rgba(255,255,255,0.7), 0px 0px 1px rgba(255,255,255,0.7);

  --transition-1: .25s ease;
  --transition-2: .5s ease;
}

:root.light {
  --bg: #fff;
  --bg-accent: #fff;
  --text: #0f1724;
  --text-dim: #48546b;

  --card: rgba(0,0,0,0.04);
  --header-bg: rgba(255,255,255,0.3);
  --border: rgba(0,0,0,0.12);
  --hover: rgba(0,0,0,0.06);

  --shadow: 0 3px 5px rgba(11,18,36,0.5);
  --card-shadow: 0 0px 10px rgba(0,0,0,0.35);
  --shadow-small: 0px 0px 3px rgba(0,0,0,0.7), 0px 0px 1px rgba(0,0,0,0.7);
}

:root.light {
  --bg: #FFF;
  --bg-accent: #ffffff;
  --text: #0f1724;
  --text-dim: #48546b;
  --card: rgba(0,0,0,0.04);
  --header-bg: rgba(255,255,255,0.3);
  --border: rgba(0,0,0,0.12);
  --hover: rgba(0,0,0,0.06);
  --shadow: 0 3px 5px rgba(11,18,36,0.50);
  --card-shadow: 0 0px 10px rgba(0,0,0,0.35);
  --shadow-small: 0px 0px 3px rgba(0, 0, 0, 0.7), 0px 0px 1px rgba(0, 0, 0, 0.7);
}

.hidden { display: none !important; }

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

html, body { min-width: 350px; }

body {
  font-family: Roboto, 'Poppins', system-ui, -apple-system, Segoe UI, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  background-attachment: fixed;
  transition: background 0.3s ease, color 0.3s ease;
}

a { color: inherit; text-decoration: none; }
img { display: block; width: 100%; height: 100%; object-fit: cover; }
ul { list-style: none; }
button { border: 0; background: transparent; color: inherit; font: inherit; cursor: pointer; }

.header {
    padding: 10px 15px;
    width: 100%;
    position: fixed;
    top: 0; left: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--header-bg);
    backdrop-filter: blur(14px) saturate(120%);
    -webkit-backdrop-filter: blur(14px) saturate(120%);
    box-shadow: var(--shadow-small);
}

.header .logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.header a {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 100%;
  text-decoration: none;
}

.header h1 {
  font-size: 22px;
  font-weight: bold;
}

header.header svg {
    width: 30px;
    height: 30px;
    filter: drop-shadow(0 0 8px);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header-left a:hover {
    text-shadow: 0 0 8px #ff9900;
}

.header .logo:hover svg {
  filter: drop-shadow(0 0 8px #ff9900) drop-shadow(0 0 12px #ff9900);
}

.nav-links a {
  text-decoration: none;
  border: 1px solid;
  border-radius: 5px;
  font-weight: 500;
  padding: 1px 10px;;
  transition: color 0.2s, box-shadow 0.2s;
}

.nav-links a:hover {
  box-shadow: 0 0 8px #ff9900;
}

.app { width: 520px; max-width: 90%; min-height: calc(100dvh - 168px); position: relative; margin: 60px auto 0; display: block; gap: 24px; }

.sidebar { position: sticky; top: 60px; overflow: hidden; z-index: 100;  margin-bottom:20px;}
.sidebar a { font-weight: bold; text-decoration: underline; }

.sidebar-extra {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 95%;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.6s ease;
}

.sidebar-extra.open {
  max-height: 1000px;
  transition: max-height 1s ease;
}

.sidebar-quote {
  padding: 12px;
  margin: 12px 0;
  border-radius: var(--radius-lg);
  font-size: var(--fs-5);
  color: var(--text);
  text-align: center;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.sidebar-quote .quote-icon {
  display: inline-block;
  margin-right: 6px;
  font-size: 1.2em;
  transition: transform 0.5s ease;
}

#devQuote {
  transition: opacity 0.5s ease;
}

.side-info {
  margin-top: 0;
}

.info_more-btn {
    position: absolute;
    top: 0px;
    right: 0px;
    border-radius: 0 15px;
    font-size: 13px;
    color: var(--text);
    padding: 7px;
    box-shadow: var(--shadow-small);
    transition: transform 0.3s ease;
    z-index: 1;
}

.info_more-btn::before {
    content: "";
    position: absolute;
    inset: 1px;
    border-radius: inherit;
    transition: var(--transition-1);
    z-index: -1;
}

.info_more-btn ion-icon {
  display: block;
  transition: transform 0.3s ease;
}

.info_more-btn.open ion-icon {
  transform: rotate(180deg);
  transition: transform 0.3s ease;
}

.glass {
  background: var(--header-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(14px) saturate(120%);
  box-shadow: var(--shadow);
}

.panel { padding: 15px }

.tools-header { display: flex; padding: 0 10px; align-items: center; justify-content: space-between; gap: 10px; }
.title { font-size: var(--fs-1); font-weight: 600; letter-spacing: -0.3px; }

.side-info { display: grid; gap: 12px; margin-top: 12px; }
.side-info-card { padding: 14px; border-radius: var(--radius-lg); border: 1px dashed var(--border); background: linear-gradient(180deg, transparent, var(--hover)); }
.muted { color: var(--text-dim); font-size: var(--fs-5); }

.divider { height: 1px; background: var(--border); margin: 14px 0; }

/* Theme toggle wrapper */
.theme-toggle {
  position: relative;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* Base styles for both icons */
.theme-toggle ion-icon {
  font-size: 27px;
  position: absolute;
  transition: opacity 0.25s ease, transform 0.25s ease, color 0.25s ease;
  color: var(--text);
  pointer-events: none;
}

/* Default (dark theme): show sun */
.icon-sun {
  opacity: 0;
  z-index: 1;
}

.icon-moon {
  opacity: 1;
  z-index: 2;
}

/* Light theme: show moon */
.light .icon-sun {
  opacity: 1;
  z-index: 2;
}

.light .icon-moon {
  opacity: 0;
  z-index: 1;
}

.btn { padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--hover); }

.search { display: flex; gap: 8px; margin-right: 20px; align-items: center; border: 1px solid var(--border); border-radius: 12px; padding: 8px 10px; background: var(--hover); }
.search input { width: 100%; border: 0; background: transparent; color: var(--text); outline: none; font-size: var(--fs-3); }

.search:hover { box-shadow: 0 6px 14px rgba(58,110,165,0.4); border-color: #3a6ea5; }
.search:focus-within { box-shadow: 0 6px 14px rgba(58,110,165,0.4); border-color: #3a6ea5; }

.content { padding: 0px; }

.section-title {
    padding: 3px 0;
    display: inline-block;
    font-size: var(--fs-3);
    font-weight: 600;
    align-content: center;
    color: #3a6ea5;
    text-shadow: 0 4px 10px rgba(0,0,0,0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.section-title:hover {
    text-shadow: 0 6px 14px rgba(0,0,0,0.3);
}

.grid { display: grid; grid-template-columns: 1fr; gap: 18px; }

.portfolio-posts-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 15px;
}

.empty-portfolio {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 300px; /* adjust as needed */
}

.portfolio-post-item {
    display: block;
    border: 0px solid;
    text-decoration: none;
    box-shadow: var(--shadow-small);
    overflow: hidden;
    color: inherit;
    cursor: pointer;
    border-radius: 10px;
    animation: fadeInUp 0.5s ease forwards;
}

@keyframes fadeInUp {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.portfolio-post-item > a {
  position: relative;
  background: var(--border-gradient-onyx);
  height: 100%;
  box-shadow: var(--shadow-4);
  border-radius: 12px;
  overflow: hidden;
  z-index: 1;
}

.portfolio-post-item > a::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  background: var(--eerie-black-1);
  z-index: -1;
}

.portfolio-post-item:hover {
  color: #2b5c85;
}

.portfolio-post-item > a:hover {
  color: currentColor;;
}

.portfolio-banner-box {
  width: 100%;
  aspect-ratio: 8 / 5;
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow-small);
  transition: transform var(--transition-2);
}

.portfolio-banner-box:hover {
  transform: scale(1.01);
}

.portfolio-banner-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(0.3);
  transform: scale(1.01);
  transition: transform var(--transition-2);
}

.portfolio-banner-box:hover img {
  transform: scale(1.03);
}

.portfolio-link-overlay {
  position: absolute;
  bottom: 0px;
  right: 0px;
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--header-bg);
  border: 1px solid var(--border);
  border-radius: 6px 0 0;
  padding: 2px 5px;
  opacity: 0.7;
  font-size: var(--fs-5);
  color: var(--text);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: var(--shadow-small);
}

.portfolio-banner-box::after {
  content: "";
  position: absolute;
  inset: 0;
  background: transparent;
  z-index: 2;
}

.portfolio-content { padding: 15px; }

.portfolio-meta {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 7px;
  margin-bottom: 10px;
}

.portfolio-meta :is(.portfolio-link) {
  color: var(--light-gray-70);
  font-size: var(--fs-6);
  font-weight: var(--fw-300);
}

.portfolio-meta .cleanDomain {
  font-size: var(--fs-4);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

.avatar {
  width: 24px;
  height: 24px;
  margin-right: 6px;
  vertical-align: middle;
  border-radius: 4px;
  filter: drop-shadow(0px 0px 1px var(--text));
}

.avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 25px;
  height: 25px;
  margin-right: 6px;
  text-shadow: 0 0 5px #ff9900;
  font-weight: 700;
  border: 1px solid;
  border-radius: 5px;
  font-size: var(--fs-2);
  font-family: 'Lobster', 'Poppins', sans-serif;
  color: var(--text);
}

.portfolio-item-title {
  margin-bottom: 10px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.portfolio-text {
  color: var(--light-gray);
  font-size: var(--fs-6);
  font-weight: var(--fw-300);
  line-height: 1.6;

  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  height: calc(1.6em * 3);
}

.portfolio-controls {
  display: flex;
  padding: 5px 15px;
  margin-bottom: 20px;
  border-radius: 10px;
  border: none;
  box-shadow: var(--shadow-small);
  justify-content: space-between;
}

.portfolio-actions {
  text-align: center;
}

.view-btn {
  display: inline-flex;
  align-items: center;
  gap: 15px;
  width: 90%;
  padding: 8px;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 1rem;
  background: transparent;
  color: var(--text);
  text-decoration: none;
  transition: all 0.2s ease;
}

.view-btn:hover {
  background: var(--hover-bg);
  color: var(--accent);
  border-color: var(--accent);
}

.portfolio-post-item.featured .portfolio-actions .view-btn  {
  background: #ff990080;
}

.portfolio-post-item.featured .favicon {
  filter: drop-shadow(0px 0px 1px #ff9900);
}

.portfolio-post-item.featured {
  border: 3px solid #ff9900;
  background: #ff990022;
  box-shadow: 0 0 12px rgba(255, 153, 0, 0.5);
  animation: featuredPulse 3s infinite;
  position: relative;
}

@keyframes featuredPulse {
  0% {
    box-shadow: 0 0 6px rgba(255, 153, 0, 0.5);
  }
  50% {
    box-shadow: 0 0 8px rgba(255, 153, 0, 0.9);
  }
  100% {
    box-shadow: 0 0 6px rgba(255, 153, 0, 0.5);
  }
}

.portfolio-post-item.featured::before {
  content: "★ Featured";
  position: absolute;
  top: 8px;
  right: 8px;
  background: #ff9900;
  color: #000;
  font-size: 12px;
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 4px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.featured-badge {
  position: absolute;
  top: 7px;
  right: 0;
  background: #ff9900;
  color: #000;
  font-size: 15px;
  font-weight: bold;
  padding: 5px 10px;
  border-radius: 5px 0 0 5px;
  box-shadow: 0 0 6px rgba(255, 153, 0, 0.5);
  animation: badgePulse 1.5s infinite alternate;
}

@keyframes badgePulse {
  from {
    box-shadow: 0 0 3px rgba(255, 153, 0, 0.2);
  }
  to {
    box-shadow: 0 0 6px rgba(255, 153, 0, 0.9);
  }
}

/* Ribbon container */
.ribbon {
  width: 150px;
  height: 150px;
  overflow: hidden;
  position: absolute;
  top: -10px;
  right: -10px;
  pointer-events: none;
  z-index: 2;
}

/* Actual diagonal strip */
.ribbon span {
  position: absolute;
  display: block;
  width: 200px;
  padding: 6px 0;
  background: #ff9900;
  color: white;
  text-align: center;
  font-weight: bold;
  font-size: 0.8rem;
  box-shadow: 0 3px 6px rgba(0,0,0,0.2);
  transform: rotate(45deg);
  top: 30px;
  right: -50px;
}

/* Optional subtle glow for “special” look */
.ribbon span::before,
.ribbon span::after {
  content: "";
  position: absolute;
  top: 100%;
  border-top: 3px solid #ff9900;
  border-left: 3px solid transparent;
  border-right: 3px solid transparent;
}

.ribbon span::before {
  left: 0;
}

.ribbon span::after {
  right: 0;
}

.portfolio-extra {
    margin: 10px 0;
    height: 81px;
    overflow: visible !important;
}

.tech-badge {
  display: inline-block;
  padding: 0px 7px;
  margin: 2px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: var(--fs-5);
  color: var(--text);
  white-space: nowrap;
}

.portfolio-post-item.featured .tech-badge {
  background: #ff990077;
  position: relative;
  border-radius: 6px;
}

.portfolio-post-item.featured .portfolio-item-title {
  text-shadow: 1px 1px 25px #ff9900;
}

.portfolio-post-item.featured .portfolio-item-title::before {
    content: "✨ ";
    text-shadow: 0 0 1px rgba(255, 153, 0, 0.5);
    font-size: 18px;
}

.portfolio-post-item.featured .portfolio-banner-box img {
    filter: grayscale(0) brightness(1.3);
}

.portfolio-post-item.featured:hover {
  color: #ff9900;
}

.floating-star {
    position: absolute;
    font-size: 1.2rem;
    color: #ff9900;
    opacity: 0;
    pointer-events: none;
}

.floating-star-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.more-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  background: transparent !important;
  border: none !important;
  padding: 0 5px;
  overflow: visible;
  z-index: 20;
}

.hidden-tech {
  position: absolute;
  bottom: 100%;
  right: 0;
  margin-bottom: 8px;
  background: var(--bg-accent);
  padding: 10px;
  border-radius: var(--radius-sm);
  white-space: normal;
  max-width: 240px;
  font-size: 0.85rem;
  color: var(--text-dim);
  box-shadow: var(--shadow-small);

  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.more-badge:hover .hidden-tech,
.more-badge:focus-within .hidden-tech {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.more-badge .hidden-tech::after {
  content: "";
  position: absolute;
  right: 100%;
}

.hidden-tech .tech-badge {
  all: unset;
  background: transparent !important;
  padding: 0;
  font-size: inherit;
  color: inherit;
  white-space: nowrap;
  box-shadow: none;
  cursor: default;
}

/* Container tweaks */
.sort-dropdown {
  position: relative;
  display: inline-block;
  padding: 3px 0;
}

/* Hide default arrow */
.sort-dropdown select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;

  width: 120px;
  padding: 8px 25px 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: var(--fs-5);
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px) saturate(120%);
}

/* Hover & focus */
.sort-dropdown select:hover,
.sort-dropdown select:focus {
  border-color: #3a6ea5;
  box-shadow: 0 6px 14px rgba(58,110,165,0.4);
  background: rgba(255,255,255,0.05);
  outline: none;
}

/* Custom arrow */
.sort-dropdown::after {
  content: "▾"; /* down arrow */
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  pointer-events: none;
  font-size: 14px;
  color: var(--text-dim);
  transition: transform 0.3s ease;
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.pagination button {
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--hover);
  color: var(--text);
  cursor: pointer;
  font-size: var(--fs-5);
  transition: background var(--transition-1);
}

.pagination button.active {
  font-weight: 600;
  background: #3a6ea5;
  color: #fff;
  box-shadow: 0 4px 10px rgba(58,110,165,0.3);
  transform: scale(1.01);
  transition: all 0.3s ease;
}

.pagination button:hover {
  background: var(--border);
}

.footer {
  margin-top: 40px;
  padding: 16px 24px;
  text-align: center;
  font-size: var(--fs-5);
  color: var(--text-dim);
  border-radius: 0;
}

.footer a {
  color: var(--text);
  font-weight: 500;
  transition: color 0.3s ease;
}

.footer a:hover {
  color: var(--text-dim);
}

.dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--text-dim); opacity: .6; }

@media (min-width: 520px) {
  .section-title { font-size: var(--fs-2); }
  .sort-dropdown select { width: 150px; }
}

@media (min-width: 768px) {
  .sidebar { top: 70px; }
  .app { width: 750px; max-width: 100%; margin: 70px auto 0;}
  .grid { grid-template-columns: repeat(2, 1fr); }
  .portfolio-posts-list { grid-template-columns: repeat(2, 1fr); }
  .sort-dropdown { padding: 6px 0; }
  .sort-dropdown select { width: 160px; }
  .theme-toggle:hover .icon-sun,
  .theme-toggle:hover .icon-moon {
    transform: scale(1.1);
    color: #ff9900;
  }
}

@media (min-width: 1100px) {
  .header { padding: 10px 30px; }
  .app { width: 1080px; }
  .portfolio-posts-list { grid-template-columns: repeat(3, 1fr); }
  .section-title { font-size: var(--fs-1); padding: 0; }
  .sort-dropdown { padding: 10px 0; }
}

@media (min-width: 1250px) {
  .app { grid-template-columns: 250px 1fr; align-items: start; width: 1550px; max-width: 95dvw; display: grid; }
  .search { margin-right: 0px; }
  .grid { grid-template-columns: repeat(3, 1fr); }
  .portfolio-posts-list { grid-template-columns: repeat(3, 1fr); }
  .sidebar { position: sticky; height: 75dvh; width: 250px;}
  .sidebar-extra { max-height: none; opacity: 1; overflow: visible; }
  .info_more-btn { display: none; }
}

@media (min-width: 1650px) {
  .app { max-width: 1550px; }
  .portfolio-posts-list { grid-template-columns: repeat(3, 1fr); }
}