/* Inputs inherit font and improved styling */
input, textarea, select, button { font: inherit; color: var(--text); }
input, textarea, select {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--line);
  border-radius: 30px;
  padding: 12px 14px;
  color: var(--text);
}
input::placeholder, textarea::placeholder { color: color-mix(in oklab, var(--muted) 85%, white 15%); }

/*
  Nikit Hamal — Portfolio Styles
  - Modern, minimal, Google-like cleanliness
  - Poppins, subtle glass & gradient accents
  - Responsive and accessible
*/

:root {
  --bg: #ffffff;
  --panel: #f6f7f9;
  --text: #0b0d10;
  --muted: #667085;
  --brand: #111827;   /* near-black */
  --brand-2: #111827;
  --accent: #111827;
  /* Dark green accent */
  --green: #1A7F37;
  --green-2: #166534;
  --line: rgba(0, 0, 0, 0.08);
  --glass: rgba(0,0,0,0.04);
  --shadow: 0 1px 2px rgba(16,24,40,0.06), 0 1px 3px rgba(16,24,40,0.1);
  --radius: 16px;
  --radius-sm: 12px;
  --container: 1200px;
  --header-h: 64px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  color-scheme: light;
}

img { max-width: 100%; display: block; }

/* Skip link for accessibility */
.skip-link {
  position: fixed; top: 8px; left: 8px; z-index: 1000;
  padding: 8px 12px; border-radius: 10px; background: var(--panel); color: var(--text);
  border: 1px solid var(--line); text-decoration: none; transform: translateY(-200%);
}
.skip-link:focus { transform: translateY(0); box-shadow: 0 8px 24px rgba(0,0,0,0.35); }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  position: relative;
  padding: 48px 0;
}

/* Offset anchor scroll for fixed header */
.section { scroll-margin-top: calc(var(--header-h) + 32px); }

h1, h2, h3 { margin: 0 0 12px; line-height: 1.2; }
.kicker { color: var(--muted); font-weight: 500; letter-spacing: .02em; }
.muted { color: var(--muted); }

/* Background blobs disabled for minimal look */
.bg { display: none; }

/* Header */
.site-header {
  position: fixed; top: 16px; left: 0; right: 0; z-index: 1000;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(16,24,40,0.08);
  margin: 16px;
  border-radius: 16px;
}

