/* ────────────────────────────────────────────────────
   Bishal Ramdam B.K. — engineering editorial
   Paper-warm ground, ink text, one deep-teal accent.
   Fraunces (display) · Inter (body) · JetBrains Mono (labels)
──────────────────────────────────────────────────── */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --paper:      #faf9f7;
  --paper-soft: #f3f1ec;
  --ink:        #1c1917;
  --muted:      #57534e;
  --faint:      #a8a29e;
  --accent:     #0f766e;
  --accent-ink: #115e59;
  --accent-soft: rgba(15, 118, 110, 0.08);
  --line:       #e2ded6;
  --line-dark:  #d6d1c7;
  --radius:     10px;
  --max-w:      1080px;
  --serif:      'Fraunces', Georgia, serif;
  --sans:       'Inter', system-ui, -apple-system, sans-serif;
  --mono:       'JetBrains Mono', ui-monospace, 'SF Mono', monospace;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  /* Sticky footer: on short pages (e.g. a young blog) the footer
     stays pinned to the bottom of the viewport */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body > * {
  width: 100%;
}

.site-footer {
  margin-top: auto;
}

/* Faint dot grid behind the hero — a quiet nod to perfboard */
.hero {
  background-image: radial-gradient(var(--line-dark) 1px, transparent 1px);
  background-size: 28px 28px;
  background-position: center;
}

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
}

section {
  padding: 5.5rem 0;
  border-top: 1px solid var(--line);
}

::selection {
  background: var(--accent);
  color: var(--paper);
}

a {
  color: inherit;
  text-decoration: none;
}

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

/* ─── Type ────────────────────────────────────────── */

h1, h2, .contact-headline {
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: -0.015em;
  color: var(--ink);
}

h1 em, .contact-headline em {
  font-style: italic;
  color: var(--accent-ink);
}

h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink);
}

p {
  color: var(--muted);
}

.eyebrow {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-ink);
}

/* ─── Section headers ─────────────────────────────── */

.section-head {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 2.75rem;
}

.section-num {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--faint);
}

.section-head h2 {
  font-size: clamp(1.6rem, 3.2vw, 2.1rem);
  line-height: 1.15;
}

/* ─── Buttons ─────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line-dark);
  border-radius: var(--radius);
  padding: 0.65rem 1.35rem;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.btn:hover {
  border-color: var(--accent);
  color: var(--accent-ink);
  background: var(--accent-soft);
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.btn-primary:hover {
  background: var(--accent-ink);
  border-color: var(--accent-ink);
  color: var(--paper);
}

.btn-danger {
  color: #fff;
  background: #dc2626;
  border-color: #dc2626;
}

.btn-danger:hover {
  color: #fff;
  background: #b91c1c;
  border-color: #b91c1c;
}

/* ─── Header ──────────────────────────────────────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 249, 247, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s ease;
}

.site-header.scrolled {
  border-bottom-color: var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 4.25rem;
}

.brand {
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 600;
  white-space: nowrap;
}

.brand span {
  color: var(--accent-ink);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 1.6rem;
}

.nav-link {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--muted);
  position: relative;
  padding: 0.25rem 0;
  transition: color 0.2s ease;
}

.nav-link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 1.5px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}

.nav-link:hover {
  color: var(--ink);
}

.nav-link.active {
  color: var(--accent-ink);
}

.nav-link.active::after {
  transform: scaleX(1);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 2.5rem;
  height: 2.5rem;
  background: none;
  border: 1px solid var(--line-dark);
  border-radius: var(--radius);
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 1.1rem;
  height: 1.5px;
  margin: 0 auto;
  background: var(--ink);
  transition: transform 0.25s ease;
}

.nav-toggle[aria-expanded="true"] span:first-child {
  transform: translateY(3.25px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:last-child {
  transform: translateY(-3.25px) rotate(-45deg);
}

/* ─── Hero ────────────────────────────────────────── */

.hero {
  border-top: none;
  padding: 6.5rem 0 6rem;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 4rem;
  align-items: center;
}

.hero h1 {
  font-size: clamp(2.3rem, 5.5vw, 3.6rem);
  line-height: 1.12;
  margin: 1.1rem 0 1.5rem;
}

.hero-lede {
  font-size: 1.08rem;
  max-width: 34rem;
  margin-bottom: 2.2rem;
}

.hero-lede strong {
  color: var(--ink);
  font-weight: 600;
}

.hero-ctas {
  display: flex;
  gap: 0.85rem;
  flex-wrap: wrap;
  margin-bottom: 2.2rem;
}

.hero-meta {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--faint);
}

.hero-open {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--accent-ink);
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.35; }
}

.hero-figure {
  position: relative;
  justify-self: end;
  margin: 0;
}

.hero-photo {
  display: block;
  width: min(320px, 100%);
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  object-position: center top;
  border-radius: var(--radius);
  border: 1px solid var(--line-dark);
  box-shadow: 14px 14px 0 -1px var(--paper-soft), 14px 14px 0 0 var(--line-dark);
}

.hero-caption {
  margin-top: 1.6rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--faint);
  text-align: right;
}

/* ─── About ───────────────────────────────────────── */

