/* ============================================================
   DESJEWEL.NET — Clean & Friendly Light Theme
   ============================================================ */

/* --- Tokens --- */
:root {
  --white:       #ffffff;
  --bg:          #fafaf9;
  --surface:     #f3f2f0;
  --border:      #e5e3df;
  --text:        #1a1916;
  --text-muted:  #6b6760;
  --text-light:  #9c9893;

  /* Accent: warm rose + soft emerald */
  --rose:        #e8687a;
  --rose-light:  #fce8eb;
  --rose-dark:   #c94f60;
  --green:       #4a9e6b;
  --green-light: #e3f5eb;
  --gold:        #d9903d;
  --gold-light:  #fdf0e3;

  --radius-sm:   8px;
  --radius:      14px;
  --radius-lg:   20px;
  --shadow-sm:   0 1px 3px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.05);
  --shadow:      0 4px 16px rgba(0,0,0,.08), 0 1px 4px rgba(0,0,0,.05);
  --shadow-lg:   0 12px 40px rgba(0,0,0,.1), 0 2px 8px rgba(0,0,0,.06);

  --font-display: 'Nunito', sans-serif;
  --font-body:    'Nunito Sans', sans-serif;
  --max-w:        1140px;
  --header-h:     64px;
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

/* --- Utils --- */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.25rem;
  color: var(--text);
}
.logo-diamond {
  color: var(--rose);
  font-size: 1.1rem;
  line-height: 1;
  display: inline-block;
  animation: spin-diamond 8s linear infinite;
}
@keyframes spin-diamond {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
.logo-text { letter-spacing: -.01em; }

/* Nav */
.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}
.main-nav a {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .9rem;
  padding: 6px 14px;
  border-radius: 100px;
  color: var(--text-muted);
  transition: background .15s, color .15s;
}
.main-nav a:hover {
  background: var(--surface);
  color: var(--text);
}
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform .2s, opacity .2s;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .9rem;
  padding: 10px 22px;
  border-radius: 100px;
  transition: transform .15s, box-shadow .15s, background .15s, color .15s;
  cursor: pointer;
  border: none;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: var(--rose);
  color: var(--white);
  box-shadow: 0 4px 12px rgba(232,104,122,.35);
}
.btn-primary:hover {
  background: var(--rose-dark);
  box-shadow: 0 6px 18px rgba(232,104,122,.4);
}
.btn-outline {
  background: var(--white);
  color: var(--text);
  border: 2px solid var(--border);
}
.btn-outline:hover {
  border-color: var(--rose);
  color: var(--rose);
}
.btn-ghost {
  background: none;
  color: var(--text-muted);
  padding: 8px 14px;
}
.btn-ghost:hover {
  color: var(--rose);
  background: var(--rose-light);
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  padding: 100px 0 90px;
  overflow: hidden;
  background: var(--white);
  border-bottom: 1px solid var(--border);
}
.hero-bg-pattern {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 80% 20%, rgba(232,104,122,.08) 0%, transparent 50%),
    radial-gradient(circle at 10% 80%, rgba(74,158,107,.07) 0%, transparent 50%);
  pointer-events: none;
}

/* Floating blocks */
.hero-blocks { position: absolute; inset: 0; pointer-events: none; }
.block {
  position: absolute;
  border-radius: var(--radius-sm);
  opacity: .18;
}
.b1 { width: 40px; height: 40px; background: var(--rose); top: 12%; right: 18%; transform: rotate(12deg); animation: float1 6s ease-in-out infinite; }
.b2 { width: 24px; height: 24px; background: var(--green); top: 60%; right: 12%; transform: rotate(-8deg); animation: float2 8s ease-in-out infinite; }
.b3 { width: 32px; height: 32px; background: var(--gold); top: 30%; left: 8%; transform: rotate(20deg); animation: float1 7s ease-in-out infinite reverse; }
.b4 { width: 16px; height: 16px; background: var(--rose); bottom: 20%; left: 20%; transform: rotate(45deg); animation: float2 5s ease-in-out infinite; }

@keyframes float1 {
  0%, 100% { transform: rotate(12deg) translateY(0); }
  50%       { transform: rotate(12deg) translateY(-12px); }
}
@keyframes float2 {
  0%, 100% { transform: rotate(-8deg) translateY(0); }
  50%       { transform: rotate(-8deg) translateY(-8px); }
}

