/* UBERMORGEN.COM — redesign pass 1
   Goal: keep the terminal / green-on-black hacker aesthetic,
   fix structure (semantic HTML, responsive layout, collapsible archive). */

:root {
  --bg: #000;
  --green: #0f0;
  --green-dim: #0c0;
  --yellow: #ff0;
  --white: #fff;
  --mono: "Andale Mono", "Monaco", "Consolas", monospace;
  --max-width: 900px;

  /* the entire site uses exactly these 4 sizes — nothing else */
  --fs-1: 1.5em;   /* section titles: ACTUALITÉ, WORKS */
  --fs-2: 1.1em;   /* item titles: venue, archive title, headline */
  --fs-3: 0.95em;  /* body copy: work text, meta, nav links */
  --fs-4: 0.78em;  /* fine print: prompt-line, footer, inst tag, ticker */
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--green);
  font-family: var(--mono);
  font-size: 16px;
  line-height: 1.5;
}

/* keep text legible now that the content panels are transparent */
.wrap {
  text-shadow: 0 0 4px rgba(0, 0, 0, 0.9), 0 0 10px rgba(0, 0, 0, 0.7);
}

/* subtle CRT scanline texture, very low-key */
body {
  background-image: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.015) 0px,
    rgba(255, 255, 255, 0.015) 1px,
    transparent 1px,
    transparent 3px
  );
}

/* falling-pixel "pixelrain" canvas — sits on top of everything else, clicks pass through */
#snow-canvas {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
}

a { color: var(--green); text-decoration: none; }
a:visited { color: var(--green-dim); }
a:hover { color: var(--yellow); }
a:active { color: var(--white); }

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 20px 16px 80px;
}

/* ---------- header ---------- */
header.site-header {
  padding-top: 4px;
  margin-bottom: 36px;
  text-align: right;
}

/* the artist statement — what we make, full stop, nothing else */
.statement {
  color: var(--white);
  font-size: var(--fs-1);
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 0 2px;
}

/* prompt-line and nav links share one consistent
   font treatment — same family, size, weight, and color */
.prompt-line,
nav.top-links {
  font-family: var(--mono);
  font-size: var(--fs-4);
  font-weight: normal;
  color: var(--green-dim);
}

.prompt-line {
  word-break: break-word;
  margin: 0 0 2px;
}

nav.top-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px 10px;
  margin-bottom: 8px;
}

nav.top-links a,
nav.top-links a:visited {
  color: var(--white);
}

nav.top-links a:hover {
  color: var(--yellow);
}

nav.top-links a::after {
  content: "";
}

nav.top-links span.sep {
  color: var(--green-dim);
}

nav.top-links .social-icon {
  display: inline-flex;
  align-items: center;
}

nav.top-links .social-icon img {
  width: 13px;
  height: 13px;
  display: block;
}

/* ---------- i18n (EN / 中文 toggle) ---------- */
/* default + explicit "en": hide cn content. explicit "cn": hide en content.
   visible elements keep their own authored display value untouched. */
html:not([data-lang="cn"]) [data-i18n="cn"] {
  display: none;
}

html[data-lang="cn"] [data-i18n="en"] {
  display: none;
}

[data-i18n="cn"] {
  font-family: "PingFang SC", "Noto Sans SC", "Microsoft YaHei", var(--mono);
  letter-spacing: 0.02em;
}

nav.top-links .lang-toggle {
  background: transparent;
  border: 1px solid var(--green-dim);
  color: var(--green-dim);
  font-family: var(--mono);
  font-size: var(--fs-4);
  padding: 2px 8px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

nav.top-links .lang-toggle:hover {
  color: var(--yellow);
  border-color: var(--yellow);
}

/* ---------- ticker ---------- */
.ticker {
  overflow: hidden;
  white-space: nowrap;
  border-top: 1px dotted var(--green-dim);
  border-bottom: 1px dotted var(--green-dim);
  padding: 8px 0;
  margin: 0 0 28px;
  background: transparent;
}

.ticker-track {
  display: inline-block;
  padding-left: 100%;
  animation: ticker-scroll 45s linear infinite;
  font-size: var(--fs-4);
  color: var(--green);
}

.ticker-track span.tick-sep {
  color: var(--green-dim);
  margin: 0 1.5em;
}

.ticker-track .zh {
  font-family: "PingFang SC", "Noto Sans SC", "Microsoft YaHei", var(--mono);
  letter-spacing: 0.02em;
  color: var(--green-dim);
}

@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-100%); }
}

