/* =========================================================
   Project and venture pages. Loads after styles.css.
   Each page sets --accent / --accent-deep on <body>.
   ========================================================= */

/* ---------- Breadcrumb ---------- */
.crumb { padding-top: 1.75rem; font-size: 0.85rem; color: var(--text-soft); }
.crumb ol {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem;
}
.crumb li::after { content: "/"; margin-left: 0.5rem; color: #c3bfb6; }
.crumb li:last-child::after { content: none; }
.crumb a { color: var(--text-soft); }
.crumb a:hover { color: var(--accent); }
.crumb [aria-current="page"] { color: var(--text); font-weight: 500; }

/* ---------- Hero ---------- */
.p-hero {
  padding: clamp(2.25rem, 4vw, 3.5rem) 0 clamp(3rem, 6vw, 5rem);
  background:
    radial-gradient(110% 90% at 88% 0%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 64%),
    linear-gradient(180deg, var(--paper) 0%, var(--white) 72%);
}
.p-mark { height: 64px; width: auto; margin-bottom: 1.75rem; }
.p-mark--icon { height: 76px; width: 76px; border-radius: 17px; box-shadow: 0 0 0 1px rgba(22,25,26,0.1); }
.p-hero h1 { font-size: clamp(2.1rem, 4.6vw, 3.5rem); max-width: 19ch; margin-bottom: 1rem; }
.p-lede { font-size: clamp(1.03rem, 1.4vw, 1.18rem); max-width: 58ch; margin-bottom: 2rem; }
.p-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }

.pill {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-size: 0.8rem; font-weight: 500;
  color: var(--accent-deep);
  background: color-mix(in srgb, var(--accent) 11%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 32%, transparent);
  border-radius: 999px; padding: 0.35rem 0.85rem; margin-bottom: 1.15rem;
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

/* ---------- Sections ---------- */
.p-section { padding-block: clamp(3rem, 6vw, 5rem); }
.p-section--paper { background: var(--paper); }
.p-section--bone { background: var(--bone); }

.p-intro {
  display: grid; grid-template-columns: 1fr 1.3fr;
  gap: clamp(2rem, 5vw, 4.5rem); align-items: start;
}
.p-intro h2 { max-width: 16ch; margin: 0; }
.p-intro p { font-size: 1.04rem; }
.p-intro p + p { margin-top: 1em; }

.p-head { max-width: 46rem; margin-bottom: 2.75rem; }
.p-head h2 { max-width: 22ch; }

/* ---------- Use case strip ---------- */
.cases { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 1.25rem; }
.case {
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 1.75rem 1.5rem;
  display: flex; flex-direction: column; gap: 0.7rem;
}
.case-when {
  font-family: var(--display); font-weight: 600; font-size: 0.78rem;
  color: var(--accent-deep);
}
.case h3 { font-size: 1.04rem; margin: 0; }
.case p { font-size: 0.95rem; margin: 0; }
.case-note {
  margin-top: 2rem; font-size: 0.88rem; color: var(--text-soft);
  display: flex; align-items: center; gap: 0.55rem;
}
.case-note svg { width: 16px; height: 16px; color: var(--accent); flex: none; }

/* ---------- Flow ---------- */
.flow { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 2rem; counter-reset: flow; }
.flow-step { counter-increment: flow; }
.flow-step h3 { display: flex; align-items: baseline; gap: 0.6rem; font-size: 1.02rem; margin-bottom: 0.5rem; }
.flow-step h3::before {
  content: counter(flow, decimal-leading-zero);
  font-family: var(--display); font-weight: 700; font-size: 1.4rem;
  color: var(--accent); line-height: 1;
}
.flow-step p { font-size: 0.95rem; margin: 0; }

/* ---------- Features ---------- */
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.4rem; }
.feature {
  background: var(--white); border: 1px solid var(--rule);
  border-radius: 3px; padding: 1.75rem 1.5rem;
}
.p-section--paper .feature, .p-section--bone .feature { background: var(--white); }
.feature h3 {
  font-size: 1.02rem; margin-bottom: 0.55rem;
  padding-top: 0.85rem; border-top: 2px solid var(--accent); display: inline-block;
}
.feature p { font-size: 0.95rem; margin: 0; }
.feature ul { margin: 0.75rem 0 0; padding-left: 1.1rem; font-size: 0.92rem; color: var(--text-soft); }
.feature li { margin-bottom: 0.3rem; }

/* ---------- Specs ---------- */
.specs { list-style: none; margin: 0; padding: 0; max-width: 46rem; }
.specs li {
  display: grid; grid-template-columns: 11rem 1fr; gap: 1.5rem;
  padding: 1rem 0; border-bottom: 1px solid var(--rule); font-size: 0.96rem;
}
.specs .k { font-weight: 500; color: var(--text); }
.specs .v { color: var(--text-soft); }

/* ---------- Closing CTA ---------- */
.p-cta {
  padding-block: clamp(3.5rem, 6vw, 5rem);
  background: var(--ink); color: var(--on-dark); text-align: center;
}
.p-cta h2 { color: var(--on-dark); max-width: 20ch; margin-inline: auto; }
.p-cta p { color: var(--on-dark-soft); margin-inline: auto; max-width: 52ch; margin-bottom: 2rem; }
.p-cta-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: center; }

/* ---------- Siblings ---------- */
.more { padding-block: clamp(2.5rem, 4vw, 3.5rem); background: var(--paper); }
.more h2 { font-size: 1.3rem; margin-bottom: 1.5rem; }
.more-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.9rem; }
.more-card {
  display: flex; align-items: center; gap: 0.7rem;
  padding: 0.85rem 1rem; background: var(--white);
  border: 1px solid var(--rule); border-radius: 3px;
  font-size: 0.92rem; font-weight: 500; color: var(--text);
  transition: border-color 0.18s ease;
}
.more-card:hover { border-color: var(--accent); }
.more-card img { width: 28px; height: 28px; border-radius: 7px; box-shadow: 0 0 0 1px rgba(22,25,26,0.1); }

@media (max-width: 860px) {
  .p-intro { grid-template-columns: 1fr; gap: 1.5rem; }
  .p-intro h2 { max-width: none; }
  .specs li { grid-template-columns: 1fr; gap: 0.2rem; }
}

/* ---------- Portfolio directory ---------- */
.pstats {
  display: flex; flex-wrap: wrap; gap: 2.5rem;
  margin-top: 2.25rem; padding-top: 1.75rem;
  border-top: 1px solid var(--rule);
}
.pstat { display: flex; flex-direction: column; gap: 0.2rem; }
.pstat-n {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(1.7rem, 3vw, 2.4rem); line-height: 1;
  letter-spacing: -0.03em; color: var(--text);
}
.pstat-l { font-size: 0.85rem; color: var(--text-soft); }

.pfilters { display: flex; flex-wrap: wrap; gap: 0.55rem; margin-bottom: 2.25rem; }
.pfilter {
  font: inherit; font-size: 0.88rem; font-weight: 500;
  color: var(--text-soft);
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 0.55rem 1.05rem;
  cursor: pointer;
  transition: border-color 0.16s ease, color 0.16s ease, background-color 0.16s ease;
}
.pfilter span { opacity: 0.6; margin-left: 0.3rem; font-variant-numeric: tabular-nums; }
.pfilter:hover { border-color: var(--slate); color: var(--text); }
.pfilter.is-on {
  background: var(--ink); border-color: var(--ink); color: var(--on-dark);
}
.pfilter.is-on span { opacity: 0.7; }

.pgrid {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 1rem;
}
.pcard[hidden] { display: none; }
.pcard > a {
  display: grid; gap: 0.4rem; height: 100%;
  padding: 1.4rem;
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: 3px;
  transition: border-color 0.18s ease, transform 0.18s ease;
}
.pcard > a:hover { border-color: var(--accent); transform: translateY(-2px); }
.pcard-mark { font-size: 1.5rem; line-height: 1; margin-bottom: 0.35rem; }
.pcard-name { font-family: var(--display); font-weight: 600; font-size: 1.02rem; color: var(--text); }
.pcard-industry { font-size: 0.8rem; color: var(--accent-deep); font-weight: 500; }
.pcard-desc { font-size: 0.91rem; color: var(--text-soft); line-height: 1.55; }
.pcard-go {
  margin-top: auto; padding-top: 0.75rem;
  font-size: 0.82rem; font-weight: 500; color: var(--text-soft);
}
.pcard > a:hover .pcard-go { color: var(--accent); }

