/* ==========================================================================
   Inner pages — careers, roles, team, contact, writing and legal pages.
   Builds on css/core/system.css and follows the homepage: the landscape hero,
   sans headings with a quieter second clause, serif leads, white cards on
   paper, square buttons and the shared footer.
   ========================================================================== */

.ds {
  --pg-line: #E2DACD;
  --pg-line-2: #D6C8B3;
  --pg-brown: #5B4130;
  --pg-cream: #F7EFE2;
  --pg-cream-2: #E3D4BF;
  --pg-cream-3: #B9AE9F;
}

/* Short pages keep the footer at the bottom of the window */
.ds.page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.ds.page main {
  flex: 1;
}

/* ---------- Page hero: the homepage landscape, shorter ---------- */

.hero--page {
  min-height: 0;
}

.hero--page .hero-shade {
  background:
    linear-gradient(90deg, rgba(19, 18, 15, 0.9) 0%, rgba(19, 18, 15, 0.7) 40%, rgba(19, 18, 15, 0.22) 78%, rgba(19, 18, 15, 0.3) 100%),
    linear-gradient(180deg, rgba(19, 18, 15, 0.55) 0%, rgba(19, 18, 15, 0) 26%, rgba(19, 18, 15, 0) 62%, rgba(19, 18, 15, 0.8) 100%);
}

.hero--page .hero-inner {
  padding-top: 196px;
  padding-bottom: 128px;
}

.hero--page .hero-title {
  max-width: 17ch;
}

.hero--page .hero-actions {
  align-items: center;
  gap: 14px 28px;
  margin-top: 40px;
}

/* Centred page hero: careers, team and writing */
.hero--center .hero-shade {
  background:
    radial-gradient(ellipse at 50% 55%, rgba(19, 18, 15, 0.55) 0%, rgba(19, 18, 15, 0.78) 70%),
    linear-gradient(180deg, rgba(19, 18, 15, 0.5) 0%, rgba(19, 18, 15, 0) 30%, rgba(19, 18, 15, 0) 65%, rgba(19, 18, 15, 0.8) 100%);
}

.hero--center .hero-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 980px;
  margin: 0 auto;
  text-align: center;
}

.hero--center .hero-title {
  max-width: 20ch;
}

.hero--center .hero-lead {
  max-width: 40ch;
}

.hero--center .hero-actions {
  justify-content: center;
}

.hero-link {
  padding-bottom: 3px;
  border-bottom: 1px solid rgba(247, 239, 226, 0.35);
  font-size: 16px;
  font-weight: 500;
  color: var(--pg-cream);
  transition: border-color 0.25s;
}

.hero-link:hover {
  border-color: var(--pg-cream);
}

/* Hero with a panel beside the copy (contact) */
.hero--split .hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  align-items: center;
  gap: 72px;
  padding-bottom: 112px;
}

/* ---------- Document header: light, for roles, articles and legal pages ---------- */

.doc-head {
  padding: 168px 0 64px;
  border-bottom: 1px solid var(--pg-line);
  background: var(--paper-2);
}

.doc-title {
  max-width: 20ch;
  margin: 0;
  font-family: var(--sans);
  font-size: clamp(40px, 4.6vw, 64px);
  font-weight: 500;
  line-height: 1.04;
  letter-spacing: -0.04em;
  text-wrap: balance;
}

.doc-title span {
  color: var(--ink-3);
}

.doc-lead {
  max-width: 560px;
  margin: 22px 0 0;
  font-family: var(--serif);
  font-size: 21px;
  line-height: 1.45;
  color: var(--ink-2);
}

.doc-meta {
  margin: 22px 0 0;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--ink-3);
}

/* 404: the header fills the window and offers ways back in */
.doc-head--404 {
  display: flex;
  align-items: center;
  min-height: calc(100vh - 220px);
  border-bottom: 0;
}

.doc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 36px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 36px;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink-2);
  transition: color 0.2s;
}

