/* =========================================================
   Evan Rowbotham — Global Styles (clean)
   ========================================================= */

:root{
  --bg:#0a0d12;
  --panel:#0f1720;
  --card:#111b27;
  --text:#e7eef5;
  --muted:#9fb0c0;
  --line:#203042;
  --brand:#8bc5ff;
  --shadow:0 8px 24px rgba(0,0,0,.35);
  --radius:14px;

  --list-thumb-size: 90px;

  --interests-title-size: 34px;
  --interests-item-size: 18px;
  --bullet-size: 22px;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
html{ overflow-anchor:none; }

body{
  margin:0;
  background:var(--bg);
  color:var(--text);
  font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text","SF Pro Display",
               system-ui,"Segoe UI",Roboto,Helvetica,Arial,
               "Apple Color Emoji","Segoe UI Emoji";
  line-height:1.6;
  text-rendering:optimizeLegibility;
}

a{ color:var(--text); text-decoration:none; border-bottom:1px solid transparent; }
a:hover{ color:var(--brand); border-bottom-color:var(--brand); }
.muted{ color:var(--muted); }

.container{
  max-width:1180px;
  margin:0 auto;
  padding:0 28px;
}

/* =========================================================
   Top Bar
   ========================================================= */
.topbar{
  position:sticky;
  top:0;
  z-index:50;
  background:rgba(10,13,18,.88);
  backdrop-filter:saturate(180%) blur(10px);
  border-bottom:1px solid var(--line);
}

.topbar-inner{
  height:76px;
  display:flex;
  align-items:center;
  justify-content:space-between;
}

.brand{
  display:flex;
  align-items:center;
  gap:12px;
  margin-left:0;
  border-bottom-color:transparent;
}
.brand:hover{ border-bottom-color:transparent; }

.favicon-lg{
  width:32px;
  height:32px;
  border-radius:8px;
  border:none;
  background:transparent;
}

.brand-name{
  font-family:"SF Pro Display",-apple-system,BlinkMacSystemFont,system-ui !important;
  font-weight:800 !important;
  font-size:22px !important;
  line-height:1 !important;
  letter-spacing:.2px !important;
  white-space:nowrap;
  font-synthesis:none;
  -webkit-font-smoothing:antialiased;
}

.topnav{
  display:flex;
  gap:24px;
  align-items:center;
  flex-wrap:nowrap;
}
.topnav a{
  color:var(--muted);
  border-bottom-color:transparent;
  white-space:nowrap;
}
.topnav a:hover,
.topnav a.active{ color:var(--text); }

/* =========================================================
   Hero
   ========================================================= */
.hero{
  display:grid;
  grid-template-columns:320px 1fr;
  gap:44px;
  align-items:center;
  padding:52px 0 18px;
}

.hero-photo{
  width:300px;
  height:300px;
  object-fit:cover;
  border-radius:28px;
  border:1px solid var(--line);
  box-shadow:var(--shadow);
  background:#0a0f15;
}

.display{
  font-size:56px;
  line-height:1.06;
  margin:0 0 10px;
  font-weight:800;
  letter-spacing:-.6px;
}
.lead{ color:var(--muted); font-size:18px; margin:0 0 16px; }

.hero-socials{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
}
.btn{
  display:inline-flex;
  align-items:center;
  gap:8px;
  font-size:14px;
  font-weight:600;
  padding:8px 14px;
  border-radius:999px;
  border:1px solid var(--line);
  background:var(--panel);
  border-bottom-color:transparent;
}
.btn:hover{ border-bottom-color:transparent; }

/* Research interests */
.hero-research{
  grid-column:1 / -1;
  margin-top:14px;
  padding-top:12px;
}
.research-title{
  margin:6px 0 12px;
  font-size:var(--interests-title-size);
  font-weight:800;
  letter-spacing:-.3px;
  white-space:nowrap;
}
.research-list{
  margin:0;
  padding-left:0;
  list-style:none;
}
.research-list li{
  position:relative;
  margin:10px 0;
  padding-left:22px;
  font-size:var(--interests-item-size);
  line-height:1.7;
}
.research-list li::before{
  content:"•";
  position:absolute;
  left:0;
  top:0.05em;
  font-size:var(--bullet-size);
  line-height:1;
  color:var(--muted);
}

/* =========================================================
   Sections + heads
   ========================================================= */
.section{ padding:24px 0 8px; }
.h2{ font-size:26px; font-weight:800; margin:0; }

.section-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  border-bottom:1px solid var(--line);
  padding-bottom:8px;
  margin-bottom:16px;
}

