.page-header {
  max-width: 700px;
}

/* =========================
   GENERIC CARD GRID
========================= */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  margin-top: 40px;
}

.card {
  background: white;
  padding: 28px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}

/* =========================
   RESEARCH PAGE (SCOPED)
========================= */

.research {
  max-width: 1100px;
  margin: auto;
}

.research-header {
  max-width: 680px;
}

.research-header h1 {
  font-size: 2.4rem;
  letter-spacing: -0.02em;
}

.research-header p {
  margin-top: 14px;
  font-size: 1.05rem;
  line-height: 1.7;
  opacity: 0.8;
}

/* Research Grid Discipline */

.research-grid {
  margin-top: 56px;
}

/* Research Cards */

.research-card {
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  cursor: pointer;
}

.research-card h3 {
  font-size: 1.2rem;
  margin-bottom: 10px;
}

.research-card p {
  font-size: 0.95rem;
  line-height: 1.6;
  opacity: 0.75;
}

/* Desktop-only hover interaction */
@media (hover: hover) and (pointer: fine) {
  .research-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 18px 40px rgba(0,0,0,0.08);
  }
}

/* Focus accessibility */
.research-card:focus-visible {
  outline: 2px solid var(--blue-primary);
  outline-offset: 4px;
}

/* =========================
   RESEARCH CARDS — MOBILE
========================= */

@media (max-width: 768px) {

  .research-header h1 {
    font-size: 2rem;
  }

  .research-header p {
    font-size: 1rem;
  }

  /* Neutralize grid → flex transition safely */
  .card-grid.research-grid {
    display: flex;
    gap: 18px;
  }

  .research-card {
    padding: 24px;
  }

  .research-card h3 {
    font-size: 1.1rem;
  }

  .research-card p {
    font-size: 0.95rem;
  }
}

/* =========================
   RESEARCH SECTION — ENHANCED
========================= */

.research-header {
  margin-bottom: 32px;
}

.research-header h1 {
  margin-bottom: 12px;
}

/* Research card refinement */

.research-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.research-card h3 {
  letter-spacing: -0.01em;
}

.research-meta {
  margin-top: 18px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--blue-primary);
  opacity: 0.85;
}

/* Improve reading rhythm */
.research-card p {
  margin-top: 8px;
}

/* =========================
   SWIPE SUPPORT (MOBILE)
========================= */

@media (max-width: 768px) {

  .research-grid {
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }

  .research-card {
    min-width: 85%;
    scroll-snap-align: start;
    flex-shrink: 0;
  }

  /* Hide scrollbar */
  .research-grid::-webkit-scrollbar {
    display: none;
  }
}

/* =========================
   RESEARCH — VISUAL UPGRADE
========================= */

.research-card {
  background: linear-gradient(
    180deg,
    rgba(30,43,255,0.03),
    #ffffff
  );
  border-radius: var(--radius-lg);
  padding: 30px;
  box-shadow: var(--shadow-soft);
  position: relative;
}

/* Accent bar */
.research-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  height: 4px;
  width: 100%;
  background: var(--blue-primary);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.research-meta {
  align-self: flex-start;
  margin-top: 20px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  background: rgba(30,43,255,0.08);
  color: var(--blue-primary);
}

/* =========================
   ESSAYS — MEDIUM FEED
========================= */

#essays {
  margin-top: 50px;
}

.essay-card {
  background: white;
  padding: 30px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  position: relative;
}

/* Accent */
.essay-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  height: 4px;
  width: 100%;
  background: linear-gradient(
    90deg,
    var(--blue-primary),
    rgba(30,43,255,0.3)
  );
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.essay-meta {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--blue-primary);
  font-weight: 600;
}

.essay-card h3 {
  margin-top: 10px;
  font-size: 1.15rem;
  line-height: 1.4;
}

.essay-card p {
  margin-top: 14px;
  font-size: 0.95rem;
  line-height: 1.6;
  opacity: 0.8;

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

.essay-card a {
  display: inline-block;
  margin-top: 18px;
  font-weight: 500;
  color: var(--blue-primary);
}

@media (hover: hover) {
  .essay-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 18px 40px rgba(0,0,0,0.08);
  }
}



/* =========================
   NEWS — CARDS (SCOPED)
========================= */

