/* ============================================================
   Parmis Bathayan — personal site
   Minimal editorial design system · light (default) + dark
   ============================================================ */

:root {
  --bg:      #fbfaf8;
  --surface: #ffffff;
  --text:    #1c1b1a;
  --muted:   #6b6862;
  --faint:   #98948c;
  --line:    #e8e5df;
  --line-strong: #d9d5cd;
  --accent:  #4b45d1;
  --accent-soft: #edecfb;

  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;

  --maxw: 940px;
  --pad: 24px;
  --radius: 14px;
}

:root[data-theme="dark"] {
  --bg:      #16150f;
  --surface: #1e1d17;
  --text:    #ecebe4;
  --muted:   #a29e94;
  --faint:   #7c786f;
  --line:    #2c2a23;
  --line-strong: #3a382f;
  --accent:  #9a92ff;
  --accent-soft: #211f36;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

a { color: inherit; }

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--pad);
}

/* ---------- Navigation ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--pad);
}
.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: var(--text);
}
.brand .name {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 500;
  letter-spacing: 0.2px;
  white-space: nowrap;
}
.nav-right { display: flex; align-items: center; gap: 20px; }
.menu {
  display: flex;
  align-items: center;
  gap: 26px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.menu a {
  position: relative;
  text-decoration: none;
  color: var(--muted);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.1px;
  padding: 4px 0;
  transition: color 0.18s ease;
}
.menu a:hover { color: var(--text); }
.menu a.active { color: var(--text); }
.menu a.active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}
.menu a.cv {
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.menu a.cv svg { width: 13px; height: 13px; }

/* Theme toggle */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition: color 0.18s ease, border-color 0.18s ease;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }
.theme-toggle svg { width: 16px; height: 16px; display: block; }
.theme-toggle .i-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: block; }

/* ---------- Section scaffolding ---------- */
main { padding: 0 0 96px; }

.eyebrow {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 18px;
}

.section-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 15px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--faint);
  margin: 0 0 26px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

/* ---------- Hero ---------- */
.hero {
  display: grid;
  grid-template-columns: 1.35fr 0.9fr;
  gap: 56px;
  align-items: center;
  padding-block: 72px 64px;
}
.hero h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(40px, 6vw, 58px);
  line-height: 1.02;
  letter-spacing: -0.5px;
  margin: 0 0 16px;
}
.hero .role {
  font-size: 18px;
  color: var(--muted);
  margin: 0 0 22px;
}
.hero .role em { font-family: var(--serif); font-style: italic; color: var(--text); }
.hero .lede {
  font-size: 18px;
  line-height: 1.7;
  color: var(--text);
  margin: 0 0 30px;
  max-width: 34em;
}
.hero .lede .hl { color: var(--accent); font-weight: 500; }

.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid var(--line-strong);
  color: var(--text);
  background: var(--surface);
  transition: all 0.18s ease;
}
.btn:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.btn svg { width: 15px; height: 15px; }
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn.primary:hover { color: #fff; filter: brightness(1.08); }

/* Portrait */
.portrait {
  position: relative;
  justify-self: center;
  width: 100%;
  max-width: 300px;
}
.portrait::before {
  content: "";
  position: absolute;
  inset: 14px -14px -14px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--accent);
  opacity: 0.35;
  z-index: 0;
}
.portrait img {
  position: relative;
  z-index: 1;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  display: block;
}

/* ---------- Focus cards ---------- */
.block { padding-block: 40px; }
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 22px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.card:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.card .ico { color: var(--accent); margin-bottom: 14px; }
.card .ico svg { width: 26px; height: 26px; display: block; }
.card h3 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 20px;
  margin: 0 0 8px;
  letter-spacing: 0.2px;
}
.card p { margin: 0; font-size: 15px; color: var(--muted); line-height: 1.6; }

/* ---------- Education / list rows ---------- */
.rows { display: flex; flex-direction: column; gap: 0; }
.row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 24px;
  padding: 22px 0;
  border-top: 1px solid var(--line);
}
.row:last-child { border-bottom: 1px solid var(--line); }
.row .r-title { font-weight: 600; font-size: 17px; }
.row .r-sub { color: var(--muted); font-size: 15px; margin-top: 3px; }
.row .r-meta {
  color: var(--faint);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  text-align: right;
}
.row .r-note {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 15px;
  font-style: italic;
  font-family: var(--serif);
}
.tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.4px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  vertical-align: middle;
}

/* ---------- Page header (inner pages) ---------- */
.page-head { padding-block: 64px 8px; }
.page-head h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(34px, 5vw, 46px);
  letter-spacing: -0.4px;
  margin: 10px 0 14px;
}
.page-head p { color: var(--muted); font-size: 18px; max-width: 42em; margin: 0; }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  text-decoration: none;
  font-size: 14.5px;
  font-weight: 500;
  transition: color 0.18s ease;
}
.back-link:hover { color: var(--accent); }
.back-link svg { width: 15px; height: 15px; }

