/* ==========================================================
   Anadi Dwivedi — personal website
   Theme: black with a purple → pink gradient
   ========================================================== */

:root {
  --bg: #09090B;
  --bg-2: #0F0F13;
  --card: #18181B;
  --card-2: #1F1F24;
  --line: #2A2A31;
  --text: #FAFAFA;
  --muted: #A1A1AA;
  --purple: #8B5CF6;
  --pink: #EC4899;
  --grad: linear-gradient(135deg, var(--purple), var(--pink));

  --font-display: "Sora", "Segoe UI", system-ui, sans-serif;
  --font-body: "Manrope", "Segoe UI", system-ui, sans-serif;

  --wrap: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
  --radius: 18px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 1.0625rem/1.65 var(--font-body);
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: #C4B5FD; text-underline-offset: 3px; }
a:hover { color: var(--pink); }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.15; margin: 0; letter-spacing: -0.02em; }
p { margin: 0 0 1em; }
:focus-visible { outline: 2px solid var(--pink); outline-offset: 3px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--purple); color: #fff; padding: 8px 14px; z-index: 100; border-radius: 8px; }
.skip:focus { left: 8px; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.muted { color: var(--muted); }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* soft background glow */
.bg-glow {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(600px 400px at 85% 10%, rgb(139 92 246 / .18), transparent 70%),
    radial-gradient(500px 400px at 5% 60%, rgb(236 72 153 / .10), transparent 70%);
}

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  background: var(--grad); color: #fff; border: 0;
  font: 700 1rem/1 var(--font-body); padding: 16px 26px; border-radius: 999px;
  text-decoration: none; cursor: pointer;
  box-shadow: 0 10px 30px -10px rgb(236 72 153 / .55);
  transition: transform .2s, box-shadow .2s;
}
.btn:hover { color: #fff; transform: translateY(-2px); box-shadow: 0 14px 34px -10px rgb(236 72 153 / .7); }
.btn-ghost { background: transparent; border: 1.5px solid var(--line); box-shadow: none; }
.btn-ghost:hover { border-color: var(--purple); box-shadow: none; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgb(9 9 11 / .7); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent; transition: border-color .2s;
}
.site-header.scrolled { border-bottom-color: var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.brand { font: 800 1.5rem var(--font-display); color: var(--text); text-decoration: none; letter-spacing: -0.03em; }
.brand span { color: var(--pink); }
.brand:hover { color: var(--text); }
.site-nav { display: flex; align-items: center; gap: 30px; }
.site-nav a { color: var(--muted); text-decoration: none; font-weight: 600; font-size: .98rem; transition: color .2s; }
.site-nav a:hover, .site-nav a.active { color: var(--text); }
.site-nav .nav-cta { color: var(--text); padding: 9px 20px; border-radius: 999px; border: 1.5px solid var(--purple); }
.site-nav .nav-cta:hover { background: var(--grad); border-color: transparent; }
.nav-toggle { display: none; background: none; border: 0; width: 44px; height: 44px; cursor: pointer; color: var(--text); }
.bars, .bars::before, .bars::after { display: block; width: 22px; height: 2px; background: currentColor; margin: 0 auto; position: relative; transition: transform .25s; }
.bars::before, .bars::after { content: ""; position: absolute; left: 0; }
.bars::before { top: -7px; } .bars::after { top: 7px; }
.nav-toggle[aria-expanded="true"] .bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .bars::before { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .bars::after { transform: translateY(-7px) rotate(-45deg); }
@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .site-nav {
    position: absolute; top: 72px; left: 0; right: 0; display: none;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--line); padding: 8px var(--gutter) 20px;
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 14px 0; border-bottom: 1px solid var(--line); }
  .site-nav .nav-cta { margin-top: 16px; text-align: center; border-bottom: 1.5px solid var(--purple); }
}

/* ---------- Hero ---------- */
.hero { padding: clamp(48px, 8vw, 110px) 0 clamp(64px, 9vw, 120px); }
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(40px, 6vw, 80px); align-items: center; }
.hello { color: var(--muted); font-weight: 600; font-size: 1.15rem; margin-bottom: 10px; }
.hero h1 { font-size: clamp(2.8rem, 1.6rem + 5vw, 5.4rem); font-weight: 800; letter-spacing: -0.04em; line-height: 1.02; margin-bottom: 18px; }
.typed-line { font: 600 clamp(1.3rem, 1rem + 1.2vw, 1.9rem) var(--font-display); margin-bottom: 22px; min-height: 1.4em; }
.typed { color: #C4B5FD; }
.caret { display: inline-block; width: 3px; height: 1.05em; background: var(--pink); margin-left: 4px; vertical-align: -0.15em; animation: caret 1s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }
.lede { color: var(--muted); font-size: 1.15rem; max-width: 52ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 30px 0 34px; }
.socials { list-style: none; padding: 0; margin: 0; display: flex; gap: 10px; }
.socials a {
  display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%;
  background: var(--card); border: 1px solid var(--line); color: var(--text); font-size: 1.1rem;
  transition: background .2s, border-color .2s, transform .2s;
}
.socials a:hover { background: var(--grad); border-color: transparent; color: #fff; transform: translateY(-2px); }

.hero-photo { position: relative; justify-self: center; width: min(100%, 420px); }
.ring { padding: 6px; border-radius: 50%; background: var(--grad); box-shadow: 0 30px 80px -20px rgb(139 92 246 / .5); }
.ring img { border-radius: 50%; aspect-ratio: 1; object-fit: cover; object-position: 50% 30%; width: 100%; border: 6px solid var(--bg); }
.badge {
  position: absolute; display: flex; align-items: center; gap: 8px;
  background: rgb(24 24 27 / .9); backdrop-filter: blur(8px); border: 1px solid var(--line);
  padding: 10px 16px; border-radius: 999px; font-weight: 700; font-size: .92rem; white-space: nowrap;
  box-shadow: 0 10px 30px -10px rgb(0 0 0 / .6);
}
.badge i { color: var(--pink); }
.badge-1 { top: 12%; left: -8%; }
.badge-2 { bottom: 10%; right: -6%; }

/* ---------- Sections ---------- */
.section { padding: clamp(64px, 9vw, 110px) 0; }
.section-alt { background: var(--bg-2); border-block: 1px solid var(--line); }
.section-head { max-width: 680px; margin-bottom: clamp(32px, 5vw, 52px); }
.section-head h2 { font-size: clamp(2rem, 1.4rem + 2.2vw, 3rem); font-weight: 800; margin-bottom: 12px; }
.section-head h2::after { content: ""; display: block; width: 56px; height: 4px; border-radius: 4px; background: var(--grad); margin-top: 14px; }
.section-head p { color: var(--muted); font-size: 1.12rem; margin: 0; }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: clamp(32px, 5vw, 64px); align-items: start; }
.about-copy h3 { font-size: 1.6rem; margin-bottom: 16px; }
.about-copy .big { font-size: 1.15rem; color: var(--text); font-style: italic; }
.about-copy p { color: var(--muted); max-width: 62ch; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0; }
.facts > div { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; }
.facts dt { color: var(--muted); font-size: .88rem; font-weight: 600; display: flex; gap: 8px; align-items: center; }
.facts dt i { color: var(--pink); }
.facts dd { margin: 4px 0 0; font-weight: 700; font-size: .98rem; overflow-wrap: break-word; word-break: break-word; }
.pill { display: inline-block; background: rgb(34 197 94 / .15); color: #4ADE80; padding: 2px 12px; border-radius: 999px; font-size: .9rem; }

/* ---------- Skills ---------- */
.skills { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.skill { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; }
.skill-top { display: flex; justify-content: space-between; font-weight: 700; margin-bottom: 12px; }
.skill-top span:last-child { color: var(--muted); font-weight: 600; }
.bar { height: 8px; background: var(--card-2); border-radius: 8px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--grad); border-radius: 8px; transition: width 1.2s cubic-bezier(.2,.8,.2,1); }
.skills.in .bar i { width: calc(var(--v) * 1%); }

/* ---------- Resume ---------- */
.summary { padding: 26px 28px; margin-bottom: 44px; border-left: 4px solid var(--purple); }
.summary h3 { font-size: 1.4rem; margin-bottom: 10px; }
.summary p { color: var(--muted); font-style: italic; }
.summary .muted { font-style: normal; margin: 0; }
.summary .muted i { color: var(--pink); }
.resume-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: clamp(32px, 5vw, 64px); }
.col-title { font-size: 1.35rem; margin-bottom: 26px; display: flex; gap: 10px; align-items: center; }
.col-title i { color: var(--pink); }
.timeline { list-style: none; margin: 0; padding: 0 0 0 28px; border-left: 2px solid var(--line); }
.timeline > li { position: relative; padding-bottom: 34px; }
.timeline > li:last-child { padding-bottom: 0; }
.timeline > li::before {
  content: ""; position: absolute; left: -37px; top: 4px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--bg); border: 3px solid var(--pink); box-shadow: 0 0 0 4px rgb(236 72 153 / .15);
}
.when { display: inline-block; background: rgb(139 92 246 / .15); color: #C4B5FD; font-weight: 700; font-size: .85rem; padding: 4px 12px; border-radius: 999px; margin-bottom: 10px; }
.timeline h4 { font-size: 1.2rem; margin-bottom: 4px; }
.where { color: var(--muted); font-style: italic; margin-bottom: 10px; }
.timeline ul { margin: 0; padding-left: 1.1em; color: var(--muted); }
.timeline ul li { margin-bottom: 6px; }
.timeline ul li::marker { color: var(--purple); }

/* ---------- Portfolio ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 30px; }
.chip-btn {
  font: 600 .95rem var(--font-body); color: var(--muted); background: var(--card);
  border: 1px solid var(--line); border-radius: 999px; padding: 10px 20px; cursor: pointer; transition: color .2s, border-color .2s;
}
.chip-btn:hover { color: var(--text); border-color: var(--purple); }
.chip-btn[aria-pressed="true"] { background: var(--grad); color: #fff; border-color: transparent; }
.gallery { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.gallery li[hidden] { display: none; }
.gallery button {
  position: relative; display: block; width: 100%; padding: 0; border: 1px solid var(--line); background: var(--card);
  border-radius: var(--radius); overflow: hidden; cursor: zoom-in; color: inherit; font: inherit; text-align: left;
}
.gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform .5s; }
.g-info {
  position: absolute; inset: auto 0 0 0; padding: 40px 18px 16px;
  background: linear-gradient(to top, rgb(9 9 11 / .95), rgb(9 9 11 / .75) 55%, transparent);
}
.g-title { display: block; font-weight: 700; line-height: 1.3; }
.g-sub { display: block; color: var(--muted); font-size: .88rem; }
.gallery button:hover img { transform: scale(1.06); }
.gallery button:hover { border-color: var(--purple); }

.lightbox { border: 0; padding: 0; background: transparent; max-width: min(1100px, 94vw); max-height: 94vh; overflow: visible; }
.lightbox::backdrop { background: rgb(0 0 0 / .88); backdrop-filter: blur(4px); }
.lightbox img { max-height: 82vh; width: auto; max-width: 100%; margin: 0 auto; border-radius: 12px; }
.lightbox p { color: var(--text); text-align: center; margin: 14px 0 0; }
.lb-close { position: absolute; top: -16px; right: -16px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--grad); color: #fff; font-size: 18px; cursor: pointer; z-index: 2; }
.lightbox[open] { animation: lb-in .25s ease-out; }
@keyframes lb-in { from { opacity: 0; transform: scale(.96); } }

/* ---------- Testimonials ---------- */
.quotes { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.quote { margin: 0; padding: 30px; position: relative; }
.q-icon { font-size: 3rem; line-height: 1; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.quote blockquote { margin: 8px 0 24px; }
.quote blockquote p { font-size: 1.1rem; line-height: 1.6; margin: 0; }
.quote figcaption { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: .92rem; }
.quote figcaption img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; border: 2px solid var(--purple); }
.quote figcaption strong { display: block; color: var(--text); font-size: 1rem; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: .85fr 1.15fr; gap: 24px; align-items: start; }
.contact-info { display: grid; gap: 16px; }
.info { display: flex; gap: 16px; align-items: center; padding: 20px; }
.info > i { display: grid; place-items: center; width: 48px; height: 48px; flex: none; border-radius: 50%; background: var(--grad); color: #fff; font-size: 1.2rem; }
.info h4 { font-size: 1.05rem; margin-bottom: 2px; }
.info p { margin: 0; color: var(--muted); overflow-wrap: anywhere; }
.map { width: 100%; height: 250px; border: 1px solid var(--line); border-radius: var(--radius); filter: grayscale(.6) invert(.9) hue-rotate(200deg) contrast(.9); }
.contact-form { padding: clamp(22px, 3.5vw, 34px); display: grid; gap: 18px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field label { display: block; font-weight: 600; font-size: .95rem; margin-bottom: 6px; }
.field input, .field textarea {
  width: 100%; font: 500 1rem var(--font-body); color: var(--text); background: var(--bg);
  border: 1px solid var(--line); border-radius: 12px; padding: 13px 15px;
}
.field textarea { resize: vertical; min-height: 140px; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--purple); box-shadow: 0 0 0 3px rgb(139 92 246 / .25); }
.field [aria-invalid="true"] { border-color: #F87171; }
.form-error { color: #F87171; margin: 0; font-weight: 600; }
.form-note { color: var(--muted); font-size: .88rem; margin: 0; }
.contact-form .btn { justify-self: start; }

/* ---------- Footer ---------- */
.site-footer { padding: 28px 0; border-top: 1px solid var(--line); color: var(--muted); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.site-footer p { margin: 0; }
.site-footer strong { color: var(--text); }
.to-top { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--grad); color: #fff; }
.to-top:hover { color: #fff; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero-grid, .about-grid, .resume-grid, .contact-grid, .quotes { grid-template-columns: 1fr; }
  .hero-photo { order: -1; width: min(78%, 340px); }
  .badge-1 { left: -14%; } .badge-2 { right: -14%; }
}
@media (max-width: 560px) {
  .facts, .row2 { grid-template-columns: 1fr; }
  .hero-actions .btn { flex: 1 1 100%; }
  .badge { font-size: .8rem; padding: 8px 12px; }
  .badge-1 { left: -10%; } .badge-2 { right: -10%; }
  .skills { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .skills .bar i { width: calc(var(--v) * 1%); }
}
