:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #0f172a;
  --text-soft: #334155;
  --muted: #64748b;
  --border: #e2e8f0;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --accent-soft: #dbeafe;
  --danger: #dc2626;
  --success: #065f46;
  --shadow-sm: 0 6px 18px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 14px 30px rgba(15, 23, 42, 0.1);
  --radius-sm: 10px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --content-width: 1120px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-family, "Plus Jakarta Sans", "Inter", sans-serif);
  line-height: 1.65;
}

main {
  flex: 1;
}

a,
button,
input,
select,
textarea {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
}

img,
svg {
  display: block;
  max-width: 100%;
}

code,
pre {
  background: #e2e8f0;
  color: #0f172a;
  border-radius: 8px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

code {
  padding: 0.1rem 0.4rem;
}

pre {
  overflow-x: auto;
  padding: 1rem;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 100;
  transform: translateY(-140%);
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  font-weight: 600;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
}

.nav-shell,
.footer-inner,
.hero-section,
.section-shell,
.project-detail,
.login-section {
  width: min(var(--content-width), calc(100% - 2rem));
  margin-inline: auto;
}

.nav-shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 72px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-family, "Plus Jakarta Sans", "Inter", sans-serif);
  font-weight: 700;
  letter-spacing: 0;
  height: 40px;
}

.brand-logo {
  max-height: 40px;
  width: auto;
  object-fit: contain;
}

.brand-pixel {
  display: none;
}

.menu-toggle {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-soft);
  gap: 6px;
}

.hamburger-line {
  width: 20px;
  height: 2px;
  background-color: currentColor;
  transition:
    transform 0.25s ease,
    opacity 0.2s ease,
    margin 0.3s ease;
  transform-origin: 50% 50%;
  border-radius: 2px;
}

.menu-toggle:hover .hamburger-line {
  opacity: 0.75;
}

.menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(1) {
  transform: translateY(4px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(2) {
  transform: translateY(-4px) rotate(-45deg);
}

.site-menu {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* Cache Reminder Banner */
.cache-reminder-banner {
  display: none;
  position: relative;
  z-index: 40;
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border-bottom: 2px solid #f59e0b;
  padding: 1rem;
}

.cache-reminder-banner.is-visible {
  display: block;
  animation: slideDown 300ms ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.reminder-content {
  width: min(var(--content-width), calc(100% - 2rem));
  margin-inline: auto;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1rem;
  align-items: center;
}

.reminder-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #fbbf24;
  color: #78350f;
  flex-shrink: 0;
  font-size: 1.125rem;
}

.reminder-text {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.reminder-title {
  margin: 0;
  font-weight: 700;
  color: #78350f;
  font-size: 0.95rem;
}

.reminder-description {
  margin: 0;
  color: #92400e;
  font-size: 0.875rem;
  line-height: 1.4;
}

.reminder-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

.btn-dismiss-reminder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.5);
  color: #78350f;
  border: 1px solid rgba(120, 53, 15, 0.2);
  cursor: pointer;
  transition: all 200ms ease;
  font-size: 1rem;
}

.btn-dismiss-reminder:hover {
  background: rgba(255, 255, 255, 0.8);
  border-color: #78350f;
}

.btn-remind-later {
  padding: 0.5rem 1rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.7);
  color: #78350f;
  border: 1px solid rgba(120, 53, 15, 0.3);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 200ms ease;
  white-space: nowrap;
}

.btn-remind-later:hover {
  background: #ffffff;
  border-color: #78350f;
}

@media (max-width: 768px) {
  .reminder-content {
    grid-template-columns: auto 1fr;
    gap: 0.75rem;
  }

  .reminder-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }

  .reminder-description {
    font-size: 0.8rem;
  }
}

/* Coachmark / Feature Highlight for refresh button */
.refresh-btn-wrapper {
  position: relative;
  display: inline-flex;
}

.coachmark {
  position: absolute;
  top: calc(100% + 8px);
  right: -6px;
  z-index: 9999;
  display: none;
  align-items: center;
  gap: 0.5rem;
  pointer-events: auto;
}

.coachmark-bubble {
  background: #111827;
  color: #ffffff;
  padding: 0.6rem 0.9rem;
  border-radius: 14px;
  font-weight: 700;
  font-size: 0.92rem;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.18);
  max-width: 230px;
  line-height: 1.15;
  position: relative;
  white-space: normal;
  text-align: left;
  word-break: break-word;
}

.coachmark-bubble .coachmark-sub {
  display: block;
  font-weight: 600;
  opacity: 0.9;
  font-size: 0.78rem;
  margin-top: 0.2rem;
  color: #cbd5e1;
}

.coachmark-dismiss {
  background: transparent;
  border: 0;
  color: #111827;
  font-weight: 800;
  font-size: 1.1rem;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
  cursor: pointer;
}

/* small pointer using pseudo-element */
.coachmark-bubble::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  right: 18px;
  top: -6px;
  transform: rotate(45deg);
  background: #111827;
  border-radius: 2px;
}

@media (max-width: 760px) {
  .coachmark-bubble {
    max-width: 180px;
    font-size: 0.78rem;
  }
}

.site-menu a,
.admin-nav a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.8rem;
  border-radius: 10px;
  border: 1px solid transparent;
  color: var(--text-soft);
  font-weight: 600;
  transition: all 300ms ease;
}

.site-menu a:hover,
.site-menu a.is-active,
.admin-nav a:hover,
.admin-nav a.is-active {
  color: var(--accent-dark);
  background: var(--accent-soft);
  border-color: #bfdbfe;
}

.nav-console {
  border-color: var(--border) !important;
}

.hero-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 3rem;
  padding-block: 4.5rem;
}

.eyebrow {
  margin: 0 0 0.9rem;
  color: var(--accent-dark);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-family, "Plus Jakarta Sans", "Inter", sans-serif);
  line-height: 1.3;
  letter-spacing: 0;
}

h1 {
  font-size: 2.45rem;
}

h2 {
  font-size: 1.75rem;
}

h3 {
  font-size: 1.1rem;
}

p {
  margin: 0;
}

.hero-role {
  display: inline-flex;
  align-items: center;
  margin-top: 1.15rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  border: 1px solid #bfdbfe;
  padding: 0.45rem 0.9rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.hero-text {
  max-width: 700px;
  margin-top: 1.25rem;
  color: var(--text-soft);
  font-size: 1.05rem;
  margin-left: auto;
  margin-right: auto;
}

.hero-actions,
.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.6rem;
  justify-content: center;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.6rem;
  justify-content: flex-start;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.2rem;
  justify-content: center;
}

.hero-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  background: var(--surface);
  font-size: 0.85rem;
  box-shadow: var(--shadow-sm);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 44px;
  padding: 0.65rem 1rem;
  border-radius: 12px;
  border: 1px solid transparent;
  font-size: 0.94rem;
  font-weight: 600;
  transition: all 300ms ease;
}

.btn:hover {
  transform: translateY(-4px);
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: var(--accent-dark);
  box-shadow: var(--shadow-md);
}

.btn-outline {
  background: var(--surface);
  color: var(--text-soft);
  border-color: var(--border);
}

.btn-outline:hover {
  color: var(--accent-dark);
  border-color: #93c5fd;
  background: #eff6ff;
}

.btn.compact {
  min-height: 38px;
  padding: 0.45rem 0.8rem;
  font-size: 0.85rem;
}

.hero-media {
  display: grid;
  justify-items: center;
  gap: 1.2rem;
  padding: 1.25rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.profile-image,
.profile-avatar {
  width: min(100%, 300px);
  aspect-ratio: 1 / 1;
  border-radius: 18px;
  border: 1px solid var(--border);
}

.profile-image {
  object-fit: cover;
}

.profile-avatar {
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #2563eb 0%, #4f46e5 100%);
  color: #ffffff;
}

.profile-avatar span {
  font-size: 3rem;
  font-weight: 700;
}

.profile-summary {
  display: grid;
  gap: 0.25rem;
  width: 100%;
  text-align: center;
}

.profile-summary strong {
  color: var(--text);
  font-size: 0.98rem;
}

.profile-summary span {
  color: var(--muted);
  font-size: 0.88rem;
}

.section-shell {
  padding-block: 4rem;
  scroll-margin-top: 96px;
}

.section-shell+.section-shell {
  border-top: 1px solid var(--border);
}

.section-heading {
  margin-bottom: 1.8rem;
}

.section-subtext {
  max-width: 720px;
  margin-top: 0.7rem;
  color: var(--text-soft);
}

.section-heading-row,
.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.tech-heading-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.tech-layout-controls svg,
.project-link-controls svg {
  width: 1.15rem;
  height: 1.15rem;
}

.tech-grid,
.project-grid,
.about-grid,
.stats-grid {
  display: grid;
  gap: 1rem;
}

.tech-grid {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.tech-grid.is-folder-mode {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  align-items: center;
}

.tech-tile,
.project-card,
.about-grid article,
.system-panel,
.auth-card,
.admin-panel,
.stat-card,
.empty-state {
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.tech-tile {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-height: 72px;
  padding: 0.9rem 1rem;
  color: var(--text-soft);
  font-weight: 600;
}

.tech-grid.is-folder-mode .tech-tile {
  display: none;
}

.tech-folder-card {
  display: none;
  min-height: 150px;
  padding: 1rem;
  place-items: center;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  color: var(--accent-dark);
  overflow: visible;
}

.tech-folder-card:hover,
.tech-folder-card:focus-within,
.tech-folder-card:has(.folder.open) {
  z-index: 10 !important;
}

.tech-grid.is-folder-mode .tech-folder-card {
  display: grid;
}

.tech-folder-card .folder {
  --folder-color: var(--accent);
  --folder-back-color: var(--accent);
  --paper-1: #e6e6e6;
  --paper-2: #f2f2f2;
  --paper-3: #ffffff;
  display: block;
  width: 100px;
  height: 80px;
  transform-origin: center bottom;
  transition: all 0.2s ease-in;
  cursor: pointer;
}

@media (min-width: 769px) {
  .tech-folder-card .folder:hover {
    transform: translateY(-8px);
  }

  .tech-folder-card .folder:hover .paper {
    transform: translate(-50%, 0%);
  }

  .tech-folder-card .folder:hover .folder__front {
    transform: skew(15deg) scaleY(0.6);
  }

  .tech-folder-card .folder:hover .right {
    transform: skew(-15deg) scaleY(0.6);
  }
}

.tech-folder-card .folder.open {
  transform: translateY(-8px);
}

.tech-folder-card .folder.open .paper {
  z-index: 4;
}

.tech-folder-card .folder.open .paper:hover {
  z-index: 6;
}

.tech-folder-card .folder.open .paper:nth-child(1) {
  transform: translate(-120%, -70%) rotateZ(-15deg);
}

.tech-folder-card .folder.open .paper:nth-child(1):hover {
  transform: translate(-120%, -70%) rotateZ(-15deg) scale(1.1);
}

.tech-folder-card .folder.open .paper:nth-child(2) {
  transform: translate(10%, -70%) rotateZ(15deg);
  height: 80%;
}

.tech-folder-card .folder.open .paper:nth-child(2):hover {
  transform: translate(10%, -70%) rotateZ(15deg) scale(1.1);
}

.tech-folder-card .folder.open .paper:nth-child(3) {
  transform: translate(-50%, -100%) rotateZ(5deg);
  height: 80%;
}

.tech-folder-card .folder.open .paper:nth-child(3):hover {
  transform: translate(-50%, -100%) rotateZ(5deg) scale(1.1);
}

.tech-folder-card .folder.open .folder__front {
  transform: skew(15deg) scaleY(0.6);
}

.tech-folder-card .folder.open .right {
  transform: skew(-15deg) scaleY(0.6);
}

.tech-folder-card .folder__back {
  position: relative;
  display: block;
  width: 100px;
  height: 80px;
  background: var(--folder-back-color);
  border-radius: 0 10px 10px 10px;
  transform: translateZ(0);
}

.tech-folder-card .folder__back::after {
  position: absolute;
  z-index: 0;
  bottom: 98%;
  left: 0;
  content: "";
  width: 30px;
  height: 10px;
  background: var(--folder-back-color);
  border-radius: 5px 5px 0 0;
}

.tech-folder-card .paper {
  position: absolute;
  z-index: 2;
  bottom: 10%;
  left: 50%;
  display: grid;
  place-items: center;
  transform: translate(-50%, 10%);
  width: 70%;
  height: 80%;
  padding: 0.45rem;
  background: var(--paper-1);
  border-radius: 10px;
  overflow: hidden;
  transition: all 0.3s ease-in-out;
}

.tech-folder-card .paper:nth-child(2) {
  background: var(--paper-2);
  width: 80%;
  height: 70%;
}

.tech-folder-card .paper:nth-child(3) {
  background: var(--paper-3);
  width: 90%;
  height: 60%;
}

.tech-folder-card .folder__front {
  position: absolute;
  z-index: 3;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  background: var(--folder-color);
  border-radius: 5px 10px 10px 10px;
  transform-origin: bottom;
  transition: all 0.3s ease-in-out;
}

.tech-folder-card .folder__front.right {
  right: 0;
}

.folder-tech-icon {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: var(--accent-dark);
  opacity: 0;
  transform: scale(0.84);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.tech-folder-card .folder.open .folder-tech-icon {
  opacity: 1;
  transform: scale(1);
}

.folder-tech-icon i,
.folder-tech-icon .tech-icon-svg {
  width: 1.75rem !important;
  height: 1.75rem !important;
  font-size: 1.65rem;
}

.tech-tile i,
.stat-card i,
.empty-state i {
  color: var(--accent-dark);
  font-size: 1.2rem;
}

/* Loop Layout styles */
.tech-grid.is-loop-mode {
  display: block;
  width: 100%;
  overflow: visible;
}

.tech-grid.is-loop-mode>.tech-tile {
  display: none;
}

.tech-grid.is-loop-mode>.tech-folder-card {
  display: none;
}

.tech-loop-container {
  width: 100%;
  display: none;
}

.tech-grid.is-loop-mode .tech-loop-container {
  display: block;
}

.logoloop {
  position: relative;
  overflow: hidden;
  width: 100%;
  --logoloop-gap: 32px;
  --logoloop-logoHeight: 48px;
  --logoloop-fadeColorAuto: var(--bg);
  padding: 1rem 0;
}

.logoloop__track {
  display: flex;
  width: max-content;
  will-change: transform;
  user-select: none;
  position: relative;
  z-index: 0;
}

.logoloop__list {
  display: flex;
  align-items: center;
  list-style: none;
  padding: 0;
  margin: 0;
}

.logoloop__item {
  flex: 0 0 auto;
  margin-right: var(--logoloop-gap);
  display: flex;
  align-items: center;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.logoloop__item:hover {
  transform: scale(1.05);
}

.logoloop__item .tech-tile {
  min-height: 64px;
  padding: 0.75rem 1.25rem;
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
}

.logoloop--fade::before,
.logoloop--fade::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: clamp(24px, 12%, 120px);
  pointer-events: none;
  z-index: 10;
}

.logoloop--fade::before {
  left: 0;
  background: linear-gradient(to right,
      var(--logoloop-fadeColor, var(--logoloop-fadeColorAuto)) 0%,
      rgba(0, 0, 0, 0) 100%);
}

.logoloop--fade::after {
  right: 0;
  background: linear-gradient(to left,
      var(--logoloop-fadeColor, var(--logoloop-fadeColorAuto)) 0%,
      rgba(0, 0, 0, 0) 100%);
}

@media (prefers-reduced-motion: reduce) {
  .logoloop__track {
    transform: translate3d(0, 0, 0) !important;
  }

  .logoloop__item {
    transition: none !important;
  }
}

.project-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.project-card {
  display: flex;
  flex-direction: column;
  min-height: 320px;
  padding: 1rem;
  transition: all 300ms ease;
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.project-thumb {
  display: grid;
  place-items: center;
  height: 148px;
  border-radius: var(--radius-sm);
  border: 1px solid #dbeafe;
  background: linear-gradient(150deg, #eff6ff 0%, #e0e7ff 100%);
  color: #4f46e5;
  font-size: 1.5rem;
  margin-bottom: 0.9rem;
}

.project-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
}

.project-year {
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #f1f5f9;
  color: var(--text-soft);
  padding: 0.2rem 0.65rem;
  font-size: 0.82rem;
  font-weight: 600;
}

.project-card h3 {
  margin-top: 0.95rem;
}

.project-card p {
  margin-top: 0.7rem;
  color: var(--text-soft);
}

.stack-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 1rem;
}

.stack-list span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.58rem;
  border-radius: 999px;
  background: #f8fafc;
  border: 1px solid var(--border);
  color: var(--text-soft);
  font-size: 0.8rem;
  font-weight: 600;
}

.card-actions {
  margin-top: auto;
  padding-top: 1.25rem;
}

.icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  color: var(--text-soft);
  background: var(--surface);
  transition: all 300ms ease;
}

.icon-link:hover {
  transform: translateY(-3px);
  color: var(--accent-dark);
  border-color: #93c5fd;
  background: #eff6ff;
}

.project-links-panel {
  margin-top: 1.2rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  padding: 1rem;
}

.project-links-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.9rem;
}

.project-link-controls {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  padding: 0.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
}

.project-link-controls button {
  display: inline-grid;
  place-items: center;
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 8px;
  color: var(--muted);
  transition:
    background-color 220ms ease,
    color 220ms ease,
    box-shadow 220ms ease;
}

.project-link-controls button:hover,
.project-link-controls button.is-active {
  color: var(--accent-dark);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.project-link-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(200px, 1fr));
  gap: 1rem;
}

