:root {
  /* Colors */
  --color-bg: #fcfbfb;
  --color-primary: #ef4d3c;
  --color-text: #37342d;
  --color-muted: #f3f4f6;
  --color-border: #e5e7eb;
  --color-white: #ffffff;
  --color-shadow: rgba(55, 52, 45, 0.08);
  
  /* Typography */
  --font-serif: 'Playfair Display', serif;
  --font-sans: 'Inter', sans-serif;
  
  /* Spacing */
  --space-unit: 4px;
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  
  /* Effects */
  --radius: 8px;
  --shadow-soft: 0 4px 20px var(--color-shadow);
  --glass: rgba(255, 255, 255, 0.7);
  --blur: blur(8px);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  line-height: 1.5;
  overflow-x: hidden;
  height: 100vh;
  width: 100vw;
}

h1, h2, h3 {
  font-family: var(--font-serif);
  letter-spacing: -0.02em;
}

/* Layout */
.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-width: 480px;
  margin: 0 auto;
  position: relative;
  background-color: var(--color-bg);
  overflow: hidden;
}

/* Header */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg);
  z-index: 10;
}

.header-title {
  font-size: 1.25rem;
  font-weight: 700;
  text-align: center;
}

.nav-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  transition: transform 0.2s ease;
}

.nav-btn:active {
  transform: scale(0.9);
}

/* Main Swipe Area */
.gallery-viewport {
  flex: 1;
  position: relative;
  padding: var(--space-md);
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1000px;
}

.card-stack {
  position: relative;
  width: 100%;
  height: 85%;
  max-height: 600px;
}

.card {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--color-white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
  cursor: grab;
}

.card:active {
  cursor: grabbing;
}

/* Card States */
.card-next {
  transform: scale(0.92) translateY(20px);
  z-index: 1;
  opacity: 0.6;
}

.card-current {
  z-index: 2;
}

.card-image-container {
  width: 100%;
  height: 100%;
  position: relative;
}

.card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Swiping Overlays */
.overlay-label {
  position: absolute;
  top: 40px;
  padding: 8px 16px;
  border: 4px solid;
  border-radius: var(--radius);
  font-size: 2rem;
  font-weight: 800;
  text-transform: uppercase;
  font-family: var(--font-sans);
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.overlay-like {
  left: 30px;
  color: #4CAF50;
  border-color: #4CAF50;
  transform: rotate(-15deg);
}

.overlay-skip {
  right: 30px;
  color: var(--color-primary);
  border-color: var(--color-primary);
  transform: rotate(15deg);
}

/* Simulation of states via separate pages or interactive-like classes */
.card.swiping-right {
  transform: translate(150%, -20%) rotate(20deg);
  opacity: 0;
}

.card.swiping-left {
  transform: translate(-150%, -20%) rotate(-20deg);
  opacity: 0;
}

/* Bottom Controls */
.controls {
  padding: var(--space-xl) var(--space-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-lg);
  z-index: 10;
}

.btn-action {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background: var(--color-white);
  color: var(--color-text);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-action:active {
  transform: scale(0.9);
}

.btn-action.primary {
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.btn-action.primary:active {
  background-color: var(--color-primary);
  color: var(--color-white);
}

.btn-small {
  width: 40px;
  height: 40px;
  color: #9ca3af;
  border-color: transparent;
  box-shadow: none;
  background: transparent;
}

/* Comment Drawer */
.comment-drawer {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: var(--color-white);
  padding: var(--space-lg);
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  box-shadow: 0 -10px 40px rgba(0,0,0,0.1);
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  z-index: 20;
}

.comment-drawer.open {
  transform: translateY(0);
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-lg);
}

.comment-input-wrap {
  background: var(--color-muted);
  border-radius: var(--radius);
  padding: var(--space-sm) var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.comment-input {
  border: none;
  background: none;
  flex: 1;
  padding: 8px 0;
  font-family: var(--font-sans);
  color: var(--color-text);
  outline: none;
}

.comment-input::placeholder {
  color: #9ca3af;
}

/* Micro-animations */
@keyframes heartPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

.pulse {
  animation: heartPulse 0.4s ease-out;
}

.placeholder-image {
  width: 100%;
  height: 100%;
  background: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.placeholder-image::after {
  content: attr(data-label);
  font-family: var(--font-serif);
  color: #999;
  font-style: italic;
}

/* Visual textures */
.grain {
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
  opacity: 0.03;
  pointer-events: none;
  z-index: 5;
}

/* Album View Styles */
.album-scroll-area {
  flex: 1;
  overflow-y: auto;
  padding: 0 var(--space-lg);
}

.album-hero {
  text-align: center;
  padding: var(--space-xl) 0;
}

.album-meta {
  font-size: 0.875rem;
  color: #9ca3af;
  margin-top: var(--space-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.album-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
  padding-bottom: var(--space-xl);
}

.grid-item {
  position: relative;
  aspect-ratio: 4/5;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 2px 10px var(--color-shadow);
  text-decoration: none;
  background: var(--color-white);
  transition: transform 0.2s ease;
}

.grid-item:active {
  transform: scale(0.98);
}

.grid-item .placeholder-image {
  height: 100%;
}

.grid-item-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--space-sm);
  background: linear-gradient(transparent, rgba(0,0,0,0.4));
  color: white;
  font-size: 0.75rem;
  font-family: var(--font-serif);
}

.album-actions {
  display: flex;
  justify-content: center;
  gap: var(--space-md);
  margin-top: var(--space-lg);
}

.btn-pill {
  padding: var(--space-sm) var(--space-lg);
  border-radius: 20px;
  border: 1px solid var(--color-border);
  background: var(--color-white);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  text-decoration: none;
}
