/* ==========================================================================
   SHIVANSH VISHWAKARMA — HAND-DRAWN DESIGN SYSTEM STYLESHEET
   Colors:
     Background: #fdfbf7 (Warm Paper)
     Foreground: #2d2d2d (Soft Pencil Black)
     Muted:      #e5e0d8 (Old Paper / Erased Pencil)
     Accent:     #c92a2a (Crimson Ink Marker - WCAG AA 4.8:1 Compliant)
     Secondary:  #204e8a (Deep Blue Ballpoint Pen - WCAG AA 5.4:1 Compliant)
     Post-it:    #fff9c4 (Sticky Note Yellow)
   Typography:
     Headings:   'Kalam', cursive (700)
     Body:       'Patrick Hand', cursive (400)
   ========================================================================== */

:root {
  --bg-paper: #fdfbf7;
  --fg-pencil: #2d2d2d;
  --muted-paper: #e5e0d8;
  --accent-red: #b91c1c;
  --accent-blue: #204e8a;
  --postit-yellow: #fff9c4;
  --card-white: #ffffff;

  /* Reusable Wobbly Border Radii Tokens */
  --radius-wobbly: 255px 15px 225px 15px / 15px 225px 15px 255px;
  --radius-wobbly-md: 25px 225px 20px 245px / 225px 20px 245px 25px;
  --radius-wobbly-alt: 225px 25px 245px 20px / 25px 245px 20px 225px;
  --radius-wobbly-sm: 185px 12px 165px 12px / 12px 165px 12px 185px;
  --radius-wobbly-circle: 55% 45% 52% 48% / 48% 54% 46% 52%;

  /* Hard Offset Shadows (NO BLUR) */
  --shadow-hard: 4px 4px 0px 0px #2d2d2d;
  --shadow-hard-lg: 8px 8px 0px 0px #2d2d2d;
  --shadow-hard-sm: 2px 2px 0px 0px #2d2d2d;
  --shadow-hard-hover: 6px 6px 0px 0px #2d2d2d;
  --shadow-card: 3px 3px 0px 0px rgba(45, 45, 45, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background-color: var(--bg-paper);
  color: var(--fg-pencil);
  font-family: 'Patrick Hand', cursive, sans-serif;
  overflow-x: clip;
}

body {
  margin: 0;
  background-color: var(--bg-paper);
  color: var(--fg-pencil);
  font-family: 'Patrick Hand', cursive, sans-serif;
  background-image: radial-gradient(#e5e0d8 1.25px, transparent 1.25px);
  background-size: 24px 24px;
  overflow-x: clip;
}

h1, h2, h3, h4, .font-heading {
  font-family: 'Kalam', cursive, sans-serif;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.font-body {
  font-family: 'Patrick Hand', cursive, sans-serif;
}

/* Wobbly Border Utility Classes */
.wobbly {
  border-radius: var(--radius-wobbly);
}

.wobbly-md {
  border-radius: var(--radius-wobbly-md);
}

.wobbly-alt {
  border-radius: var(--radius-wobbly-alt);
}

.wobbly-sm {
  border-radius: var(--radius-wobbly-sm);
}

.wobbly-circle {
  border-radius: var(--radius-wobbly-circle);
}

/* Hard Offset Shadow Utilities */
.shadow-sketch {
  box-shadow: var(--shadow-hard);
}

.shadow-sketch-lg {
  box-shadow: var(--shadow-hard-lg);
}

.shadow-sketch-sm {
  box-shadow: var(--shadow-hard-sm);
}

.shadow-sketch-subtle {
  box-shadow: var(--shadow-card);
}

/* Visibility & Responsive Nav Utility Protection */
.hidden, [hidden] {
  display: none !important;
}

@media (max-width: 1023px) {
  #desktop-nav-links {
    display: none !important;
  }
  #mobile-menu-btn {
    display: inline-flex !important;
  }
}

@media (min-width: 1024px) {
  #mobile-menu-btn,
  #mobile-nav-drawer {
    display: none !important;
  }
  #desktop-nav-links {
    display: flex !important;
  }
}

/* Smooth Touch Scrolling without Ugly Scrollbar Tracks */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}


