/* =========================================================
   JP Peng — index.css
   Updates in this version:
   - Featured section renamed to "Featured Analytics" (HTML change)
   - New "Quantitative Portfolio" section uses same project card styles
   - Adds project meta + bullets styling (used by portfolio cards)
   ========================================================= */

/* Fonts (local) */
@font-face {
  font-family: "Hk Grotesk";
  font-style: normal;
  font-weight: 400;
  src: url("./fonts/HKGrotesk-Regular.woff") format("woff");
}
@font-face {
  font-family: "Jost";
  font-style: normal;
  font-weight: 400;
  src: url("./fonts/Jost-Regular.ttf") format("truetype");
}

:root{
  --bg-0:#05070d;
  --bg-1:#070b12;
  --bg-2:#0b111c;

  --ink-0:rgba(255,255,255,.98);
  --ink-1:rgba(255,255,255,.86);
  --ink-2:rgba(255,255,255,.68);
  --ink-3:rgba(255,255,255,.50);

  --brand:#2ee9d3;
  --brand-2:#26b9ff;

  --line:rgba(255,255,255,.10);
  --line-2:rgba(255,255,255,.14);

  --card:rgba(12, 18, 33, .55);

  --shadow:0 20px 60px rgba(0,0,0,.55);
  --shadow-soft:0 12px 30px rgba(0,0,0,.40);

  --radius-xl:24px;
  --radius-lg:16px;

  --max:1180px;
  --pad-x:28px;

  --h2:clamp(26px,3.0vw,42px);
  --h3:clamp(18px,2.1vw,26px);
  --body:clamp(14px,1.2vw,18px);

  --sans:"Hk Grotesk",system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  --display:"Jost","Hk Grotesk",system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;

  --focus:0 0 0 3px rgba(46,233,211,.30);
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
html{ scroll-behavior:smooth; }

body{
  margin:0;
  font-family:var(--sans);
  font-size:var(--body);
  line-height:1.65;
  color:var(--ink-1);
  background:
    radial-gradient(900px 500px at 18% 12%, rgba(46,233,211,.10), transparent 55%),
    radial-gradient(900px 500px at 82% 0%, rgba(38,185,255,.10), transparent 55%),
    radial-gradient(1100px 800px at 50% 60%, rgba(9,14,26,.70), transparent 65%),
    linear-gradient(180deg, var(--bg-0), var(--bg-1) 40%, var(--bg-0));
  overflow-x:hidden;
}

img{ max-width:100%; display:block; height:auto; }
a{ color:inherit; text-decoration:none; }
a:hover{ color:var(--ink-0); }

:focus{ outline:none; }
body.user-is-tabbing a:focus,
body.user-is-tabbing button:focus{
  box-shadow:var(--focus);
  border-radius:10px;
}

.row{
  width:min(var(--max), calc(100% - 2*var(--pad-x)));
  margin:0 auto;
}

.section{
  padding:54px 0;
  border-top:1px solid var(--line);
}
@media (max-width:800px){
  .section{ padding:44px 0; }
}

/* Skip link */
.skip-link{
  position:absolute;
  left:-999px;
  top:10px;
  background:var(--bg-2);
  color:var(--ink-0);
  padding:10px 12px;
  border:1px solid var(--line-2);
  border-radius:10px;
  z-index:999;
}
.skip-link:focus{ left:12px; }

/* Card */
.card{
  border:1px solid var(--line);
  border-radius:var(--radius-xl);
  box-shadow:var(--shadow-soft);
  background:var(--card);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.card--glass{
  background: linear-gradient(180deg, rgba(12,18,33,.70), rgba(12,18,33,.42));
}

/* Buttons */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:11px 18px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.08);
  font-family:var(--display);
  letter-spacing:.2px;
  cursor:pointer;
  transition: transform .15s ease, filter .15s ease;
  white-space: nowrap;
}
.btn--primary{
  color:#061016;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 14px 34px rgba(38,185,255,.16);
}
.btn--primary:hover{ filter: brightness(1.05); transform: translateY(-1px); }
.btn--primary:active{ transform: translateY(0); }