.pempty { margin: 2rem 0 0; color: var(--text-soft); }

.pnote {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 1.5rem; margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--rule);
}
.pnote p { margin: 0; max-width: 56ch; }

/* ---------- Long-form story ---------- */
.story-long {
  display: grid; grid-template-columns: 0.8fr 1.2fr;
  gap: clamp(2rem, 5vw, 4.5rem); align-items: start;
}
.story-long-figure img { width: 100%; }
.story-long-body p { font-size: 1.05rem; }
.story-long-body p + p { margin-top: 1.1em; }
.story-next { display: flex; flex-wrap: wrap; gap: 0.75rem; }

/* ---------- Book shelf ---------- */
.shelf {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 1.75rem 1.5rem;
}
.bk { display: block; }
.bk-cover {
  position: relative; display: block;
  border-radius: 3px; overflow: hidden;
  box-shadow: 0 1px 2px rgba(22,25,26,0.14), 0 8px 20px rgba(22,25,26,0.08);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}
.bk-cover img { width: 100%; height: auto; display: block; }
.bk-reveal {
  position: absolute; inset: 0;
  display: flex; align-items: flex-end;
  padding: 1.1rem;
  background: linear-gradient(180deg, rgba(18,20,21,0.2) 0%, rgba(18,20,21,0.93) 55%);
  color: var(--on-dark);
  font-size: 0.86rem; line-height: 1.5;
  opacity: 0; transition: opacity 0.22s ease;
}
.bk:hover .bk-cover, .bk:focus-within .bk-cover { transform: translateY(-3px); }
.bk:hover .bk-reveal, .bk:focus-within .bk-reveal { opacity: 1; }

.bk-meta { display: block; margin-top: 0.8rem; }
.bk-title {
  display: block; font-family: var(--display); font-weight: 600;
  font-size: 0.95rem; line-height: 1.3; color: var(--text);
}
.bk-author { display: block; font-size: 0.8rem; color: var(--accent-deep); margin-top: 0.15rem; }
/* Visible only where hover does not exist, so touch users still get the note. */
.bk-note { display: none; font-size: 0.87rem; color: var(--text-soft); line-height: 1.5; margin-top: 0.5rem; }

@media (hover: none) {
  .bk-reveal { display: none; }
  .bk-note { display: block; }
}
@media (max-width: 860px) {
  .story-long { grid-template-columns: 1fr; }
  .story-long-figure { max-width: 380px; }
}

