/* === Eye-Friendly Themes === */
:root,
[data-theme="slate"] {
  --bg: #12151a;
  --bg-elev: #191e26;
  --bg-subtle: #202731;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #e7ecf2;
  --text-muted: #9aa5b4;
  --accent: #68c5b0;
  --accent-soft: rgba(104, 197, 176, 0.14);
  --accent-text: #0d1d19;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
  --topbar-bg: rgba(18, 21, 26, 0.84);
}

[data-theme="paper"] {
  --bg: #f5f2eb;
  --bg-elev: #fcfbf8;
  --bg-subtle: #ece7dc;
  --border: rgba(28, 36, 33, 0.09);
  --border-strong: rgba(28, 36, 33, 0.18);
  --text: #1f2623;
  --text-muted: #5a6661;
  --accent: #187561;
  --accent-soft: rgba(24, 117, 97, 0.11);
  --accent-text: #ffffff;
  --shadow: 0 10px 28px rgba(31, 38, 35, 0.07);
  --topbar-bg: rgba(245, 242, 235, 0.86);
}

[data-theme="dusk"] {
  --bg: #191615;
  --bg-elev: #231f1d;
  --bg-subtle: #2d2724;
  --border: rgba(245, 232, 216, 0.09);
  --border-strong: rgba(245, 232, 216, 0.18);
  --text: #ece5dc;
  --text-muted: #aca094;
  --accent: #d4a36a;
  --accent-soft: rgba(212, 163, 106, 0.15);
  --accent-text: #1d150c;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.34);
  --topbar-bg: rgba(25, 22, 21, 0.86);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.25s ease, color 0.25s ease;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

.container {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 22px;
}

/* === Topbar === */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--topbar-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 66px;
  flex-wrap: wrap;
  padding-top: 8px;
  padding-bottom: 8px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid var(--border-strong);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-text strong {
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.brand-text small {
  font-size: 12px;
  color: var(--text-muted);
}

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

.theme-picker,
.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
}

.theme-btn,
.lang-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background-color 0.18s ease, color 0.18s ease;
}

.theme-btn:hover,
.lang-btn:hover {
  color: var(--text);
}

.theme-btn[aria-pressed="true"],
.lang-btn[aria-pressed="true"] {
  background: var(--bg-elev);
  color: var(--text);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.16);
}

.swatch {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 1px solid rgba(128, 128, 128, 0.45);
  display: inline-block;
}