.btn--ghost{
  color: var(--ink-0);
  background: rgba(255,255,255,.02);
  border-color: rgba(255,255,255,.14);
}
.btn--ghost:hover{ transform: translateY(-1px); }
.btn--ghost:active{ transform: translateY(0); }

.btn--small{ padding:9px 14px; font-size:14px; }

/* Titles */
.section__title{
  margin:0 0 10px 0;
  font-family:var(--display);
  font-weight:400;
  font-size:var(--h2);
  color:var(--ink-0);
}
.section__subtitle{
  margin:0 0 26px 0;
  color:var(--ink-2);
  max-width:72ch;
}

/* Header */
.header{
  padding:22px 0 24px;
  border-bottom:1px solid var(--line);
}
.header__nav{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
}
.brand__link{
  display:inline-flex;
  align-items:center;
  gap:10px;
  user-select:none;
}
.brand__mark{
  height:34px;
  width:34px;
  border-radius:12px;
  display:grid;
  place-items:center;
  font-family:var(--display);
  color:var(--ink-0);
  background: rgba(46,233,211,.10);
  border: 1px solid rgba(46,233,211,.28);
}
.brand__name{
  font-family:var(--display);
  color:var(--ink-0);
}

/* Nav */
.nav__items{
  list-style:none;
  display:flex;
  gap:10px;
  padding:0;
  margin:0;
  flex-wrap:wrap;
}
.nav__link{
  padding:8px 10px;
  border-radius:999px;
  border:1px solid transparent;
  color:var(--ink-2);
  font-family:var(--display);
}
.nav__link:hover{
  color:var(--ink-0);
  background: rgba(46,233,211,.06);
  border-color: rgba(46,233,211,.22);
}

/* HERO */
.hero{
  margin-top: 18px;
  display:grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 18px;
  align-items: stretch;
  min-height: 72vh;
}

/* Left */
.hero__eyebrow{
  margin:0 0 10px 0;
  color: rgba(255,255,255,.75);
  font-size:13px;
  letter-spacing:.22em;
  text-transform:uppercase;
}
.hero__title{
  margin:0;
  font-family:var(--display);
  font-weight:400;
  font-size: clamp(38px, 4.6vw, 64px);
  color:var(--ink-0);
}
.hero__role{
  margin:12px 0 16px;
  color: rgba(255,255,255,.90);
  font-family: var(--display);
  font-size: clamp(15px, 1.35vw, 19px);
}
.hero__cta{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
  margin-bottom: 14px;
}

.hero__contact{
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,.10);
  max-width: 62ch;
}
.contactline{
  display:flex;
  gap:10px;
  align-items:baseline;
  margin: 8px 0;
}
.contactlabel{
  color: rgba(255,255,255,.92);
  font-family: var(--display);
  min-width: 64px;
}
.contactvalue{ color: rgba(255,255,255,.92); }
a.contactvalue{
  border-bottom: 1px solid rgba(46,233,211,.35);
  padding-bottom: 1px;
}
a.contactvalue:hover{
  color: var(--ink-0);
  border-bottom-color: rgba(46,233,211,.70);
}

.hero__micro{
  margin-top: 14px;
  color: rgba(255,255,255,.70);
  font-size: 14px;
}

/* Right profile card */
.profile{
  display:flex;
  flex-direction: column;
  overflow:hidden;
  padding: 14px;
}
.profile__photo{
  margin:0;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.14);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}
.profile__photo img{
  width: 100%;
  height: clamp(360px, 46vh, 520px);
  object-fit: contain;
  object-position: center;
  background: rgba(0,0,0,.10);
}

.profile__body{ padding: 14px 6px 6px; }
.profile__title{
  margin: 6px 0 10px 0;
  font-family: var(--display);
  font-weight: 400;
  color: var(--ink-0);
  font-size: 18px;
}
.profile__list{
  margin:0;
  padding-left: 18px;
  color: var(--ink-2);
}
.profile__list li{ margin: 8px 0; }

/* About */
.about{
  display:grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap:18px;
  align-items:start;
}
.about__text p{
  margin:0 0 12px 0;
  color: var(--ink-2);
  max-width: 78ch;
}
.about__actions{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
  margin-top: 10px;
}
.about__visual img{
  width:100%;
  border-radius: var(--radius-xl);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  background: rgba(0,0,0,.20);
}

