/* ==========================================================
   Palak Pandey | Portfolio styles
   Sections: 1 Variables · 2 Base · 3 Layout · 4 Header
   5 Buttons · 6 Hero · 7 Sections · 8 Cards · 9 Project
   10 Timeline · 11 Contact · 12 Footer · 13 Motion · 14 Responsive
   ========================================================== */

/* 1. VARIABLES ------------------------------------------------ */
:root {
  --accent: #4f46e5;
  --accent-strong: #4338ca;
  --accent-soft: #eef0ff;
  --bg: #ffffff;
  --bg-alt: #f6f7fb;
  --surface: #ffffff;
  --text: #14172b;
  --text-muted: #565b73;
  --border: #e3e5ef;
  --shadow: 0 10px 30px rgba(20, 23, 43, 0.08);
  --shadow-sm: 0 2px 10px rgba(20, 23, 43, 0.06);
  --radius: 16px;
  --radius-sm: 10px;
  --header-h: 68px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

[data-theme="dark"] {
  --accent: #8b93ff;
  --accent-strong: #a5abff;
  --accent-soft: #1d2040;
  --bg: #0e1020;
  --bg-alt: #13162b;
  --surface: #181b33;
  --text: #eef0fb;
  --text-muted: #aab0c9;
  --border: #272b4a;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* 2. BASE ----------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 8px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  transition: background-color 0.3s var(--ease), color 0.3s var(--ease);
}
img, svg { display: block; max-width: 100%; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5rem; letter-spacing: -0.01em; }
p { margin: 0 0 1rem; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-strong); }
[hidden] { display: none !important; }

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

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 200;
  background: var(--accent); color: #fff; padding: 10px 16px; border-radius: 8px;
  transition: top 0.2s;
}
.skip-link:focus { top: 12px; color: #fff; }

/* 3. LAYOUT --------------------------------------------------- */
.container { width: min(1120px, 100% - 40px); margin-inline: auto; }
.container.narrow { width: min(820px, 100% - 40px); }

.section { padding: clamp(64px, 9vw, 104px) 0; }
.section-alt { background: var(--bg-alt); }
.section-head { margin-bottom: 2.5rem; }
.section-head.center { text-align: center; }
.section-head h2 { font-size: clamp(1.7rem, 3.4vw, 2.3rem); }
.section-sub { color: var(--text-muted); max-width: 62ch; font-size: 1.05rem; }
.section-head.center .section-sub { margin-inline: auto; }
.eyebrow {
  display: inline-block; margin-bottom: 0.6rem;
  font-size: 0.8rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent);
}
.sub-title { font-size: 1.15rem; margin: 3rem 0 1rem; }

/* 4. HEADER --------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 100; height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.site-header.scrolled { border-color: var(--border); box-shadow: var(--shadow-sm); }
.nav { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }

.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; }
.brand:hover { color: var(--text); }
.brand-mark {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px;
  background: var(--accent); color: #fff; font-weight: 800;
}
[data-theme="dark"] .brand-mark { color: #0e1020; }

.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a {
  display: block; padding: 8px 14px; border-radius: 999px;
  color: var(--text-muted); font-size: 0.95rem; font-weight: 500;
  transition: color 0.2s, background-color 0.2s;
}
.nav-links a:hover { color: var(--text); background: var(--accent-soft); }
.nav-links a.active { color: var(--accent); background: var(--accent-soft); }

.nav-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 42px; height: 42px;
  border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface); color: var(--text); cursor: pointer;
  transition: border-color 0.2s, transform 0.2s var(--ease);
}
.icon-btn:hover { border-color: var(--accent); transform: translateY(-1px); }
.icon-sun { display: none; }
[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }

.nav-toggle { display: none; flex-direction: column; gap: 4px; }
.nav-toggle .bar { display: block; width: 18px; height: 2px; background: currentColor; border-radius: 2px; transition: transform 0.25s var(--ease), opacity 0.2s; }
.nav-toggle[aria-expanded="true"] .bar:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .bar:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* 5. BUTTONS -------------------------------------------------- */
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 1.5rem; }
.btn-row.center { justify-content: center; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 24px; border-radius: 12px; border: 1.5px solid transparent;
  font: inherit; font-weight: 600; font-size: 0.95rem; cursor: pointer;
  transition: transform 0.2s var(--ease), background-color 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 35%, transparent); }
