/* ============================================================
   Claridian — "The model" page
   Reuses tokens, nav, .feature glass cards, .grid, .section-head,
   .reveal, footer from Claridian_landing.css
============================================================ */
body.model-page{ background: var(--cream, #FBF8F1); }
.model-main{ padding-top: 92px; }
.model-section{ position: relative; padding: clamp(54px, 8vh, 96px) 0; }
.model-section > .wrap-wide{ position: relative; z-index: 2; }

.sec-title{
  font-family: var(--font-display); font-weight: 800; letter-spacing: -.025em; color: var(--ink);
  font-size: clamp(30px, 5vw, 54px); line-height: 1.04; margin: 0 0 22px;
}
.sec-title .serif{ font-family: 'Instrument Serif', Georgia, serif; font-style: italic; font-weight: 400; color: var(--brand); letter-spacing: 0; }
.sec-lead{ font-size: clamp(15px, 1.5vw, 18px); line-height: 1.7; color: var(--ink-3); max-width: 70ch; }
.sec-lead + .sec-lead{ margin-top: 16px; }

.mblob{ position: absolute; border-radius: 50%; filter: blur(70px); opacity: .5; z-index: 0; pointer-events: none; will-change: transform; }

/* back/exit-style link (forward arrow) */
.mlink{
  appearance: none; border: 0; background: none; cursor: pointer;
  font: 700 14px var(--font-display); color: var(--brand);
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 2px; position: relative;
}
.mlink .mlbl{ position: relative; }
.mlink::after{ content: ""; position: absolute; left: 2px; right: 2px; bottom: 2px; height: 1.6px; background: var(--brand); transform: scaleX(0); transform-origin: left; transition: transform .3s var(--ease); }
.mlink:hover::after{ transform: scaleX(1); }
.mlink .mlarr{ display: inline-block; transition: transform .25s var(--ease); }
.mlink:hover .mlarr{ transform: translateX(3px); }
.mlink.back:hover .mlarr{ transform: translateX(-3px); }

/* ── 1 · Intro ── */
.intro-section{ overflow: hidden; min-height: calc(100svh - 92px); display: flex; align-items: center; padding-top: clamp(12px, 2vh, 26px); padding-bottom: clamp(12px, 2vh, 26px); }
.intro-copy{ width: min(70%, 880px); max-width: none; position: relative; z-index: 2; }
.intro-copy .sec-title{ font-size: clamp(26px, 3.6vw, 42px); margin: 0 0 9px; }
.intro-copy .sec-lead{ max-width: none; font-size: 15px; line-height: 1.52; }
.intro-copy .sec-lead + .sec-lead{ margin-top: 8px; }
.intro-watermark{ position: absolute; top: 0; bottom: 0; right: -4%; width: min(55vw, 4000px); display: flex; align-items: center; z-index: 0; pointer-events: none; }
.intro-watermark img{ width: 100%; height: auto; filter: grayscale(1) brightness(.25) contrast(.125); opacity: .9; will-change: transform; }

/* wider, more spread-out centred intro paragraphs (engines + research section heads) */
.section-head{ max-width: 82ch; }
.section-head p{ font-size: 18px; line-height: 1.7; max-width: 74ch; margin-left: auto; margin-right: auto; }

/* numbered feature strip (no cards) */
.numstrip{ display: grid; grid-template-columns: repeat(4, 1fr); margin-top: clamp(14px, 2vh, 22px); border-top: 1px solid var(--line); }
.numitem{ position: relative; padding: 13px 20px 4px; border-left: 1px solid var(--line); overflow: hidden; }
.numitem:first-child{ border-left: 0; padding-left: 0; }
.num-ghost{ position: absolute; top: 4px; right: 8px; z-index: 0; font-family: var(--font-display); font-weight: 800; font-size: clamp(36px, 4vw, 56px); color: var(--brand); opacity: .14; line-height: 1; letter-spacing: -.04em; pointer-events: none; }
.ni-ico{ position: relative; z-index: 1; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; color: var(--brand); background: var(--brand-wash); border: 1px solid var(--brand-tint); margin-bottom: 9px; }
.ni-ico svg{ width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.numitem b{ position: relative; z-index: 1; display: block; font-family: var(--font-display); font-weight: 800; font-size: 16px; color: var(--ink); }
.numitem .ni-sub{ position: relative; z-index: 1; display: block; margin-top: 5px; font-size: 12.5px; color: var(--ink-3); line-height: 1.45; max-width: 26ch; }
.ni-ico svg{ width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.numitem b{ position: relative; z-index: 1; display: block; font-family: var(--font-display); font-weight: 800; font-size: 17px; color: var(--ink); }
.numitem .ni-sub{ position: relative; z-index: 1; display: block; margin-top: 7px; font-size: 13px; color: var(--ink-3); line-height: 1.5; max-width: 26ch; }

/* ── 2 · Engines ── */
.engines-section{ background: linear-gradient(180deg, transparent, #F6F2FF 50%, transparent); }
.eng-card{ min-height: 340px; }
.eng-sub{ font-family: var(--font-mono); font-size: 12px; color: var(--ink-4); margin: 6px 0 0; position: relative; z-index: 2; }
.eng-live{ margin-top: auto; padding-top: 22px; position: relative; z-index: 2; }
/* centered "Explore" button at the bottom of each engine card */
.eng-cta{ display: flex; justify-content: center; margin-top: 16px; position: relative; z-index: 2; }
.eng-explore{ min-width: 150px; justify-content: center; }

.eng-bars{ display: flex; align-items: flex-end; gap: 8px; height: 56px; }
.eng-bars i{ flex: 1; border-radius: 5px 5px 0 0; background: linear-gradient(180deg, var(--brand-3), var(--brand)); height: 40%; animation: engbar 2.4s var(--ease) infinite; }
.eng-bars i:nth-child(2){ animation-delay: .3s; } .eng-bars i:nth-child(3){ animation-delay: .6s; }
.eng-bars i:nth-child(4){ animation-delay: .9s; } .eng-bars i:nth-child(5){ animation-delay: 1.2s; }
@keyframes engbar{ 0%,100%{ height: 28%; } 50%{ height: 92%; } }

.eng-rules{ display: flex; flex-direction: column; gap: 8px; }
.eng-rules div{ position: relative; overflow: hidden; font-family: var(--font-mono); font-size: 11px; color: var(--ink-2); background: var(--surface-warm); border: 1px solid var(--line); border-radius: 9px; padding: 8px 11px; }
.eng-rules b{ color: var(--brand); }
.eng-rules div::after{ content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(91,71,217,.16), transparent); transform: translateX(-100%); animation: engsweep 3s linear infinite; }
.eng-rules div:nth-child(2)::after{ animation-delay: 1s; } .eng-rules div:nth-child(3)::after{ animation-delay: 2s; }
@keyframes engsweep{ to{ transform: translateX(100%); } }

/* ANFIS card: digital brain network with binary numbers */
.anfis-brain{ width: 100%; height: 132px; display: flex; align-items: center; justify-content: center; }
.anfis-brain svg{ width: 100%; height: 100%; overflow: visible; }
.anfis-brain .ab-lines line{ opacity: .28; stroke-dasharray: 4 5; animation: abFlow 2.6s linear infinite; }
.anfis-brain .ab-lines line:nth-child(2n){ animation-duration: 3.4s; }
.anfis-brain .ab-lines line:nth-child(3n){ animation-duration: 2.1s; opacity: .42; }
@keyframes abFlow{ to{ stroke-dashoffset: -18; } }
.anfis-brain .ab-nodes circle{ fill: var(--brand); filter: drop-shadow(0 0 4px rgba(91,71,217,.7)); transform-box: fill-box; transform-origin: center; animation: abPulse 2.4s ease-in-out infinite; }
.anfis-brain .ab-nodes circle:nth-child(2n){ animation-delay: .4s; }
.anfis-brain .ab-nodes circle:nth-child(3n){ animation-delay: .8s; }
.anfis-brain .ab-nodes circle:nth-child(4n){ animation-delay: 1.2s; }
.anfis-brain .ab-nodes .ab-hub{ fill: var(--brand-2); filter: drop-shadow(0 0 7px rgba(91,71,217,.9)); animation-duration: 1.8s; }
@keyframes abPulse{ 0%,100%{ transform: scale(1); opacity: .85; } 50%{ transform: scale(1.32); opacity: 1; } }
.anfis-brain .ab-bits text{ fill: var(--brand-3); font-weight: 500; opacity: .5; animation: abTwinkle 3s ease-in-out infinite; }
.anfis-brain .ab-bits text:nth-child(2n){ fill: var(--brand); animation-duration: 2.2s; animation-delay: .3s; }
.anfis-brain .ab-bits text:nth-child(3n){ animation-duration: 3.6s; animation-delay: .7s; }
.anfis-brain .ab-bits text:nth-child(4n){ animation-delay: 1.1s; }
.anfis-brain .ab-bits text:nth-child(5n){ animation-delay: 1.5s; }
@keyframes abTwinkle{ 0%,100%{ opacity: .18; } 50%{ opacity: .8; } }

/* ── 3 · Team ── */
.team-grid{ display: grid; grid-template-columns: repeat(3, minmax(0, 300px)); justify-content: center; gap: 24px; margin-top: 44px; }
.tcard{
  position: relative; border-radius: 24px; overflow: hidden; min-height: 380px;
  display: flex; flex-direction: column; justify-content: flex-end; padding: 16px;
  border: 1px solid var(--line); box-shadow: 0 34px 64px -38px rgba(40,30,90,.55); min-height: 440px;
}
.tcard .t-bg{ position: absolute; inset: 0; z-index: 0; }
.tcard.t-1 .t-bg{ background-image:url(Daniel_Emelike.PNG); background-repeat: no-repeat; background-position: center 18%; background-size: cover; }
.tcard.t-2 .t-bg{ background: radial-gradient(120% 90% at 42% 18%, #2b3a52, #1d2738 70%, #131b27); }
.tcard.t-3 .t-bg{ background: radial-gradient(120% 90% at 60% 18%, #FFE7A8, #E8A52A 68%, #b97f12); }
.tcard .t-mono{ position: absolute; top: 18px; left: 20px; z-index: 1; font-family: var(--font-display); font-weight: 800; font-size: 50px; color: rgba(255,255,255,.85); letter-spacing: -.03em; }
.tcard .t-glass{
  position: relative; z-index: 1; border-radius: 18px; padding: 15px 16px 15px;
  background: rgba(16,14,26,.26); border: 1px solid rgba(255,255,255,.26);
  backdrop-filter: blur(22px) saturate(160%); -webkit-backdrop-filter: blur(22px) saturate(160%); color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.22), 0 18px 36px -22px rgba(0,0,0,.5);
}
.tcard .t-glass h3{ font-family: var(--font-display); font-weight: 800; font-size: 19px; margin: 0; color: #fff; }
.tcard .t-role{ font-size: 12.5px; font-weight: 600; opacity: .95; margin: 5px 0 8px; }
.tcard .t-glass p{ font-size: 12.5px; line-height: 1.5; margin: 0; opacity: .9; }
.tcard .t-socials{ display: flex; gap: 12px; margin-top: 12px; }
.tcard .t-socials a{ color: #fff; opacity: .85; transition: opacity .2s var(--ease); display: inline-flex; }
.tcard .t-socials a:hover{ opacity: 1; }
.tcard .t-arrow{ font-size: 15px; opacity: .8; }

/* ── Modals ── */
.mw-modal[hidden]{ display: none !important; }
.mw-modal{
  position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: 88px 20px 32px;
  background: rgba(250,248,243,.62); backdrop-filter: blur(8px) saturate(150%); -webkit-backdrop-filter: blur(8px) saturate(150%);
  animation: mwfade .28s var(--ease); overflow: hidden;
}
@keyframes mwfade{ from{ opacity: 0; } to{ opacity: 1; } }
.mw-card{
  position: relative; width: min(980px, 100%);
  max-height: calc(100vh - 124px); overflow-y: auto; overscroll-behavior: contain;
  scrollbar-width: none; -ms-overflow-style: none;
  background: linear-gradient(180deg, #ffffff, #FAF8F3); border: 1px solid var(--line); border-radius: 26px;
  padding: 30px clamp(22px, 3.4vw, 42px) 34px;
  box-shadow: 0 50px 100px -36px rgba(40,30,90,.5), inset 0 1px 0 rgba(255,255,255,.9);
  animation: mwcard .42s var(--ease) both;
  transition: box-shadow .4s var(--ease), transform .4s var(--ease);
}
.mw-card::-webkit-scrollbar{ width: 0; height: 0; display: none; }
.mw-card:hover{
  box-shadow: 0 40px 90px -30px rgba(91,71,217,.55), 0 0 0 1px rgba(91,71,217,.28), inset 0 1px 0 rgba(255,255,255,.9);
}
.mw-card--wide{ width: min(1240px, 96vw); }
@keyframes mwcard{ from{ opacity: 0; transform: translateY(16px) scale(.97); } to{ opacity: 1; transform: none; } }
.mw-x{ position: absolute; top: 16px; right: 18px; border: 0; background: none; font-size: 26px; line-height: 1; color: var(--ink-4); cursor: pointer; transition: color .2s var(--ease); }
.mw-x:hover{ color: var(--ink); }
.mw-tag{ font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--brand); }
.mw-card h3{ font-family: var(--font-display); font-weight: 800; font-size: clamp(22px, 3vw, 30px); margin: 8px 0 8px; color: var(--ink); letter-spacing: -.02em; }
.mw-lead{ color: var(--ink-3); font-size: 15px; line-height: 1.65; max-width: 74ch; margin: 0 0 8px; }
#refsModal .mw-lead{ max-width: none; white-space: nowrap; }
@media (max-width: 720px){ #refsModal .mw-lead{ white-space: normal; } }
.mw-card h4{ font-family: var(--font-display); font-weight: 800; font-size: 15px; margin: 26px 0 12px; color: var(--ink); }
.mw-card p{ color: var(--ink-3); font-size: 14px; line-height: 1.66; max-width: 76ch; }
.mw-card p + p{ margin-top: 10px; }
.mw-exit{ margin-top: 26px; }

/* static architecture diagram */
.archd{ display: flex; align-items: stretch; gap: 8px; flex-wrap: nowrap; justify-content: center; margin-top: 8px; }
.archd-group{ border: 1px dashed var(--ink-4); border-radius: 14px; padding: 12px 12px 14px; display: flex; flex-direction: column; gap: 9px; }
.archd-group .gl{ font-family: var(--font-mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-4); text-align: center; margin-bottom: 2px; }
.archd-box{ background: #fff; border: 1px solid var(--line); border-radius: 11px; padding: 10px 11px; text-align: center; font-family: var(--font-display); font-weight: 700; font-size: 12px; color: var(--ink); box-shadow: 0 8px 18px -12px rgba(40,30,90,.35); min-width: 96px; }
.archd-box small{ display: block; font-family: var(--font-body); font-weight: 500; font-size: 11px; color: var(--ink-4); margin-top: 3px; }
.archd-box.core{ background: linear-gradient(160deg, var(--brand-2), var(--brand)); border-color: transparent; color: #fff; }
.archd-box.core small{ color: rgba(255,255,255,.85); }
.archd-box.out{ background: var(--ink); border-color: var(--ink); color: #fff; }
.archd-box.out small{ color: rgba(255,255,255,.8); }
.archd-arrow{ align-self: center; color: var(--brand); font-size: 16px; line-height: 1; flex: 0 0 auto; }

/* nudge for wide diagrams (architecture pipeline, ANFIS layers) on small screens */
.rotate-notice{
  display: none;
  align-items: center; gap: 10px;
  margin: 6px 0 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(91,71,217,.08);
  border: 1px solid rgba(91,71,217,.22);
  color: var(--ink-2);
  font-size: 12.5px;
  line-height: 1.5;
}
.rotate-notice i{ color: var(--brand); font-size: 18px; flex-shrink: 0; }
@media (max-width: 700px) and (orientation: portrait){
  .rotate-notice{ display: flex; }
}
@media (max-width: 700px){
  .archd{
    flex-wrap: nowrap; justify-content: flex-start;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    padding: 4px 4px 12px; margin: 8px -4px 0;
  }
  .archd-box{ min-width: 88px; font-size: 11px; flex-shrink: 0; }
  .archd-group{ flex-shrink: 0; }
  .mw-modal .anfis{ padding: 4px 4px 12px; }
}

/* membership-function chart (Sugeno) */
.mfx{ width: 100%; height: auto; background: transparent; border: 0; padding: 0; }
.mfx-legend{ display: flex; gap: 22px; flex-wrap: wrap; justify-content: center; margin: 14px 0 0; font-size: 13px; color: var(--ink-2); }
.mfx-legend span{ display: inline-flex; align-items: center; gap: 7px; }
.mfx-legend i{ width: 12px; height: 12px; border-radius: 3px; display: inline-block; }

/* rule-base columns (Mamdani) */
.rb-grid{ display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 4px; }
.rb-col{ background: var(--surface-warm); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.rb-col h5{ margin: 0 0 14px; font-family: var(--font-display); font-weight: 800; font-size: 14px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.rb-dot{ width: 9px; height: 9px; border-radius: 50%; }
.rb-low .rb-dot{ background: var(--risk-low); } .rb-mod .rb-dot{ background: var(--risk-mod); } .rb-high .rb-dot{ background: var(--risk-high); }
.rb-col ul{ list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.rb-col li{ font-family: var(--font-mono); font-size: 11.5px; line-height: 1.55; color: var(--ink-2); text-align: center; }
.rb-col li b{ color: var(--brand); font-weight: 500; }

/* ANFIS layer diagram */
.anfis{ display: flex; align-items: stretch; gap: 8px; overflow-x: auto; padding-bottom: 6px; }
.anfis-layer{ flex: 1 0 0; min-width: 110px; text-align: center; }
.anfis-layer .al-h{ font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .04em; color: var(--ink-4); margin-bottom: 10px; }
.anfis-layer .al-nodes{ display: flex; flex-direction: column; gap: 8px; align-items: center; }
.anfis-node{ width: 100%; max-width: 96px; padding: 9px 8px; border-radius: 10px; font-family: var(--font-display); font-weight: 700; font-size: 11.5px; color: #fff; background: linear-gradient(160deg, var(--brand-2), var(--brand)); box-shadow: 0 8px 16px -10px rgba(91,71,217,.5); }
.anfis-layer:nth-child(1) .anfis-node{ background: var(--ink); }
.anfis-layer:nth-child(5) .anfis-node{ background: var(--risk-mod); color: #2a2310; }

@media (max-width: 980px){
  .intro-section{ min-height: auto; }
  .intro-copy{ width: 100%; }
  .numstrip{ grid-template-columns: repeat(2, 1fr); }
  .numitem:nth-child(3){ border-left: 0; padding-left: 0; }
  .numitem:nth-child(n+3){ border-top: 1px solid var(--line); padding-top: 18px; }
  .intro-watermark{ display: none; }
}
@media (max-width: 900px){
  .team-grid{ grid-template-columns: 1fr; }
  .rb-grid{ grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce){
  .eng-bars i, .eng-rules div::after,
  .anfis-brain .ab-lines line, .anfis-brain .ab-nodes circle, .anfis-brain .ab-bits text{ animation: none !important; }
  .anfis-brain .ab-bits text{ opacity: .5; }
  .intro-watermark img, .mblob{ transform: none !important; }
}

/* active nav tab */
.nav-links a[aria-current="page"]{ color: var(--brand); font-weight: 700; }
/* ── what-it-measures callout (intro) ── */
.measure-box{ margin-top: clamp(12px, 1.6vh, 18px); padding: 14px 18px; border-radius: 16px; background: linear-gradient(180deg, rgba(91,71,217,.06), rgba(91,71,217,.02)); border: 1px solid var(--brand-tint); max-width: none; }
.measure-box h3{ font-family: var(--font-display); font-weight: 800; font-size: clamp(16px, 1.7vw, 19px); line-height: 1.24; color: var(--ink); letter-spacing: -.02em; margin: 0 0 7px; }
.measure-eyebrow{ display: block; font-family: var(--font-mono); font-size: 11px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--brand); margin-bottom: 5px; }
.measure-box p{ font-size: 13px; line-height: 1.46; color: var(--ink-2); margin: 0 0 6px; }
.measure-box p:last-child{ margin-bottom: 0; }
.measure-box b{ color: var(--ink); font-weight: 700; }

/* ── research section ── */
.research-grid{ display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: clamp(30px, 4vh, 44px); }
@media (max-width: 860px){ .research-grid{ grid-template-columns: 1fr; } }
.rsrch-card{ padding: 26px 28px; border-radius: 20px; background: #fff; border: 1px solid var(--line); box-shadow: 0 1px 2px rgba(20,18,10,.03); }
.rsrch-card h3{ font-family: var(--font-display); font-weight: 800; font-size: 19px; color: var(--ink); letter-spacing: -.02em; margin: 0 0 12px; }
.rsrch-card p{ font-size: 14.5px; line-height: 1.68; color: var(--ink-2); margin: 0; }
.rsrch-card b{ color: var(--ink); font-weight: 700; }
.sig-map{ display: flex; flex-direction: column; gap: 9px; margin-top: 16px; }
.sig-item{ display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; border-radius: 12px; background: rgba(91,71,217,.04); border: 1px solid var(--brand-tint); }
.sig-item span{ font-size: 13.5px; font-weight: 700; color: var(--ink); }
.sig-item em{ font-style: normal; font-size: 12.5px; color: var(--ink-3); }
.rsrch-reflink{ margin-top: 16px; }
.refs-modal .ref-list, #refsModal .ref-list{ margin: 14px 0 0; }
.ref-list{ margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 11px; }
.ref-list li{ font-size: 13px; line-height: 1.6; color: var(--ink-2); }
.ref-list li i{ font-style: italic; }
.ref-list a{ color: var(--brand); text-decoration: none; word-break: break-word; }
.ref-list a:hover{ text-decoration: underline; }