/* =============================================
   Framework page — geological layer styles
   Loaded only on /framework/ via baseof.html
============================================= */

:root {
  --strat-deep:  #2C2417;
  --strat-mid:   #5C4A2A;
  --strat-light: #8C6E45;
  --strat-bg:    #EDE0CC;

  --topo-deep:   #3A4D2A;
  --topo-mid:    #5A7A46;
  --topo-light:  #8CA870;
  --topo-bg:     #E4EDDB;

  --infra-deep:  #2A3D52;
  --infra-mid:   #3F5E78;
  --infra-light: #6B8FA8;
  --infra-bg:    #D8E4EE;

  --arch-deep:   #4A2A3A;
  --arch-mid:    #7A4A62;
  --arch-light:  #A87890;
  --arch-bg:     #EEDAD7;
}

/* ── HERO ── */
.framework-hero {
  background: var(--bg-main);
  border-bottom: 3px solid rgba(0,0,0,0.06);
  overflow: hidden;
  position: relative;
}

.framework-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    180deg,
    transparent 0px,
    transparent 38px,
    rgba(0,0,0,0.028) 38px,
    rgba(0,0,0,0.028) 40px
  );
  pointer-events: none;
}

/* Two-column grid matching the shared hero layout */
.framework-hero .hero-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 5rem 1.25rem 4rem;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 3.5rem;
  align-items: center;
  position: relative;
}

.framework-hero h1 {
  font-size: 3.2rem;
  line-height: 1.1;
  margin-bottom: 1.5rem;
}

.framework-hero h1 em {
  font-style: italic;
  color: var(--strat-mid);
}

.framework-hero .hero-lead {
  font-size: 1.15rem;
  max-width: 520px;
  color: #5a5a5a;
  margin-bottom: 2rem;
}

/* Visual column */
.framework-hero .hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
  align-self: center;
}

/* Botanical: constrain height for portrait image */
.framework-hero .hero-botanical {
  max-height: 420px;
  width: auto;
  max-width: 100%;
}

/* Strip: 4 items, slightly compressed to stay on one row */
.framework-hero .hero-strip {
  margin-top: 2rem;
  flex-wrap: nowrap;
}

.framework-hero .hero-strip-item {
  gap: 0.5rem;
}

.framework-hero .hero-strip-label strong {
  font-size: 0.68rem;
}

.framework-hero .hero-strip-label span {
  font-size: 0.63rem;
}

.framework-hero .hero-strip-divider {
  margin: 0 0.75rem;
}

/* Icon backgrounds for framework strip */
.fstrip-strat { background: var(--strat-bg); }
.fstrip-topo  { background: var(--topo-bg); }
.fstrip-infra { background: var(--infra-bg); }
.fstrip-arch  { background: var(--arch-bg); }

/* ── INTRO ── */
.intro-section {
  background: var(--bg-main);
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

.intro-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 4rem 1.25rem;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 5rem;
  align-items: start;
}

.intro-text h2 {
  font-size: 2rem;
  max-width: 480px;
  margin-bottom: 1.25rem;
}

.intro-text p {
  max-width: 500px;
  color: #5a5a5a;
  margin-bottom: 1rem;
}

/* Cross-section diagram */
.cross-section { position: relative; }

.layer-diagram-wrap {
  position: relative;
  display: inline-block;
  width: 100%;
}

.layer-diagram-img {
  width: 100%;
  max-width: 460px;
  display: block;
  border-radius: 8px;
}

.diagram-label {
  position: absolute;
  right: -10px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  transform: translateX(100%);
  padding-left: 0.75rem;
}

.diagram-label::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 10px;
  height: 1px;
  background: currentColor;
  opacity: 0.4;
}

.dlabel-name {
  font-family: "Alegreya Sans SC", "Alegreya Sans", sans-serif;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  font-weight: 500;
  line-height: 1.2;
}

