/* ———————————————————————————————————————————————————————————
   Thomas Delli Antoni — Social Feed Portfolio
   Scoped to .social-root to avoid conflicts with /materias route
   ——————————————————————————————————————————————————————————— */

/* Fonts loaded via index.html <link> tags */

:root {
  --accent: #e85d2f;
  --bg: #fcfaf6;
  --bg-elev: #ffffff;
  --bg-tint: #f5efe4;
  --fg: #0f0e0c;
  --fg-muted: #6b665c;
  --fg-subtle: #9c968a;
  --line: #ebe4d5;
  --line-strong: #d8cfbc;
  --ring: #0f0e0c;
  --danger: #ff2e4d;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 20px;
  --max: 1040px;

  --font-sans: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-serif: 'Instrument Serif', 'Times New Roman', serif;
  --font-mono: 'Geist Mono', ui-monospace, monospace;
}

[data-theme="dark"] .social-root,
[data-theme="dark"].social-root {
  --bg: #0c0b09;
  --bg-elev: #161512;
  --bg-tint: #1c1a16;
  --fg: #f6f2ea;
  --fg-muted: #a8a294;
  --fg-subtle: #6b665c;
  --line: #2a2720;
  --line-strong: #3a362d;
  --ring: #f6f2ea;
}

[data-density="tight"] .social-root,
[data-density="tight"].social-root { --grid-gap: 2px; }
[data-density="cozy"] .social-root,
[data-density="cozy"].social-root  { --grid-gap: 4px; }
[data-density="airy"] .social-root,
[data-density="airy"].social-root  { --grid-gap: 12px; }

* { box-sizing: border-box; }

/* Scoped resets — only apply within social-root */
.social-root {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01", "cv01";
  min-height: 100vh;
}

.social-root button {
  font-family: inherit;
  cursor: pointer;
  border: 0;
  background: none;
  color: inherit;
}

.social-root a {
  color: inherit;
  text-decoration: none;
}

/* ——— MAIN ——— */
.main {
  max-width: var(--max); margin: 0 auto;
  padding: 32px 24px 80px;
}

/* ——— PROFILE HEADER ——— */
.profile-header {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 48px;
  padding: 24px 0 36px;
  align-items: start;
}
.profile-avatar { display: grid; place-items: center; }
.profile-row-1 {
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  margin-bottom: 22px;
}
.profile-handle-wrap { display: flex; align-items: center; gap: 6px; }
.profile-handle {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 40px;
  font-weight: 400;
  letter-spacing: -0.02em;
  margin: 0;
  line-height: 1;
}
.profile-actions { display: flex; gap: 8px; align-items: center; }

.lang-toggle {
  display: inline-flex;
  background: var(--bg-tint);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 2px;
  margin-left: 4px;
  font-family: var(--font-mono, var(--font-sans));
}
.lang-toggle-btn {
  padding: 6px 9px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--fg-muted);
  border-radius: 7px;
  background: transparent;
  transition: all 0.15s;
}
.lang-toggle-btn.on {
  background: var(--bg-elev);
  color: var(--fg);
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}
.lang-toggle-btn:not(.on):hover { color: var(--fg); }

.btn {
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 14px; font-weight: 500;
  border: 1px solid transparent;
  transition: all 0.15s;
  white-space: nowrap;
}
.btn-primary {
  background: var(--fg); color: var(--bg);
}
.btn-primary:hover { transform: translateY(-1px); }
.btn-secondary {
  background: var(--bg-tint); color: var(--fg);
  border-color: var(--line);
}
.btn-secondary:hover { background: var(--line); }
.btn-icon { padding: 8px 10px; }

.profile-row-2 {
  display: flex; gap: 40px; margin-bottom: 22px;
}
.stat { display: flex; gap: 6px; font-size: 15px; align-items: baseline; }
.stat-value { font-weight: 600; }
.stat-label { color: var(--fg-muted); }

