/* Ferrocodex site
   Palette lifted from the logo: indigo iron, teal pages, brass for golden. */

@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  src: url('/assets/fonts/archivo-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Archivo';
  font-style: italic;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  src: url('/assets/fonts/archivo-italic-latin.woff2') format('woff2');
}

:root {
  --iron: #1a1450;
  --iron-deep: #120e3b;
  --iron-tint: #2a2470;
  --plate: #f3f5f8;
  --paper: #ffffff;
  --ink: #17182b;
  --graphite: #565a74;
  --rule: #d6dae3;
  --rule-dark: rgba(255, 255, 255, 0.14);
  --teal: #1a6880;
  --teal-bright: #5bb5c8;
  --teal-tint: #e3f2f5;
  --brass: #a8781f;
  --brass-ink: #6b4a0b;
  --brass-tint: #fbf3e0;
  --silver: #8a90a3;
  --silver-tint: #eceef3;

  --font: 'Archivo', 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  --step-0: 1.0625rem;   /* 17 */
  --step-1: 1.3125rem;   /* 21 */
  --step-2: 1.6875rem;   /* 27 */
  --step-3: 2.125rem;    /* 34 */
  --step-4: 2.75rem;     /* 44 */

  --measure: 36rem;
  --container: 70rem;
  --gutter: 1.5rem;
  --section: clamp(4rem, 9vw, 6.5rem);
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--step-0);
  line-height: 1.55;
  color: var(--ink);
  background: var(--plate);
  font-feature-settings: 'kern' 1, 'liga' 1;
}

h1, h2, h3 {
  margin: 0;
  font-weight: 600;
  font-stretch: 112%;
  letter-spacing: -0.015em;
  line-height: 1.1;
  text-wrap: balance;
}
h1 { font-size: clamp(2.25rem, 1.2rem + 3.2vw, 3.3rem); }
h2 { font-size: clamp(1.75rem, 1.2rem + 1.8vw, var(--step-3)); }
h3 { font-size: var(--step-1); font-stretch: 105%; line-height: 1.25; }

p { margin: 0; }
p + p { margin-top: 1em; }

a { color: var(--teal); text-decoration-thickness: 1px; text-underline-offset: 0.15em; }
a:hover { color: var(--iron); }

:focus-visible {
  outline: 3px solid var(--teal-bright);
  outline-offset: 3px;
}

code { font-family: var(--mono); font-size: 0.9em; }

.container {
  width: min(var(--container), 100% - 2 * var(--gutter));
  margin-inline: auto;
}

/* Buttons */

.button {
  display: inline-block;
  padding: 0.8rem 1.35rem;
  border: 1.5px solid transparent;
  border-radius: 3px;
  font-weight: 600;
  font-stretch: 105%;
  text-decoration: none;
  line-height: 1.2;
  color: var(--paper);
  background: var(--iron);
}
.button:hover { color: var(--paper); background: var(--iron-tint); }
.button--small { padding: 0.5rem 0.9rem; font-size: 0.95rem; }
.button--primary { background: var(--iron); }
.button--light { color: var(--iron); background: var(--paper); }
.button--light:hover { color: var(--iron); background: var(--teal-tint); }
.button--ghost { color: var(--paper); background: transparent; border-color: var(--rule-dark); }
.button--ghost:hover { color: var(--paper); background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.4); }

/* Status chips. These mirror the statuses inside the application. */

