/* ============================================
   Personal homepage demo — adapted from TEITAR-mxh (Luka-based)
   ============================================ */

:root {
  --mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', 'Consolas', monospace;
}

/* ---- neutral light and dark palettes ---- */
[data-theme="light"] {
  color-scheme: light;
  --luka-bg: #ffffff; --luka-text: #24272c; --luka-accent: #343a40;
  --luka-on-accent: #ffffff; --luka-accent-soft: rgba(52,58,64,.07);
  --luka-secondary: #697079; --luka-border: #d5d9df;
  --luka-shadow: rgba(25,30,40,.08); --luka-shadow-soft: rgba(25,30,40,.04);
  --luka-panel: #ffffff; --luka-panel-muted: #f5f6f8;
  --luka-nav-bg: rgba(255,255,255,.94); --luka-social-bg: #ffffff;
  --luka-social-text: #565d67; --luka-footer-border: #e8eaee;
}
[data-theme="dark"] {
  color-scheme: dark;
  --luka-bg: #17191c; --luka-text: #e5e7eb; --luka-accent: #e0e4e9;
  --luka-on-accent: #17191c; --luka-accent-soft: rgba(224,228,233,.10);
  --luka-secondary: #a2a9b2; --luka-border: #424850;
  --luka-shadow: rgba(0,0,0,.25); --luka-shadow-soft: rgba(0,0,0,.15);
  --luka-panel: #1c1f23; --luka-panel-muted: #25292f;
  --luka-nav-bg: rgba(23,25,28,.94); --luka-social-bg: #1c1f23;
  --luka-social-text: #d1d5db; --luka-footer-border: #30353b;
}
/* ---- sidebar subtitle ---- */
body.theme-luka .sidebar-sub {
  margin: -6px 0 18px;
  font-size: 14px;
  color: var(--luka-secondary);
  letter-spacing: 0.02em;
}

/* ---- sidebar typewriter ---- */
body.theme-luka .welcome-note { min-height: 1.4em; }
body.theme-luka .tw-caret {
  display: inline-block; width: 2px; height: 0.9em; margin-left: 2px;
  background: var(--luka-accent); vertical-align: text-bottom;
  animation: tw-blink 1s step-end infinite;
}
@keyframes tw-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

/* ---- avatar decoration (ring around the portrait) ---- */
body.theme-luka .image.avatar {
  clip-path: none;
  box-shadow: 0 10px 30px var(--luka-shadow),
              0 0 0 5px var(--luka-accent-soft),
              0 0 0 6px var(--luka-border);
}

/* ---- site name decoration (gradient + underline) ---- */
body.theme-luka .name-lettering {
  display: inline-block;
  transform: scale(1.08, 0.9);
  transform-origin: center;
  color: var(--luka-text);
}
body.theme-luka .site-name::after {
  content: '';
  display: block;
  width: 44px;
  height: 3px;
  margin: 14px auto 0;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--luka-accent), var(--luka-border));
}

/* ---- UI polish ---- */
body.theme-luka .section-title::before {
  content: '';
  flex-shrink: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--luka-accent);
  box-shadow: 0 0 0 3px var(--luka-accent-soft);
}
body.theme-luka .comp-item { transition: color var(--luka-motion-fast) ease; }
body.theme-luka .comp-item:hover .comp-name { color: var(--luka-accent); }
body.theme-luka .nav-link { transition: color var(--luka-motion-fast) ease, background-color var(--luka-motion-fast) ease, transform var(--luka-motion-press) var(--luka-ease-out); }

/* ---- bilibili icon fill ---- */
body.theme-luka .social-icons .icon-bilibili { fill: currentColor; stroke: none; }

/* ---- honors chapter-index: competitions and scholarships ---- */
body.theme-luka .chapter-index { grid-template-columns: repeat(2, minmax(0, 1fr)); }
body.theme-luka .reading-track { left: 25%; right: 25%; }

