/* ============================================================
   Ishani Singh — Writing Portfolio
   Aesthetic: Editorial / Literary Magazine
   Fonts: Playfair Display (display) + Source Serif 4 (body)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700;0,800;1,400;1,600&family=Source+Serif+4:ital,opsz,wght@0,8..60,300;0,8..60,400;0,8..60,600;1,8..60,300;1,8..60,400&family=JetBrains+Mono:wght@400&display=swap');

:root {
  /* Palette — warm ivory + deep ink + coral accent */
  --ivory:        #FAF7F2;
  --cream:        #F3EDE4;
  --sand:         #E8DFD1;
  --ink:          #1A1A1A;
  --ink-light:    #4A4A4A;
  --ink-faint:    #8A8A8A;
  --coral:        #E8665C;
  --coral-dark:   #C94F46;
  --blush:        #FCEAE8;
  --teal:         #2A6F6F;
  --teal-light:   #E6F0F0;

  /* Typography scale */
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'Source Serif 4', 'Georgia', serif;
  --font-mono:    'JetBrains Mono', monospace;

  --fs-hero:      clamp(2.8rem, 6vw, 5.5rem);
  --fs-h1:        clamp(2rem, 4vw, 3.2rem);
  --fs-h2:        clamp(1.5rem, 3vw, 2.2rem);
  --fs-h3:        clamp(1.15rem, 2vw, 1.5rem);
  --fs-body:      clamp(1rem, 1.2vw, 1.15rem);
  --fs-small:     0.875rem;
  --fs-caption:   0.8rem;

  --lh-body:      1.72;
  --max-w:        1200px;
  --max-w-text:   720px;
  --gap:          clamp(1.5rem, 3vw, 3rem);
}

/* ---- Reset ---- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--ink);
  background: var(--ivory);
}

/* ---- Utility ---- */
.container     { max-width: var(--max-w); margin: 0 auto; padding: 0 var(--gap); }
.text-center   { text-align: center; }
.sr-only       { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* ---- Grain overlay (subtle texture) ---- */
body::after {
  content: '';
  position: fixed; inset: 0;
  pointer-events: none;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  z-index: 9999;
}

/* ==========================================================
   HEADER / NAV
   ========================================================== */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(250,247,242,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--sand);
  transition: box-shadow 0.3s;
}
.site-header.scrolled { box-shadow: 0 2px 20px rgba(0,0,0,0.06); }

.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 72px;
  max-width: var(--max-w); margin: 0 auto; padding: 0 var(--gap);
}

.nav-logo {
  font-family: var(--font-display);
  font-weight: 700; font-size: 1.4rem;
  letter-spacing: -0.02em;
}
.nav-logo span { color: var(--coral); }

.nav-links { display: flex; gap: 2rem; align-items: center; }
.nav-links a {
  font-family: var(--font-body);
  font-size: var(--fs-small);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-light);
  position: relative;
  transition: color 0.25s;
}
.nav-links a::after {
  content: ''; position: absolute; bottom: -4px; left: 0; width: 0; height: 2px;
  background: var(--coral); transition: width 0.3s;
}
.nav-links a:hover,
.nav-links a.active { color: var(--ink); }
.nav-links a:hover::after,
.nav-links a.active::after { width: 100%; }

/* Hamburger */
.nav-toggle {
  display: none; background: none; border: none; cursor: pointer;
  width: 28px; height: 20px; position: relative; z-index: 200;
}
.nav-toggle span {
  display: block; width: 100%; height: 2px; background: var(--ink);
  position: absolute; left: 0; transition: 0.3s;
}
.nav-toggle span:nth-child(1) { top: 0; }
.nav-toggle span:nth-child(2) { top: 9px; }
.nav-toggle span:nth-child(3) { top: 18px; }

.nav-toggle.open span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: fixed; inset: 0; background: var(--ivory);
    flex-direction: column; justify-content: center; gap: 2.5rem;
    transform: translateX(100%); transition: transform 0.4s cubic-bezier(0.4,0,0.2,1);
  }
  .nav-links.open { transform: translateX(0); }
  .nav-links a { font-size: 1.3rem; }
}

/* ==========================================================
   HERO
   ========================================================== */
.hero {
  padding: clamp(5rem,12vw,10rem) 0 clamp(4rem,8vw,7rem);
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* Decorative blobs */
.hero::before,
.hero::after {
  content: ''; position: absolute; border-radius: 50%; opacity: 0.12; pointer-events: none;
}
.hero::before {
  width: 500px; height: 500px; background: var(--coral);
  top: -180px; right: -120px; filter: blur(80px);
}
.hero::after {
  width: 400px; height: 400px; background: var(--teal);
  bottom: -160px; left: -100px; filter: blur(80px);
}

.hero-label {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--fs-caption);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--coral);
  margin-bottom: 1.2rem;
  opacity: 0; animation: fadeUp 0.8s 0.2s forwards;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: var(--fs-hero);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.025em;
  max-width: 900px; margin: 0 auto 1.5rem;
  opacity: 0; animation: fadeUp 0.8s 0.4s forwards;
}
.hero h1 em {
  font-style: italic; color: var(--coral);
}