.profile-row-3 { font-size: 15px; line-height: 1.55; }
.profile-name { font-weight: 600; margin-bottom: 2px; }
.profile-role { color: var(--fg-muted); margin-bottom: 10px; font-size: 14px; }
.profile-link {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--accent); font-weight: 500;
  margin-top: 6px;
}
.profile-link:hover { text-decoration: underline; }

/* ——— AVATAR ——— */
.avatar-wrap {
  border-radius: 999px;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.avatar {
  width: 100%; height: 100%;
  border-radius: 999px;
  display: grid; place-items: center;
  font-family: var(--font-serif); font-weight: 400;
  font-style: italic;
  border: 2px solid var(--bg);
  background-size: cover; background-position: center;
  overflow: hidden;
}

/* ——— HIGHLIGHTS ——— */
.highlights {
  margin: 24px 0 32px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 28px;
}
.highlights-rail {
  display: flex; gap: 28px;
  overflow-x: auto; scrollbar-width: none;
  padding: 4px 0;
}
.highlights-rail::-webkit-scrollbar { display: none; }
.highlight {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  min-width: 84px;
}
.highlight-ring {
  width: 80px; height: 80px;
  border-radius: 999px;
  padding: 3px;
  border: 1.5px solid var(--line-strong);
  overflow: hidden;
  transition: transform 0.15s;
}
.highlight:hover .highlight-ring { transform: scale(1.04); }
.highlight-ring .cover {
  border-radius: 999px;
}
.highlight-ring .cover-bigtext {
  font-size: 28px;
}
.highlight-label {
  font-size: 12px;
  color: var(--fg);
  max-width: 84px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ——— TABS ——— */
.tabs {
  display: flex; justify-content: center; gap: 64px;
  border-top: 1px solid var(--line);
}
.tab {
  padding: 18px 4px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.12em;
  color: var(--fg-subtle);
  display: flex; align-items: center; gap: 8px;
  border-top: 1.5px solid transparent;
  margin-top: -1px;
  transition: color 0.12s, border-color 0.12s;
}
.tab:hover { color: var(--fg-muted); }
.tab-active { color: var(--fg); border-top-color: var(--fg); }

/* ——— COVER (placeholder) ——— */
.cover {
  position: relative;
  width: 100%; height: 100%;
  display: grid; place-items: center;
  overflow: hidden;
}
.cover-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.cover-bigtext {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(40px, 8vw, 96px);
  letter-spacing: -0.03em;
  line-height: 1;
  text-align: center;
  padding: 0 16px;
  position: relative;
  z-index: 1;
}
.cover-label {
  position: absolute; bottom: 12px; left: 12px;
  font-family: var(--font-mono);
  font-size: 10px; letter-spacing: 0.04em;
  opacity: 0.85;
  z-index: 1;
}
.cover-phone {
  width: 45%; aspect-ratio: 9 / 19;
  background: rgba(255,255,255,0.9);
  border-radius: 24px;
  border: 1px solid rgba(0,0,0,0.15);
  box-shadow: 0 12px 30px rgba(0,0,0,0.15);
  position: relative;
  display: grid; place-items: center;
  color: #333;
}
.cover-phone-notch {
  position: absolute; top: 8px; left: 50%; transform: translateX(-50%);
  width: 28%; height: 14px; background: #111; border-radius: 8px;
}
.cover-phone-label {
  font-family: var(--font-mono); font-size: 10px; text-align: center;
  padding: 0 12px; color: #888;
}

/* ——— FEED GRID ——— */
.feed-grid {
  display: grid;
  gap: var(--grid-gap, 4px);
  padding-top: var(--grid-gap, 4px);
}
.grid-posts { grid-template-columns: repeat(3, 1fr); }
.grid-reels { grid-template-columns: repeat(3, 1fr); }

.grid-cell {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  cursor: pointer;
  background: var(--bg-tint);
  padding: 0; border: 0;
  display: block;
}
.reel-cell { aspect-ratio: 9/16; }

.grid-cell-overlay {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 14px;
  background: linear-gradient(180deg, rgba(0,0,0,0) 50%, rgba(0,0,0,0.55) 100%);
  opacity: 0;
  transition: opacity 0.2s;
  color: #fff;
  pointer-events: none;
}
.grid-cell:hover .grid-cell-overlay { opacity: 1; }

.grid-cell-meta {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center; gap: 28px;
  font-weight: 600; font-size: 15px;
}
.grid-cell-meta span {
  display: flex; align-items: center; gap: 6px;
}
.grid-cell-carousel-badge {
  position: absolute; top: 10px; right: 10px;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.4));
}
.grid-cell-title {
  position: relative;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.grid-cell-title-main {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 18px;
  letter-spacing: -0.01em;
  text-transform: none;
  margin-bottom: 2px;
}

/* Reel overlay (always visible gradient) */
.reel-cell-overlay {
  position: absolute; inset: 0;
  padding: 12px;
  background: linear-gradient(180deg, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0) 40%, rgba(0,0,0,0.7) 100%);
  color: #fff;
  display: flex; flex-direction: column; justify-content: space-between;
  pointer-events: none;
}
.reel-cell-play {
  align-self: flex-end;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.5));
}
.reel-cell-views {
  display: flex; align-items: center; gap: 6px;
  font-weight: 600; font-size: 13px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}
