/* Cambrian writing. Tokens, type scale and grid mirror landing-page/src/index.css
   and components/Page.module.css so the two sites read as one. */

:root {
  --ink: #141417;
  --copper: #b87333;
  --text-1: #eeede9;
  --text-2: rgba(238, 237, 233, 0.66);
  --text-3: #85858b;
  --hairline: rgba(238, 237, 233, 0.14);

  --fs-display: clamp(2.5rem, 5vw, 3.75rem);
  --fs-lead: clamp(1.2rem, 1.9vw, 1.5rem);
  --fs-body: 1.0625rem;
  --fs-small: 0.875rem;
  --fs-label: 0.6875rem;

  /* Archivo unless a font is chosen in Ghost's design settings */
  --font: var(--gh-font-body, 'Archivo', -apple-system, BlinkMacSystemFont, sans-serif);
  --pad: clamp(24px, 5vw, 80px);
  --label-col: minmax(9rem, 1fr);
  --body-col: minmax(0, 3fr);
  --col-gap: clamp(2rem, 5vw, 5rem);
  --fast: 0.15s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  line-height: 1.6;
  color: var(--text-1);
  background: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection { background: var(--copper); color: var(--ink); }

a { color: inherit; text-decoration: none; }

/* The site's contour field, fixed and faded out on the left */
.contours {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.35;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, transparent 38%, #000 88%);
  mask-image: linear-gradient(90deg, transparent 0%, transparent 38%, #000 88%);
}

.page {
  position: relative;
  z-index: 1;
  max-width: 1400px;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0 auto;
  padding: clamp(1.5rem, 3vw, 2.25rem) var(--pad);
  display: flex;
  flex-direction: column;
}

/* Header */
.header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
}

.home { font-size: 0.9375rem; transition: opacity var(--fast); }
.home:hover { opacity: 0.75; }

.wordmark {
  display: inline-flex;
  flex-wrap: wrap;
  column-gap: 0.42em;
  font-stretch: 118%;
  letter-spacing: 0.05em;
  line-height: 1;
  color: var(--text-1);
}
.wordmark-word { white-space: nowrap; }
.wordmark-industries { font-weight: 380; color: var(--copper); }

.nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1.75rem; }
.nav-link { color: var(--text-3); transition: color var(--fast); }
.nav-link:hover { color: var(--copper); }

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-block: clamp(2.5rem, 9vh, 6rem);
}

/* Grid rows: labels left, content right, baselines aligned */
.row {
  display: grid;
  grid-template-columns: var(--label-col) var(--body-col);
  column-gap: var(--col-gap);
  align-items: baseline;
}
.row + .row { margin-top: clamp(1.5rem, 4vh, 2.5rem); }
.row-body { min-width: 0; max-width: 44rem; }

.ruled {
  margin-top: clamp(3rem, 8vh, 5rem) !important;
  padding-top: 1.5rem;
  border-top: 1px solid var(--hairline);
}

.footer { padding-top: 1.25rem; border-top: 1px solid var(--hairline); }

/* The five text styles */
.display {
  font-family: var(--gh-font-heading, var(--font));
  font-size: var(--fs-display);
  font-weight: 380;
  font-stretch: 108%;
  line-height: 1.04;
  letter-spacing: -0.022em;
  color: var(--text-1);
  text-wrap: balance;
}

.lead {
  margin-top: 1rem;
  font-size: var(--fs-lead);
  font-weight: 350;
  font-stretch: 108%;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--text-3);
}

.body { max-width: 36rem; font-size: var(--fs-body); line-height: 1.65; color: var(--text-2); }
.small { font-size: var(--fs-small); line-height: 1.5; color: var(--text-2); }

.label,
.nav-link {
  font-size: var(--fs-label);
  font-weight: 500;
  font-stretch: 118%;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.label { color: var(--text-3); }

/* Sign-in */
.signin { margin-top: 2rem; display: grid; gap: 1.5rem; max-width: 22rem; }
.field { display: grid; gap: 0.5rem; }
.input {
  font: inherit;
  font-size: var(--fs-body);
  color: var(--text-1);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--hairline);
  border-radius: 0;
  padding: 0.4rem 0;
  transition: border-color var(--fast);
}
.input:focus { outline: none; border-bottom-color: var(--copper); }
.input:-webkit-autofill {
  -webkit-text-fill-color: var(--text-1);
  box-shadow: 0 0 0 1000px var(--ink) inset;
  caret-color: var(--text-1);
}

