/* ── Katya App — Base Design System & Layout ── */

:root {
  --black: #050505;
  --deep: #0c0c0c;
  --card: #121212;
  --gold: #c4a24e;
  --gold-light: #dfc873;
  --gold-bright: #f0d98c;
  --gold-dim: #7a6430;
  --silver: #d0d0d0;
  --white: #f5f5f0;
  --gray: #5a5a5a;
  --danger: #c44e4e;
  --success: #4ec46e;
  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: 'Outfit', sans-serif;
  --radius: 2px;
  --nav-height: 60px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ── Reset ── */

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--sans);
  font-weight: 400;
  background: var(--black);
  color: var(--white);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-light); }

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

button {
  font-family: var(--sans);
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
  font-size: inherit;
}

input, textarea, select {
  font-family: var(--sans);
  font-size: 1rem;
}

/* ── Grain Overlay ── */

.grain-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

/* ── Typography ── */

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 600;
  color: var(--white);
  line-height: 1.2;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }

.text-gold { color: var(--gold); }
.text-dim { color: var(--gray); }
.text-small { font-size: 0.85rem; }
.text-center { text-align: center; }

/* ── App View ── */

.app-view {
  min-height: 100vh;
  min-height: 100dvh;
  padding-bottom: calc(var(--nav-height) + var(--safe-bottom) + 16px);
}

/* ── Bottom Navigation ── */

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(var(--nav-height) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: var(--deep);
  border-top: 1px solid rgba(196, 162, 78, 0.15);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 100;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 16px;
  color: var(--gray);
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: color 0.2s;
}

.nav-btn svg {
  width: 22px;
  height: 22px;
}

.nav-btn--active {
  color: var(--gold);
}

.nav-btn--upload {
  background: var(--gold);
  color: var(--black);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  padding: 0;
  margin-top: -12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-btn--upload span { display: none; }

.nav-btn--upload.nav-btn--active {
  background: var(--gold-light);
  color: var(--black);
}

/* ── Cards ── */

.card {
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 12px;
  border: 1px solid rgba(196, 162, 78, 0.08);
}

.card-media {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: var(--deep);
}

.card-media img,
.card-media video {
  width: 100%;
  display: block;
  object-fit: cover;
}

.card-media img[loading="lazy"] {
  min-height: 200px;
}

.card-body {
  padding: 14px 16px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.card-caption {
  color: var(--silver);
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 10px;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--gray);
}

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

.card-action-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--gray);
  font-size: 0.8rem;
  transition: color 0.2s;
}

.card-action-btn:hover,
.card-action-btn--active {
  color: var(--gold);
}

.card-action-btn svg {
  width: 18px;
  height: 18px;
}

/* ── Locked Content Overlay ── */

.card-locked-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(5, 5, 5, 0.5);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 2;
  gap: 8px;
}

.card-locked-overlay svg {
  width: 32px;
  height: 32px;
  color: var(--gold);
}

.card-locked-overlay span {
  font-size: 0.85rem;
  color: var(--gold-light);
  font-weight: 500;
}

/* ── Tier Badges ── */

.tier-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius);
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.badge--free {
  background: rgba(90, 90, 90, 0.3);
  color: var(--silver);
}

.badge--gold {
  background: rgba(196, 162, 78, 0.2);
  color: var(--gold-light);
  border: 1px solid rgba(196, 162, 78, 0.3);
}

.badge--diamond {
  background: rgba(78, 140, 196, 0.2);
  color: #8ec5e8;
  border: 1px solid rgba(78, 140, 196, 0.3);
}

.badge--crown {
  background: rgba(140, 78, 196, 0.2);
  color: #c48ee8;
  border: 1px solid rgba(140, 78, 196, 0.3);
}

/* ── Buttons ── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.btn--primary {
  background: var(--gold);
  color: var(--black);
}

.btn--primary:hover {
  background: var(--gold-light);
}

.btn--primary:disabled {
  background: var(--gold-dim);
  cursor: not-allowed;
}

.btn--outline {
  background: transparent;
  border: 1px solid var(--gold);
  color: var(--gold);
}

.btn--outline:hover {
  background: rgba(196, 162, 78, 0.1);
}

.btn--danger {
  background: var(--danger);
  color: var(--white);
}

.btn--ghost {
  color: var(--gray);
  padding: 8px 12px;
  font-size: 0.85rem;
}

.btn--ghost:hover {
  color: var(--white);
}

.btn--block {
  width: 100%;
}

.btn--sm {
  padding: 8px 16px;
  font-size: 0.8rem;
}

/* ── Loading / Skeleton ── */

.skeleton {
  background: linear-gradient(
    90deg,
    var(--deep) 25%,
    rgba(30, 30, 30, 1) 50%,
    var(--deep) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-pulse 1.5s ease-in-out infinite;
  border-radius: var(--radius);
}

@keyframes skeleton-pulse {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-card {
  margin: 12px;
  border-radius: var(--radius);
  overflow: hidden;
}

.skeleton-media {
  width: 100%;
  height: 300px;
}

.skeleton-line {
  height: 14px;
  margin: 10px 16px;
}

.skeleton-line--short { width: 40%; }
.skeleton-line--medium { width: 70%; }

.spinner {
  width: 28px;
  height: 28px;
  border: 2px solid var(--gray);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 24px auto;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