.dlabel-sub {
  font-family: "Alegreya Sans", sans-serif;
  font-size: 0.68rem;
  opacity: 0.65;
  font-style: italic;
}

.diagram-label-arch  { top: 12%; color: var(--arch-mid); }
.diagram-label-infra { top: 38%; color: var(--infra-mid); }
.diagram-label-topo  { top: 60%; color: var(--topo-mid); }
.diagram-label-strat { top: 80%; color: var(--strat-mid); }

.cross-section-note {
  margin-top: 1rem;
  font-size: 0.8rem;
  color: #888;
  font-style: italic;
  text-align: center;
}

/* ── LAYER SECTIONS ── */
.layer-section {
  border-bottom: 1px solid rgba(0,0,0,0.06);
  position: relative;
}

.layer-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 5rem 1.25rem;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 5rem;
  align-items: start;
}

.layer-section:nth-child(even) .layer-inner {
  grid-template-columns: 1fr 280px;
}

.layer-section:nth-child(even) .layer-sidebar { order: 2; }
.layer-section:nth-child(even) .layer-content { order: 1; }

.layer-sidebar {
  position: sticky;
  top: 80px;
}

.layer-marker {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  font-family: "Alegreya", serif;
  font-size: 1.4rem;
  color: white;
  font-style: italic;
}

.layer-num {
  font-family: "Alegreya Sans SC", "Alegreya Sans", sans-serif;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  margin-bottom: 0.35rem;
}

.layer-title {
  font-family: "Alegreya", serif;
  font-size: 2rem;
  line-height: 1.1;
  margin-bottom: 0.5rem;
}

.layer-subtitle {
  font-size: 0.9rem;
  font-style: italic;
  color: #777;
  margin-bottom: 1.5rem;
}

.layer-stripe {
  height: 3px;
  border-radius: 2px;
  width: 48px;
  margin-bottom: 1.5rem;
}

.layer-content h3 {
  font-size: 1.3rem;
  margin-bottom: 0.75rem;
  margin-top: 2rem;
}

.layer-content h3:first-child { margin-top: 0; }

.layer-content p {
  max-width: 580px;
  color: #5a5a5a;
  margin-bottom: 1rem;
}

/* Concept tags */
.concept-cluster {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.25rem 0;
}

.concept-tag {
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
  font-size: 0.82rem;
  font-family: "Alegreya Sans", sans-serif;
  border: 1px solid;
}

/* Pull quote */
.layer-quote {
  border-left: 3px solid;
  padding: 0.75rem 1.25rem;
  margin: 2rem 0;
  font-family: "Alegreya", serif;
  font-size: 1.1rem;
  font-style: italic;
  line-height: 1.5;
}

/* ── LAYER COLOR THEMES ── */
.section-strat { background: var(--strat-bg); }
.strat .layer-num    { color: var(--strat-mid); }
.strat .layer-title  { color: var(--strat-deep); }
.strat .layer-stripe { background: var(--strat-mid); }
.strat .layer-marker { background: var(--strat-mid); }
.strat .concept-tag  { background: rgba(92,74,42,0.08); border-color: rgba(92,74,42,0.25); color: var(--strat-deep); }
.strat .layer-quote  { border-color: var(--strat-mid); color: var(--strat-deep); background: rgba(92,74,42,0.04); }

.section-topo { background: var(--topo-bg); }
.topo .layer-num    { color: var(--topo-mid); }
.topo .layer-title  { color: var(--topo-deep); }
.topo .layer-stripe { background: var(--topo-mid); }
.topo .layer-marker { background: var(--topo-mid); }
.topo .concept-tag  { background: rgba(58,77,42,0.08); border-color: rgba(58,77,42,0.25); color: var(--topo-deep); }
.topo .layer-quote  { border-color: var(--topo-mid); color: var(--topo-deep); background: rgba(58,77,42,0.04); }