/* ---- panel visibility for renamed chapters (prevents FOUC on #honors / #life) ---- */
html[data-panel="honors"] .site-panel:not(#honors),
html[data-panel="life"] .site-panel:not(#life) { display: none; }

/* ---- news / announcements ---- */
body.theme-luka .announce-list { display: flex; flex-direction: column; }
body.theme-luka .announce-item {
  display: flex; gap: 16px; padding: 16px 0;
  border-bottom: 1px solid var(--luka-footer-border);
}
body.theme-luka .announce-item:last-child { border-bottom: none; }
body.theme-luka .announce-date {
  flex-shrink: 0; width: 64px; padding-top: 2px;
  font-family: var(--mono); font-size: 12px; color: var(--luka-secondary);
  font-variant-numeric: tabular-nums;
}
body.theme-luka .announce-tag {
  display: inline-block; margin-right: 6px; padding: 2px 8px; border-radius: 999px;
  font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: 0.02em;
  background: var(--luka-accent-soft); color: var(--luka-accent);
}
body.theme-luka .announce-body { flex: 1; min-width: 0; }
body.theme-luka .announce-title { font-weight: 600; color: var(--luka-text); font-size: 16px; }
body.theme-luka .announce-desc { margin-top: 6px; font-size: 14px; color: var(--luka-secondary); line-height: 1.7; }

/* ---- competitions ---- */
body.theme-luka .comp-list { display: flex; flex-direction: column; }
body.theme-luka .comp-item {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  padding: 13px 0; border-bottom: 1px solid var(--luka-footer-border);
}
body.theme-luka .comp-item:last-child { border-bottom: none; }
body.theme-luka .comp-name { font-weight: 600; color: var(--luka-text); font-size: 15.5px; }
body.theme-luka .comp-award { flex-shrink: 0; text-align: right; font-size: 13.5px; color: var(--luka-accent); font-weight: 600; white-space: nowrap; }

/* ---- projects ---- */
body.theme-luka .proj-list { display: flex; flex-direction: column; gap: 16px; }
body.theme-luka .proj-card {
  display: flex; align-items: center; padding: 0; overflow: hidden;
  border: 1px solid var(--luka-footer-border); border-radius: 14px;
  background: var(--luka-panel);
  transition: border-color var(--luka-motion-fast) ease, box-shadow var(--luka-motion-fast) var(--luka-ease-out), transform var(--luka-motion-press) var(--luka-ease-out);
}
body.theme-luka .proj-card:hover {
  border-color: var(--luka-border);
  box-shadow: 0 10px 28px var(--luka-shadow-soft);
  transform: translateY(-2px);
}
body.theme-luka .proj-thumb { flex: 0 0 300px; aspect-ratio: 16/9; overflow: hidden; background: var(--luka-panel-muted); }
body.theme-luka .proj-thumb img {
  width: 100%; height: 100%; display: block;
  object-fit: contain;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
body.theme-luka .proj-card:hover .proj-thumb img { transform: scale(1.05); }
body.theme-luka .proj-body { flex: 1; min-width: 0; padding: 18px 22px; }
body.theme-luka .proj-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
body.theme-luka .proj-title { font-weight: 600; color: var(--luka-text); font-size: 16.5px; }
body.theme-luka .proj-tag { font-family: var(--mono); font-size: 12px; color: var(--luka-accent); white-space: nowrap; }
body.theme-luka .proj-desc { margin-top: 8px; font-size: 14.5px; color: var(--luka-secondary); line-height: 1.75; }

/* ---- experience ---- */
body.theme-luka .exp-block { margin-bottom: 26px; }
body.theme-luka .exp-block:last-child { margin-bottom: 0; }
body.theme-luka .exp-label { font-size: 14px; color: var(--luka-accent); font-weight: 700; margin-bottom: 8px; }
body.theme-luka .exp-item { display: flex; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--luka-footer-border); }
body.theme-luka .exp-item:last-child { border-bottom: none; }
body.theme-luka .exp-tag { flex-shrink: 0; width: 48px; padding-top: 1px; font-family: var(--mono); font-size: 12px; color: var(--luka-secondary); }
body.theme-luka .exp-body { flex: 1; min-width: 0; }
body.theme-luka .exp-title { font-weight: 600; color: var(--luka-text); }
body.theme-luka .exp-desc { margin-top: 2px; font-size: 14px; color: var(--luka-secondary); line-height: 1.7; }
body.theme-luka .exp-meta { margin-top: 3px; font-family: var(--mono); font-size: 12px; color: var(--luka-accent); }

/* ---- education ---- */
body.theme-luka .edu-card {
  padding: 20px 24px; border: 1px solid var(--luka-footer-border); border-radius: 14px;
  background: var(--luka-panel);
}
body.theme-luka .edu-card + .edu-card { margin-top: 12px; }
body.theme-luka .edu-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
body.theme-luka .edu-logo {
  flex-shrink: 0; width: 66px; height: 66px; object-fit: contain;
  padding: 7px; border-radius: 15px;
  background: #fff; border: 1px solid var(--luka-footer-border);
  box-shadow: 0 2px 10px var(--luka-shadow-soft);
}
body.theme-luka .edu-main { min-width: 0; }
body.theme-luka .edu-name { font-size: 16.5px; }
body.theme-luka .edu-meta { margin-top: 2px; font-size: 14px; color: var(--luka-secondary); }
body.theme-luka .edu-period { flex-shrink: 0; font-family: var(--mono); font-size: 13px; color: var(--luka-accent); font-weight: 600; white-space: nowrap; }
body.theme-luka .edu-extra { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--luka-footer-border); font-size: 13.5px; color: var(--luka-secondary); line-height: 1.8; }

/* ---- gallery ---- */
body.theme-luka .gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
body.theme-luka .gallery-item {
  position: relative; aspect-ratio: 3/2; overflow: hidden; border-radius: 10px;
  cursor: pointer; background: var(--luka-panel-muted);
}
body.theme-luka .gallery-item img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
body.theme-luka .gallery-item:hover img { transform: scale(1.05); }
body.theme-luka .gallery-cap {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 14px 10px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.55)); color: #fff;
  font-size: 12.5px; opacity: 0; transition: opacity 0.3s;
}
body.theme-luka .gallery-item:hover .gallery-cap { opacity: 1; }

