:root {
  --ink: #202124;
  --muted: #5f6368;
  --link: #1155cc;
  --accent: #990000;
  --purple: #6a0dad;
  --line: #dadce0;
  --bg: #ffffff;
  --max: 1120px;
  --serif: Lora, "Times New Roman", serif;          /* headings, like the Google Site */
  --sans: "Gentium Basic", Palatino, "Palatino Linotype", serif; /* Work / Publications / Projects / Awards body: Gentium Basic 12pt */
  --times: "Times New Roman", Times, serif;         /* Home page body: Times New Roman 14pt */
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: var(--sans);
  font-size: 12pt;
  line-height: 1.6;
}

body.home {
  display: flex;
  flex-direction: column;
  font-family: var(--times);
  font-size: 14pt;
  line-height: 1.6;
  background:
    linear-gradient(rgba(38, 78, 92, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(38, 78, 92, 0.05) 1px, transparent 1px),
    linear-gradient(180deg, #d5e4ec 0%, #e7eef0 42%, #eef3ee 100%);
  background-size: 28px 28px, 28px 28px, auto;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; }

.topbar {
  order: 1;
  background: #111;
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar-inner {
  position: relative;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 22px;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: 0.01em;
  text-decoration: none;
}

.brand:hover { text-decoration: none; color: #fff; }

.nav-cluster {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-left: auto;
}

.mark {
  width: auto;
  height: 48px;
  flex: none;
  border-radius: 8px;
  background: #fff;
  object-fit: contain;
}

.nav {
  display: flex;
  gap: 22px;
  align-items: center;
}

.nav a {
  color: #fff;
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 400;
}

.nav a.active {
  box-shadow: inset 0 -2px 0 #fff;
  padding-bottom: 2px;
}

.nav-toggle, .nav-btn { display: none; }

.hero {
  position: relative;
  height: clamp(280px, 38vw, 440px);
  background: #0a1020 center / cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 48%;
}

.hero h1 {
  position: relative;
  z-index: 1;
  margin: 0;
  color: #fff;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(42px, 6vw, 68px);
  letter-spacing: 0.01em;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.35);
}

@media (max-width: 700px) {
  .news { height: 360px; }
  article.media { padding-left: 102px; min-height: 110px; }
  article.media > .shot { width: 88px; max-height: 88px; }
}

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 36px 22px 64px;
}

.intro {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 32px;
  align-items: center;
}

.portrait {
  width: 100%;
  display: block;
  object-fit: cover;
  object-position: center top;
  background: #eee;
}

.bio p { margin: 0 0 14px; }

.bio strong { font-weight: 700; }

.social {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: center;
  margin: 28px 0 8px;
}

.social a {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 8px;
}

.social a:hover { background: #f1f3f4; text-decoration: none; }

.social svg { width: 52px; height: 52px; }

h2.section {
  font-family: var(--times);
  color: #152520;
  font-weight: 700;
  font-size: 28px;
  margin: 36px 0 12px;
}

h2.section .count {
  font-size: 14px;
  font-weight: 400;
  color: var(--muted);
  margin-left: 10px;
  vertical-align: middle;
}

.news-frame { position: relative; }

/* Fixed-height box; the list scrolls inside it, never the page. */
.news {
  height: 480px;
  max-height: 480px;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px 20px;
  background: #fff;
  font-family: var(--times);
  font-size: 18px;
  line-height: 1.6;
  color: var(--ink);
}

.news:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }

.news::-webkit-scrollbar { width: 10px; }
.news::-webkit-scrollbar-track { background: #f1f3f4; border-radius: 0 8px 8px 0; }
.news::-webkit-scrollbar-thumb { background: #c4c7cb; border-radius: 8px; border: 2px solid #f1f3f4; }
.news::-webkit-scrollbar-thumb:hover { background: #9aa0a6; }

.news ul {
  margin: 0;
  padding-left: 20px;
}

.news li { margin: 0 0 12px; }
.news a { color: #1a73e8; }

.scroll-hint {
  position: absolute;
  right: 22px;
  bottom: 10px;
  margin: 0;
  padding: 2px 10px;
  font-size: 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 999px;
  pointer-events: none;
  transition: opacity 0.25s;
}

/* Now + Journey */
.now-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 16px;
  margin-top: 16px;
}

.now, .journey {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px 20px;
  background: #fff;
}

.journey h3 {
  margin: 0 0 10px;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 18px;
  color: #1c4587;
  display: flex;
  align-items: center;
  gap: 8px;
}

.now-detail {
  margin: 0;
  padding-left: 20px;
}

.now-detail li {
  margin: 0 0 12px;
  font-size: 16px;
  line-height: 1.55;
}

.now-detail li:last-child { margin-bottom: 0; }

.pulse {
  width: 10px; height: 10px; border-radius: 50%;
  background: #2e7d32;
  box-shadow: 0 0 0 0 rgba(46, 125, 50, 0.5);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(46, 125, 50, 0.5); }
  70% { box-shadow: 0 0 0 9px rgba(46, 125, 50, 0); }
  100% { box-shadow: 0 0 0 0 rgba(46, 125, 50, 0); }
}

.journey {
  --node: 132px;
  width: 100%;
  padding: 0 0 12px;
  border: none;
  background: transparent;
}

.jgraph {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0;
  overflow-x: auto;
  padding: 8px 0 2px;
}

.jhome {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 0 0 auto;
}

.jarrow {
  flex: 1 1 48px;
  min-width: 28px;
  margin-top: 46px;
  border-top: 2px dashed #c5ced6;
}

.jnode {
  position: relative;
  display: block;
  width: var(--node);
  color: var(--ink);
  text-align: center;
}

.jnode:hover { text-decoration: none; color: var(--link); }

.jhome > .jnode::after {
  content: "";
  display: block;
  width: 0;
  height: 12px;
  margin: 4px auto 0;
  border-left: 2px dashed #c5ced6;
}

.jhome:not(:has(.jfork)) > .jnode::after { display: none; }

.jfork {
  display: flex;
  justify-content: center;
  gap: 16px;
  position: relative;
  padding-top: 14px;
}

.jfork::before {
  content: "";
  position: absolute;
  top: 0;
  left: calc(var(--node) / 2);
  right: calc(var(--node) / 2);
  border-top: 2px dashed #c5ced6;
}

.jfork .jnode::before {
  content: "";
  position: absolute;
  top: -12px;
  left: 50%;
  height: 12px;
  border-left: 2px dashed #c5ced6;
}

.jfork.solo::before { display: none; }

.journey img {
  width: 92px; height: 92px;
  object-fit: contain;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--line);
  display: block;
  margin: 0 auto 6px;
  transition: transform 0.15s;
}

.jnode:hover img { transform: scale(1.12); }

.journey span { display: block; font-size: 15px; line-height: 1.2; }
.journey small { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }

@media (prefers-reduced-motion: reduce) {
  .pulse { animation: none; }
  .journey img { transition: none; }
}

#contact {
  margin-top: 8px;
  scroll-margin-top: 80px;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  margin-top: 12px;
}

.contact-grid h3 {
  margin: 0 0 8px;
  font-size: 18px;
}

.contact-grid p { margin: 0 0 6px; }

.map {
  margin-top: 12px;
  height: 220px;
  border: 0;
  width: 100%;
  border-radius: 8px;
}

.page-intro {
  max-width: none;
  margin: 0 0 28px;
  font-family: var(--sans);
  font-size: 21px;
  line-height: 1.45;
  color: #212121;
}

h2.group {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 32px;
  color: #1c4587;
  margin: 36px 0 14px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}

.role, .paper, .project, .award {
  padding: 16px 0 8px;
  border-bottom: 1px solid #f1f3f4;
}

.role h3, .paper h3, .project h3, .award h3 {
  margin: 0 0 4px;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 12pt;
  line-height: 1.35;
}

.role h3 { color: var(--accent); }
.role h3 a { color: var(--accent); }

article.media {
  position: relative;
  padding-left: 154px;
  min-height: 160px;
}

article.media > .shot {
  position: absolute;
  left: 0;
  top: 16px;
  width: 132px;
  max-height: 128px;
  object-fit: contain;
}

article.media.wide { padding-left: 0; min-height: 0; }

article.media.wide > .shot,
article.media.wide > .shots {
  position: static;
  display: block;
  width: min(100%, 480px);
  max-height: 280px;
  margin: 8px 0 12px;
  border-radius: 6px;
}

article.media.wide > .shots {
  display: flex;
  gap: 10px;
  max-height: none;
  width: min(100%, 620px);
}

article.media.wide > .shots img {
  width: calc(50% - 5px);
  max-height: 220px;
  object-fit: contain;
  border-radius: 6px;
  background: #111;
}

.when {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 14.5px;
}

.venue {
  margin: 2px 0 14px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.4;
}

.role ul, .project ul, .paper ul {
  margin: 8px 0 12px;
  padding-left: 20px;
}

.links {
  margin: 2px 0 14px;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.4;
}

.detail-body .links,
.detail-body .venue {
  font-size: 19px;
}

.detail-body .links a,
.detail-body .venue a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 20px;
  row-gap: 32px;
  align-items: start;
}

.gallery figure {
  margin: 0;
}

.gallery img,
.gallery iframe {
  width: 100%;
  height: auto;
  aspect-ratio: auto;
  object-fit: contain;
  display: block;
  background: #111;
}

.gallery iframe {
  aspect-ratio: 16 / 9;
  border: 0;
}

.gallery figcaption {
  margin: 12px 0 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 25px;
  line-height: 1.35;
  text-align: center;
  color: #000;
}

.gallery figure.wide {
  grid-column: 1 / -1;
}

.gallery .more-photos {
  display: block;
  margin-top: 4px;
  white-space: nowrap;
  font: inherit;
  color: inherit;
}

.gallery .pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.gallery figure.wide p {
  max-width: 773px;
  margin: 10px auto 0;
  text-align: center;
  font-family: var(--sans);
  font-size: 14.67px;
  line-height: 1.65;
  color: #212121;
}

.note {
  margin-top: 28px;
  color: var(--muted);
}

footer.site {
  border-top: 1px solid var(--line);
  color: var(--muted);
  text-align: center;
  padding: 22px;
  font-size: 14px;
}

footer.site p { margin: 0 0 4px; }
.to-top {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #111;
  color: #fff;
  font-size: 18px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  opacity: 0.85;
  z-index: 15;
}

.to-top:hover { opacity: 1; text-decoration: none; }

@media (max-width: 900px) {
  .intro, .contact-grid { grid-template-columns: 1fr; }
  .now-grid { grid-template-columns: 1fr; }
  .portrait { max-width: 280px; }
  .hero { height: clamp(220px, 48vw, 300px); }
}

@media (max-width: 640px) {
  .gallery { grid-template-columns: 1fr; }
  .gallery .pair { grid-template-columns: 1fr; }
  .gallery figcaption, .gallery .more-photos { font-size: 20px; }
}

@media (max-width: 760px) {
  body.home { font-size: 13pt; }
  .news { font-size: 16px; height: 300px; max-height: 300px; }
  .to-top { right: max(12px, env(safe-area-inset-right)); bottom: max(12px, env(safe-area-inset-bottom)); }
  .wrap { padding: 24px 16px 56px; }

  .topbar-inner {
    padding: 0 12px;
    gap: 10px;
    min-height: 56px;
  }

  .mark { height: 36px; border-radius: 6px; }
  .brand { gap: 8px; min-width: 0; }
  .brand span {
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 42vw;
  }

  .nav-cluster { gap: 8px; margin-left: 0; flex: none; }

  .theme-toggle {
    padding: 7px;
    margin-right: 0;
  }

  .theme-label { display: none; }

  .nav-btn {
    display: inline-flex;
    align-items: center;
    color: #fff;
    border: 1px solid rgba(255,255,255,0.35);
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 14px;
    cursor: pointer;
  }

  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #111;
    flex-direction: column;
    align-items: stretch;
    padding: 10px 16px 18px;
    gap: 4px;
    z-index: 40;
    box-shadow: 0 16px 28px rgba(0, 0, 0, 0.28);
  }

  .nav a {
    padding: 10px 4px;
    font-size: 17px;
  }

  .nav-toggle:checked ~ .nav { display: flex; }

  .journey { --node: 104px; }
  .jnode small { font-size: 10px; }

  .proj-nav {
    justify-content: space-between;
    width: 100%;
  }

  dialog.detail {
    width: 100vw;
    max-height: 100vh;
    height: 100vh;
    border-radius: 0;
  }
}

