/* ===========================================================
   Ravi Anand — Executive Portfolio
   Design system + sections + responsive + animations
   =========================================================== */

/* ---------- Tokens ---------- */
:root {
  --purple: #9929fb;
  --purple-dark: #650fa0;
  --purple-soft: #f3e9ff;

  --bg: #ffffff;
  --bg-soft: #f6f4fb;
  --ink: #16121f;
  --ink-2: #2b2538;
  --muted: #6b6675;
  --line: #e7e3ef;

  --shadow-sm: 0 2px 10px rgba(22, 18, 31, .06);
  --shadow-md: 0 10px 30px rgba(22, 18, 31, .08);
  --shadow-lg: 0 30px 70px rgba(101, 15, 160, .12);

  --radius: 18px;
  --radius-sm: 12px;
  --maxw: 1200px;
  --nav-h: 76px;

  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--nav-h); }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3 { margin: 0; line-height: 1.15; font-weight: 600; }

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

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: var(--purple);
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--sans); font-weight: 600; font-size: 15px;
  padding: 13px 24px; border-radius: 999px; border: 1.5px solid transparent;
  cursor: pointer; transition: transform .25s ease, background .3s ease, box-shadow .3s ease, color .3s ease;
  white-space: nowrap;
}
.btn--sm { padding: 9px 18px; font-size: 14px; }
.btn--block { width: 100%; justify-content: center; margin-top: 18px; }
.btn--primary { background: var(--purple); color: #fff; box-shadow: 0 8px 22px rgba(153, 41, 251, .28); }
.btn--primary:hover { background: var(--purple-dark); transform: translateY(-2px); box-shadow: 0 12px 28px rgba(101, 15, 160, .35); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--purple); color: var(--purple); transform: translateY(-2px); }
.btn--light { background: #fff; color: var(--purple-dark); }
.btn--light:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn--ghost-light { background: transparent; color: #fff; border-color: rgba(255,255,255,.4); }
.btn--ghost-light:hover { border-color: #fff; background: rgba(255,255,255,.08); transform: translateY(-2px); }

/* ---------- Navbar ---------- */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.72); backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: box-shadow .4s ease, border-color .4s ease, background .4s ease;
}
.nav.is-scrolled { box-shadow: var(--shadow-sm); border-color: var(--line); background: rgba(255,255,255,.9); }
.nav__inner { height: var(--nav-h); display: flex; align-items: center; justify-content: space-between; gap: 16px; }

.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand__mark {
  width: 40px; height: 40px; border-radius: 11px; flex: none;
  display: grid; place-items: center; color: #fff; font-family: var(--serif); font-weight: 700;
  background: linear-gradient(135deg, var(--purple), var(--purple-dark));
  box-shadow: 0 6px 16px rgba(153,41,251,.3);
}
.brand__name { font-family: var(--serif); font-weight: 600; font-size: 20px; letter-spacing: .2px; }

.nav__links { display: flex; align-items: center; gap: 4px; }
.nav__link {
  position: relative; padding: 8px 14px; font-weight: 500; font-size: 15px; color: var(--ink-2);
  border-radius: 8px; transition: color .25s ease, background .25s ease;
}
.nav__link::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 4px; height: 2px;
  background: var(--purple); border-radius: 2px; transform: scaleX(0); transform-origin: left; transition: transform .3s ease;
}
.nav__link:hover { color: var(--purple); }
.nav__link.is-active { color: var(--purple); }
.nav__link.is-active::after { transform: scaleX(1); }