.project-link-list.is-compact {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 0.8rem;
  min-height: 120px;
  padding-bottom: 0.5rem;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}

.project-link-list.is-compact::-webkit-scrollbar {
  display: none;
}

.project-link-list li {
  position: relative;
}

.project-link-list a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  color: var(--text);
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  transition: all 300ms ease;
  min-height: 100px;
  position: relative;
}

.project-link-list.is-compact a {
  justify-content: center;
  width: var(--dock-size, 64px);
  height: var(--dock-size, 64px);
  min-height: unset;
  padding: 0;
  flex-shrink: 0;
  transition:
    width 0.15s cubic-bezier(0.25, 1, 0.5, 1),
    height 0.15s cubic-bezier(0.25, 1, 0.5, 1),
    transform 0.2s ease,
    background 300ms ease,
    border-color 300ms ease;
  will-change: width, height;
}

.project-link-icon {
  width: 40px;
  height: 40px;
  object-fit: contain;
  flex-shrink: 0;
  color: var(--accent-dark);
  font-size: 1.35rem;
}

.project-link-list.is-compact .project-link-icon {
  width: calc(var(--dock-size, 64px) * 0.7);
  height: calc(var(--dock-size, 64px) * 0.7);
  font-size: calc(var(--dock-size, 64px) * 0.6);
  transition:
    width 0.15s cubic-bezier(0.25, 1, 0.5, 1),
    height 0.15s cubic-bezier(0.25, 1, 0.5, 1),
    font-size 0.15s cubic-bezier(0.25, 1, 0.5, 1);
}

.project-link-list.is-compact a span {
  display: none;
}

.project-link-list a:hover {
  text-decoration: none;
  background: var(--accent-soft);
  border-color: #93c5fd;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 2rem;
  flex-wrap: wrap;
  scroll-margin-top: 96px;
}

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  color: var(--text-soft);
  font-weight: 600;
  transition: all 300ms ease;
  text-decoration: none;
}

.pagination a:hover {
  color: var(--accent-dark);
  background: var(--accent-soft);
  border-color: #93c5fd;
  transform: translateY(-2px);
}

.pagination span.active {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

.pagination span.disabled {
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.5;
}

.about-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.about-grid article,
.system-panel,
.auth-card,
.admin-panel,
.stat-card,
.empty-state {
  padding: 1.1rem;
}

.about-grid p {
  margin-top: 0.7rem;
  color: var(--text-soft);
}

.journey-section {
  position: relative;
}

.journey-timeline {
  position: relative;
  display: grid;
  gap: 1.25rem;
  padding-block: 0.35rem;
}

.journey-timeline::before {
  content: "";
  position: absolute;
  top: 0.9rem;
  bottom: 0.9rem;
  left: 50%;
  width: 4px;
  border-radius: 999px;
  background: linear-gradient(180deg, #2563eb 0%, #14b8a6 52%, #f59e0b 100%);
  box-shadow: 0 0 0 6px rgba(37, 99, 235, 0.06);
  transform: translateX(-50%);
}

.journey-item {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 66px minmax(0, 1fr);
  gap: 0.75rem;
  align-items: start;
}

.journey-node {
  position: relative;
  z-index: 2;
  grid-column: 2;
  grid-row: 1;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin-inline: auto;
  border-radius: 50%;
  border: 1px solid #bfdbfe;
  background: #ffffff;
  color: var(--accent-dark);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
}

.journey-node img {
  width: 62%;
  height: 62%;
  object-fit: contain;
}

.journey-node i {
  font-size: 1.05rem;
}

.journey-item.is-latest .journey-node {
  border-color: #fde68a;
  background: #fffbeb;
  color: #b45309;
}

.journey-card {
  position: relative;
  z-index: 1;
  grid-row: 1;
  display: grid;
  gap: 0.75rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  padding: 1rem;
}

.journey-card::after {
  content: "";
  position: absolute;
  top: 29px;
  width: calc(33px + 0.75rem);
  height: 2px;
  background: #bfdbfe;
}

.journey-item:nth-child(odd) .journey-card {
  grid-column: 1;
}

.journey-item:nth-child(odd) .journey-card::after {
  right: calc(-33px - 0.75rem);
}

.journey-item:nth-child(even) .journey-card {
  grid-column: 3;
}

.journey-item:nth-child(even) .journey-card::after {
  left: calc(-33px - 0.75rem);
}

.journey-card-top,
.journey-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
}

.journey-card-top {
  justify-content: space-between;
}

.journey-period,
.journey-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 999px;
  padding: 0.25rem 0.65rem;
  font-size: 0.8rem;
  font-weight: 700;
}

.journey-period {
  border: 1px solid #ccfbf1;
  background: #f0fdfa;
  color: #0f766e;
}

.journey-badge {
  border: 1px solid #fde68a;
  background: #fffbeb;
  color: #b45309;
}

.journey-card p {
  color: var(--text-soft);
}

.journey-stack {
  margin-top: 0;
}

.journey-actions {
  margin-top: 0.15rem;
}

.site-footer {
  border-top: 1px solid var(--border);
  background: #ffffff;
  padding-block: 1.4rem;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: var(--text-soft);
}

.footer-links {
  display: flex;
  gap: 0.55rem;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  color: var(--text-soft);
  background: var(--surface);
  transition: all 300ms ease;
}

.footer-links a:hover {
  transform: translateY(-3px);
  color: var(--accent-dark);
  border-color: #93c5fd;
  background: #eff6ff;
}

.login-section {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 72px);
  padding-block: 2.5rem;
}

.auth-card {
  width: min(480px, 100%);
}

.field {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.95rem;
  font-weight: 600;
  color: var(--text-soft);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #ffffff;
  color: var(--text);
  padding: 0.7rem 0.8rem;
  resize: vertical;
  transition: all 300ms ease;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px #dbeafe;
  outline: none;
}

.field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
  margin-top: 0.95rem;
}

.field-row .field {
  margin-top: 0;
}

.flash {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  margin-bottom: 0.8rem;
  padding: 0.75rem 0.9rem;
  background: #f8fafc;
  color: var(--text-soft);
  font-weight: 600;
}

.flash-success {
  border-color: #a7f3d0;
  background: #ecfdf5;
  color: var(--success);
}

.flash-error {
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}

.flash button {
  color: inherit;
}

.project-detail {
  padding-block: 3rem 4rem;
}