.now-live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 8px 14px 8px 12px;
  border: 1px solid rgba(46, 125, 50, 0.55);
  border-radius: 999px;
  background: rgba(232, 245, 233, 0.92);
  color: #1b5e20;
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.04em;
  cursor: pointer;
  flex: none;
  align-self: flex-start;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.35),
    0 8px 22px rgba(21, 37, 32, 0.18);
}

.now-live:hover {
  background: #e8f5e9;
  border-color: #2e7d32;
}

.now-live:focus-visible {
  outline: 2px solid #2e7d32;
  outline-offset: 3px;
}

.now-live-tag {
  font-size: 10px;
  letter-spacing: 0.16em;
  font-weight: 700;
  color: #fff;
  background: #2e7d32;
  border-radius: 999px;
  padding: 3px 7px 2px;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-right: 4px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: transparent;
  color: #fff;
  border-radius: 999px;
  padding: 5px 12px 5px 8px;
  font-family: var(--serif);
  font-size: 14px;
  cursor: pointer;
}

.theme-toggle .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f6c445;
  box-shadow: 0 0 0 3px rgba(246, 196, 69, 0.28);
}

.mast {
  order: 2;
  position: relative;
  z-index: 1;
  min-height: 0;
  max-width: 1120px;
  margin: 0 auto;
  padding: 5vh 22px 28px;
  display: flex;
  flex-direction: column;
}

