/* ==========================================================================
   AI for Science — personal academic site
   Theme: "Blackboard & Tractatus" — chalk-on-slate by default,
   ink-on-paper as the alternate. Numbering throughout borrows the
   decimal-proposition style of Wittgenstein's Tractatus Logico-Philosophicus.
   ========================================================================== */

:root{
  --serif: 'Spectral', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', 'SFMono-Regular', Consolas, monospace;

  --measure: 40rem;
  --nav-h: 3.75rem;
  --ease: cubic-bezier(.4,0,.2,1);

  /* chalkboard (default) */
  --bg: #14171a;
  --bg-raised: #1b1f22;
  --fg: #eae6da;
  --fg-muted: #a7a99f;
  --fg-faint: #6c6f68;
  --line: #33383a;
  --accent: #6fb8a8;
  --accent-2: #e0c068;
  --shadow: rgba(0,0,0,.4);
}

[data-theme="paper"]{
  --bg: #f3efe3;
  --bg-raised: #ece5d3;
  --fg: #262420;
  --fg-muted: #5c574c;
  --fg-faint: #8c8574;
  --line: #d8cfb8;
  --accent: #2f6f62;
  --accent-2: #93641b;
  --shadow: rgba(60,50,20,.12);
}

*, *::before, *::after{ box-sizing: border-box; }

html{
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 1rem);
}

body{
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  transition: background .35s var(--ease), color .35s var(--ease);
  position: relative;
}

/* chalk-dust texture overlay */
body::before{
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: .5;
  mix-blend-mode: overlay;
  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' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.35'/%3E%3C/svg%3E");
}
[data-theme="paper"] body::before{ opacity: .25; mix-blend-mode: multiply; }

img{ max-width: 100%; display: block; }
a{ color: inherit; }

::selection{ background: var(--accent-2); color: #14171a; }

/* ---------- layout helpers ---------- */
.wrap{
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 1.5rem;
}
section{
  position: relative;
  z-index: 1;
  padding: 6.5rem 0;
  border-bottom: 1px solid var(--line);
}
section:last-of-type{ border-bottom: none; }

.kicker{
  font-family: var(--mono);
  font-size: .78rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
}

.prop-num{
  font-family: var(--mono);
  color: var(--fg-faint);
  font-size: .85em;
  margin-right: .6em;
}

h1, h2, h3{
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.25;
  margin: 0 0 .6em;
}
h2{
  font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.1rem);
  display: flex;
  align-items: baseline;
  gap: .1em;
}
h3{ font-size: 1.15rem; }

p{ margin: 0 0 1.1em; color: var(--fg); }
.muted{ color: var(--fg-muted); }

/* hand-drawn chalk underline */
.chalk-underline{
  position: relative;
  display: inline-block;
}
.chalk-underline::after{
  content: "";
  position: absolute;
  left: -2%; right: -2%; bottom: -.18em;
  height: .5em;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 12'%3E%3Cpath d='M2 8 C 40 2, 80 10, 120 5 S 180 2, 198 7' stroke='%23e0c068' stroke-width='3' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: 100% 100%;
  opacity: .8;
}

/* epigraph / quote blocks */
blockquote.epigraph{
  margin: 1.8rem 0;
  padding: 0 0 0 1.1rem;
  border-left: 2px solid var(--accent);
  font-family: var(--serif);
  font-style: italic;
  color: var(--fg-muted);
  font-size: 1.02rem;
}
blockquote.epigraph cite{
  display: block;
  margin-top: .5em;
  font-family: var(--mono);
  font-style: normal;
  font-size: .78rem;
  letter-spacing: .04em;
  color: var(--fg-faint);
}
blockquote.epigraph cite::before{ content: "— "; }