/* ---- videos ---- */
body.theme-luka .video-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
body.theme-luka .video-card { border-radius: 12px; overflow: hidden; border: 1px solid var(--luka-footer-border); background: var(--luka-panel); }
body.theme-luka .video-poster { position: relative; aspect-ratio: 16/9; cursor: pointer; overflow: hidden; }
body.theme-luka .video-poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
body.theme-luka .video-poster .play-btn {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, 0.18); transition: background 0.3s;
}
body.theme-luka .video-poster:hover .play-btn { background: rgba(0, 0, 0, 0.28); }
body.theme-luka .play-btn svg { width: 48px; height: 48px; fill: rgba(255, 255, 255, 0.9); transition: transform 0.3s; }
body.theme-luka .video-poster:hover .play-btn svg { transform: scale(1.08); }
body.theme-luka .video-info { padding: 12px 16px 14px; }
body.theme-luka .video-title { font-weight: 600; color: var(--luka-text); font-size: 14.5px; }
body.theme-luka .video-desc { margin-top: 2px; font-size: 12.5px; color: var(--luka-secondary); }

/* ---- lightbox ---- */
body.theme-luka .lightbox {
  position: fixed; inset: 0; z-index: 500; background: rgba(0, 0, 0, 0.94);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity 0.3s;
}
body.theme-luka .lightbox.open { opacity: 1; pointer-events: auto; }
body.theme-luka .lightbox img { max-width: 90vw; max-height: 85vh; transform: scale(0.92); transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1); }
body.theme-luka .lightbox.open img { transform: scale(1); }
body.theme-luka .lightbox-close {
  position: absolute; top: 16px; right: 24px; color: #fff; font-size: 1.8rem;
  cursor: pointer; opacity: 0.6; transition: opacity 0.2s; background: none; border: none; line-height: 1; padding: 8px;
}
body.theme-luka .lightbox-close:hover { opacity: 1; }
body.theme-luka .lightbox-caption { position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%); color: rgba(255, 255, 255, 0.7); font-size: 13px; }

/* ---- responsive ---- */
@media (max-width: 640px) {
  body.theme-luka .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.theme-luka .video-grid { grid-template-columns: minmax(0, 1fr); }
  body.theme-luka .comp-item { flex-direction: column; align-items: flex-start; gap: 2px; }
  body.theme-luka .comp-award { text-align: left; white-space: normal; }
  body.theme-luka .announce-item { flex-direction: column; gap: 4px; }
  body.theme-luka .announce-date { width: auto; text-align: left; }
  body.theme-luka .edu-row { flex-direction: column; align-items: flex-start; gap: 4px; }
  body.theme-luka .proj-card { flex-direction: column; }
  body.theme-luka .proj-thumb { flex-basis: auto; width: 100%; min-height: 0; aspect-ratio: 16/9; }
}