.nav__actions { display: flex; align-items: center; gap: 12px; }
.nav__toggle { display: none; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; flex-direction: column; gap: 5px; align-items: center; justify-content: center; }
.nav__toggle span { width: 20px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .3s ease, opacity .3s ease; }
.nav__toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav__toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Sections ---------- */
.section { padding: 96px 0; position: relative; }
.section--soft { background: var(--bg-soft); }
.section__head { max-width: 720px; margin-bottom: 52px; }
.eyebrow { display: inline-block; font-size: 13px; font-weight: 600; letter-spacing: 2px; text-transform: uppercase; color: var(--purple); margin-bottom: 14px; }
.eyebrow--light { color: #e9d4ff; }
.section__title { font-family: var(--serif); font-size: clamp(28px, 4vw, 44px); font-weight: 600; letter-spacing: -.5px; color: var(--ink); }
.section__sub { margin-top: 16px; color: var(--muted); font-size: 17px; }
.accent { color: var(--purple); }

/* ---------- Hero ---------- */
.hero {
  padding-top: 70px; padding-bottom: 90px; overflow: hidden;
  background:
    radial-gradient(circle at 88% 0%, rgba(153,41,251,.10), transparent 38%),
    radial-gradient(circle at 8% 100%, rgba(101,15,160,.08), transparent 42%);
}
.hero__grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 56px; align-items: center; }
.hero__eyebrow { color: var(--purple); font-weight: 600; letter-spacing: 2px; text-transform: uppercase; font-size: 14px; margin: 0 0 14px; }
.hero__title { font-family: var(--serif); font-weight: 700; font-size: clamp(48px, 7vw, 84px); letter-spacing: -1.5px; line-height: 1; }
.hero__tagline { font-size: clamp(18px, 2.2vw, 23px); color: var(--ink-2); margin: 22px 0 10px; max-width: 540px; }
.hero__tagline em { font-family: var(--serif); font-style: italic; color: var(--purple-dark); }
.hero__location { color: var(--muted); font-size: 16px; margin: 6px 0 30px; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 44px; }

.hero__stats { display: flex; gap: 14px; flex-wrap: wrap; }
.hero__stats li { flex: 1; min-width: 130px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 18px 20px; box-shadow: var(--shadow-sm); }
.hero__stats strong { display: block; font-family: var(--serif); font-size: 32px; font-weight: 700; color: var(--purple-dark); line-height: 1; }
.hero__stats span { font-size: 13.5px; color: var(--muted); }