.back-link:hover {
  color: var(--ink);
}

.back-link svg {
  transition: translate 0.25s var(--ease);
}

.back-link:hover svg {
  translate: -3px 0;
}

/* ---------- Sections ---------- */

.pg {
  padding: 128px 0;
  background: var(--paper);
}

.pg--tint {
  background: var(--paper-2);
}

.pg-head {
  display: grid;
  grid-template-columns: 1.9fr 1fr;
  align-items: end;
  gap: 56px;
  margin-bottom: 56px;
}

.pg-title {
  margin: 0;
  font-family: var(--sans);
  font-size: clamp(36px, 4.1vw, 56px);
  font-weight: 500;
  line-height: 1.04;
  letter-spacing: -0.04em;
  text-wrap: balance;
}

.pg-title span {
  color: var(--ink-3);
}

.pg-lead {
  max-width: 420px;
  margin: 0;
  font-family: var(--serif);
  font-size: 21px;
  line-height: 1.45;
  color: var(--ink-2);
}

.pg-lead + .pg-lead {
  margin-top: 16px;
}

/* ---------- Cards ---------- */

.pg-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.pg-card {
  position: relative;
  padding: 28px;
  border: 1px solid var(--pg-line);
  border-radius: 24px;
  background: var(--white);
  transition: border-color 0.3s, box-shadow 0.3s;
}

a.pg-card:hover,
.pg-card--lift:hover {
  border-color: var(--pg-line-2);
  box-shadow: 0 24px 40px -28px rgba(53, 38, 27, 0.4);
}

.pg-badge {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: 22px;
  border-radius: 16px;
  background: var(--pg-brown);
  font-size: 20px;
  font-weight: 500;
  color: var(--pg-cream);
}

.pg-card h3 {
  margin: 0 0 10px;
  font-family: var(--sans);
  font-size: 24px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

.pg-card p {
  margin: 0;
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink-2);
}

.pg-card .pg-more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 22px;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
}

/* ---------- Photos ---------- */

.pg-photos {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.pg-photo {
  overflow: hidden;
  margin: 0;
  border-radius: 24px;
  background: var(--paper-2);
}

.pg-photo img {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.pg-photo--wide {
  grid-column: 1 / -1;
}

.pg-photo--wide img {
  aspect-ratio: 21 / 9;
}

/* ---------- Empty and status states ---------- */

.pg-empty {
  padding: 48px 32px;
  border: 1px dashed var(--pg-line-2);
  border-radius: 24px;
  text-align: center;
}

.pg-empty h3,
.pg-empty-title {
  margin: 0 0 8px;
  font-family: var(--sans);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.pg-empty p {
  max-width: 460px;
  margin: 0 auto;
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink-2);
}

.pg-empty a,
.prose a,
.pg-note a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--pg-line-2);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.2s;
}

.pg-empty a:hover,
.prose a:hover,
.pg-note a:hover {
  text-decoration-color: var(--ink);
}

/* ---------- Tags ---------- */

.pg-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pg-tag {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border: 1px solid var(--pg-line);
  border-radius: 999px;
  background: var(--paper);
  font-size: 14px;
  line-height: 1.3;
  color: var(--ink-2);
}

/* ---------- Form fields ---------- */

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field-label {
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
}

.field-label .opt {
  font-weight: 400;
  color: var(--ink-3);
}

.field-label .req {
  color: var(--bronze);
}

.field-input {
  width: 100%;
  min-height: 52px;
  padding: 13px 16px;
  border: 1px solid var(--line-2);
  border-radius: 2px;
  background: var(--white);
  font: inherit;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field-input::placeholder {
  color: #9A9388;
}

.field-input:hover {
  border-color: var(--ink-3);
}

.field-input:focus {
  border-color: var(--ink);
  outline: none;
  box-shadow: 0 0 0 3px rgba(142, 82, 32, 0.18);
}

textarea.field-input {
  min-height: 150px;
  resize: vertical;
}

select.field-input {
  appearance: none;
  padding-right: 44px;
  background: var(--white) no-repeat right 16px center / 14px 14px
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234F4B43' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
}

.field-hint {
  font-size: 14px;
  color: var(--ink-3);
}

.field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.form-error {
  margin: 0;
  padding: 14px 16px;
  border-left: 3px solid var(--signal);
  background: #FBEEE3;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
}

.form-error[hidden] {
  display: none;
}

/* ---------- Prose: legal pages, articles and role descriptions ---------- */

.prose {
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink-2);
}

