/* Suandok Bioinformatics Unit — home page.
   Light editorial canvas, oversized type, floating pill nav; SBU pixel-brand
   colours (navy / blue / teal) taken from the logo. */
:root {
  --canvas: #ecebe7;
  --paper: #f6f5f2;
  --ink: #141519;
  --ink-2: #4a4d57;
  --muted: #8b8e98;
  --line: #d6d4cd;
  --navy: #262f78;
  --blue: #2b5fb4;
  --teal: #2bd9cc;
  --teal-soft: #c9f4ef;
  --night: #121427;
  --radius: 22px;
  --pad: clamp(18px, 3.2vw, 44px);
  --ease: cubic-bezier(.2, .7, .1, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--canvas); color: var(--ink);
  font: 400 17px/1.55 "Inter Tight", "Sarabun", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
.pixel { image-rendering: pixelated; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 99px; }
.skip:focus { left: 16px; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 6px; }

/* micro label "• OUR RESEARCH" */
.label { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 18px;
  font: 700 11px/1 "Space Mono", monospace; letter-spacing: .12em; text-transform: uppercase; color: var(--ink); }
.label i { width: 7px; height: 7px; border-radius: 50%; background: var(--ink); display: inline-block; }
.label.light { color: #fff; } .label.light i { background: var(--teal); }
.label.center { display: flex; justify-content: center; }

/* underlined text link */
.u { position: relative; font-size: 14px; font-weight: 500; padding-bottom: 2px; background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat; transition: background-size .35s var(--ease); }
.u:hover { background-size: 0 1px; background-position: 100% 100%; }
.u.strong { font-weight: 600; }
.u.light { color: #fff; }

/* ---------- top bar ---------- */
.top { position: fixed; inset: 0 0 auto; z-index: 40; display: flex; justify-content: space-between; align-items: center;
  padding: 22px var(--pad); pointer-events: none; }
.top > * { pointer-events: auto; }
.logo { display: flex; align-items: center; gap: 10px; font: 700 15px/1 "Space Mono", monospace; letter-spacing: .14em; }
.logo sup { font-size: .7em; }
.top-links { display: flex; align-items: center; gap: 22px; }
.pill { font-size: 13px; font-weight: 500; border: 1px solid var(--ink); border-radius: 99px; padding: 8px 16px; transition: background .25s, color .25s; background: color-mix(in srgb, var(--canvas) 70%, transparent); backdrop-filter: blur(6px); }
.pill:hover { background: var(--ink); color: #fff; }
.top a { transition: color .3s, border-color .3s, background .3s; }
.top.on-dark { color: #fff; }
.top.on-dark .pill { border-color: #fff; background: rgba(18, 20, 39, .5); }
.top.on-dark .pill:hover { background: #fff; color: var(--night); }

/* ---------- hero ---------- */
.hero { position: relative; min-height: 100svh; display: grid; place-items: center; padding: 120px var(--pad) 140px; }
.hero-title { margin: 0; text-align: center; font-weight: 400; letter-spacing: -.045em; line-height: .92;
  font-size: clamp(56px, 11.5vw, 190px); display: grid; grid-template-columns: auto auto; grid-template-areas: "l1 m" "l2 l2"; align-items: center; justify-content: center; column-gap: .12em; }
.hero-title .l1 { grid-area: l1; }
.hero-title .l2 { grid-area: l2; }
.hero-title em { font-style: normal; color: var(--navy); }
.hero-title sup { font-size: .25em; vertical-align: super; }
.mascot { grid-area: m; width: .95em; display: block; transform: rotate(-8deg); }
.mascot img { width: 100%; filter: drop-shadow(0 18px 30px rgba(38, 47, 120, .25)); animation: bob 6s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-.06em) rotate(4deg); } }
.foot { position: absolute; bottom: 34px; margin: 0; font-size: 12px; color: var(--ink-2); }
.foot-l { left: var(--pad); }
.foot-r { right: var(--pad); text-align: right; }

/* news card */
.news { position: absolute; right: var(--pad); bottom: 96px; width: 270px; padding: 16px 18px 18px; border-radius: 14px; color: #fff;
  background: var(--night); overflow: hidden; box-shadow: 0 20px 50px rgba(18, 20, 39, .25); display: flex; flex-direction: column; gap: 8px; transition: transform .35s var(--ease); }
.news:hover { transform: translateY(-4px); }
.news-art { position: absolute; inset: 0; opacity: .55; background:
  repeating-linear-gradient(90deg, transparent 0 14px, rgba(43, 217, 204, .18) 14px 16px),
  linear-gradient(160deg, #2b5fb4 0%, #262f78 55%, #121427 100%); }
.news > *:not(.news-art) { position: relative; }
.news-link::after { content: ""; position: absolute; inset: -200px; }   /* whole card clickable */
.news-link strong { font-size: 19px; font-weight: 500; line-height: 1.15; letter-spacing: -.01em; }
.news-sub { font-size: 12px; color: #cfd3ff; }
.chip { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; background: var(--teal); color: var(--night); border-radius: 99px; padding: 4px 10px; font: 700 10px/1 "Space Mono", monospace; text-transform: uppercase; letter-spacing: .08em; }
.chip i { width: 6px; height: 6px; border-radius: 50%; background: var(--night); }
.news-x { position: absolute !important; top: 8px; right: 10px; z-index: 2; background: none; border: 0; color: #fff; font-size: 18px; cursor: pointer; opacity: .7; }
.news-x:hover { opacity: 1; }
.news.gone { display: none; }

/* ---------- dark band ---------- */
.band { background: var(--night); color: #e8e9f5; border-radius: var(--radius) var(--radius) 0 0; overflow: hidden; }
.marquee { border-bottom: 1px solid rgba(255, 255, 255, .1); padding: 26px 0; overflow: hidden; }
.track { display: flex; gap: 34px; width: max-content; animation: slide 38s linear infinite; font-size: clamp(30px, 4.6vw, 64px); letter-spacing: -.03em; white-space: nowrap; }
.track b { color: var(--teal); font-weight: 400; font-size: .5em; align-self: center; }
@keyframes slide { to { transform: translateX(-50%); } }
.band-body { padding: clamp(60px, 9vw, 130px) var(--pad); max-width: 1320px; margin: 0 auto; }
.statement { font-size: clamp(26px, 3.6vw, 52px); line-height: 1.12; letter-spacing: -.025em; margin: 0; max-width: 22ch; max-width: 1100px; font-weight: 300; }
.statement strong { font-weight: 500; }
.band .hl { color: var(--teal); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; margin-top: clamp(50px, 7vw, 90px); background: rgba(255, 255, 255, .12); border-radius: 16px; overflow: hidden; }
.stats > div { background: var(--night); padding: 26px 22px 22px; }
.stats strong { display: block; font-size: clamp(38px, 4.4vw, 64px); font-weight: 400; letter-spacing: -.04em; color: #fff; line-height: 1; }
.stats span { display: block; margin-top: 10px; font-size: 13px; color: #9aa0c7; }

/* ---------- research list ---------- */
.research { display: grid; grid-template-columns: minmax(220px, 1fr) 3fr; gap: 40px; padding: clamp(80px, 10vw, 150px) var(--pad); background: var(--paper); }
.side { position: sticky; top: 110px; align-self: start; }
.side-text { font-size: 19px; line-height: 1.3; margin: 0 0 22px; max-width: 18ch; }
.biglist { list-style: none; margin: 0; padding: 0; counter-reset: bl; }
.biglist li { border-top: 1px solid var(--line); counter-increment: bl; }
.biglist li:last-child { border-bottom: 1px solid var(--line); }
.biglist li > * { display: grid; grid-template-columns: 1fr; padding: 18px 0 20px; position: relative; }
.bl-title { font-size: clamp(36px, 5.6vw, 92px); letter-spacing: -.045em; line-height: 1; transition: transform .45s var(--ease), color .3s; }
.bl-title::before { content: "0" counter(bl); font: 700 12px/1 "Space Mono", monospace; letter-spacing: .1em; vertical-align: top; margin-right: 14px; color: var(--muted); }
.bl-desc { max-height: 0; overflow: hidden; opacity: 0; font-size: 16px; color: var(--ink-2); max-width: 60ch; transition: max-height .5s var(--ease), opacity .4s, margin .4s; }
.bl-desc em { font-style: normal; color: var(--blue); font-weight: 500; }
.biglist li:hover .bl-title, .biglist li:focus-within .bl-title { transform: translateX(18px); color: var(--navy); }
.biglist li:hover .bl-desc, .biglist li:focus-within .bl-desc { max-height: 120px; opacity: 1; margin-top: 10px; }

/* ---------- feature cards ---------- */
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 0 var(--pad) clamp(80px, 10vw, 140px); background: var(--paper); }
.card { position: relative; min-height: 440px; border-radius: var(--radius); overflow: hidden; color: #fff; padding: 34px; display: flex; flex-direction: column; justify-content: flex-end; gap: 14px; isolation: isolate; }
.card-art { position: absolute; inset: 0; z-index: -1; transition: transform .8s var(--ease); }
.card:hover .card-art { transform: scale(1.05); }
.pix-a { background:
  linear-gradient(180deg, rgba(18, 20, 39, 0) 30%, rgba(18, 20, 39, .85)),
  repeating-linear-gradient(0deg, rgba(255, 255, 255, .05) 0 2px, transparent 2px 22px),
  repeating-linear-gradient(90deg, rgba(43, 217, 204, .22) 0 22px, transparent 22px 44px),
  linear-gradient(135deg, #2bd9cc, #2b5fb4 45%, #262f78); }
.pix-b { background:
  linear-gradient(180deg, rgba(18, 20, 39, 0) 30%, rgba(18, 20, 39, .85)),
  radial-gradient(circle at 75% 30%, rgba(43, 217, 204, .55), transparent 40%),
  repeating-radial-gradient(circle at 75% 30%, rgba(255, 255, 255, .07) 0 2px, transparent 2px 26px),
  linear-gradient(160deg, #262f78, #121427); }
.card-kicker { font: 700 11px/1 "Space Mono", monospace; letter-spacing: .12em; text-transform: uppercase; color: var(--teal-soft); }
.card-title { font-size: clamp(26px, 2.8vw, 40px); line-height: 1.08; letter-spacing: -.025em; max-width: 18ch; }
.card .u { align-self: flex-start; }

/* ---------- approach cloud ---------- */
.approach { padding: clamp(90px, 11vw, 160px) var(--pad); text-align: center; }
.cloud { display: flex; flex-wrap: wrap; justify-content: center; gap: .05em .45em; max-width: 1200px; margin: 10px auto 40px;
  font-size: clamp(40px, 6.6vw, 104px); letter-spacing: -.045em; line-height: 1.02; }
.cloud span { color: #d3d1ca; transition: color .4s var(--ease); cursor: default; }
.cloud span.lit, .cloud span:hover { color: var(--ink); }
.cloud span:nth-child(3n).lit { color: var(--navy); }
.approach-text { max-width: 56ch; margin: 0 auto; font-size: 19px; color: var(--ink-2); }

/* ---------- team ---------- */
.team { padding: clamp(80px, 10vw, 140px) var(--pad); background: var(--paper); border-radius: var(--radius) var(--radius) 0 0; }
.team-head { display: flex; justify-content: space-between; align-items: end; flex-wrap: wrap; gap: 20px; margin-bottom: 40px; }
.team-head h2 { margin: 0; font-weight: 400; font-size: clamp(40px, 5.4vw, 84px); letter-spacing: -.045em; line-height: .98; }
.people { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; }
.person { display: flex; flex-direction: column; gap: 4px; }
.person img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 50%; filter: grayscale(1) contrast(1.05); background: var(--line); transition: filter .5s var(--ease), transform .5s var(--ease), box-shadow .5s var(--ease); margin-bottom: 12px; }
.person:hover img { filter: none; transform: translateY(-6px) rotate(-2deg); box-shadow: 0 0 0 6px var(--teal-soft); }
.person strong { font-size: 15px; font-weight: 500; line-height: 1.2; }
.person span { font-size: 13px; color: var(--muted); }

/* ---------- publications ---------- */
.pubs { padding: clamp(80px, 10vw, 150px) var(--pad); }
.pubs-head { display: grid; grid-template-columns: minmax(160px, 1fr) 3fr; gap: 40px; align-items: center; margin-bottom: 60px; }
.doodle { width: 110px; color: var(--ink); transform: rotate(-12deg); justify-self: center; }
.statement.dark { color: var(--ink); font-weight: 400; max-width: 20ch; }
.circled { position: relative; white-space: nowrap; display: inline-block; }
.circled svg { position: absolute; left: -6%; top: -18%; width: 112%; height: 136%; overflow: visible; }
.circled path { fill: none; stroke: var(--blue); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 900; stroke-dashoffset: 900; transition: stroke-dashoffset 1.6s var(--ease) .3s; }
.circled.in path, .reveal.in .circled path { stroke-dashoffset: 0; }
.pub-list { list-style: none; margin: 0; padding: 0; }
.pub-list li { display: grid; grid-template-columns: 90px 1fr 240px; gap: 20px; align-items: baseline; padding: 20px 0; border-top: 1px solid var(--line); transition: padding .35s var(--ease); }
.pub-list li:last-child { border-bottom: 1px solid var(--line); }
.pub-list li:hover { padding-left: 14px; }
.py { font: 700 12px/1 "Space Mono", monospace; color: var(--muted); }
.pub-list a { font-size: clamp(17px, 1.6vw, 22px); letter-spacing: -.01em; line-height: 1.25; }
.pub-list a:hover { color: var(--blue); }
.pj { font-size: 13px; color: var(--ink-2); text-align: right; }

/* ---------- contact ---------- */
.contact { background: var(--night); color: #e8e9f5; padding: clamp(90px, 11vw, 160px) var(--pad) 130px; border-radius: var(--radius) var(--radius) 0 0; }
.contact-title { margin: 0 0 26px; font-weight: 400; font-size: clamp(60px, 12vw, 200px); letter-spacing: -.05em; line-height: .9; color: #fff; }
.contact-title span { color: var(--teal); }
.contact-text { max-width: 46ch; font-size: 19px; color: #b9bdd9; margin: 0 0 30px; }
.contact-mail { display: inline-block; font-size: clamp(22px, 3vw, 40px); letter-spacing: -.02em; color: #fff; border-bottom: 2px solid var(--teal); padding-bottom: 4px; transition: color .3s; }
.contact-mail:hover { color: var(--teal); }
.foot-bar { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-top: 100px; padding-top: 22px; border-top: 1px solid rgba(255, 255, 255, .12); font-size: 13px; color: #8f94b8; }
.foot-bar p { margin: 0; }
.foot-bar a:hover { color: #fff; }

/* ---------- floating dock ---------- */
.dock { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 50; display: flex; align-items: center; gap: 4px;
  background: rgba(30, 32, 44, .82); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-radius: 18px; padding: 6px; box-shadow: 0 16px 40px rgba(0, 0, 0, .25); border: 1px solid rgba(255, 255, 255, .08); }
.dock a, .dock-where { color: #a8abbb; font-size: 14px; padding: 10px 14px; border-radius: 12px; transition: color .25s, background .25s; white-space: nowrap; }
.dock a:hover, .dock a.on { color: #fff; }
.dock a.on { background: rgba(255, 255, 255, .08); }
.dock-where { display: flex; flex-direction: column; line-height: 1.1; color: #fff; padding-right: 16px; border-right: 1px solid rgba(255, 255, 255, .12); margin-right: 4px; }
.dock-where small { font-size: 10px; color: #8f94b8; }
.dock-where b { font-weight: 500; font-size: 13px; }
.dock-cta { display: flex !important; align-items: center; gap: 10px; background: #0d0e16; color: #fff !important; font-size: 13px !important; }
.bubble { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #fff; color: var(--night); font-size: 13px; }

/* ---------- reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.hero .reveal { transition-duration: 1.1s; }
.hero .mascot.reveal { transition-delay: .15s; }
.hero .l2.reveal { transition-delay: .3s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .track, .mascot img { animation: none; }
  .circled path { stroke-dashoffset: 0; transition: none; }
}

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .people { grid-template-columns: repeat(3, 1fr); }
  .news { display: none; }
}
@media (max-width: 820px) {
  .hide-sm { display: none; }
  .research, .pubs-head { grid-template-columns: 1fr; }
  .side { position: static; }
  .cards { grid-template-columns: 1fr; }
  .card { min-height: 340px; padding: 26px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .pub-list li { grid-template-columns: 1fr; gap: 6px; }
  .pj { text-align: left; }
  .doodle { display: none; }
  .bl-desc { max-height: none; opacity: 1; margin-top: 8px; }   /* no hover on touch */
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .top { padding: 16px; }
  .top-links { gap: 12px; }
  .top-links .u.strong { display: none; }
  .hero { padding: 110px 16px 150px; }
  .hero-title { grid-template-columns: 1fr; grid-template-areas: "m" "l1" "l2"; }
  .mascot { justify-self: center; width: 1.1em; margin-bottom: .1em; }
  .foot { bottom: 92px; font-size: 11px; }
  .foot-r { display: none; }
  .people { grid-template-columns: repeat(2, 1fr); }
  .dock { bottom: 12px; max-width: calc(100% - 24px); }
  .dock-where, .dock a[data-target="publications"] { display: none; }
  .dock a { padding: 9px 11px; font-size: 13px; }
  .contact { padding-bottom: 110px; }
}

/* ---------- legal pages (privacy.html, terms.html) ---------- */
.legal { padding: 140px var(--pad) 120px; background: var(--paper); min-height: 100vh; }
.legal .narrow { max-width: 760px; margin: 0 auto; }
.legal h1 { font-weight: 400; font-size: clamp(44px, 7vw, 96px); letter-spacing: -.045em; line-height: .95; margin: 0 0 12px; }
.legal h2 { font-weight: 500; font-size: 22px; letter-spacing: -.01em; margin: 2.2em 0 .5em; }
.legal p, .legal li { color: var(--ink-2); }
.legal a { color: var(--blue); text-decoration: underline; text-underline-offset: 3px; }
.legal ul { padding-left: 1.2em; }
.legal li { margin-bottom: .5em; }
.legal .muted { color: var(--muted); font-size: 14px; }
.legal-foot { background: var(--night); color: #8f94b8; padding: 26px var(--pad); font-size: 13px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.legal-foot p { margin: 0; }
.legal-foot a:hover { color: #fff; }