.reel-cell-title {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 18px;
  line-height: 1.1;
  margin-top: 4px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.6);
}

/* ——— PRESS CELLS ——— */
.press-cell {
  position: relative;
  cursor: default;
}
.press-cell::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0.72) 100%);
  z-index: 1;
  opacity: 1;
}
.press-cell-content {
  position: absolute; inset: 0;
  z-index: 2;
  padding: 20px;
  display: flex; flex-direction: column; justify-content: flex-end;
  color: #fff;
  gap: 6px;
}
.press-outlet {
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase;
  opacity: 0.9;
}
.press-label {
  font-size: 18px; line-height: 1.25;
  font-weight: 500;
  font-family: var(--font-serif);
  text-wrap: pretty;
}
.press-year {
  font-size: 12px;
  opacity: 0.7;
  margin-top: 4px;
}

/* ——— MODAL ——— */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(4px);
  display: grid; place-items: center;
  padding: 20px;
  animation: fadeIn 0.18s;
  overflow-y: auto;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-close {
  position: absolute; top: 16px; right: 16px;
  width: 40px; height: 40px; border-radius: 999px;
  background: rgba(255,255,255,0.1); color: #fff;
  display: grid; place-items: center;
  z-index: 10;
  border: 0; cursor: pointer;
}
.modal-close:hover { background: rgba(255,255,255,0.2); }

.modal-post {
  width: 100%; max-width: 1100px; max-height: 92vh;
  background: var(--bg-elev);
  border-radius: var(--radius-lg);
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0,0,0,0.3);
  animation: popIn 0.22s cubic-bezier(.2,.8,.2,1);
}
@keyframes popIn { from { opacity: 0; transform: scale(0.96);} to { opacity: 1; transform: scale(1);} }