.prose > :first-child {
  margin-top: 0;
}

.prose h2 {
  margin: 56px 0 16px;
  font-family: var(--sans);
  font-size: 26px;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.025em;
  color: var(--ink);
  scroll-margin-top: 112px;
}

.prose h3,
.prose h4 {
  margin: 36px 0 12px;
  font-family: var(--sans);
  font-size: 19px;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: -0.015em;
  color: var(--ink);
}

.prose p {
  margin: 0 0 18px;
}

.prose ul,
.prose ol {
  margin: 0 0 22px;
  padding-left: 22px;
}

.prose li {
  margin-bottom: 10px;
  padding-left: 4px;
}

.prose li::marker {
  color: var(--bronze);
}

.prose strong,
.prose b {
  font-weight: 500;
  color: var(--ink);
}

.prose img {
  max-width: 100%;
  height: auto;
  border-radius: 16px;
}

.prose blockquote {
  margin: 28px 0;
  padding: 4px 0 4px 24px;
  border-left: 2px solid var(--signal);
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1.45;
  color: var(--ink);
}

.prose hr {
  height: 1px;
  margin: 48px 0 0;
  border: 0;
  background: var(--pg-line);
}

.prose code {
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--paper-2);
  font-family: var(--mono);
  font-size: 0.88em;
}

.prose pre {
  overflow-x: auto;
  margin: 0 0 22px;
  padding: 20px;
  border-radius: 16px;
  background: var(--night);
  color: var(--on-night);
}

.prose pre code {
  padding: 0;
  background: none;
  color: inherit;
}

/* ---------- Legal: contents beside the text ---------- */

.legal {
  display: grid;
  grid-template-columns: 260px minmax(0, 760px);
  gap: 96px;
}

.legal-toc {
  position: sticky;
  top: 112px;
  align-self: start;
}

