/* ==========================================================================
   KHERAD — Strata / Earned Layers system
   A very restrained visual language for accumulated, tested structure.
   Inspired by architectural drawings, sediment, growth rings, and quiet refinement.
   Everything is optional and can be dialed to near-invisibility.
   ========================================================================== */

/* Base document feel overrides (apply selectively) */
body.strata {
  /* slightly more material paper */
  background: #FBFAF7;
}

/* Fine horizontal strata — the core motif for "earned layers" */
.strata-rule {
  height: 1px;
  background: linear-gradient(
    to right,
    transparent 0%,
    var(--line) 15%,
    var(--line) 85%,
    transparent 100%
  );
  margin: 28px 0;
  position: relative;
}

.strata-rule.thick {
  height: 2px;
  background: var(--line);
}

.strata-rule.double {
  height: 3px;
  background: repeating-linear-gradient(
    90deg,
    var(--line) 0px,
    var(--line) 1px,
    transparent 1px,
    transparent 4px
  );
}

/* Very faint background strata (used sparingly on alt sections or records) */
.strata-bg {
  background-image: 
    linear-gradient(to bottom, transparent 0%, transparent 48%, var(--line-soft) 49%, transparent 50%, transparent 100%),
    linear-gradient(to bottom, transparent 0%, transparent 98%, var(--line) 99%, transparent 100%);
  background-size: 100% 48px, 100% 12px;
  background-repeat: repeat;
  opacity: 0.035;
}

/* Refined drawing / record containers */
.record {
  border: 1px solid var(--line);
  background: var(--paper);
  padding: 32px 36px;
  position: relative;
}

.record::before {
  content: '';
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  bottom: 12px;
  border: 1px solid var(--line-soft);
  pointer-events: none;
  opacity: 0.6;
}

/* Ladder as measured drawing */
.ladder-drawing {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  color: var(--ink-faint);
  padding: 18px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin: 24px 0;
}

.ladder-drawing .epoch {
  padding: 2px 8px;
  transition: all 600ms ease;
}

.ladder-drawing .epoch.done {
  color: var(--ink);
  border-bottom: 1px solid var(--ink-soft);
}

.ladder-drawing .epoch.active {
  color: var(--accent);
  border-bottom: 1px solid var(--accent);
  position: relative;
}

.ladder-drawing .epoch.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 1px;
  background: var(--accent);
  opacity: 0.3;
}

/* Subtle "settling" interaction on principles and measured items */
.principle, .status-item {
  transition: border-color 500ms ease, padding 400ms ease;
}

.principle:hover,
.status-item:hover {
  border-color: var(--ink-soft);
}

.principle:hover .idx,
.status-item:hover .label {
  color: var(--ink);
}

/* Calm line animation for "earned" elements */
.earned-line {
  position: relative;
  overflow: hidden;
}

.earned-line::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 900ms cubic-bezier(0.23, 1, 0.32, 1);
}

.earned-line:hover::after,
.earned-line:focus-within::after {
  width: 100%;
}

/* Header evolution — less app-like */
header.site {
  border-bottom: 1px solid var(--line-soft);
  background: rgba(251, 250, 247, 0.92);
}

header.site .bar {
  padding-top: 18px;
  padding-bottom: 18px;
}

/* Make logo feel more like a document title */
header.site .logo {
  letter-spacing: 0.18em;
  font-weight: 500;
}

/* Reduce SaaS button energy */
.btn {
  border-radius: 0;
  border-width: 1px;
  padding: 9px 18px;
  letter-spacing: 0.16em;
}

/* Measured record legend style for status */
.status-legend {
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
  text-transform: uppercase;
}

/* Very subtle scroll strata hint */
@media (prefers-reduced-motion: no-preference) {
  .strata-bg {
    transition: opacity 1.2s ease;
  }
  
  section:hover .strata-bg {
    opacity: 0.05;
  }
}

.strata-mark {
  display: inline-block;
  width: 14px;
  height: 8px;
  margin-left: 6px;
  vertical-align: 1px;
  border-top: 1px solid var(--ink-faint);
  border-bottom: 1px solid var(--ink-faint);
  position: relative;
}
.strata-mark::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  right: 2px;
  height: 1px;
  background: var(--ink-faint);
  opacity: 0.6;
}