.mast-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.mast h1 {
  margin: 0;
  color: #152520;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(48px, 7vw, 84px);
  letter-spacing: 0.01em;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.35);
}

.updated-stamp {
  margin: 6px 0 0;
  color: #5c6b62;
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: 0.06em;
}

.sky-legend {
  margin: 8px 0 0;
  color: #2e5c3f;
  font-family: var(--serif);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 13px;
}

.mast-intro {
  margin-top: 24px;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 28px;
  align-items: center;
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  box-shadow: 0 18px 50px rgba(21, 37, 32, 0.12);
}


.portrait-card { margin: 0; }

.portrait-card .portrait {
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(21, 37, 32, 0.16);
}

.sheet {
  order: 3;
  position: relative;
  z-index: 1;
  background: #fff;
  border-radius: 28px 28px 0 0;
  box-shadow: 0 -24px 60px rgba(21, 37, 32, 0.08);
}

.pub-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 12px;
}

.pub-tabs button {
  font-family: var(--serif);
  font-size: 16px;
  color: #1c4587;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 14px;
  cursor: pointer;
}

.pub-tabs button .n { margin-left: 4px; font-size: 13px; opacity: 0.7; }

.pub-tabs button.active {
  background: #1c4587;
  border-color: #1c4587;
  color: #fff;
}

