/* ============================================================
   Heet Mehta portfolio
   Palette: cream #F7F2E9 · card #FFFBF2 · ink #26251F
            blue #3F5E9E · blue bright #5B7FC7 · wash #EAEFF9
   Type: Inter (all text) · IBM Plex Mono (dates, tags, labels)
   ============================================================ */

:root {
  --paper: #F7F2E9;
  --card: #FFFBF2;
  --ink: #26251F;
  --muted: #6B675C;
  --blue: #3F5E9E;
  --blue-bright: #5B7FC7;
  --blue-deep: #2F477A;
  --wash: #EAEFF9;
  --line: #E3DCCB;
  --amber: #E4A24C;
  --radius: 10px;
  --font-body: "Inter", -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
}

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

img, svg, video { max-width: 100%; }

/* justified paragraph text sitewide */
.hero-lede, .about-text p, .tile-body p,
.resume-card p, .contact-lede { text-align: justify; }

body {
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

.tile-title, .tile-org, .tile-body p, .tile-body li { overflow-wrap: break-word; }
.tile-body .mono { overflow-wrap: anywhere; }
main { flex: 1; }

.container { max-width: 820px; margin: 0 auto; padding: 0 24px; }
.mono { font-family: var(--font-mono); font-size: 0.82em; letter-spacing: 0.01em; }
.dim { color: var(--muted); }

::selection { background: var(--blue); color: #fff; }

/* ---------- header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease;
}
.site-header.scrolled { border-bottom-color: var(--line); }

.nav {
  max-width: 820px; margin: 0 auto; padding: 15px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 1.02rem; letter-spacing: -0.01em;
  color: var(--ink); text-decoration: none; white-space: nowrap;
}
.brand-bug rect { fill: var(--blue); transition: fill 0.25s ease; }
.brand-bug .hole { fill: var(--paper); }
.brand-bug .dim { fill: var(--blue-bright); }
.brand:hover .brand-bug rect { fill: var(--blue-bright); }
.brand:hover .brand-bug .hole { fill: var(--paper); }

.nav-links { display: flex; gap: 22px; list-style: none; }
.nav-links a {
  color: var(--muted); text-decoration: none; font-size: 0.88rem; font-weight: 500;
  position: relative; padding: 4px 0; transition: color 0.2s ease;
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: 0;
  width: 100%; height: 2px; background: var(--blue-bright);
  transform: scaleX(0); transform-origin: right; transition: transform 0.28s ease;
}
.nav-links a:hover, .nav-links a.active { color: var(--ink); }
.nav-links a:hover::after, .nav-links a.active::after {
  transform: scaleX(1); transform-origin: left;
}

.nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav-toggle span {
  display: block; width: 22px; height: 2px; background: var(--ink);
  margin: 5px 0; transition: transform 0.25s ease, opacity 0.25s ease;
}

/* ---------- panels (tab layout) ---------- */
.panel { display: none; }
.panel.active { display: block; animation: panelIn 0.45s cubic-bezier(0.22, 0.61, 0.36, 1); }
@keyframes panelIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

.section { padding: 72px 0 96px; }

.section-title {
  font-weight: 700; letter-spacing: -0.02em;
  font-size: clamp(1.35rem, 3vw, 1.65rem); margin-bottom: 34px;
  display: flex; align-items: center; gap: 13px;
}
.tick {
  width: 11px; height: 11px; background: var(--blue);
  display: inline-block; flex: none;
  clip-path: polygon(0 0, 66% 0, 66% 33%, 100% 33%, 100% 100%, 33% 100%, 33% 66%, 0 66%);
}

/* ---------- hero ---------- */
.hero { padding-top: 88px; }
.eyebrow {
  font-family: var(--font-mono); font-size: 0.76rem; text-transform: uppercase;
  letter-spacing: 0.14em; color: var(--blue); margin-bottom: 16px;
}
.hero-title {
  font-weight: 700; font-size: clamp(2.2rem, 5.5vw, 3.3rem);
  line-height: 1.08; letter-spacing: -0.025em; margin-bottom: 20px;
}
.hero-lede {
  max-width: 540px; font-size: 1.06rem; color: var(--muted); margin-bottom: 32px;
}
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px; border-radius: var(--radius);
  font-weight: 600; font-size: 0.92rem; text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease,
              color 0.18s ease, border-color 0.18s ease;
}
.btn svg { width: 16px; height: 16px; flex: none; }
.btn-primary {
  background: var(--blue); color: #fff;
  box-shadow: 0 1px 0 var(--blue-deep);
}
.btn-primary:hover {
  background: var(--blue-bright); transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(63, 94, 158, 0.32);
}
.btn-ghost { color: var(--blue); border: 1.5px solid var(--line); background: transparent; }
.btn-ghost:hover {
  border-color: var(--blue-bright); color: var(--blue-deep);
  background: var(--wash); transform: translateY(-2px);
}

/* ---------- pug scene ---------- */
.pug-scene { margin-top: 48px; }
#pugCanvas {
  display: block; width: 100%; height: 130px;
  border-bottom: 1px solid var(--line);
}

/* ---------- about ---------- */
.about-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 44px; align-items: start; }
.about-text p { margin-bottom: 16px; font-size: 0.98rem; }
.about-photo img {
  width: 100%; border-radius: var(--radius); display: block;
  box-shadow: 0 10px 28px rgba(38, 37, 31, 0.14);
}
.edu-cards { display: grid; gap: 12px; margin-top: 26px; }
.edu-card {
  display: flex; gap: 15px; align-items: center;
  padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--card); transition: border-color 0.2s ease, transform 0.2s ease;
}
.edu-card:hover { border-color: var(--blue-bright); transform: translateX(4px); }
.edu-card img { width: 42px; height: 42px; object-fit: contain; flex: none; }
.edu-card h3 { font-size: 0.95rem; font-weight: 600; }
.edu-card p { font-size: 0.86rem; color: var(--muted); }