/* ---------- Recommend a book ---------- */
.rec {
  display: grid; grid-template-columns: 1fr 1.1fr;
  gap: clamp(2rem, 5vw, 4rem); align-items: start;
}
.rec-intro h2 { max-width: 16ch; }
.rec-form { display: grid; gap: 1rem; }
.rec-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
/* The shared field styles are written for dark bands; this form sits on paper. */
.rec-form .field label { color: var(--text); }
.rec-form .field .optional { color: var(--text-soft); font-weight: 400; }
.rec-form .field input,
.rec-form .field textarea {
  color: var(--text);
  background: var(--white);
  border: 1px solid #cfcac1;
}
.rec-form .field input:hover,
.rec-form .field textarea:hover { border-color: #ada89e; }
.rec-form .field input:focus,
.rec-form .field textarea:focus {
  background-color: var(--white);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(194,52,43,0.18);
}
.rec-form .field-error { color: var(--accent-deep); }
.rec-form .form-status[data-tone="ok"] {
  color: #2f6b45; background: rgba(93,173,118,0.14); border-color: rgba(93,173,118,0.45);
}
.rec-form .form-status[data-tone="error"] {
  color: #93261e; background: rgba(194,52,43,0.08); border-color: rgba(194,52,43,0.35);
}
.more-link--pair { display: flex; flex-wrap: wrap; gap: 0.75rem; }

@media (max-width: 860px) {
  .rec { grid-template-columns: 1fr; }
  .rec-row { grid-template-columns: 1fr; }
}

/* ---------- Long-form story chapters ----------
   One column, measured for reading. The mark before each heading gives the
   eye a rest between chapters without needing an image every time. */
.chapters {
  display: grid;
  gap: clamp(2.75rem, 5vw, 4rem);
  max-width: 44rem;
}
.chapter { scroll-margin-top: 90px; }
.chapter-mark {
  width: 30px; height: 30px; margin-bottom: 1.1rem;
  color: var(--accent);
}
.chapter-mark svg { width: 100%; height: 100%; }
.chapter h2 {
  font-size: clamp(1.45rem, 2.4vw, 2rem);
  margin-bottom: 0.85rem;
}
.chapter p { font-size: 1.04rem; }
/* The bolded phrases are the scan layer: they have to read darker than the
   body copy, which is deliberately soft. */
.chapter strong, .lessons strong { color: var(--text); font-weight: 600; }
.chapter em { font-style: italic; }
.chapter-close {
  margin-top: 2rem; padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  font-size: 0.97rem;
}

.lessons { list-style: none; margin: 0 0 1.5rem; padding: 0; display: grid; gap: 1.15rem; }
.lessons li {
  padding-left: 1.25rem;
  border-left: 2px solid var(--rule);
  font-size: 1.02rem; line-height: 1.6; color: var(--text-soft);
}
.lessons li strong { display: block; margin-bottom: 0.3rem; }

/* Full-bleed-ish image break between chapters. */
.story-break { margin: 0; }
.story-break img {
  width: 100%; border-radius: 3px;
  filter: grayscale(100%) contrast(1.04);
}

/* ---------- Set covers ----------
   For titles whose jacket is not on the server yet. Matches the existing
   covers: accent rule, title top left, author on the baseline, on the same
   deep muted grounds. Swap for an <img> when the real cover lands in
   /media/books/<slug>.webp. Type is sized in container units so it scales
   with the card exactly as the baked-in covers do. */
.bk-cover--set {
  aspect-ratio: 420 / 630;
  container-type: inline-size;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 11.5% 11% 9.5%;
  background: #332320;
}
.bk-cover--set[data-tone="2"] { background: #242c25; }
.bk-cover--set[data-tone="3"] { background: #2b2430; }
.bk-cover--set[data-tone="4"] { background: #382e22; }
.bk-cover--set[data-tone="5"] { background: #22272e; }
.bk-set { display: block; }
.bk-set-rule {
  display: block; width: 23%; height: 1.4cqw; min-height: 2px;
  margin-bottom: 13%;
  background: var(--accent);
}
.bk-set-title {
  display: block;
  font-family: var(--display); font-weight: 700;
  font-size: 9cqw; line-height: 1.18; letter-spacing: -0.02em;
  color: #ede7dd;
  text-wrap: balance;
}
.bk-set-author {
  display: block;
  font-size: 4.9cqw; line-height: 1.3;
  color: rgba(237, 231, 221, 0.6);
}

/* ---------- Full summary disclosure ---------- */
.bk-more { margin-top: 0.6rem; }
.bk-more > summary {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-size: 0.8rem; font-weight: 500; color: var(--accent-deep);
  cursor: pointer; list-style: none; padding: 0.15rem 0;
}
.bk-more > summary::-webkit-details-marker { display: none; }
.bk-more > summary::after {
  content: ""; width: 7px; height: 7px; margin-left: 0.1rem;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translate(-2px, -2px);
  transition: transform 0.18s ease;
}
.bk-more[open] > summary::after { transform: rotate(-135deg) translate(-2px, -2px); }
.bk-more > summary:hover { color: var(--accent); }
.bk-summary {
  margin-top: 0.5rem; padding: 0.85rem 0.95rem;
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: 3px;
}
.bk-summary p { font-size: 0.87rem; line-height: 1.55; margin: 0; max-width: none; }
.bk-buy { margin-top: 0.7rem !important; display: flex; flex-wrap: wrap; gap: 0.75rem; }
.bk-buy a {
  font-size: 0.8rem; font-weight: 500; color: var(--accent-deep);
  border-bottom: 1px solid rgba(158,40,32,0.35); padding-bottom: 1px;
}
.bk-buy a:hover { color: var(--accent); border-bottom-color: var(--accent); }
