/* =========================
   House of Prithvi — styles
   Complete consolidated CSS
   ========================= */

/* -------- Palette (Refined for consistency) -------- */
:root {
  --color-bg: #f4eed9;          /* Main page background */
  --color-surface: #efe7c9;     /* Cards / panels */
  --color-surface-strong: #e9e0c2;
  --color-border: #e2d9bd;      /* Dividers / lines */
  --color-text-main: #2a2f35;    /* Primary text and headings */
  --color-text-muted: #6a6f76;   /* Lighter text */
  --color-accent: #2f3a46;      /* Buttons and interactive elements */
  --shadow: 0 1px 2px rgba(0, 0, 0, .02);
}

/* -------- Base -------- */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--color-text-main);
  background: var(--color-bg);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }

/* Containers */
.container { max-width: 960px; margin: 0 auto; padding: 0 20px; }
.container-narrow { max-width: 780px; }

/* -------- Header / Navbar -------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--color-bg);
  backdrop-filter: saturate(140%) blur(6px);
  border-bottom: 1px solid var(--color-border);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { font-weight: 700; color: var(--color-text-main); text-decoration: none; }
.nav-links { display: flex; align-items: center; gap: 18px; list-style: none; margin: 0; padding: 0; }
.nav-links a {
  color: var(--color-text-main);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.nav-links a:hover, .nav-links a.active { border-bottom-color: var(--color-text-main); }

/* -------- Sections -------- */
.section { padding: 72px 0; border-bottom: 1px solid var(--color-border); }
.section:last-of-type { border-bottom: 0; }
.section-head { margin-bottom: 24px; }

/* -------- Typography -------- */
.h1 { font-size: 40px; line-height: 1.2; margin: 0 0 12px; color: var(--color-text-main); }
.h2 { font-size: 28px; line-height: 1.2; margin: 0; }
.h3 { font-size: 20px; margin: 0 0 4px; }
.h4 { margin: 24px 0 6px; }
.lede { font-size: 18px; max-width: 720px; }
.note { color: var(--color-text-muted); margin-top: 6px; }
.muted { color: var(--color-text-muted); }

/* --- Hero (Intro) --- */
.hero {
  padding-top: 96px;
  padding-bottom: 48px;
  background:
    linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0) 40%, color-mix(in oklab, var(--color-bg) 88%, #000 0%) 100%);
  border-bottom: 0;
}
.kicker {
  letter-spacing: .06em;
  text-transform: uppercase;
  font-size: 12px;
  color: var(--color-text-muted);
  margin: 0 0 8px;
}
.display {
  font-size: clamp(36px, 6vw, 56px);
  line-height: 1.12;
  margin: 0 0 14px;
  color: var(--color-text-main);
  font-weight: 800;
}
.micro { color: var(--color-text-muted); margin: 6px 0 18px; }
.rule { border: 0; border-top: 1px solid var(--color-border); margin: 28px 0 0; }

