@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;600;700&display=swap');

/* ===== Reset theme conflicts ===== */
body .page,
body #main,
body .page__inner-wrap,
body article.page,
body .page__footer footer,
body .masthead__inner-wrap,
body .wrapper {
  max-width: 100% !important;
  width: 100% !important;
  margin: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}
.masthead { display: none !important; }
.page__footer { margin-top: 0 !important; }

/* Override Academic Pages theme wrapper */
.greedy-nav, .sidebar__right, .page__hero--overlay { display: none !important; }

/* ===== Variables ===== */
:root {
  --apple-bg: #f5f5f7;
  --apple-dark: #1d1d1f;
  --apple-gray: #86868b;
  --apple-blue: #0071e3;
  --apple-radius: 20px;
}

/* ===== Navigation ===== */
.home-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 9999;
  padding: 0 clamp(20px, 4vw, 80px);
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0,0,0,0.85);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 0.5px solid rgba(255,255,255,0.08);
}

.home-nav .nav-logo {
  font-family: 'Noto Serif SC', serif;
  font-size: 20px;
  font-weight: 700;
  color: #f5f5f7;
  text-decoration: none;
  letter-spacing: 0.02em;
}

.home-nav .nav-links {
  display: flex;
  gap: 32px;
}

.home-nav .nav-links a {
  font-size: 14px;
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  font-weight: 400;
  transition: color 0.2s;
}

.home-nav .nav-links a:hover { color: #fff; }

/* ===== Hero Section ===== */
.apple-hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #000;
  color: #f5f5f7;
  text-align: center;
  padding: 0 24px;
}

.apple-hero::before {
  content: '';
  position: absolute;
  top: -40%; left: -40%;
  width: 180%; height: 180%;
  background:
    radial-gradient(ellipse at 25% 50%, rgba(120,119,198,0.25) 0%, transparent 50%),
    radial-gradient(ellipse at 75% 25%, rgba(255,119,198,0.12) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 75%, rgba(99,102,241,0.18) 0%, transparent 50%);
  animation: heroFloat 25s ease-in-out infinite;
}

@keyframes heroFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -20px) scale(1.02); }
  66% { transform: translate(-20px, 15px) scale(0.98); }
}

.apple-hero-content {
  position: relative;
  z-index: 1;
  max-width: 100%;
}

.apple-hero h1 {
  font-family: 'Noto Serif SC', serif;
  font-size: clamp(3rem, 8vw, 5.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 20px;
  background: linear-gradient(180deg, #fff 0%, rgba(255,255,255,0.65) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-family: 'Noto Serif SC', serif;
  font-size: clamp(1.1rem, 2.5vw, 1.6rem);
  font-weight: 300;
  color: rgba(255,255,255,0.55);
  line-height: 1.7;
  max-width: 100%;
  margin: 0 auto 48px;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 16px 36px;
  background: var(--apple-blue);
  color: #fff;
  border-radius: 980px;
  font-size: 17px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.3s ease;
}

.hero-cta:hover {
  background: #0077ed;
  transform: scale(1.04);
}

.apple-scroll-indicator {
  position: absolute;
  bottom: 48px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
  animation: bounce 2.5s ease-in-out infinite;
}

.apple-scroll-indicator svg {
  width: 28px; height: 28px;
  stroke: rgba(255,255,255,0.35);
  fill: none; stroke-width: 2;
}

@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); opacity: 1; }
  50% { transform: translateX(-50%) translateY(12px); opacity: 0.5; }
}

/* ===== Content Section ===== */
.apple-content {
  background: var(--apple-bg);
  padding: clamp(80px, 10vw, 140px) clamp(20px, 5vw, 80px);
}

.apple-container {
  max-width: 100%;
  margin: 0 auto;
}

.apple-section-header {
  text-align: center;
  margin-bottom: 64px;
}

.apple-section-header h2 {
  font-family: 'Noto Serif SC', serif;
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  font-weight: 700;
  color: var(--apple-dark);
  letter-spacing: -0.01em;
  margin-bottom: 12px;
}

.apple-section-header p {
  font-size: 1.15rem;
  color: var(--apple-gray);
  max-width: 480px;
  margin: 0 auto;
}

/* ===== Post Cards Grid ===== */
.apple-posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 56px;
}