/* ——— CAROUSEL ——— */
.modal-carousel {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  background: #000;
  user-select: none;
}
.carousel-track {
  display: flex; width: 100%; height: 100%;
  transition: transform 0.35s cubic-bezier(.2,.8,.2,1);
}
.carousel-slide {
  flex: 0 0 100%; height: 100%;
  display: grid;
}
.carousel-quote {
  width: 100%; height: 100%;
  display: grid; place-items: center;
  text-align: center;
  padding: 48px;
  position: relative;
}
.carousel-quote-mark {
  font-family: var(--font-serif);
  font-size: 180px; line-height: 0.5;
  position: absolute; top: 60px; left: 50%; transform: translateX(-50%);
  opacity: 0.4;
}
.carousel-quote-text {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(22px, 3vw, 36px);
  line-height: 1.25;
  max-width: 500px;
  position: relative;
}
.carousel-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; border-radius: 999px;
  background: rgba(255,255,255,0.9); color: #111;
  display: grid; place-items: center;
  transition: transform 0.15s;
  border: 0; cursor: pointer;
}
.carousel-nav:hover { transform: translateY(-50%) scale(1.08); }
.carousel-nav-prev { left: 12px; }
.carousel-nav-next { right: 12px; }
.carousel-dots {
  position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 5px;
}
.carousel-dot {
  width: 6px; height: 6px; border-radius: 999px;
  background: rgba(255,255,255,0.5);
  transition: all 0.15s;
}
.carousel-dot-active { background: #fff; width: 6px; }
.carousel-count {
  position: absolute; top: 14px; right: 14px;
  padding: 4px 10px; border-radius: 999px;
  background: rgba(0,0,0,0.55); color: #fff;
  font-size: 12px; font-weight: 600;
}
.heart-burst {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  pointer-events: none;
  animation: heartBurst 0.7s forwards;
}
@keyframes heartBurst {
  0% { opacity: 0; transform: scale(0.2); }
  30% { opacity: 1; transform: scale(1.1); }
  60% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(0.95); }
}

/* ——— MODAL SIDE ——— */
.modal-side {
  display: flex; flex-direction: column;
  min-width: 0;
}
.modal-side-header {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.modal-side-header-info { flex: 1; min-width: 0; }
.modal-side-handle {
  font-weight: 600; font-size: 14px;
  display: flex; align-items: center; gap: 4px;
}
.modal-side-subtitle {
  font-size: 12px; color: var(--fg-muted);
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}
.icon-btn {
  display: grid; place-items: center;
  width: 36px; height: 36px; border-radius: 8px;
  transition: background 0.12s;
  color: var(--fg);
  border: 0; cursor: pointer; background: none;
}
.icon-btn:hover { background: var(--bg-tint); }
.icon-btn-lg { width: 40px; height: 40px; }
.save-btn { margin-left: auto; }

.modal-side-body {
  flex: 1; overflow-y: auto;
  padding: 18px;
}
.modal-caption { font-size: 14px; line-height: 1.55; margin-bottom: 20px; }
.modal-caption-handle { font-weight: 600; }
.modal-caption-title { font-weight: 600; }
.modal-caption-sub { color: var(--fg-muted); }
.modal-caption-text { margin-top: 8px; color: var(--fg); }

.inline-link {
  display: inline-flex; align-items: center; gap: 4px;
  color: var(--accent); font-weight: 500; font-size: 14px;
  margin-top: 10px;
  border: 0; padding: 0; background: none; cursor: pointer;
}
.inline-link:hover { text-decoration: underline; }
.inline-link-muted { color: var(--fg-muted); }

.modal-details {
  margin-top: 14px;
  padding: 14px;
  background: var(--bg-tint);
  border-radius: var(--radius);
  font-size: 13px;
}
.detail-row {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 14px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}
.detail-row:last-child { border-bottom: 0; }
.detail-label {
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--fg-muted);
  padding-top: 2px;
}
.detail-value { color: var(--fg); }

.modal-comments {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 12px;
}
.modal-comment {
  font-size: 14px; line-height: 1.5;
}
.modal-comment-user { font-weight: 600; }

.modal-testimonials {
  border-top: 1px solid var(--line);
  padding-top: 16px;
  margin-top: 4px;
}
.modal-testimonials-label {
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--fg-muted);
  margin-bottom: 10px;
}
.modal-testimonials .modal-comment {
  font-style: italic;
  color: var(--fg);
  padding-left: 12px;
  border-left: 2px solid var(--accent);
  font-size: 13px;
}
.modal-testimonials .modal-comment-user {
  display: block;
  font-style: normal;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-top: 4px;
  font-weight: 600;
}
.modal-testimonials .modal-comment-user::before { content: "— "; }