.breadcrumbs {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.breadcrumbs a {
  color: var(--accent-dark);
  font-weight: 600;
}

.breadcrumbs a:hover {
  text-decoration: underline;
}

.detail-hero {
  position: relative;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  padding: 1.4rem;
  box-shadow: var(--shadow-sm);
}

.detail-hero.has-logo {
  padding-right: clamp(5.5rem, 9vw, 8rem);
}

.detail-hero-content {
  max-width: 860px;
  text-align: left;
}

.detail-hero h1 {
  margin: 0.4rem 0 0;
  line-height: 1.08;
}

.detail-hero>.detail-hero-content>p:not(.eyebrow) {
  max-width: 860px;
  margin-top: 0.9rem;
  color: var(--text-soft);
}

.detail-stack {
  margin: 1rem 0 1.1rem;
  justify-content: flex-start;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 1rem;
  font-weight: 600;
  color: var(--accent-dark);
}

.back-link:hover {
  text-decoration: underline;
}

.detail-hero-logo {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: clamp(78px, 10vw, 112px);
  height: clamp(78px, 10vw, 112px);
  pointer-events: none;
}

.detail-hero-logo-orb {
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
}

.detail-hero-logo-orb::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: linear-gradient(150deg, #eff6ff 0%, #e0e7ff 100%);
  border: 1px solid #dbeafe;
}

.detail-hero-logo-orb img {
  position: relative;
  z-index: 1;
  width: 58%;
  height: 58%;
  object-fit: contain;
  filter: drop-shadow(0 6px 10px rgba(15, 23, 42, 0.12));
}

.case-study {
  max-width: 860px;
  margin-top: 2rem;
  color: var(--text-soft);
  line-height: 1.85;
}

.case-study>*+* {
  margin-top: 1rem;
}

.case-study a {
  color: var(--accent-dark);
  text-decoration: underline;
  font-weight: 600;
}

.case-study ul,
.case-study ol {
  padding-left: 1.4rem;
}

.empty-state {
  display: grid;
  place-items: center;
  gap: 0.55rem;
  min-height: 160px;
  text-align: center;
  color: var(--text-soft);
}

.system-panel h1,
.system-panel h2,
.auth-card h1 {
  margin-bottom: 0.8rem;
}

.system-panel .btn {
  margin-top: 1rem;
}

.admin-body {
  background: var(--bg);
}

.admin-layout {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  min-height: 100vh;
}

.admin-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 1rem;
  border-right: 1px solid var(--border);
  background: #ffffff;
}

.admin-brand {
  display: flex;
  padding: 0.65rem 0.4rem 1rem;
  border-bottom: 1px solid var(--border);
}

.admin-nav {
  display: grid;
  gap: 0.35rem;
  margin-top: 1rem;
}

.admin-main {
  min-width: 0;
  padding: 1.35rem;
}

.admin-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.admin-user {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #ffffff;
  padding: 0.45rem 0.65rem;
  color: var(--text-soft);
  font-weight: 600;
}

.stats-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-bottom: 1.5rem;
}

.stat-card {
  display: grid;
  gap: 0.45rem;
}

.stat-card span {
  color: var(--text);
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1.2;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(280px, 420px) minmax(0, 1fr);
  gap: 1.3rem;
  align-items: start;
}

.admin-grid.wide-form {
  grid-template-columns: minmax(320px, 540px) minmax(0, 1fr);
}

.admin-panel+.admin-panel {
  margin-top: 1rem;
}

.form-panel {
  position: sticky;
  top: 1rem;
}

.panel-heading {
  margin-bottom: 1rem;
}

.table-wrap {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 620px;
}

.data-table th,
.data-table td {
  border-bottom: 1px solid var(--border);
  padding: 0.75rem;
  text-align: left;
  vertical-align: middle;
}

.data-table th {
  background: #f1f5f9;
  color: var(--text-soft);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
}

.action-cell {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.danger {
  color: var(--danger);
}

.danger:hover {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.6rem;
}

.checkbox-tile {
  position: relative;
  display: block;
}

.checkbox-tile input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.checkbox-tile span {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  color: var(--text-soft);
  font-weight: 600;
  transition: all 300ms ease;
}

.checkbox-tile input:checked+span,
.checkbox-tile span:hover {
  color: var(--accent-dark);
  background: var(--accent-soft);
  border-color: #93c5fd;
}

legend {
  padding: 0;
  color: var(--text-soft);
  font-weight: 600;
}

fieldset {
  min-width: 0;
  border: 0;
  padding: 0;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

/* Language Dropdown */
.lang-dropdown {
  position: relative;
  display: inline-flex;
}

.lang-flag {
  font-size: 1.3rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
}

.lang-flag svg {
  display: inline-flex;
  width: 22px;
  height: 22px;
}

.lang-dropdown__trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  min-height: 34px;
  padding: 0.25rem 0.5rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #ffffff;
  cursor: pointer;
  transition: all 200ms ease;
  box-shadow: var(--shadow-sm);
}

.lang-dropdown__trigger:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.lang-dropdown__trigger:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.lang-dropdown__menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 155px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  padding: 0.35rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: all 200ms ease;
  z-index: 100;
}

.lang-dropdown.is-open .lang-dropdown__menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.lang-dropdown__item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 0.7rem;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 150ms ease;
  cursor: pointer;
}

.lang-dropdown__item:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.lang-dropdown__item.is-active {
  background: #0f172a;
  color: #ffffff;
}

.lang-dropdown__item.is-active:hover {
  background: #1e293b;
}

.lang-dropdown__item .lang-flag {
  font-size: 1.2rem;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
}

.lang-dropdown__item .lang-flag svg {
  width: 20px;
  height: 20px;
  display: inline-flex;
}

.lang-dropdown__label {
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1.3;
}

/* Remove old language-switch styles if any */
.language-switch {
  display: none;
}

/* ── Mode Dropdown ── */
.mode-dropdown {
  position: relative;
  display: inline-flex;
}

.mode-dropdown__trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 34px;
  padding: 0.35rem 0.65rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 200ms ease;
  box-shadow: var(--shadow-sm);
  font-family: inherit;
  line-height: 1;
  white-space: nowrap;
}

.mode-dropdown__trigger span {
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mode-dropdown__trigger:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.mode-dropdown__trigger:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.mode-dropdown__arrow {
  font-size: 0.65rem;
  transition: transform 250ms ease;
  color: var(--muted);
}

.mode-dropdown.is-open .mode-dropdown__arrow {
  transform: rotate(180deg);
}

.mode-dropdown__menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 150px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  padding: 0.35rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: all 200ms ease;
  z-index: 100;
}

.mode-dropdown.is-open .mode-dropdown__menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.mode-dropdown__item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.7rem;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 150ms ease;
  cursor: pointer;
}

.mode-dropdown__item:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.mode-dropdown__item.is-active {
  background: #0f172a;
  color: #ffffff;
}

.mode-dropdown__item.is-active:hover {
  background: #1e293b;
}

.mode-dropdown__item i {
  width: 1.1rem;
  text-align: center;
  font-size: 0.9rem;
}

.models-hero {
  width: min(var(--content-width), calc(100% - 2rem));
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 2rem;
  padding-block: 4.5rem 3.5rem;
}

.models-hero-copy {
  max-width: 820px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.8rem;
}

.models-hero-copy h1 {
  font-size: clamp(2rem, 4vw, 3.15rem);
  line-height: 1.08;
}

.models-hero-copy p:not(.eyebrow) {
  margin-top: 1rem;
  color: var(--text-soft);
  font-size: 1.04rem;
}

.models-hero-panel {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 320px;
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid #ccfbf1;
  background:
    linear-gradient(135deg, rgba(20, 184, 166, 0.14), rgba(245, 158, 11, 0.12)),
    repeating-linear-gradient(90deg,
      rgba(15, 23, 42, 0.06) 0 1px,
      transparent 1px 34px),
    repeating-linear-gradient(0deg,
      rgba(15, 23, 42, 0.05) 0 1px,
      transparent 1px 34px),
    #ffffff;
  box-shadow: var(--shadow-md);
}

.models-hero-panel i {
  position: relative;
  z-index: 2;
  color: #0f766e;
  font-size: 6rem;
  filter: drop-shadow(0 18px 24px rgba(15, 23, 42, 0.18));
  transform: rotate(-12deg);
}

.model-axis {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 52%;
  height: 3px;
  border-radius: 999px;
  transform-origin: left center;
}

.axis-x {
  background: #dc2626;
  transform: rotate(0deg);
}

.axis-y {
  background: #16a34a;
  transform: rotate(-58deg);
}

.axis-z {
  background: #2563eb;
  transform: rotate(58deg);
}

.section-count,
.model-card-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text-soft);
  font-size: 0.84rem;
  font-weight: 700;
}

.section-count {
  min-height: 38px;
  padding: 0.45rem 0.75rem;
}

.model-grid {
  align-items: stretch;
}

.model-card {
  border-color: #ccfbf1;
}

.model-thumb {
  height: clamp(220px, 28vw, 260px);
  flex-shrink: 0;
  overflow: hidden;
  background:
    linear-gradient(180deg,
      rgba(20, 184, 166, 0.04) 0%,
      rgba(20, 184, 166, 0.08) 100%),
    #f8fafc;
  border-color: #ccfbf1;
  color: #0f766e;
  display: flex;
  align-items: center;
  justify-content: center;
}

.model-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  padding: 0.5rem;
  display: block;
  border-radius: calc(var(--radius-sm) - 1px);
}

.model-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.9rem;
}

.model-card-meta span {
  padding: 0.28rem 0.58rem;
  background: #f8fafc;
}

.model-detail-meta {
  margin-top: 0;
}

.model-detail-hero {
  overflow: hidden;
}

.iot-hero {
  padding-block: 4rem 3rem;
}

.iot-grid {
  align-items: stretch;
}

.iot-card {
  border-color: #bae6fd;
}

.iot-thumb {
  height: clamp(190px, 24vw, 240px);
  flex-shrink: 0;
  overflow: hidden;
  border-color: #bae6fd;
  color: #0369a1;
  background:
    linear-gradient(180deg,
      rgba(14, 165, 233, 0.05) 0%,
      rgba(34, 197, 94, 0.08) 100%),
    #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
}

.iot-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  padding: 0.65rem;
}

.iot-card-meta span {
  border-color: #bae6fd;
  background: #f0f9ff;
  color: #075985;
}

.iot-detail-hero {
  overflow: hidden;
}

.iot-device-section {
  max-width: none;
}

.iot-device-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1rem;
}

.iot-device-card {
  display: grid;
  gap: 0.75rem;
  grid-template-rows: auto auto;
  align-content: start;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 0.9rem;
  box-shadow: var(--shadow-sm);
}

.iot-device-image {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1 / 1;
  min-height: 0;
  border-radius: var(--radius-sm);
  border: 1px solid #bae6fd;
  background: #f0f9ff;
  color: #0369a1;
  overflow: hidden;
}

.iot-device-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  padding: 0.55rem;
}

.iot-device-card h3 {
  font-size: 1rem;
  text-align: center;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}

.iot-device-card p {
  margin-top: 0.3rem;
  color: var(--text-soft);
  font-size: 0.9rem;
  line-height: 1.45;
  text-align: center;
}

.model-viewer-stage {
  position: relative;
  width: min(var(--content-width), calc(100% - 2rem));
  margin-inline: auto;
  min-height: clamp(500px, 72vh, 780px);
  margin-top: 2rem;
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: #f8fafc;
}

.model-env-studio {
  background: linear-gradient(180deg, #f8fafc 0%, #e2e8f0 100%);
}

.model-env-sunset {
  background: linear-gradient(180deg, #fff7ed 0%, #fde68a 48%, #f8fafc 100%);
}

.model-env-gallery {
  background: linear-gradient(180deg, #ffffff 0%, #f1f5f9 100%);
}

.model-env-midnight {
  background: linear-gradient(180deg, #0f172a 0%, #1e293b 54%, #334155 100%);
}

.model-viewer,
.model-canvas-host {
  position: absolute;
  inset: 0;
}

.model-canvas-host canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.model-loading {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  transform: translate(-50%, -50%);
  display: grid;
  gap: 0.7rem;
  width: min(84vw, 320px);
  padding: 1rem 1.05rem;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  background: rgba(255, 255, 255, 0.9);
  color: var(--text-soft);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(8px);
}

.model-loading__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.93rem;
  font-weight: 700;
}

.model-loading__label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.model-loading__percent {
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  color: var(--accent-dark);
}

.model-loading__bar {
  overflow: hidden;
  height: 10px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.14);
}

.model-loading__bar-fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #60a5fa);
  transition: width 120ms linear;
}

.model-loading.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.model-control-bar {
  position: absolute;
  left: 50%;
  bottom: 1rem;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.55rem;
  width: min(100% - 2rem, 980px);
  transform: translateX(-50%);
  padding: 0.55rem;
  border-radius: 14px;
  border: 1px solid rgba(226, 232, 240, 0.8);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
  backdrop-filter: blur(10px);
}

.viewer-control-group {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem;
}

.viewer-control-group button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.38rem;
  min-height: 38px;
  padding: 0.45rem 0.65rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text-soft);
  font-size: 0.82rem;
  font-weight: 700;
  transition: all 220ms ease;
}

.viewer-control-group button:hover,
.viewer-control-group button.is-active {
  border-color: #5eead4;
  background: #ccfbf1;
  color: #0f766e;
}

.icon-only-controls button {
  width: 38px;
  padding-inline: 0;
}

.model-noscript {
  position: absolute;
  inset: auto 1rem 1rem;
  z-index: 4;
  border-radius: 10px;
  background: #ffffff;
  padding: 0.75rem;
  color: var(--text-soft);
  font-weight: 700;
}

