﻿:root {
  --bg: #ffffff;
  --ink: #0b0b0b;
  --muted: #4a4a4a;
  --accent: #ff7f50;
  --gap: 10px;
  --bulb-icon-light: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 24 24' fill='none' stroke='%23000000' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 18h6'/%3E%3Cpath d='M10 22h4'/%3E%3Cpath d='M12 2a7 7 0 0 0-4 12l.5.5c.4.4.5.9.5 1.5V17h6v-1c0-.6.1-1.1.5-1.5l.5-.5A7 7 0 0 0 12 2Z'/%3E%3C/svg%3E");
  --bulb-icon-dark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 18h6'/%3E%3Cpath d='M10 22h4'/%3E%3Cpath d='M12 2a7 7 0 0 0-4 12l.5.5c.4.4.5.9.5 1.5V17h6v-1c0-.6.1-1.1.5-1.5l.5-.5A7 7 0 0 0 12 2Z'/%3E%3C/svg%3E");
}

:root[data-theme='dark'] {
  --bg: #111318;
  --ink: #f2f2f2;
  --muted: #9aa3b1;
  --accent: #ff7f50;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  min-height: 100vh;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.brand-mark {
  width: 34px;
  height: 34px;
  object-fit: cover;
  border-radius: 0;
  box-shadow: none;
  border: none;
  background: transparent;
  flex-shrink: 0;
}

.brand .title {
  margin: 0;
}

.hero {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.2);
  z-index: 10;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

:root[data-theme='dark'] .hero {
  background: rgba(17, 19, 24, 0.7);
}


.title {
  font-size: 1.25rem;
  letter-spacing: 0.08em;
  text-transform: none;
  font-weight: 500;
  font-family: 'Futura', 'Futura PT', 'Futura-Medium', 'Century Gothic', Arial, sans-serif;
  color: #2b2b2b;
  flex: 0 0 auto;
}

:root[data-theme='dark'] .title {
  color: var(--ink);
}

main {
  padding-top: 64px;
}

.viewer {
  display: none;
}

.actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.control-row {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: flex-end;
  flex: 1 1 auto;
  flex-wrap: wrap;
}

.divider {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ink);
  display: inline-block;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.collection-btn {
  font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  padding: 6px 10px;
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.4);
  color: var(--ink);
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease;
}

:root[data-theme='dark'] .collection-btn {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(17, 19, 24, 0.55);
}

.collection-btn:hover,
.collection-btn.active {
  background: rgba(0, 0, 0, 0.08);
}

:root[data-theme='dark'] .collection-btn:hover,
:root[data-theme='dark'] .collection-btn.active {
  background: rgba(255, 255, 255, 0.14);
}

.contact {
  font-family: 'Futura', 'Futura PT', 'Futura-Medium', 'Century Gothic', Arial, sans-serif;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  text-decoration: none;
  color: var(--ink);
  padding: 6px 10px;
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

:root[data-theme='dark'] .contact {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(17, 19, 24, 0.55);
}

.contact:hover {
  background: rgba(0, 0, 0, 0.08);
}

:root[data-theme='dark'] .contact:hover {
  background: rgba(255, 255, 255, 0.14);
}

.mode-toggle {
  font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  width: 38px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid rgba(0, 0, 0, 0.18);
  border-radius: 6px;
  background-color: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: var(--ink);
  background-image: var(--bulb-icon-light);
  background-repeat: no-repeat;
  background-position: center;
  background-size: 18px;
  cursor: pointer;
  transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease, filter 0.25s ease;
}

:root[data-theme='dark'] .mode-toggle {
  border-color: rgba(255, 255, 255, 0.28);
  background-color: rgba(17, 19, 24, 0.55);
  background-image: var(--bulb-icon-dark);
}

.mode-toggle:hover {
  background-color: rgba(0, 0, 0, 0.08);
}

:root[data-theme='dark'] .mode-toggle:hover {
  background-color: rgba(255, 255, 255, 0.14);
}

.gallery {
  padding: var(--gap);
  transition: filter 0.06s ease;
}

.gallery.feed {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

.gallery.grid {
  column-width: 384px; /* ~20% larger than previous 320px */
  column-gap: var(--gap);
}

.gallery.switching {
  filter: blur(1.9px);
}

.photo-tile {
  margin: 0 0 var(--gap);
  padding: 0;
  position: relative;
  overflow: hidden;
  background: transparent;
  border: none;
  width: 100%;
  display: block;
  break-inside: avoid;
  transition: none;
  cursor: pointer;
  outline: 0 solid transparent;
}

:root[data-theme='dark'] .photo-tile {
  background: #1a1c23;
}

.photo-tile:hover {
  outline: 0 solid transparent;
  box-shadow: none;
}

.photo-tile img {
  display: block;
  width: 100%;
  height: auto;
  transition: box-shadow 0.3s ease;
}

.gallery.feed .photo-tile {
  width: min(92vw, 1100px);
  max-width: calc(100% - 2 * var(--gap));
  align-self: center;
  margin-left: auto;
  margin-right: auto;
}

.gallery.feed .photo-tile img {
  width: 100%;
  height: auto;
  max-height: 80vh;
  object-fit: contain;
}

.photo-tile.selected {
  box-shadow: none;
}

body.expanded .photo-tile.selected {
  box-shadow: none;
}

body.expanded .photo-tile.selected img {
  max-height: 90vh;
  object-fit: contain;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(0, 0, 0, 0.12);
}

.photo-tile.selected img {
  box-shadow: 0 0 0 2px var(--accent);
}

.nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  padding: 0;
  display: grid;
  place-items: center;
  background: radial-gradient(circle, rgba(0, 0, 0, 0.1125) 0%, rgba(0, 0, 0, 0.075) 60%, rgba(0, 0, 0, 0) 100%);
  color: #ffffff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: background 0.25s ease, opacity 0.25s ease;
}

.nav-btn:hover {
  background: radial-gradient(circle, rgba(0, 0, 0, 0.22) 0%, rgba(0, 0, 0, 0.16) 54%, rgba(0, 0, 0, 0.02) 100%);
}

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

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

.viewer:hover .nav-btn {
  opacity: 1;
  pointer-events: auto;
}

@media (max-width: 820px) {
  main {
    padding-top: var(--gap);
  }

  .hero {
    position: static;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px;
  }

  .brand {
    width: 100%;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    margin: 0 auto;
    gap: 8px;
  }

  .brand .title,
  .title {
    width: 100%;
    text-align: center;
  }

  .control-row {
    width: 100%;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
  }

  .gallery {
    column-count: 1;
    column-width: 100%;
    column-gap: var(--gap);
    padding: var(--gap);
  }

  .photo-tile {
    margin-bottom: var(--gap);
  }

  .tooltip-hint {
    display: none;
  }
}

#status {
  margin: 0 16px;
  padding: 10px 12px;
  background: #f2f2f2;
  border: 1px dashed #d2d2d2;
  color: var(--muted);
  font-size: 0.95rem;
}

@media (max-width: 640px) {
  .photo-tile {
    grid-column: span 1;
  }

  .photo-tile.selected {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16), 0 0 0 1px rgba(0, 0, 0, 0.12);
  }

  .nav-btn {
    height: 44px;
    width: 44px;
  }
}

.tooltip-hint {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  font-size: 0.92rem;
  letter-spacing: 0.03em;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 20;
}

:root[data-theme='dark'] .tooltip-hint {
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.3);
}

.tooltip-hint.visible {
  opacity: 1;
}