.modal-side-actions {
  border-top: 1px solid var(--line);
  padding: 12px 14px 14px;
  flex-shrink: 0;
}
.actions-row { display: flex; align-items: center; gap: 4px; position: relative; }
.copied-toast {
  position: absolute; top: -32px; left: 50%; transform: translateX(-50%);
  background: var(--fg); color: var(--bg);
  padding: 6px 12px; border-radius: 999px;
  font-size: 12px; font-weight: 500;
  animation: toastIn 0.2s;
  white-space: nowrap;
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 4px); } to { opacity: 1; transform: translate(-50%, 0); } }

.modal-date {
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.08em; color: var(--fg-subtle);
  margin-top: 6px;
}

/* ——— STORIES ——— */
.stories-backdrop {
  position: fixed; inset: 0; z-index: 120;
  background: rgba(0,0,0,0.92);
  display: grid; place-items: center;
  padding: 20px;
  animation: fadeIn 0.18s;
}
.stories-stage {
  display: flex; align-items: center; gap: 20px;
  max-width: 100%;
  max-height: 100%;
}
.stories-side {
  width: 44px; height: 44px; border-radius: 999px;
  background: rgba(255,255,255,0.12); color: #fff;
  display: grid; place-items: center;
  transition: background 0.12s;
  flex-shrink: 0;
  border: 0; cursor: pointer;
}
.stories-side:hover { background: rgba(255,255,255,0.22); }

.stories-card {
  position: relative;
  width: min(420px, calc(100vw - 140px));
  aspect-ratio: 9/16;
  max-height: calc(100vh - 40px);
  height: auto;
  border-radius: var(--radius-lg);
  overflow: hidden;
  padding: 14px;
  display: flex; flex-direction: column;
  animation: popIn 0.22s cubic-bezier(.2,.8,.2,1);
  box-shadow: 0 30px 80px rgba(0,0,0,0.5);
}
@media (max-aspect-ratio: 9/16) {
  .stories-card { width: auto; height: calc(100vh - 40px); max-height: calc(100vh - 40px); }
}
.stories-progress {
  display: flex; gap: 4px;
  margin-bottom: 14px;
  position: relative; z-index: 2;
}
.stories-progress-track {
  flex: 1; height: 2.5px;
  background: rgba(255,255,255,0.35);
  border-radius: 999px; overflow: hidden;
}
.stories-progress-fill {
  height: 100%; background: rgba(255,255,255,0.95);
  transition: width 0.08s linear;
}
.stories-header {
  display: flex; align-items: center; gap: 10px;
  position: relative; z-index: 2;
  margin-bottom: 6px;
}
.stories-handle {
  font-weight: 600; font-size: 14px;
  flex: 1;
  color: #fff;
}
.stories-story-name {
  font-weight: 400; opacity: 0.8;
  font-style: italic;
  font-family: var(--font-serif);
  font-size: 16px;
}
.stories-time { font-size: 12px; opacity: 0.7; color: #fff; }

.stories-content {
  flex: 1;
  display: flex; flex-direction: column; justify-content: center;
  padding: 20px 8px;
  position: relative; z-index: 2;
  text-align: left;
}
.stories-title {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(32px, 7vw, 52px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}
.stories-body {
  font-size: 17px; line-height: 1.45;
  max-width: 32ch;
  opacity: 0.92;
}
.stories-author {
  margin-top: 16px;
  font-family: var(--font-mono); font-size: 12px;
  opacity: 0.7;
}
.stories-cta {
  align-self: flex-start;
  margin-top: 24px;
  padding: 12px 20px;
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 999px;
  color: inherit;
  font-weight: 500; font-size: 14px;
  backdrop-filter: blur(6px);
  transition: background 0.12s;
  cursor: pointer;
}
.stories-cta:hover { background: rgba(255,255,255,0.3); }

.stories-tap {
  position: absolute; top: 0; bottom: 0;
  background: transparent; border: 0; cursor: pointer;
  z-index: 1;
}
.stories-tap-left { left: 0; width: 30%; }
.stories-tap-right { right: 0; width: 70%; }

.stories-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px; height: 40px;
  border-radius: 999px;
  background: rgba(0,0,0,0.35);
  color: #fff;
  display: grid; place-items: center;
  z-index: 3;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.2);
  transition: background 0.12s, transform 0.12s;
  cursor: pointer;
}
.stories-arrow:hover { background: rgba(0,0,0,0.55); transform: translateY(-50%) scale(1.06); }
.stories-arrow:active { transform: translateY(-50%) scale(0.95); }
.stories-arrow-prev { left: 10px; }
.stories-arrow-next { right: 10px; }

