html, body {
  height: 100%;
  overflow: hidden;
  margin: 0;
  padding: 0;
}

.wrapper {
  display: grid;
  grid-template-columns: 320px 1fr;
  height: 100vh;
  overflow: hidden;
}

.sidebar {
  position: relative;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px 40px;
  border-right: 1px solid var(--border);
  box-sizing: border-box;
}

.sidebar__top {
  flex: 0 0 auto;
}

.sidebar__middle {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  max-height: 240px;
  overflow: hidden;
}

.sidebar__bottom {
  flex: 0 0 auto;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

main {
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 48px 56px;
  box-sizing: border-box;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

main::-webkit-scrollbar {
  display: none;
}

.section__header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
}

.section__icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--accent-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    flex-shrink: 0;
}

.section__label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--accent);
    position: relative;
}

.section__label::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    height: 1px;
    background: var(--accent);
    width: 0;
    transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.section__label.revealed::after {
    width: 60px;
}

.name {
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--text-1);
}

.title {
  font-size: 16px;
  color: var(--text-2);
  margin-top: 6px;
}

nav {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  gap: 0;
  margin-top: 32px;
  overflow-x: visible;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-radius: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--text-3);
  text-decoration: none;
  background: none;
  transition: color 0.3s ease;
}

.nav-link::before {
  content: '';
  display: block;
  width: 24px;
  height: 1px;
  background: var(--text-3);
  transition: width 0.3s ease, background 0.3s ease;
  flex-shrink: 0;
}

.nav-link:hover {
  color: var(--text-1);
}

.nav-link:hover::before {
  width: 32px;
  background: var(--text-1);
}

.nav-link.active {
  color: var(--text-1);
  background: none;
}

.nav-link.active::before {
  width: 40px;
  background: var(--accent);
}

.tagline-devanagari {
    font-family: 'Baloo 2', sans-serif;
    font-size: 18px;
    font-weight: 500;
    color: var(--text-1);
    line-height: 1.7;
    letter-spacing: 0.02em;
    margin-bottom: 2px;
}

.tagline-transliteration {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 13px;
    font-weight: 400;
    font-style: italic;
    color: var(--accent);
    opacity: 0.7;
    letter-spacing: 0.14em;
    margin-top: 0;
}

.tagline-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-3);
}

.status__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4CAF50;
    box-shadow: 0 0 6px rgba(76, 175, 80, 0.5);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }

    100% {
        opacity: 1;
    }
}

.socials {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 16px;
}

.social-link {
    color: var(--text-3);
    transition: color 0.2s ease;
    display: flex;
}

.social-link:hover {
    color: var(--accent);
}

.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-3);
    display: flex;
    align-items: center;
    transition: color 0.2s ease;
    padding: 0;
}

.theme-toggle:hover {
    color: var(--accent);
}

.icon-moon {
    display: none;
}

[data-theme="light"] .icon-sun {
    display: none;
}

[data-theme="light"] .icon-moon {
    display: block;
}

.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 2px;
    width: 0;
    z-index: 9999;
    background: linear-gradient(90deg, var(--accent), var(--accent-glow));
    box-shadow: 0 0 8px var(--accent-glow);
    transition: none;
}

.spotlight {
    position: fixed;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(200, 149, 108, 0.15) 0%, transparent 70%);
    pointer-events: none;
    z-index: 9998;
    transform: translate(-50%, -50%);
    transition: opacity 0.3s ease;
    will-change: transform;
    opacity: 1;
}

[data-theme="light"] .spotlight {
    background: radial-gradient(circle, rgba(176, 125, 86, 0.10) 0%, transparent 70%);
}

#three-bg {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 0.4;
}

[data-theme="light"] #three-bg {
    opacity: 0.2;
}

#sidebar-shape {
    width: 100%;
    flex: 1;
    min-height: 180px;
    max-height: 220px;
    display: block;
    cursor: grab;
    background: transparent;
}