.section-infra { background: var(--infra-bg); }
.infra .layer-num    { color: var(--infra-mid); }
.infra .layer-title  { color: var(--infra-deep); }
.infra .layer-stripe { background: var(--infra-mid); }
.infra .layer-marker { background: var(--infra-mid); }
.infra .concept-tag  { background: rgba(42,61,82,0.08); border-color: rgba(42,61,82,0.25); color: var(--infra-deep); }
.infra .layer-quote  { border-color: var(--infra-mid); color: var(--infra-deep); background: rgba(42,61,82,0.04); }

.section-arch { background: var(--arch-bg); }
.arch .layer-num    { color: var(--arch-mid); }
.arch .layer-title  { color: var(--arch-deep); }
.arch .layer-stripe { background: var(--arch-mid); }
.arch .layer-marker { background: var(--arch-mid); }
.arch .concept-tag  { background: rgba(74,42,58,0.08); border-color: rgba(74,42,58,0.25); color: var(--arch-deep); }
.arch .layer-quote  { border-color: var(--arch-mid); color: var(--arch-deep); background: rgba(74,42,58,0.04); }

/* ── SIDEBAR BOTANICAL ICONS ── */
.layer-sidebar-icon {
  margin-top: 1.75rem;
  width: 100%;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  box-sizing: border-box;
}

.layer-sidebar-icon img {
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
  opacity: 0.9;
}

/* ── RELATIONS SECTION ── */
.relations-section {
  background: var(--bg-main);
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

.relations-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 5rem 1.25rem;
}

.relations-header {
  display: flex;
  align-items: flex-start;
  gap: 4rem;
  margin-bottom: 3rem;
}

.relations-header-text { flex: 1; }

.relations-header-text h2 {
  font-size: 2rem;
  max-width: 560px;
  margin-bottom: 1rem;
}

.relations-header-text p {
  max-width: 580px;
  color: #5a5a5a;
  margin: 0;
}

.relations-header-image {
  flex: 0 0 300px;
}

.relations-header-image img {
  width: 100%;
  height: auto;
  display: block;
}

.relations-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.relation-card {
  background: white;
  border-radius: 10px;
  padding: 1.5rem;
  border: 1px solid rgba(0,0,0,0.06);
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.relation-card h3 { font-size: 1.05rem; margin-bottom: 0.5rem; }
.relation-card p  { font-size: 0.9rem; color: #666; max-width: none; }

.relation-layers  { display: flex; gap: 0.35rem; margin-bottom: 0.75rem; }
.rl { height: 6px; flex: 1; border-radius: 3px; }
.rl-strat { background: var(--strat-mid); }
.rl-topo  { background: var(--topo-mid); }
.rl-infra { background: var(--infra-mid); }
.rl-arch  { background: var(--arch-mid); }

/* ── SCROLL REVEAL ── */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.reveal.visible { opacity: 1; transform: none; }

/* ── RESPONSIVE ── */
@media (max-width: 860px) {
  .framework-hero .hero-inner {
    grid-template-columns: 1fr;
    padding: 3.5rem 1.25rem 2.5rem;
  }
  .framework-hero .hero-visual {
    display: none;
  }
  .framework-hero .hero-strip {
    flex-wrap: wrap;
    gap: 1rem;
  }
  .framework-hero .hero-strip-divider {
    display: none;
  }
  .framework-hero h1 {
    font-size: 2.2rem;
  }

  .intro-inner,
  .layer-inner,
  .layer-section:nth-child(even) .layer-inner {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .layer-section:nth-child(even) .layer-sidebar,
  .layer-section:nth-child(even) .layer-content { order: unset; }
  .layer-sidebar { position: static; }

  .relations-header {
    flex-direction: column;
    gap: 2rem;
  }
  .relations-header-image {
    flex: none;
    width: 100%;
    max-width: 320px;
  }
  .relations-grid { grid-template-columns: 1fr; }
}