.news {
  max-width: 1100px;
  margin: auto;
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 28px;
  margin-top: 50px;
}

/* Individual card */

.news-card {
  background: linear-gradient(
    180deg,
    rgba(30,43,255,0.03),
    rgba(255,255,255,1)
  );

  border-radius: var(--radius-lg);
  padding: 26px 28px;

  box-shadow: var(--shadow-soft);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  position: relative;
}

/* Accent bar */
.news-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--blue-primary);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

/* Source */
.news-source {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--blue-primary);
  font-weight: 600;
}

/* Title */
.news-card h3 {
  margin-top: 10px;
  font-size: 1.05rem;
  line-height: 1.4;
}

/* Description */
/* Clamp description to 3 lines */
.news-card p {
  margin-top: 14px;
  font-size: 0.95rem;
  opacity: 0.75;
  line-height: 1.6;

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

/* Link */
.news-card a {
  display: inline-block;
  margin-top: 18px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--blue-primary);
}

/* Hover effect */
.news-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 40px rgba(0,0,0,0.08);
}

/* =========================
   MOBILE OPTIMIZATION
========================= */

@media (max-width: 768px) {

  .news-grid {
    grid-template-columns: 1fr;
  }

  .news-card {
    padding: 22px;
  }
}

/* =========================
   NEWS MODAL (SECONDARY SCREEN)
========================= */

.news-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.news-modal.open {
  display: flex;
}

.news-modal-content {
  background: white;
  max-width: 640px;
  width: 90%;
  padding: 36px;
  border-radius: var(--radius-lg);
  box-shadow: 0 30px 60px rgba(0,0,0,0.2);
  position: relative;
}

.news-modal-content h2 {
  margin-top: 10px;
  font-size: 1.4rem;
  line-height: 1.4;
}

.news-modal-content p {
  margin-top: 18px;
  font-size: 1rem;
  line-height: 1.7;
  opacity: 0.85;
}

.news-modal-content a {
  display: inline-block;
  margin-top: 22px;
  color: var(--blue-primary);
  font-weight: 500;
}

/* Close button */
.news-modal-close {
  position: absolute;
  top: 18px;
  right: 22px;
  font-size: 1.6rem;
  cursor: pointer;
  opacity: 0.6;
}

.news-modal-close:hover {
  opacity: 1;
}


/* =========================
   SIDE PANEL (GLOBAL)
========================= */

.side-panel {
  position: fixed;
  top: 0;
  right: -420px;
  width: 400px;
  height: 100vh;
  background: white;
  box-shadow: -20px 0 40px rgba(0,0,0,0.12);
  z-index: 1000;

  display: flex;
  flex-direction: column;
  transition: right 0.35s ease;
}

.side-panel.open {
  right: 0;
}

/* Header */
.side-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;

  padding: 22px 24px;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

.side-panel-header h2 {
  font-size: 1.1rem;
  line-height: 1.4;
}

.side-panel-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  opacity: 0.6;
}

.side-panel-close:hover {
  opacity: 1;
}

/* Content */
.side-panel-content {
  padding: 24px;
  overflow-y: auto;
}

.side-panel-content p {
  font-size: 0.95rem;
  line-height: 1.7;
  opacity: 0.85;
}

.side-panel-content a {
  display: inline-block;
  margin-top: 22px;
  color: var(--blue-primary);
  font-weight: 500;
}

/* Mobile behavior */
@media (max-width: 768px) {
  .side-panel {
    width: 100%;
    right: -100%;
  }
}


/* =========================
   ABOUT — PAPER SUPE THEME
========================= */

.about {
  max-width: 1100px;
  margin: auto;
}

/* =========================
   HERO
========================= */

.about-hero {
  max-width: 720px;
  margin-bottom: 72px;

  position: relative;
  padding-bottom: 28px;
}

/* Single, intentional divider */
.about-hero::after {
  content: "";
  display: block;
  margin-top: 30px;
  width: 56px;
  height: 3px;
  background: var(--blue-primary);
  border-radius: 999px;
}

/* Fix hero label + title collision */

.about-tag {
  display: block;              /* force its own line */
  margin-bottom: 12px;         /* space before name */
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blue-primary);
  font-weight: 600;
  opacity: 0.9;
}