.stories-reply {
  display: flex; gap: 6px; align-items: center;
  position: relative; z-index: 2;
  margin-top: auto;
}
.stories-reply-input {
  flex: 1;
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(255,255,255,0.3);
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  outline: 0;
  font-family: inherit; font-size: 14px;
}
.stories-reply-input::placeholder { color: rgba(255,255,255,0.7); }

/* ——— DM ——— */
.dm-modal {
  width: 100%; max-width: 520px; height: 82vh;
  max-height: 760px;
  background: var(--bg-elev);
  border-radius: var(--radius-lg);
  display: flex; flex-direction: column;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0,0,0,0.3);
  animation: popIn 0.22s cubic-bezier(.2,.8,.2,1);
}
.dm-header {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.dm-back { display: none; }
.dm-header-info { flex: 1; min-width: 0; }
.dm-header-name {
  font-weight: 600; font-size: 14px;
  display: flex; align-items: center; gap: 4px;
}
.dm-header-status {
  font-size: 11px; color: var(--fg-muted);
  display: flex; align-items: center; gap: 5px;
  font-family: var(--font-mono);
}
.dm-dot {
  width: 6px; height: 6px; border-radius: 999px;
  background: #22c55e; box-shadow: 0 0 0 2px rgba(34,197,94,0.15);
  flex-shrink: 0;
}

.dm-scroll {
  flex: 1; overflow-y: auto;
  padding: 20px 16px;
  display: flex; flex-direction: column; gap: 8px;
}
.dm-intro {
  display: flex; flex-direction: column; align-items: center;
  padding: 20px 8px 30px;
  gap: 6px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
}
.dm-intro-name {
  font-family: var(--font-serif); font-style: italic;
  font-size: 22px;
  margin-top: 12px;
}
.dm-intro-sub { font-size: 13px; color: var(--fg-muted); }
.dm-intro-note {
  font-size: 12px; color: var(--fg-subtle);
  margin-top: 8px; text-align: center;
  max-width: 280px;
}

.dm-msg {
  display: flex; align-items: flex-end;
  max-width: 80%;
  animation: slideIn 0.2s;
}
@keyframes slideIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
.dm-msg-bot { align-self: flex-start; }
.dm-msg-me {
  align-self: flex-end;
  flex-direction: row-reverse;
}
.dm-bubble {
  padding: 9px 14px;
  border-radius: 18px;
  font-size: 14px; line-height: 1.4;
  max-width: 100%;
  word-wrap: break-word;
}
.dm-msg-bot .dm-bubble {
  background: var(--bg-tint);
  color: var(--fg);
  border-bottom-left-radius: 4px;
}
.dm-msg-me .dm-bubble {
  background: var(--fg);
  color: var(--bg);
  border-bottom-right-radius: 4px;
}
.dm-typing {
  display: flex; gap: 4px;
  padding: 12px 14px;
}
.dm-typing span {
  width: 7px; height: 7px; border-radius: 999px;
  background: var(--fg-subtle);
  animation: typingBounce 1.2s infinite;
}
.dm-typing span:nth-child(2) { animation-delay: 0.15s; }
.dm-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-4px); opacity: 1; }
}

