/* Field Lines — Benjamin I. Weintrub, benjaminiweintrub.com */

:root {
  --bg: #0a0e14;
  --bg-raise: #0e1523;
  --ink: #e9edf6;
  --muted: #98a4bb;
  --line: #1d2739;
  --violet: #8b7bff;
  --blue: #4f8cff;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --sans: "Archivo", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

a { color: var(--violet); }
a:focus-visible { outline: 2px solid var(--violet); outline-offset: 3px; border-radius: 2px; }

/* ---------- hero ---------- */

.hero {
  position: relative;
  min-height: 88vh;
  display: grid;
  align-content: center;
  overflow: hidden;
  padding: 5rem 1.5rem 6rem;
  background:
    radial-gradient(1100px 620px at 72% 18%, rgba(79, 140, 255, 0.16), transparent 62%),
    radial-gradient(900px 540px at 15% 85%, rgba(139, 123, 255, 0.14), transparent 60%),
    var(--bg);
}

.lattice {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-inner {
  position: relative;
  width: min(980px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3rem;
  align-items: center;
}

.kicker {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--blue);
  margin: 0 0 1.2rem;
  animation: rise 0.7s ease both;
}

.hero h1 {
  margin: 0;
  font-weight: 800;
  font-stretch: 118%;
  text-transform: uppercase;
  letter-spacing: -0.015em;
  line-height: 0.98;
  font-size: clamp(2.9rem, 9vw, 6rem);
  text-shadow: 0 0 90px rgba(139, 123, 255, 0.35);
  animation: rise 0.7s 0.1s ease both;
}

.role {
  margin: 1.4rem 0 0;
  color: var(--muted);
  font-size: 1.05rem;
  animation: rise 0.7s 0.2s ease both;
}

.metrics {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  padding: 0;
  margin: 2.2rem 0 0;
  animation: rise 0.7s 0.3s ease both;
}

.metrics li {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
  border: 1px solid var(--line);
  background: rgba(14, 21, 35, 0.7);
  border-radius: 999px;
  padding: 0.45rem 1rem;
}

.metrics .num {
  color: var(--violet);
  font-weight: 500;
  margin-right: 0.4rem;
}

/* portrait — rounded frame, hex outlines floating behind */

.portrait-wrap {
  position: relative;
  width: clamp(230px, 26vw, 310px);
  animation: rise 0.7s 0.25s ease both;
}

.portrait-wrap::before,
.portrait-wrap::after {
  content: "";
  position: absolute;
  z-index: 0;
  background-repeat: no-repeat;
  background-size: contain;
}

.portrait-wrap::before {
  width: 92px;
  height: 106px;
  top: -34px;
  right: -38px;
  opacity: 0.55;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 115'%3E%3Cpath d='M50 2 98 30v56L50 113 2 86V30z' fill='none' stroke='%238b7bff' stroke-width='2'/%3E%3C/svg%3E");
}

.portrait-wrap::after {
  width: 58px;
  height: 67px;
  bottom: -26px;
  left: -30px;
  opacity: 0.4;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 115'%3E%3Cpath d='M50 2 98 30v56L50 113 2 86V30z' fill='none' stroke='%234f8cff' stroke-width='2'/%3E%3C/svg%3E");
}

.portrait-frame {
  position: relative;
  z-index: 1;
  border-radius: 22px;
  padding: 3px;
  background: linear-gradient(160deg, var(--violet), var(--blue) 55%, rgba(29, 39, 57, 0.6));
  box-shadow:
    0 24px 70px rgba(79, 140, 255, 0.18),
    0 0 50px rgba(139, 123, 255, 0.22);
}

.portrait {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: 50% 22%;
  border-radius: 19px;
}

/* ---------- sections ---------- */

.band {
  width: min(880px, 100%);
  margin: 0 auto;
  padding: 4.5rem 1.5rem 0;
}

.band h2 {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 2rem;
}

.band h2 .no { color: var(--violet); }

.band h2::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--line), transparent);
}

.prose p { margin: 0 0 1.1rem; max-width: 68ch; }

/* about grid + personal figure */

.about-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 3rem;
  align-items: center;
}