.all-link{
  color:var(--muted);
  border-bottom-color:transparent;
}
.all-link:hover{ color:var(--text); }

/* =========================================================
   List pages
   ========================================================= */
.list-page{ padding:36px 0 28px; }
.display.big{ font-size:56px; font-weight:800; margin:10px 0 18px; }

.year{ font-size:22px; font-weight:700; margin-bottom:8px; }
.rule{ border:0; height:1px; background:var(--line); margin:0 0 18px; }

/* =========================================================
   Rows (Projects/Publications pages)
   - correct spacing
   - pill on RIGHT side
   ========================================================= */
.row{
  display:grid;
  grid-template-columns: auto 1fr auto;
  gap:18px;
  align-items:center;
  padding:20px 18px;
  border:1px solid var(--line);
  border-radius:12px;
  background:var(--card);
  box-shadow:var(--shadow);
  margin-bottom:16px;
}

.thumb{
  width:var(--list-thumb-size);
  height:var(--list-thumb-size);
  border-radius:10px;
  border:1px solid var(--line);
  object-fit:cover;
  background:var(--panel);
}

.row-main{
  min-width:0;
}

.row-title{
  margin:0 0 10px;
  font-size:18px;
  font-weight:800;
  line-height:1.25;
}

.row-authors,
.row-venue{
  margin:0;
  font-size:15px;
  line-height:1.4;
}

.row-authors{ margin-bottom:6px; }

.row-authors b,
.row-authors strong{
  font-size:1em;
  line-height:inherit;
  font-weight:800;
}

.pill{
  justify-self:end;
  white-space:nowrap;
  color:var(--brand);
  font-weight:700;
  border-bottom-color:transparent;
  padding:6px 0;
}
.pill:hover{
  border-bottom-color:transparent;
}

/* =========================================================
   Homepage: Latest Projects card grid
   ========================================================= */
#latest-projects.home-grid{
  display:grid;
  grid-template-columns:repeat(3, 1fr);
  gap:20px;
}

/* turn rows into square cards ONLY on the homepage projects grid */
#latest-projects.home-grid > .row{
  display:flex;
  flex-direction:column;
  padding:0;
  margin:0;
  aspect-ratio:1 / 1;
  overflow:hidden;
  border-radius:var(--radius);
}

/* image at top */
#latest-projects.home-grid > .row > img.thumb{
  width:100%;
  height:60%;
  border:0;
  border-bottom:1px solid var(--line);
  border-radius:0;
  object-fit:cover;
}

/* text block */
#latest-projects.home-grid > .row .row-main{
  padding:14px 14px 0;
}

/* keep only title on home cards */
#latest-projects.home-grid > .row .row-authors,
#latest-projects.home-grid > .row .row-venue{
  display:none;
}

/* put link at bottom-left of card */
#latest-projects.home-grid > .row .pill{
  justify-self:auto;
  align-self:flex-start;
  margin-top:auto;
  padding:12px 14px 14px;
}

/* placeholder */
#latest-projects.home-grid > .card-placeholder{
  display:flex;
  align-items:center;
  justify-content:center;
  aspect-ratio:1/1;
  border-radius:var(--radius);
  border:1px dashed var(--line);
  color:var(--muted);
  background:transparent;
}

/* =========================================================
   Homepage: Latest Publications should stay a normal row
   ========================================================= */
#latest-pubs .row{
  margin-bottom:0;
}

/* =========================================================
   Footer
   ========================================================= */
.site-footer{
  margin-top:40px;
  padding:22px 0 32px;
  border-top:1px solid var(--line);
}
.footer-center{
  display:flex;
  justify-content:center;
  align-items:center;
}
.copy{ color:var(--muted); font-size:14px; }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width:900px){
  .hero{ grid-template-columns:1fr; gap:10px; }
  .hero-photo{ width:220px; height:220px; }
  .display{ font-size:40px; }
  .research-title{ white-space:normal; }

  #latest-projects.home-grid{ grid-template-columns:1fr; }

  .row{
    grid-template-columns: 1fr;
  }
  .pill{
    justify-self:start;
  }
}
/* Homepage project cards: right-align "Read more →" */
#latest-projects.home-grid > .row .pill{
  align-self: flex-end;
  margin-left: auto;
  text-align: right;
}