/* Local demo: placeholder assets, white default, no external tracking. */
body.theme-luka .image.avatar img { top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; }
body.theme-luka .demo-note { margin: 24px auto 0; padding: 13px 16px; max-width: 238px; border: 1px dashed var(--luka-border); border-radius: 12px; color: var(--luka-secondary); font-size: 12px; line-height: 1.8; }
body.theme-luka .demo-note strong { color: var(--luka-text); display: block; font-size: 13px; }
body.theme-luka .sidebar-motto { margin-top: 24px; max-width: 100%; text-align: center; }
body.theme-luka .section-body p { margin-top: 0; }
body.theme-luka .edu-main { flex: 1; }
body.theme-luka .proj-desc details { margin-top: 10px; }
body.theme-luka .proj-desc summary { color: var(--luka-text); cursor: pointer; font-size: 12px; }
body.theme-luka .proj-desc details p { margin: 8px 0 0; font-size: 13px; }
body.theme-luka .gallery-item { padding: 0; border: 1px solid var(--luka-footer-border); font: inherit; }
body.theme-luka .gallery-cap { opacity: 1; }
body.theme-luka .lightbox { z-index: 2000; }
body.theme-luka .site-footer { font-size: 12px; }
body.theme-luka .site-footer p { margin: 4px 0; }
body.theme-luka .site-footer a { text-decoration: underline; }
body.theme-luka .placeholder-label { display: block; font-family: var(--mono); font-size: 12px; color: var(--luka-secondary); margin-bottom: 18px; }

body.theme-luka .lightbox[hidden] { display: none; }

/* Resume awards: wrap long competition names and award labels. */
body.theme-luka .comp-name { flex: 1; min-width: 0; }
body.theme-luka .comp-award { max-width: 44%; white-space: normal; }
body.theme-luka .award-detail { margin-top: 5px; color: var(--luka-secondary); font-size: 13px; line-height: 1.7; }
@media (max-width: 640px) { body.theme-luka .comp-award { max-width: 100%; } }

/* Internship responsibilities from the supplied resume. */
body.theme-luka .internship-details { margin: 12px 0 0; padding-left: 1.3em; font-size: 14px; line-height: 1.85; color: var(--luka-secondary); }
body.theme-luka .internship-details li + li { margin-top: 8px; }

/* Bilingual navigation beside the theme control. */
body.theme-luka .nav-container { gap: 12px; }
body.theme-luka .nav-right { display: flex; align-items: center; gap: 8px; }
body.theme-luka .language-switch { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; font-size: 12px; }
body.theme-luka .language-switch a { display: inline-flex; align-items: center; justify-content: center; min-width: 33px; min-height: 36px; padding: 3px 6px; border-radius: 8px; color: var(--luka-secondary); }
body.theme-luka .language-switch a[aria-current="page"] { color: var(--luka-text); background: var(--luka-accent-soft); font-weight: 700; }
body.theme-luka .language-switch a:hover { color: var(--luka-text); background: var(--luka-accent-soft); }
body.theme-luka .language-switch a:focus-visible { outline: 2px solid var(--luka-accent); outline-offset: 2px; }
body.theme-luka .language-switch > span { color: var(--luka-secondary); opacity: .5; }
body.theme-luka .edu-logo { padding: 3px; }
html[lang="en"] body.theme-luka .comp-name { overflow-wrap: anywhere; }
html[lang="en"] body.theme-luka .edu-name { line-height: 1.45; }
@media (max-width: 480px) {
  body.theme-luka .nav-container { gap: 4px; padding-left: 12px; padding-right: 12px; }
  body.theme-luka .nav-left { flex: 1; }
  body.theme-luka .nav-link { padding-left: 7px; padding-right: 7px; font-size: 13px; }
  body.theme-luka .nav-right { gap: 2px; }
  body.theme-luka .language-switch { gap: 0; }
  body.theme-luka .language-switch a { min-width: 30px; padding-left: 4px; padding-right: 4px; }
}

/* Real project descriptions, team details and repository links. */
body.theme-luka .proj-desc p { margin: 0; }
body.theme-luka .proj-desc p + p { margin-top: 8px; }
body.theme-luka .proj-desc a { text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; }
body.theme-luka .proj-metadata { margin-top: 14px; padding-top: 11px; border-top: 1px solid var(--luka-footer-border); color: var(--luka-secondary); font-size: 12px; line-height: 1.8; }
body.theme-luka .proj-metadata p { margin: 0; }
body.theme-luka .proj-metadata p + p { margin-top: 4px; }
body.theme-luka .proj-meta-label { font-weight: 600; }
body.theme-luka .proj-metadata a { overflow-wrap: anywhere; text-decoration: underline; text-underline-offset: 3px; }
body.theme-luka a.proj-thumb { display: block; align-self: center; }
body.theme-luka a.proj-thumb:focus-visible { outline: 2px solid var(--luka-accent); outline-offset: -3px; }

/* Personal profile and GitHub mark. */
body.theme-luka .social-icons .icon-github { fill: currentColor; stroke: none; }
body.theme-luka .image.avatar img { object-position: center 62%; }