/* Projects (used by Featured Analytics + Quantitative Portfolio) */
.grid--projects{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap:18px;
}
.project{
  padding:18px 18px 16px;
  display:flex;
  flex-direction:column;
  gap:12px;
}
.project__title{
  margin:0;
  font-family: var(--display);
  font-weight: 400;
  font-size: var(--h3);
  color: var(--ink-0);
}
.project__desc{ margin:0; color: var(--ink-2); }

.project__actions{ display:flex; gap:10px; flex-wrap:wrap; }

.tagrow{ display:flex; flex-wrap:wrap; gap:8px; }
.tag{
  font-size:12px;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.03);
  color: rgba(255,255,255,.78);
}

.project__single img{
  width:100%;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
  background: rgba(0,0,0,.20);
}

/* Portfolio meta + bullets (for Quantitative Portfolio cards) */
.project__meta{
  display:flex;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
  color: var(--ink-3);
  font-size:14px;
  margin-top: -4px;
}
.project__meta-left,
.project__meta-right{
  white-space:nowrap;
}
.project__bullets{
  margin: 0;
  padding-left: 18px;
  color: var(--ink-2);
}
.project__bullets li{ margin: 8px 0; }

/* Experience */
.timeline{ display:grid; gap:16px; }
.xp{ padding:18px 18px 16px; }
.xp__top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
}
.xp__role{
  margin:0;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(16px, 1.6vw, 22px);
  color: var(--ink-0);
}
.xp__org{ margin-top:6px; color: var(--ink-2); font-size:14px; }
.xp__meta{ color: var(--ink-3); font-size:14px; white-space:nowrap; }
.xp__bullets{ margin:12px 0 0; padding-left:18px; color: var(--ink-2); }
.xp__bullets li{ margin:8px 0; }
.xp__figure{ margin:14px 0 0; }
.xp__figure img{
  width:100%;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
  background: rgba(0,0,0,.20);
}

/* Closing */
.closing{
  padding:56px 0 58px;
  border-top:1px solid var(--line);
}
.closing__stack{ display:grid; gap:16px; }
.media--closing img{
  width:100%;
  border-radius: var(--radius-xl);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  background: rgba(0,0,0,.25);
}
.closing__line{
  margin:0;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(26px, 3.3vw, 52px);
  line-height: 1.06;
  color: var(--ink-0);
}
.closing__actions{ display:flex; gap:12px; flex-wrap:wrap; }

/* Footer */
.footer{
  border-top:1px solid var(--line);
  padding:20px 0 28px;
  color:var(--ink-3);
}
.footer__row{
  display:flex;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
  align-items:center;
}
.footer__links a{ color: var(--ink-3); }
.footer__links a:hover{ color: var(--ink-0); }
.footer__links .sep{ opacity:.5; padding:0 6px; }

/* Back to top */
.back-to-top{
  position:fixed;
  right:22px;
  bottom:22px;
  height:52px;
  width:52px;
  display:grid;
  place-items:center;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  border-radius:999px;
  border:1px solid rgba(255,255,255,.10);
  box-shadow:0 16px 32px rgba(0,0,0,.40);
  visibility:hidden;
  opacity:0;
  transform: scale(.92);
  transition: opacity .15s ease, transform .15s ease, visibility .15s ease;
  z-index:50;
}
.back-to-top__image{ width:62%; height:62%; filter: brightness(1.10); }

/* Responsive */
@media (max-width:1100px){
  .grid--projects{ grid-template-columns: 1fr 1fr; }
}
@media (max-width:980px){
  .hero{ grid-template-columns:1fr; min-height: auto; }
  .header__nav{ flex-direction:column; align-items:flex-start; }
  .about{ grid-template-columns:1fr; }
  .profile__photo img{ height: 420px; }
}
@media (max-width:720px){
  .grid--projects{ grid-template-columns:1fr; }
}
::selection{ background: rgba(46,233,211,.22); color: var(--ink-0); }
@media (prefers-reduced-motion: reduce){
  *{ transition:none !important; }
}