.model-story {
  margin-inline: auto;
}

.checkbox-line {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.95rem;
  color: var(--text-soft);
  font-weight: 700;
}

.checkbox-line input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.checkbox-line span {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.current-upload-preview {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.4rem;
}

.current-upload-preview img {
  width: 150px;
  max-height: 110px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.iot-device-admin-list {
  display: grid;
  gap: 0.75rem;
}

.iot-device-admin-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(170px, 0.8fr);
  gap: 0.65rem;
  align-items: end;
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #f8fafc;
}

.iot-device-admin-row label {
  display: grid;
  gap: 0.35rem;
}

.iot-device-admin-row label span {
  font-size: 0.82rem;
  color: var(--muted);
}

.current-device-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.current-device-preview span {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 38px;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text-soft);
  font-size: 0.84rem;
  font-weight: 700;
}

.current-device-preview img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #f8fafc;
}

/* Gallery Slider */
.detail-logo-section {
  margin-block: 1.5rem;
  text-align: center;
}

.project-gallery {
  margin-block: 1.75rem;
}

.gallery-slider {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.gallery-viewport {
  overflow: hidden;
}

.gallery-track {
  display: flex;
  width: 100%;
  transition: transform 420ms cubic-bezier(0.33, 0.66, 0.66, 1);
  will-change: transform;
}

.gallery-item {
  flex: 0 0 100%;
  min-width: 100%;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: clamp(280px, 50vw, 560px);
  background: white;
}

.gallery-item-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
  color: inherit;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

body.is-modal-open {
  overflow: hidden;
}

.gallery-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(15, 23, 42, 0.7);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
  z-index: 200;
}

.gallery-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.gallery-modal-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: transparent;
  cursor: zoom-out;
}

.gallery-modal-panel {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: min(100%, 1100px);
  max-height: 90vh;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #0f172a;
  padding: 0.75rem;
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.35);
}

.gallery-modal-image {
  width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: calc(var(--radius-lg) - 6px);
  background: #0b1220;
}

.gallery-modal-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(15, 23, 42, 0.8);
  color: #ffffff;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.gallery-modal-close:hover {
  background: rgba(15, 23, 42, 0.95);
}

.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 300ms ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-nav:hover {
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.gallery-prev {
  left: 0.5rem;
}

.gallery-next {
  right: 0.5rem;
}

.gallery-dots {
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  margin: 1rem 0 0;
  padding-bottom: 1rem;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: transparent;
  cursor: pointer;
  transition: all 300ms ease;
}

.dot.active {
  background: var(--accent);
  border-color: var(--accent);
}

.dot:hover {
  border-color: var(--accent);
}

@media (max-width: 1024px) {
  .nav-shell {
    min-height: 66px;
    flex-wrap: wrap;
  }

  .nav-actions {
    margin-left: auto;
  }

  .mode-dropdown__trigger {
    max-width: calc(100vw - 178px);
  }

  .menu-toggle {
    display: inline-flex;
  }

  .site-menu {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 40;
    background: #ffffff;
    width: 100%;
    margin: 0;
    /* CardNav animation setups */
    visibility: hidden;
    max-height: 0;
    padding: 0 1rem;
    overflow: hidden;
    /* Faster duration */
    transition:
      max-height 0.3s cubic-bezier(0.215, 0.61, 0.355, 1),
      padding 0.3s cubic-bezier(0.215, 0.61, 0.355, 1),
      visibility 0.3s;
    transition-delay: 0.4s;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  }

  .site-menu.is-open {
    visibility: visible;
    max-height: calc(100vh - 80px);
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--border);
    transition:
      max-height 0.3s cubic-bezier(0.215, 0.61, 0.355, 1),
      padding 0.3s cubic-bezier(0.215, 0.61, 0.355, 1),
      visibility 0s;
    transition-delay: 0s;
  }

  .site-menu a {
    border-color: var(--border);
    opacity: 0;
    transform: translateY(50px);
    transition:
      opacity 0.2s ease,
      transform 0.2s cubic-bezier(0.215, 0.61, 0.355, 1);
  }

  /* Close animation transition-delays (bottom-to-top reverse order) */
  .site-menu a:nth-child(1) {
    transition-delay: 0.2s;
  }

  .site-menu a:nth-child(2) {
    transition-delay: 0.16s;
  }

  .site-menu a:nth-child(3) {
    transition-delay: 0.12s;
  }

  .site-menu a:nth-child(4) {
    transition-delay: 0.08s;
  }

  .site-menu a:nth-child(5) {
    transition-delay: 0.04s;
  }

  .site-menu a:nth-child(6) {
    transition-delay: 0s;
  }

  .site-menu a:nth-child(7) {
    transition-delay: 0s;
  }

  .site-menu.is-open a {
    opacity: 1;
    transform: translateY(0);
    transition:
      opacity 0.25s ease,
      transform 0.25s cubic-bezier(0.215, 0.61, 0.355, 1);
  }

  /* Open animation transition-delays (top-to-bottom order after container expands in 0.3s) */
  .site-menu.is-open a:nth-child(1) {
    transition-delay: 0.3s;
  }

  .site-menu.is-open a:nth-child(2) {
    transition-delay: 0.34s;
  }

  .site-menu.is-open a:nth-child(3) {
    transition-delay: 0.38s;
  }

  .site-menu.is-open a:nth-child(4) {
    transition-delay: 0.42s;
  }

  .site-menu.is-open a:nth-child(5) {
    transition-delay: 0.46s;
  }

  .site-menu.is-open a:nth-child(6) {
    transition-delay: 0.5s;
  }

  .site-menu.is-open a:nth-child(7) {
    transition-delay: 0.54s;
  }

  .skeleton-nav {
    height: 66px;
  }

  .skeleton-nav-links {
    display: none;
  }
}

@media (max-width: 980px) {

  .about-grid,
  .models-hero,
  .admin-layout,
  .admin-grid,
  .admin-grid.wide-form,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .hero-section {
    padding-block: 3rem;
  }

  .models-hero {
    padding-block: 3rem;
  }

  .admin-sidebar {
    position: relative;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .form-panel {
    position: static;
  }
}

@media (max-width: 760px) {
  h1 {
    font-size: 1.9rem;
  }

  h2 {
    font-size: 1.4rem;
  }

  .project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .journey-timeline::before {
    left: 50%;
    transform: translateX(-50%);
  }

  .journey-item {
    grid-template-columns: minmax(0, 1fr) 44px minmax(0, 1fr);
    gap: 0.5rem;
  }

  .journey-node {
    grid-column: 2;
    width: 44px;
    height: 44px;
  }

  .journey-card {
    padding: 0.85rem;
  }

  .journey-card::after {
    top: 22px;
  }

  .journey-item:nth-child(odd) .journey-card::after {
    right: calc(-22px - 0.5rem);
    left: auto;
    width: calc(22px + 0.5rem);
  }

  .journey-item:nth-child(even) .journey-card::after {
    left: calc(-22px - 0.5rem);
    right: auto;
    width: calc(22px + 0.5rem);
  }

  .journey-card-top {
    flex-direction: column;
    align-items: flex-start;
  }

  .journey-card h3 {
    font-size: 1rem;
  }

  .journey-card p {
    font-size: 0.9rem;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    overflow: hidden;
  }

  .journey-stack {
    display: none;
  }

  .journey-actions {
    gap: 0.4rem;
  }

  .field-row {
    grid-template-columns: 1fr;
  }

  .project-link-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
  }

  .project-link-list a {
    flex-direction: column;
    justify-content: center;
    min-height: 106px;
    padding: 0.75rem;
    text-align: center;
  }

  .project-link-list a span {
    font-size: 0.86rem;
    line-height: 1.25;
    overflow-wrap: anywhere;
  }

  .project-link-list.is-compact {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.5rem;
    min-height: unset;
    padding-bottom: 0;
    overflow-x: visible;
  }

  .project-link-list.is-compact a {
    width: 100%;
    height: auto;
    min-height: 78px;
    transition: all 300ms ease;
  }

  .project-link-list.is-compact .project-link-icon {
    width: 38px;
    height: 38px;
    font-size: 1.4rem;
    transition: all 300ms ease;
  }

  .tech-heading-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .tech-grid.is-folder-mode {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detail-hero {
    padding: 1.1rem;
  }

  .detail-hero.has-logo {
    padding-right: 4.75rem;
  }

  .detail-hero-logo {
    top: 0.8rem;
    right: 0.8rem;
    width: 86px;
    height: 86px;
  }

  .gallery-slider {
    border-radius: 14px;
  }

  .gallery-item {
    min-height: 280px;
  }

  .gallery-nav {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }

  .gallery-nav.gallery-prev {
    left: 0.25rem;
  }

  .gallery-nav.gallery-next {
    right: 0.25rem;
  }

  .nav-shell {
    min-height: 66px;
    flex-wrap: wrap;
  }

  .nav-actions {
    margin-left: auto;
  }

  .mode-dropdown__trigger {
    max-width: calc(100vw - 178px);
  }

  .menu-toggle {
    display: inline-flex;
  }

  .site-menu {
    display: grid;
    grid-template-columns: 1fr;
    position: absolute;
    top: 66px;
    left: 0;
    right: 0;
    z-index: 40;
    background: #ffffff;
    width: 100%;
    margin: 0;
    /* CardNav animation setups */
    visibility: hidden;
    max-height: 0;
    padding: 0 1rem;
    overflow: hidden;
    /* Faster duration */
    transition:
      max-height 0.3s cubic-bezier(0.215, 0.61, 0.355, 1),
      padding 0.3s cubic-bezier(0.215, 0.61, 0.355, 1),
      visibility 0.3s;
    transition-delay: 0.4s;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  }

  .site-menu.is-open {
    visibility: visible;
    max-height: 400px;
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--border);
    transition:
      max-height 0.3s cubic-bezier(0.215, 0.61, 0.355, 1),
      padding 0.3s cubic-bezier(0.215, 0.61, 0.355, 1),
      visibility 0s;
    transition-delay: 0s;
  }

  .site-menu a {
    border-color: var(--border);
    opacity: 0;
    transform: translateY(50px);
    transition:
      opacity 0.2s ease,
      transform 0.2s cubic-bezier(0.215, 0.61, 0.355, 1);
  }

  /* Close animation transition-delays (bottom-to-top reverse order) */
  .site-menu a:nth-child(1) {
    transition-delay: 0.2s;
  }

  .site-menu a:nth-child(2) {
    transition-delay: 0.16s;
  }

  .site-menu a:nth-child(3) {
    transition-delay: 0.12s;
  }

  .site-menu a:nth-child(4) {
    transition-delay: 0.08s;
  }

  .site-menu a:nth-child(5) {
    transition-delay: 0.04s;
  }

  .site-menu a:nth-child(6) {
    transition-delay: 0s;
  }

  .site-menu a:nth-child(7) {
    transition-delay: 0s;
  }

  .site-menu.is-open a {
    opacity: 1;
    transform: translateY(0);
    transition:
      opacity 0.25s ease,
      transform 0.25s cubic-bezier(0.215, 0.61, 0.355, 1);
  }

  /* Open animation transition-delays (top-to-bottom order after container expands in 0.3s) */
  .site-menu.is-open a:nth-child(1) {
    transition-delay: 0.3s;
  }

  .site-menu.is-open a:nth-child(2) {
    transition-delay: 0.34s;
  }

  .site-menu.is-open a:nth-child(3) {
    transition-delay: 0.38s;
  }

  .site-menu.is-open a:nth-child(4) {
    transition-delay: 0.42s;
  }

  .site-menu.is-open a:nth-child(5) {
    transition-delay: 0.46s;
  }

  .site-menu.is-open a:nth-child(6) {
    transition-delay: 0.5s;
  }

  .site-menu.is-open a:nth-child(7) {
    transition-delay: 0.54s;
  }

  .models-hero-panel {
    min-height: 240px;
  }

  .models-hero-panel i {
    font-size: 4.4rem;
  }

  .model-viewer-stage {
    min-height: 620px;
  }

  .model-control-bar {
    align-content: flex-start;
    bottom: 0.75rem;
    max-height: 42%;
    overflow-y: auto;
  }

  .footer-inner,
  .section-heading-row,
  .panel-heading,
  .admin-topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero-actions,
  .card-actions,
  .detail-actions {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }

  .project-thumb {
    height: 128px;
  }

  .iot-device-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
  }

  .iot-device-card {
    gap: 0.4rem;
    padding: 0.45rem;
    border-radius: 10px;
  }

  .iot-device-image {
    border-radius: 8px;
  }

  .iot-device-card>div:last-child {
    min-width: 0;
  }

  .iot-device-image img {
    padding: 0.35rem;
  }

  .iot-device-card h3 {
    font-size: 0.72rem;
    line-height: 1.2;
  }

  .iot-device-card p {
    display: none;
  }
}