.about-hero h1 {
  margin-top: 0;               /* prevent double spacing */
  font-size: 2.7rem;
  letter-spacing: -0.03em;
}

@media (max-width: 768px) {
  .about-tag {
    margin-bottom: 10px;
  }
}


/* Lead */
.about-hero p {
  margin-top: 14px;
  font-size: 1.05rem;
  line-height: 1.7;
  opacity: 0.82;
}

/* Subtle line */
.about-subtle {
  margin-top: 10px;
  font-size: 0.9rem;
  opacity: 0.6;
  font-style: italic;
}

/* =========================
   LAYOUT
========================= */

.about-layout {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 34px;
}

/* =========================
   CARDS
========================= */

.about-card {
  background: linear-gradient(
    180deg,
    rgba(30,43,255,0.025),
    #ffffff
  );

  padding: 34px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);

  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

/* Primary card refinement */
.about-card.primary {
  border-left: 3px solid var(--blue-primary);
}

/* Remove visual overload */
.about-card.primary::before {
  content: "";
  display: block;
  width: 40px;
  height: 3px;
  background: var(--blue-primary);
  border-radius: 999px;
  margin-bottom: 16px;
  opacity: 0.7;
}

.about-card h3 {
  font-size: 1.25rem;
  margin-bottom: 16px;
}

.about-card p {
  font-size: 0.97rem;
  line-height: 1.7;
  opacity: 0.85;
  margin-bottom: 14px;
}

/* CTA */
.about-cta {
  display: inline-block;
  margin-top: 12px;
  font-weight: 500;
  color: var(--blue-primary);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.about-cta:hover {
  transform: translateX(4px);
  opacity: 0.9;
}

/* Philosophy list */
.about-list {
  list-style: none;
  padding: 0;
}

.about-list li {
  padding: 10px 0;
  font-size: 0.95rem;
  opacity: 0.85;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

/* Hover lift */
@media (hover: hover) and (pointer: fine) {
  .about-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 18px 40px rgba(0,0,0,0.08);
  }
}

/* =========================
   SOCIAL STRIP
========================= */

.about-social {
  margin-top: 80px;
  padding-top: 32px;

  display: flex;
  gap: 22px;
  flex-wrap: wrap;

  border-top: 1px solid rgba(0,0,0,0.08);
}

.about-social a {
  font-size: 0.95rem;
  font-weight: 500;
  opacity: 0.8;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.about-social a::after {
  content: "↗";
  margin-left: 6px;
  font-size: 0.75rem;
  opacity: 0.6;
}

.about-social a:hover {
  opacity: 1;
  transform: translateY(-1px);
}

/* =========================
   MOBILE
========================= */

@media (max-width: 768px) {

  .about-hero h1 {
    font-size: 2.1rem;
  }

  .about-layout {
    grid-template-columns: 1fr;
  }

  .about-card {
    padding: 26px;
  }

  .about-social {
    gap: 16px;
  }
}


/* =========================
   GITHUB ACTIVITY
========================= */

.github-activity {
  margin-top: 80px;
}

.github-activity h2 {
  font-size: 1.4rem;
  margin-bottom: 24px;
  letter-spacing: -0.01em;
}



/* =========================
   PAGE HEADER — HERO STYLE
========================= */

.page-header {
  max-width: 720px;
  margin: 0 auto 64px;
  padding: 0 8%;
}

/* Tag wrapper (keeps spacing clean) */
.page-tag-wrap {
  margin-bottom: 10px;
}

/* Tag itself */
.page-tag {
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--blue-primary);
}

/* Title */
.page-header h1 {
  font-size: 2.7rem;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

/* Optional paragraph */
.page-header p {
  margin-top: 14px;
  font-size: 1.05rem;
  line-height: 1.7;
  opacity: 0.8;
}

/* Accent divider */
.page-header::after {
  content: "";
  display: block;
  margin-top: 28px;
  width: 48px;
  height: 3px;
  background: var(--blue-primary);
  border-radius: 999px;
}

/* =========================
   MOBILE
========================= */

@media (max-width: 768px) {
  .page-header {
    padding: 0 6%;
    margin-bottom: 48px;
  }

  .page-header h1 {
    font-size: 2.1rem;
  }
}


