/* lamhuynh.info — modern layout stylesheet */

/* ---------- Tokens ---------- */
:root {
  --bg:        #fdfdfd;
  --surface:   #ffffff;
  --text:      #1a1a1a;
  --muted:     #666666;
  --accent:    #1772d0;
  --accent-h:  #f09228;
  --border:    #e5e5e5;
  --shadow:    0 1px 2px rgba(0, 0, 0, 0.04);

  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  --font-name: Georgia, "Times New Roman", serif;

  --container-max: 960px;
  --pad-x: 1.5rem;
}

html[data-theme="dark"] {
  --bg:       #0f1419;
  --surface:  #151b22;
  --text:     #e8e8e8;
  --muted:    #999999;
  --accent:   #4a9eff;
  --accent-h: #ffb366;
  --border:   #2a2a2a;
  --shadow:   0 1px 2px rgba(0, 0, 0, 0.3);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
body, h1, h2, h3, p, ul, figure { margin: 0; }
ul { padding: 0; list-style: none; }
img { max-width: 100%; height: auto; display: block; }

/* ---------- Base typography ---------- */
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  font-size: 0.975rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  transition: background 0.15s ease, color 0.15s ease;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s ease;
}
a:hover, a:focus { color: var(--accent-h); }

strong { font-weight: 600; }

/* ---------- Container ---------- */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding-left: var(--pad-x);
  padding-right: var(--pad-x);
}
@media (min-width: 768px) {
  :root { --pad-x: 2rem; }
}
/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  height: 56px;
}

.brand {
  font-family: var(--font-name);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
}
.brand:hover { color: var(--accent); }

.nav-links {
  display: flex;
  gap: 1.25rem;
  margin-left: auto;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.nav-links::-webkit-scrollbar { display: none; }
.nav-links a {
  color: var(--muted);
  font-size: 0.9rem;
  white-space: nowrap;
}
.nav-links a:hover {
  color: var(--accent-h);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.theme-toggle {
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  color: var(--text);
}
.theme-toggle:hover { color: var(--accent-h); }

/* ---------- Sections ---------- */
.section {
  padding: 2.5rem 0;
  border-top: 1px solid var(--border);
}
#research { border-top: none; }
@media (min-width: 768px) {
  .section { padding: 4rem 0; }
}

.section h2 {
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 1.5rem;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  margin-top: 2rem;
  color: var(--muted);
  font-size: 0.875rem;
  text-align: center;
}
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--accent-h); }

/* ---------- Hero ---------- */
.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  padding: 3rem 0 2rem;
  align-items: center;
}
@media (min-width: 768px) {
  .hero {
    grid-template-columns: 1.5fr 1fr;
    gap: 3rem;
    padding: 4rem 0 3rem;
  }
}

.hero-text .name {
  font-family: var(--font-name);
  font-size: 2.25rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 1rem;
}

.hero-text p { margin-bottom: 1rem; }

.hero-image img {
  border-radius: 50%;
  max-width: 280px;
  margin: 0 auto;
}

.social-icons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}
.social-icons img {
  width: 36px;
  height: 36px;
  transition: transform 0.15s ease;
}
.social-icons a:hover img { transform: scale(1.1); }

/* CSS tooltip — appears on hover, no JS needed */
.social-icon { position: relative; }
.social-icon a[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: -2rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: var(--bg);
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}
.social-icon a[data-tooltip]:hover::after { opacity: 1; }

/* ---------- Entry (paper / project / note) ---------- */
.entry {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--border);
}
.entry:first-of-type { border-top: none; }

@media (min-width: 640px) {
  .entry {
    grid-template-columns: 140px 1fr;
    gap: 1.5rem;
  }
}

.entry-thumb {
  position: relative;
  width: 100%;
  max-width: 140px;
}
.entry-thumb img {
  width: 100%;
  height: auto;
  border-radius: 4px;
  transition: transform 0.2s ease;
}
.entry-thumb:hover img { transform: scale(1.03); }

/* Hover-swap thumbnails — preserve original .one/.two/.fade behavior */
.entry-thumb.one { width: 140px; height: 140px; position: relative; }
.entry-thumb.one .two {
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  transition: opacity 0.2s ease-in-out;
}
.entry-thumb.one:hover .fade { opacity: 0; }
.entry-thumb.one:hover .two  { opacity: 1; }

.entry-title {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  line-height: 1.3;
}
.entry-authors {
  font-size: 0.9rem;
  color: var(--text);
  margin-bottom: 0.25rem;
}
.entry-venue {
  font-size: 0.9rem;
  color: var(--muted);
  font-style: italic;
  margin-bottom: 0.5rem;
}
.entry-links {
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}
.entry-links a + a::before,
.entry-links a + .entry-link-plain::before {
  content: " / ";
  color: var(--muted);
}
.entry-abstract {
  font-size: 0.9rem;
  color: var(--muted);
}

.activities p { margin-bottom: 0.75rem; }

/* ---------- Responsive ---------- */
@media (max-width: 639px) {
  .hero-text .name { font-size: 1.75rem; }
  .section h2 { font-size: 1.4rem; }
  .hero { padding: 2rem 0 1rem; }
  .hero-image img { max-width: 200px; }
  .nav { gap: 0.75rem; }
  .brand { font-size: 1rem; }
  .nav-links { gap: 0.75rem; }
  .nav-links a { font-size: 0.8rem; }
}
