:root {
  --bg: #FAFAFA;
  --bg-card: #FFFFFF;
  --text: #262626;
  --text-light: #555555;
  --text-muted: #8E8E8E;
  --accent: #262626;
  --accent-gradient: linear-gradient(45deg, #555, #262626, #000);
  --border: #EFEFEF;
  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-sans: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --radius: 8px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 18px; -webkit-font-smoothing: antialiased; scroll-behavior: smooth; }
body { font-family: var(--font-sans); background: var(--bg); color: var(--text); line-height: 1.6; min-height: 100vh; }
::selection { background: #262626; color: white; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ===== PAGE LAYOUT ===== */
.page-layout {
  display: flex;
  justify-content: center;
  gap: 0;
  max-width: 760px;
  margin: 0 auto;
  position: relative;
}

.feed-wrapper {
  width: 100%;
  max-width: 520px;
  padding: 0 16px 80px;
}

/* ===== SIDE NAV ===== */
.side-nav {
  position: sticky;
  top: 50%;
  transform: translateY(-50%);
  height: fit-content;
  align-self: flex-start;
  padding: 0 8px 0 0;
  margin-top: 50vh;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 50;
}

.side-nav-link {
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 14px;
  border-radius: 100px;
  text-align: right;
  white-space: nowrap;
  transition: color 0.2s, background 0.2s;
  font-family: var(--font-sans);
}

.side-nav-link:hover {
  color: var(--text);
  background: var(--border);
}

.side-nav-link.active {
  color: var(--accent);
  background: rgba(38, 38, 38, 0.06);
}

/* ===== PROFILE HERO ===== */
.profile-hero {
  padding: 52px 0 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.profile-avatar-ring {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  padding: 3px;
  background: var(--accent-gradient);
  margin-bottom: 16px;
}

.profile-avatar-ring img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--bg);
}

.profile-name {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 400;
  font-style: italic;
  line-height: 1.15;
  margin-bottom: 4px;
}

.profile-subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
  letter-spacing: 0.03em;
  margin-bottom: 12px;
}

.profile-links {
  display: flex;
  gap: 18px;
  margin-bottom: 16px;
}

.profile-link-icon {
  width: 18px;
  height: 18px;
  color: var(--text);
  transition: color 0.2s;
}

.profile-link-icon:hover { color: var(--text-muted); }

/* ===== BIO ===== */
.bio-banner {
  padding: 12px 0 22px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
  text-align: center;
}

.bio-text {
  font-size: 0.86rem;
  color: var(--text-light);
  line-height: 1.65;
  max-width: 420px;
  margin: 0 auto;
}

.bio-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
  justify-content: center;
}

.bio-tag {
  font-size: 0.62rem;
  font-weight: 500;
  color: var(--accent);
  background: rgba(38, 38, 38, 0.06);
  padding: 4px 12px;
  border-radius: 100px;
}

/* ===== METRICS PANEL ===== */
.bio-metrics {
  display: flex;
  justify-content: center;
  gap: 0;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.bio-metric {
  flex: 1;
  text-align: center;
  padding: 4px 8px;
  position: relative;
}

.bio-metric:not(:last-child)::after {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 28px;
  background: var(--border);
}

.bio-metric-value {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
}

.bio-metric-label {
  font-size: 0.58rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ===== QUICK CARDS ===== */
.quick-cards {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.quick-card {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
  text-decoration: none;
  color: var(--text);
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
}

.quick-card:hover {
  background: var(--bg);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.quick-card-favicon {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  flex-shrink: 0;
  image-rendering: crisp-edges;
}

.quick-card-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.quick-card-title {
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.quick-card-url {
  font-size: 0.62rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.quick-card-arrow {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: var(--text-muted);
  transition: color 0.2s;
}

.quick-card:hover .quick-card-arrow {
  color: var(--text);
}

/* ===== POST — BASE ===== */
.post {
  margin-bottom: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}

.post.visible { opacity: 1; transform: translateY(0); }

.post-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
}

.post-type-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  flex-shrink: 0;
  background: var(--bg);
  border: 1px solid var(--border);
}

.post-type-avatar {
  background: none;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border);
}

.post-type-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.post-meta { flex: 1; }
.post-category { font-size: 0.8rem; font-weight: 600; line-height: 1.3; }
.post-timestamp { font-size: 0.68rem; color: var(--text-muted); }

.post-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  cursor: pointer;
}

.post-image.portrait { aspect-ratio: 3 / 4; }

/* Video embed */
.post-video {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 */
  background: #000;
}

.post-video-shorts {
  padding-bottom: 100%; /* shorter, full-width */
}

.post-video iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

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

.post-title {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 400;
  font-style: italic;
  line-height: 1.25;
  margin-bottom: 6px;
}

.post-text {
  font-size: 0.86rem;
  color: var(--text-light);
  line-height: 1.7;
}

.post-text a { color: var(--accent); font-weight: 500; }
.post-text a:hover { text-decoration: underline; }

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 0 16px 10px;
}

.post-tag {
  font-size: 0.62rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg);
  padding: 3px 10px;
  border-radius: 100px;
}