.legal-toc h2 {
  margin: 0 0 16px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.legal-toc ol {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.legal-toc a {
  display: block;
  padding: 7px 0 7px 14px;
  border-left: 1px solid var(--pg-line);
  font-size: 15px;
  line-height: 1.4;
  color: var(--ink-2);
  transition: color 0.2s, border-color 0.2s;
}

.legal-toc a:hover,
.legal-toc a[aria-current="true"] {
  border-color: var(--ink);
  color: var(--ink);
}

/* ---------- Closing links: two routes onwards ---------- */

.pg-routes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.pg-route {
  display: flex;
  flex-direction: column;
  min-height: 240px;
  padding: 32px;
  border-radius: 28px;
  background: var(--white);
  border: 1px solid var(--pg-line);
  transition: border-color 0.3s, box-shadow 0.3s;
}

.pg-route:hover {
  border-color: var(--pg-line-2);
  box-shadow: 0 24px 40px -28px rgba(53, 38, 27, 0.4);
}

.pg-route--dark {
  border-color: var(--pg-brown);
  background: var(--pg-brown);
  color: var(--pg-cream);
}

.pg-route--dark:hover {
  border-color: var(--pg-brown);
}

.pg-route h3 {
  margin: 0 0 10px;
  font-family: var(--sans);
  font-size: 28px;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.pg-route p {
  max-width: 420px;
  margin: 0;
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink-2);
}

.pg-route--dark p {
  color: var(--pg-cream-2);
}

.pg-route .pg-more {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding-top: 32px;
  font-size: 16px;
  font-weight: 500;
}

.pg-route .pg-more svg {
  transition: translate 0.25s var(--ease);
}

.pg-route:hover .pg-more svg {
  translate: 2px -2px;
}

/* ==========================================================================
   Careers — open roles (rendered by js/pages/careers/careers.js)
   ========================================================================== */

.job-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.job-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  padding: 24px 28px;
  border: 1px solid var(--pg-line);
  border-radius: 20px;
  background: var(--white);
  color: var(--ink);
  transition: border-color 0.3s, box-shadow 0.3s;
}

.job-card:hover {
  border-color: var(--pg-line-2);
  box-shadow: 0 24px 40px -28px rgba(53, 38, 27, 0.4);
}

.job-card-title {
  font-size: 22px;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.job-card-tags,
.job-page-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.job-page-tags {
  margin-top: 24px;
}

.job-tag,
.job-detail-tag {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border: 1px solid var(--pg-line);
  border-radius: 999px;
  background: var(--paper);
  font-size: 14px;
  line-height: 1.3;
  color: var(--ink-2);
}

.job-tag-posted,
.job-detail-tag-posted {
  border-color: transparent;
  background: none;
  color: var(--ink-3);
}

.job-details-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
}

.job-details-btn::after {
  content: "";
  width: 14px;
  height: 14px;
  background: currentColor;
  -webkit-mask: var(--arrow) center / contain no-repeat;
  mask: var(--arrow) center / contain no-repeat;
  transition: translate 0.25s var(--ease);
}

.job-card:hover .job-details-btn::after {
  translate: 3px 0;
}

.careers-empty {
  padding: 48px 32px;
  border: 1px dashed var(--pg-line-2);
  border-radius: 24px;
  text-align: center;
}

.careers-empty-icon {
  display: none;
}

.careers-empty-title {
  margin-bottom: 8px;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.careers-empty-text {
  max-width: 460px;
  margin: 0 auto;
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink-2);
}

.careers-empty-text a,
.pg-lead a,
.doc-lead a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--pg-line-2);
  text-underline-offset: 3px;
}

/* ==========================================================================
   Role page (js/pages/careers/job.js and apply.js)
   ========================================================================== */

.job-head-actions {
  margin-top: 32px;
}

.job-body {
  max-width: 760px;
}

.jd-list {
  margin: 0 0 22px;
  padding-left: 22px;
}

.job-apply {
  max-width: 760px;
  margin-top: 72px;
  padding: 40px;
  border: 1px solid var(--pg-line);
  border-radius: 28px;
  background: var(--white);
  scroll-margin-top: 96px;
}

.job-apply-heading {
  margin: 0 0 6px;
  font-family: var(--sans);
  font-size: 30px;
  font-weight: 500;
  letter-spacing: -0.03em;
}

.job-apply-note {
  margin: 0 0 32px;
  font-size: 15px;
  color: var(--ink-3);
}

.job-apply-note .req,
.apply-form .req {
  color: var(--bronze);
}

.apply-form {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

/* File picker: the input stays focusable, the label is the visible target */
.apply-form-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.apply-form-file {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 14px 18px;
  border: 1px dashed var(--line-2);
  border-radius: 2px;
  background: var(--paper);
  font-size: 15px;
  color: var(--ink-2);
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s;
}

.apply-form-file:hover,
.apply-form-file-input:focus-visible + .apply-form-file {
  border-color: var(--ink);
  background: var(--white);
}

.apply-form-file-input:focus-visible + .apply-form-file {
  box-shadow: 0 0 0 3px rgba(142, 82, 32, 0.18);
}

.apply-form-file.has-file {
  border-style: solid;
  border-color: var(--ink);
  color: var(--ink);
}

.apply-form-file-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--paper-2);
}

.apply-form-feedback {
  display: none;
  margin: 0;
  padding: 14px 16px;
  border-left: 3px solid var(--signal);
  background: #FBEEE3;
  font-size: 15px;
  color: var(--ink);
}

