:root {
  color-scheme: light;
  --ink: #0d1b2a;
  --muted: #596a78;
  --paper: #f2f7fb;
  --panel: #fbfdff;
  --line: #c8d9e6;
  --green: #1c83c9;
  --green-dark: #06182c;
  --lime: #9ee3ff;
  --coral: #ef7a4e;
  --yellow: #35a6ff;
  --blue: #2453d6;
  --shadow: 10px 10px 0 rgba(6, 24, 44, 0.12);
  --radius: 1px;
  font-family:
    "Inter",
    "Hiragino Sans",
    "Yu Gothic UI",
    "Yu Gothic",
    Meiryo,
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(rgba(13, 27, 42, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(13, 27, 42, 0.04) 1px, transparent 1px),
    var(--paper);
  background-size: 32px 32px;
  color: var(--ink);
  letter-spacing: 0;
}

body.view-mode .page-view {
  display: none;
}

body.view-mode .page-view.is-active {
  display: block;
}

body.is-transitioning {
  overflow: hidden;
}

body.is-loading {
  overflow: hidden;
}

a {
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
}

.scroll-progress {
  position: fixed;
  z-index: 50;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: var(--yellow);
}

.site-header {
  position: fixed;
  z-index: 40;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px 48px;
  color: #fff;
  background: rgba(6, 24, 44, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: max-content;
  text-decoration: none;
  font-weight: 900;
}

.brand-mark {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: var(--radius);
  background: #0a2441;
  color: var(--lime);
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 22px;
  font-size: 0.9rem;
  font-weight: 800;
}

.site-nav a {
  position: relative;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.78);
}

.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -7px;
  height: 2px;
  background: var(--yellow);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 180ms ease;
}

.site-nav a:hover,
.site-nav a.is-active {
  color: #fff;
}

.site-nav a:hover::after,
.site-nav a.is-active::after {
  transform: scaleX(1);
}

.hero {
  position: relative;
  min-height: 82svh;
  overflow: hidden;
  color: #fff;
  background:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    #06182c;
  background-size: 44px 44px;
}

.page-view.section:not(.source-section) {
  min-height: 100svh;
  padding-top: 126px;
}

#molecule-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  opacity: 0.2;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(6, 24, 44, 0.86) 0%, rgba(6, 24, 44, 0.56) 44%, rgba(6, 24, 44, 0.24) 100%),
    linear-gradient(to bottom, rgba(6, 24, 44, 0.18), rgba(6, 24, 44, 0.74)),
    url("assets/header.png") center / cover no-repeat;
  opacity: 0.94;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 210px;
  z-index: 1;
  background: linear-gradient(to top, rgba(6, 24, 44, 0.96), transparent);
  pointer-events: none;
}

.hero-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  align-items: end;
  gap: 54px;
  max-width: 1240px;
  min-height: 82svh;
  margin: 0 auto;
  padding: 130px 28px 74px;
}

.hero-inner {
  max-width: 760px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero .eyebrow,
.links-section .eyebrow {
  color: var(--yellow);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 18px;
  font-size: 7.2rem;
  line-height: 0.95;
  font-weight: 950;
}

.hero-copy {
  max-width: 700px;
  margin-bottom: 22px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.22rem;
  line-height: 1.85;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
}

.hero-tags span {
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(6, 24, 44, 0.72);
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.82rem;
  font-weight: 800;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  min-width: 148px;
  padding: 12px 18px;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 900;
  transition:
    background-color 180ms ease,
    color 180ms ease;
}

.button.primary {
  color: #041827;
  background: var(--lime);
}

.button.secondary {
  border: 1px solid rgba(255, 255, 255, 0.38);
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.button:hover {
  background-color: var(--yellow);
}

.stage-card {
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(6, 24, 44, 0.82);
  box-shadow: 12px 12px 0 rgba(53, 166, 255, 0.2);
}

.stage-card::before,
.stage-card::after {
  content: "";
  position: absolute;
  width: 54px;
  height: 10px;
  background: var(--yellow);
}

.stage-card::before {
  top: -6px;
  left: 20px;
}

.stage-card::after {
  right: 20px;
  bottom: -6px;
}

.stage-label {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  color: var(--lime);
  font-size: 0.76rem;
  font-weight: 900;
}

.portrait-frame {
  position: relative;
  aspect-ratio: 1;
  margin: 16px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: #071f38;
  overflow: hidden;
}

.portrait-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(transparent 92%, rgba(255, 255, 255, 0.12) 92%),
    linear-gradient(90deg, transparent 92%, rgba(255, 255, 255, 0.12) 92%);
  background-size: 28px 28px;
  pointer-events: none;
  mix-blend-mode: screen;
}

.portrait-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.92) contrast(1.05);
}