.hero-sub {
  font-size: clamp(1.05rem,1.5vw,1.25rem);
  color: var(--ink-light);
  max-width: 560px; margin: 0 auto 2.5rem;
  opacity: 0; animation: fadeUp 0.8s 0.6s forwards;
}

.hero-cta {
  display: inline-flex; align-items: center; gap: 0.6rem;
  padding: 0.85rem 2rem;
  background: var(--ink);
  color: var(--ivory);
  font-family: var(--font-body);
  font-weight: 600; font-size: var(--fs-small);
  letter-spacing: 0.06em; text-transform: uppercase;
  border-radius: 100px;
  transition: background 0.3s, transform 0.3s;
  opacity: 0; animation: fadeUp 0.8s 0.8s forwards;
}
.hero-cta:hover { background: var(--coral); transform: translateY(-2px); }
.hero-cta svg { width: 16px; height: 16px; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ==========================================================
   SECTION TITLES
   ========================================================== */
.section-title {
  font-family: var(--font-display);
  font-size: var(--fs-h2);
  font-weight: 700;
  margin-bottom: 0.4rem;
}
.section-subtitle {
  color: var(--ink-faint);
  font-size: var(--fs-small);
  letter-spacing: 0.04em;
  margin-bottom: 2.5rem;
}
.section-rule {
  width: 48px; height: 3px;
  background: var(--coral);
  margin-bottom: 1rem;
}

/* ==========================================================
   FEATURED ARTICLES GRID
   ========================================================== */
.articles-section {
  padding: clamp(4rem,8vw,7rem) 0;
}

.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 2rem;
}

/* ---- Article Card ---- */
.article-card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--sand);
  transition: transform 0.35s cubic-bezier(0.4,0,0.2,1), box-shadow 0.35s;
  display: flex;
  flex-direction: column;
}
.article-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 48px rgba(0,0,0,0.08);
}

/* Featured image placeholder */
.card-image {
  position: relative;
  aspect-ratio: 16 / 10;
  background: var(--cream);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}
.article-card:hover .card-image img {
  transform: scale(1.04);
}

/* Placeholder state — shown when no image is uploaded yet */
.card-image-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  height: 100%;
  background:
    linear-gradient(135deg, var(--cream) 0%, var(--sand) 100%);
  color: var(--ink-faint);
  text-align: center;
  padding: 1.5rem;
}
.card-image-placeholder svg {
  width: 40px;
  height: 40px;
  opacity: 0.35;
}
.card-image-placeholder span {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.5;
}

/* Category tag inside image area */
.card-image .card-category-overlay {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
}

.card-body {
  padding: 1.5rem 1.5rem 1.8rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-category {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--coral);
  margin-bottom: 0.6rem;
  font-weight: 400;
}

/* When overlaid on image */
.card-category-overlay .card-category {
  background: var(--ivory);
  padding: 0.25rem 0.65rem;
  border-radius: 4px;
  margin-bottom: 0;
}

.card-title {
  font-family: var(--font-display);
  font-size: var(--fs-h3);
  font-weight: 700;
  line-height: 1.28;
  margin-bottom: 0.7rem;
  letter-spacing: -0.01em;
}
.card-title a {
  transition: color 0.25s;
}
.card-title a:hover { color: var(--coral); }

.card-excerpt {
  color: var(--ink-light);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 1.2rem;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  display: flex; align-items: center; gap: 0.8rem;
  font-size: var(--fs-caption);
  color: var(--ink-faint);
  border-top: 1px solid var(--sand);
  padding-top: 1rem;
  margin-top: auto;
}
.card-meta time { font-family: var(--font-mono); letter-spacing: 0.04em; }
.card-meta .dot { width: 3px; height: 3px; background: var(--ink-faint); border-radius: 50%; }

/* ==========================================================
   CATEGORY PILLS
   ========================================================== */
.categories-bar {
  display: flex; flex-wrap: wrap; gap: 0.6rem;
  margin-bottom: 2.5rem;
}
.cat-pill {
  padding: 0.45rem 1.1rem;
  border: 1px solid var(--sand);
  border-radius: 100px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-light);
  cursor: pointer;
  transition: all 0.25s;
  background: transparent;
}
.cat-pill:hover,
.cat-pill.active {
  background: var(--ink);
  color: var(--ivory);
  border-color: var(--ink);
}

/* ==========================================================
   ABOUT / BIO BAND
   ========================================================== */
.bio-band {
  background: var(--ink);
  color: var(--ivory);
  padding: clamp(4rem,8vw,7rem) 0;
}
.bio-inner {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: clamp(2rem,4vw,5rem);
  align-items: center;
}
.bio-photo {
  aspect-ratio: 3/4;
  background: var(--ink-light);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}
