/* Shared fixed UI for the blog-generation network. Article body copy is untouched. */
html.codex-brand-ui {
  --codex-header-fade: color-mix(in srgb, var(--codex-brand-primary) 14%, transparent);
  --codex-border: color-mix(in srgb, var(--codex-brand-primary) 22%, #fff);
  --codex-shadow: 0 18px 46px color-mix(in srgb, var(--codex-brand-ink) 13%, transparent);
  color: var(--codex-brand-ink);
}

html.codex-brand-ui .l-header,
html.codex-brand-ui #header-container,
html.codex-brand-ui .header {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background-color: var(--codex-brand-soft) !important;
  background-image:
    radial-gradient(circle at 12% 16%, color-mix(in srgb, var(--codex-brand-accent) 27%, transparent) 0 13%, transparent 36%),
    radial-gradient(circle at 82% 5%, color-mix(in srgb, var(--codex-brand-primary) 21%, transparent) 0 17%, transparent 42%),
    linear-gradient(125deg, color-mix(in srgb, var(--codex-brand-soft) 92%, #fff), color-mix(in srgb, var(--codex-brand-primary) 10%, #fff)) !important;
}

html.codex-brand-ui .l-header__inner,
html.codex-brand-ui .header-in {
  position: relative;
  z-index: 1;
  min-height: clamp(132px, 15vw, 184px);
}

html.codex-brand-ui .l-header__logo {
  display: flex !important;
  flex: 1 0 100% !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100% !important;
  min-height: 174px !important;
  height: auto !important;
}

html.codex-brand-ui .l-header__inner::after,
html.codex-brand-ui .header-in::after {
  content: "";
  position: absolute;
  z-index: -1;
  top: 50%;
  right: clamp(22px, 7vw, 110px);
  width: clamp(92px, 11vw, 144px);
  aspect-ratio: 1;
  transform: translateY(-50%) rotate(4deg);
  border-radius: 28%;
  background: var(--codex-site-icon) center / contain no-repeat;
  filter: saturate(.82);
  opacity: .19;
}

html.codex-brand-ui .c-headLogo,
html.codex-brand-ui .logo-header {
  height: auto !important;
  width: fit-content !important;
  max-width: min(420px, 72vw) !important;
  margin: 18px auto !important;
  padding: 13px 20px !important;
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 18px;
  background: rgba(255,255,255,.78);
  box-shadow: 0 12px 34px rgba(24,35,45,.09);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

html.codex-brand-ui .c-headLogo__link,
html.codex-brand-ui .c-headLogo a {
  height: auto !important;
}

html.codex-brand-ui .c-headLogo img,
html.codex-brand-ui .c-headLogo__img,
html.codex-brand-ui .logo-header img {
  display: block !important;
  width: auto !important;
  max-width: min(350px, 64vw) !important;
  height: auto !important;
  max-height: 96px !important;
  object-fit: contain !important;
  object-position: center !important;
}

html.codex-brand-ui .c-headLogo__link,
html.codex-brand-ui .c-headLogo a,
html.codex-brand-ui .logo-header a {
  color: var(--codex-brand-ink) !important;
  font-weight: 800;
  letter-spacing: .02em;
  text-shadow: none !important;
}

html.codex-brand-ui .l-header__gnav,
html.codex-brand-ui .l-header__spNav,
html.codex-brand-ui #navi,
html.codex-brand-ui .navi {
  position: relative;
  z-index: 2;
  border-top: 1px solid rgba(255,255,255,.22);
  background: color-mix(in srgb, var(--codex-brand-primary) 92%, #202631) !important;
  box-shadow: 0 7px 22px color-mix(in srgb, var(--codex-brand-ink) 18%, transparent);
}

html.codex-brand-ui .c-gnav,
html.codex-brand-ui .navi-in > ul {
  justify-content: center;
}

html.codex-brand-ui .c-gnav > li > a,
html.codex-brand-ui .navi-in > ul > li > a {
  color: #fff !important;
  font-size: 14px !important;
  font-weight: 700;
  letter-spacing: .02em;
  white-space: nowrap;
}

html.codex-brand-ui .c-gnav > li > a:hover,
html.codex-brand-ui .navi-in > ul > li > a:hover {
  background: rgba(255,255,255,.12) !important;
}

html.codex-brand-ui .c-widget__title.-side,
html.codex-brand-ui .sidebar .widget-title,
html.codex-brand-ui .sidebar h3:not(.codex-profile-identity h3) {
  border-color: var(--codex-brand-primary) !important;
  background: var(--codex-brand-primary) !important;
  color: #fff !important;
}

html.codex-brand-ui .home .post_content h2:where(:not([class^="swell-block-"]):not(.faq_q):not(.p-postList__title)),
html.codex-brand-ui .page .post_content h2:where(:not([class^="swell-block-"]):not(.faq_q):not(.p-postList__title)) {
  border-color: var(--codex-brand-primary) !important;
  background: var(--codex-brand-primary) !important;
  color: #fff !important;
}

/* Individual background techniques: each keeps the shared structure but changes the atmosphere. */
html.codex-pattern-grid .l-header,
html.codex-pattern-grid .header {
  background-image: linear-gradient(rgba(49,87,213,.07) 1px, transparent 1px), linear-gradient(90deg, rgba(49,87,213,.07) 1px, transparent 1px), radial-gradient(circle at 72% 20%, rgba(44,198,183,.28), transparent 34%), linear-gradient(125deg,#f5f8ff,#e8efff) !important;
  background-size: 24px 24px,24px 24px,auto,auto !important;
}
html.codex-pattern-frames .l-header,
html.codex-pattern-frames .header {
  background-image: linear-gradient(135deg, transparent 0 68%, rgba(237,122,168,.15) 68% 72%, transparent 72%), repeating-linear-gradient(90deg, rgba(88,102,168,.055) 0 1px, transparent 1px 44px), linear-gradient(120deg,#f6f3fc,#eef1fb) !important;
}
html.codex-pattern-notebook .l-header,
html.codex-pattern-notebook .header {
  background-image: linear-gradient(90deg, transparent 0 9%, rgba(229,111,89,.16) 9% calc(9% + 2px), transparent calc(9% + 2px)), repeating-linear-gradient(0deg, transparent 0 27px, rgba(49,95,119,.09) 27px 28px), linear-gradient(125deg,#fffaf0,#fff1de) !important;
}
html.codex-pattern-soft .l-header,
html.codex-pattern-soft .header {
  background-image: radial-gradient(ellipse at 8% 30%, rgba(125,165,139,.28), transparent 34%), radial-gradient(ellipse at 86% 5%, rgba(184,107,85,.20), transparent 38%), linear-gradient(125deg,#fbf7f1,#f4ebe4) !important;
}
html.codex-pattern-road .l-header,
html.codex-pattern-road .header {
  background-image: repeating-linear-gradient(112deg, transparent 0 48px, rgba(255,255,255,.72) 48px 54px, transparent 54px 108px), linear-gradient(125deg,#f8e9e8,#ebeef2) !important;
}
html.codex-pattern-steps .l-header,
html.codex-pattern-steps .header {
  background-image: linear-gradient(135deg, transparent 0 56%, rgba(49,95,119,.08) 56% 60%, transparent 60%), repeating-linear-gradient(135deg, rgba(232,120,100,.10) 0 2px, transparent 2px 34px), linear-gradient(125deg,#f5fbfb,#e8f3f5) !important;
}
html.codex-pattern-waves .l-header,
html.codex-pattern-waves .header {
  background-image: radial-gradient(80px 36px at 16% 100%, transparent 47%, rgba(23,123,145,.15) 49% 54%, transparent 56%), radial-gradient(100px 40px at 70% 100%, transparent 47%, rgba(85,185,165,.20) 49% 54%, transparent 56%), linear-gradient(155deg,#eaf8f7,#dceff4) !important;
}
html.codex-pattern-care .l-header,
html.codex-pattern-care .header {
  background-image: radial-gradient(circle at 18% 38%, rgba(98,183,150,.22) 0 8%, transparent 8.5%), radial-gradient(circle at 78% 20%, rgba(57,123,178,.16) 0 12%, transparent 12.5%), linear-gradient(125deg,#f5fbfa,#e7f2f7) !important;
}
html.codex-pattern-steam .l-header,
html.codex-pattern-steam .header {
  background-image: radial-gradient(ellipse at 22% 110%, transparent 42%, rgba(155,73,56,.13) 43% 48%, transparent 49%), radial-gradient(ellipse at 72% 110%, transparent 45%, rgba(228,169,79,.18) 46% 51%, transparent 52%), linear-gradient(125deg,#fcf5eb,#f5e2cf) !important;
}
html.codex-pattern-network .l-header,
html.codex-pattern-network .header {
  background-image: radial-gradient(circle,rgba(46,181,195,.22) 0 2px,transparent 2.5px), linear-gradient(135deg,transparent 48%,rgba(51,87,164,.07) 48% 50%,transparent 50%), linear-gradient(125deg,#f3f7fd,#e7eef9) !important;
  background-size: 34px 34px,68px 68px,auto !important;
}
html.codex-pattern-palette .l-header,
html.codex-pattern-palette .header {
  background-image: radial-gradient(circle at 13% 22%,rgba(228,160,143,.24) 0 15%,transparent 15.5%),radial-gradient(circle at 85% 8%,rgba(155,107,145,.20) 0 19%,transparent 19.5%),radial-gradient(circle at 72% 88%,rgba(113,151,184,.15) 0 16%,transparent 16.5%),linear-gradient(125deg,#fff8fa,#f4edf5) !important;
}
html.codex-pattern-table .l-header,
html.codex-pattern-table .header {
  background-image: radial-gradient(circle at 12% 30%,transparent 0 33px,rgba(214,88,67,.13) 34px 39px,transparent 40px),radial-gradient(circle at 82% 15%,transparent 0 48px,rgba(240,169,58,.16) 49px 54px,transparent 55px),linear-gradient(125deg,#fffaf1,#ffeddc) !important;
}
html.codex-pattern-mountain .l-header,
html.codex-pattern-mountain .header {
  background-image: linear-gradient(145deg,transparent 0 63%,rgba(63,107,82,.13) 63% 76%,transparent 76%),linear-gradient(35deg,transparent 0 64%,rgba(217,144,69,.13) 64% 76%,transparent 76%),radial-gradient(circle at 82% 18%,rgba(217,144,69,.25) 0 5%,transparent 5.5%),linear-gradient(125deg,#f5f5ea,#e7eee4) !important;
}

/* Shared upper card on articles and pages. */
html.codex-brand-ui .p-articleHead,
html.codex-brand-ui .article-header,
html.codex-brand-ui .archive-title {
  position: relative;
  overflow: hidden;
  margin-bottom: clamp(22px,4vw,38px);
  padding: clamp(20px,3.3vw,34px) !important;
  border: 1px solid var(--codex-border);
  border-left: 6px solid var(--codex-brand-primary);
  border-radius: 16px;
  background: linear-gradient(125deg,rgba(255,255,255,.96),color-mix(in srgb,var(--codex-brand-soft) 82%,#fff));
  box-shadow: 0 12px 32px color-mix(in srgb,var(--codex-brand-ink) 7%,transparent);
}
html.codex-brand-ui .p-articleHead::after,
html.codex-brand-ui .article-header::after {
  content: "";
  position: absolute;
  right: 18px;
  bottom: -18px;
  width: 86px;
  aspect-ratio: 1;
  border-radius: 24%;
  background: var(--codex-site-icon) center/contain no-repeat;
  opacity: .075;
  pointer-events: none;
}

/* Profile page identity: real icon, clear role, and a site-specific color atmosphere. */
html.codex-brand-ui .codex-profile-identity {
  display: grid;
  grid-template-columns: 148px minmax(0,1fr);
  gap: clamp(22px,4vw,44px);
  align-items: center;
  margin: 0 0 42px;
  padding: clamp(24px,4vw,42px);
  border: 1px solid var(--codex-border);
  border-radius: 24px;
  background: radial-gradient(circle at 8% 18%,color-mix(in srgb,var(--codex-brand-accent) 18%,transparent),transparent 34%),linear-gradient(135deg,#fff,var(--codex-brand-soft));
  box-shadow: var(--codex-shadow);
}

html.codex-profile-page .eye-catch-wrap,
html.codex-profile-page .sns-share,
html.codex-profile-page .sns-follow,
html.codex-profile-page #toc,
html.codex-profile-page .p-toc,
html.codex-profile-page .blog-generation-toc {
  display: none !important;
}

html.codex-profile-page .article-header {
  min-height: 0;
}
html.codex-brand-ui .codex-profile-identity__icon {
  display: block;
  width: 144px;
  height: 144px;
  margin: 0;
  border: 7px solid rgba(255,255,255,.92);
  border-radius: 30%;
  background: #fff;
  box-shadow: 0 12px 28px color-mix(in srgb,var(--codex-brand-ink) 16%,transparent);
  object-fit: contain;
}
html.codex-brand-ui .codex-profile-identity__copy > * { margin-top: 0; }
html.codex-brand-ui .codex-profile-identity__eyebrow {
  margin-bottom: 8px;
  color: var(--codex-brand-primary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .16em;
}
html.codex-brand-ui .codex-profile-identity__title {
  margin-bottom: 4px !important;
  padding: 0 !important;
  border: 0 !important;
  background: none !important;
  color: var(--codex-brand-ink) !important;
  font-size: clamp(26px,4vw,38px);
  font-weight: 800;
  line-height: 1.35;
}
html.codex-brand-ui .codex-profile-identity__role {
  margin-bottom: 14px;
  color: var(--codex-brand-primary);
  font-size: 14px;
  font-weight: 700;
}
html.codex-brand-ui .codex-profile-identity__lead {
  margin-bottom: 0;
  line-height: 1.9;
}

html.codex-brand-ui .codex-sidebar-profile,
html.codex-brand-ui .uchip-sidebar-profile,
html.codex-brand-ui .p-profileBox,
html.codex-brand-ui .author-box {
  overflow: hidden;
  border: 1px solid var(--codex-border) !important;
  border-radius: 16px !important;
  background: linear-gradient(155deg,#fff,var(--codex-brand-soft)) !important;
  box-shadow: 0 10px 28px color-mix(in srgb,var(--codex-brand-ink) 8%,transparent);
}
html.codex-brand-ui .codex-sidebar-profile img,
html.codex-brand-ui .uchip-sidebar-profile img,
html.codex-brand-ui .p-profileBox img,
html.codex-brand-ui .author-box img {
  border-color: color-mix(in srgb,var(--codex-brand-primary) 22%,#fff) !important;
  object-fit: contain !important;
}

@media (max-width: 959px) {
  html.codex-profile-page body,
  html.codex-profile-page #container,
  html.codex-profile-page #content,
  html.codex-profile-page .content-in,
  html.codex-profile-page #main,
  html.codex-profile-page .main,
  html.codex-profile-page .article,
  html.codex-profile-page .entry-content {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box;
  }
  html.codex-profile-page .wrap {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box;
  }
  html.codex-profile-page .content-in { display: block !important; }
  html.codex-profile-page .main { padding-right: 12px !important; padding-left: 12px !important; }
  html.codex-profile-page .sidebar { display: none !important; }
  html.codex-profile-page img { max-width: 100% !important; height: auto; }
  html.codex-brand-ui .l-header__inner,
  html.codex-brand-ui .header-in { min-height: 112px; }
  html.codex-brand-ui .l-header__logo { min-height: 112px !important; }
  html.codex-brand-ui .l-header__inner::after,
  html.codex-brand-ui .header-in::after { right: 14px; width: 72px; opacity: .15; }
  html.codex-brand-ui .c-headLogo,
  html.codex-brand-ui .logo-header { max-width: min(250px,72vw) !important; margin: 12px auto !important; padding: 10px 15px !important; border-radius: 14px; }
  html.codex-brand-ui .c-headLogo img,
  html.codex-brand-ui .c-headLogo__img,
  html.codex-brand-ui .logo-header img { max-width: min(220px,62vw) !important; max-height: 64px !important; }
  html.codex-brand-ui .codex-profile-identity { grid-template-columns: 1fr; text-align: center; }
  html.codex-brand-ui .codex-profile-identity__icon { width: 124px; height: 124px; margin-inline: auto; }
}

@media (prefers-reduced-motion: no-preference) {
  html.codex-brand-ui .c-gnav > li > a,
  html.codex-brand-ui .navi-in > ul > li > a { transition: background-color .18s ease, transform .18s ease; }
  html.codex-brand-ui .c-gnav > li > a:hover,
  html.codex-brand-ui .navi-in > ul > li > a:hover { transform: translateY(-1px); }
}