.hero-inner { position: relative; max-width: 640px; }
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--rose);
  background: var(--rose-light);
  padding: 5px 14px;
  border-radius: 100px;
  margin-bottom: 20px;
}
.hero-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(2.4rem, 6vw, 3.8rem);
  line-height: 1.12;
  letter-spacing: -.025em;
  color: var(--text);
  margin-bottom: 20px;
}
.hero-title em {
  font-style: normal;
  color: var(--rose);
  position: relative;
}
.hero-desc {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 480px;
  margin-bottom: 36px;
  line-height: 1.7;
}
.hero-cta-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* ============================================================
   SOCIALS STRIP
   ============================================================ */
.socials-strip {
  padding: 64px 0;
  background: var(--white);
  border-bottom: 1px solid var(--border);
}
.section-label {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 28px;
  text-align: center;
}
.socials-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
}
.social-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 24px 12px 20px;
  border-radius: var(--radius);
  background: var(--bg);
  border: 1px solid var(--border);
  transition: transform .18s, box-shadow .18s, border-color .18s;
  text-align: center;
}
.social-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: transparent;
}
.social-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}
.social-icon svg { width: 24px; height: 24px; }

.social-icon.bluesky   { background: #e8f1fd; color: #0085ff; }
.social-icon.substack  { background: #fff3eb; color: #ff6719; }
.social-icon.twitter   { background: #f0f0f0; color: #0f0f0f; }
.social-icon.github    { background: #f0f0f0; color: #0f0f0f; }
.social-icon.gumroad   { background: #fff0f3; color: #e8007a; }
.social-icon.pmc       { background: var(--green-light); color: var(--green); }

.social-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: .85rem;
  color: var(--text);
  line-height: 1.2;
}
.social-handle {
  font-size: .78rem;
  color: var(--text-light);
}

/* ============================================================
   SECTIONS
   ============================================================ */
.section { padding: 80px 0; }
.section-tinted { background: var(--surface); }

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 36px;
  gap: 16px;
}
.eyebrow {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--rose);
  margin-bottom: 4px;
}
.section-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.9rem;
  letter-spacing: -.02em;
  line-height: 1.1;
  color: var(--text);
}

/* Loading */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 48px 24px;
  color: var(--text-muted);
  font-size: .9rem;
  grid-column: 1 / -1;
}
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--rose);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Error state */
.error-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 32px 24px;
  color: var(--text-muted);
  font-size: .9rem;
}
.error-state a { color: var(--rose); text-decoration: underline; }

/* ============================================================
   VIDEOS GRID
   ============================================================ */
.videos-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.video-card iframe {
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--white);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: transform .18s, box-shadow .18s;
}
.video-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}
.video-embed {
  position: relative;
  padding-bottom: 56.25%;
  background: #111;
}
.video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}
.video-info { padding: 16px 18px 18px; }
.video-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: .95rem;
  line-height: 1.35;
  color: var(--text);
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.video-date {
  font-size: .8rem;
  color: var(--text-light);
}

/* ============================================================
   GITHUB REPOSITORIES
   ============================================================ */

.github-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.repo-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition:
    transform .18s ease,
    box-shadow .18s ease,
    border-color .18s ease;
}

.repo-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: var(--rose-light);
}

.repo-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 18px 0;
}

.repo-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  color: var(--text);
}

.repo-badge {
  font-family: var(--font-display);
  font-size: .72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--green);
  background: var(--green-light);
  padding: 5px 10px;
  border-radius: 100px;
}

.repo-body {
  padding: 16px 18px 20px;
  display: flex;
  flex-direction: column;
  height: calc(100% - 60px);
}

.repo-name {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 900;
  color: var(--text);
  margin-bottom: 8px;
  line-height: 1.25;
}