.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: var(--header-h); padding: 8px 0; }
.site-header .container { padding-left: max(24px, calc(16px + env(safe-area-inset-left))); padding-right: max(24px, calc(16px + env(safe-area-inset-right))); }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 400; }
.logo-dot { width: 10px; height: 10px; border-radius: 50%; background: #000; box-shadow: 0 0 0 4px rgba(0,0,0,0.18); }
.brand-text { font-weight: 400; letter-spacing: .2px; }

.nav__toggle { display: none; place-items: center; background: transparent; border: 0; color: var(--text); width: 40px; height: 40px; border-radius: 12px; cursor: pointer; position: relative; z-index: 1101; pointer-events: auto; }
.nav__list { display: flex; gap: 8px; align-items: center; list-style: none; margin: 0; padding: 0; }
.nav__list a { text-decoration: none; color: var(--text); padding: 12px; border-radius: 30px; transition: background .2s ease, color .2s ease; min-height: 44px; display: inline-flex; align-items: center; font-size: 14px; }
.nav__list a:hover { background: var(--glass); }
.pill { background: #000; border-color: #000; color: #fff !important; font-weight: 400; }

/* Layout offset for floating fixed header (top/bottom margins + header height) */
main { padding-top: calc(var(--header-h) + 32px); }

/* Hero */
.hero { padding-top: 64px; }
.hero__inner { display: grid; grid-template-columns: 1.25fr 1fr; gap: 40px; align-items: center; }
.hero__title { font-size: clamp(32px, 5.5vw, 56px); font-weight: 500; letter-spacing: -0.02em; line-height: 1.05; max-width: 18ch; }
.hero__subtitle { color: var(--muted); font-size: clamp(14px, 1.6vw, 18px); margin-top: 12px; max-width: 60ch; }
.hero__cta { display: flex; gap: 14px; margin-top: 26px; }

.social { display: flex; gap: 10px; margin-top: 20px; }
.social a { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 30px; background: transparent; color: var(--text); border: 1px solid var(--line); transition: transform .2s ease, background .2s ease; text-decoration: none; }
.social a:hover { transform: translateY(-2px); background: rgba(255,255,255,0.1); }

.hero__visual { display: grid; gap: 16px; align-content: start; }
.card.glass.profile { display: flex; align-items: center; gap: 16px; padding: 12px; border-radius: var(--radius); background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); }
/* Avatar image */
img.avatar { width: 52px; height: 52px; border-radius: 14px; object-fit: cover; display: block; }
.card.glass.profile#profileCard, #avatarImg { cursor: pointer; }
.meta h3 { margin: 0 0 4px; font-size: 16px; }
.meta p { margin: 0; color: var(--muted); font-size: 13px; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; text-align: center; }
.stat .num { font-weight: 500; font-size: 18px; color: var(--brand); }
.stat .label { display: block; color: var(--muted); font-size: 12px; }

/* About */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; padding: 0; margin: 12px 0 0; list-style: none; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 12px; border-radius: 30px; background: #000; border: 1px solid #000; color: #fff; font-size: 12px; font-weight: 400; }

.card { border-radius: var(--radius); background: #fff; border: 1px solid #ddd; box-shadow: var(--shadow); padding: 12px; }
.card.gradient { background: #fff; }
.card__title { margin-bottom: 10px; font-size: 18px; }
.card__list { margin: 0; padding-left: 18px; color: #666; }

/* Projects */
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; flex-wrap: wrap; gap: 8px 12px; }
.section-head h2 { margin: 0; }
.link { color: var(--text); text-decoration: none; opacity: .8; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; line-height: 1; }
.link i { font-size: 16px; line-height: 1; }
.ri, i { font-weight: 400; }
.link:hover { opacity: 1; }

.cards .project {
  overflow: hidden;
  padding: 0;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cards .project:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

/* This makes the entire card a clickable link and removes underline */
.cards .project .card__link {
  text-decoration: none;
  color: inherit;
  display: block;
  height: 100%;
}

.card__media {
  height: 160px;
  background: #f2f4f7;
  border-bottom: 1px solid var(--line);
  will-change: transform;
  backface-visibility: hidden;
  transition: transform 0.2s ease; /* Add subtle zoom on hover */
}

.cards .project:hover .card__media {
  transform: scale(1.03);
}

.card__body { padding: 12px; }
.tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.tags span { font-size: 11px; padding: 12px; border-radius: 999px; background: #000; border: 1px solid #000; color: #fff; }

/* === REDESIGNED SECTIONS (Gemini) === */

/* --- Skills Section --- */
#skills {
  background-color: var(--panel);
  padding: 64px 0;
}

.skills .section-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 48px;
}

.skills .section-title {
  font-size: clamp(28px, 4vw, 36px);
  margin-bottom: 8px;
}

.skills .section-subtitle {
  max-width: 60ch;
  margin: 0 auto;
  color: var(--muted);
}

.skills-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.skill-category {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.skill-category:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.skill-category__header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.skill-category__icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--glass);
  color: var(--brand);
  font-size: 24px;
}

.skill-category__title {
  font-size: 18px;
  font-weight: 500;
  margin: 0;
}

.skill-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.skill-list li {
  color: var(--muted);
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.skill-list li::before {
  content: '•';
  color: var(--accent);
  font-weight: bold;
}


/* --- Writing Section --- */
.writing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-top: 24px;
}

.writing-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}

.writing-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.writing-card__link {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.writing-card__media {
  height: 180px;
  background-color: var(--panel);
  background-size: cover;
  background-position: center;
  border-bottom: 1px solid var(--line);
}

.writing-card__body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.writing-card__category {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.writing-card__title {
  font-size: 18px;
  line-height: 1.3;
  margin: 0 0 12px;
  font-weight: 600;
}

.writing-card__excerpt {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
  flex-grow: 1;
}

.writing-card__meta {
  display: flex;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  margin-top: 16px;
  align-items: center;
}


/* --- Contact Section --- */
#contact {
  background: var(--brand);
  color: #fff;
  padding: 80px 0;
  margin-top: 64px;
}

#contact h2, #contact p {
  color: #fff;
}

.contact-wrapper {
  display: block;
  text-align: center;
}

.contact-title {
  font-size: clamp(32px, 5vw, 42px);
  line-height: 1.1;
  margin-bottom: 16px;
}

.contact-subtitle {
  color: rgba(255,255,255,0.8);
  max-width: 45ch;
  margin-bottom: 32px;
}

.contact-links {
  display: grid;
  gap: 16px;
}

.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: rgba(255,255,255,0.9);
  font-size: 14px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.05);
  transition: background 0.2s ease;
}