.dm-composer {
  border-top: 1px solid var(--line);
  padding: 12px;
  flex-shrink: 0;
}
.dm-chips {
  display: flex; flex-wrap: wrap; gap: 8px;
  justify-content: flex-end;
}
.dm-chip {
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--bg);
  border: 1.5px solid var(--accent);
  color: var(--accent);
  font-size: 13px; font-weight: 500;
  transition: all 0.12s;
  cursor: pointer;
}
.dm-chip:hover { background: var(--accent); color: #fff; }

.dm-input-row {
  display: flex; gap: 8px; align-items: flex-end;
}
.dm-input {
  flex: 1;
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: 20px;
  padding: 10px 14px;
  font-family: inherit; font-size: 14px;
  color: var(--fg);
  outline: 0;
  resize: none;
}
.dm-input:focus { border-color: var(--fg-muted); }
.dm-textarea { line-height: 1.4; }

.dm-send {
  width: 36px; height: 36px; border-radius: 999px;
  background: var(--accent); color: #fff;
  display: grid; place-items: center;
  transition: all 0.12s;
  border: 0; cursor: pointer;
}
.dm-send:disabled { opacity: 0.35; cursor: not-allowed; }
.dm-send:not(:disabled):hover { transform: scale(1.05); }

.dm-confirm { display: flex; flex-direction: column; gap: 12px; }
.dm-summary {
  background: var(--bg-tint);
  border-radius: var(--radius);
  padding: 14px;
  font-size: 13px;
  display: flex; flex-direction: column; gap: 8px;
}
.dm-summary > div { display: grid; grid-template-columns: 80px 1fr; gap: 10px; }
.dm-summary span {
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--fg-muted);
  padding-top: 2px;
}
.dm-summary strong { font-weight: 600; }
.dm-summary p { margin: 0; line-height: 1.5; }

.dm-submit-btn {
  background: var(--fg); color: var(--bg);
  padding: 12px 16px;
  border-radius: var(--radius);
  font-weight: 500; font-size: 14px;
  transition: transform 0.12s;
  border: 0; cursor: pointer;
}
.dm-submit-btn:hover { transform: translateY(-1px); }

.dm-composer-sent {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  background: var(--bg-elev);
  border-top: 2px solid rgba(34, 197, 94, 0.3);
}
.dm-sent-badge {
  display: flex; align-items: center; gap: 8px;
  color: #16a34a;
  font-weight: 500; font-size: 14px;
}
.dm-close-btn {
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg);
  font-weight: 500; font-size: 13px;
  cursor: pointer;
}

/* ——— MOBILE NAV (phone only) ——— */
.mobile-nav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0;
  z-index: 50;
  background: var(--bg);
  backdrop-filter: blur(14px);
  opacity: 0.95;
  border-top: 1px solid var(--line);
  justify-content: space-around;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
}
.mobile-nav-btn {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  color: var(--fg);
  border: 0; background: none; cursor: pointer;
}

/* ——— FOOTER ——— */
.social-footer {
  margin-top: 60px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
  color: var(--fg-muted);
  font-size: 12px;
  display: flex; flex-direction: column; gap: 12px;
  align-items: center;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
}
.footer-links { display: flex; flex-wrap: wrap; gap: 22px; justify-content: center; }
.social-footer .footer-links a:hover { color: var(--fg); }

