/* ============================================================
   Chinoba — Research Pages
   Shared stylesheet for /research/* pages.
   Quiet, dark, Apple + research-archive aesthetic.
   ============================================================ */

:root {
  --bg: #0b0b0b;
  --bg-elev: #111111;
  --bg-elev-2: #131313;
  --fg: #f5f5f5;
  --fg-mute: #b0b0b0;
  --fg-dim: #8a8a8a;
  --fg-faint: #6a6a6a;
  --line: #1f1f1f;
  --line-strong: #2a2a2a;
  --accent: #7db7ff;
}

* { box-sizing: border-box; }

html, body {
  background: var(--bg);
  color: var(--fg);
}

body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}

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

p { margin: 0 0 20px; }

/* ---------- Top breadcrumb ---------- */
.topbar {
  position: relative;
  z-index: 2;
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--fg-faint);
}

.topbar a {
  color: var(--fg-faint);
  transition: color 200ms ease;
}

.topbar a:hover {
  color: var(--fg);
  text-decoration: none;
}

.topbar .breadcrumb {
  display: flex;
  gap: 10px;
  align-items: center;
}

.topbar .breadcrumb .sep {
  color: var(--line-strong);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: clamp(80px, 14vh, 140px) 24px clamp(80px, 12vh, 120px);
  max-width: 1100px;
  margin: 0 auto;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.018) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.018) 1px, transparent 1px);
  background-size: 64px 64px;
  background-position: center;
  -webkit-mask-image: radial-gradient(ellipse at center, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0) 75%);
          mask-image: radial-gradient(ellipse at center, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0) 75%);
  pointer-events: none;
}

.hero::after {
  content: "";
  position: absolute;
  inset: -20%;
  background: radial-gradient(ellipse at 50% 30%, rgba(125, 183, 255, 0.05) 0%, rgba(125, 183, 255, 0) 50%);
  pointer-events: none;
}

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

.hero .eyebrow {
  font-size: 11px;
  letter-spacing: 3px;
  color: var(--fg-faint);
  text-transform: uppercase;
  margin-bottom: 32px;
}

.hero h1 {
  font-size: clamp(40px, 6.4vw, 64px);
  line-height: 1.05;
  letter-spacing: 0.5px;
  margin: 0 0 28px;
  font-weight: 700;
}

.hero .hero-sub {
  color: var(--fg-mute);
  font-size: clamp(18px, 2.2vw, 22px);
  line-height: 1.5;
  margin: 0 0 36px;
  letter-spacing: 0.3px;
  font-style: italic;
}

.hero .hero-sub span {
  display: block;
}

.hero .hero-desc {
  color: var(--fg);
  font-size: 16px;
  max-width: 620px;
  margin: 0;
  line-height: 1.85;
}

/* ---------- Section frame ---------- */
.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

section.research-section {
  padding: clamp(80px, 12vh, 120px) 0;
  border-bottom: 1px solid var(--line);
}

section.research-section:last-of-type {
  border-bottom: none;
}

.section-head {
  margin-bottom: 48px;
}

.section-label {
  font-size: 11px;
  letter-spacing: 3px;
  color: var(--fg-faint);
  text-transform: uppercase;
  margin-bottom: 14px;
}

.section-head h2 {
  font-size: clamp(26px, 3.4vw, 34px);
  margin: 0 0 14px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.section-head .section-lede {
  color: var(--fg-mute);
  max-width: 640px;
  margin: 0;
  font-size: 16px;
  line-height: 1.8;
}

/* ---------- Two-column (text + image) ---------- */
.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(40px, 6vw, 72px);
  align-items: start;
}

.two-col .col-text h3 {
  font-size: 20px;
  margin: 0 0 14px;
  font-weight: 600;
  letter-spacing: 0.2px;
  color: var(--fg);
}

.two-col .col-text h3:not(:first-child) {
  margin-top: 36px;
}

.two-col .col-text p,
.two-col .col-text li {
  color: var(--fg-mute);
  font-size: 15.5px;
  line-height: 1.85;
}

.two-col .col-text ul {
  margin: 14px 0 20px;
  padding-left: 18px;
}

.two-col .col-text ul li {
  margin-bottom: 6px;
}

.two-col .col-text .quote {
  display: block;
  margin: 28px 0 12px;
  padding: 14px 18px;
  border-left: 2px solid var(--line-strong);
  color: var(--fg);
  font-family: "Courier New", monospace;
  font-size: 14px;
  letter-spacing: 0.3px;
  background: rgba(255,255,255,0.015);
}

/* ---------- Figures ---------- */
.figure {
  margin: 0;
}

.figure-frame {
  display: block;
  width: 100%;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  cursor: zoom-in;
  transition: border-color 200ms ease, transform 320ms ease;
}