/* ---------- nav ---------- */
.site-nav{
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  backdrop-filter: blur(10px) saturate(120%);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid var(--line);
}
.site-nav .wrap{
  max-width: 64rem;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand{
  font-family: var(--mono);
  font-size: .95rem;
  letter-spacing: .02em;
  text-decoration: none;
  color: var(--fg);
}
.brand strong{ color: var(--accent-2); }

.nav-links{
  display: flex;
  gap: 1.6rem;
  list-style: none;
  margin: 0; padding: 0;
}
.nav-links a{
  font-family: var(--mono);
  font-size: .82rem;
  text-decoration: none;
  color: var(--fg-muted);
  padding: .3rem 0;
  border-bottom: 1px solid transparent;
  transition: color .2s var(--ease), border-color .2s var(--ease);
}
.nav-links a:hover,
.nav-links a.active{
  color: var(--fg);
  border-color: var(--accent-2);
}

.theme-toggle{
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--fg-muted);
  padding: .4rem .7rem;
  border-radius: 3px;
  cursor: pointer;
  transition: all .2s var(--ease);
}
.theme-toggle:hover{ color: var(--accent-2); border-color: var(--accent); transform: translateY(-1px); }

/* ---------- hero ---------- */
.hero{
  padding-top: calc(var(--nav-h) + 5.5rem);
  padding-bottom: 5rem;
  border-bottom: 1px solid var(--line);
}
.hero .kicker{ margin-bottom: 1rem; display: block; }
.hero h1{
  font-size: clamp(2.2rem, 1.6rem + 2.6vw, 3.4rem);
  margin-bottom: .3rem;
}
.hero .role{
  font-family: var(--mono);
  color: var(--fg-muted);
  font-size: 1rem;
  margin-bottom: 1.6rem;
}
.hero .role .divider{ color: var(--fg-faint); margin: 0 .5em; }

.hero-cta{
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .8rem;
  margin-top: 1.8rem;
}
.btn{
  font-family: var(--mono);
  font-size: .82rem;
  text-decoration: none;
  height: 2.75rem;
  padding: 0 1.1rem;
  border-radius: 3px;
  border: 1px solid var(--line);
  color: var(--fg);
  transition: all .2s var(--ease);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn:hover{ border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.btn.primary{
  background: var(--accent);
  border-color: var(--accent);
  color: #10201c;
  font-weight: 600;
}
.btn.primary:hover{ background: var(--accent-2); border-color: var(--accent-2); color: #201a08; }

/* ---------- about ---------- */
.about-grid{
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.4rem;
}
.philosophy{
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1.6rem 1.8rem;
}
.timeline{
  list-style: none;
  margin: 0; padding: 0;
  border-left: 1px dashed var(--line);
}
.timeline li{
  position: relative;
  padding: 0 0 1.3rem 1.4rem;
}
.timeline li::before{
  content: "";
  position: absolute;
  left: -4.5px; top: .35em;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent-2);
}
.timeline .t-year{
  font-family: var(--mono);
  font-size: .78rem;
  color: var(--fg-faint);
  display: block;
}

/* awards: a compact honors board, distinct from the timeline above */
.honors-block{
  position: relative;
  isolation: isolate;
  overflow: hidden;
  margin-top: 2.6rem;
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-top-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  border-radius: 6px;
  background: color-mix(in srgb, var(--bg-raised) 65%, var(--bg));
  box-shadow: 0 8px 20px -22px var(--shadow);
}
.honors-heading{
  margin-bottom: 1.15rem;
}
.honors-heading h3{ margin: 0; }
.honors-kicker{
  display: block;
  margin-bottom: .1rem;
  font-family: var(--mono);
  font-size: .66rem;
  line-height: 1.4;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
}
.honors-list{
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}
.honors-list li{
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr) auto;
  align-items: start;
  gap: .75rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
}
.honor-number{
  padding-top: .15rem;
  font-family: var(--mono);
  font-size: .7rem;
  color: var(--accent-2);
}
.honor-copy strong{
  display: block;
  margin-bottom: .15rem;
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--fg);
}
.honor-copy span{
  display: block;
  font-size: .86rem;
  line-height: 1.5;
  color: var(--fg-muted);
}
.honor-year{
  margin-top: .05rem;
  padding: .15rem .45rem;
  border: 1px solid var(--line);
  border-radius: 2px;
  font-family: var(--mono);
  font-size: .68rem;
  line-height: 1.4;
  color: var(--fg-faint);
  background: var(--bg);
}

/* ---------- research ---------- */
.card-grid{
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.2rem;
  margin-top: 1.6rem;
}
.card{
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1.4rem 1.5rem;
  transition: border-color .2s var(--ease), transform .2s var(--ease);
}
.card:hover{ border-color: var(--accent); transform: translateY(-2px); }
.card h3{ margin-bottom: .4rem; }
.card p{ margin: 0; color: var(--fg-muted); font-size: .95rem; }