@media (max-width: 560px) {
  .mode-dropdown__trigger {
    max-width: calc(100vw - 154px);
  }

  .viewer-control-group button span {
    display: none;
  }

  .model-viewer-stage {
    min-height: 560px;
  }

  .journey-item {
    grid-template-columns: minmax(0, 1fr) 38px minmax(0, 1fr);
    gap: 0.4rem;
  }

  .journey-node {
    width: 38px;
    height: 38px;
  }

  .journey-card {
    padding: 0.75rem;
  }

  .journey-card::after {
    top: 19px;
  }

  .journey-item:nth-child(odd) .journey-card::after {
    right: calc(-19px - 0.4rem);
    width: calc(19px + 0.4rem);
  }

  .journey-item:nth-child(even) .journey-card::after {
    left: calc(-19px - 0.4rem);
    width: calc(19px + 0.4rem);
  }

  .project-grid {
    grid-template-columns: 1fr;
  }

  .iot-device-admin-row {
    grid-template-columns: 1fr;
  }

  .journey-card-top {
    align-items: flex-start;
    flex-direction: column;
  }
}

.tech-icon-svg {
  width: 1.2em !important;
  height: 1.2em !important;
  max-width: 32px !important;
  max-height: 32px !important;
  object-fit: contain;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
  line-height: 1;
}

/* Specific constraint for table cells in admin */
.data-table td .tech-icon-svg {
  width: 24px !important;
  height: 24px !important;
}

.contact-layout {
  display: grid;
  grid-template-columns: minmax(240px, 360px) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.contact-aside,
.contact-card {
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.contact-aside {
  padding: 1.1rem;
  display: grid;
  gap: 0.75rem;
}

.contact-aside h3 {
  font-size: 1.2rem;
}

.contact-aside p {
  color: var(--text-soft);
}

.contact-detail-list {
  display: grid;
  gap: 0.85rem;
  margin-top: 0.35rem;
}

.contact-detail-list div {
  display: grid;
  gap: 0.2rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
}

.contact-detail-list span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
}

.contact-detail-list a,
.contact-detail-list strong {
  color: var(--text-soft);
  font-weight: 600;
}

.contact-card {
  width: 100%;
  padding: 1.1rem;
}

.tech-icon-svg {
  width: 1.2em !important;
  height: 1.2em !important;
  max-width: 32px !important;
  max-height: 32px !important;
  object-fit: contain;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
  line-height: 1;
}

/* Specific constraint for table cells in admin */
.data-table td .tech-icon-svg {
  width: 24px !important;
  height: 24px !important;
}

.contact-layout {
  display: grid;
  grid-template-columns: minmax(240px, 360px) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.contact-aside,
.contact-card {
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.contact-aside {
  padding: 1.1rem;
  display: grid;
  gap: 0.75rem;
}

.contact-aside h3 {
  font-size: 1.2rem;
}

.contact-aside p {
  color: var(--text-soft);
}

.contact-detail-list {
  display: grid;
  gap: 0.85rem;
  margin-top: 0.35rem;
}

.contact-detail-list div {
  display: grid;
  gap: 0.2rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
}

.contact-detail-list span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
}

.contact-detail-list a,
.contact-detail-list strong {
  color: var(--text-soft);
  font-weight: 600;
}

.contact-card {
  width: 100%;
  padding: 1.1rem;
}

.contact-card form {
  width: 100%;
}

.contact-actions {
  align-items: center;
}

@media (max-width: 860px) {
  .contact-layout {
    grid-template-columns: 1fr;
  }

  .contact-aside,
  .contact-card {
    min-width: 0;
  }
}

@media (max-width: 560px) {
  .section-shell {
    width: min(100% - 1.25rem, var(--content-width));
    padding-block: 2.5rem;
  }

  .contact-layout {
    gap: 0.85rem;
  }

  .contact-aside,
  .contact-card {
    padding: 0.95rem;
    border-radius: 12px;
  }

  .contact-aside h3 {
    font-size: 1.05rem;
  }

  .contact-aside p,
  .contact-detail-list a,
  .contact-detail-list strong {
    overflow-wrap: anywhere;
  }

  .contact-card .field input,
  .contact-card .field textarea {
    width: 100%;
    min-width: 0;
  }

  .contact-actions {
    width: 100%;
    align-items: stretch;
  }
}

/* Anime.js layout modal for the tech stack section */

#layout-dialog {
  --overlay-alpha: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: fixed;
  z-index: 1000;
  top: 0;
  left: 0;
  width: 100%;
  height: 100dvh;
  max-width: 100%;
  max-height: 100%;
  border: none;
  background: transparent;
  pointer-events: none;
  background-color: color-mix(in srgb,
      #0f172a,
      transparent var(--overlay-alpha));
}

#layout-dialog[open] {
  --overlay-alpha: 40%;
  pointer-events: auto;
}

#layout-dialog::backdrop {
  background: transparent;
}

#layout-dialog .item {
  position: relative;
  visibility: hidden;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  column-gap: 1rem;
  row-gap: 1rem;
  align-items: flex-start;
  justify-content: flex-start;
  text-align: left;
  width: min(30rem, calc(100vw - 2rem));
  height: auto;
  min-height: 14.5rem;
  max-height: calc(100dvh - 2rem);
  padding: 2rem;
  border-radius: 1rem;
  border: 1px solid var(--border);
  font-size: 1rem;
  color: var(--text);
  background-color: var(--surface);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

#layout-dialog[open] .item {
  visibility: visible;
}

#layout-dialog .item h2 {
  font-size: 2rem;
  align-self: center;
  will-change: font-size;
  text-wrap: wrap;
  color: var(--text);
}

#layout-dialog .item .tech-tile-icon {
  display: grid;
  place-items: center;
  width: 3.25rem;
  height: 3.25rem;
  color: var(--accent-dark);
}

#layout-dialog .item .tech-tile-icon i,
#layout-dialog .item .tech-tile-icon .tech-icon-svg {
  width: 2.75rem !important;
  height: 2.75rem !important;
  font-size: 2.75rem;
}

.folder-tech-icon .tech-icon-svg {
  width: 1.75rem !important;
  height: 1.75rem !important;
  max-width: 1.75rem !important;
  max-height: 1.75rem !important;
}

#layout-usage-animate-modal-dialog .item {
  cursor: pointer;
}

#layout-usage-animate-modal-dialog .item h2 {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 0.95rem;
  font-weight: 700;
  overflow-wrap: anywhere;
  text-align: left;
}

#layout-usage-animate-modal-dialog .item.is-open {
  visibility: hidden;
}

#layout-usage-animate-modal-dialog .item p {
  text-align: left;
  display: none;
}

#layout-dialog .item p {
  grid-column: 1 / -1;
  padding-top: 1rem;
  border-top: 1px solid currentColor;
  color: var(--text-soft);
  line-height: 1.6;
  font-size: 0.95rem;
  width: 100%;
  margin: 0;
  min-height: 0;
  overflow-y: auto;
}

#layout-dialog[open] .item p {
  display: block;
}

/* ═══════════════════════════════════════════
   Dark Mode – triggered via data-theme="dark" on <html>
   ═══════════════════════════════════════════ */
[data-theme="dark"] {
  --bg: #0f172a;
  --surface: #1e293b;
  --text: #f1f5f9;
  --text-soft: #cbd5e1;
  --muted: #94a3b8;
  --border: #334155;
  --accent: #3b82f6;
  --accent-dark: #60a5fa;
  --accent-soft: #1e3a5f;
  --danger: #ef4444;
  --success: #10b981;
  --shadow-sm: 0 6px 18px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 14px 30px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] code,
[data-theme="dark"] pre {
  background: #1e293b;
  color: #e2e8f0;
}

[data-theme="dark"] .site-header {
  background: rgba(15, 23, 42, 0.92);
}

[data-theme="dark"] .site-menu {
  background: #0f172a;
}

[data-theme="dark"] .site-footer {
  background: #0f172a;
}

[data-theme="dark"] .admin-sidebar {
  background: #0f172a;
}

[data-theme="dark"] .admin-user {
  background: #1e293b;
}

[data-theme="dark"] .data-table th {
  background: #1e293b;
  color: #cbd5e1;
}

[data-theme="dark"] .field input,
[data-theme="dark"] .field select,
[data-theme="dark"] .field textarea {
  background: #0f172a;
  color: #f1f5f9;
}

[data-theme="dark"] .field input:focus,
[data-theme="dark"] .field select:focus,
[data-theme="dark"] .field textarea:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

[data-theme="dark"] .lang-dropdown__trigger,
[data-theme="dark"] .mode-dropdown__trigger {
  background: #1e293b;
  color: #f1f5f9;
}

