/* ============================================
   Saswati Mishra — Portfolio
   Warm parchment palette, dramatic typography,
   Craig Mod whitespace, Tom Sears type confidence,
   Jessica Hische craft-as-design
   ============================================ */

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #f7f3e8;
  --bg-nav: rgba(247, 243, 232, 0.92);
  --text: #2c2418;
  --text-secondary: #7a6f5f;
  --accent: #a8872e;
  --accent-hover: #8c6f1e;
  --accent-light: rgba(168, 135, 46, 0.12);
  --border: #e0d9c8;
  --code-bg: #eee8d8;
  --card-bg: #fdfaf2;
  --card-shadow: 0 1px 3px rgba(60,45,20,0.04), 0 1px 2px rgba(60,45,20,0.06);
  --heading: 'Playfair Display', 'Georgia', 'Times New Roman', serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

[data-theme="dark"] {
  --bg: #1e1b15;
  --bg-nav: rgba(30, 27, 21, 0.92);
  --text: #e0daca;
  --text-secondary: #9e9484;
  --accent: #c9a84c;
  --accent-hover: #dbb85c;
  --accent-light: rgba(201, 168, 76, 0.1);
  --border: #3a3428;
  --code-bg: #28241c;
  --card-bg: #252118;
  --card-shadow: 0 1px 3px rgba(0,0,0,0.2), 0 1px 2px rgba(0,0,0,0.3);
}

html {
  font-size: 18px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
  overflow-x: hidden;
}

/* -----------------------------------------------
   Watercolor corner motifs
   ----------------------------------------------- */
.watercolor-motif {
  position: fixed;
  pointer-events: none;
  z-index: 0;
  -webkit-mask-image: radial-gradient(ellipse, rgba(0,0,0,0.55) 8%, transparent 58%);
  mask-image: radial-gradient(ellipse, rgba(0,0,0,0.55) 8%, transparent 58%);
}

.motif-tr {
  top: -140px;
  right: -140px;
  width: 580px;
  opacity: 0.055;
  mix-blend-mode: multiply;
}

.motif-bl {
  bottom: -140px;
  left: -140px;
  width: 500px;
  opacity: 0.05;
  mix-blend-mode: multiply;
}

[data-theme="dark"] .watercolor-motif {
  opacity: 0.03 !important;
  mix-blend-mode: screen;
}

/* --- Typography — Tom Sears confidence --- */
h1, h2, h3, h4 {
  font-family: var(--heading);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
}

h1 {
  font-size: 3.4rem;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

h2 {
  font-size: 1.6rem;
  margin-top: 3.5rem;
  margin-bottom: 1.25rem;
}

h3 {
  font-size: 1.2rem;
  margin-top: 2.5rem;
  margin-bottom: 0.85rem;
}

p { margin-bottom: 1.4rem; }

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, color 0.2s ease;
}
a:hover {
  border-bottom-color: var(--accent);
  color: var(--accent-hover);
}

blockquote {
  border-left: 1px solid var(--accent);
  margin: 3.5rem 0;
  padding: 1.5rem 2rem;
  color: var(--text-secondary);
  font-family: var(--heading);
  font-style: italic;
  font-size: 1.15rem;
  line-height: 1.7;
  text-align: center;
}

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 4rem 0;
}

strong { font-weight: 600; }
em { font-style: italic; }

/* --- Layout --- */
.container {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 1.5rem;
  position: relative;
  z-index: 1;
}

/* --- Navigation — whisper, not shout --- */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-nav);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  padding: 0.85rem 0;
}

nav .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-name {
  font-family: var(--heading);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  border-bottom: none;
}
.nav-name:hover { color: var(--accent); border-bottom: none; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.nav-links a {
  font-size: 0.72rem;
  color: var(--text-secondary);
  letter-spacing: 0.08em;
  text-transform: capitalize;
  font-weight: 400;
  border-bottom: none;
  transition: color 0.2s ease;
}
.nav-links a:hover,
.nav-links a.active { color: var(--accent); border-bottom: none; }

.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.3rem 0.55rem;
  cursor: pointer;
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: capitalize;
  color: var(--text-secondary);
  transition: all 0.2s ease;
  line-height: 1;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }

/* Mobile nav */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  color: var(--text);
}
.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text);
  margin: 4px 0;
  transition: all 0.3s ease;
}

@media (max-width: 640px) {
  .nav-toggle { display: block; }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--bg-nav);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.5rem;
    gap: 1rem;
    align-items: flex-start;
  }
  .nav-links.open { display: flex; }
}

/* --- Hero — Craig Mod breathing space --- */
.hero {
  padding: 8rem 0 3rem;
}

/* Botanical frame — simplified, no border or corners */
.hero-framed {
  position: relative;
  border: none;
  border-radius: 0;
  padding: 0;
}

.hero-framed .corner-ornament {
  display: none;
}

/* About intro — portrait + text */
.about-intro {
  display: flex;
  align-items: flex-start;
  gap: 2.75rem;
}

.about-portrait-wrap {
  flex-shrink: 0;
}

.about-portrait {
  width: 170px;
  height: 170px;
  border-radius: 50%;
  object-fit: cover;
  object-position: 58% 22%;
  border: 2px solid var(--accent);
  box-shadow: 0 4px 20px rgba(60,45,20,0.1);
}

[data-theme="dark"] .about-portrait {
  border-color: var(--accent);
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.about-intro h1 {
  margin-bottom: 0.85rem;
}

.about-intro h1::after {
  content: '';
  display: block;
  width: 50px;
  height: 1px;
  background: var(--accent);
  margin-top: 0.7rem;
  opacity: 0.5;
}

.hero p.tagline {
  font-family: var(--heading);
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 1.75rem;
  line-height: 1.7;
  font-style: italic;
}

/* --- Social Links --- */
.social-links {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}
.social-links a {
  font-size: 0.85rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  padding-bottom: 1px;
}
.social-links a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* --- Background / Resume Section --- */
.background-section {
  padding: 3rem 0 5rem;
}

.background-section h2 {
  font-size: 0.82rem;
  font-family: var(--sans);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  margin-top: 0;
  margin-bottom: 2rem;
}

.background-section h2::after {
  content: '';
  display: block;
  width: 30px;
  height: 1px;
  background: var(--accent);
  margin-top: 0.5rem;
  opacity: 0.4;
}

.resume-items {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.resume-item {
  display: flex;
  gap: 1.5rem;
  align-items: baseline;
}

.resume-date {
  flex-shrink: 0;
  width: 100px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.resume-detail h3 {
  font-family: var(--heading);
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.2rem;
}

.resume-detail p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 0;
  line-height: 1.55;
}

/* --- Essay Cards --- */
.essays {
  padding-bottom: 5rem;
}

.essays > .container > h2 {
  font-size: 0.82rem;
  font-family: var(--sans);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  margin-top: 0;
  margin-bottom: 2rem;
}

.essays > .container > h2::after {
  content: '';
  display: block;
  width: 30px;
  height: 1px;
  background: var(--accent);
  margin-top: 0.5rem;
  opacity: 0.4;
}

.essay-card {
  display: block;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2rem;
  margin-bottom: 1.5rem;
  text-decoration: none;
  box-shadow: var(--card-shadow);
  transition: all 0.35s ease;
}
.essay-card:hover {
  border-color: var(--accent);
  box-shadow: 0 6px 24px rgba(60,45,20,0.1);
  transform: scale(1.015);
}
[data-theme="dark"] .essay-card:hover {
  box-shadow: 0 6px 24px rgba(0,0,0,0.35);
}

.essay-card h3 {
  font-family: var(--heading);
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  color: var(--text);
}
.essay-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0;
  line-height: 1.6;
}
.essay-card .card-tag {
  display: inline-block;
  font-size: 0.68rem;
  font-family: var(--sans);
  color: var(--accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.4rem;
  font-weight: 600;
}

/* --- CTA Section — more breathing room --- */
.cta-section {
  padding: 5rem 0 6rem;
  text-align: center;
}

.cta-section p {
  font-family: var(--heading);
  font-size: 1.1rem;
  color: var(--text-secondary);
  font-style: italic;
  max-width: 480px;
  margin: 0 auto 2rem;
  line-height: 1.65;
}

.cta-button {
  display: inline-block;
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--accent);
  border: none;
  border-bottom: 1px solid var(--accent);
  border-radius: 0;
  padding: 0.35rem 0;
  background: none;
  transition: all 0.3s ease;
}
.cta-button:hover {
  border-bottom-color: var(--accent-hover);
  color: var(--accent-hover);
  padding-bottom: 0.5rem;
}

/* --- Page Header (essay pages) — enormous Craig Mod space --- */
.page-header {
  padding: 7rem 0 3rem;
}

.page-header h1::after {
  content: '';
  display: block;
  width: 50px;
  height: 1px;
  background: var(--accent);
  margin-top: 0.75rem;
  opacity: 0.5;
}

.page-header .subtitle {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-top: 1rem;
  margin-bottom: 0;
  font-family: var(--sans);
  font-weight: 400;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

/* --- Essay Content --- */
.essay-content {
  padding-bottom: 6rem;
}
.essay-content p {
  font-size: 1.05rem;
  line-height: 1.85;
  margin-bottom: 1.6rem;
}
.essay-content .lead {
  font-size: 1.2rem;
  color: var(--text-secondary);
  font-family: var(--heading);
  font-style: italic;
  line-height: 1.75;
}

/* Thin gold rule before each h2 in essays */
.essay-content h2::before {
  content: '';
  display: block;
  width: 30px;
  height: 1px;
  background: var(--accent);
  margin-bottom: 0.75rem;
  opacity: 0.4;
}

.essay-content h2 {
  margin-top: 4rem;
}

/* --- Art / Image Presentation ---
   Clean, floating, magazine-spread quality.
   No mat borders. Just subtle shadow and space. */

.art-piece {
  margin: 3.5rem 0;
  text-align: center;
}

.art-piece img {
  max-width: 100%;
  border-radius: 4px;
  box-shadow:
    0 2px 8px rgba(60,45,20,0.08),
    0 8px 30px rgba(60,45,20,0.06);
  transition: box-shadow 0.4s ease, transform 0.4s ease;
}

.art-piece img:hover {
  box-shadow:
    0 4px 12px rgba(60,45,20,0.1),
    0 12px 40px rgba(60,45,20,0.08);
  transform: translateY(-1px);
}

[data-theme="dark"] .art-piece img {
  box-shadow:
    0 2px 8px rgba(0,0,0,0.25),
    0 8px 30px rgba(0,0,0,0.2);
}

[data-theme="dark"] .art-piece img:hover {
  box-shadow:
    0 4px 12px rgba(0,0,0,0.3),
    0 12px 40px rgba(0,0,0,0.25);
}

/* Remove museum mat — clean edges only */
.art-matted img {
  padding: 0;
  background: none;
  border: none;
}

[data-theme="dark"] .art-matted img {
  background: none;
  border: none;
}

/* Featured art — full-bleed, breaks out of container (magazine spread) */
.art-featured img {
  max-width: calc(100% + 6rem);
  margin-left: -3rem;
  margin-right: -3rem;
  border-radius: 0;
  box-shadow: none;
}

.art-featured img:hover {
  box-shadow: none;
  transform: none;
}

/* Inline art — constrained with subtle treatment */
.art-inline img {
  max-width: 360px;
  border-radius: 4px;
}

/* Small art */
.art-small img {
  max-width: 260px;
}

.art-caption {
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-style: italic;
  margin-top: 0.85rem;
  line-height: 1.5;
  letter-spacing: 0.01em;
}

/* Art pair — side by side */
.art-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin: 3.5rem 0;
}
.art-pair .art-piece { margin: 0; }
.art-pair .art-piece img { max-width: 100%; }

/* --- Video Embed --- */
.video-embed {
  margin: 3rem 0;
  border-radius: 4px;
  overflow: hidden;
  background: var(--code-bg);
  border: 1px solid var(--border);
}
.video-embed .placeholder {
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
}
.video-embed .placeholder .icon {
  font-size: 2rem;
  opacity: 0.25;
}
.video-embed video,
.video-embed iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
  border: none;
}

