/* =========================================================
   LED dot-matrix theme
   Everything on a pure black panel. Display text is set in
   Doto (a round dot-matrix typeface); running text keeps a
   Share Tech Mono; images are re-drawn as a grid of lit dots.
   ========================================================= */

:root {
  --led-bg: #000;
  --led-ink: #ece6d6;                 /* warm "lit" white */
  --led-ink-dim: #8b97a2;             /* half-lit */
  --led-ink-faint: rgba(236, 230, 214, 0.3);
  --led-blue: #5db1ff;
  --led-teal: #3fd0c0;
  --led-amber: #ffb547;

  --font-dot: "Doto", "JetBrains Mono", monospace;
  --font-text: "Share Tech Mono", "Courier New", monospace;   /* 70s console face, for running text */
  --dot-rond: 100;                    /* 0 = square pixels, 100 = round dots */
}

/* ---------- Panel ---------- */

html, body {
  background-color: var(--led-bg) !important;
  color: var(--led-ink) !important;
}

/* unlit LED grid behind everything, barely visible */
body {
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.045) 0.9px, transparent 1.25px);
  background-size: 6px 6px;
  background-position: 3px 3px;
  min-height: 100vh;
}

::selection { background: var(--led-ink); color: #000; }

/* ---------- Dot typeface for display text ---------- */

.dot,
header .menu a,
h1, h2, h3, h4,
.home-name,
.home-btn, .cv-btn,
.item-date,
.typewriter-line,
.r-date,
.r-tags,
footer {
  font-family: var(--font-dot);
  font-variation-settings: "ROND" var(--dot-rond);
  font-weight: 700;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Running text ---------- */

.dot-screen,
.home-paragraph,
.news-list .item-text,
.r-title,
.r-desc,
.publications-content p,
.home-section p,
main > p,
main > ul > li {
  font-family: var(--font-text);
  font-weight: 400;
  font-size: 1.04rem;
  line-height: 1.5;
  letter-spacing: -0.02em;
}

/* Running text is drawn plain (no dot screen): the CSS screen caused
   first-paint glitches on iPhone Safari. Share Tech Mono has the
   console feel on its own. It has a single weight. */


/* ---------- Navigation ---------- */

header .menu {
  border-top: 2px dotted var(--led-ink-faint) !important;
  border-bottom: 2px dotted var(--led-ink-faint) !important;
}

header .menu ul li { margin-left: 1.4rem; }

header .menu a {
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--led-ink-dim) !important;
  padding: 0.15rem 0.1rem;
  transition: color 0.15s ease, text-shadow 0.15s ease;
}

header .menu a:hover {
  background: none !important;
  color: var(--led-ink) !important;
  text-shadow: 0 0 10px rgba(236, 230, 214, 0.55);
}

header .menu a[aria-current="page"] {
  color: var(--led-blue) !important;
  text-decoration: none;
  text-shadow: 0 0 12px rgba(93, 177, 255, 0.55);
}

/* a lit dot before the current page */
header .menu a[aria-current="page"]::before {
  content: "";
  display: inline-block;
  width: 0.42em;
  height: 0.42em;
  border-radius: 50%;
  background: var(--led-blue);
  box-shadow: 0 0 8px var(--led-blue);
  margin-right: 0.45em;
  vertical-align: 0.12em;
}

/* ---------- Links & buttons ---------- */

a {
  color: var(--led-blue);
  text-decoration: underline dotted;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

a:hover {
  color: #000;
  background: var(--led-blue);
  text-decoration: none;
  box-shadow: 0 0 14px rgba(93, 177, 255, 0.55);
}

.home-btn, .cv-btn {
  display: inline-block;
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--led-ink);
  text-decoration: none;
  border: 2px dotted var(--led-ink-faint);
  padding: 0.45rem 0.9rem;
  transition: all 0.15s ease;
}

.home-btn.secondary, .cv-btn.secondary { color: var(--led-ink-dim); }

.home-btn:hover, .cv-btn:hover {
  color: #000;
  background: var(--led-ink);
  border-color: var(--led-ink);
  border-style: solid;
  box-shadow: 0 0 16px rgba(236, 230, 214, 0.45);
}

/* ---------- Home: name, intro, typewriter ---------- */

.home-intro { gap: 2.4rem; margin-top: 2.2rem; }

.home-name {
  font-size: 3.6rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  /* hot bulb: near-white core with a soft warm bloom */
  color: #fffbe8;
  text-shadow:
    0 0 4px rgba(255, 240, 180, 0.9),
    0 0 12px rgba(255, 225, 140, 0.7),
    0 0 28px rgba(255, 200, 90, 0.4),
    0 0 60px rgba(255, 180, 50, 0.22);
  margin: 0.1rem 0 1.2rem 0;
}

.home-paragraph { font-size: 1.08rem; line-height: 1.5; }

.typewriter-line {
  border-top: 2px dotted var(--led-ink-faint);
  font-size: 1rem;
  font-weight: 700;
  color: var(--led-ink-dim);
}

.tw-prompt { color: var(--led-teal); text-shadow: 0 0 10px rgba(63, 208, 192, 0.6); }

.tw-text::after {
  content: "";
  display: inline-block;
  width: 0.55em;
  height: 0.95em;
  margin-left: 0.2rem;
  vertical-align: -0.12em;
  background: var(--led-amber);
  box-shadow: 0 0 10px var(--led-amber);
  animation: blink 1s step-end infinite;
}

/* ---------- Section headings ---------- */

.home-section h2,
.publications-content h2,
main h2 {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--led-ink);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.home-section h2::before,
.publications-content h2::before,
main h2::before {
  content: "";
  width: 0.5em;
  height: 0.5em;
  border-radius: 50%;
  background: var(--led-teal);
  box-shadow: 0 0 10px var(--led-teal);
  flex: none;
}

.home-sections + .home-sections { border-top: 2px dotted var(--led-ink-faint); }

.item-date { color: var(--led-ink-dim); font-size: 1em; font-weight: 800; letter-spacing: 0.03em; }

/* the console theme prefixes list items with "-"; the LED list uses dates instead */
.news-list li::before { content: none !important; }
.news-list .item-text { text-align: left; hyphens: none; }

/* ---------- Dot-matrix portrait ---------- */

.dot-portrait {
  position: relative;
  flex: none;
  width: 300px;
  height: 330px;                       /* matches the photo's 726:799 shape, no crop */
  background: #000;
  border: 2px dotted var(--led-ink-faint);
  padding: 6px;                        /* black bezel around the panel */
  box-sizing: border-box;
  overflow: hidden;
}

.dot-portrait .dot-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.dot-portrait img.profile-img {
  position: absolute;
  inset: 6px;
  width: calc(100% - 12px);
  height: calc(100% - 12px);
  border: 0;
  border-radius: 0;
  object-fit: cover;
  object-position: center top;
  transition: opacity 0.4s ease;
}

/* the photo is not in the page at all (the script loads it from data-src),
   so nothing can flash before the dots draw; an <img> only exists inside
   <noscript> for browsers with JavaScript off */
.dot-portrait img.profile-img { opacity: 1; }

/* ---------- Research timeline ---------- */

.research-timeline::before {
  width: 4px !important;
  left: calc(var(--line-x) - 2px) !important;
  background: radial-gradient(circle, var(--led-ink-faint) 1.3px, transparent 1.8px) center top / 4px 7px repeat-y !important;
}

.r-entry::before {
  width: 0.7rem !important;
  height: 0.7rem !important;
  left: calc(var(--line-x) - 0.35rem) !important;
  border-radius: 50%;
  background: #000 !important;
  border: 2px solid var(--led-ink-dim) !important;
}

.r-entry.published::before {
  background: var(--led-blue) !important;
  border-color: var(--led-blue) !important;
  box-shadow: 0 0 10px var(--led-blue);
}

.r-entry.published .r-body {
  border: 2px dotted var(--led-ink-faint) !important;
  box-shadow: none !important;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.r-entry.published:hover .r-body {
  border-color: var(--led-ink) !important;
  box-shadow: 0 0 18px rgba(236, 230, 214, 0.12) !important;
}

.r-entry:hover .r-title { text-decoration: none; color: var(--led-blue); text-shadow: 0 0 10px rgba(93, 177, 255, 0.5); }

.r-entry, .r-entry:hover { background: none; box-shadow: none; color: var(--led-ink); }

.r-title { font-size: 1.24rem; font-weight: 400; line-height: 1.3; letter-spacing: -0.02em; color: var(--led-ink); }
.r-desc { color: #a3adb6; font-size: 0.98rem; line-height: 1.5; }
.r-tags { color: var(--led-ink-dim); font-size: 0.86rem; letter-spacing: 0.04em; }

.research-typewriter { font-size: 1rem; border-top: none; }

/* ---------- Publications ---------- */

.publications-content p { line-height: 1.45; font-size: 0.98rem; margin-bottom: 1.4rem; white-space: normal; }
.publications-content h2 { margin-bottom: 1rem; }
.pub-title { display: block; color: var(--led-ink); font-weight: 400; font-size: 1.15em; margin-bottom: 0.1em; }
.pub-authors { display: block; color: #a3adb6; font-weight: 400; }
.publications-content strong { color: var(--led-blue); font-weight: 400; }
.venue { display: block; color: var(--led-ink-dim); font-style: italic; font-size: 0.92em; margin-top: 0.1em; }

/* ---------- Footer ---------- */

footer {
  border-top: 2px dotted var(--led-ink-faint) !important;
  color: var(--led-ink-dim) !important;
  font-size: 0.9rem;
  letter-spacing: 0.06em;
}

.site-copyright { color: var(--led-ink-dim); }

@keyframes blink { 50% { opacity: 0; } }

/* ---------- Mobile ---------- */

@media (max-width: 720px) {
  .home-intro { align-items: center; }
  .dot-portrait { width: min(320px, 100%); height: auto; aspect-ratio: 726 / 799; }
  .dot-portrait .dot-canvas { height: auto; aspect-ratio: 726 / 799; }
  .home-name { font-size: clamp(3rem, 13vw, 4rem) !important; }
  /* compact nav row that wraps cleanly instead of overflowing */
  header .menu ul { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.2rem 0.6rem; }
  header .menu ul li { margin-left: 0; }
  header .menu a { font-size: 0.74rem; letter-spacing: 0.05em; white-space: nowrap; padding: 0.1rem 0; }
  header .menu a[aria-current="page"]::before { margin-right: 0.35em; }
  .typewriter-line, .research-typewriter { font-size: 0.68rem; }
  .item-date { font-size: 0.68rem; }
  footer { font-size: 0.64rem; }

  /* phone sizes: comfortable, not huge */
  .dot-screen, .news-list .item-text, .home-section p, main > p, main > ul > li { font-size: 0.78rem; line-height: 1.45; }
  .home-paragraph { font-size: 0.8rem; line-height: 1.45; }
  .r-title { font-size: 0.9rem; line-height: 1.3; }
  .r-desc, .publications-content p { font-size: 0.74rem; line-height: 1.45; }
  .home-name { margin-bottom: 0.7rem; }

  /* tighter vertical rhythm so the page is not mostly black space */
  header { margin-top: 14px; margin-bottom: 6px; }
  header .menu { margin-bottom: 16px; }
  header .menu ul { margin-top: 5px; margin-bottom: 5px; }
  .home-intro { gap: 1.1rem; margin-top: 1rem; margin-bottom: 1rem; }
  .dot-portrait { width: min(300px, 92%); }
  .home-paragraph { margin-bottom: 0.7rem; }
  .home-actions { margin-top: 0.7rem; gap: 0.45rem; }
  .home-btn, .cv-btn { font-size: 0.58rem; padding: 0.28rem 0.55rem; }
  .typewriter-line { margin-top: 0.9rem; padding-top: 0.6rem; min-height: 0; }
  .home-sections { margin-top: 1.2rem; }
  .home-sections + .home-sections { padding-top: 1rem; }
  .home-section h2 { margin-bottom: 0.5rem; }
  .home-section h2, .publications-content h2, main h2 { font-size: 0.76rem; }
  .news-list li { margin-bottom: 0.55rem; gap: 0.05rem; }
  .research-typewriter { margin-bottom: 0.9rem; }
  .r-entry { margin-bottom: 1.1rem; }
  body .r-entry.published .r-body, main .r-entry.published .r-body { padding: 0.8rem 0.9rem 0.7rem 1rem !important; }
  .r-desc { margin-top: 0.3rem; }
  .r-tags { margin-top: 0.35rem; font-size: 0.6rem; }
  .publications-content h2 { margin-bottom: 0.6rem; }
  .publications-content p { margin-bottom: 1rem; }
  footer { margin-top: 12px; }
}

/* very small phones: keep the four nav items on one line */
@media (max-width: 360px) {
  header .menu a { font-size: 0.64rem; letter-spacing: 0.03em; }
  header .menu ul { gap: 0.2rem 0.4rem; }
}

@media (prefers-reduced-motion: reduce) {
  .tw-text::after { animation: none; }
  .dot-portrait img.profile-img { transition: none; }
}
