/* Captain Cook case study. Load after portfolio-theme.css. */

/* Screenshots and diagrams need a wider column. Other pages stay at 1000px. */
@media screen {
  .site-nav,
  .page-shell {
    width: min(100%, 90rem);
  }
}

@media screen and (min-width: 720px) {
  .site-nav,
  .page-shell {
    width: min(92vw, 90rem);
  }
}


.reading-progress {
  position: fixed;
  inset: 0 0 auto;
  z-index: 120;
  height: 3px;
  pointer-events: none;
}

.reading-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--ochre);
}

.hero-band {
  padding: 7.75rem clamp(1.35rem, 5vw, 4.5rem) 3.4rem;
  color: #f4faf6;
  background:
    radial-gradient(circle at 86% 18%, rgba(215, 229, 220, 0.16) 0 12%, transparent 12.6%),
    radial-gradient(circle at 86% 18%, transparent 0 21%, rgba(215, 229, 220, 0.22) 21.2% 21.6%, transparent 22%),
    linear-gradient(145deg, #1b4332, #10281d);
}

.hero-band .eyebrow {
  color: #cfe0d6;
}

.hero-band h1 {
  max-width: 16em;
  color: #f7faf6;
  font-size: clamp(2.05rem, 4.2vw, 3.15rem);
  line-height: 1.08;
}

.hero-sub {
  max-width: 40em;
  margin-top: 1.15rem;
  color: #d7e4dc;
  font-size: 1.12rem;
  line-height: 1.55;
}

.meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 1.8rem 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.22);
}

.meta div {
  padding: 0.85rem 0.85rem 0.85rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.22);
}

.meta dt {
  color: #c9ddd2;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.meta dd {
  margin: 0.22rem 0 0;
  color: #f7faf6;
  font-size: 0.92rem;
  font-weight: 650;
  line-height: 1.35;
}

.hero-band .btn-primary {
  background: var(--ochre);
  color: #1a241c;
}

.hero-band .btn-primary:hover {
  background: #e0b15c;
}

.hero-band .btn-ghost {
  border-color: rgba(255, 255, 255, 0.4);
  background: transparent;
  color: #f7faf6;
}

.hero-band .btn-ghost:hover {
  border-color: #f7faf6;
  color: #f7faf6;
}

.hero-figure {
  margin: 2.6rem 0 0;
}

.story {
  padding: 4rem clamp(1.35rem, 5vw, 4.5rem);
  border-top: 1px solid var(--line-soft);
}

.story h2,
.spine h2 {
  max-width: 20em;
  margin-bottom: 1rem;
}

.spine h2 {
  font-size: clamp(1.45rem, 2.6vw, 1.95rem);
}

.story p,
.fold-body p,
.spine-item p {
  max-width: 40em;
}

.story p + p,
.fold-body p + p,
.spine-item p + p,
.proof-step p + p {
  margin-top: 0.95rem;
}

.thesis,
.principle {
  margin: 1.35rem 0;
  padding: 0;
  border: 0;
  color: var(--forest);
  font-family: var(--font-display);
  line-height: 1.35;
}

.thesis {
  max-width: 20em;
  font-size: clamp(1.35rem, 2.5vw, 1.8rem);
}

.principle {
  max-width: 36em;
  padding-left: 0.9rem;
  border-left: 3px solid var(--ochre);
  font-size: 1.15rem;
}

.split {
  display: grid;
  gap: 1.75rem;
}

.side-figure,
.proof-figure,
.frames figure,
.proof-step figure,
.device-frame {
  margin: 0;
}

.shot {
  display: block;
  width: 100%;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: var(--paper);
  box-shadow: 0 10px 24px rgba(31, 43, 38, 0.06);
  cursor: zoom-in;
}

.shot img {
  display: block;
  width: 100%;
  height: auto;
}

.hero-figure .shot {
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 22px 40px rgba(0, 0, 0, 0.22);
}

