:root {
  color-scheme: dark;
  --background: #000;
  --panel: #303030;
  --text: #e7e7e7;
  --muted: #c5c5c5;
  --line: #242424;
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-weight: 700;
  color: var(--text);
  background: var(--background);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--background); font-size: 20px; line-height: 1.5; text-transform: lowercase; }
.keep-case, #displayName { text-transform: none; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-weight: 700; }
button, a { touch-action: manipulation; }
:focus-visible { outline: 3px solid #69b9ff; outline-offset: 5px; }
.skip-link { position: fixed; top: -100px; left: 24px; z-index: 10; background: #eee; color: #111; padding: 10px 16px; border-radius: 8px; }
.skip-link:focus { top: 10px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.profile {
  width: 100%;
  min-height: 100svh;
  margin: 0;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 19px;
}
.card { background: var(--panel); border-radius: 13px; }
.head-card { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; min-height: 179px; background: none; border-radius: 0; }
.avatar-box { flex: 0 0 auto; width: auto; height: 220px; aspect-ratio: 967 / 1100; border-radius: 16px; background: #222; object-fit: cover; }
.head-info { min-width: 0; flex: 1 1 180px; }
.head-info h1 { font-size: 46px; line-height: 1.15; margin-bottom: 7px; letter-spacing: -.5px; }
.handle { color: var(--muted); font-size: 20px; line-height: 1.5; }
.status { display: flex; align-items: center; gap: 7px; margin-top: 10px; font-size: 20px; line-height: 1.5; }
.dot { flex: 0 0 19px; height: 19px; border-radius: 50%; background: #35c875; }
.title { font-size: 23px; margin-top: 12px; line-height: 1.5; }
.about { padding: 19px; }
.about h2 { font-size: 26px; line-height: 1.4; }
.bio-copy { margin-top: 18px; }
.bio-copy p { max-width: 1080px; margin: 0 0 16px; font-size: 20px; line-height: 1.65; letter-spacing: 0; }
.bio-copy .bio-intro { font-size: 24px; font-weight: 700; }
.bio-copy strong { color: #fff; font-weight: 700; }
.bio-copy a { color: #e7e7e7; text-underline-offset: 4px; }
.bio-email { margin-top: 20px !important; }
.research-interests { margin-top: 25px; padding-top: 21px; border-top: 1px solid #4a4a4a; }
.research-interests h3 { font-size: 22px; line-height: 1.4; }
.research-interests ul { margin: 13px 0 0; padding-left: 25px; }
.research-interests li { margin: 7px 0; font-size: 18px; line-height: 1.5; }
.row-title { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 2px 0 14px; }
.row-title h2 { font-size: 26px; line-height: 1.5; }
.row-title a { font-size: 20px; color: var(--muted); text-decoration: none; white-space: nowrap; }
.row-title a:hover { color: #fff; text-decoration: underline; }
.creations { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.creation-button { min-height: 112px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 18px; padding: 19px 22px; color: var(--text); text-align: left; background: var(--panel); border: 1px solid #ffffff12; border-radius: 13px; cursor: pointer; transition: background .18s ease, border-color .18s ease, transform .18s ease; }
.creation-icon { width: 58px; height: 58px; display: grid; place-items: center; border-radius: 50%; background: #202020; font-size: 22px; font-weight: 700; }
.creation-copy { display: flex; flex-direction: column; }
.creation-copy strong { font-size: 23px; font-weight: 700; line-height: 1.35; }
.creation-copy small { color: var(--muted); font-size: 16px; line-height: 1.5; margin-top: 2px; }
.creation-arrow { color: var(--muted); font-size: 28px; transition: transform .18s ease; }
@media (hover: hover) {
  .creation-button:hover { background: #383838; border-color: #ffffff38; transform: translateY(-2px); }
  .creation-button:hover .creation-arrow { transform: translateX(4px); }
}
.badges { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; text-align: center; }
.badges li { font-size: 16px; line-height: 1.5; letter-spacing: .3px; }
.badge-icon { width: 93px; height: 93px; margin: 0 auto 3px; border-radius: 50%; display: grid; place-items: center; background: #222; }
.badge-icon svg { width: 32px; height: 32px; fill: none; stroke: #eaeaea; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
/* "Play me!" pill in the Find me row: opens Nhi's Universe */
.contact-links .play-me { position: relative; gap: 8px; padding-left: 8px; color: #fff; font-weight: 700; background: linear-gradient(135deg, #ff8fb8, #ff6fa3 55%, #c86bff); border-color: #ffffff40; }
.contact-links .play-me:hover { background: linear-gradient(135deg, #ff9ec2, #ff7fae 55%, #d27dff); transform: translateY(-2px) rotate(-2deg); }
.contact-links .play-me:active { transform: scale(.96); }
.contact-links .play-me .play-me-icon { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; flex: 0 0 30px; border-radius: 50%; background: #fff; color: #ff5f9a; }
.contact-links .play-me .play-me-icon svg { width: 13px; height: 13px; margin-left: 2px; fill: currentColor; stroke: none; }
.contact-links .play-me .sparkle { display: inline-block; transition: transform .3s ease; }
@media (hover: hover) { .contact-links .play-me:hover .sparkle { transform: rotate(20deg) scale(1.2); } }


/* day / night toggle */
.head-card { position: relative; }
.theme-toggle { position: absolute; top: 0; right: 0; width: 46px; height: 46px; display: grid; place-items: center; padding: 0; border-radius: 50%; background: var(--panel); border: 1px solid #ffffff1a; cursor: pointer; transition: background .18s ease, transform .18s ease; }
.theme-toggle:hover { transform: rotate(-15deg); }
.theme-toggle svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .icon-moon { display: none; }
[data-theme="light"] .theme-toggle .icon-sun { display: none; }
[data-theme="light"] .theme-toggle .icon-moon { display: block; }
.head-info { padding-right: 56px; }

/* day mode colours */
:root[data-theme="light"] { color-scheme: light; --background: #fbf8f5; --panel: #ece7e2; --text: #1d1d1f; --muted: #5a5a5f; }
[data-theme="light"] .bio-copy strong { color: #000; }
[data-theme="light"] .bio-copy a { color: var(--text); }
[data-theme="light"] .research-interests { border-top-color: #00000022; }
[data-theme="light"] .row-title a:hover { color: #000; }
[data-theme="light"] .creation-button,
[data-theme="light"] .contact-links a,
[data-theme="light"] .theme-toggle { border-color: #0000001a; }
@media (hover: hover) { [data-theme="light"] .creation-button:hover { background: #e3ddd7; border-color: #00000030; } }
[data-theme="light"] .creation-icon,
[data-theme="light"] .badge-icon,
[data-theme="light"] .avatar-box { background: #fff; }
[data-theme="light"] .badge-icon svg { stroke: var(--text); }
[data-theme="light"] .contact-links a:hover { background: #e3ddd7; }
[data-theme="light"] .contact-links .play-me { color: #fff; }
[data-theme="light"] dialog { background: var(--background); border-color: #0000002a; }
[data-theme="light"] dialog::backdrop { background: #0006; }
[data-theme="light"] .dialog-close { background: var(--panel); border-color: #00000030; }
[data-theme="light"] .detail-entry { background: var(--panel); }
[data-theme="light"] .detail-entry .meta { color: var(--muted); }
body, .card, .creation-button, .contact-links a, .theme-toggle { transition: background-color .25s ease, color .25s ease, border-color .25s ease, transform .18s ease; }

/* contact row */
.contact { margin: 0; padding: 0; }
.contact h2 { font-size: 26px; line-height: 1.4; margin-bottom: 14px; }
.contact-links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 12px; }
.contact-links a { display: inline-flex; align-items: center; gap: 10px; padding: 12px 20px; border-radius: 99px; background: var(--panel); border: 1px solid #ffffff1a; text-decoration: none; font-size: 18px; transition: background .18s ease, transform .18s ease; }
.contact-links a:hover { background: #3c3c3c; transform: translateY(-2px); }
.contact-links svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
dialog { width: min(820px, calc(100% - 32px)); max-height: calc(100dvh - 48px); padding: 24px; color: var(--text); background: #202020; border: 1px solid #555; border-radius: 16px; }
dialog::backdrop { background: #000c; }
body:has(dialog[open]) { overflow: hidden; }
.dialog-head { position: sticky; top: 0; z-index: 1; height: 0; display: flex; justify-content: flex-end; }
.dialog-head h2 { font-size: 28px; }
.dialog-close { border: 1px solid #666; border-radius: 50%; background: #333; width: 40px; height: 40px; flex: 0 0 40px; cursor: pointer; font-size: 28px; line-height: 1; }
.detail-section + .detail-section { margin-top: 28px; }
.detail-section > h3 { font-size: 23px; margin-bottom: 12px; }
.detail-entry { background: #303030; border-radius: 10px; padding: 18px; margin: 10px 0; font-size: 16px; }
.detail-entry h4 { margin: 0 0 7px; font-size: 19px; }
.detail-entry p { margin: 6px 0; }
.detail-entry .meta { color: #bcbcbc; }
.course-list { margin: 6px 0 0; padding-left: 22px; }
.course-list li { margin: 3px 0; }
.detail-entry a { display: inline-block; margin-top: 8px; text-underline-offset: 4px; }

@media (min-width: 900px) {
  /* centered column that fills the screen height; --w is the column's design width */
  :root { --w: 860; --u: clamp(.8px, min(calc(100svh / 700), calc(100vw / var(--w))), 2.2px); }
  body { font-size: calc(16 * var(--u)); line-height: 1.45; }
  .profile {
    max-width: calc(var(--w) * var(--u));
    margin: 0 auto;
    min-height: 100svh;
    padding: calc(20 * var(--u)) calc(24 * var(--u));
    display: flex;
    flex-direction: column;
    gap: calc(20 * var(--u));
    justify-content: space-between;
  }
  .profile > * { flex: 0 0 auto; }
  .head-card { flex-wrap: nowrap; gap: calc(16 * var(--u)); min-height: calc(88 * var(--u)); }
  .avatar-box { height: calc(170 * var(--u)); border-radius: calc(14 * var(--u)); }
  .head-info h1 { font-size: calc(42 * var(--u)); line-height: 1.15; margin-bottom: calc(4 * var(--u)); }
  .handle { font-size: calc(15 * var(--u)); line-height: 1.4; }
  .status { gap: calc(6 * var(--u)); margin-top: calc(5 * var(--u)); font-size: calc(15 * var(--u)); line-height: 1.4; }
  .dot { flex-basis: calc(12 * var(--u)); height: calc(12 * var(--u)); }
  .title { margin-top: calc(5 * var(--u)); font-size: calc(17 * var(--u)); line-height: 1.4; }

  .about { padding: calc(16 * var(--u)) calc(18 * var(--u)); }
  .about h2 { font-size: calc(22 * var(--u)); line-height: 1.3; }
  .bio-copy { margin-top: calc(7 * var(--u)); display: block; }
  .bio-copy p { max-width: none; margin: 0 0 calc(8 * var(--u)); font-size: calc(15 * var(--u)); line-height: 1.45; }
  .bio-copy p:last-child { margin-bottom: 0; }
  .bio-email { margin-top: 0 !important; }
  .research-interests { margin-top: calc(7 * var(--u)); padding-top: calc(7 * var(--u)); }
  .research-interests h3 { font-size: calc(15 * var(--u)); line-height: 1.3; }
  .research-interests ul { margin: calc(4 * var(--u)) 0 0; padding-left: calc(22 * var(--u)); }
  .research-interests li { margin: calc(2 * var(--u)) 0; font-size: calc(15 * var(--u)); line-height: 1.4; }

  .creations-section { grid-column: 1; min-width: 0; }
  .badges-section { grid-column: 2; min-width: 0; }
  .row-title { margin: 0 0 calc(10 * var(--u)); }
  .row-title h2 { font-size: calc(20 * var(--u)); line-height: 1.3; }
  .row-title a { font-size: calc(15 * var(--u)); }
  .creation-button { min-height: calc(60 * var(--u)); gap: calc(12 * var(--u)); padding: calc(8 * var(--u)) calc(15 * var(--u)); }
  .creation-icon { width: calc(38 * var(--u)); height: calc(38 * var(--u)); font-size: calc(17 * var(--u)); }
  .creation-copy strong { font-size: calc(17 * var(--u)); line-height: 1.3; }
  .creation-copy small { font-size: calc(13 * var(--u)); line-height: 1.4; margin-top: calc(1 * var(--u)); }
  .creation-arrow { font-size: calc(22 * var(--u)); }
  .badges { gap: calc(8 * var(--u)); }
  .badges li { font-size: calc(12 * var(--u)); line-height: 1.35; letter-spacing: .1px; }
  .badge-icon { width: calc(40 * var(--u)); height: calc(40 * var(--u)); margin-bottom: calc(3 * var(--u)); }
  .badge-icon svg { width: calc(25 * var(--u)); height: calc(25 * var(--u)); }

  .contact { margin: 0; padding: 0; min-width: 0; display: flex; align-items: center; gap: calc(18 * var(--u)); }
  .contact h2 { margin: 0; font-size: calc(20 * var(--u)); line-height: 1.3; }
  .contact-links { display: flex; gap: calc(8 * var(--u)); }
  .contact-links a { justify-content: center; gap: calc(6 * var(--u)); min-width: 0; padding: calc(6 * var(--u)) calc(14 * var(--u)); font-size: calc(13 * var(--u)); white-space: nowrap; }
  .contact-links svg { width: calc(17 * var(--u)); height: calc(17 * var(--u)); flex: 0 0 calc(17 * var(--u)); }
  .contact-links .play-me { padding-left: calc(6 * var(--u)); }
  .theme-toggle { width: calc(34 * var(--u)); height: calc(34 * var(--u)); }
  .theme-toggle svg { width: calc(17 * var(--u)); height: calc(17 * var(--u)); }
  .head-info { padding-right: calc(44 * var(--u)); }
  .contact-links .play-me .play-me-icon { width: calc(22 * var(--u)); height: calc(22 * var(--u)); flex-basis: calc(22 * var(--u)); }
  .contact-links .play-me .play-me-icon svg { width: calc(10 * var(--u)); height: calc(10 * var(--u)); flex-basis: auto; }

}

@media (max-width: 899px) {
  body { font-size: 16px; }
  .profile { width: 100%; padding: 16px 14px; gap: 18px; }
  .head-card { gap: 15px; min-height: 128px; }
  .head-card .avatar-box + .head-info { flex-basis: 0; }
  .avatar-box { height: 150px; border-radius: 14px; }
  .head-info h1 { font-size: 32px; margin-bottom: 3px; }
  .theme-toggle { width: 38px; height: 38px; }
  .theme-toggle svg { width: 19px; height: 19px; }
  .head-info { padding-right: 44px; }
  .handle, .status { font-size: 15px; }
  .status { margin-top: 5px; gap: 5px; }
  .dot { flex-basis: 12px; height: 12px; }
  .title { font-size: 16px; line-height: 1.4; margin-top: 7px; }
  .about { padding: 16px; }
  .about h2, .row-title h2 { font-size: 22px; }
  .bio-copy { margin-top: 13px; }
  .bio-copy p { font-size: 16px; line-height: 1.65; margin-bottom: 13px; }
  .bio-copy .bio-intro { font-size: 19px; }
  .research-interests { margin-top: 20px; padding-top: 17px; }
  .research-interests h3 { font-size: 19px; }
  .research-interests li { font-size: 15px; }
  .row-title { margin-bottom: 10px; }
  .row-title a { font-size: 16px; }
  .creations { gap: 10px; }
  .creation-button { min-height: 92px; gap: 10px; padding: 13px; }
  .creation-icon { width: 42px; height: 42px; font-size: 16px; }
  .creation-copy strong { font-size: 17px; }
  .creation-copy small { font-size: 12px; }
  .creation-arrow { font-size: 21px; }
  .badge-icon { width: 62px; height: 62px; }
  .badge-icon svg { width: 26px; height: 26px; }
  .badges { gap: 4px; }
  .badges li { font-size: 12px; letter-spacing: 0; }
  .contact h2 { font-size: 22px; }
  .contact-links { gap: 8px; }
  .contact-links a { font-size: 15px; padding: 10px 15px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }
