:root {
  --accent: #86c5fc;
  --accent-strong: #5aaef5;
  --accent-rgb: 134, 197, 252;

  --bg: #ffffff;
  --surface: #fbfcfe;
  --surface-raised: #ffffff;
  --text: #16202e;
  --text-muted: #5b6472;
  --border: #e7ebf1;
  --border-strong: #d9e0e9;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow: 0 2px 8px -3px rgba(15, 23, 42, 0.07), 0 1px 2px rgba(15, 23, 42, 0.03);
  --shadow-hover: 0 12px 28px -14px rgba(15, 23, 42, 0.14);
  --glow-hover: 0 0 0 1px rgba(var(--accent-rgb), 0.4), 0 12px 30px -18px rgba(var(--accent-rgb), 0.5);

  --radius-sm: 8px;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-pill: 999px;

  --font-sans: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  --font-display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --font-mono: "Fira Code", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  --max-width: 1100px;
  --nav-height: 58px;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --dur: 240ms;
}

body.dark-mode {
  --bg: #0f172a;
  --surface: #141d30;
  --surface-raised: #172035;
  --text: #e8eef8;
  --text-muted: #9aa7b8;
  --border: #223047;
  --border-strong: #2d3d56;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow: 0 2px 10px -4px rgba(0, 0, 0, 0.5), 0 1px 2px rgba(0, 0, 0, 0.28);
  --shadow-hover: 0 14px 32px -16px rgba(0, 0, 0, 0.65);
  --glow-hover: 0 0 0 1px rgba(var(--accent-rgb), 0.34), 0 14px 34px -20px rgba(var(--accent-rgb), 0.4);
}

/* ---------- Base & typography ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg);
  color: var(--text);
  font-size: 0.9375rem;
  line-height: 1.68;
  letter-spacing: -0.004em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

h1, h2, h3 {
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
  text-wrap: balance;
}

button { font: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 3px;
  border-radius: 6px;
}

::selection { background: rgba(var(--accent-rgb), 0.3); }

.skip-link {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, -140%);
  z-index: 2000;
  padding: 0.6rem 1rem;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  background: var(--surface-raised);
  border: 1px solid var(--border);
  font-size: 0.85rem;
  font-weight: 600;
  transition: transform 200ms var(--ease);
}

.skip-link:focus-visible { transform: translate(-50%, 0); }

/* ---------- Ambient Background ---------- */
.ambient-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-color: var(--bg);
  background-image:
    radial-gradient(46rem 28rem at 8% -8%, rgba(var(--accent-rgb), 0.16), transparent 64%),
    radial-gradient(38rem 24rem at 100% 6%, rgba(90, 174, 245, 0.11), transparent 66%),
    radial-gradient(42rem 26rem at 22% 62%, rgba(var(--accent-rgb), 0.07), transparent 68%),
    radial-gradient(46rem 28rem at 50% 106%, rgba(var(--accent-rgb), 0.1), transparent 70%);
}

.ambient-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.6) 48%, rgba(255, 255, 255, 0.15) 100%);
}

body.dark-mode .ambient-bg {
  background-image:
    radial-gradient(48rem 30rem at 6% -10%, rgba(var(--accent-rgb), 0.12), transparent 64%),
    radial-gradient(38rem 24rem at 100% 4%, rgba(90, 174, 245, 0.09), transparent 68%),
    radial-gradient(42rem 26rem at 20% 60%, rgba(var(--accent-rgb), 0.05), transparent 70%),
    radial-gradient(46rem 30rem at 50% 108%, rgba(var(--accent-rgb), 0.07), transparent 72%);
}

body.dark-mode .ambient-bg::after {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.25) 0%, rgba(15, 23, 42, 0.66) 48%, rgba(15, 23, 42, 0.25) 100%);
}

body > *:not(.ambient-bg):not(.skip-link) {
  position: relative;
  z-index: 1;
}

/* ---------- Layout Primitives ---------- */
.section {
  width: min(var(--max-width), 90%);
  margin-inline: auto;
  padding: 4.5rem 0;
  scroll-margin-top: calc(var(--nav-height) + 20px);
}

.section-compact { padding: 3rem 0; }
.first-section { padding-top: 4.75rem; padding-bottom: 3.75rem; }

.section-heading { max-width: 720px; margin-bottom: 2.25rem; }
.section-heading-tight { margin-bottom: 1.35rem; }

.section-kicker {
  color: var(--accent-strong);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 0.6rem;
}

.section-quote {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
  font-style: italic;
  letter-spacing: 0.02em;
}

.section-heading h2, .about-text h2, .footer-left h2 {
  font-size: clamp(1.15rem, 2vw, 1.4rem);
  margin-bottom: 0.7rem;
}

.section-heading-tight h2 { margin-bottom: 0; }

.section-subtitle {
  color: var(--text-muted);
  font-size: 0.75rem; 
  max-width: 62ch;
}

.card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  transition:
    transform var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease),
    border-color var(--dur) var(--ease),
    background-color var(--dur) var(--ease);
}

.card:hover, .card:focus-within {
  transform: translateY(-3px);
  border-color: rgba(var(--accent-rgb), 0.4);
  box-shadow: var(--shadow-hover), var(--glow-hover);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 36px;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background-color: var(--surface-raised);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: -0.004em;
  cursor: pointer;
  transition: all var(--dur) var(--ease);
}

.btn i { font-size: 0.8em; }

.btn:hover {
  transform: translateY(-1px);
  border-color: rgba(var(--accent-rgb), 0.6);
  box-shadow: 0 6px 16px -10px rgba(var(--accent-rgb), 0.75);
}

.btn:active { transform: translateY(0); }

.btn-accent {
  background-color: rgba(var(--accent-rgb), 0.13);
  border-color: rgba(var(--accent-rgb), 0.42);
  color: var(--accent-strong);
}

.btn-accent:hover { background-color: rgba(var(--accent-rgb), 0.2); }
.btn-secondary:hover { color: var(--accent-strong); }

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background-color: transparent;
  cursor: pointer;
  transition: all var(--dur) var(--ease);
}

.icon-button:hover {
  color: var(--accent-strong);
  border-color: rgba(var(--accent-rgb), 0.6);
  background-color: rgba(var(--accent-rgb), 0.1);
}

/* ---------- Fixed Navigation ---------- */
.floating-nav {
  position: fixed !important;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 9999 !important;
  border-bottom: 1px solid var(--border);
  background-color: color-mix(in oklab, var(--bg) 85%, transparent);
  backdrop-filter: saturate(170%) blur(20px);
  -webkit-backdrop-filter: saturate(170%) blur(20px);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease),
    background-color var(--dur) var(--ease);
}

main#home { padding-top: calc(var(--nav-height) + 2rem); }

.floating-nav.is-scrolled {
  border-bottom-color: var(--border);
  box-shadow: 0 8px 24px -22px rgba(15, 23, 42, 0.4);
}

.nav-shell {
  width: min(var(--max-width), 92%);
  min-height: var(--nav-height);
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}

.logo {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  padding: 0.3rem 0.1rem;
  transition: color var(--dur) var(--ease);
}

.logo:hover { color: var(--accent-strong); }
.right-nav { display: flex; align-items: center; gap: 0.15rem; }

.nav-link {
  position: relative;
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 500;
  transition: color var(--dur) var(--ease), background-color var(--dur) var(--ease);
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0.05rem;
  width: 0;
  height: 2px;
  border-radius: 2px;
  background-color: var(--accent-strong);
  transform: translateX(-50%);
  transition: width var(--dur) var(--ease), opacity var(--dur) var(--ease);
  opacity: 0;
}

.nav-link:hover {
  color: var(--text);
  background-color: rgba(var(--accent-rgb), 0.08);
}

.nav-link.active { color: var(--accent-strong); }
.nav-link.active::after { width: 1rem; opacity: 1; }

#theme-toggle { margin-left: 0.4rem; }

/* ---------- Hero & About ---------- */
.about-flex {
  display: grid;
  grid-template-columns: 0.88fr 1.12fr;
  align-items: center;
  gap: clamp(2.25rem, 5vw, 4.25rem);
}

.profile-hero { text-align: center; }

.profile-ring {
  position: relative;
  width: 188px;
  height: 188px;
  margin: 0 auto 1.4rem;
  border-radius: 50%;
  padding: 5px;
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, rgba(var(--accent-rgb), 0.75), rgba(90, 174, 245, 0.28));
  box-shadow: 0 0 15px 5px rgba(var(--accent-rgb), 0.35); 
}

.profile-ring::before {
  content: "";
  position: absolute;
  inset: -12%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--accent-rgb), 0.16), transparent 70%);
  filter: blur(6px);
  z-index: -1;
}

.avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  background-color: var(--surface);
}

.intro-line {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 0.15rem;
}

.name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.1rem, 5vw, 2.9rem);
  line-height: 1.08;
  letter-spacing: -0.008em;
  white-space: nowrap;
  margin-bottom: 0.5rem;
}

.typing-container {
  min-height: 1.4rem;
  margin-bottom: 0.85rem;
}

.typewriter {
  color: var(--accent-strong);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.cursor {
  color: var(--accent-strong);
  font-weight: 400;
  margin-left: 1px;
  animation: blink 1.1s steps(1, end) infinite;
}

.hero-meta-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  margin-top: 1.2rem;
  flex-wrap: wrap;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
}

.meta-item { display: flex; align-items: center; gap: 0.4rem; }
.meta-item i { color: var(--accent-strong); font-size: 1rem; }

.time-muted {
  color: var(--text-muted);
  opacity: 0.7;
  letter-spacing: 0.05em;
  margin-left: 2px;
}

.resume-link-btn {
  color: var(--accent-strong) !important;
  font-weight: 600;
  text-decoration: none;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-pill);
  background-color: rgba(var(--accent-rgb), 0.1);
  border: 1px solid rgba(var(--accent-rgb), 0.25);
  transition: all var(--dur) var(--ease);
}

.resume-link-btn:hover {
  background-color: rgba(var(--accent-rgb), 0.2);
  transform: translateY(-2px);
}

.about-text p {
  color: var(--text-muted);
  margin-bottom: 0.95rem;
  max-width: 58ch;
  font-size: 0.8rem; 
}

.about-text .section-kicker { color: var(--accent-strong); }

.about-highlights {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
  margin-top: 1.4rem;
}

.highlight-card {
  padding: 0.8rem 0.95rem;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.78rem;
  font-weight: 600;
}

.highlight-card i {
  color: var(--accent-strong);
  font-size: 0.95rem;
  width: 1.25rem;
  text-align: center;
}

/* ---------- Skills ---------- */
.skills-strip {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.05rem;
}

.skills-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  align-items: start;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border);
}

.skills-left {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--accent-strong);
}

.skills-right {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.skills-right span {
  font-size: 0.74rem;
  font-weight: 500;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-pill);
  background-color: rgba(var(--accent-rgb), 0.08);
  border: 1px solid rgba(var(--accent-rgb), 0.2);
  color: var(--text);
  transition: transform 180ms var(--ease), border-color 180ms var(--ease);
}

.skills-right span:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

/* ---------- Projects ---------- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 1.1rem;
}

.project-card {
  padding: 1.25rem 1.3rem;
  display: flex;
  flex-direction: column;
}

.project-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.6rem;
}

.project-top h3 { font-size: 1.05rem; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  white-space: nowrap;
}

.badge::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background-color: currentColor;
}

.badge-live {
  color: #1f9d6b;
  background-color: rgba(46, 168, 123, 0.1);
  border-color: rgba(46, 168, 123, 0.26);
}

body.dark-mode .badge-live { color: #4fd39c; }

.project-desc {
  color: var(--text-muted);
  font-size: 0.75rem; 
  line-height: 1.62;
  margin-bottom: 0.9rem;
}

.tech-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
  margin-top: auto;
}

.tech-stack li {
  border: 1px solid var(--border);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-pill);
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-muted);
}

.project-links {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

/* ---------- Experience ---------- */
.experience-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.1rem;
}

.exp-item { padding: 1.25rem 1.3rem; }

.exp-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.85rem;
  margin-bottom: 0.85rem;
  flex-wrap: wrap;
}