.apply-success {
  display: none;
}

.apply-success-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin-bottom: 20px;
  border-radius: 16px;
  background: #E3ECE1;
  color: #4F6B52;
}

.apply-success-title {
  margin: 0 0 10px;
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.03em;
}

.apply-success-text,
.apply-success-sub {
  margin: 0 0 12px;
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink-2);
}

.apply-success-sub a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.apply-success .btn {
  margin-top: 16px;
}

/* ==========================================================================
   Team (cards rendered by the script on team.html)
   ========================================================================== */

.team-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}

.team-card {
  overflow: hidden;
  padding-bottom: 24px;
  border: 1px solid var(--pg-line);
  border-radius: 24px;
  background: var(--white);
}

.team-card-photo {
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 5;
  background: var(--paper-2);
  color: var(--ink-3);
}

.team-card-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.team-card-name {
  margin: 20px 24px 0;
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.team-card-role {
  margin: 4px 24px 0;
  font-size: 15px;
  color: var(--ink-3);
}

.team-card-desc {
  margin: 14px 24px 0;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink-2);
}

/* ==========================================================================
   Contact — the form beside the hero copy
   ========================================================================== */

.hero--split .hero-title {
  font-size: clamp(40px, 4.4vw, 64px);
}

.contact-points {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 36px 0 0;
  padding: 0;
  list-style: none;
}

.contact-points li {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 17px;
  color: var(--pg-cream-2);
}

.contact-points svg {
  flex: 0 0 auto;
  color: var(--tan);
}

.contact-points a {
  color: var(--pg-cream);
  text-decoration: underline;
  text-decoration-color: rgba(247, 239, 226, 0.35);
  text-underline-offset: 4px;
}

.contact-points a:hover {
  text-decoration-color: var(--pg-cream);
}

.contact-card {
  padding: 36px;
  border-radius: 28px;
  background: var(--pg-cream);
  box-shadow: 0 40px 80px -40px rgba(0, 0, 0, 0.8);
  color: var(--ink);
}

.ds .contact-card :focus-visible {
  outline-color: var(--bronze);
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.contact-form .btn {
  align-self: flex-start;
}

.contact-success {
  padding: 12px 0;
}

.contact-success[hidden] {
  display: none;
}

.contact-success h2 {
  margin: 0 0 10px;
  font-size: 30px;
  font-weight: 500;
  letter-spacing: -0.03em;
}

.contact-success p {
  margin: 0 0 24px;
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink-2);
}

.btn--outline {
  border-color: var(--line-2);
  color: var(--ink);
}

.btn--outline:hover {
  border-color: var(--ink);
}

/* ==========================================================================
   Writing — topic filters and the article view (js/components/blog.js)
   ========================================================================== */

.blog-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 48px;
}

.blog-filter-btn {
  height: 42px;
  padding: 0 18px;
  border: 1px solid var(--line-2);
  border-radius: 2px;
  background: transparent;
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink-2);
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}

.blog-filter-btn:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.blog-filter-btn.active {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

/* ---------- Article view (writing.html?id=) ---------- */

/* The head script on writing.html sets html.is-article for ?id= before
   first paint, so the listing never flashes in first */
.is-article #blogListingView,
html:not(.is-article) #blogDetailView {
  display: none;
}

#blogDetailView [hidden] {
  display: none;
}

.post {
  /* How far the cover rises into the dark header */
  --post-overlap: clamp(64px, 9vw, 152px);
}

/* Header: the landscape hero, with the copy at the top */
.post .post-hero .hero-inner {
  justify-content: flex-start;
  padding-top: 168px;
  padding-bottom: 112px;
}

.post.has-cover .post-hero .hero-inner {
  padding-bottom: calc(96px + var(--post-overlap));
}

/* While the post loads the header holds the first screen, so the footer
   does not flash up and then jump away */
.post[aria-busy="true"] .post-hero {
  min-height: 100vh;
  min-height: 100svh;
}

