/* ============================================================
   Harsha Nandi — Portfolio
   Theme tokens
   ============================================================ */
:root {
  --bg: #14142b;
  --bg-alt: #191934;
  --surface: #1e1e3a;
  --surface-2: #23234a;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #e6e8f0;
  --muted: #9aa0b4;
  --accent: #00d4ff;
  --accent-2: #6a5cff;
  --accent-soft: rgba(0, 212, 255, 0.12);
  --danger: #ff6b6b;
  --radius: 14px;
  --radius-sm: 10px;
  --maxw: 1120px;
  --shadow: 0 18px 40px -20px rgba(0, 0, 0, 0.6);
  --font-body: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --font-head: "Space Grotesk", var(--font-body);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ============================================================
   Reset & base
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 16px;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: var(--font-head); line-height: 1.15; margin: 0; font-weight: 600; }
p { margin: 0 0 1rem; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { font-family: inherit; cursor: pointer; }

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

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 200;
  background: var(--accent); color: #04122a; padding: 10px 16px;
  border-radius: var(--radius-sm); font-weight: 600; transition: top .2s var(--ease);
}
.skip-link:focus { top: 12px; }

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

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .8rem 1.4rem; border-radius: var(--radius-sm); font-weight: 600;
  font-size: .95rem; border: 1px solid transparent; transition: transform .2s var(--ease), background .2s var(--ease), box-shadow .2s var(--ease), color .2s var(--ease); white-space: nowrap;
}
.btn-primary { background: var(--accent); color: #04122a; box-shadow: 0 10px 24px -12px rgba(0, 212, 255, 0.7); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 30px -12px rgba(0, 212, 255, 0.75); }
.btn-ghost { background: transparent; border-color: var(--border-strong); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }
.btn-block { width: 100%; }

/* ============================================================
   Header
   ============================================================ */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(20, 20, 43, 0.72);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: background .25s var(--ease), border-color .25s var(--ease);
}
.site-header.scrolled { background: rgba(16, 16, 34, 0.92); border-bottom-color: var(--border); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 70px; }

.brand { display: inline-flex; align-items: center; gap: .6rem; font-weight: 600; }
.brand-mark {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #04122a; font-family: var(--font-head); font-weight: 700; font-size: .95rem;
}
.brand-name { font-family: var(--font-head); letter-spacing: .2px; }
.brand.small .brand-mark { width: 34px; height: 34px; }

.nav { display: flex; align-items: center; gap: 2rem; }
.nav-list { display: flex; gap: 1.6rem; }
.nav-list a { color: var(--muted); font-size: .95rem; font-weight: 500; position: relative; padding: 4px 0; transition: color .2s var(--ease); }
.nav-list a::after { content: ""; position: absolute; left: 0; bottom: -2px; height: 2px; width: 0; background: var(--accent); transition: width .25s var(--ease); }
.nav-list a:hover, .nav-list a.active { color: var(--text); }
.nav-list a:hover::after, .nav-list a.active::after { width: 100%; }
.nav-cta { padding: .6rem 1.1rem; }

.nav-toggle { display: none; flex-direction: column; gap: 5px; background: transparent; border: 0; padding: 8px; }
.nav-toggle span { width: 24px; height: 2px; background: var(--text); border-radius: 2px; transition: transform .25s var(--ease), opacity .2s var(--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); }

/* ============================================================
   Hero
   ============================================================ */
