/* ===========================================================
   Nishant Arora — Personal Website
   Custom styles complementing Tailwind (loaded via CDN).
   Dark, editorial, scholarly.
   =========================================================== */

:root {
  --ink: #0a0a0a;
  --surface: #111111;
  --elevated: #171717;
  --rule: #2a2a2a;
  --muted: #9a9a9a;
  --body: #d4d4d4;
  --heading: #f5f5f5;
  --accent: #c9a66b;
  --accent-soft: #e6c893;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
  background: var(--ink);
}

body {
  font-size: 16px;
  line-height: 1.65;
  font-feature-settings: "ss01", "ss02", "cv11";
}

/* Selection */
::selection {
  background: var(--accent);
  color: var(--ink);
}

/* Focus visible */
:focus-visible {
  outline: 2px solid var(--accent-soft);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  background: var(--accent);
  color: var(--ink);
  padding: 0.65rem 1rem;
  border-radius: 4px;
  font-weight: 600;
  z-index: 100;
  transition: top 0.15s ease;
}
.skip-link:focus {
  top: 1rem;
}

/* ==================== HEADER ==================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.site-header.is-scrolled {
  border-bottom-color: var(--rule);
}

#primary-nav a,
#mobile-nav a {
  color: var(--body);
  text-decoration: none;
  padding: 0.4rem 0;
  position: relative;
  transition: color 0.15s ease;
}
#primary-nav a:hover,
#mobile-nav a:hover {
  color: var(--heading);
}
#primary-nav a.is-active {
  color: var(--heading);
}
#primary-nav a.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -4px;
  height: 1px;
  background: var(--accent);
}
#primary-nav .nav-cta {
  color: var(--accent);
}
#primary-nav .nav-cta:hover {
  color: var(--accent-soft);
}

#mobile-nav a {
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--rule);
  min-height: 44px;
  display: flex;
  align-items: center;
}
#mobile-nav a:last-child {
  border-bottom: none;
}

#menu-button {
  min-width: 44px;
  min-height: 44px;
}

/* ==================== HERO ==================== */
.hero {
  position: relative;
  min-height: calc(100vh - 4rem);
  display: flex;
  align-items: center;
  background:
    radial-gradient(1200px 600px at 70% 20%, rgba(201, 166, 107, 0.08), transparent 60%),
    radial-gradient(800px 500px at 10% 90%, rgba(201, 166, 107, 0.04), transparent 60%),
    var(--ink);
  border-bottom: 1px solid var(--rule);
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
  pointer-events: none;
}

.eyebrow {
  color: var(--accent);
  font-size: 0.8rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 500;
}

.hero-photo-wrap {
  display: flex;
  justify-content: center;
}

