/**
 * AumFriday Homepage — white premium SaaS knowledge platform
 * Brand #1877F2 · soft shadows · Playfair + Plus Jakarta
 * Journey: Hero → Topics → Trending → Featured → Creators → Experts → Become → Newsletter
 */

body:has(.af-home) {
  background: #ffffff;
}

.af-home {
  --af-blue: #1877F2;
  --af-blue-deep: #0b5fcc;
  --af-blue-soft: #e8f1fe;
  --af-ink: #0f172a;
  --af-muted: #64748b;
  --af-line: #e8eef5;
  --af-paper: #f7f9fc;
  --af-white: #ffffff;
  --af-shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
  --af-shadow-md: 0 12px 40px rgba(15, 23, 42, 0.08);
  --af-radius: 16px;
  --af-max: 1120px;
  --af-space: 72px;
  --af-font: "Plus Jakarta Sans", system-ui, sans-serif;
  --af-display: "Playfair Display", Georgia, serif;
  font-family: var(--af-font);
  color: var(--af-ink);
  background:
    radial-gradient(ellipse 70% 40% at 50% -5%, rgba(24, 119, 242, 0.07), transparent 55%),
    #ffffff;
  overflow-x: hidden;
  min-height: 60vh;
}

.af-home a { color: inherit; }

.af-wrap {
  width: min(100% - 40px, var(--af-max));
  margin-inline: auto;
  padding-bottom: 48px;
}

.af-home h1,
.af-home h2,
.af-brand {
  font-family: var(--af-display);
  letter-spacing: -0.03em;
  font-weight: 900;
}

.af-home h3 {
  font-family: var(--af-font);
  letter-spacing: -0.02em;
  font-weight: 700;
}

.af-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.af-eyebrow {
  margin: 0 0 8px;
  font-family: var(--af-font);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--af-blue);
}

.af-eyebrow-on-tint {
  color: var(--af-blue);
  margin-bottom: 10px;
}

/* —— Reveal motion —— */
.af-reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1), transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.af-reveal.is-in {
  opacity: 1;
  transform: none;
}

/* —— Full-bleed hero —— */
.af-hero {
  position: relative;
  min-height: min(88vh, 700px);
  display: flex;
  align-items: flex-end;
  color: var(--af-ink);
  isolation: isolate;
}

.af-hero-bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(145deg, #f0f6ff 0%, #e8f1fe 40%, #dbeafe 70%, #bfdbfe 100%);
  overflow: hidden;
}

.af-hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.28;
  transform: scale(1.04);
  animation: afKen 22s ease-in-out infinite alternate;
}

.af-hero-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.55) 0%, rgba(255, 255, 255, 0.72) 45%, rgba(255, 255, 255, 0.96) 100%),
    linear-gradient(105deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.5) 48%, transparent 78%);
  z-index: 1;
}

.af-hero-bg::after {
  content: "";
  position: absolute;
  width: 50%;
  height: 65%;
  right: -6%;
  top: -12%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(24, 119, 242, 0.18), transparent 70%);
  animation: afDrift 18s ease-in-out infinite alternate;
  z-index: 0;
}

@keyframes afDrift {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(-4%, 6%) scale(1.08); }
}

@keyframes afKen {
  from { transform: scale(1.04) translate(0, 0); }
  to { transform: scale(1.08) translate(-1.2%, 0.6%); }
}

.af-hero-inner {
  position: relative;
  z-index: 2;
  width: min(100% - 40px, var(--af-max));
  margin: 0 auto;
  padding: 132px 0 64px;
  max-width: 720px;
  margin-left: max(20px, calc((100% - var(--af-max)) / 2));
}