[data-theme="dark"] .lang-dropdown__menu,
[data-theme="dark"] .mode-dropdown__menu {
  background: #1e293b;
  border-color: #334155;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .lang-dropdown__item.is-active,
[data-theme="dark"] .mode-dropdown__item.is-active {
  background: #3b82f6;
  color: #ffffff;
}

[data-theme="dark"] .lang-dropdown__item.is-active:hover,
[data-theme="dark"] .mode-dropdown__item.is-active:hover {
  background: #2563eb;
}

[data-theme="dark"] .stack-list span {
  background: #0f172a;
}

[data-theme="dark"] .project-year {
  background: #0f172a;
}

[data-theme="dark"] .project-thumb {
  background: linear-gradient(150deg, #1e3a5f 0%, #1e1b4b 100%);
  border-color: #334155;
}

[data-theme="dark"] .journey-node {
  background: #1e293b;
  border-color: #334155;
}

[data-theme="dark"] .journey-item.is-latest .journey-node {
  background: #422006;
  border-color: #78350f;
}

[data-theme="dark"] .journey-card::after {
  background: #334155;
}

[data-theme="dark"] .model-viewer-stage {
  background: #0f172a;
}

[data-theme="dark"] .model-env-studio {
  background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
}

[data-theme="dark"] .model-env-sunset {
  background: linear-gradient(180deg, #422006 0%, #78350f 48%, #0f172a 100%);
}

[data-theme="dark"] .model-env-gallery {
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
}

[data-theme="dark"] .model-loading {
  background: rgba(30, 41, 59, 0.92);
  border-color: rgba(51, 65, 85, 0.58);
  color: #cbd5e1;
}

[data-theme="dark"] .model-control-bar {
  background: rgba(15, 23, 42, 0.88);
  border-color: rgba(51, 65, 85, 0.8);
}

[data-theme="dark"] .viewer-control-group button {
  background: #1e293b;
  color: #cbd5e1;
  border-color: #334155;
}

[data-theme="dark"] .viewer-control-group button:hover,
[data-theme="dark"] .viewer-control-group button.is-active {
  border-color: #14b8a6;
  background: #134e4a;
  color: #5eead4;
}

[data-theme="dark"] .models-hero-panel {
  background:
    linear-gradient(135deg, rgba(20, 184, 166, 0.08), rgba(245, 158, 11, 0.06)),
    repeating-linear-gradient(90deg,
      rgba(255, 255, 255, 0.04) 0 1px,
      transparent 1px 34px),
    repeating-linear-gradient(0deg,
      rgba(255, 255, 255, 0.04) 0 1px,
      transparent 1px 34px),
    #0f172a;
  border-color: #134e4a;
}

[data-theme="dark"] .models-hero-panel i {
  color: #14b8a6;
}

[data-theme="dark"] .model-card-meta span,
[data-theme="dark"] .section-count {
  background: #0f172a;
}

[data-theme="dark"] .model-thumb {
  background:
    linear-gradient(180deg, rgba(20, 184, 166, 0.06), rgba(20, 184, 166, 0.1)),
    #0f172a;
  border-color: #134e4a;
}

[data-theme="dark"] .iot-thumb {
  background:
    linear-gradient(180deg, rgba(14, 165, 233, 0.06), rgba(34, 197, 94, 0.08)),
    #0f172a;
  border-color: #0c4a6e;
}

[data-theme="dark"] .iot-card-meta span {
  background: #0c4a6e;
  border-color: #0c4a6e;
  color: #7dd3fc;
}

[data-theme="dark"] .iot-device-image {
  border-color: #0c4a6e;
  background: #0c4a6e;
}

[data-theme="dark"] .iot-device-admin-row {
  background: #0f172a;
}

[data-theme="dark"] .current-device-preview span {
  background: #1e293b;
}

[data-theme="dark"] .current-upload-preview img {
  border-color: #334155;
}

[data-theme="dark"] .gallery-item {
  background: #0f172a;
}

[data-theme="dark"] .gallery-nav {
  background: rgba(30, 41, 59, 0.9);
  color: #f1f5f9;
  border-color: #334155;
}

[data-theme="dark"] .gallery-nav:hover {
  background: #1e293b;
}

[data-theme="dark"] .detail-hero {
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
}

[data-theme="dark"] .detail-hero-logo-orb::before {
  background: linear-gradient(150deg, #1e3a5f 0%, #1e1b4b 100%);
  border-color: #334155;
}

[data-theme="dark"] .checkbox-grid .checkbox-tile span {
  background: #0f172a;
}

[data-theme="dark"] .checkbox-tile input:checked+span,
[data-theme="dark"] .checkbox-tile span:hover {
  background: #1e3a5f;
  border-color: #3b82f6;
}

[data-theme="dark"] .theme-toggle-btn {
  border-color: var(--border);
  color: var(--text-soft);
  background: var(--surface);
}

[data-theme="dark"] .theme-toggle-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

/* Make logo white in dark mode */
[data-theme="dark"] .brand-logo {
  filter: brightness(0) invert(1);
}

/* ── Smooth theme transition (lightweight) ── */
@media (prefers-reduced-motion: no-preference) {
  body {
    transition:
      background-color 0.35s ease,
      color 0.35s ease;
  }

  .site-header,
  .site-footer,
  .admin-sidebar,
  .admin-main,
  .brand-logo,
  .theme-toggle-btn {
    transition:
      background-color 0.35s ease,
      color 0.35s ease,
      border-color 0.35s ease,
      box-shadow 0.35s ease,
      filter 0.35s ease;
  }
}

/* ── Theme Toggle Button ── */
.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text-soft);
  cursor: pointer;
  transition: all 200ms ease;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
  font-size: 1rem;
}

.theme-toggle-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.theme-toggle-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.theme-toggle-btn .theme-icon-dark {
  display: none;
}

[data-theme="dark"] .theme-toggle-btn .theme-icon-light {
  display: none;
}

[data-theme="dark"] .theme-toggle-btn .theme-icon-dark {
  display: inline-block;
}

/* ═══════════════════════════════════════════
   Typing Effect – blinking cursor
   ═══════════════════════════════════════════ */
.typing-cursor {
  display: inline-block;
  width: 2px;
  height: 1.1em;
  background: var(--accent-dark);
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: blink-cursor 0.75s step-end infinite;
}

@keyframes blink-cursor {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0;
  }
}

[data-theme="dark"] .typing-cursor {
  background: var(--accent);
}

/* ═══════════════════════════════════════════
   Scroll Reveal – fade-in + slide-up
   ═══════════════════════════════════════════ */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 0.55s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger delays for children */
.reveal-delay-1 {
  transition-delay: 0.05s;
}

.reveal-delay-2 {
  transition-delay: 0.1s;
}

.reveal-delay-3 {
  transition-delay: 0.15s;
}

.reveal-delay-4 {
  transition-delay: 0.2s;
}

.reveal-delay-5 {
  transition-delay: 0.25s;
}

.reveal-delay-6 {
  transition-delay: 0.3s;
}

/* ═══════════════════════════════════════════
   Image Shimmer (thin skeleton for <img>)
   ═══════════════════════════════════════════ */
img[data-shimmer] {
  position: relative;
  background: linear-gradient(90deg,
      var(--border) 25%,
      var(--surface) 50%,
      var(--border) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  color: transparent;
}

img[data-shimmer]:not(.shimmer-loaded) {
  visibility: hidden;
}

img[data-shimmer].shimmer-loaded {
  visibility: visible;
  animation: none;
  background: none;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

/* ═══════════════════════════════════════════
   Back to Top Button
   ═══════════════════════════════════════════ */
.back-to-top {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-soft);
  font-size: 1.15rem;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition:
    opacity 0.3s ease,
    visibility 0.3s ease,
    transform 0.3s ease,
    background-color 0.35s ease,
    color 0.35s ease,
    border-color 0.35s ease,
    box-shadow 0.35s ease;
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  transform: translateY(-3px);
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.18);
}

.back-to-top:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Admin back to top adjustment */
.admin-body .back-to-top {
  bottom: 1.5rem;
  right: 1.5rem;
}

@media (max-width: 560px) {
  .back-to-top {
    bottom: 1rem;
    right: 1rem;
    width: 42px;
    height: 42px;
    font-size: 1rem;
  }
}

body.is-loading {
  overflow: hidden !important;
  height: 100vh !important;
}

.page-skeleton {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.page-skeleton.skeleton-hidden {
  opacity: 0;
}

/* Shared shimmer */
.skeleton-block {
  border-radius: 10px;
  background: linear-gradient(90deg,
      var(--border) 25%,
      var(--surface) 50%,
      var(--border) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
}

@keyframes skeleton-shimmer {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

/* Nav skeleton */
.skeleton-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1120px, calc(100% - 2rem));
  height: 72px;
  padding-block: 1rem;
}

.skeleton-logo {
  width: 120px;
  height: 34px;
}

.skeleton-nav-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.skeleton-nav-link {
  width: 70px;
  height: 34px;
}

/* Hero skeleton */
.skeleton-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: min(700px, calc(100% - 2rem));
  padding-block: 4rem 3rem;
  gap: 1rem;
}

.skeleton-hero-eyebrow {
  width: 100px;
  height: 18px;
  margin-bottom: 0.5rem;
}

.skeleton-hero-title {
  width: 340px;
  height: 42px;
}

.skeleton-hero-role {
  width: 260px;
  height: 32px;
  margin-top: 0.25rem;
}

.skeleton-hero-text {
  width: 100%;
  height: 52px;
  margin-top: 0.5rem;
}

.skeleton-hero-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

.skeleton-hero-btn {
  width: 160px;
  height: 44px;
  border-radius: 12px;
}

/* Section skeleton */
.skeleton-section {
  width: min(1120px, calc(100% - 2rem));
  padding-block: 2rem;
}

.skeleton-section-title {
  width: 180px;
  height: 28px;
  margin-bottom: 1.5rem;
}

.skeleton-grid--3col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.skeleton-card {
  height: 200px;
}

.skeleton-card--tall {
  height: 280px;
}

/* Centered hero (models / IoT) */
.skeleton-hero--center {
  text-align: center;
}

.skeleton-hero-title--wide {
  width: 420px;
}

.skeleton-hero-text--short {
  width: 70%;
  height: 36px;
  margin-inline: auto;
}

/* Detail page skeleton */
.skeleton-hero-breadcrumb {
  width: 180px;
  height: 18px;
  margin-bottom: 0.25rem;
  align-self: flex-start;
}

.skeleton-detail-content {
  width: 100%;
  height: 400px;
}

/* Contact page skeleton */
.skeleton-contact {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.skeleton-contact-aside {
  height: 280px;
}

.skeleton-contact-form {
  height: 360px;
}

@media (max-width: 860px) {
  .skeleton-contact {
    grid-template-columns: 1fr;
  }

  .skeleton-contact-aside {
    height: 200px;
  }
}

@media (max-width: 760px) {
  .skeleton-grid--3col {
    grid-template-columns: repeat(2, 1fr);
  }

  .skeleton-hero-title,
  .skeleton-hero-title--wide {
    width: 260px;
    height: 36px;
  }

  .skeleton-hero-btn {
    width: 140px;
  }

  .skeleton-card--tall {
    height: 220px;
  }
}

/* ═══════════════════════════════════════════
   Offline Banner
   ═══════════════════════════════════════════ */
.offline-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 99998;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.7rem 1rem;
  background: #dc2626;
  color: #ffffff;
  font-size: 0.88rem;
  font-weight: 700;
  text-align: center;
  box-shadow: 0 4px 16px rgba(220, 38, 38, 0.3);
  transform: translateY(-100%);
  transition: transform 0.35s ease;
}

.offline-banner.is-visible {
  display: flex;
  transform: translateY(0);
}

.offline-banner i {
  font-size: 1rem;
  flex-shrink: 0;
}

[data-theme="dark"] .offline-banner {
  box-shadow: 0 4px 16px rgba(220, 38, 38, 0.5);
}

@media (max-width: 560px) {
  .offline-banner {
    font-size: 0.8rem;
    padding: 0.6rem 0.8rem;
  }
}

@media (max-width: 480px) {
  .skeleton-grid--3col {
    grid-template-columns: 1fr;
  }

  .skeleton-card--tall {
    height: 200px;
  }
}

/* Falling Physics Mode */
.falling-canvas-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.tech-grid.is-falling-mode {
  display: block !important;
  position: relative;
  height: 450px !important;
  min-height: 450px !important;
  user-select: none !important;
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
  -ms-user-select: none !important;
}

@media (max-width: 768px) {
  .tech-grid.is-falling-mode {
    height: 300px !important;
    min-height: 300px !important;
  }
}

@media (max-width: 480px) {
  .tech-grid.is-falling-mode {
    height: 250px !important;
    min-height: 250px !important;
  }
}

.tech-grid.is-falling-mode .tech-tile,
.tech-grid.is-falling-mode .tech-folder-card {
  display: none !important;
}

/* Falling Icon Clones - Premium Circular Badges */
.falling-icon-clone {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 80px !important;
  height: 80px !important;
  border-radius: 50% !important;
  background: var(--surface) !important;
  border: 1.5px solid var(--border) !important;
  box-shadow:
    0 8px 20px rgba(0, 0, 0, 0.08),
    0 2px 6px rgba(0, 0, 0, 0.04) !important;
  pointer-events: auto !important;
  cursor: grab !important;
  margin: 0 !important;
  user-select: none !important;
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
  -ms-user-select: none !important;
  touch-action: none !important;
  -webkit-user-drag: none !important;
}

/* Dark mode adjustments for premium look */
[data-theme="dark"] .falling-icon-clone {
  background: rgba(30, 41, 59, 0.8) !important;
  backdrop-filter: blur(8px) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  box-shadow:
    0 10px 25px rgba(0, 0, 0, 0.35),
    0 3px 10px rgba(0, 0, 0, 0.2) !important;
}

.falling-icon-clone:active {
  cursor: grabbing !important;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.15) !important;
  transform: translate(-50%, -50%) scale(1.05) !important;
}

[data-theme="dark"] .falling-icon-clone:active {
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.5) !important;
}

/* Icons inside the falling circular badges */
.falling-icon-clone .tech-icon-svg {
  width: 44px !important;
  height: 44px !important;
  max-width: 100% !important;
  max-height: 100% !important;
  pointer-events: none !important;
  user-select: none !important;
  -webkit-user-drag: none !important;
}

.falling-icon-clone i {
  font-size: 2.5rem !important;
  color: var(--accent-dark) !important;
  pointer-events: none !important;
  user-select: none !important;
}

/* Responsive adjustments for falling mode icons */
@media (max-width: 768px) {
  .falling-icon-clone {
    width: 64px !important;
    height: 64px !important;
    border-width: 1px !important;
  }

  .falling-icon-clone .tech-icon-svg {
    width: 34px !important;
    height: 34px !important;
  }

  .falling-icon-clone i {
    font-size: 1.85rem !important;
  }
}

@media (max-width: 480px) {
  .falling-icon-clone {
    width: 52px !important;
    height: 52px !important;
  }

  .falling-icon-clone .tech-icon-svg {
    width: 28px !important;
    height: 28px !important;
  }

  .falling-icon-clone i {
    font-size: 1.5rem !important;
  }
}

/* ═══════════════════════════════════════════
   SETTINGS BUTTON & DIALOG STYLES
   ═══════════════════════════════════════════ */

body.modal-open {
  overflow: hidden !important;
}

.settings-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-soft);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.settings-toggle-btn:hover {
  background: var(--border);
  color: var(--text);
  transform: scale(1.05) rotate(45deg);
}

.settings-toggle-btn:active {
  transform: scale(0.95) rotate(90deg);
}

[data-theme="dark"] .settings-toggle-btn {
  background: rgba(30, 41, 59, 0.8);
  border-color: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.8);
}

[data-theme="dark"] .settings-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

/* Settings Modal Dialog (Solid colors, no glassmorphism backdrop-filter) */
.settings-dialog {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: #ffffff;
  color: var(--text);
  padding: 0;
  max-width: 480px;
  width: 90%;
  max-height: 85vh;
  box-shadow: var(--shadow-md);
  box-sizing: border-box;
  overflow: hidden;
  display: none;
}