.hero-photo {
  position: relative;
  width: min(320px, 80vw);
  aspect-ratio: 4 / 5;
  border-radius: 6px;
  overflow: hidden;
  background: linear-gradient(160deg, #1a1a1a, #0f0f0f);
  border: 1px solid var(--rule);
  box-shadow:
    0 30px 60px -20px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(201, 166, 107, 0.08);
}

.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-initials {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Fraunces", Georgia, serif;
  font-weight: 600;
  font-size: clamp(4rem, 10vw, 7rem);
  color: var(--accent);
  letter-spacing: 0.05em;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.hero-photo.no-image .hero-initials {
  opacity: 1;
}
.hero-photo.no-image {
  background:
    radial-gradient(circle at 30% 30%, rgba(201, 166, 107, 0.15), transparent 60%),
    linear-gradient(160deg, #1a1a1a, #0f0f0f);
}

/* CTAs */
.cta-primary,
.cta-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.5rem;
  min-height: 44px;
  font-weight: 500;
  text-decoration: none;
  border-radius: 2px;
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  letter-spacing: 0.01em;
}
.cta-primary {
  background: var(--accent);
  color: var(--ink);
}
.cta-primary:hover {
  background: var(--accent-soft);
  transform: translateY(-1px);
}
.cta-secondary {
  border: 1px solid var(--rule);
  color: var(--heading);
  background: transparent;
}
.cta-secondary:hover {
  border-color: var(--accent);
  color: var(--accent-soft);
}

/* ==================== SECTIONS ==================== */
.section {
  padding: 6rem 0;
  border-bottom: 1px solid var(--rule);
}
.section-alt {
  background: var(--surface);
}

.section-heading {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 500;
  color: var(--heading);
  font-size: clamp(2rem, 4.5vw, 3.25rem);
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin-top: 1rem;
  max-width: 52rem;
}

.section-lede {
  margin-top: 1.25rem;
  max-width: 48rem;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.7;
}

/* ==================== PROSE ==================== */
.prose-dark p {
  margin-bottom: 1.25rem;
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--body);
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
  -webkit-hyphens: auto;
  hanging-punctuation: first last;
}
.prose-dark p:last-child {
  margin-bottom: 0;
}
.prose-dark strong {
  color: var(--heading);
  font-weight: 600;
}

/* At a glance */
.at-a-glance {
  background: var(--elevated);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 1.75rem;
  align-self: start;
}
.at-a-glance dl {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.at-a-glance dl > div {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--rule);
}
.at-a-glance dl > div:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.at-a-glance dt {
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}
.at-a-glance dd {
  color: var(--heading);
  font-size: 0.98rem;
  font-weight: 500;
}

/* ==================== CARDS ==================== */
.card {
  background: var(--elevated);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}
.card:hover {
  border-color: rgba(201, 166, 107, 0.4);
  transform: translateY(-2px);
}

.card-wide {
  padding: 2.25rem;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}

.card-title {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 500;
  color: var(--heading);
  font-size: 1.35rem;
  line-height: 1.3;
  letter-spacing: -0.005em;
}

.card-body {
  color: var(--body);
  font-size: 0.98rem;
  line-height: 1.65;
  flex: 1;
}

.card-link {
  color: var(--accent);
  font-size: 0.92rem;
  font-weight: 500;
  text-decoration: none;
  letter-spacing: 0.01em;
  margin-top: 0.25rem;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  min-height: 44px;
  padding-top: 0.5rem;
  border-top: 1px solid var(--rule);
  transition: color 0.15s ease;
}
.card-link:hover {
  color: var(--accent-soft);
}
.card-link span {
  transition: transform 0.2s ease;
}
.card-link:hover span {
  transform: translateX(3px);
}

/* ==================== CREDENTIALS ==================== */
.credentials-group-heading {
  font-family: "Fraunces", Georgia, serif;
  color: var(--heading);
  font-size: 1.25rem;
  font-weight: 500;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 1rem;
}

.credentials-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.credentials-list li {
  display: flex;
  flex-direction: column;
  padding: 0.85rem 0;
  border-bottom: 1px dotted var(--rule);
}
.credentials-list li:last-child {
  border-bottom: none;
}
.credentials-list li strong {
  color: var(--heading);
  font-weight: 500;
  font-size: 1rem;
}
.credentials-list li span {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 0.15rem;
}

/* ==================== CONTACT ==================== */
.contact-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.75rem;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: var(--elevated);
  text-decoration: none;
  min-height: 44px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.contact-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.contact-label {
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}
.contact-value {
  color: var(--heading);
  font-size: 1.1rem;
  font-weight: 500;
  word-break: break-word;
}

/* ==================== FOOTER ==================== */
.site-footer {
  background: var(--ink);
  border-top: 1px solid var(--rule);
}

/* ==================== REDUCED MOTION ==================== */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* ==================== MOBILE TUNING ==================== */
@media (max-width: 767px) {
  .section {
    padding: 4rem 0;
  }
  .hero {
    min-height: auto;
    padding: 2rem 0 1rem;
  }
  .hero-photo-wrap {
    order: -1;
    margin-bottom: 0.5rem;
  }
  .hero-photo {
    width: min(220px, 60vw);
  }
  .card {
    padding: 1.5rem;
  }
  /* On narrow screens, justified text leaves ugly gaps. Fall back to left. */
  .prose-dark p {
    text-align: left;
    hyphens: none;
  }
}