/* ---------- now-strip ---------- */
.now-strip {
  display: flex;
  gap: 10px;
  margin: 0 0 28px;
  overflow-x: auto;
}

.now-item {
  position: relative;
  flex: 1 1 0;
  min-width: 140px;
  height: 142px;
  display: block;
  overflow: hidden;
  border: 1px dotted var(--green-dim);
  background: transparent;
}

.now-item img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.9;
}

.now-item:hover img {
  opacity: 1;
}

/* fixed height so all 3 caption bars line up identically, regardless of
   how long each caption text is — text is clipped to one line per language
   rather than allowed to wrap and change the bar's height */
.now-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 52px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  padding: 4px 8px;
  background: rgba(0, 10, 0, 0.55);
  backdrop-filter: blur(1px);
  overflow: hidden;
}

.now-cap {
  display: block;
  font-size: var(--fs-4);
  color: var(--white);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.now-zh {
  display: block;
  font-size: var(--fs-4);
  color: var(--green-dim);
  font-family: "PingFang SC", "Noto Sans SC", "Microsoft YaHei", var(--mono);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.now-item:hover .now-cap {
  color: var(--yellow);
}

@media (max-width: 600px) {
  .now-strip {
    flex-wrap: nowrap;
  }
  .now-item {
    min-width: 110px;
    height: 122px;
  }
}

/* ---------- news / actualite ---------- */
section.news {
  margin-bottom: 0;
}

section.news details {
  border-bottom: 1px dotted var(--green-dim);
  padding: 16px 0;
  background: transparent;
}

section.news summary {
  cursor: pointer;
  color: var(--white);
  font-size: var(--fs-1);
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 16px;
}

section.news summary:hover { color: var(--yellow); }

.news-item {
  margin-bottom: 18px;
}

.news-item > a {
  display: block;
}

.news-item .venue a.venue-link-white {
  color: var(--white);
}

.news-item .venue a.venue-link-white:hover {
  color: var(--yellow);
}

.news-item .venue .venue-accent {
  color: var(--green);
  font-weight: normal;
}

.news-item .venue {
  color: var(--white);
  font-family: var(--mono);
  font-size: var(--fs-2);
  line-height: 1.35;
  font-weight: bold;
  display: block;
}

.news-item .work {
  display: block;
  font-size: var(--fs-3);
  margin-top: 4px;
}

/* keeps each linked unit ("HEK", "(Sound of eBay)", "& ArtMeta") from
   breaking mid-phrase on narrow screens — wraps only happen between units */
.news-item .work .nowrap {
  white-space: nowrap;
}

.news-item .zh {
  display: block;
  font-size: var(--fs-4);
  color: var(--green-dim);
  margin-top: 2px;
}

/* secondary English line on the Chinese index page, mirrors .zh but
   keeps the plain mono font instead of switching to a CJK family */
.news-item .en {
  display: block;
  font-size: var(--fs-4);
  color: var(--green-dim);
  margin-top: 2px;
  font-family: var(--mono);
}

/* ---------- archive / publications ---------- */
section.archive details,
section.publications details {
  border-top: 1px dotted var(--green-dim);
  padding: 16px 0;
  background: transparent;
}

section.archive summary,
section.publications summary {
  cursor: pointer;
  color: var(--white);
  font-size: var(--fs-1);
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

section.archive summary:hover,
section.publications summary:hover { color: var(--yellow); }

.archive-list {
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.archive-list li {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  padding: 4px 0;
  border-bottom: 1px dotted rgba(0, 255, 0, 0.15);
}

.archive-list .title {
  flex: 1 1 220px;
  min-width: 0;
  font-size: var(--fs-2);
}

.archive-list .meta {
  flex: 0 1 auto;
  color: var(--green-dim);
  font-size: var(--fs-3);
  white-space: normal;
}

/* optional commissioning-institution tag — small, dim, set apart from the
   description so it reads as metadata rather than competing with the title */
.archive-list .inst {
  flex: 0 0 auto;
  font-size: var(--fs-4);
  font-style: italic;
  color: var(--green-dim);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  opacity: 0.75;
}

.archive-list .inst::before {
  content: "// ";
}

/* category sub-headers within the Works / Publications lists */
.archive-list li.group-header {
  display: block;
  border-bottom: none;
  padding: 20px 0 6px;
  margin-top: 4px;
}

.archive-list li.group-header:first-child {
  padding-top: 0;
  margin-top: 0;
}

.archive-list .group-label {
  color: var(--white);
  font-size: var(--fs-3);
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-top: 1px dotted var(--green-dim);
  display: block;
  width: 100%;
  padding-top: 12px;
}

.archive-list li.group-header:first-child .group-label {
  border-top: none;
  padding-top: 0;
}

/* English gloss after a translated Chinese category label, e.g. on
   index-cn.html's group headers — smaller, dim, plain mono */
.archive-list .group-label .en {
  font-size: var(--fs-4);
  font-weight: normal;
  font-family: var(--mono);
  color: var(--green-dim);
  text-transform: none;
  letter-spacing: normal;
  margin-left: 4px;
}

/* ---------- bio page ---------- */
.bio-content,
.cv-content {
  margin: 8px 0 40px;
  padding-top: 24px;
}

.bio-content .page-title,
.cv-content .page-title {
  color: var(--white);
  font-size: var(--fs-1);
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 6px;
}

.bio-content .bio-tagline {
  color: var(--green-dim);
  font-size: var(--fs-3);
  font-style: italic;
  margin: 0 0 24px;
}

.bio-content p,
.cv-content > p {
  font-size: var(--fs-3);
  line-height: 1.6;
  margin: 0 0 20px;
  max-width: 680px;
}

.bio-content .bio-meta .label,
.cv-content .bio-meta .label {
  display: block;
  font-size: var(--fs-4);
  font-style: italic;
  color: var(--green-dim);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  opacity: 0.75;
  margin-bottom: 4px;
}

.bio-content .bio-meta .label::before,
.cv-content .bio-meta .label::before {
  content: "// ";
}

.bio-content .bio-meta .sep {
  color: var(--green-dim);
  margin: 0 6px;
}

/* ---------- cv page ---------- */
.cv-content section.archive {
  margin-bottom: 0;
}

.cv-content .press-cats .bio-meta {
  font-size: var(--fs-3);
  line-height: 1.6;
  margin: 0 0 18px;
  max-width: 680px;
}

.bio-content .mugshot {
  margin: 32px 0 0;
  border-top: 1px dotted var(--green-dim);
  padding-top: 24px;
}

.bio-content .mugshot img {
  display: block;
  max-width: 100%;
  height: auto;
}

.bio-content .mugshot figcaption {
  margin-top: 8px;
  font-size: var(--fs-4);
  color: var(--green-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ---------- footer ---------- */
footer.site-footer {
  margin-top: 60px;
  font-size: var(--fs-4);
  color: var(--green-dim);
  border-top: 1px dotted var(--green-dim);
  padding-top: 16px;
}

/* rain toggle — pixelrain on/off, lives in the footer after contacts */
footer.site-footer .rain-toggle {
  display: inline-block;
  vertical-align: baseline;
  margin-left: 2px;
  background: transparent;
  border: 1px dotted var(--green-dim);
  color: var(--green-dim);
  font-family: var(--mono);
  font-size: var(--fs-4);
  padding: 3px 9px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

footer.site-footer .rain-toggle:hover {
  color: var(--yellow);
  border-color: var(--yellow);
}

footer.site-footer .rain-toggle.is-on {
  color: var(--green);
  border-color: var(--green);
}

footer.site-footer .rain-toggle .rain-state {
  font-weight: bold;
}

/* ---------- responsive / mobile hardening ---------- */
html, body {
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

@media (max-width: 600px) {
  body { font-size: 15px; }

  .wrap { padding: 16px 12px 60px; }

  header.site-header {
    margin-bottom: 28px;
    text-align: left; /* right-alignment only reads well on wider screens */
  }

  nav.top-links { justify-content: flex-start; gap: 6px 8px; }

  .ticker-track { animation-duration: 30s; }

  section.news details,
  section.archive details,
  section.publications details { padding: 12px 0; }

  .archive-list li { flex-direction: column; gap: 2px; }

  .archive-list .title,
  .archive-list .meta,
  .archive-list .inst { flex-basis: auto; }
}

@media (hover: none) {
  a:hover { color: var(--green); }
}