.af-hero-enter {
  opacity: 0;
  transform: translateY(18px);
  animation: afHeroIn 0.75s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.af-hero-enter-d1 { animation-delay: 0.1s; }
.af-hero-enter-d2 { animation-delay: 0.22s; }
.af-hero-enter-d3 { animation-delay: 0.34s; }

@keyframes afHeroIn {
  to { opacity: 1; transform: none; }
}

.af-brand {
  font-size: clamp(2.6rem, 7vw, 4.2rem);
  line-height: 0.92;
  margin: 0 0 22px;
  color: var(--af-ink);
  letter-spacing: -0.045em;
}

.af-brand span {
  color: var(--af-blue);
}

.af-hero-title {
  font-family: var(--af-display);
  font-size: clamp(1.65rem, 3.4vw, 2.45rem);
  font-weight: 900;
  line-height: 1.18;
  letter-spacing: -0.03em;
  margin: 0 0 16px;
  color: var(--af-ink);
  max-width: 18ch;
}

.af-hero-title .af-accent {
  color: var(--af-blue);
}

.af-hero-lede {
  font-size: 1.05rem;
  line-height: 1.6;
  font-weight: 500;
  color: var(--af-muted);
  margin: 0 0 32px;
  max-width: 42ch;
}

.af-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.af-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 22px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.94rem;
  text-decoration: none !important;
  border: 1px solid transparent;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
  font-family: var(--af-font);
}

.af-btn-primary {
  background: var(--af-blue);
  color: #fff !important;
  box-shadow: 0 8px 24px rgba(24, 119, 242, 0.28);
  padding: 14px 24px;
}
.af-btn-primary:hover {
  background: var(--af-blue-deep);
  transform: translateY(-1px);
}
.af-btn-primary:active { transform: none; }

.af-btn-ghost {
  background: rgba(255, 255, 255, 0.72);
  color: var(--af-ink) !important;
  border-color: var(--af-line);
  padding: 14px 22px;
  backdrop-filter: blur(8px);
  box-shadow: var(--af-shadow);
}
.af-btn-ghost:hover {
  border-color: rgba(24, 119, 242, 0.45);
  color: var(--af-blue) !important;
  background: #fff;
}

.af-btn-ghost-light {
  background: #fff;
  color: var(--af-ink) !important;
  border-color: #dbe3ee;
}

@media (prefers-reduced-motion: reduce) {
  .af-reveal { opacity: 1; transform: none; transition: none; }
  .af-hero-bg::after,
  .af-hero-bg img { animation: none !important; }
  .af-hero-enter {
    opacity: 1;
    transform: none;
    animation: none !important;
  }
  .af-btn-primary:hover,
  .af-story:hover,
  .af-person:hover,
  .af-cat:hover { transform: none !important; }
  .af-story:hover .af-story-media img,
  .af-lead:hover img { transform: none !important; }
}

/* —— Stats bar (real counts only) —— */
.af-stats {
  margin-top: -28px;
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  padding: 20px 22px;
  background: var(--af-white);
  border: 1px solid var(--af-line);
  border-radius: var(--af-radius);
  box-shadow: var(--af-shadow-md);
}

.af-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 10px;
  text-align: center;
}

.af-stat-value {
  font-family: var(--af-display);
  font-size: 1.55rem;
  font-weight: 900;
  color: var(--af-ink);
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.af-stat-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--af-muted);
}

/* —— Section chrome —— */
.af-section {
  padding: var(--af-space) 0 0;
  margin-top: var(--af-space);
  background-image: linear-gradient(90deg, transparent, var(--af-line) 12%, var(--af-line) 88%, transparent);
  background-size: 100% 1px;
  background-repeat: no-repeat;
  background-position: top center;
}

.af-section:first-child,
.af-wrap > .af-section:first-of-type,
.af-wrap > .af-stats + .af-section {
  background-image: none;
}

.af-wrap > .af-section:first-of-type {
  margin-top: 48px;
}

.af-wrap > .af-stats + .af-section {
  margin-top: 56px;
}

.af-section-tight {
  padding-top: 40px;
  margin-top: 40px;
}