/* ——— RESPONSIVE ——— */
@media (max-width: 820px) {
  .main { padding: 16px 0 80px; }
  .profile-header {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 16px;
  }
  .profile-avatar { justify-content: flex-start; }
  .profile-avatar .avatar-wrap { width: 96px !important; height: 96px !important; }
  .profile-row-1 { margin-bottom: 14px; }
  .profile-handle { font-size: 28px; }
  .profile-actions { width: 100%; gap: 6px; }
  .profile-actions .btn:not(.btn-icon) { flex: 1; }
  .profile-row-2 {
    display: flex; justify-content: space-around;
    margin: 0 -16px;
    padding: 14px 16px;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
  }
  .profile-row-2 .stat {
    flex-direction: column; align-items: center; gap: 2px;
    font-size: 14px;
  }
  .profile-row-3 { padding: 0 0 16px; }
  .highlights { padding: 0 16px 18px; margin: 8px 0 0; }
  .highlight-ring { width: 64px; height: 64px; }
  .highlight-ring .cover-bigtext { font-size: 22px; }
  .tabs { gap: 40px; }
  .feed-grid.grid-posts, .feed-grid.grid-reels { gap: 2px; }
  .grid-cell-title { display: none; }
  .cover-bigtext { font-size: clamp(28px, 9vw, 48px); }
  .cover-label { font-size: 9px; bottom: 6px; left: 6px; }
  .grid-cell-carousel-badge svg { width: 14px; height: 14px; }
  .grid-cell-carousel-badge { top: 6px; right: 6px; }
  .grid-reels { grid-template-columns: repeat(2, 1fr); }
  .reel-cell { aspect-ratio: 9/14; }
  .reel-cell-overlay { padding: 10px; }
  .reel-cell-title { font-size: 14px; line-height: 1.15; }
  .reel-cell-views { font-size: 11px; }
  .cover-phone { width: 52%; }

  .modal-post {
    grid-template-columns: 1fr;
    max-height: 94vh;
    height: 94vh;
    width: 100%;
    max-width: 100%;
    border-radius: 14px;
  }
  .modal-carousel { aspect-ratio: 1; max-height: 45vh; width: 100%; }
  .modal-side { min-width: 0; width: 100%; }
  .modal-side-body { padding: 14px; }
  .modal-backdrop { padding: 10px; }

  .dm-modal {
    max-width: 100%; height: 100vh; max-height: 100vh;
    border-radius: 0;
  }
  .dm-back { display: grid; }
  .dm-header > .icon-btn:last-child { display: none; }

  .mobile-nav { display: flex; }
  .social-footer { padding: 32px 16px 0; }

  .stories-backdrop { padding: 0; }
  .stories-stage { gap: 0; width: 100%; height: 100%; position: relative; }
  .stories-side {
    position: absolute;
    top: 50%; transform: translateY(-50%);
    width: 40px; height: 40px;
    background: rgba(0,0,0,0.35);
    backdrop-filter: blur(8px);
    z-index: 5;
    border: 1px solid rgba(255,255,255,0.15);
  }
  .stories-side-prev { left: 10px; }
  .stories-side-next { right: 10px; }
  .stories-card {
    width: 100vw;
    height: 100vh;
    max-height: 100vh;
    max-width: 100vw;
    aspect-ratio: auto;
    border-radius: 0;
    padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
    padding-top: calc(12px + env(safe-area-inset-top));
  }
  .stories-title { font-size: clamp(28px, 8vw, 44px); }
  .stories-body { font-size: 16px; }
  .modal-close { top: calc(10px + env(safe-area-inset-top)); right: 10px; z-index: 140; }
}

@media (max-height: 620px) {
  .stories-card {
    aspect-ratio: auto;
    height: calc(100vh - 40px);
    width: min(360px, 52vh);
    max-height: calc(100vh - 40px);
  }
  .stories-title { font-size: clamp(24px, 5vh, 40px); margin-bottom: 10px; }
  .stories-body { font-size: 15px; }
  .stories-content { padding: 12px 6px; }
  .stories-cta { margin-top: 14px; padding: 10px 16px; }
}

@media (max-width: 420px) {
  .profile-handle { font-size: 24px; }
  .tabs { gap: 24px; }
  .tab span { display: none; }
  .tab { padding: 14px 18px; }
}