/* ---------- resume ---------- */
.resume-card {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 28px 30px; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); flex-wrap: wrap;
}
.resume-card h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: 6px; }
.resume-card p { color: var(--muted); max-width: 46ch; font-size: 0.94rem; }

/* ---------- expandable tiles ---------- */
.tile-list { display: grid; gap: 12px; }
.tile {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  transition: border-color 0.22s ease, box-shadow 0.22s ease;
  overflow: hidden;
}
.tile:hover { border-color: var(--blue-bright); }
.tile[open] {
  border-color: var(--blue-bright);
  box-shadow: 0 10px 26px rgba(63, 94, 158, 0.13);
}
.tile summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; gap: 16px;
  padding: 18px 20px;
}
.tile summary::-webkit-details-marker { display: none; }
.tile summary:focus-visible { outline: 2px solid var(--blue-bright); outline-offset: -2px; border-radius: var(--radius); }

.tile-logo {
  width: 44px; height: 44px; flex: none; border-radius: 8px;
  border: 1px solid var(--line); background: #fff;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.tile-logo img { width: 76%; height: 76%; object-fit: contain; }
.tile-logo-letter {
  width: 44px; height: 44px; flex: none; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; font-weight: 500; color: var(--blue); background: var(--wash);
}
.tile-emoji { font-size: 1.4rem; border-color: transparent; background: var(--wash); }

.tile-head { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.tile-title { font-weight: 600; font-size: 0.99rem; letter-spacing: -0.01em; }
.tile-org { color: var(--blue); font-weight: 500; font-size: 0.86rem; }
.tile-date { flex: none; }

.chev {
  flex: none; width: 9px; height: 9px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(45deg); margin-top: -4px;
  transition: transform 0.28s ease, border-color 0.2s ease;
}
.tile[open] .chev { transform: rotate(225deg); margin-top: 4px; }
.tile summary:hover .chev { border-color: var(--blue); }

.tile-body { padding: 0 20px 20px 80px; }
.tile-body p { color: var(--ink); font-size: 0.93rem; margin-bottom: 12px; }
.tile-body ul:not(.tags) { padding-left: 18px; color: var(--ink); font-size: 0.93rem; display: grid; gap: 8px; margin-bottom: 12px; }
.tile-body ul:not(.tags) li::marker { color: var(--blue-bright); }
.tile-link {
  display: inline-block; color: var(--blue); font-weight: 600; font-size: 0.88rem;
  text-decoration: none; border-bottom: 1.5px solid transparent;
  transition: border-color 0.2s ease;
}
.tile-link:hover { border-bottom-color: var(--blue-bright); }

.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.tags li {
  font-size: 0.72rem; padding: 3px 10px; border-radius: 99px;
  background: var(--wash); color: var(--blue-deep);
}

/* hackathon badges inside tile summary */
.hack-badges { display: flex; gap: 8px; flex: none; }
.badge {
  padding: 4px 12px; border-radius: 99px; font-size: 0.74rem;
  border: 1px solid var(--line); color: var(--muted); background: var(--paper);
}
.badge-win { background: var(--blue); border-color: var(--blue); color: #fff; }

/* ---------- contact ---------- */
.contact-lede { color: var(--muted); font-size: 1.02rem; margin-bottom: 10px; max-width: 48ch; }
.contact-stage { position: relative; padding-top: 96px; }
#catCanvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 1;
}
.contact-links { display: flex; gap: 14px; flex-wrap: wrap; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 22px 0; font-size: 0.82rem; }

/* ---------- reveal ---------- */
.reveal {
  opacity: 0; transform: translateY(18px);
  transition: opacity 0.6s cubic-bezier(0.22, 0.61, 0.36, 1),
              transform 0.6s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.reveal.in { opacity: 1; transform: none; }

/* ---------- responsive ---------- */
@media (max-width: 720px) {
  .about-grid { grid-template-columns: 1fr; }
  .about-photo { order: -1; max-width: 320px; }
  .hero { padding-top: 56px; }
  .section { padding: 52px 0 72px; }
  #pugCanvas { height: 104px; }

  .container { padding: 0 18px; }
  .tile summary { flex-wrap: wrap; gap: 10px 12px; padding: 14px; }
  .tile-logo, .tile-logo-letter { width: 40px; height: 40px; }
  .tile-date { width: 100%; order: 4; padding-left: 52px; margin-top: -4px; }
  .tile:not(:has(.tile-logo)) .tile-date { padding-left: 0; }
  .tile-body { padding: 0 14px 16px 14px; }
  .hack-badges { width: 100%; order: 4; flex-wrap: wrap; }
  .contact-links .btn { flex: 1 1 auto; justify-content: center; min-width: 130px; }

  .nav-toggle { display: block; }
  .nav-links {
    position: fixed; inset: 57px 0 auto 0; flex-direction: column;
    background: var(--paper); border-bottom: 1px solid var(--line);
    padding: 18px 24px 26px; gap: 16px;
    transform: translateY(-130%); transition: transform 0.3s ease; z-index: 40;
  }
  .nav-links.open { transform: none; }
  .nav-toggle[aria-expanded="true"] span:first-child { transform: translateY(3.5px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:last-child { transform: translateY(-3.5px) rotate(-45deg); }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .panel.active { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