.about-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 3.5rem;
  align-items: start;
}

.about-text {
  font-size: 1.02rem;
}

.about-text p + p {
  margin-top: 1.1rem;
}

.about-aside {
  border-left: 2px solid var(--accent);
  padding-left: 1.5rem;
}

.fact-list {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.fact-list dt {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 0.2rem;
}

.fact-list dd {
  font-size: 0.92rem;
  color: var(--ink);
}

/* ─── Experience ──────────────────────────────────── */

.exp-entry {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 2.5rem;
}

.exp-period {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--accent-ink);
}

.exp-location {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--faint);
  margin-top: 0.3rem;
}

.exp-body h3 {
  font-size: 1.2rem;
}

.exp-company {
  font-size: 0.95rem;
  color: var(--muted);
  margin: 0.2rem 0 1.4rem;
}

.exp-bullets {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.exp-bullets li {
  font-size: 0.95rem;
  color: var(--muted);
  padding-left: 1.4rem;
  position: relative;
}

.exp-bullets li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 0.55rem;
  height: 1.5px;
  background: var(--accent);
}

/* ─── Projects ────────────────────────────────────── */

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.4rem;
}

.project-card {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.75rem;
  transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.project-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 14px 28px -16px rgba(28, 25, 23, 0.25);
}

.project-badge {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}

.project-badge.award {
  color: var(--accent-ink);
}

.project-title {
  font-size: 1.12rem;
}

.project-desc {
  font-size: 0.92rem;
  flex: 1;
}

.project-footer {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.project-tags {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--faint);
}

.project-link {
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--accent-ink);
  white-space: nowrap;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

.project-link:hover {
  border-bottom-color: var(--accent-ink);
}

/* ─── Skills ──────────────────────────────────────── */

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0;
  border-top: 1px solid var(--line);
}

.skill-group {
  padding: 1.6rem 1.75rem 1.6rem 0;
  border-bottom: 1px solid var(--line);
}

.skill-group h3 {
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-ink);
  margin-bottom: 0.6rem;
}

.skill-group p {
  font-size: 0.93rem;
  color: var(--muted);
  line-height: 1.8;
}

/* ─── Education ───────────────────────────────────── */

.edu-list {
  display: flex;
  flex-direction: column;
}

.edu-entry {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 2.5rem;
  padding: 1.6rem 0;
  border-bottom: 1px solid var(--line);
}

.edu-entry:first-child {
  padding-top: 0;
}

.edu-year {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--accent-ink);
}

.edu-school {
  font-size: 0.92rem;
  margin-top: 0.15rem;
}

.edu-note {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--faint);
  margin-top: 0.4rem;
}

/* ─── Contact ─────────────────────────────────────── */

.contact-headline {
  font-size: clamp(1.9rem, 4.5vw, 2.9rem);
  line-height: 1.15;
  margin-bottom: 1rem;
  max-width: 28ch;
}

.contact-intro {
  font-size: 1.05rem;
  max-width: 36rem;
  margin-bottom: 2.4rem;
}

.contact-actions {
  display: flex;
  gap: 0.85rem;
  flex-wrap: wrap;
}

/* ─── Footer ──────────────────────────────────────── */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 2.25rem 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.site-footer p {
  font-size: 0.85rem;
  color: var(--faint);
}

.footer-mono {
  font-family: var(--mono);
  font-size: 0.75rem;
}

/* ─── Error page (404) ────────────────────────────── */

.error-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem 1.5rem;
  background-image: radial-gradient(var(--line-dark) 1px, transparent 1px);
  background-size: 28px 28px;
}

.error-card {
  max-width: 460px;
  width: 100%;
  text-align: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 3.5rem 2.5rem;
}

.error-code {
  font-family: var(--serif);
  font-size: clamp(3.5rem, 12vw, 5.5rem);
  font-weight: 500;
  line-height: 1;
  color: var(--accent-ink);
  margin-bottom: 0.85rem;
}

.error-title {
  font-family: var(--serif);
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 0.6rem;
}

.error-text {
  margin-bottom: 2rem;
}

/* ─── Motion ──────────────────────────────────────── */

.fade-in {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .fade-in { opacity: 1; transform: none; transition: none; }
  .dot { animation: none; }
}

/* ─── Responsive ──────────────────────────────────── */

@media (max-width: 900px) {
  .main-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    padding: 0.5rem 1.5rem 1.25rem;
    display: none;
  }

  .main-nav.open {
    display: flex;
  }

  .main-nav .nav-link {
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--line);
    font-size: 0.95rem;
  }

  .main-nav .nav-link::after {
    display: none;
  }

  .nav-toggle {
    display: flex;
  }

  .hero-inner {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .hero-figure {
    justify-self: start;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .exp-entry,
  .edu-entry {
    grid-template-columns: 1fr;
    gap: 0.6rem;
  }

  .exp-location {
    display: inline;
    margin-left: 0.6rem;
  }
}

@media (max-width: 640px) {
  section {
    padding: 4rem 0;
  }

  .hero {
    padding: 4rem 0;
  }

  .hero-caption {
    text-align: left;
  }

  .skill-group {
    padding-right: 0;
  }
}