.af-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.af-section-head h2 {
  font-size: clamp(1.55rem, 3vw, 2.15rem);
  margin: 0;
  color: var(--af-ink);
  line-height: 1.12;
  letter-spacing: -0.035em;
}

.af-section-head p {
  margin: 8px 0 0;
  color: var(--af-muted);
  font-size: 0.94rem;
  max-width: 44ch;
  line-height: 1.5;
}

.af-section-link {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--af-blue) !important;
  text-decoration: none;
  white-space: nowrap;
}
.af-section-link:hover { text-decoration: underline; }

.af-block {
  margin-top: 36px;
}
.af-block:first-of-type {
  margin-top: 0;
}

.af-block-label {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.af-block-label h3 {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--af-ink);
}
.af-block-label span {
  font-size: 0.78rem;
  color: var(--af-muted);
}

/* —— Topics (card grid) —— */
.af-cats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 14px;
}

.af-cat {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px 16px;
  border-radius: var(--af-radius);
  border: 1px solid var(--af-line);
  background: var(--af-white);
  box-shadow: var(--af-shadow);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--af-ink);
  text-decoration: none !important;
  transition: border-color 0.15s, box-shadow 0.2s, transform 0.2s;
}

.af-cat:hover,
.af-cat:focus-visible {
  border-color: rgba(24, 119, 242, 0.45);
  box-shadow: var(--af-shadow-md);
  transform: translateY(-2px);
  color: var(--af-blue);
}

.af-cat-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--af-blue-soft);
  color: var(--af-blue);
  display: grid;
  place-items: center;
  font-size: 0.95rem;
}

.af-cat small {
  font-weight: 600;
  color: var(--af-muted);
  font-size: 0.78rem;
}

/* —— Featured lead + rail —— */
.af-featured {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 18px;
}

.af-lead {
  position: relative;
  display: block;
  min-height: 420px;
  border-radius: var(--af-radius);
  overflow: hidden;
  text-decoration: none !important;
  color: #fff !important;
  background: #1e3a5f;
  box-shadow: var(--af-shadow-md);
}
.af-lead img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.55s ease;
}
.af-lead:hover img { transform: scale(1.035); }
.af-lead-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 22%, rgba(15, 23, 42, 0.88) 100%);
}
.af-lead-body {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 28px;
}
.af-lead .af-tag { margin-bottom: 12px; }
.af-lead h3 {
  font-family: var(--af-display);
  font-size: clamp(1.45rem, 2.5vw, 2.05rem);
  line-height: 1.15;
  margin: 0 0 12px;
  color: #fff;
  letter-spacing: -0.03em;
  font-weight: 900;
}
.af-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  font-size: 0.76rem;
  color: rgba(226, 232, 240, 0.85);
  font-weight: 600;
}