.btn-primary:hover { background: var(--accent-strong); color: #fff; }
[data-theme="dark"] .btn-primary, [data-theme="dark"] .btn-primary:hover { color: #0e1020; }
.btn-outline { background: transparent; color: var(--text); border-color: var(--border); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-ghost { background: transparent; color: var(--accent); }
.btn-ghost:hover { background: var(--accent-soft); color: var(--accent); }

.link-arrow { font-weight: 600; display: inline-flex; gap: 6px; align-items: center; }

/* 6. HERO ----------------------------------------------------- */
.hero { padding: clamp(48px, 8vw, 96px) 0 clamp(56px, 8vw, 96px); position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: -20% -10% auto auto; width: 560px; height: 560px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 22%, transparent), transparent 68%);
  z-index: 0; pointer-events: none;
}
.hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: 1.25fr 0.75fr; gap: clamp(32px, 6vw, 72px); align-items: center; }
.hero h1 { font-size: clamp(2.6rem, 6.5vw, 4.4rem); font-weight: 800; letter-spacing: -0.03em; margin-bottom: 0.7rem; }
.hero .eyebrow { font-size: 0.9rem; }
.hero-role { font-size: clamp(1.05rem, 2vw, 1.3rem); font-weight: 600; color: var(--accent); margin-bottom: 1rem; }
.hero-intro { font-size: 1.1rem; color: var(--text-muted); max-width: 54ch; }
.hero-meta { display: flex; align-items: center; gap: 8px; margin: 1.6rem 0 0; font-size: 0.92rem; color: var(--text-muted); }

.hero-photo { display: flex; justify-content: center; }
.photo-frame {
  position: relative; width: min(100%, 340px); aspect-ratio: 4 / 5;
  border-radius: 28px; padding: 8px; background: var(--surface);
  border: 1px solid var(--border); box-shadow: var(--shadow);
}
.photo-frame::before {
  content: ""; position: absolute; inset: 18px -14px -14px 18px; z-index: -1;
  border-radius: 28px; background: var(--accent-soft); border: 1px solid var(--border);
}
.photo-frame img { width: 100%; height: 100%; object-fit: cover; border-radius: 22px; }

/* 7. ABOUT / SECTIONS ---------------------------------------- */
.about p { font-size: 1.08rem; color: var(--text-muted); }
.about p:first-child { color: var(--text); }

/* 8. CARDS & CHIPS ------------------------------------------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.6rem; box-shadow: var(--shadow-sm);
  transition: transform 0.25s var(--ease), box-shadow 0.25s, border-color 0.25s;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.card h3 { font-size: 1.1rem; margin-bottom: 0.9rem; }
.card p:last-child { margin-bottom: 0; }
.card-note { margin: 0.9rem 0 0; font-size: 0.85rem; color: var(--text-muted); font-style: italic; }

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

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips li {
  padding: 6px 14px; border-radius: 999px; font-size: 0.88rem; font-weight: 500;
  background: var(--accent-soft); color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent);
}
.tag { display: inline-block; padding: 3px 12px; border-radius: 999px; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: 0.7rem; }
.tag-accent { background: var(--accent); color: #fff; }
[data-theme="dark"] .tag-accent { color: #0e1020; }

.check-list li { position: relative; padding-left: 26px; margin-bottom: 0.55rem; color: var(--text-muted); font-size: 0.97rem; }
.check-list li::before {
  content: ""; position: absolute; left: 0; top: 0.5em; width: 14px; height: 8px;
  border-left: 2.5px solid var(--accent); border-bottom: 2.5px solid var(--accent);
  transform: translateY(-50%) rotate(-45deg) scale(0.85);
}

/* 9. PROJECT -------------------------------------------------- */
.project-meta { font-size: 0.88rem; color: var(--text-muted); margin: 0.4rem 0 0; }
.project-top { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 4vw, 48px); align-items: center; margin-bottom: 28px; }
.project-visual { margin: 0; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow); }
.project-visual svg { width: 100%; height: auto; }
.project-summary p { color: var(--text-muted); }
.project-summary strong { color: var(--text); }