.status {
  display: inline-block;
  padding: 0.15rem 0.6rem 0.2rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
}
.status::before {
  content: '';
  display: inline-block;
  width: 0.5em;
  height: 0.5em;
  margin-right: 0.45em;
  border-radius: 50%;
  background: currentColor;
  vertical-align: 0.05em;
}
.status--draft { color: var(--graphite); background: var(--silver-tint); }
.status--silver { color: #4f5569; background: var(--silver-tint); }
.status--approved { color: var(--teal); background: var(--teal-tint); }
.status--golden { color: var(--brass-ink); background: var(--brass-tint); }
.status--golden::before { background: var(--brass); }
.status--archived { color: var(--graphite); background: transparent; border: 1px solid var(--rule); }

/* Header */

.site-header {
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}
.site-header__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 4.5rem;
}
.brand { display: inline-flex; align-items: center; gap: 0.65rem; text-decoration: none; color: var(--iron); }
.brand img { display: block; height: 2.25rem; width: auto; }
.brand__name {
  font-size: 1.35rem;
  font-weight: 600;
  font-stretch: 110%;
  letter-spacing: -0.01em;
  line-height: 1;
}
.brand--footer { color: var(--paper); }
.brand--footer img { filter: brightness(0) invert(1); opacity: 0.9; }

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2.5vw, 2rem);
  font-weight: 500;
}
.site-nav a:not(.button) { color: var(--ink); text-decoration: none; }
.site-nav a:not(.button):hover { color: var(--teal); }

/* Hero */

.hero {
  background: var(--iron);
  color: var(--paper);
  padding-block: var(--section);
}
.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}
.hero__copy { max-width: var(--measure); }
.hero__lede {
  margin-top: 1.5rem;
  font-size: var(--step-1);
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.82);
  max-width: 32rem;
}
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}
.hero__meta {
  margin-top: 1.5rem;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.6);
}

/* The ledger: the one bold element on the page. */

.ledger {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  border-radius: 6px;
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  position: relative;
  border-left: 10px solid var(--teal);
}
.ledger::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--teal-bright);
}
.ledger__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.1rem 1.25rem 0.9rem;
  border-bottom: 1px solid var(--rule);
}
.ledger__asset {
  font-size: var(--step-1);
  font-weight: 600;
  font-stretch: 110%;
  line-height: 1.2;
}
.ledger__path { color: var(--graphite); font-size: 0.9rem; margin-top: 0.15rem; }
.ledger__kind {
  font-size: 0.85rem;
  color: var(--graphite);
  padding-top: 0.25rem;
  white-space: nowrap;
}
.ledger__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.ledger__table th {
  text-align: left;
  font-weight: 500;
  color: var(--graphite);
  font-size: 0.8rem;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--rule);
}
.ledger__table td {
  padding: 0.7rem 0.75rem;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}
.ledger__table th:first-child, .ledger__table td:first-child { padding-left: 1.25rem; }
.ledger__table td:first-child { font-family: var(--mono); font-size: 0.85rem; }
.ledger__table th:last-child, .ledger__table td:last-child { padding-right: 1.25rem; text-align: right; }
.ledger__date { display: block; color: var(--graphite); font-size: 0.8rem; margin-top: 0.1rem; }
.ledger__branch td:nth-child(2)::before {
  content: '';
  display: inline-block;
  width: 0.9rem;
  height: 0.55rem;
  margin-right: 0.35rem;
  border-left: 2px solid var(--silver);
  border-bottom: 2px solid var(--silver);
  border-bottom-left-radius: 4px;
  vertical-align: 0.1em;
}
.ledger__golden td { background: var(--brass-tint); border-bottom: 0; }
.ledger__golden td:nth-child(2) { font-weight: 600; }
.ledger__foot {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.5rem;
  padding: 0.75rem 1.25rem;
  background: var(--plate);
  border-top: 1px solid var(--rule);
  font-size: 0.8rem;
  color: var(--graphite);
}
.ledger__foot code { color: var(--ink); }

/* Sections */

section { padding-block: var(--section); }
section + section { border-top: 1px solid var(--rule); }
.hero + section { border-top: 0; }

h2 + p, h2 + .principles__grid, h2 + .steps { margin-top: 1rem; }

/* Principles */

.principles { background: var(--paper); }
.principles__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2.5rem;
  margin-top: 2.5rem;
}
.principle { padding-top: 1.25rem; border-top: 2px solid var(--teal); }
.principle p { margin-top: 0.75rem; color: var(--graphite); }

/* Features */

.features__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: clamp(2rem, 5vw, 5rem);
}
.features__intro p { margin-top: 1rem; color: var(--graphite); max-width: 24rem; }
.features__list {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2.25rem 2.5rem;
}
.features__list dt { font-weight: 600; font-size: var(--step-1); font-stretch: 105%; line-height: 1.25; }
.features__list dd { margin: 0.5rem 0 0; color: var(--graphite); }

