/* ============================================================
   Billy Joinville — Portfolio
   Single stylesheet, zero external conflicts.
   ============================================================ */

/* --- Tokens --- */
:root {
  --bg:       #ffffff;
  --fg:       #111111;
  --muted:    #6b7280;
  --dim:      #9ca3af;
  --border:   #e5e7eb;
  --surface:  #f8fafc;
  --max:      1100px;
  --pad:      clamp(20px, 4vw, 40px);
  --nav:      56px;
  --font:     'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* --- Reset --- */
*,
*::before,
*::after { box-sizing: border-box; margin: 0; padding: 0; }
html     { scroll-behavior: smooth; font-size: 16px; }
body     {
  font-family: var(--font);
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
  overflow-x: hidden;
}
img  { max-width: 100%; display: block; height: auto; }
a    { color: inherit; text-decoration: none; }
ul   { list-style: none; padding: 0; margin: 0; }
li   { margin: 0; padding: 0; }

/* --- Container --- */
.c {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--pad);
}

/* ============================================================
   Navigation
   ============================================================ */
.nav {
  position: fixed; inset: 0 0 auto 0;
  height: var(--nav);
  display: flex; align-items: center;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  z-index: 200;
}
.nav .c {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: 24px;
}
.nav-brand {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  flex-shrink: 0;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}
.nav-links a {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--muted);
  transition: color 0.15s;
}
.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--fg);
}
.nav-cta {
  flex-shrink: 0;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 8px 18px;
  border: 1.5px solid var(--fg);
  transition: background 0.15s, color 0.15s;
}
.nav-cta:hover { background: var(--fg); color: var(--bg); }
.nav-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none; border: none;
  cursor: pointer;
  width: 32px; height: 32px;
  padding: 4px;
  flex-shrink: 0;
}
.nav-burger span {
  display: block;
  height: 1.5px;
  background: var(--fg);
  transform-origin: center;
  transition: transform 0.22s ease, opacity 0.22s ease;
}
/* Burger → X when drawer is open */
.nav-burger.is-open span:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}
.nav-burger.is-open span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.nav-burger.is-open span:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

.nav-drawer {
  display: flex;
  position: fixed;
  inset: var(--nav) 0 0 0;
  background: var(--bg);
  z-index: 199;
  padding: 40px var(--pad) 48px;
  flex-direction: column;
  gap: 0;
  border-top: 1px solid var(--border);
  /* slide from top */
  transform: translateY(-16px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.25s ease, opacity 0.22s ease;
}
.nav-drawer.open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}
.nav-drawer .nav-links {
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  width: 100%;
}
.nav-drawer .nav-links a {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--fg);
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
  width: 100%;
  display: block;
  letter-spacing: -0.02em;
  transition: opacity 0.15s;
}
.nav-drawer .nav-links a:hover { opacity: 0.5; }
.nav-drawer .nav-links a:first-child { border-top: 1px solid var(--border); }
.nav-drawer .nav-cta {
  margin-top: 32px;
  align-self: flex-start;
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-block;
  font-family: var(--font);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 12px 24px;
  border: 1.5px solid var(--fg);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, opacity 0.15s;
  white-space: nowrap;
}
.btn-fill    { background: var(--fg); color: var(--bg); }
.btn-fill:hover  { opacity: 0.78; }
.btn-outline { background: transparent; color: var(--fg); }
.btn-outline:hover { background: var(--surface); }

/* ============================================================
   Hero
   ============================================================ */
.hero {
  padding: calc(var(--nav) + 72px) 0 72px;
  border-bottom: 1px solid var(--border);
}
.hero .c {
  display: grid;
  grid-template-columns: 1fr 290px;
  gap: 56px;
  align-items: center;
}
.hero-kicker {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 22px;
}
.hero-name {
  font-size: clamp(3rem, 5.5vw, 5rem);
  font-weight: 800;
  line-height: 0.93;
  letter-spacing: -0.045em;
  margin-bottom: 24px;
}
.hero-bio {
  font-size: 15.5px;
  line-height: 1.82;
  color: var(--muted);
  max-width: 460px;
  margin-bottom: 32px;
}
.hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 48px;
}
.hero-stats {
  display: flex;
  gap: 32px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}
