:root {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
          "Helvetica Neue", Helvetica, Arial, sans-serif;
  --text: rgba(0, 0, 0, 0.82);
  --text-2: rgba(0, 0, 0, 0.45);
  --text-3: rgba(0, 0, 0, 0.25);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --r: 22px;
  --r-pill: 100px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }

body {
  font-family: var(--font);
  font-size: 15px;
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ─── Background ─── */

.scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: linear-gradient(150deg, #e6ecf5 0%, #ede5f2 30%, #f6f0e5 55%, #e3f0ea 100%);
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  will-change: transform;
  animation: drift 24s ease-in-out infinite alternate;
}

.b1 { width: 55vw; height: 50vw; top: -12%; left: -5%; background: radial-gradient(circle, rgba(110, 165, 255, 0.45), transparent 70%); }
.b2 { width: 42vw; height: 42vw; top: 8%; right: -8%; background: radial-gradient(circle, rgba(185, 135, 255, 0.35), transparent 70%); animation-delay: -7s; animation-duration: 28s; }
.b3 { width: 48vw; height: 38vw; bottom: -6%; left: 18%; background: radial-gradient(circle, rgba(90, 205, 185, 0.4), transparent 70%); animation-delay: -14s; animation-duration: 22s; }
.b4 { width: 38vw; height: 38vw; bottom: 12%; right: 2%; background: radial-gradient(circle, rgba(255, 165, 125, 0.28), transparent 70%); animation-delay: -4s; animation-duration: 30s; }

@keyframes drift {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(30px, -22px) scale(1.05); }
}

/* ─── Layout ─── */

#wrapper {
  position: relative;
  z-index: 1;
  max-width: 660px;
  margin: 0 auto;
  padding: 56px 20px 48px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ─── Glass Material ─── */

.glass {
  position: relative;
  border-radius: var(--r);
  overflow: hidden;
  backdrop-filter: blur(22px) saturate(1.8) brightness(1.06);
  -webkit-backdrop-filter: blur(22px) saturate(1.8) brightness(1.06);
  background: rgba(255, 255, 255, 0.15);
  border: 0.5px solid rgba(255, 255, 255, 0.45);
  box-shadow:
    inset 0 0.5px 0 0 rgba(255, 255, 255, 0.5),
    0 4px 24px rgba(0, 0, 0, 0.05),
    0 1px 4px rgba(0, 0, 0, 0.03);
  transition: box-shadow 0.5s ease;
  will-change: transform;
}

.glass::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    ellipse 55% 55% at var(--lx, 50%) var(--ly, 0%),
    rgba(255, 255, 255, 0.3) 0%,
    rgba(255, 255, 255, 0.04) 45%,
    transparent 70%
  );
  pointer-events: none;
  z-index: 1;
  opacity: 0.6;
  transition: opacity 0.3s ease;
}

.glass:hover::before { opacity: 1; }

.glass::after {
  content: '';
  position: absolute;
  top: 0;
  left: 8%;
  right: 8%;
  height: 0.5px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  z-index: 2;
  pointer-events: none;
}

.glass:hover {
  box-shadow:
    inset 0 0.5px 0 0 rgba(255, 255, 255, 0.6),
    0 8px 36px rgba(0, 0, 0, 0.08),
    0 2px 8px rgba(0, 0, 0, 0.04);
}

.card { padding: 24px 28px; }

/* ─── Entrance ─── */

.anim-in {
  opacity: 0;
  animation: enter 0.6s var(--ease) forwards;
}

@keyframes enter {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}

/* ─── Header ─── */

header.card {
  text-align: center;
  padding: 30px 28px 24px;
}