figcaption,
.caption {
  max-width: 42em;
  margin-top: 0.7rem;
  color: var(--text-lo);
  font-size: 0.92rem;
  line-height: 1.45;
}

.hero-band figcaption,
.hero-band .annotations {
  color: #d7e4dc;
}

.cap-label {
  display: block;
  margin-bottom: 0.3rem;
  color: var(--forest);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.reframe {
  margin-top: 0.9rem;
  color: var(--forest);
  font-weight: 650;
}

.annotations {
  display: grid;
  gap: 0.9rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
  counter-reset: note;
}

.annotations li {
  counter-increment: note;
  font-size: 0.92rem;
  line-height: 1.45;
}

.annotations li::before {
  content: counter(note);
  display: grid;
  place-items: center;
  width: 1.45rem;
  height: 1.45rem;
  margin-bottom: 0.4rem;
  border-radius: 50%;
  background: var(--ochre);
  color: #1a241c;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
}

.shift {
  display: grid;
  gap: 1rem;
  margin-top: 1.8rem;
}

.shift h3 {
  color: var(--text-lo);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.shift ul {
  margin: 0.7rem 0 0;
  padding: 0;
  list-style: none;
}

.shift li {
  padding: 0.45rem 0;
  border-top: 1px solid var(--line-soft);
  color: var(--text-lo);
  font-size: 0.95rem;
}

.shift-after {
  padding: 1.15rem 1.2rem 1.3rem;
  background: var(--paper);
  border-top: 3px solid var(--forest);
}

.shift-after h3,
.shift-line {
  color: var(--forest);
}

.shift-line {
  margin-top: 0.7rem;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.4vw, 1.7rem);
  line-height: 1.25;
}

.shift-after li {
  color: var(--text-hi);
}

.loop-title {
  margin-top: 2.4rem;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
}

.loop,
.flow,
.stages {
  margin: 0.9rem 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.loop {
  display: flex;
  flex-direction: column;
}

.loop li,
.flow li {
  counter-increment: step;
  position: relative;
  padding: 0.65rem 0 0.65rem 2.3rem;
  border-left: 1px solid var(--line);
  font-size: 0.95rem;
}

.loop li::before,
.flow li::before,
.stages li::before {
  content: counter(step);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
}

.loop li::before,
.flow li::before {
  position: absolute;
  left: -0.7rem;
  display: grid;
  place-items: center;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 50%;
  background: var(--paper);
  border: 1px solid var(--forest);
  color: var(--forest);
}

.loop-note {
  margin-top: 0.9rem;
  color: var(--text-lo);
}

.spine {
  display: flex;
  flex-direction: column;
  gap: 3.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.spine-item {
  display: grid;
  grid-template-columns: 2.75rem 1fr;
  gap: 0.9rem 1rem;
  position: relative;
}

.spine-item:not(:last-child)::before {
  content: "";
  position: absolute;
  top: 2.75rem;
  bottom: -3.25rem;
  left: 1.35rem;
  width: 1px;
  background: var(--line);
}

.spine-num {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  background: var(--forest);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
}

.points,
.fold-body ol {
  max-width: 40em;
  margin: 0.75rem 0 0;
  padding-left: 1.2rem;
}

.points li + li,
.fold-body li + li {
  margin-top: 0.4rem;
}

.frames {
  display: grid;
  gap: 1.1rem;
  margin-top: 1.4rem;
}

.lanes {
  display: grid;
  gap: 0.75rem;
  margin-top: 1.4rem;
}

.lanes section {
  padding: 1rem 1.05rem 1.15rem;
  background: var(--paper);
  border: 1px solid var(--line-soft);
}

.lanes h3 {
  color: var(--text-lo);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.lanes ul {
  margin: 0.7rem 0 0;
  padding: 0;
  list-style: none;
}

.lanes li {
  padding: 0.35rem 0;
  border-top: 1px solid var(--line-soft);
  font-size: 0.92rem;
}

.lane-hybrid {
  background: var(--surface-2);
  border-top: 3px solid var(--ochre);
}

.lane-hybrid h3 {
  color: var(--forest);
}

.counts-row {
  margin: 1.4rem 0 1rem;
}

.counts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
}

.counts div {
  padding: 0.75rem 0.7rem 0.75rem 0;
  border-top: 2px solid var(--forest);
}

.counts dt {
  color: var(--text-lo);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.counts dd {
  margin: 0.15rem 0 0;
  font-family: var(--font-display);
  font-size: 1.85rem;
  line-height: 1.1;
}

.boundary {
  max-width: 42em;
  margin-top: 0.9rem;
  padding: 0.9rem 1rem;
  background: var(--surface-2);
  border-left: 3px solid var(--ochre);
}

.proof-figure,
.proof-list {
  margin-top: 1.4rem;
}

.proof-step {
  display: grid;
  gap: 0.8rem;
  padding-top: 1.6rem;
}

.proof-step h3 {
  font-size: 1.35rem;
}

.mobile-pairing {
  display: grid;
  gap: 1.1rem;
  margin-top: 2.4rem;
  padding-top: 1.8rem;
  border-top: 1px solid var(--line-soft);
}

.mobile-pairing h3 {
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 700;
}

.device-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1.4rem;
}

.device-frame {
  width: min(220px, 46%);
}

.device-shell {
  overflow: hidden;
  border: 3px solid var(--text-hi);
  border-radius: 26px;
  background: var(--text-hi);
}

.device-shell .shot {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.device-frame figcaption {
  margin-top: 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
}

.table-scroll {
  margin: 1.35rem 0;
}

.evidence-table {
  width: 100%;
  border-collapse: collapse;
}

.evidence-table th,
.evidence-table td {
  padding: 0.8rem 0.85rem;
  border-bottom: 1px solid var(--line-soft);
  font-size: 0.92rem;
  text-align: left;
  vertical-align: top;
}

.evidence-table th {
  color: var(--text-lo);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.evidence-table td:last-child {
  color: var(--text-lo);
}

.fold {
  margin-top: 1.2rem;
  border-top: 1px solid var(--line-soft);
}

.fold summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3.1rem;
  padding: 0.8rem 0;
  color: var(--text-hi);
  font-weight: 700;
  line-height: 1.35;
  cursor: pointer;
}

.fold summary::-webkit-details-marker {
  display: none;
}

.fold summary::after {
  content: "+";
  flex-shrink: 0;
  color: var(--forest);
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 500;
}

.fold[open] summary::after {
  content: "–";
}

.fold-body {
  padding-bottom: 0.4rem;
}

.fold-body h3 {
  margin-top: 1.1rem;
  color: var(--lake);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.lessons {
  margin: 0.4rem 0 0;
  padding: 0;
  list-style: none;
}

.lessons li {
  margin-top: 1.15rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--line-soft);
}

.lessons h3 {
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 700;
}

.lessons p {
  margin-top: 0.4rem;
}

.next-test {
  margin-top: 2.8rem;
  padding-top: 2.2rem;
  border-top: 1px solid var(--line-soft);
}

.stages {
  display: grid;
  gap: 0.75rem;
  margin: 1.2rem 0;
}

.stages li {
  counter-increment: step;
  padding-top: 0.45rem;
  border-top: 2px solid var(--forest);
  font-size: 0.9rem;
  line-height: 1.35;
}

.stages li::before {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--ochre);
}

.flow {
  display: grid;
  gap: 0;
  margin: 1rem 0 1.2rem;
}

.close .cta-row {
  margin-top: 1.6rem;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem 1.25rem 1.5rem;
  background: rgba(16, 28, 24, 0.92);
}

.lightbox[hidden] {
  display: none !important;
}

.lightbox img {
  width: auto;
  max-width: min(1100px, 94vw);
  max-height: 86vh;
  border-radius: 8px;
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  padding: 0.5rem 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 4px;
  background: transparent;
  color: #f7faf6;
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
}

body.lightbox-open {
  overflow: hidden;
}

html[data-theme="harbor"] .hero-band {
  background:
    radial-gradient(circle at 86% 18%, rgba(189, 213, 218, 0.2) 0 12%, transparent 12.6%),
    radial-gradient(circle at 86% 18%, transparent 0 21%, rgba(189, 213, 218, 0.22) 21.2% 21.6%, transparent 22%),
    linear-gradient(145deg, #123d49, #0c3039);
}

html[data-theme="harbor"] .hero-band .eyebrow,
html[data-theme="harbor"] .hero-band .meta dt {
  color: #a9cbd1;
}

html[data-theme="harbor"] .hero-band h1,
html[data-theme="harbor"] .hero-band .meta dd {
  color: #f7faf9;
}

html[data-theme="harbor"] .hero-band .hero-sub,
html[data-theme="harbor"] .hero-band figcaption,
html[data-theme="harbor"] .hero-band .annotations {
  color: #d4e2e4;
}

html[data-theme="harbor"] .hero-band .btn-primary:hover {
  background: #f0b65d;
}

@media (min-width: 720px) {
  .annotations {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .stages {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (min-width: 800px) {
  .meta {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .meta div {
    border-bottom: 0;
    border-right: 1px solid rgba(255, 255, 255, 0.22);
  }

  .meta div:last-child {
    border-right: 0;
  }

  .shift {
    grid-template-columns: 0.9fr 1.1fr;
    align-items: start;
  }

  .loop {
    flex-direction: row;
    align-items: start;
    padding-top: 0.4rem;
  }

  .loop li {
    flex: 1;
    padding: 0.85rem 0.75rem 0 0;
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .loop li::before {
    top: -0.75rem;
    left: 0;
  }

  .lanes {
    grid-template-columns: 1fr 1.12fr 1fr;
    align-items: stretch;
  }

  .proof-step {
    grid-template-columns: minmax(0, 0.78fr) minmax(0, 1.22fr);
    gap: 1.4rem;
    align-items: start;
  }

  .mobile-pairing {
    grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr);
    align-items: center;
  }
}

@media (min-width: 900px) {
  .split {
    grid-template-columns: 1.2fr 0.8fr;
    align-items: start;
  }

  .frames {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .flow {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .flow li {
    padding: 0.75rem 0.7rem 0 0;
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .flow li::before {
    top: -0.75rem;
    left: 0;
  }
}

@media (max-width: 720px) {
  .evidence-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .evidence-table,
  .evidence-table tbody,
  .evidence-table tr,
  .evidence-table td {
    display: block;
    width: 100%;
  }

  .evidence-table tr {
    padding: 0.35rem 0 0.75rem;
    border-bottom: 1px solid var(--line-soft);
  }

  .evidence-table td {
    padding: 0.45rem 0;
    border: 0;
  }

  .evidence-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 0.12rem;
    color: var(--forest);
    font-family: var(--font-mono);
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
  }

  .evidence-table td:last-child {
    color: var(--text-hi);
  }
}

@media print {
  .reading-progress,
  .lightbox {
    display: none !important;
  }

  .hero-band {
    background: #fff !important;
    color: #1f2b26 !important;
  }

  .hero-band .eyebrow,
  .hero-band h1,
  .hero-band .hero-sub,
  .hero-band .meta dt,
  .hero-band .meta dd,
  .hero-band figcaption,
  .hero-band .annotations,
  .hero-band .btn-ghost {
    color: #1f2b26 !important;
  }

  .hero-band .meta,
  .hero-band .meta div {
    border-color: #ccc !important;
  }

  .shot {
    box-shadow: none;
  }
}
