/* ===========================================================
   Krunal Jethva - portfolio
   Warm, confident light theme. Plain CSS, no build step.
   =========================================================== */

/* ---------- Fonts (self-hosted Apercu) ---------- */
@font-face {
  font-family: 'Apercu';
  src: url('../fonts/apercu/Apercu-Regular.woff2') format('woff2'),
       url('../fonts/apercu/Apercu-Regular.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Apercu';
  src: url('../fonts/apercu/Apercu-Italic.woff2') format('woff2'),
       url('../fonts/apercu/Apercu-Italic.woff') format('woff');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'Apercu';
  src: url('../fonts/apercu/Apercu-Medium.woff2') format('woff2'),
       url('../fonts/apercu/Apercu-Medium.woff') format('woff');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Apercu';
  src: url('../fonts/apercu/Apercu-Bold.woff2') format('woff2'),
       url('../fonts/apercu/Apercu-Bold.woff') format('woff');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ---------- Design tokens ---------- */
:root {
  --bg: hsl(210deg 25% 98%);
  --bg-soft: hsl(220deg 35% 95%);
  --surface: #ffffff;
  --ink: hsl(222deg 22% 8%);
  --ink-soft: hsl(222deg 14% 38%);
  --ink-faint: hsl(222deg 12% 58%);
  --border: hsl(220deg 26% 90%);

  --violet: hsl(245deg 100% 60%);   /* primary - indigo */
  --primary: hsl(245deg 100% 67%);  /* solid fill (buttons, bands) */
  --pink: hsl(333deg 90% 48%);      /* secondary accent, used sparingly */
  --teal: hsl(170deg 80% 42%);

  --accent: var(--violet);
  --accent-ink: hsl(245deg 75% 50%);

  --radius: 16px;
  --radius-lg: 24px;
  --shadow-sm: 0 1px 2px rgba(33, 32, 43, 0.06), 0 2px 8px rgba(33, 32, 43, 0.05);
  --shadow-md: 0 8px 28px hsl(245deg 100% 60% / 0.16), 0 2px 8px hsl(222deg 40% 20% / 0.06);
  --maxw: 1080px;
  --font: 'Apercu', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

/* ---------- Reset-ish ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  font-size: 18px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.15; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 0.4em; }
h1 { font-size: clamp(2.4rem, 6vw, 4rem); }
h2 { font-size: clamp(1.7rem, 4vw, 2.4rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1.1em; }
::selection { background: var(--violet); color: #fff; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
/* solid accent for highlighted words (class name kept for markup stability) */
.gradient-text { color: var(--violet); }
.eyebrow {
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.8rem;
  color: var(--accent-ink);
  margin: 0 0 0.6em;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-weight: 500;
  font-size: 1rem;
  padding: 0.7em 1.3em;
  border-radius: 999px;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  text-decoration: none;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn-primary { background: var(--primary); color: #fff; box-shadow: var(--shadow-md); }
.btn-primary:hover { background: hsl(245deg 100% 60%); }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--border); box-shadow: var(--shadow-sm); }
.btn-ghost:hover { border-color: var(--violet); color: var(--accent-ink); }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: hsl(210deg 40% 99% / 0.78);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
/* Brand: first name + hand-drawn monogram + last name */
.brand { font-weight: 700; font-size: 1.2rem; color: var(--ink); display: inline-flex; align-items: baseline; gap: 0.16em; letter-spacing: -0.01em; }
.brand:hover { text-decoration: none; }
.brand-mono {
  display: inline-flex;
  align-items: center;
  color: var(--primary);
  margin: 0 0.1em;
}
.brand-mono svg {
  height: 1.25em;
  width: auto;
  display: block;
  stroke: currentColor;
  fill: none;
  overflow: visible;
  transform: translateY(0.05em) rotate(-4deg);
}
.brand-last { color: var(--ink); }

/* Primary nav as a list */
.primary-nav ul { list-style: none; display: flex; align-items: center; gap: 4px; margin: 0; padding: 0; }
.primary-nav a {
  color: var(--ink-soft);
  font-weight: 500;
  padding: 0.4em 0.8em;
  border-radius: 999px;
}
.primary-nav a:hover { color: var(--ink); background: var(--bg-soft); text-decoration: none; }
.primary-nav a.active { color: var(--accent-ink); }

/* Right-side actions cluster */
.header-actions { display: flex; align-items: center; gap: 10px; }
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border-radius: 50%;
  color: var(--ink-soft);
  border: 1px solid transparent;
}
.icon-btn:hover { color: var(--accent-ink); background: var(--bg-soft); text-decoration: none; }
.nav-toggle { display: none; background: none; border: 0; font-size: 1.6rem; line-height: 1; cursor: pointer; color: var(--ink); padding: 4px 8px; }

/* ---------- Sections ---------- */
section { padding: 72px 0; }
.section-head { max-width: 640px; margin-bottom: 40px; }
.section-head p { color: var(--ink-soft); font-size: 1.05rem; }

/* ---------- Hero ---------- */
.hero { padding-top: 88px; padding-bottom: 40px; }
.hero-grid {
  display: grid;
  grid-template-columns: 1.4fr 0.9fr;
  gap: 48px;
  align-items: center;
}
.hero .wave { display: inline-block; transform-origin: 70% 70%; animation: wave 2.4s ease-in-out 1s 2; }
@keyframes wave { 0%,60%,100%{transform:rotate(0)} 10%{transform:rotate(16deg)} 20%{transform:rotate(-8deg)} 30%{transform:rotate(16deg)} 40%{transform:rotate(-4deg)} 50%{transform:rotate(10deg)} }
.hero h1 { margin-bottom: 0.2em; }
.hero .lead { font-size: 1.25rem; color: var(--ink-soft); max-width: 38ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero-portrait {
  position: relative;
  justify-self: center;
}
.hero-portrait img {
  width: 280px;
  height: 280px;
  object-fit: cover;
  border-radius: 28px;
  box-shadow: var(--shadow-md);
  border: 4px solid #fff;
}
.hero-portrait::before {
  content: '';
  position: absolute;
  inset: -14px -14px 14px 14px;
  border-radius: 32px;
  background: var(--primary);
  z-index: -1;
}

/* ---------- Stat strip ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.stat:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.stat-num {
  position: relative;
  display: inline-block;
  padding-bottom: 12px;
  font-size: 2.4rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--violet);
  font-variant-numeric: tabular-nums;
}
/* rounded accent underline that grows in when the tile reveals */
.stat-num::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 4px;
  border-radius: 999px;
  background: var(--primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.6s ease 0.15s;
}
.stat.in .stat-num::after { transform: scaleX(1); }
.stat .label { color: var(--ink-soft); font-size: 0.95rem; margin-top: 10px; }

/* ---------- Cards grid ---------- */
.grid { display: grid; gap: 22px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.card .ico { font-size: 1.8rem; margin-bottom: 12px; }
.card h3 { margin-bottom: 0.35em; }
.card p { color: var(--ink-soft); font-size: 0.98rem; margin-bottom: 0; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.tag {
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.3em 0.75em;
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--accent-ink);
  border: 1px solid var(--border);
}

/* ---------- Bento grid (Josh Comeau-style, asymmetric tiles) ---------- */
.bento {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 1fr;
  gap: 16px;
  grid-template-areas:
    "backend backend frontend cloud"
    "backend backend frontend arch"
    "auth    mentor  mentor   arch";
}
.b-backend  { grid-area: backend; }
.b-frontend { grid-area: frontend; }
.b-cloud    { grid-area: cloud; }
.b-arch     { grid-area: arch; }
.b-auth     { grid-area: auth; }
.b-mentor   { grid-area: mentor; }

.bento-item {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 6px;
  min-height: 150px;
  padding: 24px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.bento-item:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.bento-item h3 { margin: 0; }
.bento-item p { color: var(--ink-soft); font-size: 0.96rem; margin: 0; }
.bento-item .ico { font-size: 1.7rem; line-height: 1; }
/* oversized faint glyph for texture */
.bento-item .watermark {
  position: absolute;
  right: -8px; bottom: -22px;
  font-size: 6rem;
  line-height: 1;
  opacity: 0.07;
  pointer-events: none;
  user-select: none;
}
.bento-item .tags { margin-top: 10px; }
/* illustration that fills the upper area of a tile */
.bento-art {
  width: 100%;
  flex: 1 1 auto;
  min-height: 78px;
  max-height: 180px;
  margin-bottom: 14px;
}

/* bold feature tile */
.bento-feature {
  background: var(--primary);
  border-color: transparent;
  color: #fff;
}
.bento-feature h3, .bento-feature .eyebrow { color: #fff; }
.bento-feature p { color: rgba(255, 255, 255, 0.9); }
.bento-feature .eyebrow { opacity: 0.85; }
.bento-feature .tag { background: rgba(255, 255, 255, 0.16); color: #fff; border-color: rgba(255, 255, 255, 0.25); }
.bento-feature .watermark { opacity: 0.16; }

@media (max-width: 900px) {
  .bento {
    grid-template-columns: repeat(2, 1fr);
    grid-template-areas:
      "backend backend"
      "frontend cloud"
      "arch     auth"
      "mentor   mentor";
  }
}
@media (max-width: 560px) {
  .bento { grid-template-columns: 1fr; grid-template-areas: none; }
  .bento-item { grid-area: auto !important; min-height: 0; }
}

/* ---------- Project grid (bento-style with illustrated banners) ---------- */
.proj-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
  grid-auto-flow: dense;
}
.proj-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.proj-grid .span-2 { grid-column: span 2; }
/* illustrated banner that bleeds to the card edges */
.proj-art {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 150px;
  margin: -28px -28px 20px;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
}
.proj-art svg { width: auto; height: 100%; max-width: 100%; padding: 16px 0; }

@media (max-width: 980px) {
  .proj-grid.cols-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .proj-grid, .proj-grid.cols-3 { grid-template-columns: 1fr; }
  .proj-grid .span-2 { grid-column: auto; }
}

/* ---------- Timeline ---------- */
.timeline { position: relative; margin-left: 8px; }
.timeline::before {
  content: '';
  position: absolute;
  left: 6px; top: 6px; bottom: 6px;
  width: 2px;
  background: var(--border);
}
.t-item { position: relative; padding: 0 0 36px 36px; }
.t-item:last-child { padding-bottom: 0; }
.t-item::before {
  content: '';
  position: absolute;
  left: 0; top: 7px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 4px var(--bg);
}
.t-item .t-role { font-weight: 700; font-size: 1.15rem; }
.t-item .t-meta { color: var(--ink-faint); font-size: 0.9rem; margin-bottom: 0.5em; }
.t-item .t-meta a { color: var(--accent-ink); }
.t-item ul { margin: 0; padding-left: 1.1em; color: var(--ink-soft); }
.t-item li { margin-bottom: 0.4em; }

/* ---------- Prose (about) ---------- */
.prose { max-width: 680px; }
.prose p { color: var(--ink-soft); font-size: 1.08rem; }
.prose strong { color: var(--ink); font-weight: 500; }
.prose .accent { color: var(--accent-ink); font-weight: 500; }

/* ---------- CTA band ---------- */
.band {
  background: var(--primary);
  border-radius: var(--radius-lg);
  padding: 48px;
  color: #fff;
  text-align: center;
  box-shadow: var(--shadow-md);
}
.band h2 { color: #fff; }
.band p { color: rgba(255,255,255,0.9); max-width: 46ch; margin: 0 auto 1.4em; }
.band .btn-ghost { background: #fff; border-color: #fff; color: var(--accent-ink); }

/* ---------- Footer ---------- */
.site-footer {
  position: relative;
  margin-top: 24px;
  padding: 56px 0;
  background: var(--bg-soft);
  border-top: 1px solid var(--border);
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 28px 48px;
  justify-content: space-between;
  align-items: flex-start;
}
.footer-brand .brand { font-size: 1.1rem; }
.footer-tagline { margin: 3px 0 0; color: var(--ink-soft); font-size: 0.92rem; }
.footer-col-title { font-size: 0.78rem; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); margin: 0 0 10px; }
.footer-nav { display: flex; flex-direction: column; gap: 8px; }
.footer-nav a, .socials a { color: var(--ink-soft); font-weight: 500; }
.footer-nav a:hover, .socials a:hover { color: var(--accent-ink); }
.socials { display: flex; flex-direction: column; gap: 8px; }
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  justify-content: space-between;
  align-items: center;
  margin-top: 36px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}
.copyright { color: var(--ink-faint); font-size: 0.9rem; }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero .wave { animation: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; gap: 32px; }
  .hero-portrait { order: -1; }
  .hero-portrait img { width: 200px; height: 200px; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  body { font-size: 17px; }
  section { padding: 56px 0; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .primary-nav {
    position: absolute;
    top: 68px; left: 0; right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 8px 24px 16px;
    display: none;
  }
  .primary-nav.open { display: block; }
  .primary-nav ul { flex-direction: column; align-items: stretch; gap: 2px; }
  .primary-nav a { padding: 0.7em 0.6em; }
  .nav-toggle { display: block; }
  /* keep only the hamburger in the header on mobile */
  .header-actions .icon-btn,
  .header-actions .btn { display: none; }
  .band { padding: 32px 22px; }
}