.hero { padding: clamp(3rem, 8vw, 6rem) 0 clamp(3rem, 6vw, 5rem); position: relative; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(600px 300px at 78% 10%, rgba(0, 212, 255, 0.10), transparent 70%),
    radial-gradient(500px 300px at 12% 30%, rgba(106, 92, 255, 0.10), transparent 70%);
}
.hero-inner { display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.eyebrow { color: var(--accent); font-weight: 600; font-size: .85rem; letter-spacing: .14em; text-transform: uppercase; margin-bottom: .9rem; }
.hero-title { font-size: clamp(2rem, 5vw, 3.25rem); font-weight: 700; margin-bottom: 1.1rem; }
.hero-title .accent { color: var(--accent); }
.hero-sub { color: var(--muted); font-size: 1.075rem; max-width: 46ch; margin-bottom: 1.8rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .9rem; margin-bottom: 2.4rem; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 1.8rem; }
.hero-meta li { display: flex; flex-direction: column; }
.hero-meta strong { font-family: var(--font-head); font-size: 1.5rem; color: var(--text); }
.hero-meta span { color: var(--muted); font-size: .85rem; }

.hero-visual { display: flex; justify-content: center; }
.headshot-frame {
  position: relative; width: min(360px, 80vw); border-radius: 24px; padding: 10px;
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.4), rgba(106, 92, 255, 0.35));
  box-shadow: var(--shadow);
}
.headshot-frame img { border-radius: 18px; width: 100%; }

/* ============================================================
   Sections
   ============================================================ */
.section { padding: clamp(3.5rem, 8vw, 6rem) 0; }
.section-alt { background: var(--bg-alt); }
.section-head { max-width: 640px; margin-bottom: clamp(2rem, 4vw, 3rem); }
.section-eyebrow { color: var(--accent); font-weight: 600; font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; margin-bottom: .6rem; }
.section-title { font-size: clamp(1.6rem, 3.5vw, 2.4rem); }

/* About */
.about-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.about-text p { color: var(--muted); font-size: 1.05rem; }
.about-facts { display: grid; gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.about-facts li { display: flex; justify-content: space-between; gap: 1rem; padding: 1rem 1.2rem; background: var(--surface); }
.fact-k { color: var(--muted); }
.fact-v { font-weight: 600; text-align: right; }

/* Skills */
.skills-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; }
.skill-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.6rem; transition: transform .25s var(--ease), border-color .25s var(--ease); }
.skill-card:hover { transform: translateY(-4px); border-color: var(--border-strong); }
.skill-card h3 { font-size: 1.15rem; margin-bottom: 1.1rem; color: var(--text); }
.tag-list { display: flex; flex-wrap: wrap; gap: .5rem; }
.tag-list li { font-size: .82rem; color: var(--text); background: var(--surface-2); border: 1px solid var(--border); padding: .35rem .7rem; border-radius: 999px; }
.tag-list.small li { font-size: .75rem; background: var(--accent-soft); border-color: rgba(0, 212, 255, 0.25); color: #bdeeff; }

/* Projects */
.projects-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.6rem; }
.project-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: transform .25s var(--ease), border-color .25s var(--ease), box-shadow .25s var(--ease); }
.project-card:hover { transform: translateY(-6px); border-color: rgba(0, 212, 255, 0.35); box-shadow: var(--shadow); }
.project-thumb { overflow: hidden; border-bottom: 1px solid var(--border); }
.project-thumb img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; transition: transform .4s var(--ease); }
.project-card:hover .project-thumb img { transform: scale(1.04); }
.project-body { padding: 1.4rem 1.5rem 1.6rem; display: flex; flex-direction: column; gap: .8rem; flex: 1; }
.project-body h3 { font-size: 1.2rem; }
.project-body p { color: var(--muted); margin: 0; font-size: .96rem; }
.project-links { margin-top: auto; display: flex; gap: 1.2rem; padding-top: .4rem; }
.link-arrow { color: var(--accent); font-weight: 600; font-size: .9rem; display: inline-flex; align-items: center; gap: .3rem; transition: gap .2s var(--ease), color .2s var(--ease); }
.link-arrow::after { content: "\2192"; transition: transform .2s var(--ease); }
.link-arrow:hover::after { transform: translateX(3px); }
.link-arrow.ghost { color: var(--muted); }
.link-arrow.ghost:hover { color: var(--text); }