.stage-data {
  margin: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.stage-data div {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.stage-data div:last-child {
  border-bottom: 0;
}

.stage-data dt {
  color: var(--yellow);
  font-size: 0.76rem;
  font-weight: 900;
}

.stage-data dd {
  margin: 0;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.55;
}

.log-strip {
  overflow: hidden;
  border-top: 1px solid #163b5c;
  border-bottom: 1px solid #163b5c;
  color: #041827;
  background: var(--yellow);
}

.log-track {
  display: flex;
  width: max-content;
  animation: log-scroll 26s linear infinite;
}

.log-track span {
  padding: 11px 26px;
  border-right: 1px solid rgba(4, 24, 39, 0.24);
  font-size: 0.78rem;
  font-weight: 950;
}

@keyframes log-scroll {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(-50%);
  }
}

.section {
  padding: 88px 28px;
}

.section-header {
  max-width: 1180px;
  margin: 0 auto 34px;
}

.section-header h2 {
  max-width: 900px;
  margin-bottom: 0;
  font-size: 3.65rem;
  line-height: 1.08;
  font-weight: 950;
}

.profile-grid,
.data-grid,
.activity-grid,
.article-list,
.link-grid {
  max-width: 1180px;
  margin: 0 auto;
}

.profile-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 26px;
}

.profile-text {
  padding: 28px 0;
}

.lead {
  margin-bottom: 20px;
  font-size: 1.28rem;
  line-height: 2;
}

.profile-text p:not(.lead),
.profile-note p,
.activity-card p,
.article-card p,
.source-box p {
  color: var(--muted);
  line-height: 1.85;
}

.profile-note {
  align-self: start;
  padding: 24px;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.note-index {
  display: block;
  margin-bottom: 26px;
  color: var(--coral);
  font-size: 0.78rem;
  font-weight: 950;
}

.profile-note p {
  margin-bottom: 0;
}

.character-file {
  display: grid;
  grid-template-columns: minmax(320px, 0.82fr) minmax(0, 1.18fr);
  max-width: 1180px;
  margin: 54px auto 18px;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.character-portrait {
  position: relative;
  min-height: 470px;
  padding: 48px 26px 26px;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(rgba(13, 27, 42, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(13, 27, 42, 0.05) 1px, transparent 1px),
    #eaf5ff;
  background-size: 28px 28px;
  overflow: hidden;
}

.file-label {
  position: absolute;
  z-index: 2;
  top: 18px;
  left: 20px;
  color: var(--blue);
  font-size: 0.76rem;
  font-weight: 950;
}

.character-portrait img {
  width: min(100%, 420px);
  margin: 0 auto;
  border: 1px solid rgba(6, 24, 44, 0.16);
}

.character-code {
  position: absolute;
  right: 16px;
  bottom: 16px;
  display: grid;
  min-width: 118px;
  padding: 12px;
  border: 1px solid var(--green-dark);
  background: rgba(251, 253, 255, 0.94);
  color: var(--green-dark);
}

.character-code span {
  font-size: 2.8rem;
  line-height: 1;
  font-weight: 950;
}

.character-code strong {
  margin-top: 4px;
  font-size: 0.88rem;
}

.character-code small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
}

.character-identity {
  padding: 34px;
}

.identity-kicker {
  margin-bottom: 10px;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 950;
  text-transform: uppercase;
}

.character-identity h3 {
  margin-bottom: 28px;
  font-size: 2.55rem;
  line-height: 1.08;
}

.character-identity h3 span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 900;
}

.identity-list {
  margin: 0;
  border-top: 1px solid var(--line);
}

.identity-list div {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 18px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.identity-list dt {
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 950;
}

.identity-list dd {
  margin: 0;
  line-height: 1.55;
}

.setting-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  max-width: 1180px;
  margin: 0 auto;
  border: 1px solid var(--line);
  background: var(--line);
}

.setting-item {
  min-height: 230px;
  padding: 22px;
  background: var(--panel);
}

.setting-item + .setting-item {
  border-left: 1px solid var(--line);
}

.setting-grid > .setting-item.reveal {
  transform: none;
}

.setting-item span {
  display: block;
  margin-bottom: 32px;
  color: var(--green);
  font-size: 0.74rem;
  font-weight: 950;
}

.setting-item h3 {
  margin-bottom: 12px;
  font-size: 1.25rem;
}

.setting-item p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.75;
}