.apple-post-card {
  background: rgba(255,255,255,0.8);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-radius: var(--apple-radius);
  padding: 28px 28px 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.04);
  border: 1px solid rgba(255,255,255,0.6);
  transition: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
}

.apple-post-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06);
}

.card-date {
  font-size: 13px;
  color: var(--apple-gray);
  font-weight: 500;
  letter-spacing: 0.03em;
  margin-bottom: 10px;
}

.card-title {
  font-family: 'Noto Serif SC', serif;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--apple-dark);
  line-height: 1.45;
  margin-bottom: 10px;
}

.card-excerpt {
  font-size: 14px;
  color: var(--apple-gray);
  line-height: 1.65;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.card-tag {
  font-size: 11px;
  padding: 3px 10px;
  background: rgba(0,113,227,0.07);
  color: var(--apple-blue);
  border-radius: 980px;
  font-weight: 500;
}

/* ===== View All ===== */
.apple-view-all {
  text-align: center;
  margin-top: 16px;
}

.apple-view-all a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--apple-blue);
  font-size: 17px;
  font-weight: 500;
  text-decoration: none;
  transition: gap 0.3s;
}

.apple-view-all a:hover { gap: 12px; }

.apple-view-all a::after {
  content: '\2192';
}

/* ===== Quote Section ===== */
.apple-quote-section {
  background: #000;
  color: #f5f5f7;
  padding: clamp(100px, 12vw, 180px) 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.apple-quote-section::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background:
    radial-gradient(ellipse at 30% 50%, rgba(99,102,241,0.12) 0%, transparent 55%),
    radial-gradient(ellipse at 70% 50%, rgba(236,72,153,0.08) 0%, transparent 55%);
  pointer-events: none;
}

.apple-quote {
  position: relative;
  z-index: 1;
  max-width: 100%;
  margin: 0 auto;
}

.apple-quote blockquote {
  font-family: 'Noto Serif SC', serif;
  font-size: clamp(1.6rem, 4vw, 2.8rem);
  font-weight: 400;
  line-height: 1.55;
  letter-spacing: -0.01em;
  margin: 0 0 28px 0;
  background: linear-gradient(180deg, #fff 0%, rgba(255,255,255,0.55) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.apple-quote .quote-author {
  font-size: 1rem;
  color: rgba(255,255,255,0.35);
  font-weight: 400;
}

/* ===== Footer ===== */
.page__footer {
  background: #000 !important;
  color: rgba(255,255,255,0.5) !important;
  padding: 20px 24px !important;
}

.page__footer footer {
  background: transparent !important;
}

.page__footer a {
  color: rgba(255,255,255,0.5) !important;
}

.page__footer a:hover {
  color: #fff !important;
}

/* Hide theme elements we don't need on homepage */
.page__sidebar { display: none !important; }

/* ===== Responsive: Tablet ===== */
@media (max-width: 960px) {
  .apple-posts-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ===== Responsive: Mobile ===== */
@media (max-width: 640px) {
  .home-nav {
    padding: 0 16px;
    height: 48px;
  }

  .home-nav .nav-logo {
    font-size: 17px;
  }

  .home-nav .nav-links {
    gap: 20px;
  }

  .home-nav .nav-links a {
    font-size: 13px;
  }

  .apple-hero {
    min-height: 92vh;
    padding: 0 20px;
  }

  .apple-content {
    padding: 60px 16px;
  }

  .apple-posts-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .apple-post-card {
    padding: 22px 20px 18px;
    border-radius: 16px;
  }

  .card-title {
    font-size: 1.1rem;
  }

  .apple-section-header {
    margin-bottom: 40px;
  }

  .apple-quote-section {
    padding: 80px 20px;
  }
}

/* Fix theme wrapper padding */
.page__content {
  padding: 0 !important;
  margin: 0 !important;
  max-width: none !important;
}

.page__content .page__inner-wrap {
  padding: 0 !important;
}

.page__content .initial-content {
  padding: 0 !important;
  margin: 0 !important;
}

/* Article pages — add horizontal padding (exclude homepage) */
body article.page:not(:has(.home-nav)) {
  padding: 0 clamp(20px, 5vw, 80px) !important;
}

body article.page:not(:has(.home-nav)) .page__inner-wrap {
  padding: 0 !important;
}

body article.page:not(:has(.home-nav)) .page__content {
  padding: 0 !important;
}
