/* Shared presentation layer. Artwork and photo pixels are never filtered. */
body.nerine-monochrome {
  --portal-paper: #fff;
  --portal-ink: #111;
  --portal-night: #111;
  --portal-blue: #111;
  --portal-cyan: #eee;
  --portal-purple: #666;
  --portal-pink: #eee;
  --portal-yellow: #111;
  --portal-coral: #ddd;
  --portal-line: #ddd;
  --portal-shell: min(calc(100% - 96px), 1320px);
  --portal-gutter: clamp(20px, 2.4vw, 32px);
  --portal-section-space: clamp(64px, 8vw, 112px);
  --archive-paper: #fff;
  --archive-ink: #111;
  --archive-blue: #111;
  --archive-deep: #111;
  --archive-cyan: #eee;
  --archive-line: #ddd;
  --archive-shell: var(--portal-shell);
  --about-paper: #fff;
  --about-ink: #111;
  --about-blue: #111;
  --about-navy: #111;
  --about-cyan: #eee;
  --about-line: #ddd;
  --about-shell: var(--portal-shell);
  --about-gap: var(--portal-gutter);
  --service-paper: #fff;
  --service-ink: #111;
  --service-blue: #111;
  --service-deep: #111;
  --service-cyan: #eee;
  --service-line: #ddd;
  --service-shell: var(--portal-shell);
  margin: 0;
  color: #111;
  background: #fff;
  font-size: 16px;
  line-height: 1.8;
}
body.nerine-monochrome *,
body.nerine-monochrome *::before,
body.nerine-monochrome *::after { box-sizing: border-box; }
body.nerine-monochrome::after { display: none; }
body.nerine-monochrome ::selection { color: #fff; background: #111; }
body.nerine-monochrome a { color: inherit; }
body.nerine-monochrome :is(a, button, input, select, textarea, summary):focus-visible {
  outline: 2px solid #111;
  outline-offset: 4px;
}
body.nerine-monochrome [id] { scroll-margin-top: 100px; }

/* A quiet, consistent header and footer on every redesigned page. */
body.nerine-monochrome .portal-header {
  min-height: 76px;
  color: #111;
  background: rgba(255,255,255,.97);
  border-bottom: 1px solid #ddd;
}
body.nerine-monochrome .portal-header a,
body.nerine-monochrome .portal-footer a { color: #111; }
body.nerine-monochrome .portal-header .portal-header__brand img,
body.nerine-monochrome .portal-footer .portal-footer__brand img { filter: brightness(0); }
body.nerine-monochrome .portal-navigation { gap: clamp(12px, 1.5vw, 24px); }
body.nerine-monochrome .portal-navigation a { font-family: Arial, sans-serif; font-size: 11px; font-weight: 400; letter-spacing: .08em; }
body.nerine-monochrome .portal-footer {
  color: #111;
  background: #fff;
  border-top: 1px solid #ddd;
}
body.nerine-monochrome .portal-footer__inner { display: grid; grid-template-columns: auto 1fr auto; gap: 32px; padding-block: 32px; }
body.nerine-monochrome .portal-footer__links { justify-content: center; flex-wrap: wrap; gap: 12px 24px; }
body.nerine-monochrome .portal-footer__copyright { margin: 0; color: #666; }
body.nerine-monochrome .portal-footer__wave { display: none; }

/* Home: a compact wordmark, then the latest artwork. */
body.nerine-monochrome :is(.portal-main, .portal-section, .portal-contact, .home-service-cta) {
  color: #111;
  background: #fff;
}
body.nerine-monochrome :is(.portal-section, .portal-contact, .home-service-cta) { border-top: 1px solid #ddd; }
body.nerine-monochrome .portal-hero { min-height: 0; color: #111; background: #fff; }
body.nerine-monochrome .portal-hero__inner {
  min-height: 0;
  padding: 112px 0 40px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 24px 48px;
  align-items: end;
}
body.nerine-monochrome .portal-hero__index { grid-column: 1 / -1; justify-self: start; color: #666; font-weight: 400; }
body.nerine-monochrome .portal-hero__brand { width: min(100%, 400px); justify-self: start; color: #111; filter: none; }
body.nerine-monochrome .portal-logo-svg path {
  animation: none;
  fill-opacity: 1;
  stroke: none;
  stroke-dashoffset: 0;
}
body.nerine-monochrome .portal-hero__content { display: block; margin: 0; padding: 0; }
body.nerine-monochrome .portal-hero h1 { max-width: none; font-size: clamp(18px, 2vw, 26px); font-weight: 400; line-height: 1.7; }
body.nerine-monochrome .portal-hero__fields { margin-top: 16px; font-size: 10px; line-height: 1.7; color: #666; }
body.nerine-monochrome .portal-hero__scroll { display: inline-flex; margin-top: 16px; font-size: 10px; color: #666; }
body.nerine-monochrome :is(.portal-section-heading, .portal-station-heading) { margin-bottom: 36px; }
body.nerine-monochrome :is(.portal-section-heading h2, .portal-station-heading h2, .portal-contact h2) {
  margin-top: 12px;
  font-family: Arial, "Zen Kaku Gothic New", sans-serif;
  font-size: clamp(28px, 4vw, 52px);
  font-weight: 400;
  letter-spacing: .025em;
  line-height: 1.15;
}
body.nerine-monochrome :is(.portal-section-label, .portal-station-genres, .portal-work__label) { color: #666; font-style: normal; }
body.nerine-monochrome .portal-station-heading--light { color: #111; }
body.nerine-monochrome .portal-illustration { padding-block: 28px 56px; }
body.nerine-monochrome .portal-illustration .portal-section-heading { margin-bottom: 20px; }
body.nerine-monochrome .portal-illustration h2 { margin: 8px 0 10px; font-size: clamp(20px, 2.2vw, 28px); }
body.nerine-monochrome .portal-illustration .portal-section-heading p:last-child { font-size: 14px; }
/* Layout only: leave the plugin's image visibility and initialization intact. */
body.nerine-monochrome #illustration .portal-illustration__feed #sb_instagram #sbi_images {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--portal-gutter) !important;
}
body.nerine-monochrome #illustration #sb_instagram #sbi_load .sbi_load_btn,
body.nerine-monochrome #illustration #sb_instagram .sbi_follow_btn a { color: #fff; background: #111; border-radius: 0; box-shadow: none; }
body.nerine-monochrome #illustration #sb_instagram #sbi_load a:hover { background: #444; }
/* Keep INTRO independent of the legacy 12-column grid and its placements. */
body.nerine-monochrome .portal-intro { overflow: visible; }
body.nerine-monochrome .portal-intro-layout {
  display: flex;
  align-items: flex-start;
  gap: clamp(24px, 4vw, 64px);
}
body.nerine-monochrome .portal-intro-layout__label { flex: 0 0 clamp(120px, 15vw, 200px); }
body.nerine-monochrome .portal-intro-layout__content {
  flex: 1 1 0;
  min-width: 0;
  max-width: 52rem;
}
body.nerine-monochrome .portal-intro-layout__content h2 {
  margin: 0;
  font-family: Arial, sans-serif;
  font-size: clamp(24px, 3.2vw, 42px);
  font-weight: 400;
  line-height: 1.2;
  overflow-wrap: normal;
  word-break: normal;
}
body.nerine-monochrome .portal-intro-layout__content h2 span { display: block; white-space: normal; }
body.nerine-monochrome .portal-intro-layout__content > p { margin: 24px 0; font-size: 16px; line-height: 2; }
/* Preserve the plugin's error visibility rules, but give its message a safe box. */
body.nerine-monochrome #illustration .portal-illustration__feed { min-width: 0; width: 100%; }
body.nerine-monochrome #illustration #sbi_mod_error {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 20px;
  color: #444;
  background: #f5f5f5;
  border: 1px solid #ddd;
  font-size: 14px;
  line-height: 1.8;
  overflow-wrap: break-word;
}
body.nerine-monochrome .portal-selected__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 48px var(--portal-gutter); }
body.nerine-monochrome .portal-work { grid-column: auto; }
body.nerine-monochrome .portal-work__link { width: 100%; }
body.nerine-monochrome .portal-work h3 { font-size: 17px; }
body.nerine-monochrome .portal-project-item:nth-child(2) { margin-top: 0; }
body.nerine-monochrome .portal-project-item__media { aspect-ratio: 4 / 3; overflow: hidden; }
body.nerine-monochrome .portal-project-item__media img { border-radius: 0; }
body.nerine-monochrome .portal-project-item__text { padding-top: 12px; }
body.nerine-monochrome .portal-about-logo { color: #111; }
body.nerine-monochrome .portal-about__content > p { margin-top: 24px; font-size: 16px; }
body.nerine-monochrome :is(.portal-work__fallback, .portal-work-area__media, .portal-photo__image.is-fallback) { background: #eee; }
body.nerine-monochrome .portal-work-area__media > span { color: #111; background: #fff; font-size: 20px; padding: 4px; }

/* Remove decorative scenery, while retaining all content and artwork. */
body.nerine-monochrome :is(.portal-section-art, .portal-intro__map, .portal-character-wrap--contact, .portal-contact__glow,
  .about-noise, .archive-hero__noise, .service-orbits, .service-space-art, .service-flow__character, .service-faq__neri) { display: none; }
body.nerine-monochrome :is(.portal-selected, .portal-work-station, .portal-project-station, .portal-journal,
  .portal-contact, .home-service-cta, .portal-project-item__media, .subpage-hero, .archive-hero,
  .games-archive-heading, .service-menu, .service-hero, .service-contact)::before,
body.nerine-monochrome :is(.portal-selected, .portal-work-station, .portal-project-station, .portal-journal,
  .portal-contact, .home-service-cta, .portal-project-item__media, .subpage-hero, .games-archive-heading,
  .service-hero, .service-contact)::after { display: none; }

/* WORKS, GAMES, ABOUT and SERVICE retain their content and grids. */
body.nerine-monochrome :is(.archive-page, .archive-hero, .archive-closing, .archive-single, .archive-single__header,
  .games-archive-heading, .game-single__hero, .about-hero, .about-island, .about-current, .about-profile,
  .about-community, .about-archive, .about-connect, .service-hero, .service-intro, .service-menu,
  .service-flow, .service-faq, .service-contact) { color: #111; background: #fff; }
body.nerine-monochrome :is(.archive-closing, .about-island, .about-current, .about-profile,
  .about-community, .about-archive, .about-connect, .service-section, .service-contact) { border-top: 1px solid #ddd; }
body.nerine-monochrome .works-archive .archive-content::before { background: none; }
body.nerine-monochrome :is(.works-card__image, .photo-card__image, .game-card__figure) { color: #666; background: #f5f5f5; }
body.nerine-monochrome .subpage-hero { height: auto; min-height: 0; border-bottom: 1px solid #ddd; }
body.nerine-monochrome .subpage-hero .subpage-hero__inner { width: var(--portal-shell); min-height: 0; padding: 132px 0 64px; }
body.nerine-monochrome .subpage-hero .subpage-hero__main h1 { font-family: Arial, "Zen Kaku Gothic New", sans-serif; font-size: clamp(32px, 5vw, 64px); line-height: 1.2; }
body.nerine-monochrome .subpage-hero--service .subpage-hero__main h1 { font-size: clamp(24px, 3vw, 38px); line-height: 1.5; }
body.nerine-monochrome :is(.subpage-hero--work-single, .subpage-hero--game-single) .subpage-hero__main h1 { font-size: clamp(26px, 4vw, 48px); }
body.nerine-monochrome :is(.about-current-card__link, .about-social a, .game-single__hero .game-status, .service-link--light) { color: #111; }
body.nerine-monochrome :is(.about-current-card, .about-social, .about-social a, .service-faq details) { border-color: #ddd; }
body.nerine-monochrome .service-card { border: 1px solid #ddd; background: #fff; box-shadow: none; }
body.nerine-monochrome .service-card:nth-child(even) { background: #fff; transform: none; }
body.nerine-monochrome .service-card:hover { box-shadow: none; }
body.nerine-monochrome .service-card:nth-child(even):hover { transform: translateY(-6px); }
body.nerine-monochrome .service-card__neri { filter: none; }
body.nerine-monochrome .service-flow__list::before { background: #ddd; }
body.nerine-monochrome .service-faq details:hover,
body.nerine-monochrome .service-faq details[open] { background: #f5f5f5; }
body.nerine-monochrome .service-intro h2 { white-space: normal; }
body.nerine-monochrome .service-intro__grid { grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); }
body.nerine-monochrome :is(.about-island, .about-current, .about-profile, .about-community, .about-archive, .about-connect, .service-section, .service-contact) { padding-block: var(--portal-section-space); }
body.nerine-monochrome .archive-content { padding-block: var(--portal-section-space); }
body.nerine-monochrome .service-contact__grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }

/* Contact Form 7 keeps its validation and submission behavior. */
body.nerine-monochrome .portal-contact__copy { display: block; margin-top: 24px; }
body.nerine-monochrome .portal-contact__copy p { max-width: 46em; }
body.nerine-monochrome .portal-contact__form { padding: clamp(20px, 4vw, 48px); color: #111; background: #fff; border: 1px solid #ddd; border-radius: 0; box-shadow: none; }
body.nerine-monochrome .portal-contact__form :is(input:not([type="submit"]), select, textarea) { min-width: 0; color: #111; background: #f5f5f5; border-color: #888; border-radius: 0; }
body.nerine-monochrome .portal-contact__form input[type="submit"] { min-width: 0; }
body.nerine-monochrome .wpcf7-not-valid-tip { color: #111; font-weight: 700; }
body.nerine-monochrome .wpcf7 form .wpcf7-response-output { color: #111; border-color: #666; }
body.nerine-monochrome .portal-contact__form .wpcf7-spinner { background: #666; }

/* PHOTO uses the same heading rhythm as the other lower pages. */
body.nerine-monochrome .photo-archive-label { margin: 0 auto 24px; padding-top: 132px; color: #666; font-style: normal; }
body.nerine-monochrome .photo-archive-label + .section-title { font-family: Arial, sans-serif; font-size: clamp(32px, 5vw, 64px); font-weight: 400; }

/* PHOTO pagination: keep the links, simplify the route decoration. */
body.nerine-monochrome :is(.photo-pagination__chart, .photo-pagination__line, .photo-pagination__light) { display: none; }
body.nerine-monochrome :is(.photo-pagination__direction, .photo-pagination__pages .page-numbers, .photo-pagination__dots, .photo-pagination__caption) { color: #666; }
body.nerine-monochrome .photo-pagination__pages .current { color: #111; text-decoration: underline; text-underline-offset: 6px; }
body.nerine-monochrome .photo-pagination__pages .current::before,
body.nerine-monochrome .photo-pagination__pages .current::after { display: none; }
body.nerine-monochrome .photo-pagination__pages a.page-numbers:hover,
body.nerine-monochrome .photo-pagination__direction:hover { color: #111; }

/* Legacy detail templates share the same neutral surfaces. */
body.nerine-monochrome :is(#wrapper, #under, #illust2021, #singlepage, main#work, .footer, .navi) { color: #111; background: #fff; }
body.nerine-monochrome #singlepage #work :is(.outline, .work-content-title, .work-content-url) { color: #111; }
body.nerine-monochrome #singlepage #work .work-content-category { background: #111; }
body.nerine-monochrome :is(.pagenation li.active, .tax_wrap .page-numbers.current) { color: #fff; background: #111; border-color: #111; }
body.nerine-monochrome :is(.pagenation li:hover, .tax_wrap .page-numbers:hover) { border-color: #111; }
body.nerine-monochrome .pagenation .next a { color: #111; }

@media (max-width: 1100px) {
  body.nerine-monochrome .portal-footer__inner { grid-template-columns: 1fr auto; }
  body.nerine-monochrome .portal-footer__links { grid-column: 1 / -1; grid-row: 2; justify-content: flex-start; }
}
@media (max-width: 1023px) {
  body.nerine-monochrome .portal-header { z-index: 1002; width: 100%; }
  body.nerine-monochrome .portal-header__brand { position: relative; z-index: 2; }
  body.nerine-monochrome .service-menu__grid { grid-template-columns: minmax(0, 1fr); }
  body.nerine-monochrome .portal-menu-toggle { position: relative; z-index: 2; display: flex; gap: 12px; align-items: center; min-height: 44px; padding: 8px 0 8px 12px; border: 0; color: #111; background: transparent; font: 12px Arial, sans-serif; }
  body.nerine-monochrome .portal-menu-toggle i { display: block; position: relative; width: 24px; height: 12px; border: 0; }
  body.nerine-monochrome .portal-menu-toggle i::before,
  body.nerine-monochrome .portal-menu-toggle i::after { content: ""; position: absolute; left: 0; width: 24px; height: 1px; background: #111; }
  body.nerine-monochrome .portal-menu-toggle i::before { top: 2px; }
  body.nerine-monochrome .portal-menu-toggle i::after { top: 10px; }
  body.nerine-monochrome .portal-header.is-menu-open .portal-menu-toggle i::before { top: 6px; transform: rotate(45deg); }
  body.nerine-monochrome .portal-header.is-menu-open .portal-menu-toggle i::after { top: 6px; transform: rotate(-45deg); }
  body.nerine-monochrome .portal-navigation { position: fixed; z-index: 1; inset: 0; display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; width: 100%; max-width: 100%; height: 100dvh; padding: 96px 24px 32px; gap: 0; overflow-y: auto; visibility: hidden; opacity: 0; pointer-events: none; color: #111; background: #fff; }
  body.nerine-monochrome .portal-navigation::before { display: none; }
  body.nerine-monochrome .portal-header.is-menu-open .portal-navigation { visibility: visible; opacity: 1; pointer-events: auto; }
  body.nerine-monochrome .portal-navigation a { min-height: 48px; padding: 16px 0; border-bottom: 1px solid #ddd; font-size: 16px; line-height: 1.2; }
  body.nerine-monochrome .portal-navigation a::after { display: none; }
}
@media (max-width: 767px) {
  body.nerine-monochrome { --portal-shell: calc(100% - 40px); --portal-gutter: 16px; --portal-section-space: 56px; font-size: 15px; }
  body.nerine-monochrome .portal-hero__inner { padding: 100px 0 28px; gap: 20px; }
  body.nerine-monochrome .portal-hero__brand { grid-column: 1 / -1; width: min(64vw, 280px); }
  body.nerine-monochrome .portal-hero__content { grid-column: 1 / -1; }
  body.nerine-monochrome .portal-hero h1 { font-size: 18px; }
  body.nerine-monochrome .portal-hero__fields { font-size: 9px; }
  body.nerine-monochrome .portal-illustration { padding-block: 24px 40px; }
  body.nerine-monochrome #illustration .portal-illustration__feed #sb_instagram #sbi_images { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.nerine-monochrome .portal-intro-layout { flex-direction: column; gap: 24px; }
  body.nerine-monochrome .portal-intro-layout__label { flex: 0 0 auto; }
  body.nerine-monochrome .portal-intro-layout__content { flex: 0 1 auto; width: 100%; max-width: none; }
  body.nerine-monochrome .portal-intro-layout__content > p { font-size: 15px; }
  body.nerine-monochrome .portal-selected__grid { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  body.nerine-monochrome .portal-station-heading { display: block; }
  body.nerine-monochrome .portal-station-genres { margin-top: 16px; }
  body.nerine-monochrome .portal-section-heading { margin-bottom: 24px; }
  body.nerine-monochrome .subpage-hero .subpage-hero__inner { padding: 112px 0 48px; }
  body.nerine-monochrome .service-intro__grid { display: block; }
  body.nerine-monochrome .portal-footer__inner { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  body.nerine-monochrome .portal-footer__links { grid-column: 1; grid-row: auto; gap: 8px 20px; }
  body.nerine-monochrome .portal-footer__copyright { justify-self: start; }
}