.button {
  justify-self: start;
  padding: 0.7rem 1.1rem 0.65rem;
  font-family: inherit;
  color: var(--text-1);
  background: transparent;
  border: 1px solid var(--hairline);
  cursor: pointer;
  transition: color var(--fast), border-color var(--fast);
}
.button:hover { color: var(--copper); border-color: var(--copper); }
.button:focus-visible, .input:focus-visible, a:focus-visible { outline: 1px solid var(--copper); outline-offset: 3px; }

/* Ghost adds loading / success / error classes to the form */
.button-loading, .signin-success, .signin-error { display: none; }
.signin.loading .button-idle { display: none; }
.signin.loading .button-loading { display: inline; }
.signin.success .signin-success { display: block; color: var(--text-1); }
.signin.success .field, .signin.success .button { display: none; }
.signin.error .signin-error { display: block; color: var(--copper); }

/* Archive */
.archive { list-style: none; display: grid; }
.archive-item + .archive-item { border-top: 1px solid var(--hairline); }
.archive-link { display: grid; gap: 0.4rem; padding-block: 1.25rem; }
.archive-item:first-child .archive-link { padding-top: 0; }
.archive-title {
  font-size: var(--fs-lead);
  font-weight: 380;
  font-stretch: 108%;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--text-1);
  transition: color var(--fast);
}
.archive-link:hover .archive-title { color: var(--copper); }

.pagination { margin-top: 2rem; display: flex; gap: 1.5rem; font-size: var(--fs-small); color: var(--text-3); }
.pagination a:hover { color: var(--copper); }

.back-link { font-size: var(--fs-body); color: var(--text-1); border-bottom: 1px solid var(--hairline); }
.back-link:hover { border-bottom-color: var(--copper); }

.feature img { display: block; width: 100%; height: auto; }
.feature figcaption { margin-top: 0.6rem; color: var(--text-3); }

/* Long-form reading */
.prose { font-size: 1.125rem; line-height: 1.7; color: var(--text-2); }
.prose > * + * { margin-top: 1.25em; }
.prose h2, .prose h3, .prose h4 {
  margin-top: 2.2em;
  color: var(--text-1);
  font-weight: 450;
  font-stretch: 108%;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.prose h2 { font-size: 1.6rem; }
.prose h3 { font-size: 1.3rem; }
.prose h4 { font-size: 1.1rem; }
.prose h2 + *, .prose h3 + *, .prose h4 + * { margin-top: 0.75em; }
.prose strong { color: var(--text-1); font-weight: 600; }
.prose a { color: var(--text-1); border-bottom: 1px solid var(--copper); transition: color var(--fast); }
.prose a:hover { color: var(--copper); }
.prose ul, .prose ol { padding-left: 1.25em; }
.prose li + li { margin-top: 0.4em; }
.prose li::marker { color: var(--text-3); }
.prose blockquote {
  padding-left: 1.25rem;
  border-left: 1px solid var(--copper);
  color: var(--text-1);
  font-size: 1.25rem;
  line-height: 1.5;
}
.prose hr { border: 0; border-top: 1px solid var(--hairline); margin-block: 2.5em; }
.prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.88em;
  color: var(--text-1);
  background: rgba(238, 237, 233, 0.06);
  padding: 0.1em 0.35em;
}
.prose pre { overflow-x: auto; padding: 1.1rem 1.25rem; background: rgba(238, 237, 233, 0.04); border: 1px solid var(--hairline); }
.prose pre code { background: none; padding: 0; }
.prose img { max-width: 100%; height: auto; }
.prose figcaption { margin-top: 0.6rem; font-size: var(--fs-small); color: var(--text-3); }

/* Ghost editor card widths (required by Ghost themes) */
.kg-width-wide { position: relative; width: min(100%, 60rem); max-width: none; }
.kg-width-full { position: relative; width: 100%; max-width: none; }
.kg-image { display: block; margin-inline: auto; }

/* Phone: one column, phone-sized spacing */
@media (max-width: 720px) {
  .page { padding: 1.25rem var(--pad); }
  .home { font-size: 0.875rem; }
  .main { justify-content: flex-start; padding-block: clamp(2.25rem, 7vh, 3.5rem) 2rem; }
  .row { grid-template-columns: 1fr; row-gap: 0.7rem; }
  .row-label:empty { display: none; }
  .row + .row { margin-top: 1.5rem; }
  .ruled { margin-top: 2.25rem !important; padding-top: 1.25rem; }
  .footer { display: flex; justify-content: space-between; gap: 1rem; }
  .display { font-size: clamp(2rem, 8.5vw, 2.5rem); line-height: 1.06; }
  .lead { margin-top: 0.75rem; font-size: 1.125rem; }
  .prose { font-size: 1.0625rem; line-height: 1.62; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