.af-rail {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.af-rail-item {
  display: grid;
  grid-template-columns: 104px 1fr;
  gap: 14px;
  align-items: stretch;
  text-decoration: none !important;
  background: var(--af-white);
  border: 1px solid var(--af-line);
  border-radius: var(--af-radius);
  overflow: hidden;
  box-shadow: var(--af-shadow);
  transition: border-color 0.15s, box-shadow 0.2s;
  min-height: 96px;
}
.af-rail-item:hover {
  border-color: rgba(24, 119, 242, 0.4);
  box-shadow: var(--af-shadow-md);
}
.af-rail-thumb {
  background: var(--af-blue-soft);
  min-height: 100%;
}
.af-rail-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.af-rail-body {
  padding: 12px 14px 12px 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.af-rail-body h3 {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.35;
  margin: 0 0 6px;
  color: var(--af-ink);
}
.af-rail-body .af-meta { color: var(--af-muted); }

.af-tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  width: fit-content;
}
.af-tag-ink {
  background: var(--af-blue-soft);
  color: var(--af-blue);
}

/* —— Story grid / trending cards —— */
.af-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.af-trending-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.af-story {
  display: flex;
  flex-direction: column;
  text-decoration: none !important;
  background: var(--af-white);
  border: 1px solid var(--af-line);
  border-radius: var(--af-radius);
  overflow: hidden;
  box-shadow: var(--af-shadow);
  transition: border-color 0.15s, transform 0.2s ease, box-shadow 0.2s;
  height: 100%;
}
.af-story:hover {
  border-color: rgba(24, 119, 242, 0.4);
  transform: translateY(-2px);
  box-shadow: var(--af-shadow-md);
}
.af-story-media {
  aspect-ratio: 16 / 10;
  background: linear-gradient(135deg, #e8f1fe, #dbeafe);
  overflow: hidden;
}
.af-story-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease;
}
.af-story:hover .af-story-media img { transform: scale(1.04); }
.af-story-body {
  padding: 16px 16px 18px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 8px;
}
.af-story-body h3 {
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.35;
  margin: 0;
  color: var(--af-ink);
}
.af-story-excerpt {
  font-size: 0.86rem;
  color: var(--af-muted);
  line-height: 1.55;
  margin: 0;
  flex: 1;
}
.af-story-body .af-meta { color: var(--af-muted); margin-top: auto; }

/* —— Writers / experts —— */
.af-people {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}

.af-person {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px;
  background: var(--af-white);
  border: 1px solid var(--af-line);
  border-radius: var(--af-radius);
  text-decoration: none !important;
  box-shadow: var(--af-shadow);
  transition: border-color 0.15s, box-shadow 0.2s, transform 0.2s;
}
.af-person:hover {
  border-color: rgba(24, 119, 242, 0.4);
  box-shadow: var(--af-shadow-md);
  transform: translateY(-2px);
}
.af-person-top {
  display: flex;
  align-items: center;
  gap: 12px;
}
.af-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--af-blue);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 1.05rem;
  overflow: hidden;
  box-shadow: 0 0 0 3px var(--af-blue-soft);
}
.af-avatar img { width: 100%; height: 100%; object-fit: cover; }
.af-person-name {
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--af-ink);
  margin: 0;
}
.af-person-meta {
  font-size: 0.8rem;
  color: var(--af-muted);
  line-height: 1.4;
}
.af-person-score {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--af-blue);
}

.af-rank {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  font-weight: 800;
  background: var(--af-paper);
  color: var(--af-muted);
}
.af-rank.r1 { background: var(--af-blue-soft); color: var(--af-blue); }
.af-rank.r2 { background: #f1f5f9; color: #475569; }
.af-rank.r3 { background: #f8fafc; color: #64748b; }

/* —— Become creator —— */
.af-become {
  margin: var(--af-space) 0 0;
  padding: 44px 40px;
  border-radius: var(--af-radius);
  border: 1px solid #c7dcfa;
  background:
    linear-gradient(135deg, #eef5ff 0%, #e0edff 55%, #d6e8ff 100%);
  position: relative;
  overflow: hidden;
  box-shadow: var(--af-shadow);
}
.af-become::before {
  content: "";
  position: absolute;
  width: 280px;
  height: 280px;
  right: -60px;
  top: -80px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(24, 119, 242, 0.16), transparent 70%);
  pointer-events: none;
}
.af-become-inner {
  position: relative;
  z-index: 1;
  max-width: 520px;
}
.af-become h2 {
  font-size: clamp(1.5rem, 2.8vw, 2rem);
  margin: 0 0 10px;
  color: var(--af-ink);
}
.af-become p:not(.af-eyebrow):not(.af-eyebrow-on-tint) {
  margin: 0 0 24px;
  color: var(--af-muted);
  line-height: 1.55;
  font-size: 0.98rem;
}

/* —— Newsletter —— */
.af-newsletter {
  margin: var(--af-space) 0 28px;
  padding: 36px 32px;
  border-radius: var(--af-radius);
  background: var(--af-white);
  border: 1px solid var(--af-line);
  box-shadow: var(--af-shadow);
  color: var(--af-ink);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 24px 32px;
}
.af-newsletter-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--af-blue-soft);
  color: var(--af-blue);
  display: grid;
  place-items: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}