.hero__visual { position: relative; justify-self: center; }
.hero__photo {
  width: min(380px, 80vw); aspect-ratio: 4 / 5; border-radius: 26px; overflow: hidden;
  background: linear-gradient(160deg, var(--purple-soft), #fff);
  box-shadow: var(--shadow-lg); border: 6px solid #fff;
}
.hero__photo img { width: 100%; height: 100%; object-fit: cover; }
.hero__monogram { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-family: var(--serif); font-weight: 700; font-size: 110px; color: var(--purple); background: linear-gradient(160deg, var(--purple-soft), #fff); }
.hero__badge {
  position: absolute; bottom: 22px; left: -26px; background: #fff; border-radius: 14px; padding: 14px 18px;
  box-shadow: var(--shadow-md); display: flex; align-items: center; gap: 12px; border: 1px solid var(--line);
}
.hero__badge-num { font-family: var(--serif); font-weight: 700; font-size: 22px; color: var(--purple); }
.hero__badge-txt { font-size: 12.5px; color: var(--muted); line-height: 1.35; }

/* ---------- About ---------- */
.about__grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 40px; align-items: start; }
.about__text p { color: var(--ink-2); font-size: 17px; margin: 0 0 18px; }
.about__text strong { color: var(--ink); font-weight: 600; }
.about__honors { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.chip { display: inline-block; padding: 9px 16px; border-radius: 999px; background: #fff; border: 1px solid var(--line); font-size: 14px; font-weight: 500; color: var(--ink-2); transition: transform .25s ease, border-color .25s ease, color .25s ease; }
.chip:hover { transform: translateY(-2px); border-color: var(--purple); color: var(--purple); }
.chip--honor { background: var(--purple-soft); border-color: transparent; color: var(--purple-dark); }
.about__card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 30px; box-shadow: var(--shadow-md); }
.about__card h3 { font-family: var(--serif); font-size: 22px; margin-bottom: 18px; }
.about__list li { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.about__list li:last-child { border-bottom: 0; }
.about__list span { color: var(--muted); }
.about__list strong { color: var(--ink); font-weight: 600; text-align: right; }

/* ---------- Impact ---------- */
.impact__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.impact__card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 30px 26px; box-shadow: var(--shadow-sm); transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease; }
.impact__card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); border-color: transparent; }
.impact__card strong { display: block; font-family: var(--serif); font-weight: 700; font-size: clamp(36px, 4vw, 48px); color: var(--purple-dark); line-height: 1; margin-bottom: 12px; }
.impact__card span { color: var(--muted); font-size: 15px; }

/* ---------- Timeline ---------- */
.timeline { position: relative; padding-left: 34px; }
.timeline::before { content: ""; position: absolute; left: 9px; top: 6px; bottom: 6px; width: 2px; background: linear-gradient(var(--purple), var(--purple-soft)); }
.timeline__item { position: relative; padding-bottom: 30px; }
.timeline__item:last-child { padding-bottom: 0; }
.timeline__dot { position: absolute; left: -34px; top: 22px; width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 4px solid var(--purple); box-shadow: 0 0 0 5px var(--bg-soft); }
.section:not(.section--soft) .timeline__dot { box-shadow: 0 0 0 5px var(--bg); }
.timeline__card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 28px; box-shadow: var(--shadow-sm); transition: transform .3s ease, box-shadow .3s ease; }
.timeline__card:hover { transform: translateX(5px); box-shadow: var(--shadow-md); }
.timeline__date { display: inline-block; font-size: 13px; font-weight: 600; color: var(--purple); background: var(--purple-soft); padding: 4px 12px; border-radius: 999px; margin-bottom: 12px; }
.timeline__card h3 { font-family: var(--serif); font-size: 21px; font-weight: 600; }
.timeline__co { color: var(--muted); font-weight: 500; font-family: var(--sans); font-size: 17px; }
.timeline__card p { color: var(--ink-2); font-size: 15.5px; margin: 10px 0 0; }
.timeline__card em { color: var(--purple-dark); font-style: italic; }

/* ---------- Skills ---------- */
.skills__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.skills__group { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow-sm); }
.skills__group h3 { font-family: var(--serif); font-size: 20px; margin-bottom: 18px; color: var(--purple-dark); }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- Certifications ---------- */
.cert__grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 20px; }
.cert__card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 22px; text-align: center; box-shadow: var(--shadow-sm); transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease; }
.cert__card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); border-color: transparent; }
.cert__icon { font-size: 32px; display: block; margin-bottom: 14px; }
.cert__card h3 { font-size: 15.5px; font-weight: 600; color: var(--ink-2); line-height: 1.4; }

/* ---------- Education ---------- */
.edu__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.edu__card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow-sm); transition: transform .3s ease, box-shadow .3s ease; }
.edu__card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); }
.edu__card--feature { background: linear-gradient(160deg, var(--purple), var(--purple-dark)); color: #fff; border-color: transparent; }
.edu__year { display: inline-block; font-size: 13px; font-weight: 600; color: var(--purple); margin-bottom: 12px; }
.edu__card--feature .edu__year { color: #e9d4ff; }
.edu__card h3 { font-family: var(--serif); font-size: 19px; margin-bottom: 8px; }
.edu__card p { color: var(--muted); font-size: 15px; margin: 0; }
.edu__card--feature p { color: rgba(255,255,255,.85); }

/* ---------- Contact ---------- */
.contact { padding-bottom: 110px; }
.contact__card {
  background: linear-gradient(135deg, var(--purple-dark), var(--purple)); color: #fff;
  border-radius: 28px; padding: clamp(40px, 6vw, 72px); text-align: center;
  box-shadow: var(--shadow-lg); position: relative; overflow: hidden;
}
.contact__card::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 80% 0%, rgba(255,255,255,.18), transparent 45%); pointer-events: none; }
.contact__title { font-family: var(--serif); font-size: clamp(28px, 4.5vw, 46px); font-weight: 600; margin-bottom: 16px; }
.contact__sub { max-width: 560px; margin: 0 auto 32px; color: rgba(255,255,255,.88); font-size: 17px; }
.contact__cta { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; position: relative; }