.post-actions {
  display: flex;
  gap: 14px;
  padding: 4px 16px 12px;
}

.post-action {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.2s;
  padding: 4px 0;
}

.post-action:hover { color: var(--text); }

.post-action svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
  transition: transform 0.25s var(--ease-out);
}

.post-action:hover svg { transform: scale(1.1); }
.post-action.liked { color: var(--accent); }
.post-action.liked svg { fill: var(--accent); stroke: var(--accent); }

/* Experience */
.post-exp-header { display: flex; align-items: baseline; gap: 10px; margin-bottom: 4px; }
.post-exp-company { font-family: var(--font-serif); font-size: 1.7rem; font-weight: 400; font-style: italic; line-height: 1.15; }
.post-exp-dates { font-size: 0.65rem; color: var(--text-muted); letter-spacing: 0.06em; text-transform: uppercase; }
.post-exp-role { font-size: 0.8rem; color: var(--accent); font-weight: 600; margin-bottom: 8px; }

/* Stats */
.post-stats { display: flex; border-top: 1px solid var(--border); }
.post-stat { flex: 1; text-align: center; padding: 14px 8px; border-right: 1px solid var(--border); }
.post-stat:last-child { border-right: none; }
.post-stat-num { font-size: 1.35rem; font-weight: 700; }
.post-stat-label { font-size: 0.6rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); margin-top: 1px; }

/* Quote */
.post-quote-body {
  padding: 36px 24px;
  text-align: center;
  background: linear-gradient(145deg, rgba(38,38,38,0.03), rgba(38,38,38,0.05), rgba(38,38,38,0.03));
}

.post-quote-mark {
  font-family: var(--font-serif);
  font-size: 3rem;
  line-height: 1;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.post-quote-text {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-style: italic;
  color: var(--text);
  line-height: 1.6;
  max-width: 380px;
  margin: 4px auto 0;
}

.post-quote-attr {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 14px;
}

/* Gallery */
.post-gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
}

.post-gallery img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  cursor: pointer;
  transition: opacity 0.2s;
}

.post-gallery img:hover { opacity: 0.85; }

/* Feed end */
.feed-end {
  text-align: center;
  padding: 36px 0 20px;
}

.feed-end-line { width: 32px; height: 1px; background: var(--border); margin: 0 auto 12px; }
.feed-end span { font-size: 0.8rem; color: var(--text-muted); }

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
  cursor: pointer;
}

.lightbox.active { opacity: 1; visibility: visible; }
.lightbox img { max-width: 90vw; max-height: 90vh; object-fit: contain; border-radius: 4px; }

/* ===== RESPONSIVE ===== */
@media (max-width: 760px) {
  .side-nav { display: none; }
  .page-layout { max-width: 520px; }
}

@media (max-width: 560px) {
  .feed-wrapper { padding: 0 0 80px; }
  .profile-hero { padding: 36px 16px 8px; }
  .bio-banner { padding: 12px 16px 20px; }
  .post { border-radius: 0; border-left: none; border-right: none; }
  .profile-avatar-ring { width: 80px; height: 80px; }
  .profile-name { font-size: 1.6rem; }
}
