/* ==========================================================================
   kamalgaur.com — design system
   Premium editorial: warm ink background, cream text, violet accent.
   No gradients, no shadows, flat surfaces, generous whitespace.
   ========================================================================== */

:root {
  /* Color tokens */
  --ink: #17140F;                       /* page background */
  --cream: #F5F1E8;                     /* primary text */
  --cream-muted: rgba(245, 241, 232, 0.65);   /* body / secondary copy */
  --cream-faint: rgba(245, 241, 232, 0.4);    /* captions, quiet labels */
  --violet: #9C8AD6;                    /* accent */
  --violet-light: #AFA9EC;              /* subtle highlight / hover text */
  --violet-deep: #201A38;               /* text on violet surfaces */
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.12);
  --card-bg: rgba(255, 255, 255, 0.03);

  /* Type */
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;

  /* Layout */
  --container: 1080px;
  --prose: 65ch;
}

/* --------------------------------------------------------------------------
   Reset / base
   -------------------------------------------------------------------------- */

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

html {
  scroll-behavior: smooth;
  scrollbar-color: rgba(156, 138, 214, 0.3) #17140F;
}

/* Cross-page fade (View Transitions API; progressive enhancement) */
@view-transition {
  navigation: auto;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  @view-transition {
    navigation: none;
  }
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}

body {
  margin: 0;
  background-color: var(--ink);
  color: var(--cream);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

::selection {
  background: rgba(156, 138, 214, 0.4);
  color: var(--cream);
}

::-webkit-scrollbar {
  width: 12px;
}

::-webkit-scrollbar-track {
  background: var(--ink);
}

::-webkit-scrollbar-thumb {
  background: rgba(156, 138, 214, 0.25);
  border-radius: 6px;
  border: 3px solid var(--ink);
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(156, 138, 214, 0.4);
}

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.2;
  margin: 0;
  letter-spacing: 0.005em;
}

p {
  margin: 0;
}

img, svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--violet);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--violet-light);
}

/* Visible focus states everywhere */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--violet);
  outline-offset: 3px;
  border-radius: 2px;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 24px;
}

/* Screen-reader-only helper */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--violet);
  color: var(--violet-deep);
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 0 0 6px 6px;
}

.skip-link:focus {
  top: 0;
  color: var(--violet-deep);
}

/* --------------------------------------------------------------------------
   Eyebrow labels — the only tracked-out caps on the site
   -------------------------------------------------------------------------- */

.eyebrow {
  display: block;
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--violet);
}

/* --------------------------------------------------------------------------
   Header / navigation
   -------------------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 90;
  background: rgba(23, 20, 15, 0.82);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 72px;
  position: relative;
}

.brand {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--cream);
  letter-spacing: 0.01em;
}

.brand:hover {
  color: var(--violet-light);
}

.site-nav ul {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 32px;
  margin: 0;
  padding: 0;
}

.site-nav a {
  position: relative;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--cream-muted);
  padding: 6px 2px;
}

.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--violet);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}

.site-nav a:hover {
  color: var(--cream);
}

.site-nav a:hover::after,
.site-nav a[aria-current="page"]::after {
  transform: scaleX(1);
}

.site-nav a[aria-current="page"] {
  color: var(--cream);
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  color: var(--cream);
  padding: 8px 10px;
  cursor: pointer;
  line-height: 0;
}

.nav-toggle svg {
  width: 20px;
  height: 20px;
}

.nav-toggle .icon-close {
  display: none;
}

.nav-toggle[aria-expanded="true"] .icon-menu {
  display: none;
}

.nav-toggle[aria-expanded="true"] .icon-close {
  display: block;
}

@media (max-width: 680px) {
  .nav-toggle {
    display: inline-flex;
  }

  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 50;
    background: var(--ink);
    border-bottom: 1px solid var(--border-strong);
    padding: 8px 24px 20px;
  }

  .site-nav.is-open {
    display: block;
  }

  .site-nav ul {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .site-nav a {
    display: block;
    padding: 10px 0;
    font-size: 1rem;
  }

  .site-nav a::after {
    display: none;
  }

  .site-nav a[aria-current="page"] {
    color: var(--violet);
  }
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.btn {
  display: inline-block;
  font-family: var(--sans);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1;
  padding: 14px 26px;
  border-radius: 8px;
  border: 1px solid transparent;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn-primary {
  background-color: var(--violet);
  color: var(--violet-deep);
}

.btn-primary:hover {
  background-color: var(--violet-light);
  color: var(--violet-deep);
}

.btn-secondary {
  background-color: transparent;
  color: var(--cream);
  border-color: var(--border-strong);
}

.btn-secondary:hover {
  color: var(--cream);
  border-color: rgba(255, 255, 255, 0.28);
}

/* --------------------------------------------------------------------------
   Hero (home)
   -------------------------------------------------------------------------- */