.bio-photo img { width: 100%; height: 100%; object-fit: cover; }
.bio-photo-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #2a2a2a, #3a3a3a);
  color: var(--ink-faint);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.bio-text h2 {
  font-family: var(--font-display);
  font-size: var(--fs-h1);
  font-weight: 700;
  margin-bottom: 1.5rem;
  line-height: 1.15;
}
.bio-text h2 em { font-style: italic; color: var(--coral); }
.bio-text p {
  color: rgba(255,255,255,0.72);
  margin-bottom: 1rem;
  max-width: 520px;
}
.bio-roles {
  display: flex; flex-wrap: wrap; gap: 0.5rem;
  margin-top: 1.5rem;
}
.bio-role {
  padding: 0.35rem 0.9rem;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 100px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.6);
}

@media (max-width: 768px) {
  .bio-inner { grid-template-columns: 1fr; }
  .bio-photo { max-width: 300px; margin: 0 auto 2rem; }
}

/* ==========================================================
   ARTICLE PAGE
   ========================================================== */
.article-hero {
  padding: clamp(4rem,8vw,7rem) 0 2rem;
  text-align: center;
}
.article-hero .card-category { margin-bottom: 1rem; }
.article-hero h1 {
  font-family: var(--font-display);
  font-size: var(--fs-h1);
  font-weight: 800;
  line-height: 1.15;
  max-width: 800px; margin: 0 auto 1.2rem;
}
.article-hero .article-meta {
  display: flex; justify-content: center; gap: 1.5rem;
  color: var(--ink-faint);
  font-size: var(--fs-small);
}
.article-hero .article-meta time { font-family: var(--font-mono); }

/* Featured image on article page */
.article-featured-img {
  max-width: 900px;
  margin: 2rem auto 3rem;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--sand);
}
.article-featured-img img {
  width: 100%; display: block;
}
.article-featured-placeholder {
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, var(--cream), var(--sand));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  color: var(--ink-faint);
}
.article-featured-placeholder svg { width: 48px; height: 48px; opacity: 0.3; }
.article-featured-placeholder span {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.5;
}

/* Article body prose */
.article-body {
  max-width: var(--max-w-text);
  margin: 0 auto;
  padding: 0 var(--gap) 4rem;
}
.article-body p {
  margin-bottom: 1.4rem;
  color: var(--ink);
}
.article-body h2 {
  font-family: var(--font-display);
  font-size: var(--fs-h2);
  font-weight: 700;
  margin: 2.5rem 0 1rem;
}
.article-body h3 {
  font-family: var(--font-display);
  font-size: var(--fs-h3);
  font-weight: 600;
  margin: 2rem 0 0.8rem;
}
.article-body blockquote {
  border-left: 3px solid var(--coral);
  padding: 1rem 1.5rem;
  margin: 2rem 0;
  background: var(--blush);
  border-radius: 0 8px 8px 0;
  font-style: italic;
  color: var(--ink-light);
}
.article-body ul, .article-body ol {
  padding-left: 1.5rem;
  margin-bottom: 1.4rem;
}
.article-body li { margin-bottom: 0.5rem; list-style: disc; }
.article-body a {
  color: var(--coral);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.article-body a:hover { color: var(--coral-dark); }

/* ==========================================================
   FOOTER
   ========================================================== */
.site-footer {
  background: var(--ink);
  color: rgba(255,255,255,0.5);
  padding: 3rem 0;
  text-align: center;
  font-size: var(--fs-small);
}
.footer-inner {
  max-width: var(--max-w); margin: 0 auto; padding: 0 var(--gap);
}
.footer-logo {
  font-family: var(--font-display);
  font-weight: 700; font-size: 1.3rem;
  color: #fff;
  margin-bottom: 1rem;
}
.footer-logo span { color: var(--coral); }
.footer-links {
  display: flex; justify-content: center; gap: 2rem;
  margin-bottom: 1.5rem;
}
.footer-links a {
  color: rgba(255,255,255,0.5);
  transition: color 0.25s;
  font-size: var(--fs-caption);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.footer-links a:hover { color: #fff; }
.footer-copy { font-size: var(--fs-caption); }

/* ==========================================================
   CONTACT SECTION
   ========================================================== */
.contact-section {
  padding: clamp(4rem,8vw,7rem) 0;
  text-align: center;
}
.contact-section p {
  max-width: 500px; margin: 0 auto 2rem;
  color: var(--ink-light);
}
.contact-btn {
  display: inline-flex; align-items: center; gap: 0.6rem;
  padding: 0.85rem 2.2rem;
  background: var(--coral);
  color: #fff;
  font-weight: 600;
  font-size: var(--fs-small);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 100px;
  transition: background 0.3s, transform 0.3s;
}
.contact-btn:hover { background: var(--coral-dark); transform: translateY(-2px); }

/* ==========================================================
   SCROLL REVEAL — elements with [data-reveal]
   ========================================================== */
[data-reveal] {
  opacity: 0; transform: translateY(30px);
  transition: opacity 0.7s, transform 0.7s;
}
[data-reveal].visible {
  opacity: 1; transform: translateY(0);
}

/* ==========================================================
   RESPONSIVE
   ========================================================== */
@media (max-width: 600px) {
  .articles-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 2.4rem; }
}