.settings-dialog[open] {
  display: block;
  animation: modalScaleIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.settings-dialog::backdrop {
  background: rgba(15, 23, 42, 0.45);
}

[data-theme="dark"] .settings-dialog {
  background: #1e293b;
  border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .settings-dialog::backdrop {
  background: rgba(0, 0, 0, 0.6);
}

@keyframes modalScaleIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(10px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.settings-dialog__wrapper {
  display: flex;
  flex-direction: column;
  max-height: 85vh;
  overflow: hidden;
}

.settings-dialog__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1.5px solid var(--border);
  padding: 24px 24px 14px 24px;
}

[data-theme="dark"] .settings-dialog__header {
  border-color: rgba(255, 255, 255, 0.08);
}

.settings-dialog__header h2 {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 700;
  font-family: var(--font-family, "Plus Jakarta Sans", "Inter", sans-serif);
}

.settings-dialog__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s ease;
  background: rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] .settings-dialog__close {
  background: rgba(255, 255, 255, 0.04);
}

.settings-dialog__close:hover {
  background: rgba(0, 0, 0, 0.08);
  color: var(--text);
  transform: scale(1.05);
}

[data-theme="dark"] .settings-dialog__close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.settings-dialog__content {
  display: block;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  padding: 20px 24px 24px 24px;
}

/* Settings Row Items */
.setting-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  gap: 16px;
  flex-shrink: 0;
}

.setting-item__info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.setting-item__title {
  font-weight: 600;
  color: var(--text);
}

.setting-item__desc {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.4;
}

/* Custom CSS Toggle Switch */
.switch-toggle {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
  flex-shrink: 0;
}

.switch-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-toggle__slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--border);
  transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 34px;
}

.switch-toggle__slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.15);
}

.switch-toggle input:checked+.switch-toggle__slider {
  background-color: var(--accent);
}

.switch-toggle input:checked+.switch-toggle__slider:before {
  transform: translateX(24px);
}

[data-theme="dark"] .switch-toggle__slider {
  background-color: #334155;
}

/* Warning Confirmation Panel */
.cursor-confirm-panel {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  margin-top: 0;
  padding: 0 16px;
  background: rgba(220, 38, 38, 0.06);
  border: 0 solid rgba(220, 38, 38, 0.15);
  border-radius: var(--radius-md);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cursor-confirm-panel.is-visible {
  max-height: 500px;
  margin-top: 10px;
  padding: 16px;
  border-width: 1px;
  opacity: 1;
}

.cursor-warning-box {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 12px;
  color: #dc2626;
  font-size: 0.85rem;
  line-height: 1.45;
}

[data-theme="dark"] .cursor-warning-box {
  color: #fca5a5;
}

.cursor-warning-box i {
  font-size: 1.1rem;
  margin-top: 2px;
}

.cursor-warning-box p {
  margin: 0;
}

.cursor-confirm-prompt {
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-top: 1px solid rgba(220, 38, 38, 0.15);
  padding-top: 10px;
}

.cursor-confirm-prompt p {
  margin: 0;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
}

.cursor-confirm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.btn-confirm {
  padding: 7px 15px;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-confirm--no {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-soft);
}

.btn-confirm--no:hover {
  background: var(--border);
  color: var(--text);
}

.btn-confirm--yes {
  background: #dc2626;
  color: white;
  border: none;
}

.btn-confirm--yes:hover {
  background: #b91c1c;
}

/* Language buttons inside settings dialog */
.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.55rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--text);
  transition: all 150ms ease;
  cursor: pointer;
}

.lang-btn:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.lang-btn.is-active {
  background: #0f172a;
  color: #fff;
}

[data-theme="dark"] .lang-btn.is-active {
  background: #3b82f6;
  color: #fff;
}

.lang-btn .lang-flag {
  display: inline-flex;
  line-height: 1;
}

/* Font buttons inside settings dialog */
.font-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.65rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  transition: all 150ms ease;
  cursor: pointer;
}

.font-btn:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.font-btn.is-active {
  background: #0f172a;
  color: #fff;
  border-color: #0f172a;
}

[data-theme="dark"] .font-btn.is-active {
  background: #3b82f6;
  color: #fff;
  border-color: #3b82f6;
}

/* ═══════════════════════════════════════════
   CUSTOM GLASS CURSOR STYLES (FLUIDGLASS)
   ═══════════════════════════════════════════ */

/* Native cursor is ALWAYS visible on top — glass effect just follows it */

/* Custom Cursor Wrapper (holds positioning — trails behind native cursor) */
.custom-glass-cursor-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  will-change: transform;
  transition: opacity 0.35s ease;
  opacity: 0;
}

.custom-glass-cursor-wrapper.is-active {
  opacity: 1;
}

.custom-glass-cursor-wrapper.is-hidden {
  opacity: 0 !important;
}

/* Lens — pure CSS liquid glass via SVG displacement + blur */
.custom-glass-cursor-lens {
  position: relative;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.03);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.1);

  backdrop-filter: url(#liquid-glass-filter) blur(1.5px) contrast(1.04);
  -webkit-backdrop-filter: url(#liquid-glass-filter) blur(1.5px) contrast(1.04);

  transition:
    width 0.4s cubic-bezier(0.25, 0.8, 0.25, 1),
    height 0.4s cubic-bezier(0.25, 0.8, 0.25, 1),
    border-radius 0.4s cubic-bezier(0.25, 0.8, 0.25, 1),
    border-color 0.3s ease,
    box-shadow 0.3s ease;
  overflow: hidden;

  border-radius: 50%;
  width: 72px;
  height: 72px;
}

[data-theme="dark"] .custom-glass-cursor-lens {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.04);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.25);
  backdrop-filter: url(#liquid-glass-filter) blur(1.5px) contrast(1.04);
  -webkit-backdrop-filter: url(#liquid-glass-filter) blur(1.5px) contrast(1.04);
}

/* ═══════════════════════════════════════════
   ELASTIC VOLUME SLIDER (settings modal)
   — React Bits ElasticSlider adaptation
   ═══════════════════════════════════════════ */

.sfx-volume-section {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  padding-left: 2px;
}

.sfx-volume-section.is-visible {
  max-height: 100px;
  opacity: 1;
  margin-top: 2px;
  margin-bottom: 4px;
}

.slider-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  width: 12rem;
  margin: 0.5rem auto 0;
  position: relative;
}

.slider-wrapper {
  display: flex;
  width: 100%;
  touch-action: none;
  user-select: none;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  will-change: transform, opacity;
}

.slider-root {
  position: relative;
  display: flex;
  width: 100%;
  max-width: 200px;
  flex-grow: 1;
  cursor: grab;
  touch-action: none;
  user-select: none;
  align-items: center;
  padding: 1rem 0;
}

.slider-root:active {
  cursor: grabbing;
}

.slider-track-wrapper {
  display: flex;
  flex-grow: 1;
  position: relative;
  height: 6px;
  border-radius: 9999px;
  will-change: transform, height, margin;
}

.slider-track {
  position: relative;
  height: 100%;
  flex-grow: 1;
  overflow: hidden;
  border-radius: 9999px;
  background-color: rgba(128, 128, 128, 0.4);
}

[data-theme="dark"] .slider-track {
  background-color: rgba(255, 255, 255, 0.16);
}

.slider-range {
  position: absolute;
  height: 100%;
  background-color: var(--accent);
  border-radius: 9999px;
}