#sidebar-shape:active {
    cursor: grabbing;
}

/* Contact section handles its own bottom spacing */
#contact {
    padding-bottom: 80px;
    margin-bottom: 0;
}

/* Last section in main should have no extra margin */
main .section:last-child {
    margin-bottom: 0;
}

/* Body and html should not add extra space */
@media (min-width: 769px) {
  #corner-geo {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }
}

@media (max-width: 768px) {
    html, body {
        overflow: auto;
        height: auto;
    }

    .wrapper {
        display: block;
        height: auto;
        box-sizing: border-box;
        padding: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
    }

    .sidebar {
        height: auto;
        border-right: none;
        justify-content: flex-start !important;
        box-sizing: border-box;
        position: relative;
        display: flex;
        flex-direction: column;
        gap: 0 !important;
        padding: 24px 16px 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow: visible !important;
    }

    .sidebar__top {
        gap: 6px;
        padding-bottom: 0 !important;
        flex: 0 0 auto !important;
        margin-bottom: 0 !important;
    }

    .name {
        font-size: 32px;
        letter-spacing: -0.03em;
    }

    .title {
        font-size: 15px;
        color: var(--text-2);
    }

    .tagline-group {
        margin-top: 6px;
    }

    .tagline-devanagari {
        font-size: 16px;
    }

    nav {
      display: flex !important;
      flex-direction: row !important;
      flex-wrap: wrap !important;
      gap: 6px !important;
      margin-top: 14px !important;
      overflow-x: visible !important;
      width: 100%;
    }

    nav::-webkit-scrollbar {
        display: none;
    }

    .nav-link {
      display: inline-flex !important;
      align-items: center !important;
      padding: 8px 14px !important;
      border-radius: 20px !important;
      font-size: 11px !important;
      letter-spacing: 0.08em !important;
      text-transform: uppercase !important;
      white-space: nowrap !important;
      color: var(--text-3) !important;
      background: none !important;
      width: auto !important;
    }

    .nav-link::before {
      display: none !important;
    }

    .nav-link.active {
      background: var(--accent-dim) !important;
      color: var(--text-1) !important;
    }

    main {
        height: auto;
        box-sizing: border-box;
        border-top: 1px solid var(--border);
        border-left: none;
        padding: 0 16px !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
    }

    .section {
        margin-bottom: 48px;
        padding-left: 0;
        padding-right: 0;
    }

    .section__header {
        margin-bottom: 20px;
    }

    .sidebar__bottom {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        margin-top: 14px !important;
        flex: 0 0 auto !important;
        padding-bottom: 16px;
        border-bottom: 1px solid var(--border);
        width: 100%;
    }

    .status {
        display: flex;
        align-items: center;
        gap: 8px;
        font-size: 13px;
        color: var(--text-2);
    }

    .socials {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 20px;
        margin-top: 0;
    }

    .socials a {
        font-size: 18px;
        color: var(--text-2);
    }

    .spotlight {
        display: none;
    }

    #sidebar-shape {
        display: none;
    }

    #three-bg {
        display: none;
    }

    body {
        font-size: 14px;
        line-height: 1.75;
    }

    .scroll-progress {
        height: 3px;
    }

    .about__content p {
        hyphens: none;
        overflow-wrap: break-word;
        word-break: normal;
    }

    #education {
        margin-bottom: 32px;
    }

    #contact {
        padding-top: 0;
    }
}

@media (max-width: 480px) {
    .wrapper {
        padding: 0 16px;
    }

    .name {
        font-size: 28px;
    }

    .section {
        margin-bottom: 48px;
    }

    .card {
        padding: 16px;
    }

    .project-card.hero {
        padding: 16px;
    }

    .project-card__title {
        font-size: 17px;
    }

    .project-card.hero .project-card__title {
        font-size: 22px;
    }

    .contact__email {
        font-size: 20px;
    }
}