.svg-bg { fill: var(--surface); }
.svg-frame { stroke: var(--accent); }
.svg-face { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 3; }
.svg-dot { fill: var(--text); }
.svg-line { stroke: var(--text); }
.svg-accent { fill: var(--accent); }
.svg-accent-stroke { stroke: var(--accent); }
.svg-row { fill: var(--bg-alt); stroke: var(--border); }
.svg-row-hl { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 2; }
.svg-bar { fill: var(--border); }
.svg-bar-hl { fill: var(--accent); }
.svg-caption { fill: var(--text-muted); font-size: 14px; font-family: var(--font); }

.project-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; }

.workflow { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; counter-reset: none; }
.workflow li {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 0.93rem; font-weight: 500;
}
.step-num {
  flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent); font-size: 0.8rem; font-weight: 700;
}
.workflow .step-key { border-color: var(--accent); background: var(--accent-soft); }
.workflow .step-key .step-num { background: var(--accent); color: #fff; }
[data-theme="dark"] .workflow .step-key .step-num { color: #0e1020; }

.project-bottom { display: grid; grid-template-columns: 1fr 1.3fr; gap: clamp(24px, 4vw, 48px); align-items: start; }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; min-width: 480px; }
.data-table th, .data-table td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.data-table th { background: var(--accent-soft); color: var(--accent); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table td:first-child { font-weight: 600; }

/* 10. TIMELINE & CERT ---------------------------------------- */
.timeline { position: relative; padding-left: 34px; }
.timeline::before { content: ""; position: absolute; left: 9px; top: 8px; bottom: 8px; width: 2px; background: var(--border); }
.timeline-item { position: relative; margin-bottom: 20px; }
.timeline-item:last-child { margin-bottom: 0; }
.timeline-dot {
  position: absolute; left: -34px; top: 22px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--bg-alt); border: 3px solid var(--accent);
}
.timeline-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.3rem 1.5rem; box-shadow: var(--shadow-sm); }
.timeline-card h3 { font-size: 1.1rem; margin-bottom: 0.3rem; }
.timeline-sub { margin: 0 0 0.2rem; font-weight: 500; }
.timeline-org { margin: 0 0 0.2rem; color: var(--text-muted); }
.timeline-date { margin: 0; font-size: 0.88rem; font-weight: 600; color: var(--accent); }

.cert-card {
  display: flex; gap: 20px; align-items: flex-start; padding: 1.6rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.cert-card h3 { font-size: 1.2rem; margin-bottom: 0.2rem; }
.cert-card .link-arrow { margin-top: 0.8rem; }
.cert-icon { flex: none; display: grid; place-items: center; width: 54px; height: 54px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); }

/* 11. CONTACT ------------------------------------------------- */
.contact-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.contact-item {
  display: block; height: 100%; padding: 1.2rem 1.4rem; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  transition: transform 0.25s var(--ease), border-color 0.25s, box-shadow 0.25s;
}
.contact-item:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: var(--shadow); color: var(--text); }
.contact-label { display: block; font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--accent); margin-bottom: 4px; }
.contact-value { display: block; font-weight: 500; overflow-wrap: anywhere; }

/* 12. FOOTER -------------------------------------------------- */
.site-footer { padding: 28px 0; border-top: 1px solid var(--border); font-size: 0.9rem; color: var(--text-muted); }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.footer-inner p { margin: 0; }

/* 13. MOTION -------------------------------------------------- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
.js .reveal.visible { opacity: 1; transform: none; }

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

/* 14. RESPONSIVE --------------------------------------------- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-photo { order: -1; }
  .photo-frame { width: min(100%, 260px); }
  .project-top, .project-bottom { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .nav-toggle { display: inline-grid; }
  .nav-links {
    position: absolute; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 2px; padding: 12px 20px 18px;
    background: var(--bg); border-bottom: 1px solid var(--border); box-shadow: var(--shadow);
    transform: translateY(-8px); opacity: 0; visibility: hidden;
    transition: transform 0.25s var(--ease), opacity 0.25s, visibility 0.25s;
  }
  .nav-links.open { transform: none; opacity: 1; visibility: visible; }
  .nav-links a { padding: 12px 14px; border-radius: 10px; }
}

@media (max-width: 480px) {
  .btn-row .btn { flex: 1 1 100%; }
  .cert-card { flex-direction: column; }
  .brand-name { font-size: 0.95rem; }
}

@media print {
  .site-header, .skip-link, .nav-actions { display: none; }
  .js .reveal { opacity: 1; transform: none; }
}