.figure-frame:hover {
  border-color: var(--line-strong);
}

.figure-frame img {
  display: block;
  width: 100%;
  height: auto;
}

.figure-caption {
  margin-top: 14px;
  font-size: 12px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--fg-faint);
}

.figure-wide {
  margin-top: clamp(48px, 6vw, 64px);
}

/* Figure sizing — illustration scale, not full-width posters.
   Size classes constrain max-width and center the figure; the
   existing .figure / .figure-wide / .figure-frame styling is reused. */
.figure-main,
.figure-standard,
.figure-field {
  margin-left: auto;
  margin-right: auto;
}

.figure-main     { max-width: 920px; } /* Fig. 01 — face-of-page diagram */
.figure-standard { max-width: 760px; } /* Figs. 02–06 — embedded in essay */
.figure-field    { max-width: 850px; } /* Fig. 07 — map of the field */

/* Large screens — let figures breathe a touch more */
@media (min-width: 1400px) {
  .figure-standard { max-width: 860px; }
}

/* Tablet — proportional width */
@media (max-width: 900px) {
  .figure-main,
  .figure-standard,
  .figure-field {
    width: 90%;
    max-width: none;
  }
}

/* Mobile — full available width */
@media (max-width: 600px) {
  .figure-main,
  .figure-standard,
  .figure-field {
    width: 100%;
  }
}

/* ---------- Core structure cards ---------- */
.concept-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.concept {
  background: var(--bg);
  padding: 24px 22px 28px;
  min-height: 200px;
  display: flex;
  flex-direction: column;
}

.concept .idx {
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--fg-faint);
  text-transform: uppercase;
  margin-bottom: 14px;
}

.concept h3 {
  font-size: 17px;
  margin: 0 0 10px;
  font-weight: 600;
  color: var(--fg);
  letter-spacing: 0.2px;
}

.concept p {
  color: var(--fg-mute);
  font-size: 13.5px;
  line-height: 1.7;
  margin: 0;
}

/* ---------- OSS Ecosystem ---------- */
.oss-block {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: clamp(40px, 5vw, 64px);
  align-items: center;
}

.oss-meta h3 {
  font-size: 20px;
  margin: 0 0 14px;
  font-weight: 600;
}

.oss-meta p {
  color: var(--fg-mute);
  font-size: 15px;
  line-height: 1.8;
  margin: 0 0 22px;
}

.oss-link {
  display: inline-block;
  padding: 10px 18px;
  border: 1px solid var(--line-strong);
  color: var(--fg);
  font-size: 12px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 26px;
  transition: border-color 200ms ease, color 200ms ease;
}

.oss-link:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

.oss-tags {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.oss-tags li {
  font-size: 12px;
  letter-spacing: 0.5px;
  color: var(--fg-dim);
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-elev);
  font-family: "Courier New", monospace;
}

/* ---------- Decision Flow ---------- */
.flow {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0;
  border: 1px solid var(--line);
  background: var(--line);
}

.flow-step {
  background: var(--bg);
  padding: 28px 18px 26px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  position: relative;
  transition: background 220ms ease;
}

.flow-step + .flow-step {
  margin-left: 1px;
}

.flow-step:hover {
  background: #0f0f0f;
}

.flow-step .step-num {
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--fg-faint);
  text-transform: uppercase;
}

.flow-step .step-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--fg);
  letter-spacing: 0.2px;
}

.flow-step .step-desc {
  color: var(--fg-mute);
  font-size: 12.5px;
  line-height: 1.65;
  margin: 0;
  opacity: 0;
  transition: opacity 240ms ease;
}

.flow-step:hover .step-desc,
.flow-step:focus-within .step-desc {
  opacity: 1;
}

@media (hover: none) {
  .flow-step .step-desc { opacity: 1; }
}

/* ---------- Essays ---------- */
.essays {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.essay {
  background: var(--bg);
  padding: 26px 24px 28px;
  display: flex;
  flex-direction: column;
  min-height: 160px;
  color: inherit;
  transition: background 200ms ease;
}

.essay:hover {
  background: #0f0f0f;
  text-decoration: none;
}

.essay .kicker {
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--fg-faint);
  text-transform: uppercase;
  margin-bottom: 12px;
}

.essay h3 {
  font-size: 17px;
  margin: 0 0 8px;
  font-weight: 600;
  color: var(--fg);
  letter-spacing: 0.2px;
  line-height: 1.4;
}

.essay p {
  color: var(--fg-mute);
  font-size: 14px;
  line-height: 1.7;
  margin: 0;
}

.essay .essay-meta {
  margin-top: auto;
  padding-top: 18px;
  font-size: 12px;
  color: var(--fg-faint);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.essay .essay-meta.is-available {
  color: var(--accent);
}

.essay .essay-meta.is-available::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 8px;
  vertical-align: middle;
  transform: translateY(-1px);
}