.stat-val {
  display: block;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 3px;
}
.stat-lbl {
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.hero-img-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.hero-img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: center 10%;
  border: 1px solid var(--border);
}
.hero-img-caption {
  font-size: 12px;
  line-height: 1.65;
  color: var(--muted);
  padding: 10px 12px;
  border: 1px solid var(--border);
  background: var(--surface);
}

/* ============================================================
   Sections
   ============================================================ */
.section {
  padding: 92px 0;
  border-bottom: 1px solid var(--border);
}
.section:last-of-type { border-bottom: none; }

.sec-tag {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 8px;
}
.sec-title {
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 44px;
}

/* ============================================================
   3-column panels
   ============================================================ */
.panels {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-left: 1px solid var(--border);
  border-top: 1px solid var(--border);
}
.panel {
  padding: 28px 24px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.panel h3 { font-size: 14px; font-weight: 700; margin-bottom: 10px; }
.panel p  { font-size: 13.5px; line-height: 1.78; color: var(--muted); margin: 0; }

/* ============================================================
   Work / Project cards
   ============================================================ */
.work-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}
.work-card { display: flex; flex-direction: column; }
.work-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid var(--border);
  margin-bottom: 16px;
}
.work-card h3    { font-size: 14px; font-weight: 700; margin-bottom: 8px; }
.work-card p     { font-size: 13.5px; line-height: 1.78; color: var(--muted); flex: 1; margin-bottom: 16px; }

/* ============================================================
   Experience list
   ============================================================ */
.exp-list   { border-top: 1px solid var(--border); }
.exp-row    {
  display: grid;
  grid-template-columns: 1fr 180px;
  gap: 20px;
  padding: 28px 0;
  border-bottom: 1px solid var(--border);
  align-items: start;
}
.exp-role   { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.exp-org    { font-size: 13.5px; color: var(--muted); margin-bottom: 14px; }
.exp-points {
  padding-left: 1.1em;
  list-style: disc;
}
.exp-points li {
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--muted);
  margin-bottom: 5px;
  list-style: disc;
}
.exp-right  { text-align: right; }
.exp-date   { font-size: 12px; font-weight: 500; color: var(--dim); display: block; }
.exp-loc    { font-size: 11.5px; color: var(--dim); display: block; margin-top: 3px; }

/* Tags */
.tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 14px; }
.tag  {
  font-size: 9.5px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: 3px 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
}

/* ============================================================
   Skills
   ============================================================ */