/* ---------- publications ---------- */
.pub-list{ margin-top: 1.6rem; }
.pub{
  display: grid;
  grid-template-columns: 3.2rem 1fr;
  gap: 1rem;
  padding: 1.2rem 0;
  border-top: 1px solid var(--line);
}
.pub:last-child{ border-bottom: 1px solid var(--line); }
.pub .prop-num{ font-size: .82rem; padding-top: .2em; }
.pub h3{ margin-bottom: .3rem; font-size: 1.05rem; }
.pub .authors{ color: var(--fg-muted); font-size: .92rem; margin-bottom: .2rem; }
.pub .venue{
  font-family: var(--mono);
  font-size: .78rem;
  color: var(--accent);
}
.pub .links{ margin-top: .5rem; display: flex; gap: 1rem; }
.pub .links a{
  font-family: var(--mono);
  font-size: .78rem;
  color: var(--fg-muted);
  text-decoration: none;
  border-bottom: 1px dotted var(--fg-faint);
}
.pub .links a:hover{ color: var(--accent); border-color: var(--accent); }
.pub-more{
  margin-top: 1.8rem;
  display: flex;
  justify-content: center;
}

/* ---------- notes / chalkboard ---------- */
.notes-grid{
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.4rem;
  margin-top: 1.6rem;
}
.note{
  padding: 1.3rem 1.5rem;
  border-left: 2px solid var(--fg-faint);
  background: var(--bg-raised);
  border-radius: 0 6px 6px 0;
}
.note:hover{ border-left-color: var(--accent-2); }
.note h3{ font-size: 1rem; margin-bottom: .5rem; }
.note p{ color: var(--fg-muted); font-size: .95rem; margin: 0; }
.note .note-tag{
  font-family: var(--mono);
  font-size: .72rem;
  color: var(--fg-faint);
  margin-top: .6rem;
  display: block;
}

/* ---------- contact ---------- */
.contact-links{
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .9rem;
}
.contact-links a{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  font-family: var(--mono);
  font-size: .85rem;
  text-decoration: none;
  color: var(--fg);
  border: 1px solid var(--line);
  height: 2.75rem;
  padding: 0 1rem;
  border-radius: 3px;
  transition: all .2s var(--ease);
}
.contact-links a:hover{ border-color: var(--accent); color: var(--accent); }
.contact-links svg{ width: 15px; height: 15px; fill: currentColor; }

footer{
  padding: 3rem 0 4rem;
  text-align: center;
  color: var(--fg-faint);
  font-family: var(--mono);
  font-size: .78rem;
}
footer .foot-quote{
  font-family: var(--serif);
  font-style: italic;
  color: var(--fg-muted);
  font-size: .98rem;
  margin-bottom: 1.2rem;
}

/* ---------- scroll reveal ---------- */
.reveal{
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}
.reveal.in{ opacity: 1; transform: none; }

/* ---------- responsive ---------- */
@media (max-width: 720px){
  .nav-links{ display: none; }
  .theme-toggle{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem; height: 2.75rem;
  }

  .wrap{ padding: 0 1.15rem; }

  .hero{
    padding-top: calc(var(--nav-h) + 2rem);
    padding-bottom: 3.5rem;
  }
  .hero-cta .btn{ flex: 1 1 auto; text-align: center; }

  section{ padding: 3.75rem 0; }

  .about-grid{ gap: 2rem; }
  .philosophy{ padding: 1.3rem 1.4rem; }
  .honors-block{ padding: 1.3rem 1.15rem; }
  .honors-list li{ grid-template-columns: 1.7rem minmax(0, 1fr); }
  .honor-year{
    grid-column: 2;
    justify-self: start;
    margin-top: -.2rem;
  }

  .card-grid{ grid-template-columns: 1fr; }
  .pub{ grid-template-columns: 1fr; gap: .3rem; }
  .pub .prop-num{ padding-top: 0; }

  .contact-links a{ flex: 1 1 auto; justify-content: center; }
}

@media (max-width: 380px){
  .brand{ font-size: .85rem; }
  .hero .role{ font-size: .9rem; }
}

@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior: auto; }
  .reveal{ opacity: 1; transform: none; transition: none; }
}
