/* =========================================================
   Aviral Pandey portfolio
   EDIT COLORS HERE: all colors are variables below.
   ========================================================= */
:root {
  --bg: #f4f7f8;
  --bg-alt: #e9eff1;
  --surface: #ffffff;
  --text: #0f1b2d;
  --muted: #4d5b6b;
  --line: #d3dde1;
  --accent: #0b7a75;       /* teal: links, buttons */
  --accent-strong: #075e5a;
  --accent-text: #ffffff;  /* text on accent buttons */
  --mark: #e3a230;         /* amber: small highlights only */
  --shadow: 0 1px 2px rgba(15, 27, 45, .06), 0 8px 24px rgba(15, 27, 45, .06);

  --font-head: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --font-body: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  --radius: 14px;
  --header-h: 64px;
}

:root[data-theme="dark"] {
  --bg: #0c1624;
  --bg-alt: #101d2e;
  --surface: #142338;
  --text: #e8eef4;
  --muted: #a3b2c2;
  --line: #243751;
  --accent: #5fd1c8;
  --accent-strong: #8ae3dc;
  --accent-text: #08201f;
  --mark: #f0b44a;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  transition: background-color .25s, color .25s;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-strong); }
h1, h2, h3 { font-family: var(--font-head); line-height: 1.15; margin: 0; }
p { margin: 0 0 .8em; max-width: 65ch; }
ul, ol { margin: 0; padding: 0; list-style: none; }

.container { width: min(1080px, 100% - 2.5rem); margin-inline: auto; }
.muted { color: var(--muted); }

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

.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  background: var(--accent); color: var(--accent-text);
  padding: .6rem 1rem; border-radius: 8px; text-decoration: none;
}
.skip-link:focus { top: 1rem; }

/* ---------- Header and navigation ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50; height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand {
  font-family: var(--font-head); font-weight: 800; font-size: 1.25rem;
  color: var(--text); text-decoration: none; letter-spacing: .02em;
  border-bottom: 3px solid var(--mark); line-height: 1;
}
.nav-links { display: flex; gap: .25rem; margin-left: auto; }
.nav-links a {
  display: block; padding: .45rem .7rem; border-radius: 8px;
  color: var(--muted); text-decoration: none; font-weight: 500; font-size: .98rem;
}
.nav-links a:hover { color: var(--text); background: var(--bg-alt); }
.nav-links a.active { color: var(--text); box-shadow: inset 0 -3px 0 var(--accent); border-radius: 0; }
.nav-actions { display: flex; align-items: center; gap: .4rem; }

.icon-btn {
  width: 42px; height: 42px; display: grid; place-items: center;
  background: transparent; color: var(--text); cursor: pointer;
  border: 1px solid var(--line); border-radius: 10px;
}
.icon-btn:hover { background: var(--bg-alt); }
.icon-sun { display: none; }
:root[data-theme="dark"] .icon-sun { display: block; }
:root[data-theme="dark"] .icon-moon { display: none; }

.menu-btn { display: none; flex-direction: column; gap: 5px; }
.menu-btn .bar { width: 20px; height: 2px; background: currentColor; transition: transform .2s, opacity .2s; }
.menu-btn[aria-expanded="true"] .bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-btn[aria-expanded="true"] .bar:nth-child(2) { opacity: 0; }
.menu-btn[aria-expanded="true"] .bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; padding: .75rem 1.4rem; border-radius: 10px;
  font-weight: 600; font-size: 1rem; text-decoration: none; cursor: pointer;
  border: 2px solid var(--accent); transition: background-color .2s, color .2s, transform .15s;
}
.btn-primary { background: var(--accent); color: var(--accent-text); }
.btn-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--accent-text); }
.btn-ghost { background: transparent; color: var(--accent); }
.btn-ghost:hover { background: var(--accent); color: var(--accent-text); }
.btn-small { padding: .45rem .95rem; font-size: .95rem; border-width: 1.5px; }
.btn:active { transform: translateY(1px); }

/* ---------- Hero ---------- */
.hero { padding: clamp(2.5rem, 7vw, 5.5rem) 0 clamp(3rem, 8vw, 6rem); }
.hero-grid { display: grid; grid-template-columns: 1.3fr 1fr; align-items: center; gap: clamp(2rem, 6vw, 5rem); }
.hero-meta { color: var(--muted); font-weight: 600; margin-bottom: .6rem; }
.hero-name {
  font-size: clamp(3.4rem, 10.5vw, 7.2rem);
  font-weight: 800; letter-spacing: -.03em; line-height: .95;
  margin-bottom: 1.2rem;
}
.hero-title { font-size: clamp(1.15rem, 2.4vw, 1.4rem); font-weight: 500; max-width: 30ch; margin-bottom: 1rem; }
.typing-line { font-family: var(--font-head); font-size: 1.15rem; color: var(--accent); min-height: 1.8em; margin-bottom: 1.6rem; }
.caret { display: inline-block; width: 2px; height: 1.1em; background: var(--mark); margin-left: 3px; vertical-align: text-bottom; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.hero-buttons { display: flex; flex-wrap: wrap; gap: .8rem; }

.hero-photo { justify-self: center; width: min(100%, 360px); }
.photo-frame {
  position: relative; aspect-ratio: 4 / 5; width: 100%;
  border-radius: 999px 999px var(--radius) var(--radius);   /* arch shape */
  overflow: hidden; background: var(--bg-alt);
  box-shadow: var(--shadow);
  outline: 2px solid var(--line); outline-offset: 10px;
}
.photo-frame img { width: 100%; height: 100%; object-fit: cover; object-position: center 18%; }
.photo-fallback {
  position: absolute; inset: 0; place-items: center;
  font-family: var(--font-head); font-weight: 800; font-size: 5rem; color: var(--accent);
}

/* One orchestrated page-load moment: hero text and photo come in together */
.hero-text > *, .hero-photo { animation: rise .7s cubic-bezier(.2, .7, .2, 1) both; }
.hero-text > :nth-child(2) { animation-delay: .08s; }
.hero-text > :nth-child(3) { animation-delay: .16s; }
.hero-text > :nth-child(4) { animation-delay: .24s; }
.hero-text > :nth-child(5) { animation-delay: .32s; }
.hero-photo { animation-delay: .2s; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* ---------- Sections ---------- */
.section { padding: clamp(3rem, 7vw, 5.5rem) 0; }
.section.alt { background: var(--bg-alt); }
.split { display: grid; grid-template-columns: 220px 1fr; gap: clamp(1.5rem, 5vw, 4rem); align-items: start; }
.section-title {
  font-size: clamp(1.7rem, 3.2vw, 2.2rem); font-weight: 700;
  position: sticky; top: calc(var(--header-h) + 24px);
}
.lead { font-size: 1.2rem; }
.meta-line { color: var(--muted); }

/* ---------- Timeline (education is a real sequence) ---------- */
.timeline { border-left: 2px solid var(--line); padding-left: 1.6rem; display: grid; gap: 1.8rem; }
.timeline-item { position: relative; }
.timeline-item::before {
  content: ""; position: absolute; left: calc(-1.6rem - 7px); top: .5rem;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--bg-alt); border: 3px solid var(--accent);
}
.timeline-item:first-child::before { background: var(--accent); }
.timeline-year { font-family: var(--font-head); font-weight: 700; color: var(--accent); }
.timeline-item h3 { font-size: 1.25rem; margin: .15rem 0 .3rem; }
.timeline-item p { margin: 0; }

/* ---------- Skills ---------- */
.skill-groups { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2rem 2.5rem; }
.skill-group h3 { font-size: 1.1rem; margin-bottom: .7rem; }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chips li {
  padding: .3rem .8rem; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); font-size: .98rem;
}
.chips.small { margin: .8rem 0 1.1rem; }
.chips.small li { font-size: .9rem; padding: .15rem .65rem; }