.data-section {
  background: #eaf5ff;
}

.data-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  border: 1px solid var(--line);
  background: var(--line);
}

.data-card {
  position: relative;
  min-height: 170px;
  padding: 20px;
  background: var(--panel);
}

.data-card span {
  position: absolute;
  top: 14px;
  right: 16px;
  color: rgba(18, 33, 30, 0.2);
  font-size: 2.1rem;
  font-weight: 950;
}

.data-card small {
  display: block;
  margin-bottom: 30px;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 950;
}

.data-card strong {
  display: block;
  max-width: 92%;
  font-size: 1.12rem;
  line-height: 1.55;
}

.copy-handle {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--green-dark);
  border-radius: var(--radius);
  color: var(--green-dark);
  background: transparent;
  font: inherit;
  font-weight: 950;
  cursor: pointer;
}

.copy-handle:hover {
  background: var(--lime);
}

.activities-section {
  background: #e8f3fb;
}

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

.activity-card,
.article-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.activity-card {
  min-height: 270px;
  padding: 24px;
}

.activity-card:hover,
.article-card:hover,
.link-grid a:hover {
  border-color: var(--green);
}

.activity-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  margin-bottom: 32px;
  border: 1px solid var(--green-dark);
  border-radius: var(--radius);
  color: #fff;
  background: var(--green-dark);
  font-size: 0.82rem;
  font-weight: 950;
}

.activity-card h3,
.article-card h3 {
  margin-bottom: 12px;
  font-size: 1.28rem;
  line-height: 1.35;
}

.articles-section {
  background: var(--paper);
}

.article-list {
  display: grid;
  grid-template-columns: 1.15fr repeat(2, minmax(0, 0.92fr));
  gap: 16px;
}

.article-card {
  display: flex;
  min-height: 360px;
  flex-direction: column;
  padding: 22px;
}

.feature-card {
  border-top: 5px solid var(--coral);
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 26px;
}