header h1 {
  font-size: 2em;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.sub {
  margin-top: 4px;
  font-size: 0.88em;
  color: var(--text-2);
}

/* ─── Nav Pills ─── */

.nav-row {
  display: flex;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}

.pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 7px 16px;
  border-radius: var(--r-pill);
  overflow: hidden;
  backdrop-filter: blur(16px) saturate(1.6) brightness(1.04);
  -webkit-backdrop-filter: blur(16px) saturate(1.6) brightness(1.04);
  background: rgba(255, 255, 255, 0.2);
  border: 0.5px solid rgba(255, 255, 255, 0.35);
  box-shadow:
    inset 0 0.5px 0 rgba(255, 255, 255, 0.4),
    0 2px 8px rgba(0, 0, 0, 0.04);
  font-family: var(--font);
  font-size: 0.82em;
  font-weight: 500;
  color: var(--text-2);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.4s var(--spring), color 0.25s ease,
              box-shadow 0.3s ease, background 0.3s ease;
}

.pill::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(175deg, rgba(255, 255, 255, 0.25) 0%, transparent 45%);
  pointer-events: none;
}

.pill:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.32);
  transform: translateY(-2px) scale(1.04);
  box-shadow:
    inset 0 0.5px 0 rgba(255, 255, 255, 0.5),
    0 4px 14px rgba(0, 0, 0, 0.07);
}

/* ─── Content Sections ─── */

h2 {
  font-size: 1.05em;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}

.sec-text {
  font-size: 0.88em;
  line-height: 1.7;
  color: var(--text-2);
}

/* ─── Photos ─── */

.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 6px;
}

.photo-item {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  aspect-ratio: 1;
  background: rgba(0, 0, 0, 0.04);
  transition: transform 0.45s var(--spring), box-shadow 0.4s ease;
}

.photo-item:hover {
  transform: scale(1.04) translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.photo-item a { display: block; width: 100%; height: 100%; }
.photo-placeholder { position: relative; width: 100%; height: 100%; overflow: hidden; border-radius: 14px; }

.photo-thumb,
.photo-full {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 14px;
}

.photo-full { opacity: 0; transition: opacity 0.8s ease; }

.photo-item::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 14px;
  border: 0.5px solid rgba(255, 255, 255, 0.25);
  pointer-events: none;
  z-index: 1;
}

.load-more { display: block; margin: 12px auto 0; }

/* ─── Playground ─── */

.muted { color: var(--text-3); font-size: 0.88em; }

.sparkle {
  display: inline-block;
  animation: bob 3s ease-in-out infinite;
}

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

/* ─── Disclaimer ─── */

.disclaimer { padding: 0; }

.disc-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 24px;
  font-size: 0.82em;
  font-weight: 500;
  color: var(--text-3);
  cursor: pointer;
  user-select: none;
  transition: color 0.25s ease;
}

.disc-toggle:hover { color: var(--text-2); }

.chevron {
  font-size: 1.1em;
  display: inline-block;
  transition: transform 0.4s var(--spring);
}

.disclaimer.open > .disc-toggle .chevron { transform: rotate(45deg); }

.disc-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.5s var(--ease);
}

.disclaimer.open > .disc-body { grid-template-rows: 1fr; }

.disc-inner {
  overflow: hidden;
  padding: 0 24px;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.35s ease 0.05s, transform 0.35s var(--ease) 0.05s;
}

.disclaimer.open > .disc-body .disc-inner {
  opacity: 1;
  transform: none;
  padding-bottom: 14px;
}

.disc-inner > p { font-size: 0.8em; line-height: 1.6; color: var(--text-3); }

.fonts-section { margin-top: 8px; }

.fonts-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82em;
  font-weight: 500;
  color: var(--text-3);
  cursor: pointer;
  user-select: none;
  padding: 4px 0;
}

.fonts-toggle:hover { color: var(--text-2); }

.fonts-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.4s var(--ease);
}

.fonts-section.open .fonts-body { grid-template-rows: 1fr; }
.fonts-section.open .fonts-toggle .chevron { transform: rotate(45deg); }

.fonts-inner {
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.3s ease 0.05s;
}