.hero {
  position: relative;
  text-align: center;
  padding: 96px 0 56px;
}

/* Ambient violet glow behind the hero headline */
.hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: -140px;
  left: 50%;
  transform: translateX(-50%);
  width: 780px;
  height: 520px;
  background: radial-gradient(ellipse at center, rgba(156, 138, 214, 0.13), transparent 65%);
  pointer-events: none;
}

.hero .eyebrow {
  margin-bottom: 28px;
}

.hero h1 {
  font-size: clamp(2.2rem, 5.2vw, 3.4rem);
  line-height: 1.14;
  max-width: 24ch;
  margin-inline: auto;
}

.hero-sub {
  font-size: 1.05rem;
  color: var(--cream-muted);
  max-width: 52ch;
  margin: 28px auto 0;
}

.hero-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 40px;
}

/* One-time entrance choreography (JS-gated so no-JS users see everything) */
@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.js .hero .eyebrow,
.js .hero h1,
.js .hero-sub,
.js .hero-actions,
.js .hero .scroll-cue {
  animation: rise-in 0.7s cubic-bezier(0.2, 0.7, 0.3, 1) both;
}

.js .hero h1 { animation-delay: 0.08s; }
.js .hero-sub { animation-delay: 0.16s; }
.js .hero-actions { animation-delay: 0.24s; }
.js .hero .scroll-cue { animation-delay: 0.34s; }

.scroll-cue {
  display: flex;
  justify-content: center;
  margin-top: 48px;
}

@keyframes cue-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

.scroll-cue a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  color: var(--cream-faint);
  transition: color 0.2s ease, border-color 0.2s ease;
  animation: cue-bob 2.6s ease-in-out 1.4s infinite;
}

.scroll-cue a:hover {
  color: var(--violet);
  border-color: var(--border-strong);
}

.scroll-cue svg {
  width: 18px;
  height: 18px;
}

/* --------------------------------------------------------------------------
   Section scaffolding
   -------------------------------------------------------------------------- */

.section {
  padding: 64px 0 112px;
  border-top: 1px solid var(--border);
}

.section-head {
  margin-bottom: 48px;
}

.section-head .eyebrow {
  margin-bottom: 16px;
}

.section-head h2 {
  font-size: clamp(1.7rem, 2.8vw, 2.15rem);
}

/* --------------------------------------------------------------------------
   Scroll-reveal (JS adds .is-visible via IntersectionObserver; the `translate`
   property is used so it composes with hover transforms)
   -------------------------------------------------------------------------- */

.js [data-reveal] {
  opacity: 0;
  translate: 0 18px;
  transition: opacity 0.65s ease, translate 0.65s ease;
}

.js [data-reveal].is-visible {
  opacity: 1;
  translate: 0 0;
}

/* --------------------------------------------------------------------------
   Newsletter cards — compact grid (home)
   -------------------------------------------------------------------------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.card {
  display: block;
  background-color: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 28px;
  color: var(--cream);
  transition: border-color 0.2s ease, transform 0.2s ease, background-color 0.2s ease;
}

.card:hover {
  border-color: rgba(156, 138, 214, 0.5);
  background-color: rgba(156, 138, 214, 0.05);
  transform: translateY(-3px);
  color: var(--cream);
}

.card-eyebrow {
  display: block;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--violet);
  opacity: 0.85;
  margin-bottom: 12px;
}

/* Publication logos — circular crop unifies varied logo art */
.pub-logo {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border-strong);
  margin-bottom: 18px;
}

.pub-logo-lg {
  width: 56px;
  height: 56px;
  margin-bottom: 0;
  flex-shrink: 0;
}

.card-head {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 16px;
}

.card-head .card-eyebrow {
  margin-bottom: 6px;
}

.card-head h2 {
  margin-bottom: 0;
}

.card h3 {
  font-size: 1.15rem;
  margin-bottom: 10px;
}

.card .tagline {
  font-size: 0.875rem;
  color: var(--cream-muted);
  line-height: 1.55;
}

/* --------------------------------------------------------------------------
   Page headers (interior pages)
   -------------------------------------------------------------------------- */

.page-head {
  position: relative;
  padding: 96px 0 24px;
}

