/* themes/modern/styles.css — v2 (ported from v1, using --portfolio-* vars) */

/* Modern Theme - Pure Styling
*
* Uses Google Fonts (Inter) and system fonts.
* All styling, no embedded content assets.
*/

/* Modern Theme - Sleek dark aesthetic with vibrant accents */

/* ============================================================================
BACKGROUND
============================================================================ */

:where(html[data-theme="modern"] .portfolio-root, .portfolio-root[data-theme="modern"]) {
  --modern-surface: color-mix(
    in srgb,
    var(--portfolio-bg, #111111) 94%,
    var(--portfolio-text, #ffffff) 6%
  );
  --modern-header-bg: color-mix(in srgb, var(--portfolio-bg, #111111) 80%, transparent);
  --modern-border: color-mix(in srgb, var(--portfolio-text, #ffffff) 14%, transparent);
  --modern-header-border: color-mix(
    in srgb,
    var(--portfolio-text, #ffffff) 8%,
    transparent
  );
  --modern-muted: color-mix(in srgb, var(--portfolio-text, #ffffff) 64%, transparent);
  --modern-muted-soft: color-mix(
    in srgb,
    var(--portfolio-text, #ffffff) 44%,
    transparent
  );
  --modern-overlay-soft: color-mix(
    in srgb,
    var(--portfolio-text, #ffffff) 5%,
    transparent
  );
  --modern-overlay: color-mix(in srgb, var(--portfolio-text, #ffffff) 10%, transparent);
  --modern-overlay-strong: color-mix(
    in srgb,
    var(--portfolio-text, #ffffff) 15%,
    transparent
  );
  --modern-accent-soft: color-mix(
    in srgb,
    var(--portfolio-accent, #3b82f6) 10%,
    transparent
  );
  --modern-accent-medium: color-mix(
    in srgb,
    var(--portfolio-accent, #3b82f6) 20%,
    transparent
  );
  --modern-accent-glow: color-mix(
    in srgb,
    var(--portfolio-accent, #3b82f6) 30%,
    transparent
  );
  --modern-link-hover: color-mix(
    in srgb,
    var(--portfolio-link, #3b82f6) 70%,
    var(--portfolio-text, #ffffff) 30%
  );
  --modern-shadow-soft: color-mix(in srgb, var(--portfolio-bg, #111111) 35%, transparent);
  --modern-shadow: color-mix(in srgb, var(--portfolio-bg, #111111) 55%, transparent);
  background-color: var(--portfolio-bg, #111111);
  min-height: 100vh;
  color: var(--portfolio-text, #ffffff);
  font-family: var(--portfolio-body-font, "Inter", system-ui, sans-serif);
  letter-spacing: -0.01em;
  line-height: 1.6;
}

:where(html[data-theme="modern"] .portfolio-root, .portfolio-root[data-theme="modern"])
  .theme-mode-toggle {
  position: fixed;
  top: 14px;
  right: 20px;
  z-index: 1002;
  display: inline-flex;
  height: 28px;
  width: 28px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--modern-header-border);
  border-radius: 999px;
  background: var(--modern-header-bg);
  color: var(--portfolio-text, #ffffff);
  font-size: 0;
  line-height: 1;
  overflow: hidden;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
}

:where(html[data-theme="modern"] .portfolio-root, .portfolio-root[data-theme="modern"])
  .theme-mode-toggle:hover {
  background: var(--modern-overlay);
  border-color: var(--modern-border);
}

:where(html[data-theme="modern"] .portfolio-root, .portfolio-root[data-theme="modern"])
  .theme-mode-toggle-icon {
  width: 12px;
  height: 12px;
}

:where(html[data-theme="modern"] .portfolio-root, .portfolio-root[data-theme="modern"])
  .theme-mode-toggle-label {
  display: none;
}

.portfolio-root[data-theme="modern"][data-theme-mode="dark"]
  .theme-mode-toggle-icon-light,
.portfolio-root[data-theme="modern"][data-theme-mode="light"]
  .theme-mode-toggle-icon-dark {
  display: none;
}

@media (max-width: 640px) {
  :where(html[data-theme="modern"] .portfolio-root, .portfolio-root[data-theme="modern"])
    .theme-mode-toggle {
    right: 56px;
  }
}

/* Static export: hide mobile nav trigger above sm breakpoint */
:where(html[data-theme="modern"] .portfolio-root, .portfolio-root[data-theme="modern"])
  button[aria-label="Open navigation"] {
  display: none;
}

@media (max-width: 640px) {
  :where(html[data-theme="modern"] .portfolio-root, .portfolio-root[data-theme="modern"])
    button[aria-label="Open navigation"] {
    display: block;
  }

  :where(html[data-theme="modern"] .portfolio-root, .portfolio-root[data-theme="modern"])
    .nav-bar {
    display: none;
  }
}

/* ============================================================================
HEADER / LOGO
============================================================================ */

.header-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: 60px;
  background: var(--modern-header-bg);
  border-bottom: 1px solid var(--modern-header-border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

@media (max-width: 720px) {
  .header-container {
    height: 56px;
  }
}

.logo-link {
  position: absolute;
  top: 15px;
  left: 20px;
  z-index: 1001;
  display: block;
  border: none;
  transition: opacity 0.2s ease;
}

.logo-link:hover {
  border: none;
  opacity: 0.8;
}

.logo-image {
  display: block;
  height: auto;
  width: 120px;
  max-height: 70px;
}

.logo-text {
  font-family: var(--portfolio-heading-font, "Inter", sans-serif);
  font-weight: 500;
  font-size: 0.875rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--portfolio-text, #ffffff);
}

@media (max-width: 720px) {
  .logo-link {
    left: 20px;
    transform: none;
    top: 12px;
  }
  .logo-image {
    width: 80px;
    max-height: 26px;
  }

  .logo-text {
    font-size: 0.75rem;
  }
}

/* ============================================================================
NAVIGATION BAR
============================================================================ */

.nav-bar {
  position: relative;
  width: 100%;
  height: 60px;
  line-height: 60px;
  background: transparent;
  display: flex;
  justify-content: center;
  padding: 0 20px;
}

.nav-items {
  display: flex;
  height: 100%;
  align-items: center;
  gap: 8px;
}

.portfolio-root .nav-item {
  height: auto;
  line-height: 1;
  padding: 10px 20px;
  color: var(--modern-muted);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  border: none;
}

.portfolio-root .nav-item:hover {
  color: var(--portfolio-text, #ffffff);
  background: var(--modern-overlay);
  border: none;
}

.portfolio-root .nav-item.active {
  color: var(--portfolio-on-accent, #ffffff);
  background: var(--portfolio-accent, #3b82f6);
}

@media (max-width: 720px) {
  .nav-bar {
    height: 50px;
    line-height: 50px;
    justify-content: flex-end;
  }
  .nav-items {
    gap: 4px;
  }
  .portfolio-root .nav-item {
    font-size: 11px;
    padding: 8px 12px;
  }
}

/* Header spacer */

.header-spacer {
  height: 60px;
}

@media (max-width: 720px) {
  .header-spacer {
    height: 56px;
  }
}

html[data-theme="modern"] {
  scroll-padding-top: 60px;
}

@media (max-width: 720px) {
  html[data-theme="modern"] {
    scroll-padding-top: 56px;
  }
}

/* ============================================================================
CONTENT AREA
============================================================================ */

.gallery-container {
  box-sizing: border-box;
  width: min(100%, var(--max-content-width, 1800px));
  max-width: var(--max-content-width, 1800px);
  margin-left: auto;
  margin-right: auto;
  padding-top: 80px;
  padding-left: 40px;
  padding-right: 40px;
  padding-bottom: 60px;
}

.justified-gallery {
  box-sizing: border-box;
  width: min(100%, var(--max-content-width, 1800px));
  max-width: var(--max-content-width, 1800px);
  margin-left: auto;
  margin-right: auto;
  padding-top: 80px;
  padding-left: 40px;
  padding-right: 40px;
  padding-bottom: 60px;
  font-size: 0;
  line-height: 0;
  text-align: left;
}

.gallery-ssr-fallback {
  box-sizing: border-box;
  width: min(100%, var(--max-content-width, 1800px));
  max-width: var(--max-content-width, 1800px);
  margin-left: auto;
  margin-right: auto;
}

@media (max-width: 720px) {
  .gallery-container,
  .justified-gallery {
    padding: 30px 16px 40px 16px;
  }
}

/* About page */

.portfolio-root[data-theme="modern"] .about-page {
  box-sizing: border-box;
  width: min(100%, 1120px);
  max-width: none;
  margin: 0 auto;
  padding: clamp(72px, 7vw, 96px) 40px clamp(88px, 8vw, 112px);
}

.portfolio-root[data-theme="modern"] .about-title {
  margin: 0 0 clamp(32px, 4vw, 48px);
  font-size: clamp(3rem, 2.4rem + 2vw, 5rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
}

.portfolio-root[data-theme="modern"] .about-content {
  max-width: none;
  margin: 0;
}

.portfolio-root[data-theme="modern"] .about-content--with-photo {
  display: grid;
  grid-template-columns: minmax(320px, 1.45fr) minmax(260px, 0.75fr);
  gap: clamp(48px, 6vw, 96px);
  align-items: center;
}

.portfolio-root[data-theme="modern"]
  .about-content--with-photo[data-content-amount="medium"],
.portfolio-root[data-theme="modern"]
  .about-content--with-photo[data-content-amount="long"] {
  align-items: start;
}

.portfolio-root[data-theme="modern"]
  .about-content--with-photo[data-content-amount="medium"] {
  grid-template-columns: minmax(320px, 1.25fr) minmax(320px, 0.9fr);
}

.portfolio-root[data-theme="modern"]
  .about-content--with-photo[data-content-amount="long"] {
  grid-template-columns: minmax(280px, 0.95fr) minmax(360px, 1fr);
}

.portfolio-root[data-theme="modern"] .about-content--text-only {
  max-width: 720px;
  margin: 0 auto;
}

.portfolio-root[data-theme="modern"] .about-photo-wrapper {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
}

.portfolio-root[data-theme="modern"] .about-photo {
  width: 100%;
  max-width: none;
  max-height: min(52vh, 440px);
  object-fit: cover;
  border-radius: 8px;
}

.portfolio-root[data-theme="modern"] .about-photo-caption {
  margin-top: 12px;
  color: color-mix(in srgb, var(--portfolio-text, #ffffff) 18%, transparent);
  font-size: 14px;
}

.portfolio-root[data-theme="modern"] .about-text,
.portfolio-root[data-theme="modern"] .prose-portfolio {
  max-width: 46ch;
  color: var(--portfolio-text, #ffffff);
  font-size: clamp(1.0625rem, 1rem + 0.32vw, 1.28rem);
  line-height: 1.7;
}

.portfolio-root[data-theme="modern"] .prose-portfolio p {
  margin-bottom: 1.05em;
}

.portfolio-root[data-theme="modern"] .prose-portfolio h2 {
  margin: 1.9em 0 0.5em;
  color: var(--portfolio-text, #ffffff);
  font-family: var(--portfolio-heading-font, "Inter", sans-serif);
  font-size: clamp(1.32rem, 1.12rem + 0.55vw, 1.7rem);
  font-weight: 650;
  line-height: 1.18;
  letter-spacing: -0.018em;
}

.portfolio-root[data-theme="modern"] .prose-portfolio h3 {
  margin: 1.65em 0 0.45em;
  color: var(--portfolio-text, #ffffff);
  font-family: var(--portfolio-heading-font, "Inter", sans-serif);
  font-size: clamp(1.12rem, 1rem + 0.3vw, 1.35rem);
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.portfolio-root[data-theme="modern"] .prose-portfolio > h2:first-child,
.portfolio-root[data-theme="modern"] .prose-portfolio > h3:first-child {
  margin-top: 0;
}

.portfolio-root[data-theme="modern"] .prose-portfolio ul,
.portfolio-root[data-theme="modern"] .prose-portfolio ol {
  margin: 0 0 1.15em;
  padding-left: 1.35em;
}

.portfolio-root[data-theme="modern"] .prose-portfolio li {
  margin-bottom: 0.4em;
  padding-left: 0.1em;
}

.portfolio-root[data-theme="modern"] .prose-portfolio > :last-child {
  margin-bottom: 0;
}

.portfolio-root[data-theme="modern"]
  .about-content--with-photo[data-content-amount="short"]
  .prose-portfolio
  > p:first-child,
.portfolio-root[data-theme="modern"]
  .about-content--with-photo[data-content-amount="medium"]
  .prose-portfolio
  > p:first-child {
  margin-bottom: 1em;
  font-weight: 500;
  letter-spacing: -0.025em;
}

.portfolio-root[data-theme="modern"]
  .about-content--with-photo[data-content-amount="short"]
  .prose-portfolio
  > p:first-child {
  max-width: 34ch;
  font-size: clamp(1.55rem, 1.2rem + 1.1vw, 2.35rem);
  line-height: 1.3;
}

.portfolio-root[data-theme="modern"]
  .about-content--with-photo[data-content-amount="medium"]
  .prose-portfolio
  > p:first-child {
  max-width: 38ch;
  font-size: clamp(1.24rem, 1.08rem + 0.55vw, 1.58rem);
  line-height: 1.45;
}

.portfolio-root[data-theme="modern"]
  .about-content[data-content-amount="long"]
  .about-text,
.portfolio-root[data-theme="modern"]
  .about-content[data-content-amount="long"]
  .prose-portfolio {
  max-width: 56ch;
  font-size: clamp(1.0625rem, 1rem + 0.25vw, 1.25rem);
  line-height: 1.75;
}

@media (min-width: 641px) and (max-width: 1180px) {
  .portfolio-root[data-theme="modern"][data-nav-layout="side"] .about-page {
    width: min(100%, calc(100vw - 240px));
    padding-inline: clamp(24px, 4vw, 40px);
  }

  .portfolio-root[data-theme="modern"][data-nav-layout="side"]
    .about-content--with-photo {
    grid-template-columns: 1fr;
    gap: 32px;
    justify-items: center;
  }

  .portfolio-root[data-theme="modern"][data-nav-layout="side"] .about-photo-wrapper {
    width: min(100%, 640px);
  }

  .portfolio-root[data-theme="modern"][data-nav-layout="side"] .about-photo {
    max-height: none;
  }

  .portfolio-root[data-theme="modern"][data-nav-layout="side"] .about-text,
  .portfolio-root[data-theme="modern"][data-nav-layout="side"] .prose-portfolio {
    width: min(100%, 48ch);
  }

  .portfolio-root[data-theme="modern"][data-nav-layout="side"]
    .about-content[data-content-amount="long"]
    .about-text,
  .portfolio-root[data-theme="modern"][data-nav-layout="side"]
    .about-content[data-content-amount="long"]
    .prose-portfolio {
    width: min(100%, 56ch);
  }
}

@media (max-width: 720px) {
  .portfolio-root[data-theme="modern"] .about-page {
    padding: 64px 8px 64px;
  }

  .portfolio-root[data-theme="modern"] .about-title {
    margin-bottom: 32px;
    font-size: clamp(2.35rem, 2.05rem + 1vw, 2.9rem);
  }

  .portfolio-root[data-theme="modern"] .about-content--with-photo {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .portfolio-root[data-theme="modern"]
    .about-content--with-photo[data-content-amount="medium"],
  .portfolio-root[data-theme="modern"]
    .about-content--with-photo[data-content-amount="long"] {
    grid-template-columns: 1fr;
  }

  .portfolio-root[data-theme="modern"] .about-photo-wrapper {
    align-items: center;
  }

  .portfolio-root[data-theme="modern"] .about-photo {
    width: min(100%, 320px);
    max-height: none;
    margin: 0 auto;
  }

  .portfolio-root[data-theme="modern"] .about-photo-caption {
    width: min(100%, 320px);
    margin-inline: auto;
  }

  .portfolio-root[data-theme="modern"] .about-text,
  .portfolio-root[data-theme="modern"] .prose-portfolio {
    max-width: 100%;
    font-size: 1.0625rem;
    line-height: 1.65;
  }

  .portfolio-root[data-theme="modern"] .prose-portfolio h2 {
    margin-top: 1.65em;
    font-size: 1.28rem;
    line-height: 1.22;
  }

  .portfolio-root[data-theme="modern"] .prose-portfolio h3 {
    margin-top: 1.5em;
    font-size: 1.12rem;
  }

  .portfolio-root[data-theme="modern"]
    .about-content--with-photo[data-content-amount="short"]
    .prose-portfolio
    > p:first-child,
  .portfolio-root[data-theme="modern"]
    .about-content--with-photo[data-content-amount="medium"]
    .prose-portfolio
    > p:first-child {
    max-width: none;
    font-size: inherit;
    line-height: inherit;
  }
}

/* Custom page */

.custom-page {
  --custom-page-gap: 3rem;
  --custom-page-title-size: 2.2rem;
  --custom-page-title-spacing: 0.08em;
  --custom-page-image-radius: 10px;
  --custom-page-image-shadow: 0 10px 30px var(--modern-shadow-soft);
  --custom-page-caption-color: var(--modern-muted);
  --custom-page-media-width: 42%;
}

.custom-page-content {
  padding-top: 100px;
  padding-bottom: 100px;
  max-width: 900px;
  margin: 0 auto;
}

.portfolio-root[data-theme="modern"] .custom-page:not(.legal-page) .custom-page-content {
  width: min(100%, 760px);
  max-width: 760px;
  padding-block: clamp(72px, 8vw, 120px) clamp(88px, 9vw, 128px);
}

.portfolio-root[data-theme="modern"] .custom-page:not(.legal-page) .custom-page-title {
  margin-bottom: clamp(28px, 4vw, 44px);
  color: var(--portfolio-text, #ffffff);
  font-family: var(--portfolio-heading-font, "Inter", sans-serif);
  font-size: clamp(2.5rem, 2rem + 1.6vw, 4rem);
  font-weight: 650;
  line-height: 1.02;
  letter-spacing: -0.035em;
}

.portfolio-root[data-theme="modern"] .custom-page:not(.legal-page) .custom-page-hero {
  margin-bottom: clamp(32px, 5vw, 48px);
}

.portfolio-root[data-theme="modern"] .legal-page-content {
  width: min(100%, 760px);
  max-width: 760px;
  padding-block: clamp(84px, 8vw, 132px) clamp(96px, 10vw, 144px);
}

.portfolio-root[data-theme="modern"] .legal-page .custom-page-title {
  max-width: 12ch;
  margin-bottom: clamp(36px, 5vw, 56px);
  color: var(--portfolio-text, #ffffff);
  font-family: var(--portfolio-heading-font, "Inter", sans-serif);
  font-size: clamp(2.25rem, 1.75rem + 1.6vw, 3.5rem);
  font-weight: 650;
  line-height: 1;
  letter-spacing: 0;
}

.portfolio-root[data-theme="modern"] .legal-page .prose-portfolio {
  width: 100%;
  max-width: none;
  color: color-mix(in srgb, var(--portfolio-text, #ffffff) 78%, transparent);
  font-size: clamp(1rem, 0.96rem + 0.12vw, 1.0625rem);
  line-height: 1.78;
  letter-spacing: 0;
}

.portfolio-root[data-theme="modern"] .legal-page .prose-portfolio h2 {
  margin: 2.8rem 0 0.8rem;
  color: var(--portfolio-text, #ffffff);
  font-family: var(--portfolio-heading-font, "Inter", sans-serif);
  font-size: clamp(1.125rem, 1.05rem + 0.32vw, 1.35rem);
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: 0;
}

.portfolio-root[data-theme="modern"] .legal-page .prose-portfolio h3 {
  margin: 2rem 0 0.65rem;
  color: color-mix(in srgb, var(--portfolio-text, #ffffff) 88%, transparent);
  font-family: var(--portfolio-heading-font, "Inter", sans-serif);
  font-size: 1rem;
  font-weight: 650;
  line-height: 1.35;
  letter-spacing: 0;
}

.portfolio-root[data-theme="modern"] .legal-page .prose-portfolio > h2:first-child,
.portfolio-root[data-theme="modern"] .legal-page .prose-portfolio > h3:first-child {
  margin-top: 0;
}

.portfolio-root[data-theme="modern"] .legal-page .prose-portfolio p,
.portfolio-root[data-theme="modern"] .legal-page .prose-portfolio ul,
.portfolio-root[data-theme="modern"] .legal-page .prose-portfolio ol {
  margin-bottom: 1.1rem;
}

.portfolio-root[data-theme="modern"] .legal-page .prose-portfolio ul,
.portfolio-root[data-theme="modern"] .legal-page .prose-portfolio ol {
  padding-left: 1.35rem;
}

.portfolio-root[data-theme="modern"] .legal-page .prose-portfolio li {
  margin-bottom: 0.45rem;
  padding-left: 0.15rem;
}

.portfolio-root[data-theme="modern"] .legal-page .prose-portfolio li::marker {
  color: color-mix(
    in srgb,
    var(--portfolio-accent, #3b82f6) 74%,
    var(--portfolio-text, #ffffff) 26%
  );
}

.portfolio-root[data-theme="modern"] .legal-page .prose-portfolio a {
  color: var(--portfolio-link, var(--portfolio-accent, #3b82f6));
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

@media (max-width: 720px) {
  .custom-page-content {
    padding: 30px 16px 40px 16px;
    --custom-page-gap: 2rem;
  }
  .custom-page {
    --custom-page-title-size: 1.75rem;
    --custom-page-title-spacing: 0.06em;
  }

  .portfolio-root[data-theme="modern"] .legal-page-content {
    width: 100%;
    padding: 56px 8px 72px;
  }

  .portfolio-root[data-theme="modern"]
    .custom-page:not(.legal-page)
    .custom-page-content {
    width: 100%;
    padding: 56px 8px 72px;
  }

  .portfolio-root[data-theme="modern"] .custom-page:not(.legal-page) .custom-page-title {
    margin-bottom: 28px;
    font-size: 2.25rem;
    line-height: 1.05;
  }

  .portfolio-root[data-theme="modern"] .legal-page .custom-page-title {
    max-width: none;
    margin-bottom: 32px;
    font-size: 2.25rem;
    line-height: 1.05;
  }

  .portfolio-root[data-theme="modern"] .legal-page .prose-portfolio {
    font-size: 1rem;
    line-height: 1.7;
  }

  .portfolio-root[data-theme="modern"] .legal-page .prose-portfolio h2 {
    margin-top: 2.3rem;
  }
}

/* ============================================================================
EMPTY STATE
============================================================================ */

.gallery-empty {
  padding: 40px 0 60px;
  text-align: center;
}

.gallery-empty-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px;
}

@media (max-width: 640px) {
  .gallery-empty-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.gallery-empty-placeholder {
  aspect-ratio: 3/4;
  background: var(--modern-overlay-soft);
  border: 1px solid var(--modern-border);
  border-radius: var(--gallery-corner-radius, 8px);
  box-shadow: inset 0 1px 0 var(--modern-overlay-soft);
}

.gallery-empty-text {
  margin-top: 24px;
  color: var(--modern-muted);
  font-family: var(--portfolio-body-font, "Inter", sans-serif);
  font-size: 14px;
  opacity: 0.5;
}

/* ============================================================================
GALLERY ITEMS
============================================================================ */

.gallery-item {
  border-radius: var(--gallery-corner-radius, 8px) !important;
  border: 1px solid var(--modern-border) !important;
  box-shadow: 0 4px 20px var(--modern-shadow-soft) !important;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
  text-decoration: none;
  overflow: hidden;
}

.gallery-item img {
  border-radius: max(0px, calc(var(--gallery-corner-radius, 8px) - 1px)) !important;
  transition: transform 0.3s ease;
}

.gallery-item:hover {
  transform: translateY(-8px) scale(1.02) !important;
  box-shadow:
    0 20px 40px var(--modern-shadow),
    0 0 0 1px var(--portfolio-accent, #3b82f6) !important;
  border-color: var(--portfolio-accent, #3b82f6) !important;
}

.gallery-item:hover img {
  transform: scale(1.05);
}

.gallery-item .caption {
  background: color-mix(in srgb, var(--portfolio-bg, #111111) 76%, transparent) !important;
  border-top: 1px solid color-mix(in srgb, var(--portfolio-text, #ffffff) 16%, transparent);
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  box-sizing: border-box;
  display: block;
  padding: 12px 18px 13px;
  color: var(--portfolio-text, #ffffff);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
  overflow: hidden;
}

.gallery-item .caption-text {
  overflow-wrap: anywhere;
}

@media (max-width: 720px) {
  .gallery-item {
    border-radius: 6px !important;
  }
  .gallery-item img {
    border-radius: 5px !important;
  }
  .gallery-item .caption {
    display: none !important;
  }
}

/* ============================================================================
SLIDESHOW
============================================================================ */

.portfolio-root[data-theme="modern"][data-nav-layout="top"] .slideshow-container {
  height: calc(100dvh - 60px);
  min-height: 0;
}

@media (max-width: 720px) {
  .portfolio-root[data-theme="modern"][data-nav-layout="top"] .slideshow-container {
    height: calc(100dvh - 56px);
  }
}

.main-image-wrapper {
  padding: 40px 100px 20px;
}

.portfolio-root[data-theme="modern"] .slideshow-image {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

.main-image img {
  border-radius: 12px;
  box-shadow: 0 20px 60px var(--modern-shadow);
}

/* Slideshow nav arrows — match artwork page glassmorphic style */
.portfolio-root[data-theme="modern"] .nav-btn {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--modern-border);
}

.portfolio-root[data-theme="modern"] .slideshow-container {
  --slideshow-nav-button-bg: var(--modern-overlay-soft);
  --slideshow-nav-button-hover-bg: var(--modern-overlay);
  --slideshow-nav-button-color: var(--modern-muted);
  --slideshow-nav-button-radius: 12px;
  --slideshow-nav-button-padding: 25px 14px;
}

.portfolio-root[data-theme="modern"] .nav-btn:hover {
  border-color: var(--portfolio-accent, #3b82f6);
  color: var(--portfolio-text, #ffffff);
}

/* Title area */

.title-area {
  padding: 20px;
  background: var(--modern-shadow-soft);
}

.artwork-title {
  font-family: var(--portfolio-body-font, "Inter", sans-serif);
  font-size: 18px;
  font-weight: 300;
  color: var(--modern-muted);
  letter-spacing: 0.02em;
}

.more-info-btn {
  color: var(--portfolio-text, #ffffff);
  background: var(--modern-overlay);
  border-color: var(--modern-overlay-strong);
}

.more-info-btn:hover {
  background: var(--modern-overlay-strong);
  border-color: var(--portfolio-accent, #3b82f6);
}

/* Carousel container */

.carousel-container {
  padding: 20px;
  background: var(--modern-shadow);
  backdrop-filter: blur(10px);
}

.carousel-container.centered .carousel-track {
  justify-content: center;
}

.carousel-container.centered .carousel-nav {
  display: none;
}

.carousel-track {
  gap: 12px;
  padding: 5px 10px;
}

/* Carousel nav arrows */

.carousel-nav {
  background: var(--modern-overlay-soft) !important;
  border-radius: 8px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--modern-muted);
  transition: all 0.2s ease;
}

.carousel-nav:hover {
  background: var(--modern-overlay) !important;
  color: var(--portfolio-text, #ffffff);
}

/* Carousel thumbnails */

.carousel-thumb {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  border: 2px solid transparent;
  overflow: hidden;
  transition: all 0.2s ease;
  background: var(--modern-surface);
}

.carousel-thumb:hover {
  border-color: var(--modern-overlay-strong);
  transform: scale(1.05);
}

.carousel-thumb.active {
  border-color: var(--portfolio-accent, #3b82f6);
  box-shadow: 0 0 20px var(--modern-accent-glow);
}

/* ============================================================================
ARTWORK DETAIL PAGE
============================================================================ */

.artwork-detail {
  padding-top: 60px;
  padding-bottom: 80px;
}

.back-to-gallery {
  position: fixed;
  top: 80px;
  left: 40px;
  z-index: 100;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--modern-overlay-soft);
  backdrop-filter: blur(10px);
  border: 1px solid var(--modern-border) !important;
  color: var(--modern-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.back-to-gallery:hover {
  background: var(--modern-overlay);
  color: var(--portfolio-text, #ffffff);
  border-color: var(--portfolio-accent, #3b82f6) !important;
}

/* Prev/Next navigation */

.artwork-nav-btn {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 100;
  background: var(--modern-overlay-soft);
  backdrop-filter: blur(10px);
  border: 1px solid var(--modern-border) !important;
  color: var(--modern-muted);
  padding: 25px 14px;
  border-radius: 12px;
  transition: all 0.2s ease;
}

.artwork-nav-btn:hover {
  background: var(--modern-overlay);
  color: var(--portfolio-text, #ffffff);
  border-color: var(--portfolio-accent, #3b82f6) !important;
}

.artwork-nav-btn.disabled {
  opacity: 0.2;
}

.artwork-nav-prev {
  left: 20px;
}

.artwork-nav-next {
  right: 20px;
}

/* Tags */

.tags-container {
  margin-top: 16px;
}

.tag {
  font-size: 12px;
  color: var(--portfolio-accent, #3b82f6);
  background: var(--modern-accent-soft);
  padding: 4px 10px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.tag:hover {
  background: var(--modern-accent-medium);
}

@media (max-width: 768px) {
  .back-to-gallery {
    top: 70px;
    left: 16px;
    width: 40px;
    height: 40px;
  }
  .artwork-nav-btn {
    padding: 20px 12px;
  }
  .artwork-nav-prev {
    left: 10px;
  }
  .artwork-nav-next {
    right: 10px;
  }
}

/* ============================================================================
LINKS
============================================================================ */

:where(html[data-theme="modern"] .portfolio-root, .portfolio-root[data-theme="modern"])
  a {
  color: var(--portfolio-link, #3b82f6);
  text-decoration: none;
  transition: all 0.2s ease;
}

:where(html[data-theme="modern"] .portfolio-root, .portfolio-root[data-theme="modern"])
  a:hover {
  color: var(--modern-link-hover);
  border: none !important;
}

:where(html[data-theme="modern"] .portfolio-root, .portfolio-root[data-theme="modern"])
  a:visited {
  color: var(--portfolio-link, #3b82f6);
}

/* ============================================================================
SELECTION
============================================================================ */

:where(html[data-theme="modern"] .portfolio-root, .portfolio-root[data-theme="modern"])
  ::selection {
  background: var(--portfolio-accent, #3b82f6);
  color: var(--portfolio-on-accent, #ffffff);
}

:where(html[data-theme="modern"] .portfolio-root, .portfolio-root[data-theme="modern"])
  ::-moz-selection {
  background: var(--portfolio-accent, #3b82f6);
  color: var(--portfolio-on-accent, #ffffff);
}

/* ============================================================================
FOOTER
============================================================================ */

.footer-container {
  background: var(--portfolio-bg, #111111);
  color: var(--modern-muted);
  padding: 60px 40px;
  border-top: 1px solid var(--modern-border);
}

.footer-container a {
  color: var(--portfolio-link, #3b82f6);
}

.footer-container a:hover {
  color: var(--modern-link-hover);
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  container: modern-footer / inline-size;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  gap: 2rem;
  align-items: start;
}

.footer-links-section {
  grid-column: 3;
}

.footer-logo-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-logo {
  width: 200px;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  filter: saturate(0.5) brightness(0.5);
  opacity: 0.8;
}

.footer-links-section nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-link {
  text-decoration: none;
  transition: color 0.2s ease;
  overflow-wrap: anywhere;
}

.footer-link:hover {
  opacity: 0.8;
}

.footer-text {
  color: var(--portfolio-muted, var(--modern-muted-soft));
}

.footer-credits {
  font-size: 12px;
  text-align: center;
  overflow-wrap: anywhere;
}

.footer-attribution {
  margin-top: 1rem;
}

.footer-container .footer-attribution-badge {
  background: var(--modern-overlay-soft);
  color: var(--modern-muted);
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
}

.portfolio-root[data-theme="modern"][data-theme-mode="light"] .footer-attribution-logo-light-bg {
  display: block;
}

.portfolio-root[data-theme="modern"][data-theme-mode="light"] .footer-attribution-logo-dark-bg {
  display: none;
}

.footer-container .footer-attribution-badge:hover {
  background: var(--modern-overlay);
  color: var(--modern-link-hover);
}

.footer-divider {
  border-top: 1px solid var(--modern-border);
  margin: 2rem 0;
}

.portfolio-root[data-theme="modern"][data-nav-layout="side"] .footer-grid {
  grid-template-columns: minmax(140px, 0.7fr) minmax(0, 1.3fr);
}

.portfolio-root[data-theme="modern"][data-nav-layout="side"] .footer-links-section {
  grid-column: 2;
  display: grid;
  grid-template-columns: minmax(140px, 0.7fr) minmax(0, 1.3fr);
  gap: 2rem;
  min-width: 0;
}

.portfolio-root[data-theme="modern"][data-nav-layout="side"] .footer-links-section nav,
.portfolio-root[data-theme="modern"][data-nav-layout="side"] .footer-contact-section {
  min-width: 0;
}

.portfolio-root[data-theme="modern"][data-nav-layout="side"] .footer-contact-section {
  margin-top: 0;
}

@media (max-width: 720px) {
  .footer-container {
    padding: 40px 20px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }
}

@container modern-footer (max-width: 980px) {
  .portfolio-root[data-theme="modern"] .footer-grid {
    grid-template-columns: minmax(140px, 0.7fr) minmax(0, 1.3fr);
  }

  .portfolio-root[data-theme="modern"] .footer-links-section {
    grid-column: 2;
    display: grid;
    grid-template-columns: minmax(140px, 0.7fr) minmax(0, 1.3fr);
    gap: 2rem;
    min-width: 0;
  }

  .portfolio-root[data-theme="modern"] .footer-links-section nav {
    min-width: 0;
  }

  .portfolio-root[data-theme="modern"] .footer-contact-section {
    min-width: 0;
    margin-top: 0;
  }
}

@container modern-footer (max-width: 680px) {
  .portfolio-root[data-theme="modern"] .footer-grid,
  .portfolio-root[data-theme="modern"] .footer-links-section {
    grid-template-columns: 1fr;
  }

  .portfolio-root[data-theme="modern"] .footer-links-section {
    grid-column: 1 / -1;
  }

  .portfolio-root[data-theme="modern"] .footer-contact-section {
    margin-top: 1.5rem;
  }
}

@container modern-footer (min-width: 380px) and (max-width: 680px) {
  .portfolio-root[data-theme="modern"] .footer-links-section {
    display: grid;
    grid-template-columns: minmax(140px, 0.65fr) minmax(0, 1.35fr);
    gap: 2rem;
  }

  .portfolio-root[data-theme="modern"] .footer-contact-section {
    margin-top: 0;
  }
}

@container modern-footer (max-width: 760px) {
  .portfolio-root[data-theme="modern"][data-nav-layout="side"] .footer-grid,
  .portfolio-root[data-theme="modern"][data-nav-layout="side"] .footer-links-section {
    grid-template-columns: 1fr;
  }

  .portfolio-root[data-theme="modern"][data-nav-layout="side"] .footer-links-section {
    grid-column: 1 / -1;
  }

  .portfolio-root[data-theme="modern"][data-nav-layout="side"] .footer-contact-section {
    margin-top: 1.5rem;
  }
}

@container modern-footer (min-width: 380px) and (max-width: 760px) {
  .portfolio-root[data-theme="modern"][data-nav-layout="side"] .footer-links-section {
    display: grid;
    grid-template-columns: minmax(140px, 0.65fr) minmax(0, 1.35fr);
    gap: 2rem;
  }

  .portfolio-root[data-theme="modern"][data-nav-layout="side"] .footer-contact-section {
    margin-top: 0;
  }
}

/* ============================================================================
TYPOGRAPHY
============================================================================ */

:where(html[data-theme="modern"] .portfolio-root, .portfolio-root[data-theme="modern"])
  h1,
:where(html[data-theme="modern"] .portfolio-root, .portfolio-root[data-theme="modern"])
  h2,
:where(html[data-theme="modern"] .portfolio-root, .portfolio-root[data-theme="modern"])
  h3,
:where(html[data-theme="modern"] .portfolio-root, .portfolio-root[data-theme="modern"])
  h4,
:where(html[data-theme="modern"] .portfolio-root, .portfolio-root[data-theme="modern"])
  h5,
:where(html[data-theme="modern"] .portfolio-root, .portfolio-root[data-theme="modern"])
  h6 {
  font-family: var(--portfolio-heading-font, "Inter", sans-serif);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

:where(html[data-theme="modern"] .portfolio-root, .portfolio-root[data-theme="modern"])
  h1 {
  font-size: 2.5rem;
}

:where(html[data-theme="modern"] .portfolio-root, .portfolio-root[data-theme="modern"])
  h2 {
  font-size: 2rem;
}

:where(html[data-theme="modern"] .portfolio-root, .portfolio-root[data-theme="modern"])
  h3 {
  font-size: 1.5rem;
}

/* ============================================================================
FULLSCREEN MODAL
============================================================================ */

.fullscreen-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: color-mix(in srgb, var(--portfolio-bg, #111111) 95%, transparent);
  backdrop-filter: blur(20px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}

.fullscreen-modal img {
  max-width: 95vw;
  max-height: 95vh;
  object-fit: contain;
  border-radius: 8px;
}

.fullscreen-close {
  position: absolute;
  top: 20px;
  right: 20px;
  color: var(--portfolio-text, #ffffff);
  font-size: 28px;
  background: var(--modern-overlay);
  border: none;
  cursor: pointer;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.fullscreen-close:hover {
  background: var(--modern-overlay-strong);
  color: var(--portfolio-accent, #3b82f6);
}

/* ============================================================================
SCROLLBAR STYLING
============================================================================ */

:where(html[data-theme="modern"] .portfolio-root, .portfolio-root[data-theme="modern"])
  *::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

:where(html[data-theme="modern"] .portfolio-root, .portfolio-root[data-theme="modern"])
  *::-webkit-scrollbar-track {
  background: var(--portfolio-bg, #111111);
}

:where(html[data-theme="modern"] .portfolio-root, .portfolio-root[data-theme="modern"])
  *::-webkit-scrollbar-thumb {
  background: var(--modern-border);
  border-radius: 5px;
}

:where(html[data-theme="modern"] .portfolio-root, .portfolio-root[data-theme="modern"])
  *::-webkit-scrollbar-thumb:hover {
  background: var(--modern-muted);
}

/* ============================================================================
SIDE NAVIGATION LAYOUT
============================================================================ */

/* Side nav: header becomes fixed left column */
:where(
    html[data-theme="modern"] .portfolio-root,
    .portfolio-root[data-theme="modern"]
  )[data-nav-layout="side"]
  .header-container {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: 240px;
  height: 100vh;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  padding: 32px 24px 24px;
  border-bottom: none;
  border-right: 1px solid var(--modern-border);
  background: var(--portfolio-bg, #111111);
  z-index: 30;
  overflow-y: auto;
}

:where(
    html[data-theme="modern"] .portfolio-root,
    .portfolio-root[data-theme="modern"]
  )[data-nav-layout="side"]
  .logo-link {
  position: static;
  display: flex;
  width: 100%;
  margin: 0 0 48px;
  justify-content: center;
  transform: none;
}

:where(
    html[data-theme="modern"] .portfolio-root,
    .portfolio-root[data-theme="modern"]
  )[data-nav-layout="side"]
  .logo-image {
  width: min(100%, 180px);
  max-height: 132px;
  object-fit: contain;
}

:where(
    html[data-theme="modern"] .portfolio-root,
    .portfolio-root[data-theme="modern"]
  )[data-nav-layout="side"]
  .nav-bar {
  flex-direction: column;
  height: auto;
  width: 100%;
  justify-content: flex-start;
  padding: 0;
}

:where(
    html[data-theme="modern"] .portfolio-root,
    .portfolio-root[data-theme="modern"]
  )[data-nav-layout="side"]
  .nav-items {
  flex-direction: column;
  width: 100%;
  gap: 4px;
}

:where(
    html[data-theme="modern"] .portfolio-root,
    .portfolio-root[data-theme="modern"]
  )[data-nav-layout="side"]
  .nav-item {
  width: 100%;
  text-align: left;
  padding: 8px 12px;
  border-bottom: none !important;
}

:where(
    html[data-theme="modern"] .portfolio-root,
    .portfolio-root[data-theme="modern"]
  )[data-nav-layout="side"]
  .header-spacer {
  display: none;
}

:where(
    html[data-theme="modern"] .portfolio-root,
    .portfolio-root[data-theme="modern"]
  )[data-nav-layout="side"]
  .main-content {
  margin-left: 240px;
}

/* Footer shifts too */
:where(
    html[data-theme="modern"] .portfolio-root,
    .portfolio-root[data-theme="modern"]
  )[data-nav-layout="side"]
  .footer-container {
  margin-left: 240px;
}

/* Mobile: side nav reverts to standard top nav */
@media (max-width: 640px) {
  .portfolio-root[data-theme="modern"] .slideshow-container {
    height: calc(100dvh - 56px);
  }

  :where(
      html[data-theme="modern"] .portfolio-root,
      .portfolio-root[data-theme="modern"]
    )[data-nav-layout="side"]
    .header-container {
    position: fixed;
    left: 0;
    top: 0;
    right: 0;
    bottom: auto;
    width: 100%;
    height: 56px;
    flex-direction: row;
    align-items: center;
    padding: 0 20px;
    border-right: none;
    overflow-y: visible;
  }

  :where(
      html[data-theme="modern"] .portfolio-root,
      .portfolio-root[data-theme="modern"]
    )[data-nav-layout="side"]
    .logo-link {
    position: absolute;
    top: 12px;
    left: 20px;
    display: block;
    width: auto;
    margin: 0;
  }

  :where(
      html[data-theme="modern"] .portfolio-root,
      .portfolio-root[data-theme="modern"]
    )[data-nav-layout="side"]
    .logo-image {
    width: 80px;
    max-height: none;
  }

  :where(
      html[data-theme="modern"] .portfolio-root,
      .portfolio-root[data-theme="modern"]
    )[data-nav-layout="side"]
    .main-content,
  :where(
      html[data-theme="modern"] .portfolio-root,
      .portfolio-root[data-theme="modern"]
    )[data-nav-layout="side"]
    .footer-container {
    margin-left: 0;
  }

  :where(
      html[data-theme="modern"] .portfolio-root,
      .portfolio-root[data-theme="modern"]
    )[data-nav-layout="side"]
    .header-spacer {
    display: block;
  }

  :where(
      html[data-theme="modern"] .portfolio-root,
      .portfolio-root[data-theme="modern"]
    )[data-nav-layout="side"]
    .nav-bar {
    flex-direction: row;
    width: auto;
    padding: 0;
  }

  :where(
      html[data-theme="modern"] .portfolio-root,
      .portfolio-root[data-theme="modern"]
    )[data-nav-layout="side"]
    .nav-items {
    flex-direction: row;
  }

  :where(
      html[data-theme="modern"] .portfolio-root,
      .portfolio-root[data-theme="modern"]
    )[data-nav-layout="side"]
    .nav-item {
    width: auto;
    text-align: center;
    padding: initial;
    font-size: inherit;
  }
}