.personal {
  margin: 0;
  transform: rotate(-1.2deg);
  transition: transform 0.35s ease;
}

.personal:hover { transform: rotate(0deg); }

.personal img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: 50% 30%;
  border-radius: 14px;
  border: 1px solid var(--line);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

.personal figcaption {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 0.6rem;
  text-align: right;
}

/* ---------- research cards ---------- */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1rem;
}

.card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.4rem 1.4rem 1.1rem;
  background: linear-gradient(180deg, #101828, #0c1220);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.card:hover {
  transform: translateY(-3px);
  border-color: rgba(139, 123, 255, 0.45);
  box-shadow: 0 12px 40px rgba(79, 140, 255, 0.12);
}

.card h3 { margin: 0 0 0.6rem; font-size: 1.12rem; font-weight: 700; }
.card p { margin: 0 0 0.9rem; color: var(--muted); font-size: 0.94rem; }
.card .tag {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--blue);
  margin: 0;
}

/* ---------- publications ---------- */

.pubs {
  list-style: none;
  margin: 0;
  padding: 0;
}

.pub {
  display: grid;
  grid-template-columns: 4.2rem 1fr auto;
  align-items: start;
  gap: 1rem;
  padding: 1.1rem 0.9rem;
  border-left: 2px solid transparent;
  border-bottom: 1px solid var(--line);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.pub:hover {
  border-left-color: var(--violet);
  background: rgba(139, 123, 255, 0.04);
}

.pub-year {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
  padding-top: 0.3rem;
}

.pub h3 { margin: 0 0 0.35rem; font-size: 1.05rem; font-weight: 600; line-height: 1.4; }

.pub h3 a { color: var(--ink); text-decoration: none; }
.pub h3 a:hover { color: var(--violet); text-decoration: underline; text-underline-offset: 3px; }

.pub-authors { margin: 0 0 0.3rem; font-size: 0.88rem; color: var(--muted); }
.pub-authors strong { color: var(--ink); font-weight: 600; }

.pub-venue { margin: 0; font-size: 0.88rem; color: var(--muted); }

.pub-cites {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--blue);
  margin-left: 0.8rem;
}

.pub-mark {
  height: 17px;
  width: auto;
  max-width: 110px;
  align-self: center;
  filter: brightness(0) invert(1);
  opacity: 0.45;
}

.pubnote {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  margin: 1.2rem 0 0;
}

/* ---------- education / profiles ---------- */

.edu, .links { list-style: none; margin: 0; padding: 0; }

.edu li {
  display: grid;
  grid-template-columns: 7.5rem 1fr auto;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--line);
}

.edu-when {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
  align-self: start;
  padding-top: 0.15rem;
}

.edu div { color: var(--muted); }
.edu strong { color: var(--ink); }

.edu-logo {
  height: 22px;
  width: auto;
  max-width: 150px;
  filter: brightness(0) invert(1);
  opacity: 0.5;
}

.edu-logo-ku { height: 30px; }

.links { display: flex; flex-wrap: wrap; gap: 0.8rem; }

.links a {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--ink);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.6rem 1.2rem;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.links a:hover { border-color: var(--violet); color: var(--violet); }

footer {
  width: min(880px, 100%);
  margin: 0 auto;
  padding: 4.5rem 1.5rem 3rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
}

/* ---------- motion & small screens ---------- */

@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .kicker, .hero h1, .role, .metrics, .portrait-wrap { animation: none; }
  html { scroll-behavior: auto; }
  .card, .pub, .personal { transition: none; }
}

@media (max-width: 760px) {
  .hero-inner {
    grid-template-columns: 1fr;
    gap: 2.4rem;
  }
  .portrait-wrap { order: -1; width: clamp(190px, 52vw, 250px); }
  .about-grid { grid-template-columns: 1fr; }
  .personal { max-width: 300px; }
}

@media (max-width: 560px) {
  .pub { grid-template-columns: 1fr; gap: 0.2rem; }
  .pub-mark { display: none; }
  .edu li { grid-template-columns: 1fr; gap: 0.4rem; }
  .edu-logo { justify-self: start; }
  .hero { min-height: 72vh; }
}