.post-back {
  align-self: flex-start;
  margin-bottom: 44px;
  color: var(--pg-cream-2);
}

.post-back:hover {
  color: var(--pg-cream);
}

.post-kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin: 0 0 22px;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--on-night-2);
}

.post-kicker > * + *::before {
  content: '\00B7';
  margin: 0 10px;
  color: var(--pg-cream-3);
}

.post-kicker-cat {
  color: var(--tan);
}

.post-hero .post-title {
  max-width: 22ch;
  font-size: clamp(34px, 4.2vw, 60px);
  font-weight: 600;
  line-height: 1.06;
  letter-spacing: -0.03em;
  overflow-wrap: break-word;
}

.post-hero .post-dek {
  max-width: 640px;
  margin-top: 26px;
  font-size: clamp(19px, 1.5vw, 22px);
}

/* Cover: a wide frame that overlaps the header onto the paper. The fixed
   ratio keeps the page still while the image loads. */
.post-cover {
  position: relative;
  z-index: 1;
  margin-top: calc(-1 * var(--post-overlap));
}

.post-cover-frame {
  overflow: hidden;
  width: 100%;
  max-width: 1180px; /* contents + gap + text column, so the edges line up */
  max-height: 620px;
  aspect-ratio: 2 / 1;
  border-radius: 24px;
  background: var(--night-3);
  box-shadow: 0 48px 80px -48px rgba(19, 18, 15, 0.55);
}

.post-cover-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Body: contents beside the article */
.post-body {
  display: grid;
  grid-template-columns: 240px minmax(0, 860px);
  gap: 80px;
  padding-top: 88px;
  padding-bottom: 128px;
}

.post-aside {
  position: sticky;
  top: 112px;
  align-self: start;
  max-height: calc(100vh - 136px);
  margin: -4px;
  padding: 4px; /* room for focus rings inside the scroll box */
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.post-aside .legal-toc {
  position: static;
}

.post-share {
  margin-top: 32px;
  padding-top: 28px;
  border-top: 1px solid var(--pg-line);
}

.post-toc[hidden] + .post-share {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.post-copy {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line-2);
  border-radius: 2px;
  background: transparent;
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s;
}

.post-copy:hover {
  border-color: var(--ink);
  background: var(--white);
}

.post-copy svg {
  flex: 0 0 auto;
}

.post-copy-done,
.post-copy.is-done .post-copy-icon {
  display: none;
}

.post-copy.is-done .post-copy-done {
  display: block;
  color: var(--bronze);
}

/* ---------- Article text ---------- */

.post-prose {
  font-size: 18px;
  line-height: 1.75;
  overflow-wrap: break-word;
}

.post-prose [id] {
  scroll-margin-top: 24px; /* on top of the page's 96px scroll padding */
}

.post-prose h2 {
  margin: 64px 0 18px;
  font-size: clamp(24px, 2.2vw, 30px);
  line-height: 1.2;
  letter-spacing: -0.03em;
}

.post-prose h3 {
  margin: 40px 0 12px;
  font-size: 21px;
  letter-spacing: -0.02em;
}

.post-prose p {
  margin-bottom: 22px;
}

.post-prose ul,
.post-prose ol {
  margin-bottom: 26px;
}

.post-prose li {
  margin-bottom: 8px;
}

.post-prose .post-lede {
  margin-bottom: 32px;
  font-family: var(--serif);
  font-size: clamp(20px, 1.6vw, 22px);
  line-height: 1.55;
  color: var(--ink);
}

/* Quill alignment and nested-list classes that survive the clean-up */
.post-prose .ql-align-center { text-align: center; }
.post-prose .ql-align-right { text-align: right; }
.post-prose .ql-indent-1 { margin-left: 1.5em; }
.post-prose .ql-indent-2 { margin-left: 3em; }
.post-prose .ql-indent-3 { margin-left: 4.5em; }

.post-prose iframe {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: 16px;
}

/* Citations: [n] as small bronze superscripts (.ref in system.css) */
.post-prose .ref {
  margin-left: 1px;
  white-space: nowrap;
}

.post-prose .ref a {
  text-decoration: none;
}

.post-prose .ref a:is(:target, .is-target) {
  border-radius: 2px;
  background: rgba(226, 194, 154, 0.45);
}

/* A short label above a list becomes the list's panel */
.post-panel {
  margin: 32px 0;
  padding: 22px 28px 6px;
  border: 1px solid var(--pg-line);
  border-radius: 20px;
  background: var(--white);
}

.post-prose .post-panel-title {
  margin: 0;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--pg-line);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.post-prose .post-panel ul,
.post-prose .post-panel ol {
  margin: 16px 0;
  font-size: 16px;
  line-height: 1.6;
}

/* A long quote reads as a note: a tinted callout */
.post-prose .post-callout {
  margin: 40px 0;
  padding: 28px 32px;
  border: 0;
  border-radius: 20px;
  background: var(--paper-2);
  font-size: 20px;
  line-height: 1.55;
}

.post-callout-label {
  display: block;
  margin-bottom: 10px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bronze);
}