.skills {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-left: 1px solid var(--border);
  border-top: 1px solid var(--border);
}
.skill-col {
  padding: 24px 22px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.skill-col h4 {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 16px;
}
.skill-col ul { list-style: none; padding: 0; }
.skill-col li {
  font-size: 13.5px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
  color: var(--fg);
  margin: 0;
}
.skill-col li:last-child { border-bottom: none; }

/* ============================================================
   Education block
   ============================================================ */
.edu-block {
  border: 1px solid var(--border);
  padding: 36px 32px;
}
.edu-school { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.edu-degree { font-size: 13.5px; color: var(--muted); margin-bottom: 6px; }
.edu-honors { font-size: 13px; color: var(--dim); margin-bottom: 28px; }
.edu-grid   {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.edu-lbl {
  font-size: 9.5px; font-weight: 700;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--dim); margin-bottom: 8px;
}
.edu-val { font-size: 13.5px; line-height: 1.7; color: var(--muted); }

/* ============================================================
   Activities / Leadership
   ============================================================ */
.act-list { border-top: 1px solid var(--border); }
.act-row  {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.act-role { font-size: 14px; font-weight: 600; }
.act-org  { font-size: 13px; color: var(--muted); flex-shrink: 0; }

/* ============================================================
   Memorial
   ============================================================ */
.memorial {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 40px;
}
.memorial h3 { font-size: 15px; font-weight: 700; margin-bottom: 14px; }
.memorial p  { font-size: 14px; line-height: 1.82; color: var(--muted); margin-bottom: 24px; }

/* ============================================================
   Page header (inner pages)
   ============================================================ */
.page-head {
  padding: calc(var(--nav) + 60px) 0 60px;
  border-bottom: 1px solid var(--border);
}
.page-kicker {
  font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 16px;
}
.page-title {
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.05;
  margin-bottom: 16px;
}
.page-desc {
  font-size: 15px;
  line-height: 1.82;
  color: var(--muted);
  max-width: 500px;
}
.page-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 28px;
}

/* ============================================================
   Resume page
   ============================================================ */
.resume-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border: 1px solid var(--border);
  background: var(--surface);
  margin-bottom: 20px;
  gap: 16px;
  flex-wrap: wrap;
}
.resume-bar p { font-size: 13.5px; color: var(--muted); }
.resume-embed {
  width: 100%;
  height: 880px;
  display: block;
  border: 1px solid var(--border);
  background: var(--surface);
}

/* ============================================================
   Contact cards
   ============================================================ */
.contact-grid {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border);
}
.contact-card {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
  transition: opacity 0.15s;
}
.contact-card:hover { opacity: 0.65; }
.contact-icon {
  width: 40px; height: 40px;
  border: 1px solid var(--border);
  overflow: hidden;
  flex-shrink: 0;
}
.contact-icon img { width: 100%; height: 100%; object-fit: cover; }
.contact-text { flex: 1; min-width: 0; }
.contact-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 2px;
}
.contact-val {
  font-size: 15px;
  font-weight: 500;
  color: var(--fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.contact-arrow {
  font-size: 18px;
  color: var(--dim);
  flex-shrink: 0;
}

/* ============================================================
   Availability block
   ============================================================ */
.avail-block {
  max-width: 640px;
}

/* ============================================================
   Footer
   ============================================================ */
.footer {
  padding: 36px 0 48px;
  border-top: 1px solid var(--border);
}
.footer .c {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.footer-copy { font-size: 13px; color: var(--muted); }
.footer-links { display: flex; gap: 20px; }
.footer-links a { font-size: 13px; color: var(--muted); }
.footer-links a:hover { color: var(--fg); }

/* ============================================================
   Scroll to top
   ============================================================ */
#top-btn {
  position: fixed;
  bottom: 24px; right: 24px;
  width: 40px; height: 40px;
  background: var(--fg); color: var(--bg);
  display: grid; place-items: center;
  font-size: 14px; text-decoration: none;
  border: 1px solid var(--fg);
  opacity: 0; visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
  z-index: 300;
}
#top-btn.show { opacity: 1; visibility: visible; }

/* ============================================================
   Responsive — Tablet (720 – 960px)
   ============================================================ */
@media (max-width: 960px) {
  .hero .c {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .hero-img-wrap {
    flex-direction: row;
    align-items: flex-start;
    gap: 16px;
  }
  .hero-img {
    width: 200px;
    min-width: 200px;
    aspect-ratio: 3 / 4;
  }
  .hero-img-caption { flex: 1; }

  .panels {
    grid-template-columns: 1fr;
  }

  .work-grid {
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }

  .skills {
    grid-template-columns: 1fr 1fr;
  }
  .skill-col:nth-child(2n) { border-right: none; }

  .edu-grid {
    grid-template-columns: 1fr 1fr;
  }

  .exp-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .exp-right {
    text-align: left;
    display: flex; gap: 8px; align-items: center;
    flex-wrap: wrap;
  }
  .exp-loc::before { content: "·\00a0"; }

  .section { padding: 72px 0; }
  .sec-title { margin-bottom: 36px; }
}

/* ============================================================
   Responsive — Mobile (< 720px)
   ============================================================ */
@media (max-width: 720px) {
  .nav-links,
  .nav-cta { display: none; }
  .nav-burger { display: flex; }

  .hero { padding-top: calc(var(--nav) + 48px); }
  .hero-img-wrap { flex-direction: column; }
  .hero-img { width: 160px; min-width: auto; }
  .hero-bio { font-size: 14.5px; }
  .hero-stats { gap: 20px; }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .btn { text-align: center; display: block; }

  .work-grid { grid-template-columns: 1fr; }

  .skills { grid-template-columns: 1fr; }
  .skill-col { border-right: none; }

  .edu-grid { grid-template-columns: 1fr; }

  .act-row { flex-direction: column; gap: 2px; }

  .section { padding: 52px 0; }
  .sec-title { font-size: 1.7rem; }

  .resume-embed { height: 520px; }

  .footer .c { flex-direction: column; align-items: flex-start; }
}

/* ============================================================
   Reduced motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