.pub-group { display: none; }
.pub-group.show { display: block; }

.catalog { margin: 8px 0 28px; }

.catalog.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.catalog.cards.pub-group { display: none; }
.catalog.cards.pub-group.show { display: grid; }

.proj-slider { margin: 8px 0 28px; }
.proj-slider .catalog { margin: 0; }
.catalog.cards.proj-page { display: none; }
.catalog.cards.proj-page.show { display: grid; }

.proj-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 14px;
}

.proj-nav button {
  font-family: var(--serif);
  font-size: 15px;
  color: #1c4587;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 14px;
  cursor: pointer;
}

.proj-nav button:disabled {
  opacity: 0.35;
  cursor: default;
}

.proj-nav button:not(:disabled):hover {
  background: #1c4587;
  border-color: #1c4587;
  color: #fff;
}

.proj-status {
  font-family: var(--serif);
  font-size: 14px;
  color: var(--muted);
  min-width: 3.5em;
  text-align: center;
}

.catalog.cards .entry-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  height: 100%;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}

.catalog.cards .entry-row img {
  width: 100%;
  height: 156px;
  object-fit: contain;
  background: #f4f7f5;
  border-radius: 12px;
  padding: 10px;
}

.catalog.cards .entry-row .more { margin-top: auto; }

@media (max-width: 980px) {
  .catalog.cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .catalog.cards { grid-template-columns: 1fr; }
  .catalog.cards .entry-row img { height: 180px; }
}

.entry-row {
  width: 100%;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  text-align: left;
  padding: 12px 8px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-decoration: none;
}

a.entry-row:hover { text-decoration: none; }

.entry-row:hover { background: #f4f7f5; }

.entry-row img {
  width: 72px;
  height: 56px;
  object-fit: contain;
}

.entry-row strong {
  display: block;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 16px;
  line-height: 1.35;
}

.catalog.work .entry-row strong { color: var(--accent); }

.entry-row small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 14px;
}

.entry-row .more {
  color: var(--link);
  font-size: 13px;
  white-space: nowrap;
}

.hint {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 15px;
}

dialog.detail {
  width: min(760px, calc(100vw - 32px));
  max-height: min(82vh, 820px);
  padding: 0;
  border: 0;
  border-radius: 16px;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 28px 80px rgba(21, 37, 32, 0.28);
}