/* Experience timeline */
.timeline { position: relative; margin-left: 6px; padding-left: 28px; border-left: 2px solid var(--border); display: grid; gap: 2rem; }
.timeline-item { position: relative; }
.timeline-dot { position: absolute; left: -37px; top: 4px; width: 14px; height: 14px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(0, 212, 255, 0.18); }
.timeline-content { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.4rem 1.5rem; transition: border-color .25s var(--ease), transform .25s var(--ease); }
.timeline-content:hover { border-color: var(--border-strong); transform: translateX(3px); }
.timeline-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .4rem 1rem; align-items: baseline; }
.timeline-head h3 { font-size: 1.15rem; }
.timeline-period { color: var(--accent); font-size: .85rem; font-weight: 600; }
.timeline-org { color: var(--muted); font-weight: 600; margin: .2rem 0 .6rem; }
.timeline-content p:last-child { color: var(--muted); margin: 0; }

/* Contact */
.contact-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.contact-copy p { color: var(--muted); }
.contact-direct { margin-top: 1.5rem; display: grid; gap: .8rem; }
.contact-direct li { display: flex; flex-direction: column; }
.contact-direct span:first-child { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; }
.contact-direct a { color: var(--accent); font-weight: 600; }
.contact-form { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: clamp(1.4rem, 3vw, 2rem); }
.field { margin-bottom: 1.1rem; }
.field label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: .45rem; color: var(--text); }
.field input, .field textarea {
  width: 100%; background: var(--bg); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  color: var(--text); padding: .75rem .9rem; font-family: inherit; font-size: .95rem; resize: vertical; transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field input.invalid, .field textarea.invalid { border-color: var(--danger); }
.error { color: var(--danger); font-size: .8rem; margin: .4rem 0 0; min-height: 1em; }
.form-status { margin: 1rem 0 0; font-size: .9rem; color: var(--accent); }

/* ============================================================
   Footer
   ============================================================ */
.site-footer { background: var(--bg-alt); border-top: 1px solid var(--border); padding-top: 2.5rem; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.5rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 1.4rem; }
.footer-links a { color: var(--muted); font-size: .9rem; transition: color .2s var(--ease); }
.footer-links a:hover { color: var(--text); }
.social { display: flex; gap: .8rem; }
.social a { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); color: var(--muted); transition: color .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease); }
.social a:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-3px); }
.footer-bottom { border-top: 1px solid var(--border); margin-top: 2rem; padding-block: 1.4rem; }
.footer-bottom p { margin: 0; color: var(--muted); font-size: .85rem; }

/* ============================================================
   Scroll reveal
   ============================================================ */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.reveal.visible { opacity: 1; transform: none; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; text-align: left; }
  .hero-visual { order: -1; }
  .about-grid, .contact-wrap { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: 1fr; }
  .projects-grid { grid-template-columns: 1fr; }

  .nav-toggle { display: flex; }
  .nav {
    position: fixed; inset: 70px 0 auto 0; flex-direction: column; align-items: stretch; gap: 0;
    background: rgba(16, 16, 34, 0.98); border-bottom: 1px solid var(--border);
    padding: 1rem 24px 1.6rem; transform: translateY(-140%); transition: transform .3s var(--ease); backdrop-filter: blur(12px);
  }
  .nav.open { transform: translateY(0); }
  .nav-list { flex-direction: column; gap: 0; }
  .nav-list li { border-bottom: 1px solid var(--border); }
  .nav-list a { display: block; padding: .9rem 0; }
  .nav-cta { margin-top: 1rem; text-align: center; }
}

@media (max-width: 480px) {
  .container { padding-inline: 18px; }
  .hero-meta { gap: 1.2rem; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}

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

/* ============================================================
   Print
   ============================================================ */
@media print {
  :root { --bg: #fff; --bg-alt: #fff; --surface: #fff; --text: #111; --muted: #444; --border: #ccc; }
  body { background: #fff; color: #111; }
  .site-header, .nav-toggle, .hero-actions, .contact-form, .social, .skip-link { display: none !important; }
  .hero::before { display: none; }
  .reveal { opacity: 1 !important; transform: none !important; }
  a { color: #111; }
  .section, .hero { padding: 1.2rem 0; }
  .project-card, .skill-card, .timeline-content, .about-facts { border-color: #ccc; box-shadow: none; break-inside: avoid; }
}