.value-indicator {
  color: #808080;
  position: absolute;
  transform: translateY(-1rem);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

[data-theme="dark"] .value-indicator {
  color: #bbb;
}

.icon-container-left,
.icon-container-right {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  will-change: transform;
}

.icon {
  width: 24px;
  height: 24px;
  color: #888;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
  will-change: transform;
}

.icon.dark {
  color: #ddd;
}

[data-theme="dark"] .icon {
  color: #ddd;
}

/* Icon pulse/bounce animation on overflow */
.icon.is-bouncing {
  animation: iconBounce 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes iconBounce {
  0% {
    transform: scale(1);
  }

  40% {
    transform: scale(1.4);
  }

  100% {
    transform: scale(1);
  }
}

/* Custom Cursor Type Selection UI */
.cursor-type-selector {
  display: flex;
  gap: 8px;
  background: var(--bg);
  padding: 4px;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.cursor-type-btn {
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-soft);
  transition: all 200ms ease;
  background: transparent;
  border: none;
  cursor: pointer;
}

.cursor-type-btn:hover {
  color: var(--accent);
}

.cursor-type-btn.is-active {
  background: var(--surface);
  color: var(--accent-dark);
  box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .cursor-type-btn.is-active {
  background: #1e293b;
  color: #3b82f6;
}

/* TargetCursor styles */
.target-cursor-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  pointer-events: none;
  z-index: 999999;
  mix-blend-mode: difference;
  transform: translate(-50%, -50%);
}

.target-cursor-dot {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 4px;
  height: 4px;
  background: #fff;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  will-change: transform;
}

.target-cursor-corner {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 12px;
  height: 12px;
  border: 3px solid #fff;
  will-change: transform;
}

.corner-tl {
  transform: translate(-150%, -150%);
  border-right: none;
  border-bottom: none;
}

.corner-tr {
  transform: translate(50%, -150%);
  border-left: none;
  border-bottom: none;
}

.corner-br {
  transform: translate(50%, 50%);
  border-left: none;
  border-top: none;
}

.corner-bl {
  transform: translate(-150%, 50%);
  border-right: none;
  border-top: none;
}

/* Hobby section styling */

.galeri-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 32px;
}

@media (max-width: 992px) {
  .galeri-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
}

@media (max-width: 576px) {
  .galeri-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
}

.hobby-card {
  position: relative;
  width: 100%;
  padding-top: 100%;
  /* 1:1 Aspect Ratio (Square) */
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid var(--border);
  cursor: pointer;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

.hobby-card:hover {
  box-shadow: var(--shadow-md);
}

.hobby-thumb {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.hobby-thumb img,
.hobby-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.hobby-card:hover img,
.hobby-card:hover video {
  transform: scale(1.05);
}

.hobby-media-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  color: #ffffff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  pointer-events: none;
  z-index: 2;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.hobby-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  opacity: 0;
  transition: opacity 0.3s ease;
  color: #ffffff;
  font-weight: 600;
  font-size: 1.15rem;
  z-index: 3;
}

.hobby-card:hover .hobby-overlay {
  opacity: 1;
}

.hobby-stat {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hobby-stat i {
  font-size: 1.25rem;
}

/* Lightbox Modal styling */
.hobby-detail-modal {
  border: none;
  border-radius: 16px;
  padding: 0;
  max-width: 960px;
  width: 90%;
  max-height: 90vh;
  background: transparent;
  color: var(--text);
  box-shadow: none;
  overflow: visible;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  opacity: 0;
  transition:
    transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
    opacity 0.3s ease;
  margin: 0;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

/* Pastikan dialog benar-benar tersembunyi saat tidak open */
.hobby-detail-modal:not([open]) {
  display: none !important;
}

.hobby-detail-modal[open] {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}

.hobby-detail-modal::backdrop {
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.hobby-detail-modal[open]::backdrop {
  opacity: 1;
}

[data-theme="dark"] .hobby-modal-container {
  background: #1e293b;
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
}

.hobby-modal-container {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  box-sizing: border-box;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.25);
  overflow: hidden;
}

.hobby-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  color: #ffffff;
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition:
    background 0.2s ease,
    transform 0.2s ease;
}

.hobby-modal-close:hover {
  background: var(--accent);
  transform: scale(1.1);
  color: #ffffff;
}

.hobby-modal-body {
  display: flex;
  flex-direction: row;
  min-height: 500px;
  max-height: 80vh;
  flex-grow: 1;
  box-sizing: border-box;
}

@media (max-width: 768px) {
  .hobby-detail-modal {
    width: 95%;
    max-height: 90vh;
  }

  .hobby-modal-body {
    flex-direction: column;
    min-height: auto;
    max-height: 90vh;
    overflow-y: auto;
  }

  .hobby-modal-media {
    flex: none;
    height: 300px;
    min-height: 300px;
    width: 100%;
  }

  .hobby-modal-info {
    flex: none;
    width: 100%;
  }
}

.hobby-modal-media {
  flex: 1.25;
  background: #090d16;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  min-height: 380px;
}

.hobby-modal-media img,
.hobby-modal-media video {
  width: 100%;
  height: 100%;
  max-height: 80vh;
  object-fit: contain;
  display: block;
}

@media (max-width: 768px) {
  .hobby-modal-media {
    flex: none;
    min-height: 280px;
  }

  .hobby-modal-media img,
  .hobby-modal-media video {
    max-height: 45vh;
  }
}

.video-mute-overlay {
  position: absolute;
  bottom: 16px;
  right: 16px;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  color: #ffffff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
  font-size: 0.95rem;
  transition:
    background 0.2s ease,
    transform 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.video-mute-overlay:hover {
  background: rgba(15, 23, 42, 0.8);
  transform: scale(1.1);
}

.hobby-modal-info {
  flex: 0.75;
  padding: 32px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-left: 1px solid var(--border);
  box-sizing: border-box;
  background: var(--bg);
}

@media (max-width: 768px) {
  .hobby-modal-info {
    flex: none;
    border-left: none;
    border-top: 1px solid var(--border);
    padding: 24px;
  }
}

.hobby-modal-header {
  border-bottom: 1px solid var(--border);
  padding-bottom: 16px;
  margin-bottom: 16px;
}

.hobby-modal-header h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0 0 6px 0;
  font-family: "Plus Jakarta Sans", sans-serif;
  color: var(--text);
}

.hobby-modal-date {
  font-size: 0.85rem;
  color: var(--text-soft);
  display: block;
}

.hobby-modal-desc-container {
  overflow-y: auto;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-soft);
  max-height: 250px;
}

.hobby-modal-actions-panel {
  border-top: 1.5px solid var(--border);
  padding-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.hobby-modal-stats {
  display: flex;
  gap: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stat-item i {
  color: var(--accent);
}

.btn-like-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.95rem;
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: all 0.25s ease;
  font-family: "Inter", sans-serif;
}

.btn-like-toggle:hover {
  background: rgba(239, 68, 68, 0.05);
  border-color: #ef4444;
  color: #ef4444;
}

.btn-like-toggle.is-liked {
  background: #ef4444;
  border-color: #ef4444;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-like-toggle:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ═══ Stats Heart Liked State (new like via media click) ═══ */
.stat-like.is-liked i {
  color: #ef4444 !important;
}

/* ═══════════════════════════════════════════
   IMAGE TAGGING STYLES
   ═══════════════════════════════════════════ */
.user-tag-toggle {
  position: absolute;
  bottom: 16px;
  left: 16px;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  color: #ffffff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  font-size: 0.95rem;
  transition: background 0.2s ease, transform 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.user-tag-toggle:hover {
  background: rgba(15, 23, 42, 0.8);
  transform: scale(1.1);
}

.frontend-bubble-tag {
  position: absolute;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  color: #ffffff;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  transform: translate(-50%, -50%) scale(0.95);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 15;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.frontend-bubble-tag::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px 6px 0;
  border-style: solid;
  border-color: rgba(0, 0, 0, 0.8) transparent transparent transparent;
}

.swiper-slide.show-tags .frontend-bubble-tag {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

/* Prevent image dragging and text selection when spam clicking */
.hobby-swiper .swiper-slide {
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

.hobby-swiper .swiper-slide img,
.hobby-swiper .swiper-slide video {
  -webkit-user-drag: none;
  user-select: none;
  -webkit-user-select: none;
}

/* Instagram Double Tap Heart Animation */
.ig-heart-animation {
  position: absolute;
  color: #ef4444;
  font-size: 80px;
  transform: translate(-50%, -50%) scale(0);
  opacity: 0;
  z-index: 100;
  pointer-events: none;
  animation: igHeartPopup 1s ease-in-out forwards;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.3));
}

@keyframes igHeartPopup {
  0% {
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
  }

  15% {
    transform: translate(-50%, -50%) scale(1.2);
    opacity: 0.9;
  }

  30% {
    transform: translate(-50%, -50%) scale(0.95);
    opacity: 1;
  }

  45% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }

  80% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }

  100% {
    transform: translate(-50%, -50%) scale(1.3);
    opacity: 0;
  }
}

.stat-like {
  cursor: pointer;
  transition: transform 0.2s ease;
}

.stat-like:active {
  transform: scale(0.9);
}

/* ═══ Floating Heart Burst Animation ═══ */
.like-heart-burst {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 80px;
  height: 80px;
  margin-left: -40px;
  margin-top: -40px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  pointer-events: none;
  animation: heartBurst 0.8s ease-out forwards;
}

.like-heart-burst i {
  font-size: 4rem;
  color: #ef4444;
  filter: drop-shadow(0 4px 12px rgba(239, 68, 68, 0.5));
}

@keyframes heartBurst {
  0% {
    transform: scale(0.3);
    opacity: 1;
  }

  25% {
    transform: scale(1.3);
    opacity: 1;
  }

  50% {
    transform: scale(1);
    opacity: 0.9;
  }

  100% {
    transform: scale(1.5);
    opacity: 0;
  }
}

/* ═══ Hobby Swiper Styling ═══ */
.hobby-swiper {
  width: 100%;
  height: 100%;
}

.hobby-swiper .swiper-slide {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #000;
}

.hobby-swiper img,
.hobby-swiper video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.hobby-swiper .swiper-button-next,
.hobby-swiper .swiper-button-prev {
  color: rgba(255, 255, 255, 0.8);
  background: rgba(0, 0, 0, 0.3);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  transition: all 0.2s;
}

.hobby-swiper .swiper-button-next:after,
.hobby-swiper .swiper-button-prev:after {
  font-size: 1.2rem;
  font-weight: bold;
}

.hobby-swiper .swiper-button-next:hover,
.hobby-swiper .swiper-button-prev:hover {
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
}

.hobby-swiper .swiper-pagination-bullet {
  background: #fff;
  opacity: 0.5;
}

.hobby-swiper .swiper-pagination-bullet-active {
  opacity: 1;
  background: var(--primary);
}

.hobby-modal-desc-container {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-soft);
  margin-bottom: 25px;
}

.read-more-btn {
  background: transparent;
  border: none;
  color: var(--text-soft);
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  margin-left: 5px;
}

.read-more-btn:hover {
  text-decoration: underline;
  color: var(--text);
}

/* Prevent drag/select on gallery modal */
.hobby-modal-slider .swiper-slide img,
.hobby-modal-slider .swiper-slide video {
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  touch-action: manipulation;
}

/* Video Gallery UX Enhancements */
.hobby-swiper video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.video-loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 15;
  color: #fff;
  backdrop-filter: blur(4px);
  border-radius: 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}


.video-loading-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.video-loading-overlay .spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spinner-spin 1s linear infinite;
  margin-bottom: 10px;
}

.video-loading-overlay .loading-percentage {
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 1px;
}

@keyframes spinner-spin {
  to {
    transform: rotate(360deg);
  }
}

.video-play-pause-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  width: 60px;
  height: 60px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.5rem;
  z-index: 20;
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), background 0.3s ease;
}

.video-play-pause-overlay.show {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.video-play-pause-overlay:hover {
  background: rgba(0, 0, 0, 0.7);
  transform: translate(-50%, -50%) scale(1.1);
}

.video-countdown-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  color: #ffffff;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  z-index: 10;
  font-family: monospace, sans-serif;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.video-countdown-badge.show {
  opacity: 1;
}

.ai-caption-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
  border: 1px solid rgba(59, 130, 246, 0.2);
  padding: 6px 12px;
  border-radius: 12px;
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 14px;
  width: fit-content;
  font-family: "Plus Jakarta Sans", sans-serif;
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.05);
}

[data-theme="dark"] .ai-caption-badge {
  background: rgba(96, 165, 250, 0.15);
  color: #60a5fa;
  border-color: rgba(96, 165, 250, 0.3);
}

.hobby-modal-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  border: none;
  color: #ffffff;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  cursor: pointer;
  z-index: 100;
  transition: background 0.2s, transform 0.2s, opacity 0.2s;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.hobby-modal-prev {
  left: -70px;
}

.hobby-modal-next {
  right: -70px;
}

.hobby-modal-nav:hover {
  background: var(--accent);
  transform: translateY(-50%) scale(1.1);
  color: #ffffff;
}

.hobby-modal-nav:active {
  transform: translateY(-50%) scale(0.95);
}

@media (max-width: 1100px) {
  .hobby-modal-prev {
    left: 10px;
  }

  .hobby-modal-next {
    right: 10px;
  }
}

@media (max-width: 768px) {
  .hobby-modal-nav {
    display: none !important;
  }
}

/* ═══════════════════════════════════════════
   AI Summary Feature
   ═══════════════════════════════════════════ */
.summary-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.summary-modal.is-open {
  opacity: 1;
  visibility: visible;
}

.summary-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: none;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.summary-modal-panel {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 700px;
  max-height: calc(100vh - 3rem);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-md);
  transform: translateY(20px) scale(0.95);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.summary-modal.is-open .summary-modal-panel {
  transform: translateY(0) scale(1);
}

.summary-modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg);
}

.summary-modal-header h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  display: flex;
  align-items: center;
}

.summary-modal-close {
  background: transparent;
  border: none;
  color: var(--text-soft);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.summary-modal-close:hover {
  background: var(--bg-hover);
  color: var(--danger);
}

.summary-modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
  font-size: 1.05rem;
  line-height: 1.7;
}

.summary-modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  background: var(--bg);
}
.video-countdown-badge {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.85rem;
  z-index: 10;
  font-family: monospace, sans-serif;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.video-countdown-badge.show {
  opacity: 1;
}

.ai-caption-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
  border: 1px solid rgba(59, 130, 246, 0.2);
  padding: 6px 12px;
  border-radius: 12px;
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 14px;
  width: fit-content;
  font-family: "Plus Jakarta Sans", sans-serif;
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.05);
}

[data-theme="dark"] .ai-caption-badge {
  background: rgba(96, 165, 250, 0.15);
  color: #60a5fa;
  border-color: rgba(96, 165, 250, 0.3);
}

.hobby-modal-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  border: none;
  color: #ffffff;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  cursor: pointer;
  z-index: 100;
  transition: background 0.2s, transform 0.2s, opacity 0.2s;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.hobby-modal-prev {
  left: -70px;
}

.hobby-modal-next {
  right: -70px;
}

.hobby-modal-nav:hover {
  background: var(--accent);
  transform: translateY(-50%) scale(1.1);
  color: #ffffff;
}

.hobby-modal-nav:active {
  transform: translateY(-50%) scale(0.95);
}

@media (max-width: 1100px) {
  .hobby-modal-prev {
    left: 10px;
  }

  .hobby-modal-next {
    right: 10px;
  }
}

@media (max-width: 768px) {
  .hobby-modal-nav {
    display: none !important;
  }
}

/* ═══════════════════════════════════════════
   AI Summary Feature
   ═══════════════════════════════════════════ */
.summary-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.summary-modal.is-open {
  opacity: 1;
  visibility: visible;
}

.summary-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: none;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.summary-modal-panel {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 700px;
  max-height: calc(100vh - 3rem);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-md);
  transform: translateY(20px) scale(0.95);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.summary-modal.is-open .summary-modal-panel {
  transform: translateY(0) scale(1);
}

.summary-modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg);
}

.summary-modal-header h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  display: flex;
  align-items: center;
}

.summary-modal-close {
  background: transparent;
  border: none;
  color: var(--text-soft);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.summary-modal-close:hover {
  background: var(--bg-hover);
  color: var(--danger);
}

.summary-modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
  font-size: 1.05rem;
  line-height: 1.7;
}

.summary-modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  background: var(--bg);
}

.btn-summary {
  position: relative;
  overflow: hidden;
}

.btn-summary:disabled {
  opacity: 0.8;
  cursor: not-allowed;
}

.summary-modal-body ul {
  list-style: none;
  padding-left: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
}

.summary-modal-body ul li {
  position: relative;
  background: transparent;
  padding: 0.25rem 0 0.25rem 2.75rem;
  border: none;
  border-radius: 0;
}

.summary-modal-body ul li>i {
  position: absolute;
  left: 0;
  top: 0.35rem;
  color: var(--accent);
  font-size: 1.25rem;
  width: 2.25rem;
  text-align: left;
}

.summary-modal-body ul li strong {
  display: block;
  margin-bottom: 0.45rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
}

.summary-flash-msg {
  display: inline-flex;
  align-items: center;
  margin-left: 1rem;
  padding: 0.5rem 0.85rem;
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger, #ef4444);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius-sm, 6px);
  font-size: 0.9rem;
  font-weight: 500;
  opacity: 1;
  transition: opacity 0.3s ease;
  vertical-align: middle;
}

.summary-flash-msg.fade-out {
  opacity: 0;
}
