/* ==========================================================================
   Prathmesh Sontakke — Personal Website Style Enhancements & Corrections
   Preserves original minimalist aesthetic while refining typography, contrast,
   hover interactions, and UI components.
   ========================================================================== */

:root {
  --bg: #ffffff;
  --text: #000000;          /* Pure black text */
  --strong: #000000;        /* Pure black titles & bold */
  --hover: #000000;
  --link-color: #000000;
  --link-hover: #000000;
  --border-subtle: #e2e8f0;
  --rule: #e2e8f0;
  --note: #f8fafc;
  --accent-dot: #000000;
}

/* --- Base Black Text Across Whole Site --- */
body, p, li, h1, h2, h3, h4, span, details, summary, nav a, article, article a, .side .links a, .side .name, .name, .wrap, .lead, .closing {
  color: #000000 !important;
}

/* --- Smooth Base Rendering --- */
html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

body {
  color: var(--text);
  line-height: 1.6;
}

/* --- Homepage Enhancements --- */
.wrap {
  gap: 32px;
}

.photo {
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  border-radius: 12px;
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.06);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.photo:hover {
  box-shadow: 0 10px 30px -4px rgba(0, 0, 0, 0.1);
}

.photo img {
  border-radius: 11px;
}

/* Homepage Navigation Container: Name is part of the navbar list */
.text {
  display: flex !important;
  flex-direction: column !important;
  gap: 3px !important;            /* Tight, close, equal line spacing */
}

.name,
nav a {
  margin: 0 !important;
  padding: 0 !important;
  font-size: 16px !important;
  line-height: 1.25 !important;
  font-weight: 600 !important;
  color: #000000 !important;
  letter-spacing: normal !important;
  text-decoration: none !important;
  display: inline-block;
  transition: transform 0.18s ease;
  transform-origin: left center;
}

nav a:hover,
nav a:focus-visible {
  color: #000000 !important;
  transform: translateX(4px);
}

nav {
  display: flex !important;
  flex-direction: column !important;
  gap: 3px !important;            /* Exact same 3px linespace */
  margin: 0 !important;
  padding: 0 !important;
}

/* --- Article & Reading Typography --- */
article {
  line-height: 1.65;
  color: var(--text);
}

article p {
  margin: 0 0 18px;
}

h1, h2, h3, h4 {
  color: var(--strong);
  letter-spacing: -0.015em;
  font-weight: 700;
}

h1 {
  line-height: 1.25;
  margin-bottom: 24px;
}

strong {
  color: var(--strong);
  font-weight: 600;
}

/* --- Side Navigation (Subpages: Desktop/Tablet only) --- */
@media (min-width: 541px) {
  .side {
    display: flex !important;
    flex-direction: column !important;
    gap: 3px !important;            /* Tight, equal 3px distance */
  }

  .side .name,
  .side .links a {
    margin: 0 !important;
    padding: 0 !important;
    font-size: 16px !important;
    line-height: 1.25 !important;
    font-weight: 600 !important;
    color: #000000 !important;
    letter-spacing: normal !important;
    text-decoration: none !important;
    display: block !important;
  }

  /* Prevent duplicate name: hide internal drawer link on desktop */
  .side .links a.name-in {
    display: none !important;
  }

  .side .links {
    display: flex !important;
    flex-direction: column !important;
    gap: 3px !important;            /* Clean, tight, equal distance between links */
    margin: 0 !important;
    padding: 0 !important;
  }
}

.side .links a {
  color: #000000 !important;
  display: block;
  padding: 0 !important;          /* Zero padding so gap controls exact equal distance */
  line-height: 1.25 !important;
  transition: transform 0.15s ease;
}

.side .links a:hover {
  color: #000000 !important;
  transform: translateX(4px);
}

.side .links a[aria-current="page"] {
  color: var(--strong);
  font-weight: 700;
  position: relative;
}

@media (min-width: 541px) {
  .side .links a[aria-current="page"]::before {
    content: "• ";
    color: var(--strong);
    position: absolute;
    left: -14px;
  }
}

/* --- Accordions / Details (Wow Websites & Resources) --- */
.wd {
  background: #f8fafc;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 0 18px;
  margin: 0 0 14px;
  max-width: 580px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.wd:hover,
.wd[open] {
  background: #ffffff;
  border-color: #cbd5e1;
  box-shadow: 0 3px 12px -2px rgba(0, 0, 0, 0.05);
}

.wd summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 16px;
  padding: 14px 0;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--strong);
  user-select: none;
}

.wd summary::-webkit-details-marker {
  display: none;
}

.wd summary::after {
  content: "+";
  font-size: 20px;
  font-weight: 500;
  color: #94a3b8;
  line-height: 1;
  transition: transform 0.2s ease, color 0.2s ease;
}

.wd[open] summary::after {
  transform: rotate(45deg);
  color: var(--strong);
}

.wl {
  margin: 0 0 16px;
  padding-left: 0;
  list-style: none;
  border-top: 1px solid #f1f5f9;
  padding-top: 12px;
}

.wl li {
  margin: 8px 0;
  display: flex;
  align-items: center;
}

.wl a {
  text-decoration: underline;
  color: #000000 !important;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: transform 0.15s ease;
}

.wl a:hover {
  color: #000000 !important;
  transform: translateX(3px);
}

/* External link indicator icon for wl a */
.wl a[target="_blank"]::after {
  content: "↗";
  font-size: 13px;
  opacity: 0.7;
  text-decoration: none;
  display: inline-block;
  margin-left: 2px;
}