/* --- Image Embed (legacy) --- */
.essay-image {
  margin: 3rem 0;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.essay-image img { width: 100%; display: block; }
.essay-image .placeholder {
  aspect-ratio: 16 / 10;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.5rem;
  background: var(--code-bg);
  color: var(--text-secondary);
  font-size: 0.9rem;
}
.essay-image .placeholder .icon { font-size: 2rem; opacity: 0.25; }

.image-caption {
  font-size: 0.78rem;
  color: var(--text-secondary);
  text-align: center;
  padding: 0.75rem 1rem;
  font-style: italic;
}

/* --- Back Link — more subtle, more top margin --- */
.back-link {
  display: inline-block;
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 3rem;
  margin-bottom: 1rem;
  border-bottom: none;
  letter-spacing: 0.04em;
  text-transform: capitalize;
  font-weight: 400;
  opacity: 0.7;
  transition: opacity 0.2s ease, color 0.2s ease;
}
.back-link:hover { color: var(--accent); border-bottom: none; opacity: 1; }
.back-link::before { content: '\2190\00a0'; }

/* --- Footer — more minimal, more top padding --- */
footer {
  border-top: 1px solid var(--border);
  padding: 4rem 0 3rem;
  margin-top: 3rem;
  position: relative;
  z-index: 1;
}
footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}
footer p {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 0;
  opacity: 0.7;
}
footer .footer-links { display: flex; gap: 1.25rem; }
footer .footer-links a {
  font-size: 0.75rem;
  color: var(--text-secondary);
  border-bottom: none;
  opacity: 0.7;
  transition: opacity 0.2s ease, color 0.2s ease;
}
footer .footer-links a:hover { color: var(--accent); opacity: 1; }