.af-newsletter-copy {
  flex: 1 1 220px;
  min-width: 0;
}
.af-newsletter h2 {
  font-size: clamp(1.25rem, 2.2vw, 1.55rem);
  margin: 0 0 6px;
  color: var(--af-ink);
  font-family: var(--af-display);
}
.af-newsletter-copy > p {
  margin: 0;
  color: var(--af-muted);
  font-size: 0.92rem;
}
.af-newsletter-form {
  display: flex;
  flex: 1 1 280px;
  max-width: 440px;
  background: var(--af-paper);
  border: 1px solid var(--af-line);
  border-radius: 12px;
  overflow: hidden;
}
.af-newsletter-form:focus-within {
  border-color: rgba(24, 119, 242, 0.5);
  box-shadow: 0 0 0 3px rgba(24, 119, 242, 0.12);
}
.af-newsletter-form input {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--af-ink);
  padding: 14px 16px;
  font-size: 0.92rem;
  outline: none;
  font-family: var(--af-font);
}
.af-newsletter-form input::placeholder { color: #94a3b8; }
.af-newsletter-form button {
  border: 0;
  background: var(--af-blue);
  color: #fff;
  font-weight: 700;
  padding: 0 20px;
  cursor: pointer;
  font-family: var(--af-font);
  transition: background 0.15s;
}
.af-newsletter-form button:hover { background: var(--af-blue-deep); }
.af-newsletter-note {
  width: 100%;
  margin: 0 !important;
  font-size: 0.76rem;
  color: var(--af-muted) !important;
}
.af-newsletter-note a {
  color: var(--af-blue);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* —— Pagination —— */
.af-pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 28px 0 8px;
  flex-wrap: wrap;
}
.af-page {
  min-width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border-radius: 10px;
  background: var(--af-white);
  border: 1px solid var(--af-line);
  font-weight: 700;
  text-decoration: none !important;
  color: var(--af-ink);
  font-size: 0.9rem;
  box-shadow: var(--af-shadow);
}
.af-page:hover { border-color: var(--af-blue); color: var(--af-blue); }
.af-page.is-active {
  background: var(--af-blue);
  border-color: var(--af-blue);
  color: #fff !important;
}

/* —— Responsive —— */
@media (max-width: 1024px) {
  .af-featured { grid-template-columns: 1fr; }
  .af-lead { min-height: 320px; }
  .af-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  .af-home { --af-space: 48px; }
  .af-hero { min-height: min(78vh, 620px); }
  .af-hero-inner {
    padding: 112px 0 48px;
    margin-left: auto;
    width: min(100% - 32px, var(--af-max));
  }
  .af-brand { font-size: clamp(2.4rem, 12vw, 3.4rem); }
  .af-hero-title { max-width: none; }
  .af-wrap { width: min(100% - 32px, var(--af-max)); }
  .af-grid { grid-template-columns: 1fr; }
  .af-rail-item { grid-template-columns: 84px 1fr; }
  .af-cats { grid-template-columns: repeat(2, 1fr); }
  .af-stats { margin-top: -16px; padding: 14px; }
  .af-become { padding: 32px 20px; }
  .af-newsletter { padding: 24px 18px; }
  .af-newsletter-form { flex-direction: column; max-width: none; flex: 1 1 100%; }
  .af-newsletter-form button { padding: 13px; }
  .af-wrap > .af-section:first-of-type { margin-top: 32px; }
  .af-story:hover,
  .af-person:hover,
  .af-cat:hover { transform: none; }
}

@media (max-width: 420px) {
  .af-hero-actions { flex-direction: column; align-items: stretch; }
  .af-btn { justify-content: center; }
  .af-cats { grid-template-columns: 1fr; }
}