/* Softer ambient glow on interior pages, biased toward the heading */
.page-head::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: -160px;
  left: -180px;
  width: 620px;
  height: 460px;
  background: radial-gradient(ellipse at center, rgba(156, 138, 214, 0.1), transparent 65%);
  pointer-events: none;
}

.page-head h1 {
  font-size: clamp(2.3rem, 4.8vw, 3.1rem);
}

.page-head .lede {
  margin-top: 20px;
  font-size: 1rem;
  color: var(--cream-muted);
  max-width: var(--prose);
}

/* --------------------------------------------------------------------------
   About — prose
   -------------------------------------------------------------------------- */

.prose {
  max-width: var(--prose);
  padding: 24px 0 64px;
}

.prose p {
  color: var(--cream-muted);
  font-size: 1.0625rem;
  line-height: 1.7;
}

.prose p + p {
  margin-top: 1.5em;
}

.prose a {
  color: var(--violet);
  text-decoration: underline;
  text-decoration-color: rgba(156, 138, 214, 0.4);
  text-underline-offset: 3px;
}

.prose a:hover {
  color: var(--violet-light);
  text-decoration-color: var(--violet-light);
}

.prose-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 48px;
  padding-bottom: 96px;
  max-width: var(--prose);
}

/* --------------------------------------------------------------------------
   Newsletters page — full cards
   -------------------------------------------------------------------------- */

.newsletter-list {
  max-width: 760px;
  padding: 32px 0 128px;
  display: grid;
  gap: 24px;
}

.newsletter-card {
  background-color: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 36px;
  transition: border-color 0.2s ease, transform 0.2s ease, background-color 0.2s ease;
}

.newsletter-card:hover {
  border-color: rgba(156, 138, 214, 0.4);
  background-color: rgba(156, 138, 214, 0.04);
  transform: translateY(-2px);
}

.newsletter-card h2 {
  font-size: 1.35rem;
  margin-bottom: 10px;
}

.newsletter-card .card-head h2 {
  margin-bottom: 0;
}

.newsletter-card .card-head .card-eyebrow {
  margin-bottom: 6px;
}

.newsletter-card .tagline {
  font-style: italic;
  color: var(--cream-muted);
  font-size: 0.95rem;
  line-height: 1.55;
}

.newsletter-card .blurb {
  margin-top: 18px;
  color: var(--cream-muted);
  font-size: 0.95rem;
  line-height: 1.65;
}

.newsletter-card .card-action {
  margin-top: 24px;
}

.read-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--violet);
}

.read-link svg {
  width: 14px;
  height: 14px;
  transition: transform 0.15s ease;
}

.read-link:hover svg {
  transform: translateX(3px);
}

/* --------------------------------------------------------------------------
   Contact page
   -------------------------------------------------------------------------- */

.contact-list {
  list-style: none;
  margin: 0;
  padding: 32px 0 128px;
  max-width: 520px;
  display: grid;
  gap: 16px;
}

.contact-list a {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 22px 26px;
  background-color: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--cream);
  transition: border-color 0.2s ease, transform 0.2s ease, background-color 0.2s ease;
}

.contact-list a:hover {
  border-color: rgba(156, 138, 214, 0.5);
  background-color: rgba(156, 138, 214, 0.05);
  transform: translateY(-2px);
  color: var(--cream);
}

.contact-list .handle {
  transition: color 0.2s ease;
}

.contact-list a:hover .handle {
  color: var(--cream-muted);
}

.contact-list svg {
  width: 22px;
  height: 22px;
  color: var(--violet);
  flex-shrink: 0;
}

.contact-list .label {
  font-weight: 500;
  font-size: 1rem;
}

.contact-list .handle {
  margin-left: auto;
  font-size: 0.85rem;
  color: var(--cream-faint);
}

@media (max-width: 480px) {
  .contact-list .handle {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-social {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0;
}

.footer-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  color: var(--cream-muted);
}

.footer-social a:hover {
  color: var(--violet);
}

.footer-social svg {
  width: 18px;
  height: 18px;
}

.copyright {
  font-size: 0.8125rem;
  color: var(--cream-faint);
}

/* --------------------------------------------------------------------------
   Responsive adjustments
   -------------------------------------------------------------------------- */

@media (max-width: 680px) {
  .hero {
    padding: 88px 0 80px;
  }

  .section {
    padding: 64px 0 88px;
  }

  .page-head {
    padding: 64px 0 16px;
  }

  .newsletter-card {
    padding: 28px 24px;
  }

  .footer-inner {
    flex-direction: column;
    justify-content: center;
  }
}
