.gallery-page {
  background: radial-gradient(ellipse at 95% 0, rgba(139, 0, 0, 0.14), transparent 40%), #090909;
}

.gallery-page button { font: inherit; }
.gallery-page [hidden] { display: none !important; }
.gallery-page :focus-visible { outline: 2px solid var(--accent-bright); outline-offset: 4px; }
.gallery-page .nav a[aria-current="page"] { color: #fff; }
.gallery-page .header-inner > .btn { flex-shrink: 0; }
.gallery-page .brand { flex-shrink: 0; }
.gallery-page .header-inner > .btn { width: auto; }

.skip-link {
  position: fixed;
  top: -100px;
  left: 20px;
  z-index: 200;
  padding: 12px 18px;
  background: #fff;
  color: #111;
}
.skip-link:focus { top: 12px; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.gallery-intro { padding: 44px 0 34px; }
.gallery-intro .eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 0.22em; }
.gallery-intro h1 { font-size: clamp(2.5rem, 4.5vw, 3.8rem); line-height: 1.08; margin: 14px 0; letter-spacing: -0.04em; }
.gallery-intro h1 span { color: var(--accent-bright); -webkit-text-fill-color: var(--accent-bright); }
.gallery-intro p { margin: 0; color: #aaa; font-size: 1rem; line-height: 1.75; }
.gallery-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 24px; align-items: start; scroll-margin-top: 100px; }
.gallery-sidebar, .gallery-detail { border: 1px solid #2a2626; border-radius: 20px; background: #111; min-width: 0; }
.gallery-sidebar { padding: 22px 14px; }
.sidebar-heading { display: flex; justify-content: space-between; align-items: center; padding: 0 8px 18px; }
.sidebar-heading h2 { font-size: 1rem; margin: 0; }
.project-count { font-size: 12px; color: #bcbcbc; border: 1px solid #363030; border-radius: 7px; padding: 1px 9px; }
.project-list { display: grid; gap: 10px; max-height: 580px; overflow-y: auto; padding: 4px; scrollbar-color: #633030 #171717; }
.project-choice {
  position: relative;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  width: 100%;
  text-align: left;
  padding: 15px 12px;
  border: 1px solid #292727;
  border-radius: 12px;
  background: #181717;
  color: #d9d9d9;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease;
}
.project-choice:hover { background: #222020; border-color: #675050; }
.project-choice[aria-pressed="true"] { background: linear-gradient(110deg, #361818, #201616); border-color: var(--accent); box-shadow: inset 3px 0 var(--accent-bright); }
.project-choice img { width: 58px; height: 64px; border-radius: 7px; object-fit: cover; }
.project-choice-copy { min-width: 0; }
.project-choice-title { display: block; padding-right: 22px; font-size: 14px; font-weight: 650; line-height: 1.4; }
.project-choice-flag.fi { position: absolute; right: 10px; top: 16px; width: 20px; height: 15px; border-radius: 2px; box-shadow: 0 0 0 1px #ffffff30; }
.project-country-flag.fi { margin-left: auto; width: 34px; height: 25.5px; border-radius: 3px; box-shadow: 0 0 0 1px #ffffff40; }
.project-choice-meta { display: block; margin-top: 6px; color: #ac9d9d; font-size: 11px; }
.project-choice-demo { display: inline-block; margin-top: 7px; color: #ffc3a9; font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; }
.sidebar-note { border-top: 1px solid #2a2626; margin: 22px 8px 0; padding-top: 18px; font-size: 12px; color: #9a9191; line-height: 1.7; }

.gallery-detail { overflow: hidden; }
.project-heading { padding: 26px 28px 22px; }
.project-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; min-height: 22px; }
.location-label { display: inline-flex; align-items: center; gap: 8px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--accent-bright); }
.location-label::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--accent-bright); }
.demo-badge { font-size: 10px; border: 1px solid #79553e; background: #30241c; border-radius: 4px; padding: 2px 7px; color: #ffd0ad; }
.project-heading h2 { margin: 10px 0 9px; font-size: clamp(1.6rem, 2.5vw, 2rem); letter-spacing: -0.025em; line-height: 1.2; }
.project-heading p { margin: 0; max-width: 730px; color: #aaa; font-size: 14px; line-height: 1.7; }
.photo-carousel { margin: 0 18px 18px; border-radius: 12px; }
.spotlight { margin: 0; }
.spotlight-stage { position: relative; aspect-ratio: 16 / 10; background: #050505; border: 1px solid #2c2727; border-radius: 12px; overflow: hidden; }
.spotlight-stage > img { width: 100%; height: 100%; object-fit: contain; }
.image-expand { position: absolute; right: 12px; bottom: 12px; display: inline-flex; gap: 7px; align-items: center; padding: 8px 12px; border: 1px solid #ffffff40; border-radius: 7px; color: #fff; background: #0a0a0adb; cursor: pointer; font-size: 12px !important; }
.image-expand:hover { background: #641c1c; }
.image-expand > span:first-child { font-size: 19px; line-height: 1; }
.photo-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 2px; min-height: 65px; }
#photoCaption { color: #bfb8b8; font-size: 13px; }
.photo-controls { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.photo-counter { font-size: 11px; letter-spacing: 0.12em; font-variant-numeric: tabular-nums; color: #b9b0b0; padding-right: 8px; white-space: nowrap; }
.arrow-button { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 8px; border: 1px solid #433737; background: #201b1b; color: #fff; cursor: pointer; font-size: 20px !important; }
.arrow-button:hover { background: #492020; border-color: var(--accent); }
.arrow-button:disabled { opacity: 0.35; cursor: default; }
.photo-thumbnails { display: flex; gap: 10px; overflow-x: auto; padding: 4px 3px 9px; scrollbar-color: #633030 #171717; }
.photo-thumbnail { position: relative; flex: 1 0 82px; min-width: 0; max-width: 150px; padding: 3px; border: 2px solid transparent; border-radius: 9px; background: transparent; cursor: pointer; opacity: 0.62; transition: opacity 160ms ease, border-color 160ms ease; }
.photo-thumbnail img { width: 100%; height: 68px; object-fit: cover; border-radius: 4px; }
.photo-thumbnail:hover { opacity: 1; }
.photo-thumbnail[aria-pressed="true"] { border-color: var(--accent-bright); opacity: 1; }
.photo-thumbnail-number { position: absolute; bottom: 7px; right: 8px; padding: 0 4px; border-radius: 3px; background: #080808cf; color: #fff; font-size: 10px; }
.gallery-notice { padding: 16px; color: #ddd; }
.gallery-notice a { text-decoration: underline; }
.gallery-contact { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 12px; padding: 26px 0 44px; font-size: 13px; }
.gallery-contact p { color: #999; margin: 0; }
.gallery-contact a { color: var(--accent-bright); }
.gallery-contact a:hover { color: #fff; }

.autoplay-controls { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 10px; border-top: 1px solid var(--border); margin-top: 7px; padding: 12px 3px 0; color: #aaa; font-size: 12px; }
.autoplay-toggle { border: 1px solid #433737; border-radius: 7px; padding: 8px 12px; background: #201b1b; color: #eee; cursor: pointer; }
.autoplay-toggle[aria-pressed="true"] { border-color: var(--accent); }
.autoplay-toggle:hover { background: #492020; }

.photo-dialog { width: min(1200px, calc(100% - 32px)); max-width: none; max-height: calc(100dvh - 32px); padding: 16px; border: 1px solid #5a3a3a; border-radius: 16px; background: #111; color: #eee; }
.photo-dialog::backdrop { background: #000e; }
.photo-dialog[open] { display: flex; flex-direction: column; }
body:has(.photo-dialog[open]) { overflow: hidden; }
.dialog-heading, .dialog-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-shrink: 0; }
.dialog-heading { padding-bottom: 12px; }
.dialog-heading p { margin: 0; font-weight: 650; }
.photo-dialog > img { width: 100%; min-height: 0; max-height: calc(100dvh - 205px); object-fit: contain; background: #050505; }
.dialog-toolbar { padding-top: 12px; }
.dialog-toolbar p { color: #c2b9b9; font-size: 13px; margin: 0; }

@media (max-width: 980px) {
  .gallery-layout { grid-template-columns: 235px minmax(0, 1fr); gap: 16px; }
  .gallery-sidebar { padding: 18px 10px; }
  .project-choice { grid-template-columns: 46px minmax(0, 1fr); gap: 10px; padding: 13px 10px; }
  .project-choice img { width: 46px; height: 58px; }
  .project-heading { padding: 22px 20px; }
  .photo-carousel { margin: 0 12px 12px; }
}
@media (max-width: 760px) {
  .gallery-intro { padding: 32px 0 24px; }
  .gallery-layout { grid-template-columns: minmax(0, 1fr); }
  .gallery-sidebar { padding: 16px 12px 10px; }
  .sidebar-heading { padding-bottom: 10px; }
  .project-list { display: flex; overflow-x: auto; padding-bottom: 8px; }
  .project-choice { flex: 0 0 215px; }
  .sidebar-note { display: none; }
  .gallery-contact { justify-content: center; padding-bottom: 30px; }
}
@media (max-width: 480px) {
  .gallery-page .header-inner { gap: 10px; }
  .gallery-page .brand { gap: 7px; }
  .gallery-page .brand-title { font-size: 10px; letter-spacing: 0.16em; }
  .gallery-page .header-inner > .btn { padding: 10px; font-size: 11px; border-radius: 12px; }
  .gallery-page .brand-icon { width: 28px; height: 28px; }
  .gallery-page .menu-toggle { padding: 9px; font-size: 12px; }
  .intro-break { display: none; }
  .gallery-intro p { font-size: 14px; }
  .project-heading { padding: 20px 16px; }
  .photo-toolbar { align-items: flex-start; flex-direction: column; gap: 8px; }
  .photo-controls { align-self: flex-end; }
  .spotlight-stage { aspect-ratio: 4 / 3; }
  .photo-dialog { width: calc(100% - 16px); padding: 12px; }
  .dialog-toolbar { flex-wrap: wrap; justify-content: flex-end; }
  .dialog-toolbar p { flex-basis: 100%; }
  .photo-dialog > img { max-height: calc(100dvh - 250px); }
}
@media (prefers-reduced-motion: reduce) {
  .gallery-page { scroll-behavior: auto; }
  html:has(.gallery-page) { scroll-behavior: auto; }
  .gallery-page *, .gallery-page *::before, .gallery-page *::after { transition: none !important; }
}