/* --- Buttons --- */
.cta-row { display: flex; gap: 12px; flex-wrap: wrap; margin: 14px 0 8px; }
.btn {
  display: inline-block;
  background: var(--color-accent);
  color: #fff;
  text-decoration: none;
  padding: 10px 14px;
  border-radius: 10px;
  box-shadow: var(--shadow);
}
.btn:hover { filter: brightness(.95); }
.btn-ghost {
  display: inline-block;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  background: color-mix(in oklab, var(--color-bg) 96%, #000 0%);
  color: var(--color-text-main);
  text-decoration: none;
}
.btn-ghost:hover { border-color: color-mix(in oklab, var(--color-border) 60%, #000 0%); }

/* -------- Professional / Roles -------- */
.list-roles { display: grid; gap: 22px; }
.role {
  border-radius: 10px;
  padding: 16px;
}
.role-row {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; margin: 6px 0 8px;
}
.role-title { color: var(--color-text-muted); font-weight: 600; margin: 0; }
.role-dates { color: var(--color-text-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.bullets { margin: 8px 0 0 18px; }
.bullets li { margin: 6px 0; }

/* -------- Personal -------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.links { margin: 8px 0 0 18px; }
.links li { margin: 6px 0; }

/* -------- Gallery (Masonry) -------- */
.gallery {
  column-count: 3;
  column-gap: 18px;
}
@media (max-width: 1024px) { .gallery { column-count: 2; } }
@media (max-width: 640px) { .gallery { column-count: 1; } }

.media {
  display: inline-block;
  width: 100%;
  margin: 0 0 18px;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid var(--color-border);
  background: var(--color-surface-strong);
  box-shadow: var(--shadow);
  break-inside: avoid;
}
.media img, .media-video { width: 100%; height: auto; display: block; }
.media figcaption {
  padding: 10px 12px;
  font-size: 14px;
  color: var(--color-text-muted);
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
}

/* -------- Footer -------- */
.site-footer { border-top: 1px solid var(--color-border); background: var(--color-bg); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; min-height: 72px; }
.footer-inner a { color: var(--color-accent); text-decoration: none; border-bottom: 1px solid transparent; }
.footer-inner a:hover { border-bottom-color: var(--color-accent); }

/* -------- Mobile tweaks -------- */
@media (max-width: 760px) {
  .split { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; gap: 8px; padding: 16px 0; }
  .hero { padding-top: 72px; }
  .nav-links { gap: 14px; }
}

/* -------- Mobile Nav Toggle -------- */
.nav-toggle {
  display: none; /* Hidden by default on desktop */
  flex-direction: column;
  justify-content: space-around;
  width: 2rem;
  height: 2rem;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 10;
}
.nav-toggle:focus {
  outline: none;
}
.nav-toggle span {
  width: 2rem;
  height: 0.25rem;
  background: var(--color-text-main);
  border-radius: 10px;
  transition: all 0.3s linear;
  position: relative;
  transform-origin: 1px;
}

/* -------- Mobile Tweaks (Existing and New) -------- */
@media (max-width: 760px) {
  .split { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; gap: 8px; padding: 16px 0; }
  .hero { padding-top: 72px; }

  /* Show toggle and position nav links for mobile */
  .nav-toggle {
    display: flex;
  }
  .nav-links {
    display: none; /* Hide links by default */
    position: absolute;
    top: 60px;
    left: 0;
    width: 100%;
    flex-direction: column;
    align-items: center;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    padding: 1rem 0;
  }
  .nav-links.open {
    display: flex; /* Show links when menu is open */
  }
  .nav-links li {
    width: 100%;
    text-align: center;
  }
  .nav-links a {
    display: block;
    padding: 0.75rem 0;
  }
  .nav-links a:hover, .nav-links a.active {
    background-color: var(--color-surface);
    border-bottom-color: transparent;
  }
}

/* -------- About Page -------- */
.about-layout {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 48px;
  align-items: center;
}

.about-image img {
  width: 100%;
  border-radius: 22px; /* Matches gallery item radius */
  box-shadow: var(--shadow);
  border: 1px solid var(--color-border);
}

.about-content p {
  margin-bottom: 1.2em;
}

/* Make about page layout single-column on mobile */
@media (max-width: 760px) {
  .about-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

/* -------- Writings Page Grid -------- */
.writing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.writing-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.card-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.writing-card .card-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex-grow: 1; /* Allows footer button to stick to the bottom */
}

.writing-card .h3 {
  font-size: 18px;
  margin-bottom: 8px;
}

.writing-card p {
  color: var(--color-text-muted);
  flex-grow: 1; /* Pushes button to the bottom */
  margin-bottom: 24px;
}

.writing-card .btn {
  align-self: flex-start; /* Aligns button to the left */
}

/* Responsive Grid for Writings */
@media (max-width: 1024px) {
  .writing-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 760px) {
  .writing-grid {
    grid-template-columns: 1fr;
  }
}
/* -------- Testimonials Link in Work Section -------- */
/* -------- Testimonials Link in Work Section -------- */
.testimonial-cta {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 48px;
}
.testimonial-cta p {
  margin: 0;
  color: var(--color-text-muted);
}

/* Sets a custom padding at the bottom of the work section */
section#professional {
  padding-bottom: 24px;
}

/* -------- Testimonials Page -------- */
.testimonial-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  max-width: 780px; /* Same as container-narrow */
  margin: 0 auto;
}

.testimonial-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 24px 28px;
  box-shadow: var(--shadow);
}

.testimonial-card blockquote {
  margin: 0 0 20px 0;
  font-size: 18px;
  line-height: 1.6;
  border-left: 3px solid var(--color-accent);
  padding-left: 20px;
  font-style: italic;
  color: var(--color-text-main);
}

.testimonial-author .author-name {
  font-weight: 600;
  margin: 0;
}

.testimonial-author .author-role {
  color: var(--color-text-muted);
  font-size: 14px;
  margin: 0;
}