/* ---------- Footer ---------- */
.footer { background: #16121f; color: #cfc8da; padding: 40px 0; }
.footer__inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.footer__brand { display: flex; align-items: center; gap: 14px; }
.footer__brand strong { display: block; color: #fff; font-family: var(--serif); font-size: 18px; }
.footer__brand span { font-size: 13.5px; color: #9990a8; }
.footer__right { display: flex; align-items: center; gap: 18px; }
.footer__right a { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: rgba(255,255,255,.07); color: #fff; transition: background .3s ease, transform .3s ease; }
.footer__right a:hover { background: var(--purple); transform: translateY(-2px); }
.footer__right p { font-size: 13.5px; margin: 0; }

/* ---------- Back to top ---------- */
.to-top {
  position: fixed; right: 26px; bottom: 26px; z-index: 90; width: 48px; height: 48px; border-radius: 50%;
  background: var(--purple); color: #fff; border: 0; cursor: pointer; display: grid; place-items: center;
  box-shadow: 0 10px 24px rgba(153,41,251,.4); opacity: 0; visibility: hidden; transform: translateY(12px);
  transition: opacity .3s ease, visibility .3s ease, transform .3s ease, background .3s ease;
}
.to-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }
.to-top:hover { background: var(--purple-dark); }

/* ---------- Scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .7s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1); }
.reveal.is-visible { opacity: 1; transform: none; }

/* ===========================================================
   Responsive
   =========================================================== */
@media (max-width: 1024px) {
  .impact__grid { grid-template-columns: repeat(2, 1fr); }
  .cert__grid { grid-template-columns: repeat(3, 1fr); }
  .edu__grid { grid-template-columns: repeat(2, 1fr); }

  .nav__links {
    position: fixed; inset: var(--nav-h) 0 auto 0; flex-direction: column; align-items: stretch; gap: 0;
    background: #fff; border-bottom: 1px solid var(--line); padding: 10px 16px 18px; box-shadow: var(--shadow-md);
    transform: translateY(-12px); opacity: 0; pointer-events: none; transition: transform .3s ease, opacity .3s ease;
  }
  .nav__links.is-open { transform: none; opacity: 1; pointer-events: auto; }
  .nav__link { padding: 14px 12px; font-size: 16px; border-bottom: 1px solid var(--line); border-radius: 0; }
  .nav__link::after { display: none; }
  .nav__link:last-child { border-bottom: 0; }
  .nav__toggle { display: flex; }
}

@media (max-width: 880px) {
  .hero__grid { grid-template-columns: 1fr; gap: 44px; text-align: center; }
  .hero__copy { order: 2; }
  .hero__visual { order: 1; }
  .hero__cta, .hero__stats { justify-content: center; }
  .hero__tagline { margin-inline: auto; }
  .about__grid { grid-template-columns: 1fr; }
  .skills__grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .section { padding: 68px 0; }
  .container { padding-inline: 18px; }
  .impact__grid { grid-template-columns: 1fr 1fr; gap: 14px; }
  .impact__card { padding: 22px 18px; }
  .cert__grid { grid-template-columns: 1fr 1fr; }
  .edu__grid { grid-template-columns: 1fr; }
  .brand__name { display: none; }
  .hero__badge { left: 0; }
  .hero__stats li { min-width: 100px; padding: 14px; }
  .footer__inner { flex-direction: column; text-align: center; }
}

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