.repo-desc {
  color: var(--text-muted);
  font-size: .88rem;
  line-height: 1.6;
  margin-bottom: 18px;

  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.repo-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.repo-lang {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .82rem;
  color: var(--text-muted);
  font-weight: 700;
}

.lang-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Language colors */
.lang-dot.javascript { background: #f7df1e; }
.lang-dot.typescript { background: #3178c6; }
.lang-dot.python { background: #3776ab; }
.lang-dot.cpp { background: #00599c; }
.lang-dot.c { background: #555; }
.lang-dot.csharp { background: #68217a; }
.lang-dot.java { background: #f89820; }
.lang-dot.html { background: #e34f26; }
.lang-dot.css { background: #1572b6; }
.lang-dot.php { background: #777bb4; }
.lang-dot.markdown { background: var(--text-light); }

.repo-link {
  font-family: var(--font-display);
  font-size: .8rem;
  font-weight: 800;
  color: var(--rose);
  transition: color .15s ease;
}

.repo-link:hover {
  color: var(--rose-dark);
}

/* Responsive */
@media (max-width: 1024px) {
  .github-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .github-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   ASSETS GRID
   ============================================================ */
.assets-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
.asset-card {
  border-radius: var(--radius);
  background: var(--white);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform .18s, box-shadow .18s;
}
.asset-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}
.asset-thumb {
  aspect-ratio: 4/3;
  background: var(--surface);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.asset-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s;
}
.asset-card:hover .asset-thumb img { transform: scale(1.04); }
.asset-thumb-placeholder {
  font-size: 2.5rem;
  color: var(--text-light);
}
.asset-body { padding: 16px 18px 18px; }
.asset-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: .95rem;
  line-height: 1.3;
  color: var(--text);
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.asset-desc {
  font-size: .82rem;
  color: var(--text-muted);
  margin-bottom: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.asset-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.asset-price {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1rem;
  color: var(--text);
}
.asset-price.free { color: var(--green); }
.asset-link {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .8rem;
  padding: 6px 14px;
  background: var(--rose);
  color: var(--white);
  border-radius: 100px;
  transition: background .15s, transform .15s;
}
.asset-link:hover {
  background: var(--rose-dark);
  transform: translateY(-1px);
}

/* ============================================================
   FEED TABS
   ============================================================ */
.feed-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 28px;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0;
}
.feed-tab {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .9rem;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px 16px 12px;
  margin-bottom: -2px;
  border-bottom: 2px solid transparent;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  transition: color .15s, border-color .15s;
}
.feed-tab:hover { color: var(--text); }
.feed-tab.active {
  color: var(--rose);
  border-bottom-color: var(--rose);
}

.feed-panel { display: none; }
.feed-panel.active { display: block; }

.feed-posts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.feed-more { display: block; width: fit-content; margin: 0 auto; }

/* Post card */
.post-card {
  border-radius: var(--radius);
  background: var(--white);
  border: 1px solid var(--border);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform .18s, box-shadow .18s;
  text-decoration: none;
  color: inherit;
}
.post-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--rose-light);
}
.post-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}
.post-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--rose-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: .75rem;
  color: var(--rose);
  flex-shrink: 0;
  overflow: hidden;
}
.post-avatar img { width: 100%; height: 100%; object-fit: cover; }
.post-author {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: .85rem;
  color: var(--text);
  line-height: 1.2;
}
.post-source {
  font-size: .75rem;
  color: var(--text-light);
}
.post-body {
  font-size: .88rem;
  line-height: 1.6;
  color: var(--text);
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-date {
  font-size: .78rem;
  color: var(--text-light);
}
.post-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: .92rem;
  line-height: 1.35;
  color: var(--text);
}
.post-subtitle {
  font-size: .82rem;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--text);
  color: var(--white);
  padding: 56px 0 40px;
}
.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  text-align: center;
}
.logo-footer .logo-text { color: var(--white); }
.logo-footer .logo-diamond { color: var(--rose); }
.footer-tagline {
  color: rgba(255,255,255,.5);
  font-size: .9rem;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  justify-content: center;
}
.footer-links a {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .85rem;
  color: rgba(255,255,255,.55);
  transition: color .15s;
}
.footer-links a:hover { color: var(--white); }
.footer-copy {
  font-size: .8rem;
  color: rgba(255,255,255,.3);
  margin-top: 8px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .socials-grid { grid-template-columns: repeat(3, 1fr); }
  .videos-grid  { grid-template-columns: repeat(2, 1fr); }
  .assets-grid  { grid-template-columns: repeat(2, 1fr); }
  .feed-posts   { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .main-nav { display: none; }
  .main-nav.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: var(--header-h);
    left: 0; right: 0;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 16px 24px;
    gap: 4px;
    box-shadow: var(--shadow);
  }
  .main-nav.open a { padding: 10px 14px; border-radius: var(--radius-sm); }
  .nav-toggle { display: flex; }
  .site-header { position: relative; }

  .hero { padding: 64px 0 56px; }
  .hero-title { font-size: 2.2rem; }
  .section-header { flex-direction: column; align-items: flex-start; }

  .socials-grid { grid-template-columns: repeat(2, 1fr); }
  .videos-grid  { grid-template-columns: 1fr; }
  .assets-grid  { grid-template-columns: repeat(2, 1fr); }
  .feed-posts   { grid-template-columns: 1fr; }
  .feed-tabs    { flex-wrap: wrap; }
}

@media (max-width: 480px) {
  .socials-grid { grid-template-columns: repeat(2, 1fr); }
  .assets-grid  { grid-template-columns: 1fr; }
  .hero-cta-row { flex-direction: column; align-items: flex-start; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Ensure the Bluesky component fits your section width smoothly */
bsky-embed {
  grid-column: 1 / -1;
  width: 100%;
}