.swatch-slate { background: linear-gradient(135deg, #1b222c 50%, #68c5b0 50%); }
.swatch-paper { background: linear-gradient(135deg, #f5f2eb 50%, #187561 50%); }
.swatch-dusk  { background: linear-gradient(135deg, #27211e 50%, #d4a36a 50%); }

/* === Hero === */
.hero {
  padding: 56px 0 32px;
}

.eyebrow {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--accent);
}

.hero h1 {
  margin: 0 0 14px;
  font-size: clamp(28px, 4.4vw, 42px);
  line-height: 1.18;
  letter-spacing: -0.025em;
  max-width: 18ch;
}

.hero-lead {
  margin: 0 0 28px;
  font-size: 17px;
  color: var(--text-muted);
  max-width: 60ch;
}

.hero-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.filter-pills {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pill {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text-muted);
  font: inherit;
  font-size: 13.5px;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: all 0.18s ease;
}

.pill:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.pill.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.pill-count {
  font-size: 12px;
  opacity: 0.78;
}

.quick-nav {
  display: inline-flex;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 13.5px;
  color: var(--text-muted);
}

.quick-nav a {
  text-decoration: none;
  transition: color 0.15s ease;
}

.quick-nav a:hover {
  color: var(--accent);
}

/* === Project Cards === */
.projects-list {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 12px 0 68px;
}

.project-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 28px;
  box-shadow: var(--shadow);
  scroll-margin-top: 88px;
  transition: border-color 0.2s ease, background-color 0.25s ease;
}

.project-card:hover {
  border-color: var(--border-strong);
}

.project-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.project-identity {
  display: flex;
  align-items: center;
  gap: 18px;
}

.app-icon {
  width: 74px;
  height: 74px;
  border-radius: 18px;
  object-fit: cover;
  border: 1px solid var(--border);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
  flex-shrink: 0;
}

.project-title-wrap h2 {
  margin: 0 0 4px;
  font-size: 24px;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.project-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--text-muted);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  background: var(--bg-subtle);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.badge-accent {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: transparent;
}

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

.store-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 15px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--border-strong);
  background: var(--bg-subtle);
  color: var(--text);
  transition: transform 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.store-btn:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
}

.store-btn-primary {
  background: var(--accent);
  color: var(--accent-text);
  border-color: transparent;
}

.store-btn-primary:hover {
  filter: brightness(1.06);
  border-color: transparent;
}

.store-soon {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: 1px dashed var(--border-strong);
}

.store-btn svg,
.store-soon svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.project-tagline {
  margin: 18px 0 10px;
  font-size: 17px;
  font-weight: 500;
  color: var(--text);
}

.project-desc {
  margin: 0 0 16px;
  font-size: 15px;
  color: var(--text-muted);
  max-width: 78ch;
}

.highlights {
  list-style: none;
  margin: 0 0 22px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 8px 18px;
}

.highlights li {
  position: relative;
  padding-left: 18px;
  font-size: 14px;
  color: var(--text-muted);
}

.highlights li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.85;
}

/* === Gallery === */
.gallery-wrap {
  position: relative;
}

.gallery {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  padding: 4px 2px 10px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

.gallery::-webkit-scrollbar {
  height: 7px;
}

.gallery::-webkit-scrollbar-track {
  background: transparent;
}

.gallery::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 999px;
}

.shot-btn {
  appearance: none;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: var(--bg-subtle);
  cursor: zoom-in;
  flex: 0 0 auto;
  scroll-snap-align: start;
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.shot-btn:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.gallery-portrait .shot-btn img {
  height: 310px;
  width: auto;
  object-fit: cover;
}

.gallery-landscape .shot-btn img {
  height: 215px;
  width: auto;
  object-fit: cover;
}

.project-foot {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--text-muted);
}

.privacy-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.privacy-link:hover {
  text-decoration: underline;
}

/* === Footer === */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 0 44px;
  font-size: 13.5px;
  color: var(--text-muted);
}

.footer-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-logo {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  object-fit: cover;
  border: 1px solid var(--border-strong);
  flex-shrink: 0;
}

.footer-note {
  margin: 4px 0 0;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.footer-links a {
  text-decoration: none;
  color: var(--text-muted);
}

.footer-links a:hover {
  color: var(--accent);
}

.dot {
  opacity: 0.45;
}

/* === Lightbox === */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(8, 10, 14, 0.9);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.lightbox[hidden] {
  display: none;
}

.lb-figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  max-width: 90vw;
  max-height: 88vh;
}

.lb-figure img {
  max-width: 88vw;
  max-height: 80vh;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
}

.lb-figure figcaption {
  font-size: 13.5px;
  color: #cfd6df;
}

.lb-close,
.lb-nav {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(24, 28, 36, 0.78);
  color: #eef2f6;
  cursor: pointer;
  border-radius: 999px;
  display: grid;
  place-items: center;
  transition: background-color 0.15s ease;
}

.lb-close:hover,
.lb-nav:hover {
  background: rgba(45, 53, 66, 0.92);
}

.lb-close {
  position: fixed;
  top: 20px;
  right: 22px;
  width: 42px;
  height: 42px;
  font-size: 24px;
  line-height: 1;
}

.lb-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  font-size: 28px;
  line-height: 1;
}

.lb-prev { left: 18px; }
.lb-next { right: 18px; }

/* === Responsive === */
@media (max-width: 680px) {
  .hero {
    padding-top: 36px;
  }

  .project-card {
    padding: 20px;
    border-radius: 18px;
  }

  .app-icon {
    width: 60px;
    height: 60px;
    border-radius: 14px;
  }

  .project-title-wrap h2 {
    font-size: 20px;
  }

  .gallery-portrait .shot-btn img {
    height: 250px;
  }

  .gallery-landscape .shot-btn img {
    height: 165px;
  }

  .theme-label {
    display: none;
  }

  .lb-nav {
    width: 38px;
    height: 38px;
    font-size: 22px;
  }
}