/* Workflow. A real sequence, so it is numbered. */

.workflow { background: var(--paper); }
.steps {
  list-style: none;
  margin: 2.5rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2rem;
  counter-reset: step;
}
.steps li {
  counter-increment: step;
  display: flex;
  flex-direction: column;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
}
.steps li::before {
  content: counter(step);
  font-size: var(--step-3);
  font-weight: 600;
  font-stretch: 112%;
  line-height: 1;
  color: var(--iron);
  margin-bottom: 0.9rem;
}
.steps p { margin-top: 0.6rem; color: var(--graphite); flex: 1; }
.steps .status { align-self: flex-start; margin-top: 1rem; }

/* Security */

.security__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: clamp(2rem, 5vw, 5rem);
}
.security__intro p { margin-top: 1rem; color: var(--graphite); max-width: 24rem; }
.security__lists {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2.5rem;
}
.security__lists ul { margin: 0.75rem 0 0; padding: 0; list-style: none; }
.security__lists li { padding: 0.55rem 0; border-top: 1px solid var(--rule); }
.security__lists li:last-child { border-bottom: 1px solid var(--rule); }
.security__lists > div:first-child h3 { color: var(--teal); }
.security__access { grid-column: 2; margin-top: 2.5rem; max-width: var(--measure); }
.security__access p { margin-top: 0.6rem; color: var(--graphite); }

/* Download */

.download { background: var(--paper); }
.download__lede { color: var(--graphite); max-width: var(--measure); }
.download__platforms {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2rem;
  margin-top: 2.5rem;
}
.platform { padding-top: 1.1rem; border-top: 2px solid var(--rule); }
.platform.is-current { border-top-color: var(--iron); }
.platform ul { margin: 0.9rem 0 0; padding: 0; list-style: none; }
.platform li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.5rem 0; border-bottom: 1px solid var(--rule); }
.platform li a { font-weight: 600; color: var(--iron); text-decoration: none; }
.platform li a:hover { color: var(--teal); text-decoration: underline; }
.platform__size { color: var(--graphite); font-size: 0.9rem; white-space: nowrap; }
.platform p { margin-top: 0.75rem; font-size: 0.9rem; color: var(--graphite); }
.download__notes { margin-top: 2.5rem; max-width: var(--measure); color: var(--graphite); }

/* Footer */

.site-footer {
  background: var(--iron);
  color: rgba(255, 255, 255, 0.75);
  padding-block: 3.5rem;
  font-size: 0.95rem;
}
.site-footer__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr));
  gap: 2.5rem;
}
.site-footer__brand p { margin-top: 1rem; max-width: 22rem; }
.site-footer h3 { color: var(--paper); font-size: 1rem; margin-bottom: 0.75rem; }
.site-footer__links a { display: block; color: rgba(255, 255, 255, 0.85); text-decoration: none; padding: 0.2rem 0; }
.site-footer__links a:hover { color: var(--teal-bright); }
.site-footer__links p a { display: inline; color: var(--teal-bright); text-decoration: underline; }

/* 404 */

.not-found { padding-block: var(--section); }
.not-found h1, .not-found p { max-width: var(--measure); }
.not-found p { margin-top: 1rem; color: var(--graphite); }
.not-found .button { margin-top: 0.5rem; }

/* Responsive */

@media (max-width: 64rem) {
  .hero__grid { grid-template-columns: 1fr; }
  .features__grid, .security__grid { grid-template-columns: 1fr; }
  .security__access { grid-column: auto; margin-top: 0; }
  .site-footer__grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 48rem) {
  .site-nav a:not(.button) { display: none; }
  .principles__grid, .steps, .download__platforms, .features__list, .security__lists { grid-template-columns: 1fr; }
  .steps { gap: 1.5rem; }
  .ledger__table th:nth-child(3), .ledger__table td:nth-child(3) { display: none; }
  .site-footer__grid { grid-template-columns: 1fr; gap: 2rem; }
}