/* --- Scroll Animations --- */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Responsive --- */
@media (max-width: 640px) {
  html { font-size: 16px; }
  h1 { font-size: 2.2rem; }

  .hero { padding: 5rem 0 2rem; }

  .hero-framed {
    padding: 0;
  }

  .about-intro {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.5rem;
  }
  .about-intro h1::after { margin-left: auto; margin-right: auto; }
  .about-portrait { width: 140px; height: 140px; }
  .social-links { justify-content: center; }

  .page-header { padding: 5rem 0 2rem; }

  .resume-item {
    flex-direction: column;
    gap: 0.15rem;
  }
  .resume-date { width: auto; }

  .essay-card { padding: 1.5rem; }

  .art-inline img { max-width: 100%; }
  .art-pair { grid-template-columns: 1fr; }

  .art-featured img {
    max-width: calc(100% + 3rem);
    margin-left: -1.5rem;
    margin-right: -1.5rem;
  }

  .motif-tr { width: 350px; top: -100px; right: -100px; }
  .motif-bl { width: 300px; bottom: -100px; left: -100px; }

  footer .container {
    flex-direction: column;
    align-items: flex-start;
  }

  blockquote {
    padding: 1rem 1.25rem;
    margin: 2.5rem 0;
  }
}

/* --- Transitions --- */
body, nav, .essay-card, .video-embed, .essay-image, footer,
.art-piece img {
  transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}