.post-prose .blog-figure {
  margin: 36px 0;
}

.post-prose figcaption {
  margin-top: 12px;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-3);
}

.post-prose pre {
  font-size: 14px;
  line-height: 1.6;
}

/* Code colours for highlight.js, in the site palette */
.post-prose .hljs-keyword,
.post-prose .hljs-built_in,
.post-prose .hljs-selector-tag { color: var(--tan); }
.post-prose .hljs-string,
.post-prose .hljs-attr { color: var(--sage-light); }
.post-prose .hljs-number,
.post-prose .hljs-literal { color: var(--ember); }
.post-prose .hljs-comment { color: var(--on-night-2); font-style: italic; }

/* Sources: quieter, smaller text under a hairline */
.post-sources {
  margin-top: 72px;
  border-top: 1px solid var(--pg-line);
}

.post-prose .post-sources h2 {
  margin: 32px 0 20px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.post-prose .post-sources-list {
  margin: 0;
  padding-left: 24px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-3);
}

.post-sources > .post-sources-list:first-child {
  margin-top: 32px;
}

.post-prose .post-sources-list li {
  margin-bottom: 12px;
  padding-left: 6px;
  border-radius: 2px;
  transition: background-color 0.4s, box-shadow 0.4s;
}

.post-prose .post-sources-list li::marker {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink-3);
}

.post-prose .post-sources-list li:is(:target, .is-target) {
  background: rgba(226, 194, 154, 0.32);
  box-shadow: 0 0 0 6px rgba(226, 194, 154, 0.32);
}

.post-prose .post-sources-list a {
  color: var(--ink-2);
}

.post-prose .post-sources-list a[target="_blank"]::after {
  content: '\2197';
  display: inline-block;
  margin-left: 3px;
  font-size: 0.9em;
  color: var(--ink-3);
}

.post-prose .source-back {
  margin-right: 8px;
  font-family: var(--mono);
  color: var(--bronze);
  text-decoration: none;
}

/* ---------- Closing: call to action and more writing ---------- */

.post-cta {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  align-items: end;
  gap: 32px 64px;
  padding: 56px;
  border-radius: 28px;
  background: var(--pg-brown);
  color: var(--pg-cream);
}

.ds .post-cta :focus-visible {
  outline-color: var(--tan);
}

.post-cta-title {
  max-width: 16ch;
  margin: 0;
  font-family: var(--sans);
  font-size: clamp(30px, 3.4vw, 48px);
  font-weight: 500;
  line-height: 1.06;
  letter-spacing: -0.04em;
  text-wrap: balance;
}

.post-cta-title span {
  color: var(--pg-cream-3);
}

.post-cta-copy p {
  max-width: 400px;
  margin: 0 0 28px;
  font-size: 17px;
  line-height: 1.55;
  color: var(--pg-cream-2);
}