/* ---------- Publication / project entries ---------- */
.entry {
  padding: 28px 0;
  border-top: 1px solid var(--line);
}
.entry:last-child { border-bottom: 1px solid var(--line); }
.entry h3 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 22px;
  line-height: 1.3;
  margin: 0 0 10px;
}
.entry .authors { font-size: 15.5px; color: var(--muted); margin: 0 0 6px; }
.entry .authors .me { color: var(--text); font-weight: 600; }
.entry .venue {
  font-size: 15px;
  color: var(--text);
  font-family: var(--serif);
  font-style: italic;
  margin: 0 0 14px;
}
.entry .meta-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  font-size: 14px;
  color: var(--faint);
}
.entry ul {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}
.entry ul li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 9px;
  font-size: 15.5px;
  color: var(--muted);
  line-height: 1.6;
}
.entry ul li::before {
  content: "";
  position: absolute;
  left: 2px; top: 10px;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.7;
}
.entry.featured {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px 28px;
  border-top: 1px solid var(--line);
}

/* Linked title + arXiv pill */
.entry-link {
  color: inherit;
  text-decoration: none;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-size: 0% 1.5px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: background-size 0.25s ease, color 0.18s ease;
}
.entry-link:hover { background-size: 100% 1.5px; color: var(--accent); }
.arxiv {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  font-size: 12.5px;
  letter-spacing: 0.3px;
  padding: 3px 10px;
  border: 1px solid var(--accent-soft);
  border-radius: 999px;
  transition: background 0.18s ease;
}
.arxiv:hover { background: var(--accent-soft); }

/* People (supervisor names → Google Scholar) */
.person {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dotted var(--line-strong);
  transition: color 0.18s ease, border-color 0.18s ease;
}
.person:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* ---------- Clickable project cards ---------- */
.proj-list { display: grid; gap: 14px; }
a.proj {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
a.proj:hover { border-color: var(--accent); transform: translateY(-2px); }
.proj .meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 14px;
  color: var(--faint);
  margin-bottom: 8px;
}
.proj-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.proj h3 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 21px;
  line-height: 1.3;
  margin: 0 0 8px;
}
.proj p { margin: 0; color: var(--muted); font-size: 15.5px; line-height: 1.6; }
.proj .go { color: var(--faint); flex: none; margin-top: 2px; transition: transform 0.2s ease, color 0.2s ease; }
a.proj:hover .go { color: var(--accent); transform: translate(2px, -2px); }
.proj .go svg { width: 19px; height: 19px; display: block; }

/* ---------- Toolkit ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  font-size: 14px;
  color: var(--muted);
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}

/* ---------- Simple lists, two-column, "seeking" note ---------- */
.ilist { margin: 0; padding: 0; list-style: none; }
.ilist li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 15.5px;
  line-height: 1.6;
}
.ilist li:last-child { margin-bottom: 0; }
.ilist li::before {
  content: "";
  position: absolute;
  left: 2px; top: 10px;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.7;
}
.ilist strong { color: var(--text); font-weight: 600; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 48px; }

.contact-note {
  margin: 24px 0 0;
  font-size: 15px;
  color: var(--muted);
  max-width: 34em;
}
.contact-note a {
  color: var(--accent);
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  transition: border-color 0.18s ease;
}
.contact-note a:hover { border-color: var(--accent); }

.more { margin: 20px 0 0; }
.more a {
  color: var(--accent);
  font-weight: 500;
  font-size: 15px;
  text-decoration: none;
  transition: opacity 0.18s ease;
}
.more a:hover { opacity: 0.7; }

/* ---------- Footer ---------- */
.foot {
  border-top: 1px solid var(--line);
  padding: 34px 0 44px;
}
.foot-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.foot .copy { color: var(--faint); font-size: 14px; }
.foot .links { display: flex; gap: 22px; }
.foot .links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14.5px;
  transition: color 0.18s ease;
}
.foot .links a:hover { color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card:hover, .btn:hover, a.proj:hover { transform: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 780px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 40px;
    padding-block: 48px 44px;
    text-align: left;
  }
  .portrait { order: -1; justify-self: start; max-width: 220px; }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; gap: 28px; }
}

@media (max-width: 560px) {
  :root { --pad: 18px; }
  body { font-size: 16px; }
  .brand .name { display: none; }
  .nav-right { gap: 12px; }
  .menu { gap: 15px; }
  .menu a { font-size: 13.5px; }
  .menu a.cv svg { display: none; }
  .theme-toggle { width: 31px; height: 31px; }
  .row { grid-template-columns: 1fr; }
  .row .r-meta { text-align: left; }
}