.exp-header h3 { font-size: 1rem; }
.exp-company { color: var(--accent-strong); font-size: 0.84rem; font-weight: 600; }

.exp-date {
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 0.18rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

.exp-item ul {
  display: grid;
  gap: 0.4rem;
  color: var(--text-muted);
  font-size: 0.75rem; 
  line-height: 1.58;
}

.exp-item li {
  position: relative;
  padding-left: 0.95rem;
}

.exp-item li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.68em;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background-color: rgba(var(--accent-rgb), 0.85);
}

/* ---------- Currently Grinding ---------- */
.grind-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.grind-card {
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
  z-index: 1;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.grind-card a { position: relative; z-index: 2; }

.grind-card::after {
  position: absolute;
  bottom: -15px;
  right: -10px;
  font-size: 6rem;
  opacity: 0.15;
  line-height: 1;
  pointer-events: none;
  z-index: 0; 
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
}

.grind-card:hover::after {
  transform: scale(1.1) rotate(-10deg);
  opacity: 0.25;
}

.grind-card[data-grind="leetcode"]::after { content: "\f121"; font-family: "Font Awesome 6 Free"; font-weight: 900; }
.grind-card[data-grind="codeforces"]::after { content: "\f201"; font-family: "Font Awesome 6 Free"; font-weight: 900; }
.grind-card[data-grind="tryhackme"]::after { content: "\f3ed"; font-family: "Font Awesome 6 Free"; font-weight: 900; }
.grind-card[data-grind="github"]::after { content: "\f09b"; font-family: "Font Awesome 6 Brands"; font-weight: 400; }

.grind-link {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 0.8rem 0.9rem;
}

.grind-head { display: flex; align-items: center; gap: 0.45rem; }
.grind-head i { color: var(--accent-strong); font-size: 0.85rem; }
.grind-name { font-size: 0.8rem; font-weight: 600; letter-spacing: -0.004em; }

.grind-stats { display: flex; gap: 0.85rem; }
.grind-stat { display: flex; flex-direction: column; line-height: 1.25; }
.grind-stat b { font-size: 0.9rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.grind-stat small { color: var(--text-muted); font-size: 0.63rem; font-weight: 500; letter-spacing: 0.07em; text-transform: uppercase; }

.grind-note {
  margin-top: 0.9rem;
  color: var(--text-muted);
  font-size: 0.72rem;
  letter-spacing: 0.01em;
}

/* ---------- Hackathons: IDE File Explorer ---------- */
.ide-container {
  display: grid;
  grid-template-columns: 240px 1fr;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-top: 1.5rem;
  min-height: 320px;
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.ide-container:hover {
  transform: translateY(-2px);
  border-color: rgba(var(--accent-rgb), 0.4);
  box-shadow: var(--shadow-hover);
}

.ide-sidebar {
  background-color: rgba(0, 0, 0, 0.02);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

body.dark-mode .ide-sidebar {
  background-color: rgba(0, 0, 0, 0.2);
}

.ide-sidebar-title {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  padding: 1rem 1rem 0.5rem;
  letter-spacing: 0.1em;
}

.ide-file-list {
  display: flex;
  flex-direction: column;
  padding: 0;
  margin: 0;
}

.ide-file {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 0.45rem 1rem 0.45rem 1.8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}

.ide-file i { font-size: 0.9em; }

.ide-file:hover {
  background-color: rgba(var(--accent-rgb), 0.08);
  color: var(--text);
}

.ide-file.active {
  background-color: rgba(var(--accent-rgb), 0.15);
  color: var(--text);
  border-left: 2px solid var(--accent-strong);
  padding-left: calc(1.8rem - 2px);
  font-weight: 500;
}

.ide-editor {
  display: flex;
  flex-direction: column;
  background-color: var(--surface);
}

.ide-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  background-color: rgba(0, 0, 0, 0.02);
}

body.dark-mode .ide-tabs { background-color: rgba(0, 0, 0, 0.2); }

.ide-tab {
  padding: 0.6rem 1.25rem;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  color: var(--text-muted);
  border-right: 1px solid var(--border);
  background-color: transparent;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ide-tab.active {
  background-color: var(--surface);
  color: var(--text);
  border-top: 2px solid var(--accent-strong);
  padding-top: calc(0.6rem - 2px);
}

.ide-content-area {
  padding: 2rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.8;
  color: var(--text);
  overflow-y: auto;
}

/* IDE Code Colors */
.ide-comment { color: #6b7280; font-style: italic; }
.ide-keyword { color: #c678dd; font-weight: 600; }
.ide-string { color: #98c379; }
.ide-success { color: #4fd39c; font-weight: 600; }

body:not(.dark-mode) .ide-keyword { color: #a626a4; }
body:not(.dark-mode) .ide-string { color: #50a14f; }
body:not(.dark-mode) .ide-success { color: #1f9d6b; }


/* ---------- Certifications: JSON Data Block ---------- */
.json-container {
  background-color: #1e1e1e; 
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-top: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

body:not(.dark-mode) .json-container {
  background-color: #fafafa;
  border-color: var(--border);
}

.json-container:hover {
  transform: translateY(-2px);
  border-color: rgba(var(--accent-rgb), 0.4);
  box-shadow: var(--shadow-hover);
}

.json-header {
  background-color: #2d2d2d;
  padding: 0.6rem 1rem;
  display: flex;
  align-items: center;
  border-bottom: 1px solid #3d3d3d;
}

body:not(.dark-mode) .json-header {
  background-color: #f3f3f3;
  border-bottom: 1px solid var(--border);
}

.json-dots { display: flex; gap: 6px; margin-right: 1rem; }
.json-dot { width: 10px; height: 10px; border-radius: 50%; }
.json-dot.red { background-color: #ff5f56; }
.json-dot.yellow { background-color: #ffbd2e; }
.json-dot.green { background-color: #27c93f; }

.json-filename {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  color: #a0a0a0;
}
body:not(.dark-mode) .json-filename { color: #6b7280; }

.json-code { padding: 1.5rem; overflow-x: auto; }
.json-code pre { margin: 0; }

.json-code code {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.6;
  color: #d4d4d4;
}
body:not(.dark-mode) .json-code code { color: #24292e; }

.j-key { color: #569cd6; }
.j-var { color: #9cdcfe; }
.j-str { color: #ce9178; }
.j-val { color: #b5cea8; }

body:not(.dark-mode) .j-key { color: #0000ff; }
body:not(.dark-mode) .j-var { color: #001080; }
body:not(.dark-mode) .j-str { color: #a31515; }
body:not(.dark-mode) .j-val { color: #098658; }

.json-link {
  color: #eab308;
  text-decoration: underline;
  text-decoration-color: transparent;
  transition: all 0.2s ease;
  padding: 0 2px;
  border-radius: 3px;
}
body:not(.dark-mode) .json-link { color: #d97706; }

.json-link:hover {
  text-decoration-color: currentColor;
  color: #fef08a;
}
body:not(.dark-mode) .json-link:hover { color: #f59e0b; }

.json-link:active {
  background-color: rgba(234, 179, 8, 0.25);
  outline: 2px solid #eab308;
  color: #fef08a;
  text-decoration: none;
}
body:not(.dark-mode) .json-link:active {
  background-color: rgba(217, 119, 6, 0.15);
  outline: 2px solid #d97706;
  color: #b45309;
}


/* ---------- Footer ---------- */
footer { border-top: 1px solid var(--border); }

.footer-container {
  width: min(var(--max-width), 90%);
  margin-inline: auto;
  padding: 3.5rem 0 2.5rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 2.25rem;
  flex-wrap: wrap;
}

.footer-text {
  color: var(--text-muted);
  font-size: 0.85rem;
  max-width: 46ch;
  margin-bottom: 0.8rem;
}

.footer-quote {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--text-muted);
  font-style: italic;
  margin: 1rem 0;
  letter-spacing: 0.02em;
}

.footer-email {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent-strong);
  border-bottom: 1px solid rgba(var(--accent-rgb), 0.35);
  padding-bottom: 1px;
  transition: border-color var(--dur) var(--ease);
  display: inline-block;
}

.footer-email:hover { border-bottom-color: var(--accent-strong); }
.footer-right { text-align: right; }

.contact-links {
  display: flex;
  gap: 0.55rem;
  justify-content: flex-end;
  margin-bottom: 0.9rem;
}

.contact-links a {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1px solid var(--border-strong);
  transition: all var(--dur) var(--ease);
}

.contact-links a:hover {
  transform: translateY(-2px);
  border-color: rgba(var(--accent-rgb), 0.6);
  color: var(--accent-strong);
  box-shadow: 0 8px 20px -14px rgba(var(--accent-rgb), 0.9);
}

.footer-copy { color: var(--text-muted); font-size: 0.78rem; }

#backToTop {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  z-index: 1200;
  color: var(--text);
  background-color: color-mix(in oklab, var(--surface-raised) 88%, transparent);
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease), visibility var(--dur) var(--ease);
}

#backToTop.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }
#backToTop:hover { transform: translateY(-2px); }

/* ---------- Animations ---------- */
@keyframes blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 640ms var(--ease), transform 640ms var(--ease);
}

.reveal.is-visible { opacity: 1; transform: none; }

.reveal .highlight-card,
.reveal .project-card,
.reveal .exp-item,
.reveal .skills-row,
.reveal .grind-card,
.reveal .ide-container,
.reveal .json-container {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 520ms var(--ease), transform 520ms var(--ease), box-shadow var(--dur) var(--ease),
    border-color var(--dur) var(--ease);
  transition-delay: var(--stagger, 0ms);
}

.reveal.is-visible .highlight-card,
.reveal.is-visible .project-card,
.reveal.is-visible .exp-item,
.reveal.is-visible .skills-row,
.reveal.is-visible .grind-card,
.reveal.is-visible .ide-container,
.reveal.is-visible .json-container {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal, .reveal * { opacity: 1 !important; transform: none !important; }
}

/* ---------- Responsive ---------- */
@media (max-width: 992px) {
  .about-flex { grid-template-columns: 1fr; text-align: center; }
  .about-text { text-align: center; }
  .about-text p { margin-inline: auto; }
  .about-highlights { text-align: left; }
  .section-heading { margin-inline: auto; }
  .grind-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-container { align-items: flex-start; }
}

@media (max-width: 860px) {
  .nav-shell { flex-direction: column; gap: 0.25rem; padding: 0.55rem 0; }
  .right-nav { width: 100%; justify-content: center; flex-wrap: wrap; gap: 0.1rem; }
  :root { --nav-height: 96px; }
  .first-section { padding-top: 3rem; }
  
  .ide-container { grid-template-columns: 1fr; }
  .ide-sidebar { border-right: none; border-bottom: 1px solid var(--border); }
  .ide-file-list { flex-direction: row; overflow-x: auto; padding-bottom: 0.5rem; }
  .ide-file { padding: 0.4rem 1rem; border-left: none; white-space: nowrap; }
  .ide-file.active {
    border-left: none;
    border-bottom: 2px solid var(--accent-strong);
    padding-left: 1rem;
    background-color: transparent;
  }
}

@media (max-width: 640px) {
  :root { --nav-height: 118px; }
  .section { width: min(var(--max-width), 92%); padding: 3.25rem 0; }
  .section-compact { padding: 2.5rem 0; }
  .name { font-size: clamp(1.85rem, 9vw, 2.4rem); }
  .profile-ring { width: 158px; height: 158px; }
  .hero-meta-row { gap: 0.8rem 1rem; }
  .about-highlights { grid-template-columns: 1fr; }
  .skills-row { grid-template-columns: 1fr; gap: 0.45rem; }
  .grind-strip { grid-template-columns: 1fr; }
  .grind-link { flex-direction: row; align-items: center; justify-content: space-between; gap: 0.85rem; }
  .footer-container { flex-direction: column; padding: 2.75rem 0 2.25rem; }
  .footer-right { text-align: left; }
  .contact-links { justify-content: flex-start; }
  #backToTop { right: 16px; bottom: 16px; }
}

@media (max-width: 420px) {
  .name { font-size: 7.8vw; }
  .grind-stats { gap: 0.7rem; }
  .ide-content-area { padding: 1.5rem; }
  .json-code { padding: 1rem; }
}