.fonts-section.open .fonts-inner { opacity: 1; }
.fonts-inner p { font-size: 0.76em; color: var(--text-3); padding: 2px 0; }

.privacy-link {
  display: inline-block;
  margin-top: 8px;
  padding: 4px 12px;
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: var(--r-pill);
  font-size: 0.76em;
  font-weight: 500;
  color: var(--text-3);
  text-decoration: none;
  transition: background 0.25s ease, color 0.25s ease;
}

.privacy-link:hover { background: rgba(0, 0, 0, 0.06); color: var(--text-2); }

/* ─── Footer ─── */

footer.card { text-align: center; padding: 18px 28px; }
footer p { font-size: 0.76em; line-height: 1.9; color: var(--text-3); }

.footer-link {
  color: var(--text-3);
  text-decoration: none;
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.1);
  transition: color 0.25s ease;
}

.footer-link:hover { color: var(--text-2); }

/* ─── Lightbox ─── */

#lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10000;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

#lightbox.open { display: flex; animation: lb-in 0.4s var(--ease) forwards; }
#lightbox.closing { animation: lb-out 0.3s ease-in forwards; }

@keyframes lb-in {
  from { opacity: 0; backdrop-filter: blur(0); }
  to   { opacity: 1; backdrop-filter: blur(44px) saturate(1.2) brightness(0.93); }
}
@keyframes lb-out { from { opacity: 1; } to { opacity: 0; } }

#lb-center {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  cursor: default;
  perspective: 1200px;
}

#lightbox-wrap {
  position: relative;
  max-width: 90vw;
  max-height: 85vh;
  border-radius: var(--r);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
  border: 0.5px solid rgba(255, 255, 255, 0.35);
  box-shadow:
    inset 0 0.5px 0 rgba(255, 255, 255, 0.3),
    0 20px 60px rgba(0, 0, 0, 0.1),
    0 6px 20px rgba(0, 0, 0, 0.05);
  padding: 4px;
  will-change: transform;
  animation: lb-wrap-in 0.5s var(--spring) forwards;
  transform-style: preserve-3d;
}

.closing #lightbox-wrap { animation: lb-wrap-out 0.3s ease-in forwards; }

@keyframes lb-wrap-in {
  from { opacity: 0; transform: scale(0.88) translateY(20px); }
  to   { opacity: 1; transform: none; }
}
@keyframes lb-wrap-out {
  from { opacity: 1; } to { opacity: 0; transform: scale(0.92) translateY(12px); }
}

#lb-thumb, #lb-full {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: calc(var(--r) - 4px);
}

#lb-full {
  position: absolute;
  inset: 4px;
  width: calc(100% - 8px);
  height: calc(100% - 8px);
  opacity: 0;
  transition: opacity 0.6s ease;
}

#lb-caption {
  font-size: 0.78em;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 0.5px solid rgba(255, 255, 255, 0.2);
  padding: 5px 13px;
  border-radius: var(--r-pill);
}

#lb-prev, #lb-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 0.5px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  font-size: 1.4em;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease, transform 0.35s var(--spring);
}

#lb-prev { left: 16px; }
#lb-next { right: 16px; }

#lb-prev:hover, #lb-next:hover {
  background: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.9);
  transform: translateY(-50%) scale(1.06);
}

/* ─── Responsive ─── */

@media (max-width: 600px) {
  #wrapper { padding: 36px 12px; gap: 10px; }
  .glass { --r: 18px; }
  header.card { padding: 22px 20px 18px; }
  header h1 { font-size: 1.6em; }
  .card { padding: 18px 20px; }
  .photo-grid { grid-template-columns: repeat(2, 1fr); gap: 6px; }
  .pill { padding: 6px 13px; font-size: 0.78em; }
  #lb-prev { left: 8px; }
  #lb-next { right: 8px; }
  #lb-prev, #lb-next { width: 34px; height: 34px; font-size: 1.2em; }
}

@media (min-width: 860px) { #wrapper { max-width: 720px; } }
