
.code-page{background:#fff}.code-page nav a[aria-current]{border-color:var(--pink)}
.code-hero{background:var(--ink);color:#fff;position:relative;isolation:isolate;min-height:520px;padding:65px 6% 70px;overflow:hidden}.code-hero-copy{position:relative;z-index:2;width:66%}.code-hero .eyebrow{color:var(--pink)}.code-hero h1{margin:32px 0 24px}.code-hero h1 img{width:min(100%,780px);filter:brightness(0) invert(1)}.code-lead{font-size:clamp(30px,3.3vw,48px);line-height:1.2;margin-bottom:16px}.code-hero .text-link{margin-top:25px}.code-pennant{position:absolute;top:0;right:7%;width:16%;height:370px;background:var(--pink);clip-path:polygon(0 0,100% 0,60% 100%)}.code-pennant img{position:absolute;left:56%;transform:translateX(-50%);top:8%;width:40%;height:62%;object-fit:contain}.code-visitor{position:absolute;right:4%;bottom:5%;width:23%;max-height:190px;object-fit:contain;z-index:1}
.code-opening,.principle,.code-aboard,.code-paths,.code-belonging,.code-next{padding:80px 6%}.code-opening,.principle,.code-two-col{display:grid;grid-template-columns:1fr 1fr;gap:10%}.declaration{font-size:clamp(31px,4vw,54px);line-height:1.12;letter-spacing:-.03em;margin-top:24px}.opening-reading p+p,.principle-reading>p+p,.code-two-col p+p,.code-belonging p+p{margin-top:20px}
.principle{border-bottom:1px solid #ddd;scroll-margin-top:20px}.principle:nth-child(even){background:#f4f2ed}.principle h2,.code-aboard h2,.code-paths h2,.code-belonging h2,.code-next h2{font-size:clamp(38px,4.5vw,66px);font-weight:500;line-height:1.05;letter-spacing:-.035em}.principle h2{margin-top:22px;max-width:510px}.principle-compass{font-size:27px;line-height:1.3}.practice{border-left:3px solid var(--pink);padding-left:22px;margin-top:30px}.practice p{margin-top:10px}.practice .eyebrow{font-size:10px}.code-life{position:relative;background:var(--ink)}.code-life>img{width:100%;height:clamp(280px,45vw,580px);object-fit:cover;filter:grayscale(1)}.code-life figcaption{font-family:Space Mono,monospace;font-size:11px;letter-spacing:.04em;background:var(--ink);color:#fff;padding:18px 6%}.code-aboard>.eyebrow{display:block;margin-bottom:35px}.code-paths{background:var(--ink);color:#fff}.code-paths>.section-marker{color:var(--pink);border-color:#666;margin-bottom:45px}.code-paths h2{font-size:clamp(32px,3.5vw,48px);margin:18px 0 24px}.code-paths article>.eyebrow{color:var(--pink)}.journey-steps{list-style:none;display:flex;flex-wrap:wrap;gap:8px 20px;padding:0;margin:24px 0;font-size:16px}.journey-steps li{border-bottom:1px solid #666;padding-bottom:4px}.path-note{font-size:16px;color:#ccc}.code-paths .text-link{margin-top:25px}.code-belonging{display:grid;grid-template-columns:1fr 1fr;gap:10%;align-items:center;background:var(--pink)}.code-belonging h2{margin:22px 0}.belonging-art{display:grid;grid-template-columns:1fr 1fr;gap:20px;align-items:center}.belonging-art img{width:100%;height:auto}.code-next{text-align:center}.code-next>img{margin:0 auto 25px}.code-next p{margin:25px auto;max-width:500px}.code-next>div{display:flex;justify-content:center;gap:25px 60px;flex-wrap:wrap}
@media(max-width:760px){.code-hero{min-height:480px;padding:35px 6% 50px}.code-hero-copy{width:69%}.code-hero h1{margin-top:30px}.code-hero-copy>.eyebrow{font-size:9px;max-width:190px}.code-hero-copy>p:not(.eyebrow){font-size:19px}.code-hero-copy>p.code-lead{font-size:30px}.code-hero-copy br{display:none}.code-pennant{right:4%;width:22%;height:255px}.code-visitor{width:29%;bottom:22px;right:2%}.code-hero .text-link{font-size:16px;gap:15px}.code-opening,.principle,.code-aboard,.code-paths,.code-belonging,.code-next{padding:50px 6%}.code-opening,.principle,.code-two-col,.code-belonging{grid-template-columns:1fr;gap:30px}.declaration{font-size:36px}.principle h2{font-size:44px}.principle-compass{font-size:24px}.code-belonging{gap:35px}.belonging-art{max-width:420px}.code-paths .code-two-col{gap:50px}.code-next h2{font-size:40px}.code-life figcaption{font-size:9px}.code-next>div{gap:20px}.code-aboard h2{font-size:40px}}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}}
html[data-edition=light] .code-hero{background:var(--pink);color:var(--ink)}
html[data-edition=light] .code-hero .eyebrow{color:var(--ink)}
html[data-edition=light] .code-hero h1 img,html[data-edition=light] .code-visitor{filter:brightness(0)}
html[data-edition=light] .code-pennant{background:#fff}

/* Original photography and creatures give the Code the same living world as the homepage. */
.code-hero{min-height:600px;padding-top:75px;padding-bottom:85px}
.code-hero-copy{width:58%}
.code-header-photo{position:absolute;inset:0 0 0 36%;z-index:0;margin:0;overflow:hidden}
.code-header-photo>img{width:100%;height:100%;object-fit:cover;object-position:60% center;filter:grayscale(1)}
.code-header-photo:after{content:"";position:absolute;inset:0;background:linear-gradient(90deg,#161616 0%,rgba(22,22,22,.9) 12%,rgba(22,22,22,.15) 58%,rgba(22,22,22,.12) 100%)}
.code-pennant{z-index:3}.code-visitor{z-index:3;bottom:0}
.principle-art{width:min(64%,240px);height:150px;object-fit:contain;object-position:left center;margin-top:35px}
#show-up .principle-art{width:135px}#miracles .principle-art{height:170px}
html[data-edition=light] .code-header-photo:after{background:linear-gradient(90deg,#ff9c89 0%,rgba(255,156,137,.93) 12%,rgba(22,22,22,.05) 65%)}
@media(max-width:760px){
 .code-hero{min-height:680px;padding:35px 6% 340px}
 .code-hero-copy{width:69%}
 .code-header-photo{inset:170px 0 0}
 .code-header-photo>img{object-position:55% center}
 .code-header-photo:after{background:linear-gradient(180deg,#161616 0%,rgba(22,22,22,.95) 15%,rgba(22,22,22,.35) 40%,rgba(22,22,22,0) 67%)}
 .code-pennant{height:255px}.code-visitor{bottom:-12px;width:32%}
 .principle-art{height:100px;width:48%;max-width:190px;margin-top:25px}
 #show-up .principle-art{width:95px}#miracles .principle-art{height:110px}
 html[data-edition=light] .code-header-photo:after{background:linear-gradient(180deg,#ff9c89 0%,rgba(255,156,137,.94) 15%,rgba(255,156,137,.2) 45%,transparent 67%)}
}
@media(min-width:761px){.code-pennant{right:3%;width:13%;height:250px}}
@media(max-width:760px){.code-header-photo{top:250px}}

.code-lead{max-width:650px}
.code-hero-copy>p:not(.eyebrow){max-width:540px}

.code-header-photo>img{object-position:50% center}
@media(max-width:760px){.code-header-photo>img{object-position:48% center}}

/* Artwork inhabits the transitions instead of illustrating every principle like an icon. */
.code-page main{overflow:clip}
.code-hero{overflow:visible;z-index:2}
.code-visitor{bottom:-45px;right:5%;width:24%;max-height:200px;transform:rotate(8deg);pointer-events:none}
.code-opening{position:relative;z-index:1}
.principle{position:relative}
#pattern{background:var(--pink);padding-bottom:100px;z-index:2}
.code-pattern-creature{position:absolute;left:-2%;bottom:-32px;width:38%;max-width:440px;filter:brightness(0);pointer-events:none}

.code-aboard{position:relative;padding-bottom:150px;z-index:2}

.code-paths{position:relative;z-index:1;padding-top:95px}
@media(max-width:760px){
 .code-visitor{width:35%;bottom:-30px;right:2%;max-height:120px}
 .code-opening{padding-top:65px}
 #pattern{padding-bottom:45px}
 .code-pattern-creature{position:relative;left:-13%;bottom:auto;display:block;width:90%;max-width:360px;margin:30px 0 -65px}

 .code-aboard{padding-bottom:65px}

 .code-paths{padding-top:95px}
}
#pattern .practice{border-left-color:var(--ink)}

/* Frame the foreground woman clearly; keep copy and shading away from her face and hands. */
@media(min-width:1101px){
 .code-hero-copy{width:46%}
 .code-header-photo{left:41%}
 .code-header-photo>img{object-position:0% center}
 .code-header-photo:after{background:linear-gradient(90deg,#161616 0%,rgba(22,22,22,.8) 10%,transparent 30%)}
 html[data-edition=light] .code-header-photo:after{background:linear-gradient(90deg,#ff9c89 0%,rgba(255,156,137,.8) 10%,transparent 30%)}
}
@media(max-width:1100px){
 .code-hero{display:flex;flex-direction:column;min-height:0;padding:35px 0 0}
 .code-hero-copy{order:1;width:69%;margin-left:6%}
 .code-hero h1{margin:18px 0}
 .code-header-photo{order:2;position:relative;inset:auto;width:100%;height:clamp(350px,55vw,600px);margin-top:18px}
 .code-header-photo>img{object-position:16% center}
 .code-header-photo:after{background:linear-gradient(180deg,#161616 0%,rgba(22,22,22,.6) 8%,transparent 24%)}
 html[data-edition=light] .code-header-photo:after{background:linear-gradient(180deg,#ff9c89 0%,rgba(255,156,137,.6) 8%,transparent 24%)}
}

.code-title-prefix{display:block;font-size:clamp(30px,3.2vw,44px);line-height:1.1;letter-spacing:.03em;text-transform:uppercase;font-weight:500;margin-bottom:12px}
.code-hero h1 img{width:min(100%,420px)}
.code-hero .code-lead{font-size:clamp(22px,2vw,28px);line-height:1.35}
@media(max-width:1100px){
 .code-hero-copy{width:88%}
 .code-hero h1{width:min(72%,420px);margin:18px 0 24px}
 .code-title-prefix{font-size:26px;margin-bottom:8px}
 .code-hero-copy>p.code-lead{font-size:22px;line-height:1.35}
 .code-hero-copy>p:not(.eyebrow):not(.code-lead){font-size:18px;line-height:1.4}
 .code-pennant{height:190px}
}

@media(min-width:761px) and (max-width:1100px){.code-pennant{height:230px;width:19%;right:4%}}

.practice p{margin-top:0}

/* The Pirates' own statements lead; the philosophical voices stay secondary. */
.principle-compass{font-weight:500;letter-spacing:-.015em}
.principle-voice{margin:28px 0 0;padding-top:20px;border-top:1px solid #16161635}
.principle-voice blockquote{margin:0}
.principle-voice blockquote p{font-size:18px;line-height:1.5;margin:0}
.principle-voice figcaption{margin-top:10px;font-size:13px;line-height:1.5}
.principle-voice figcaption a{text-decoration:underline;text-underline-offset:3px}
.principle-voice cite{display:block;font-style:normal;color:#555;font-size:12px}
@media(max-width:760px){.principle-voice{margin-top:24px;padding-top:18px}.principle-voice blockquote p{font-size:17px}.principle-compass{font-size:23px}}

/* Original page-specific artwork, with strong contrast at the transition. */
.code-visitor{filter:brightness(0)}

/* Brand pink keeps the original birds visible against the photograph. */
.code-visitor{filter:url(#code-birds-pink)}

@media (max-width: 760px) {
  body.code-page .code-opening .code-love-heart { display: none; }
}

/* A compact chapter index between the opening and the Code. */
.principle-index {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  box-sizing: border-box;
  width: 100%;
  column-gap: 1rem;
  padding: .2rem 5%;
  background: var(--pink);
  font-size: 1rem;
  line-height: 1.2;
}
.principle-index a {
  display: flex;
  align-items: baseline;
  align-self: stretch;
  gap: .5em;
  padding-block: .7rem;
}
.principle-index span {
  font-family: "Space Mono", monospace;
  font-size: .75rem;
  color: var(--ink);
}
.principle-index a:hover, .principle-index a:focus-visible {
  text-decoration: underline;
  text-underline-offset: .2em;
}
@media (min-width: 42rem) {
  .principle-index { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 75rem) {
  .principle-index {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0 1.25rem;
  }
}

.code-aboard .code-aboard-whale {
  display: block;
  width: clamp(96px, 13vw, 180px);
  max-width: 100%;
  height: auto;
  margin: 1.25rem 0 0;
  pointer-events: none;
}

.code-paths .path-intro { margin: 0 0 1.4rem; }

/* Numbered headings above each principle title. */
.code-page .principle-name > .eyebrow { font-size: 15px; }

/* The prompts answer the alternating chapter colours; the questions lead. */
body.code-page main #love .practice .eyebrow,
body.code-page main #pattern .practice .eyebrow { color: var(--white); }
body.code-page main :is(#show-up, #miracles, #humble) .practice .eyebrow { color: var(--pink); }
body.code-page main .practice p { font-weight: 600; }
body.code-page main .principle-voice cite { color: var(--ink); }

body.code-page main .code-aboard {
  --action-rest: var(--ink);
  --action-rest-ink: var(--white);
  --action-over: var(--pink);
  --action-over-ink: var(--ink);
}
body.code-page main .code-aboard-action { margin-top: 24px; }

/* A clear bridge from the principles to the places they are practised. */
body.code-page main .code-practice-intro { align-items: start; column-gap: clamp(28px, 5vw, 90px); }
body.code-page main .code-practice-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(80px, 8vw, 116px);
  gap: 20px;
  align-items: start;
}
body.code-page main .code-practice-summary > p { margin: 0; }
body.code-page main .code-practice-summary .code-aboard-whale { width: 100%; margin: 0; }
body.code-page main .code-aboard > .eyebrow { margin-bottom: 24px; }
body.code-page main .code-practice-places {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(28px, 5vw, 90px);
  margin-top: 32px;
}
body.code-page main .code-practice-places article { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; border-top: 1px solid #16161655; padding-top: 20px; }
body.code-page main .code-practice-places .eyebrow { color: var(--pink); font-size: 15px; }
body.code-page main .code-practice-places h3 { font-size: clamp(29px, 3vw, 42px); line-height: 1.1; letter-spacing: -.03em; margin: 14px 0 16px; }
body.code-page main .code-practice-places p { max-width: 550px; margin: 0 0 24px; }
body.code-page main .code-practice-places .major-action { margin-top: auto; }
body.code-page main .code-belonging .major-action { margin-top: 24px; }
body.code-page main .code-next p { max-width: 660px; }
@media (max-width: 760px) {
  body.code-page main .code-practice-intro { gap: 22px; }
  body.code-page main .code-practice-places { grid-template-columns: minmax(0, 1fr); gap: 34px; margin-top: 28px; }
  body.code-page main .code-practice-places .eyebrow { font-size: 13px; }
}

/* Each developing path invites the people who can help make it. */

/* Keep the line-handling crew clear of the hero copy. */
@media (min-width: 761px) and (max-width: 1200px), (min-width: 761px) and (max-width: 1400px) and (pointer: coarse) {
  body.code-page main section.menu-hero-code[data-screen-hero] > .menu-hero-photo > img {
    transform: translateX(clamp(112px, 18vw, 205px));
    mask-image: linear-gradient(to right, transparent, #000 148px);
  }
}
@media (max-width: 760px) and (max-aspect-ratio: 3 / 4) {
  body.code-page main section.menu-hero-code[data-screen-hero] { --hero-focus: 43% 50%; }
  body.code-page main section.menu-hero-code[data-screen-hero] > .menu-hero-photo > img {
    transform: translateY(clamp(70px, 18svh, 125px));
    mask-image: linear-gradient(to bottom, transparent, #000 118px);
  }
}

/* Align every desktop reading column with the opening and section navigation. */
@media (min-width: 1101px) {
  body.code-page main :is(.code-opening, .principle, .code-aboard, .code-paths, .code-belonging, .code-next, .principle-index) { padding-inline: var(--pad); }
  body.code-page main :is(.code-opening, .principle-layout, .code-two-col, .code-practice-places, .code-belonging, .principle-index) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 5vw;
  }
  body.code-page main .code-opening > .opening-reading,
  body.code-page main .code-practice-places p { max-width: none; }
}

/* Keep each chapter number beside the first line; wrap under the title. */
body.code-page main #code-overview > a.site-jump {
  display: grid;
  grid-template-columns: 2ch minmax(0, 1fr) auto;
  grid-template-rows: auto;
  column-gap: 10px;
  align-items: baseline;
  text-wrap: wrap;
}
body.code-page main #code-overview .principle-index-number {
  grid-area: 1 / 1;
  white-space: nowrap;
}
body.code-page main #code-overview .principle-index-title {
  grid-area: 1 / 2;
  min-width: 0;
  font: inherit;
}
body.code-page main #code-overview > a.site-jump::after {
  grid-area: 1 / 3;
  margin: 0;
  padding: 0;
}

body.code-page main .code-paths .path-development { border-top: 1px solid #ffffff55; margin-top: 28px; padding-top: 20px; }

/* Read down the first column, then down the second, on every screen. */
html body.code-page main #code-overview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(3, auto);
  grid-auto-flow: column;
  column-gap: clamp(14px, 4vw, 64px);
  row-gap: 0;
  align-items: stretch;
  justify-content: normal;
}