dialog.detail::backdrop { background: rgba(16, 24, 22, 0.48); }

.detail-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: inherit;
}

.detail-bar h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 20px;
}

.detail-bar button {
  border: 0;
  background: #f1f3f4;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.detail-body {
  padding: 16px 20px 28px;
  overflow: auto;
}

.detail-body img.shot,
.detail-body .shots img {
  width: min(100%, 520px);
  max-height: 280px;
  object-fit: contain;
  border-radius: 8px;
  margin: 0 0 12px;
}

.detail-body .shots { display: flex; gap: 10px; }
.detail-body .shots img { width: calc(50% - 5px); background: #111; }

.mast-intro .social { grid-column: 1 / -1; margin: 0; justify-content: flex-start; }

html.night body { background: #0a0e14; color: #e7eee9; }
html.night body.home {
  color: #e7eee9;
  background:
    linear-gradient(rgba(180, 210, 230, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(180, 210, 230, 0.05) 1px, transparent 1px),
    linear-gradient(180deg, #070b12 0%, #0c1828 42%, #101820 100%);
  background-size: 28px 28px, 28px 28px, auto;
}
html.night .page-intro,
html.night .gallery figcaption,
html.night .note { color: #d5ddd8; }

html.night .theme-toggle .dot { background: #d5e4ff; box-shadow: 0 0 0 3px rgba(213, 228, 255, 0.22); }
html.night .mast h1 { color: #f4f7f5; text-shadow: none; }
html.night .updated-stamp { color: #9aabbc; }
html.night .sky-legend { color: #b7c8d8; }

html.night .mast-intro,
html.night .sheet,
html.night dialog.detail {
  background: #121820;
  color: #e7eee9;
}

html.night .jarrow,
html.night .jhome > .jnode::after,
html.night .jfork::before,
html.night .jfork .jnode::before { border-color: #4a5a6c; }
html.night .journey,
html.night .news,
html.night .scroll-hint {
  background: #161e2a;
  color: #e7eee9;
  border-color: #2a3545;
}

html.night .now-live {
  background: rgba(26, 48, 32, 0.92);
  border-color: rgba(102, 187, 106, 0.65);
  color: #c8e6c9;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.25),
    0 8px 22px rgba(0, 0, 0, 0.35);
}
html.night .now-live:hover { background: #1f3a28; border-color: #81c784; }
html.night .now-live-tag { background: #43a047; }
html.night .entry-row small,
html.night .hint,
html.night footer.site { color: #b7c4bc; }
html.night .journey h3,
html.night h2.section { color: #d5e4ff; }
html.night .entry-row:hover { background: #1c2634; }
html.night .catalog.cards .entry-row {
  background: #161e2a;
  border-color: #2a3545;
}
html.night .catalog.cards .entry-row img { background: #0e141c; }
html.night .catalog.work .entry-row strong { color: #f0a0a0; }
html.night .news a,
html.night a { color: #9db7ff; }
html.night .detail-bar button { background: #243040; color: #fff; }
html.night .social a:hover { background: #1c2634; }
html.night .pub-tabs button { background: #161e2a; color: #d5e4ff; border-color: #2a3545; }
html.night .pub-tabs button.active { background: #d5e4ff; color: #121820; border-color: #d5e4ff; }
html.night .proj-nav button { background: #161e2a; color: #d5e4ff; border-color: #2a3545; }
html.night .proj-nav button:not(:disabled):hover { background: #d5e4ff; color: #121820; border-color: #d5e4ff; }
html.night .proj-status { color: #b7c4bc; }

/* Phone layout — kept last so it wins over base mast rules above. */
@media (max-width: 760px) {
  .now-live {
    padding: 7px 12px 7px 10px;
    font-size: 14px;
  }

  .mast {
    padding: 18px 16px 16px;
  }

  .mast-head {
    flex-wrap: wrap;
    gap: 12px;
  }

  .mast h1 {
    font-size: clamp(34px, 9vw, 44px);
  }

  .sky-legend {
    font-size: 11px;
    letter-spacing: 0.08em;
    line-height: 1.35;
  }

  .mast-intro {
    grid-template-columns: 1fr;
    margin-top: 16px;
    padding: 14px;
    gap: 14px;
  }

  .portrait-card .portrait {
    width: min(100%, 220px);
    margin: 0 auto;
    display: block;
  }

  .sheet { border-radius: 20px 20px 0 0; }
}

@media (max-width: 420px) {
  .brand span { display: none; }
}