/* Hand-Drawn Button Component */
.btn-sketch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 48px;
  padding: 0.65rem 1.5rem;
  background-color: var(--card-white);
  color: var(--fg-pencil);
  border: 3px solid var(--fg-pencil);
  border-radius: var(--radius-wobbly);
  box-shadow: var(--shadow-hard);
  font-family: 'Patrick Hand', cursive, sans-serif;
  font-size: 1.2rem;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: transform 100ms ease, box-shadow 100ms ease, background-color 100ms ease, color 100ms ease;
  user-select: none;
}

.btn-sketch:hover {
  background-color: var(--accent-red);
  color: #ffffff;
  box-shadow: var(--shadow-hard-sm);
  transform: translate(2px, 2px) rotate(-1deg);
}

.btn-sketch:active {
  box-shadow: 0px 0px 0px 0px #2d2d2d;
  transform: translate(4px, 4px);
}

.btn-sketch-secondary {
  background-color: var(--muted-paper);
  color: var(--fg-pencil);
}

.btn-sketch-secondary:hover {
  background-color: var(--accent-blue);
  color: #ffffff;
  box-shadow: var(--shadow-hard-sm);
  transform: translate(2px, 2px) rotate(1deg);
}

.btn-sketch-yellow {
  background-color: var(--postit-yellow);
  color: var(--fg-pencil);
}

.btn-sketch-yellow:hover {
  background-color: var(--accent-red);
  color: #ffffff;
}

/* Hand-Drawn Card Component */
.card-sketch {
  position: relative;
  background-color: var(--card-white);
  border: 2px solid var(--fg-pencil);
  border-radius: var(--radius-wobbly-md);
  box-shadow: var(--shadow-card);
  transition: transform 100ms ease, box-shadow 100ms ease;
}

.card-sketch:hover {
  box-shadow: var(--shadow-hard-hover);
}

.card-sketch-emph {
  border-width: 3px;
  box-shadow: var(--shadow-hard);
}

.card-sketch-emph:hover {
  box-shadow: var(--shadow-hard-lg);
}

.card-postit {
  background-color: var(--postit-yellow);
}

/* Tape & Thumbtack Decorations */
.decoration-tape::before {
  content: "";
  position: absolute;
  top: -13px;
  left: 50%;
  transform: translateX(-50%) rotate(-2deg);
  width: 96px;
  height: 26px;
  background-color: rgba(229, 224, 216, 0.78);
  border: 1.5px dashed rgba(45, 45, 45, 0.45);
  border-radius: 8px 18px 10px 16px / 14px 8px 16px 10px;
  z-index: 10;
  pointer-events: none;
}

.decoration-tack::before {
  content: "";
  position: absolute;
  top: -11px;
  left: 50%;
  transform: translateX(-50%);
  width: 22px;
  height: 22px;
  background: radial-gradient(circle at 35% 35%, #ff9999 0%, #c92a2a 45%, #991b1b 100%);
  border: 2.5px solid var(--fg-pencil);
  border-radius: 55% 45% 50% 50% / 50% 55% 45% 50%;
  box-shadow: 2px 2px 0px 0px #2d2d2d;
  z-index: 10;
  pointer-events: none;
}

/* Speech Bubble Tail */
.speech-bubble {
  position: relative;
}

.speech-bubble::after {
  content: "";
  position: absolute;
  bottom: -18px;
  left: 36px;
  width: 0;
  height: 0;
  border-left: 16px solid transparent;
  border-right: 16px solid transparent;
  border-top: 18px solid var(--fg-pencil);
}

.speech-bubble::before {
  content: "";
  position: absolute;
  bottom: -14px;
  left: 38px;
  width: 0;
  height: 0;
  border-left: 14px solid transparent;
  border-right: 14px solid transparent;
  border-top: 16px solid var(--postit-yellow);
  z-index: 2;
}

/* Hand-Drawn Inputs */
.input-sketch {
  width: 100%;
  background-color: #ffffff;
  color: var(--fg-pencil);
  border: 2px solid var(--fg-pencil);
  border-radius: var(--radius-wobbly-sm);
  padding: 0.75rem 1rem;
  font-family: 'Patrick Hand', cursive, sans-serif;
  font-size: 1.15rem;
  outline: none;
  box-shadow: 2px 2px 0px 0px rgba(45, 45, 45, 0.12);
  transition: border-color 100ms ease, box-shadow 100ms ease, transform 100ms ease;
}

.input-sketch::placeholder {
  color: #555555;
  opacity: 1;
}

.input-sketch:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 4px rgba(32, 78, 138, 0.2), 3px 3px 0px 0px var(--accent-blue);
}

/* Wavy Underline for Nav & Headings */
.wavy-link {
  position: relative;
  text-decoration: none;
  color: var(--fg-pencil);
  transition: transform 100ms ease, color 100ms ease;
}

.wavy-link:hover {
  color: var(--accent-red);
  text-decoration: underline;
  text-decoration-style: wavy;
  text-decoration-color: var(--accent-red);
  text-underline-offset: 6px;
}

.wavy-link.active-nav {
  color: var(--accent-blue);
  text-decoration: underline;
  text-decoration-style: wavy;
  text-decoration-color: var(--accent-blue);
  text-underline-offset: 6px;
}

/* Drop-Cap First Letter Treatment */
.drop-cap::first-letter {
  float: left;
  font-family: 'Kalam', cursive, sans-serif;
  font-size: 3.6rem;
  line-height: 0.85;
  padding: 0.25rem 0.6rem 0.15rem 0.4rem;
  margin-right: 0.5rem;
  margin-top: 0.1rem;
  background-color: var(--postit-yellow);
  color: var(--fg-pencil);
  border: 2px solid var(--fg-pencil);
  border-radius: var(--radius-wobbly-sm);
  box-shadow: 2px 2px 0px 0px #2d2d2d;
}

/* Smooth Exponential Floating Animation (replaces abrupt bounce) */
@keyframes sketchFloat {
  0%, 100% {
    transform: translateY(0px) rotate(-2deg);
  }
  50% {
    transform: translateY(-8px) rotate(2deg);
  }
}

.animate-sketch-bounce {
  animation: sketchFloat 3.6s cubic-bezier(0.16, 1, 0.3, 1) infinite;
}

/* Typewriter Cursor */
@keyframes blinkCursor {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.cursor-sketch {
  display: inline-block;
  width: 3px;
  height: 1.1em;
  background-color: var(--accent-red);
  margin-left: 4px;
  vertical-align: middle;
  animation: blinkCursor 0.85s infinite;
}

/* Rough Icon Circle */
.icon-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: 2.5px solid var(--fg-pencil);
  border-radius: var(--radius-wobbly-circle);
  background-color: var(--postit-yellow);
  box-shadow: 2px 2px 0px 0px #2d2d2d;
  flex-shrink: 0;
}

/* Footer link strikethrough hover */
.footer-scribble-link {
  text-decoration: none;
  position: relative;
  transition: color 100ms ease;
}

.footer-scribble-link:hover {
  color: var(--accent-red);
  text-decoration: line-through;
  text-decoration-thickness: 2.5px;
  text-decoration-color: var(--accent-red);
}

/* Skill Progress Bar Fill - Solid Ink Texture */
.skill-bar-fill {
  background-color: var(--accent-blue);
  border-right: 2px solid var(--fg-pencil);
  transition: width 600ms cubic-bezier(0.22, 1, 0.36, 1);
}

.skill-bar-fill-red {
  background-color: var(--accent-red);
  border-right: 2px solid var(--fg-pencil);
  transition: width 600ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* Sticky Note Section Tag */
.sticky-tag {
  display: inline-block;
  background-color: var(--postit-yellow);
  border: 2px solid var(--fg-pencil);
  border-radius: var(--radius-wobbly-sm);
  box-shadow: 3px 3px 0px 0px #2d2d2d;
  padding: 0.25rem 0.9rem;
  font-family: 'Kalam', cursive, sans-serif;
  font-weight: 700;
  transform: rotate(-2deg);
}

/* Off-screen Content Visibility Optimization */
.cv-auto {
  content-visibility: auto;
  contain-intrinsic-size: 1px 750px;
}