/* ---------- Books ---------- */
.book {
  padding: 22px 0 24px;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr 132px;
  gap: 32px;
  align-items: start;
}

.book:last-child { border-bottom: none; }

.book-body { min-width: 0; }

.book-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 6px;
  letter-spacing: 0.2px;
}

.book-subtitle {
  color: var(--fg-mute);
  font-size: 14px;
  margin-bottom: 12px;
}

.book p {
  color: var(--fg-mute);
  font-size: 14px;
  margin-bottom: 12px;
  max-width: 640px;
}

.book-link {
  font-size: 13px;
  color: var(--accent);
  letter-spacing: 0.3px;
}

.book-cover {
  display: block;
  width: 132px;
  justify-self: end;
}

.book-cover img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 3px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5),
              0 6px 18px rgba(0, 0, 0, 0.35);
  background: var(--bg-elev);
  transition: transform 320ms ease, box-shadow 320ms ease;
}

.book-cover:hover img {
  transform: translateY(-2px) scale(1.01);
}

/* ---------- Closing ---------- */
.closing {
  text-align: center;
  padding: clamp(100px, 16vh, 160px) 24px;
  max-width: 760px;
  margin: 0 auto;
}

.closing blockquote {
  margin: 0 0 36px;
  font-size: clamp(20px, 2.6vw, 24px);
  line-height: 1.65;
  color: var(--fg);
  font-weight: 400;
  letter-spacing: 0.3px;
}

.closing blockquote span {
  display: block;
}

.closing .closing-mark {
  font-size: 12px;
  letter-spacing: 3px;
  color: var(--fg-faint);
  text-transform: uppercase;
}

/* ---------- Related Research ---------- */
.related-research {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin-top: 20px;
}

.related-research a {
  background: var(--bg);
  padding: 24px 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--fg);
  transition: background 200ms ease;
}

.related-research a:hover {
  background: #0f0f0f;
  text-decoration: none;
}

.related-research .related-label {
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--fg-faint);
  text-transform: uppercase;
}

.related-research .related-name {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.related-research .related-status {
  font-size: 12px;
  color: var(--fg-faint);
  margin-top: 4px;
  letter-spacing: 0.5px;
}

/* ---------- Footer ---------- */
footer.research-footer {
  max-width: 1100px;
  margin: 0 auto;
  padding: 56px 24px 64px;
  border-top: 1px solid var(--line);
  color: var(--fg-faint);
  font-size: 13px;
  letter-spacing: 0.5px;
}

footer.research-footer p { margin: 0 0 6px; }
footer.research-footer .footer-tag { color: var(--fg-dim); }

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 48px;
  flex-wrap: wrap;
}

.footer-text { flex: 1 1 auto; min-width: 0; }

.footer-contact {
  flex: 0 0 auto;
  text-align: right;
  line-height: 1.7;
}

.footer-contact .contact-label {
  display: block;
  font-size: 11px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--fg-faint);
  margin-bottom: 8px;
}

.footer-contact a {
  color: var(--accent);
  font-size: 13px;
}

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 32px;
  cursor: zoom-out;
}

.lightbox.is-open {
  display: flex;
}

.lightbox img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  display: block;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
  border-radius: 4px;
}

.lightbox .lightbox-close {
  position: absolute;
  top: 22px;
  right: 28px;
  background: transparent;
  border: 1px solid var(--line-strong);
  color: var(--fg-mute);
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 8px 14px;
  cursor: pointer;
  font-family: inherit;
}

.lightbox .lightbox-close:hover {
  color: var(--fg);
  border-color: var(--fg-faint);
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .two-col,
  .oss-block {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .concept-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .flow {
    grid-template-columns: 1fr;
  }
  .flow-step + .flow-step {
    margin-left: 0;
    margin-top: 1px;
  }
  .essays,
  .related-research {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .topbar {
    padding: 22px 18px 0;
    font-size: 11px;
    letter-spacing: 1.5px;
  }
  .hero {
    padding: 64px 18px 72px;
  }
  .wrap { padding: 0 18px; }
  section.research-section { padding: 72px 0; }
  .section-head { margin-bottom: 36px; }
  .concept-grid { grid-template-columns: 1fr; }
  .book {
    grid-template-columns: 1fr;
    gap: 22px;
  }
  .book-cover {
    width: 116px;
    justify-self: center;
  }
  footer.research-footer {
    padding: 40px 18px 56px;
  }
  .footer-inner {
    flex-direction: column;
    gap: 24px;
  }
  .footer-contact { text-align: left; }
  .closing { padding: 80px 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
  }
}