.article-card .article-images { display:flex; flex-wrap:wrap; gap:12px; margin-top:18px; }
.article-card .article-images img { display:block; width:100%; max-width:440px; height:auto; object-fit:contain; }
.article-card .article-links { display:flex; flex-wrap:wrap; gap:12px 24px; margin-top:18px; }
.article-card .article-links a { overflow-wrap:anywhere; max-width:100%; }
.article-card[hidden],.log-period-tabs[hidden]{display:none}
.log-period-controls{max-width:1180px;margin:0 auto 24px;border-bottom:1px solid var(--line)}
.rule-content{max-width:1180px;margin:0 auto}
.rule-topic{display:grid;grid-template-columns:40px minmax(0,1fr);gap:24px;padding:32px 0;border-top:1px solid var(--line)}
.rule-number{padding-top:4px;font-size:13px;font-weight:700;color:var(--green-dark)}
.rule-copy{min-width:0}
.rule-copy h3{margin:0 0 20px;font-size:24px;line-height:1.5;overflow-wrap:anywhere}
.rule-copy h2{font-size:26px;line-height:1.5;margin:28px 0 16px;overflow-wrap:anywhere}
.rule-copy h4,.rule-copy h5,.rule-copy h6{font-size:18px;line-height:1.6;margin:28px 0 12px;overflow-wrap:anywhere}
.rule-copy ul,.rule-copy ol{padding-left:1.5em;margin:0 0 20px;line-height:1.9}
.rule-copy li{margin:8px 0;overflow-wrap:anywhere}
.rule-copy strong{font-weight:800}
.rule-copy em{font-style:italic}
.rule-copy p{margin:0 0 16px;line-height:1.9;white-space:pre-wrap;overflow-wrap:anywhere}
.rule-copy p:last-child{margin-bottom:0}
.rule-copy .layout-zone{padding-left:0;padding-right:0}
@media(max-width:680px){.rule-topic{grid-template-columns:24px minmax(0,1fr);gap:14px;padding:24px 0}.rule-copy h3{font-size:21px}}
.log-period-tabs{display:flex;flex-wrap:wrap;gap:4px 16px;padding:6px 0}
.log-period-tabs button{font:inherit;font-size:14px;background:transparent;border:0;border-bottom:2px solid transparent;border-radius:0;padding:8px 2px;color:inherit;cursor:pointer}
.log-period-tabs button[aria-selected="true"]{border-color:currentColor;font-weight:700;color:var(--green-dark)}
.log-period-tabs button:focus-visible{outline:2px solid #1683ca;outline-offset:2px}
.article-card .article-images[data-log-slideshow]{position:relative;display:block;aspect-ratio:16/9;width:100%;overflow:hidden;background:#162d3d}
.article-images[data-log-slideshow]>img,.article-images[data-log-slideshow] .log-image-outgoing img{width:100%;max-width:none;height:100%;object-fit:contain;position:absolute;inset:0}
.article-images[data-log-slideshow]>img[hidden]{display:none}
.log-image-outgoing{position:absolute;inset:0;background:inherit;pointer-events:none;z-index:1}
.log-gallery-controls{position:absolute;z-index:2;bottom:8px;right:8px;display:flex;align-items:center;gap:8px;padding:4px 6px;background:#102331e6;color:white;font-size:12px}
.log-gallery-controls button{width:28px;height:28px;border:0;padding:0;background:transparent;color:inherit;font-size:16px;cursor:pointer}

.article-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border-left: 3px solid var(--green-dark);
  color: var(--green-dark);
  background: #eaf5ff;
  font-size: 0.76rem;
  font-weight: 950;
}

.article-card a {
  margin-top: auto;
  color: var(--green-dark);
  font-weight: 950;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.content-empty { color: #758492; font-size: 15px; line-height: 1.8; }
.layout-zone { display: flex; flex-wrap: wrap; gap: 24px; width: 100%; max-width: 1180px; margin: 0 auto; }
.layout-zone:has(> *) { padding-top: 32px; padding-bottom: 16px; }
.layout-block { flex: 0 0 100%; min-width: 0; max-width: 100%; margin: 0; }
.layout-block[data-size="auto"] { flex: 0 1 auto; }
.layout-block[data-native][data-size="auto"] { display: contents; }
.layout-block[data-layout-block][data-position="free"] { display: block; position: relative; transform: translate(var(--layout-x,0px),var(--layout-y,0px)); z-index: 2; }
.layout-block[data-position="free"][data-size="auto"] { width: var(--layout-free-width,auto); }
.layout-block[data-position="free"] img { max-width: 100%; height: auto; }
.hero:has([data-position="free"]), .portrait-frame:has([data-position="free"]), .character-portrait:has([data-position="free"]) { overflow: visible; }
@media(max-width:680px) { .layout-block[data-layout-block][data-position="free"] { transform: none; width: 100%; max-width: 100%; } }
.layout-block[data-size="half"] { flex-basis: calc(50% - 12px); width: calc(50% - 12px); }
.layout-block[data-size="third"] { flex-basis: calc(33.333333% - 16px); width: calc(33.333333% - 16px); }
.layout-block[data-align="center"] { text-align: center; }
.layout-block[data-align="end"] { text-align: right; }
.layout-block:not([data-native]) h2 { font-size: 28px; line-height: 1.5; margin: 0 0 12px; overflow-wrap: anywhere; }
.layout-block:not([data-native]) p { font-size: 16px; line-height: 1.9; margin: 0; overflow-wrap: anywhere; white-space: pre-line; }
.layout-block:not([data-native]) img { display: inline-block; max-width: 100%; height: auto; object-fit: contain; vertical-align: middle; }
.layout-link { display: inline-flex; align-items: center; justify-content: space-between; gap: 20px; width: 100%; min-height: 62px; padding: 16px 22px; border: 1px solid #94b3cf; background: #fff; color: #173d58; font-size: 16px; font-weight: 700; text-decoration: none; overflow-wrap: anywhere; }
.layout-link:hover { border-color: #0875c1; background: #eaf4ff; }
.layout-link::after { content: '↗'; flex-shrink: 0; }
.layout-spacer { height: var(--space,32px); }
@media(max-width:680px) { .layout-block[data-size="half"], .layout-block[data-size="third"] { flex-basis: 100%; width: 100%; } .layout-zone { gap: 18px; } .layout-block:not([data-native]) h2 { font-size: 23px; } }
@media(max-width:680px) {
}

.featured-videos[hidden] { display: none !important; }
.page-view.section.featured-videos:not(.source-section) { min-height: 0; padding-top: 64px; }
.featured-videos .section-header, .featured-videos .video-grid { width: 100%; max-width: none; margin-left: 0; margin-right: 0; }
.featured-videos .section-header h2 { margin-top: 12px; font-size: 2.4rem; line-height: 1.3; }
@media (max-width: 680px) {
  .page-view.section.featured-videos:not(.source-section) { padding-top: 40px; }
  .featured-videos .section-header h2 { font-size: 1.9rem; }
}
.video-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.video-item { min-width: 0; }
.video-poster, .video-player { display: block; position: relative; width: 100%; aspect-ratio: 16 / 9; padding: 0; border: 0; border-radius: 0; overflow: hidden; background: #111; }
.video-poster { cursor: pointer; }
.video-poster img { display: block; width: 100%; height: 100%; object-fit: cover; }
.video-play { position: absolute; inset: 0; display: grid; place-items: center; color: white; font-size: 38px; text-shadow: 0 2px 12px #000; background: #0002; }
.video-poster:hover .video-play { background: #0005; }
.video-poster:focus-visible { outline: 3px solid #148bdf; outline-offset: 4px; }
.video-item h3 { font-size: 18px; line-height: 1.6; margin: 14px 0 8px; overflow-wrap: anywhere; }
.video-item a { font-size: 13px; color: #0875c1; }
@media (max-width: 1040px) { .video-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 680px) { .video-grid { grid-template-columns: 1fr; } }

.activity-tiles { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 24px; max-width: 1180px; margin: 0 auto; }
.activity-tile { display: grid; grid-template-columns: 1fr 1fr; min-width: 0; min-height: 220px; padding: 0; border: 1px solid #bed0df; border-radius: 2px; color: #102a40; background: #fff; text-align: left; font: inherit; cursor: pointer; overflow: hidden; transition: border-color .2s, box-shadow .2s; }
.activity-tile:hover, .activity-tile:focus-visible { border-color: #1683ca; box-shadow: 0 4px 16px #102a4012; }
.activity-tile:focus-visible { outline: 2px solid #1683ca; outline-offset: 3px; }
.activity-tile-copy { display: flex; flex-direction: column; align-items: flex-start; padding: 24px; min-width: 0; }
.activity-tile-number { font-size: 12px; color: #0875c1; font-weight: 700; }
.activity-tile-title { display: block; font-size: 22px; font-weight: 800; margin: 10px 0; line-height: 1.4; overflow-wrap: anywhere; }
.activity-tile-description { display: block; font-size: 14px; line-height: 1.8; color: #496071; overflow-wrap: anywhere; }
.activity-tile-arrow { margin-top: auto; padding-top: 12px; font-size: 22px; color: #0875c1; }
.activity-tile-preview { display: flex; flex-direction: column; min-width: 0; background: #eaf3fa; pointer-events: none; position: relative; isolation: isolate; }
.activity-preview-outgoing { position: absolute; inset: 0; z-index: 1; display: flex; flex-direction: column; background: inherit; pointer-events: none; }
.activity-article-thumbnail { display:block; aspect-ratio:16/9; overflow:hidden; }
.activity-article-thumbnail img { display:block; width:100%; height:100%; object-fit:cover; }
@media(prefers-reduced-motion:reduce){.activity-tile-preview{transition:none}}
.activity-tile-media { position: relative; display: grid; place-items: center; aspect-ratio: 16/11; width: 100%; overflow: hidden; background: #dfeefa; }
.activity-tile-media img { display: block; width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.activity-hover-player { position: absolute; inset: 0; width: 100%; height: 100%; min-width: 200px; min-height: 200px; border: 0; pointer-events: none; }
.activity-tile-media.is-article { background: #173d58; color: #fff; padding: 20px; font-size: 17px; line-height: 1.7; }
.activity-tile-media.is-article span { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.activity-tile-caption { padding: 12px 14px; font-size: 12px; line-height: 1.6; height: 64px; overflow: hidden; }
.activity-dialog { width: min(1000px,calc(100% - 32px)); max-height: 88svh; padding: 0; border: 1px solid #bed0df; border-radius: 4px; background: #f9fcff; color: #102a40; }
.activity-dialog::backdrop { background: #071d34bb; }
.activity-dialog[open] { animation: activity-enter .18s ease-out; }
.activity-dialog-header { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 24px; background: #fff; border-bottom: 1px solid #bed0df; }
.activity-dialog-header h3 { font-size: 24px; margin: 0; overflow-wrap: anywhere; }
.activity-close { flex: 0 0 40px; width: 40px; height: 40px; border: 1px solid #bed0df; border-radius: 2px; background: white; color: #173d58; font: 30px/1 system-ui; cursor: pointer; }
.activity-dialog-content { padding: 24px; }
.activity-dialog-content > p { margin: 0 0 24px; line-height: 1.8; }
.activity-dialog-content a { display: inline-block; color: #0875c1; margin-top: 12px; font-size: 14px; }
.activity-dialog-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 28px; margin-top: 28px; }
.activity-dialog-item { min-width: 0; border-top: 1px solid #bed0df; padding-top: 20px; }
.activity-item-links { display:flex; flex-wrap:wrap; gap:10px 20px; margin-top:12px; }
.activity-item-links a { max-width:100%; overflow-wrap:anywhere; }
.activity-dialog-item h4 { font-size: 17px; line-height: 1.7; margin: 12px 0 0; overflow-wrap: anywhere; }
body:has(.activity-dialog[open]) { overflow: hidden; }
@keyframes activity-enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@media(max-width:900px) { .activity-tiles { grid-template-columns: 1fr; } }
@media(max-width:680px) { .activity-tile-copy { padding: 18px; } .activity-tile-title { font-size: 19px; } .activity-tile-description { font-size: 13px; } .activity-tile { min-height: 200px; } .activity-dialog-list { grid-template-columns: 1fr; } .activity-dialog-header, .activity-dialog-content { padding: 16px; } }
@media(prefers-reduced-motion:reduce) { .activity-dialog[open] { animation: none; } .activity-tile { transition: none; } }

.works-tabs { display: flex; border-bottom: 1px solid var(--line); gap: 24px; margin-bottom: 32px; }
.works-tabs button { font: inherit; font-weight: 700; color: inherit; background: transparent; border: 0; border-bottom: 3px solid transparent; padding: 14px 0; border-radius: 0; cursor: pointer; }
.works-tabs button[aria-selected="true"] { color: #0875c1; border-bottom-color: #0875c1; }
.works-tabs button:focus-visible { outline: 2px solid #0875c1; outline-offset: 3px; }
.work-panel[hidden] { display: none; }
.works-tabs { flex-wrap: wrap; row-gap: 0; }
.work-playlist { max-width: 800px; margin-bottom: 40px; }
.playlist-label { position: absolute; bottom: 0; left: 0; right: 0; color: white; background: #102a40e8; padding: 12px 16px; text-align: left; font-size: 15px; }
.works-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.works-heading h3 { font-size: 21px; margin: 0; }
.works-heading a { font-size: 14px; color: #0875c1; }
.works-video-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 28px; }
.work-video { color: inherit; text-decoration: none; min-width: 0; }
.work-video:hover h4 { text-decoration: underline; }
.work-video img { display: block; width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.work-video h4 { font-size: 17px; line-height: 1.65; margin: 12px 0 0; overflow-wrap: anywhere; }
.work-entry { border-top: 1px solid var(--line); padding: 24px 0; }
.work-entry h3 { font-size: 21px; line-height: 1.6; margin: 10px 0; overflow-wrap: anywhere; }
.work-entry p { line-height: 1.9; }
.work-entry a { color: #0875c1; }
@media(max-width:1040px){ .works-video-grid {grid-template-columns:repeat(2,minmax(0,1fr));} }
@media(max-width:680px){ .works-video-grid {grid-template-columns:1fr;} .works-tabs{gap:16px;} .works-tabs button{font-size:14px;} }

.links-section {
  color: #fff;
  background:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    #06182c;
  background-size: 36px 36px;
}

.link-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.16);
}

.link-grid a {
  display: flex;
  flex-direction: column;
  min-height: 178px;
  justify-content: space-between;
  gap: 16px;
  padding: 14px;
  border: 1px solid transparent;
  background: rgba(6, 24, 44, 0.94);
  text-decoration: none;
  overflow: hidden;
}

.link-media {
  display: grid;
  min-height: 104px;
  place-items: center;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background:
    linear-gradient(135deg, rgba(58, 164, 224, 0.18), transparent 48%),
    rgba(255, 255, 255, 0.06);
}

.link-media img {
  display: block;
  width: min(100%, 142px);
  max-height: 76px;
  object-fit: contain;
  filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.24));
  transition: transform 220ms ease, filter 220ms ease;
}

.link-copy {
  display: grid;
  gap: 8px;
}

.link-grid span {
  color: var(--lime);
  font-size: 0.78rem;
  font-weight: 950;
}

.link-grid strong {
  overflow-wrap: anywhere;
  font-size: 1.06rem;
  line-height: 1.42;
}

.link-grid a:hover .link-media img {
  transform: translateY(-2px) scale(1.03);
  filter: drop-shadow(0 16px 24px rgba(0, 0, 0, 0.34));
}

.source-section {
  padding-top: 46px;
  padding-bottom: 46px;
}

.source-box {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px;
  border-left: 4px solid var(--coral);
  background: var(--panel);
}

.source-box h2 {
  margin-bottom: 10px;
  font-size: 1.2rem;
}

.source-box p {
  margin-bottom: 0;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 24px 48px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  background: var(--panel);
}

.site-footer p {
  margin-bottom: 0;
}

.site-footer a {
  font-weight: 900;
  text-decoration: none;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 60;
  padding: 12px 14px;
  border: 1px solid var(--green-dark);
  background: var(--green-dark);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 900;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.loading-screen {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  background:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    #06182c;
  background-size: 34px 34px;
  transition:
    opacity 420ms ease,
    visibility 420ms ease;
}

body:not(.is-loading) .loading-screen {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loading-panel {
  position: relative;
  width: min(78vw, 620px);
  padding: 30px;
  border: 1px solid rgba(158, 227, 255, 0.42);
  background: rgba(6, 24, 44, 0.78);
  box-shadow: 14px 14px 0 rgba(53, 166, 255, 0.18);
  animation: panel-fade-in 420ms ease both;
}

.loading-panel::after {
  content: "";
  position: absolute;
  left: 30px;
  right: 30px;
  bottom: 18px;
  height: 3px;
  background: var(--yellow);
  transform-origin: left;
  animation: transition-bar 650ms ease-in-out infinite alternate;
}

.loading-panel img {
  width: 100%;
  margin: 0 auto 18px;
  filter: drop-shadow(10px 12px 0 rgba(0, 0, 0, 0.26));
  animation: logo-soft-in 520ms ease both;
}

.loading-panel span {
  display: block;
  color: var(--lime);
  font-size: 0.8rem;
  font-weight: 950;
}

.page-transition {
  position: fixed;
  z-index: 90;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  background:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    #06182c;
  background-size: 34px 34px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 320ms ease,
    visibility 320ms ease;
}

.page-transition::before,
.page-transition::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(158, 227, 255, 0.44);
}

.page-transition::before {
  top: 34%;
}

.page-transition::after {
  bottom: 34%;
}

.page-transition.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.transition-panel {
  position: relative;
  width: min(84vw, 620px);
  padding: 28px;
  border: 1px solid rgba(158, 227, 255, 0.46);
  background: rgba(6, 24, 44, 0.86);
  box-shadow: 14px 14px 0 rgba(53, 166, 255, 0.18);
  opacity: 0;
  transform: translateY(18px) scale(0.97);
}

.page-transition.is-visible .transition-panel {
  animation: panel-fade-in 360ms ease both;
}

.transition-panel::before {
  content: "";
  position: absolute;
  left: 28px;
  right: 28px;
  bottom: 18px;
  height: 3px;
  background: var(--yellow);
  transform-origin: left;
  transform: scaleX(0);
}

.page-transition.is-visible .transition-panel::before {
  animation: transition-bar 900ms ease forwards;
}

.transition-kicker,
.transition-panel small {
  display: block;
  color: var(--lime);
  font-size: 0.78rem;
  font-weight: 950;
}

.transition-panel img {
  width: 100%;
  margin: 0 auto 18px;
  filter: drop-shadow(10px 12px 0 rgba(0, 0, 0, 0.25));
  transform: translateY(0) scale(1);
  opacity: 1;
}

.page-transition.is-visible .transition-panel img {
  animation: logo-pop 480ms ease both;
}

@keyframes transition-bar {
  to {
    transform: scaleX(1);
  }
}

@keyframes panel-fade-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.97);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes logo-soft-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes logo-pop {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.94);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition:
    opacity 520ms ease,
    transform 520ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 1040px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
    padding: 14px 24px;
  }

  .site-nav {
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .site-nav a {
    min-width: max-content;
  }

  .hero,
  .hero-grid {
    min-height: auto;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    padding-top: 150px;
  }

  .stage-card {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    width: min(100%, 680px);
  }

  .stage-label {
    grid-column: 1 / -1;
  }

  .portrait-frame {
    margin: 14px;
  }

  .stage-data {
    border-top: 0;
    border-left: 1px solid rgba(255, 255, 255, 0.18);
  }

  h1 {
    font-size: 5.8rem;
  }

  .section-header h2 {
    font-size: 2.8rem;
  }

  .profile-grid,
  .data-grid,
  .activity-grid,
  .article-list,
  .link-grid {
    grid-template-columns: 1fr 1fr;
  }

  .setting-grid {
    grid-template-columns: 1fr 1fr;
  }

  .setting-item:nth-child(2n + 1) {
    border-left: 0;
  }

  .setting-item:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }

  .profile-note {
    box-shadow: none;
  }
}

@media (max-width: 680px) {
  .site-header {
    position: absolute;
    padding: 13px 16px;
  }

  .brand {
    white-space: normal;
  }

  .site-nav {
    gap: 16px;
    font-size: 0.84rem;
  }

  .hero-grid {
    gap: 28px;
    padding: 132px 18px 38px;
  }

  h1 {
    font-size: 4rem;
  }

  .hero-copy {
    font-size: 1rem;
    line-height: 1.75;
  }

  .hero-tags {
    margin-bottom: 20px;
  }

  .hero-actions {
    width: 100%;
  }

  .button {
    flex: 1 1 150px;
    min-width: 0;
  }

  .stage-card {
    grid-template-columns: 128px minmax(0, 1fr);
  }

  .stage-label {
    padding: 9px 12px;
  }

  .portrait-frame {
    margin: 12px;
  }

  .stage-data div {
    padding: 8px 11px;
    font-size: 0.84rem;
  }

  .stage-data div:last-child {
    display: none;
  }

  .section {
    padding: 58px 18px;
  }

  .page-view.section:not(.source-section) {
    padding-top: 132px;
  }

  .section-header {
    margin-bottom: 24px;
  }

  .section-header h2 {
    font-size: 2.1rem;
  }

  .lead {
    font-size: 1.08rem;
    line-height: 1.85;
  }

  .profile-grid,
  .data-grid,
  .activity-grid,
  .article-list,
  .link-grid {
    grid-template-columns: 1fr;
  }

  .character-file {
    grid-template-columns: 1fr;
    box-shadow: none;
  }

  .character-portrait {
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .character-identity {
    padding: 24px 20px;
  }

  .character-identity h3 {
    font-size: 2rem;
  }

  .identity-list div {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .setting-grid {
    grid-template-columns: 1fr;
  }

  .setting-item + .setting-item {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .setting-item {
    min-height: auto;
  }

  .data-card,
  .activity-card,
  .article-card {
    min-height: auto;
  }

  .stage-data div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .site-footer {
    flex-direction: column;
    padding: 24px 18px;
  }

  .loading-panel,
  .transition-panel {
    width: min(88vw, 420px);
    padding: 18px;
  }
}