.post-more {
  margin-top: 112px;
}

.post-more .pg-head {
  margin-bottom: 48px;
}

.post-more-all {
  justify-self: end;
}

/* Card image boxes would vanish into the tinted section */
.post-more .insights-grid .blog-card-image {
  background: var(--paper);
}

@media (max-width: 1200px) {
  .team-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .team-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .job-card {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 22px;
  }

  .job-apply,
  .contact-card {
    padding: 24px;
  }
}

@media (max-width: 480px) {
  .team-grid {
    grid-template-columns: 1fr;
  }
}

.contact-form[hidden] {
  display: none;
}

.team-grid > .pg-empty,
.team-grid > .doc-meta {
  grid-column: 1 / -1;
}

/* ---------- Responsive ---------- */

@media (max-width: 1024px) {
  .hero--split .hero-inner {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .pg-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .legal {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .legal-toc {
    position: static;
  }
}

@media (max-width: 700px) {
  .hero--page .hero-inner {
    padding-top: 136px;
    padding-bottom: 88px;
  }

  .doc-head {
    padding: 128px 0 48px;
  }

  .pg {
    padding: 88px 0;
  }

  .pg-head {
    grid-template-columns: 1fr;
    gap: 18px;
    margin-bottom: 36px;
  }

  .pg-cards,
  .pg-photos,
  .pg-routes,
  .field-row {
    grid-template-columns: 1fr;
  }

  .pg-card,
  .pg-route {
    padding: 22px;
  }

  .pg-photo--wide img {
    aspect-ratio: 4 / 3;
  }
}

/* Article view */
@media (max-width: 1024px) and (min-width: 601px) {
  .post-more .insights-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1024px) {
  .post-body {
    grid-template-columns: minmax(0, 860px);
    gap: 40px;
    padding-top: 64px;
  }

  /* Contents and sharing sit above the text as one card */
  .post-aside {
    position: static;
    max-height: none;
    margin: 0;
    padding: 24px;
    overflow: visible;
    border: 1px solid var(--pg-line);
    border-radius: 20px;
    background: var(--white);
  }

  .post-cta {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .post .post-hero .hero-inner {
    padding-top: 120px;
    padding-bottom: 72px;
  }

  .post.has-cover .post-hero .hero-inner {
    padding-bottom: calc(64px + var(--post-overlap));
  }

  .post-back {
    margin-bottom: 32px;
  }

  .post-kicker {
    font-size: 12px;
  }

  .post .post-hero .hero-actions {
    align-items: stretch;
  }

  .post-kicker > * + *::before {
    margin: 0 8px;
  }

  .post-cover-frame {
    aspect-ratio: 16 / 10;
    border-radius: 16px;
  }

  .post-body {
    padding-top: 48px;
    padding-bottom: 88px;
  }

  .post-aside {
    padding: 20px;
  }

  .post-prose {
    font-size: 17px;
  }

  .post-prose h2 {
    margin-top: 52px;
  }

  .post-prose .post-lede {
    font-size: 20px;
  }

  .post-panel {
    padding: 18px 20px 2px;
    border-radius: 16px;
  }

  .post-prose .post-callout {
    padding: 22px;
    border-radius: 16px;
    font-size: 18px;
  }

  .post-cta {
    padding: 28px 24px;
    border-radius: 24px;
  }

  .post-cta .btn {
    width: 100%;
    height: auto;
    min-height: 54px;
    padding-top: 14px;
    padding-bottom: 14px;
    gap: 16px;
    white-space: normal;
  }

  .post-more {
    margin-top: 80px;
  }

  .post-more .pg-head {
    margin-bottom: 32px;
  }

  .post-more-all {
    justify-self: start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pg-card,
  .pg-route,
  .pg-route .pg-more svg,
  .back-link svg,
  .field-input,
  .hero-link,
  .post-copy,
  .post-prose .post-sources-list li {
    transition: none;
  }
}