.contact-link:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}

.contact-link i {
  font-size: 20px;
}

.contact-form-container {
  background: var(--bg);
  color: var(--text);
  padding: 32px;
  border-radius: var(--radius);
}

.contact-form .form-title {
  font-size: 18px;
  font-weight: 500;
  color: var(--text);
  margin: 0 0 24px;
}

.contact-form .form-group {
  margin-bottom: 16px;
}

.contact-form .form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 6px;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  border-radius: var(--radius-sm);
}

.contact-form .btn {
  width: 100%;
  justify-content: center;
  padding: 14px;
  font-size: 16px;
}

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; border: 1px solid var(--line); border-radius: 30px; padding: 12px; color: var(--text); background: var(--glass); transition: transform .2s ease, background .2s ease, box-shadow .2s ease; font-size: 14px; }
.btn:hover { transform: translateY(-2px); background: rgba(255,255,255,0.1); }
.btn.primary { border: 1px solid #000; background: #000; color: #fff; font-weight: 400; border-radius: 30px; padding: 12px; }
.btn.primary:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.22); }
.hero__cta .btn.primary { padding: 12px; }
.btn.ghost { background: transparent; border-color: var(--line); }

/* WhatsApp CTA (black) */
.btn.whatsapp { background: #000; border-color: #000; color: #fff !important; font-weight: 400; }
.btn.whatsapp i { font-size: 16px; }
.btn.whatsapp:hover { box-shadow: 0 8px 20px rgba(0,0,0,0.3); transform: translateY(-2px); }

/* Better focus styles */
:where(a, button, input, textarea, select):focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(109,214,255,0.18);
  border-color: rgba(109,214,255,0.5);
}