/* --- Notes & Quotes Enhancements --- */
.note {
  background: var(--note);
  border-left: 3px solid #cbd5e1;
  border-radius: 0 8px 8px 0;
  padding: 14px 18px;
}

.series {
  border-left: 3px solid #cbd5e1;
  padding-left: 18px;
}

/* --- Mobile Improvements --- */
@media (max-width: 540px) {
  .wrap {
    padding: 28px 20px !important;
    gap: 18px !important;
  }

  /* Balanced photo size on mobile homepage */
  .wrap .photo {
    width: 280px !important;       /* Bumped up to 280px for a prominent yet clean portrait */
    max-width: 82vw !important;
    margin: 0 !important;
  }

  .wrap .photo img {
    width: 100% !important;
    height: auto !important;
  }

  /* Mobile homepage nav: name and links unified with tight, equal linespace */
  .wrap .text {
    display: flex !important;
    flex-direction: column !important;
    gap: 3px !important;            /* Tight, equal line spacing */
  }

  .wrap .name,
  nav a {
    margin: 0 !important;
    padding: 0 !important;
    font-size: 16px !important;
    line-height: 1.25 !important;
    font-weight: 600 !important;
    color: #000000 !important;
  }

  nav {
    display: flex !important;
    flex-direction: column !important;
    gap: 3px !important;            /* Exact same 3px linespace */
    margin: 0 !important;
    padding: 0 !important;
  }

  .layout {
    padding-left: 20px;
    padding-right: 20px;
  }

  /* Clean Sticky Mobile Header: Hamburger on Right, Ruler + Deep White Fade */
  body::before {
    display: none !important;
  }

  .side {
    position: sticky !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 100 !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-end !important; /* Hamburger cleanly on right */
    padding: 8px 20px !important;
    margin: 0 -20px 24px -20px !important;
    background: #ffffff !important;
    border-bottom: 2px solid #000000 !important; /* Dark black ruler, increased boldness */
    min-height: 48px !important;
    box-sizing: border-box !important;
  }

  .side::before {
    display: none !important;
  }

  /* Soft white fade gradient DIRECTLY UNDER the ruler (reduced by 50%) */
  .side::after {
    content: "" !important;
    position: absolute !important;
    left: 0 !important;
    right: 0 !important;
    top: calc(100% + 1px) !important; /* Starts right below the ruler border */
    height: 32px !important; /* Reduced by 50% for subtle, clean fade */
    background: linear-gradient(
      to bottom,
      #ffffff 0%,
      rgba(255, 255, 255, 0.85) 45%,
      rgba(255, 255, 255, 0) 100%
    ) !important;
    pointer-events: none !important;
    z-index: 99 !important;
  }

  .side.open::after {
    display: none !important;
  }

  /* Remove name from mobile top nav bar so it does not look like a logo */
  .side > a.name {
    display: none !important;
  }

  .side.open > a.name {
    display: none !important;
  }

  /* Right-aligned equal-to sign (=) hamburger button */
  .menu-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 44px !important;
    height: 44px !important;
    padding: 0 !important;
    margin: 0 -8px 0 0 !important;
    background: transparent !important;
    border: none !important;
    cursor: pointer !important;
    z-index: 110 !important;
    position: relative !important;
  }

  /* Two horizontal bars looking like an equal to sign (=) */
  .menu-btn .bars,
  .bars {
    display: block !important;
    width: 20px !important;
    height: 2px !important;
    background: transparent !important; /* Hide middle bar to keep exactly 2 bars */
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    margin: 0 auto !important;
    transform: none !important;
  }

  .menu-btn .bars::before,
  .menu-btn .bars::after,
  .bars::before,
  .bars::after {
    content: "" !important;
    display: block !important;
    width: 20px !important;
    height: 2px !important;
    background: #000000 !important;
    position: absolute !important;
    left: 0 !important;
    right: auto !important;
    transition: transform 0.2s ease, top 0.2s ease !important;
  }

  /* Top bar of the equal sign (=) */
  .menu-btn .bars::before,
  .bars::before {
    top: -4px !important;
    transform: none !important;
  }

  /* Bottom bar of the equal sign (=) */
  .menu-btn .bars::after,
  .bars::after {
    top: 4px !important;
    transform: none !important;
  }

  /* Hamburger transforms into a crisp centered X when open */
  .side.open .menu-btn .bars,
  .side.open .bars {
    background: transparent !important;
    transform: none !important;
    top: auto !important;
  }

  .side.open .menu-btn .bars::before,
  .side.open .bars::before {
    top: 0 !important;
    transform: rotate(45deg) !important;
    background: #000000 !important;
  }

  .side.open .menu-btn .bars::after,
  .side.open .bars::after {
    top: 0 !important;
    transform: rotate(-45deg) !important;
    background: #000000 !important;
  }

  /* Mobile slide-over menu */
  .side .links {
    display: none !important;
  }

  .side.open .links {
    display: flex !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 105 !important;
    background: #ffffff !important;
    padding: 70px 24px 36px !important;
    flex-direction: column !important;
    gap: 6px !important;            /* Tight, equal line spacing */
    overflow-y: auto !important;
  }

  .side.open .links a,
  .side.open .links a.name-in {
    font-size: 16px !important;     /* Exact same size as all links */
    font-weight: 600 !important;
    color: #000000 !important;
    text-decoration: none !important;
    padding: 0 !important;
    line-height: 1.25 !important;
  }
}