/* ---------- Cards ---------- */
.cards { display: grid; gap: 1.5rem; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow);
  transition: transform .2s, border-color .2s;
}
.card:hover { transform: translateY(-4px); border-color: var(--accent); }
.card-body { padding: 1.4rem 1.5rem 1.5rem; }
.card h3 { font-size: 1.25rem; margin-bottom: .4rem; }
.card p { margin-bottom: .4rem; }
.label { font-weight: 600; color: var(--muted); font-size: .95rem; margin: 1rem 0 .2rem !important; }

.project { display: grid; grid-template-columns: 1fr 1.3fr; }
.project-image {
  position: relative; min-height: 220px; display: grid; place-items: center;
  background: linear-gradient(135deg, #0f1b2d, #0b7a75);
}
.project-image img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.project-image-label { color: #fff; font-family: var(--font-head); font-weight: 700; font-size: 1.3rem; padding: 1rem; text-align: center; }
.project-image img + .project-image-label { display: none; }

.cert { display: grid; grid-template-columns: 1fr 1.1fr; }
.cert-preview { display: block; background: #fff; border-right: 1px solid var(--line); }
.cert-preview img { width: 100%; height: 100%; object-fit: cover; }
.btn-row { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .9rem; }

/* ---------- Contact ---------- */
.contact-list { margin-top: 1.4rem; border-top: 1px solid var(--line); }
.contact-list li {
  display: grid; grid-template-columns: 110px 1fr; gap: 1rem;
  padding: 1rem 0; border-bottom: 1px solid var(--line); align-items: baseline;
}
.contact-list span { color: var(--muted); font-weight: 600; }
.contact-list a { font-weight: 500; overflow-wrap: anywhere; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 1.6rem 0; color: var(--muted); font-size: .95rem; }
.site-footer p { margin: 0; }
.footer-row { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .6rem; }

/* ---------- Scroll reveal (kept short and subtle) ---------- */
.js .reveal { opacity: 0; transform: translateY(10px); transition: opacity .5s ease, transform .5s ease; }
.js .reveal.visible { opacity: 1; transform: none; }

/* ---------- Tablet ---------- */
@media (max-width: 900px) {
  .split { grid-template-columns: 1fr; gap: 1.4rem; }
  .section-title { position: static; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-photo { order: -1; width: min(70%, 280px); justify-self: start; }
  .project, .cert { grid-template-columns: 1fr; }
  .cert-preview { border-right: 0; border-bottom: 1px solid var(--line); }
}

/* ---------- Mobile: hamburger menu ---------- */
@media (max-width: 760px) {
  .menu-btn { display: flex; }
  .nav-links {
    position: absolute; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; gap: 0; margin: 0; padding: .6rem 1.25rem 1rem;
    background: var(--bg); border-bottom: 1px solid var(--line);
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: .8rem .2rem; border-bottom: 1px solid var(--line); border-radius: 0; }
  .nav-links a.active { box-shadow: none; color: var(--accent); }
  .nav { justify-content: space-between; }
  .nav-actions { margin-left: auto; }
  .skill-groups { grid-template-columns: 1fr; }
  .contact-list li { grid-template-columns: 1fr; gap: .1rem; }
}

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