/* Footer */
.site-footer { border-top: 1px solid var(--line); background: transparent; margin-top: 64px; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; padding: 24px 0 calc(24px + env(safe-area-inset-bottom)); gap: 12px; }
.site-footer .container { padding-left: max(24px, calc(16px + env(safe-area-inset-left))); padding-right: max(24px, calc(16px + env(safe-area-inset-right))); }
.footer-inner small { opacity: .85; }
.top { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 30px; border: 1px solid var(--line); color: var(--text); text-decoration: none; margin-left: auto; align-self: center; background: #fff; transition: transform .2s ease, background .2s ease; }
.top:hover { transform: translateY(-2px); background: rgba(255,255,255,0.08); }

/* Motion base */
.reveal { opacity: 0; transform: translateY(14px); }

/* Modals */
.modal { border: none; padding: 0; background: transparent; width: min(920px, calc(100% - 32px)); max-width: 100%; border-radius: 16px; }
.modal::backdrop { background: rgba(0,0,0,0.5); backdrop-filter: blur(2px); }
.modal[open] { animation: modal-fade .15s ease-out; }
@keyframes modal-fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.modal__close { position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--line); background: #fff; display: grid; place-items: center; color: var(--text); cursor: pointer; box-shadow: var(--shadow); }
.modal__close:hover { background: #f7f7f7; }

/* Full-width photo */
.modal__image { display: block; width: 100%; height: auto; border-radius: 16px; background: #fff; }

/* Profile dialog layout */
.modal .profile { display: flex; gap: 16px; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 12px; box-shadow: var(--shadow); align-items: center; }
.modal__avatar { width: 96px; height: 96px; border-radius: 14px; object-fit: cover; flex: none; }
.modal__info h3 { margin: 0 0 6px; font-size: 20px; }
.modal__info p { margin: 0 0 12px; }
.modal__actions { margin-top: 6px; }
.modal__actions .btn { display: inline-flex; align-items: center; gap: 6px; padding: 12px; font-size: 14px; line-height: 1.1; }
.modal__actions .btn i, .modal__actions .btn .ri { font-size: 16px; }

/* About Section - New Styles */
.about-image-container {
  position: relative;
  margin-bottom: 2rem;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: var(--shadow);
  max-width: 500px; /* Constrain width on large screens */
  margin-left: 0;
  margin-right: auto;
}

.about-image {
  width: 100%;
  height: auto;
  display: block;
}

.about-image-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  color: white;
  padding: 1.5rem;
}

.about-image-overlay h2 {
  color: white;
  margin-bottom: 0.5rem;
  font-size: 1.75rem;
}

.about-image-overlay p {
  margin: 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.9rem;
}

.about-description {
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 2rem;
  font-size: 1rem;
}

.about-chips-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-bottom: 2.5rem;
}

.about-chip {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: white;
  border-radius: 16px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}

.about-chip i {
  font-size: 1.25rem;
  color: var(--brand);
}

.about-exploring-section {
  background: var(--brand);
  color: white;
  padding: 1.5rem;
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.about-exploring-section h3 {
  color: white;
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
}

.exploring-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.exploring-item {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.exploring-icon {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 0.25rem;
}

.exploring-icon i {
  font-size: 1.1rem;
  color: white;
}

.exploring-item h4 {
  margin: 0 0 0.25rem 0;
  color: white;
  font-size: 1rem;
}

.exploring-item p {
  margin: 0;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.85rem;
}

/*
  --- RESPONSIVE STYLES ---
  Consolidated for clarity and performance.
  Breakpoints: 1024px, 920px, 820px, 768px, 560px, 480px
*/

/* Desktop: center and reduce header width */
@media (min-width: 1024px) {
  .site-header {
    width: min(100% - 32px, 980px);
    left: 50%;
    right: auto;
    transform: translateX(-50%);
  }
}

@media (max-width: 1024px) {
  .skills__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    overflow-x: visible;
    padding-bottom: 0;
  }
  .skills__grid::-webkit-scrollbar {
    display: block;
  }
  .skill {
    white-space: normal;
    text-align: center;
    justify-content: center;
  }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

/* Removed media query for .contact-wrapper as it is no longer a grid */

@media (max-width: 820px) {
  .hero__inner { grid-template-columns: 1fr; }
  .hero { padding-top: 40px; }
  .hero__title { max-width: 24ch; }
  .grid-2 { grid-template-columns: 1fr; }
  .skills__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    overflow-x: visible;
    padding-bottom: 0;
  }
  .skills__grid::-webkit-scrollbar {
    display: block;
  }
  .skill {
    white-space: normal;
    text-align: center;
    justify-content: center;
  }
  .section { padding: 40px 0; }

  /* Mobile nav */
  .nav__toggle { display: inline-grid; place-items: center; }
  .nav__list { position: fixed; right: 16px; top: calc(16px + var(--header-h) + env(safe-area-inset-top)); padding: 10px; background: #fff; border: 1px solid var(--line); border-radius: 18px; flex-direction: column; gap: 4px; transform-origin: top right; transform: scale(0.96); opacity: 0; pointer-events: none; transition: opacity .18s ease, transform .18s ease; box-shadow: 0 12px 28px rgba(16,24,40,0.18); max-height: min(70vh, 420px); overflow: auto; overscroll-behavior: contain; z-index: 1100; }
  .nav__list.open { opacity: 1; transform: scale(1); pointer-events: auto; }
  .nav__list a { padding: 12px 14px; border-radius: 30px; color: var(--text); }
  .nav__list a:hover { background: rgba(0,0,0,0.04); }
}

@media (max-width: 768px) {
  .about-chips-grid {
    grid-template-columns: 1fr;
  }
  .about-image-overlay h2 {
    font-size: 1.5rem;
  }
  .about-image-overlay p {
    font-size: 0.85rem;
  }
}

@media (max-width: 560px) {
  .skills__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    overflow-x: visible;
    padding-bottom: 0;
  }
  .skills__grid::-webkit-scrollbar {
    display: block;
  }
  .skill {
    white-space: normal;
    text-align: center;
    justify-content: center;
  }
  .grid-3 { grid-template-columns: 1fr; }
  .footer-inner { align-items: stretch; }
  .top { margin-top: 8px; align-self: flex-start; }
  .section { padding: 36px 0; }

  /* Modal adjustments for small screens */
  .modal .profile { flex-direction: column; align-items: flex-start; }
  .modal__avatar { width: 84px; height: 84px; }
  .modal__actions .btn { width: 100%; justify-content: center; }
}

@media (max-width: 480px) {
  .exploring-item {
    flex-direction: column;
    gap: 0.5rem;
  }
  .exploring-icon {
    margin-top: 0;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .reveal { transition: none !important; transform: none !important; }
  html { scroll-behavior: auto; }
}
