/* Montrose Codeworks
   Visual idea: the paperwork of field trades. Engineering-paper ground,
   field-book yellow, and each app shown as a hang tag on a wire, the way
   test tags, posting flags and repair tickets hang in the real world. */

@font-face {
  font-family: "Barlow";
  src: url("fonts/barlow-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Barlow";
  src: url("fonts/barlow-latin-400-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Barlow";
  src: url("fonts/barlow-latin-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Barlow Condensed";
  src: url("fonts/barlow-condensed-latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Barlow Condensed";
  src: url("fonts/barlow-condensed-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --ledger: #e8eee3;   /* engineering-paper ground */
  --grid: #ccd8c6;     /* grid and rules */
  --ink: #1d2a30;      /* slate ink for text */
  --ink-soft: #4a5a60; /* secondary text */
  --field: #edbe2e;    /* field-book yellow */
  --manila: #e3cf9c;   /* tag stock */
  --stamp: #8e2a20;    /* rubber-stamp red */

  --display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --text: "Barlow", "Helvetica Neue", Arial, sans-serif;

  --measure: 34rem;
  --gutter: clamp(1.25rem, 4vw, 3rem);
}

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

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

body {
  margin: 0;
  background: var(--ledger);
  color: var(--ink);
  font-family: var(--text);
  font-size: 1.0625rem;
  line-height: 1.55;
}

a {
  color: var(--ink);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-thickness: 2px;
}

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

.skip {
  position: absolute;
  left: -999px;
  top: 0.5rem;
  background: var(--ink);
  color: var(--ledger);
  padding: 0.5rem 0.75rem;
}

.skip:focus {
  left: 0.5rem;
}

/* Header */

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 2rem;
  padding: 1.25rem var(--gutter);
  border-bottom: 1px solid var(--grid);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: 0.01em;
  text-decoration: none;
}

.wordmark svg {
  width: 1.35rem;
  height: 1.7rem;
  flex: none;
}

.site-nav ul {
  display: flex;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav a {
  font-weight: 500;
  text-decoration: none;
}

.site-nav a:hover {
  text-decoration: underline;
}

/* Hero: the one bold moment */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2.5rem;
  padding: clamp(3rem, 8vw, 6rem) var(--gutter) clamp(3rem, 7vw, 5rem);
  background-color: var(--ledger);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 28px 28px;
  background-position: -1px -1px;
  border-bottom: 1px solid var(--grid);
}

@media (min-width: 960px) {
  .hero {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    align-items: center;
  }
}

.hero h1 {
  margin: 0;
  max-width: 13ch;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2.9rem, 7.2vw, 5.6rem);
  line-height: 0.95;
  letter-spacing: -0.005em;
}

.lede {
  max-width: var(--measure);
  margin: 1.5rem 0 0;
  font-size: 1.2rem;
  color: var(--ink);
  background: var(--ledger);
  box-shadow: 0 0 0 0.4rem var(--ledger);
}

/* Tags on a wire */

.tag-rail {
  position: relative;
  padding-top: 0.25rem;
}

.tag-rail::before {
  content: "";
  position: absolute;
  top: 0.25rem;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--ink);
}

.tags {
  display: flex;
  justify-content: space-around;
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tags > li {
  position: relative;
  flex: 0 1 11.5rem;
  padding-top: 2.75rem;
  transform-origin: 50% 0;
  transform: rotate(var(--r));
  animation: settle 1.6s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

.tags > li:nth-child(1) { --r: -3.5deg; animation-delay: 0.05s; }
.tags > li:nth-child(2) { --r: 2deg; animation-delay: 0.2s; }
.tags > li:nth-child(3) { --r: -1.25deg; animation-delay: 0.35s; }

/* the string from wire to hole */
.tags > li::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 1.5px;
  height: 3.6rem;
  background: var(--ink);
  transform: translateX(-50%);
}

@keyframes settle {
  0% { transform: rotate(calc(var(--r) + 9deg)); }
  35% { transform: rotate(calc(var(--r) - 4deg)); }
  62% { transform: rotate(calc(var(--r) + 1.8deg)); }
  82% { transform: rotate(calc(var(--r) - 0.6deg)); }
  100% { transform: rotate(var(--r)); }
}

.tag {
  position: relative;
  min-height: 13.5rem;
  padding: 2.6rem 1rem 1.1rem;
  background: var(--manila);
  clip-path: polygon(22% 0, 78% 0, 100% 11%, 100% 100%, 0 100%, 0 11%);
}

.tag--field {
  background: var(--field);
}

/* a planned app is a blank tag: outlined, not yet filled in */
.tag--planned {
  background-color: var(--ledger);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpolygon points='22.3,1 77.7,1 99,11.4 99,99 1,99 1,11.4' fill='none' stroke='%234a5a60' stroke-width='2' stroke-dasharray='7 5' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E"),
    repeating-linear-gradient(
      0deg,
      transparent 0 1.45rem,
      var(--grid) 1.45rem calc(1.45rem + 1px)
    );
  background-size: 100% 100%, auto;
  background-repeat: no-repeat, repeat;
}

/* punched hole with a reinforcement ring */
.tag::before {
  content: "";
  position: absolute;
  top: 0.95rem;
  left: 50%;
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 50%;
  background: var(--ledger);
  box-shadow: 0 0 0 0.3rem rgba(255, 255, 255, 0.55), inset 0 1px 1px rgba(29, 42, 48, 0.35);
  transform: translateX(-50%);
}

.tag h2 {
  margin: 0.4rem 0 0.15rem;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.85rem;
  line-height: 1;
}

.tag p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.3;
}

.stamp {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.1rem 0.45rem 0.05rem;
  border: 2px solid var(--stamp);
  border-radius: 3px;
  color: var(--stamp);
  font-family: var(--display);
  font-weight: 600;
  font-size: 1rem;
  transform: rotate(-5deg);
}

.tag--planned .stamp {
  border-color: var(--ink-soft);
  color: var(--ink-soft);
}

@media (max-width: 640px) {
  .tags {
    gap: 0.5rem;
  }
  .tags > li {
    flex-basis: 33%;
    padding-top: 2.25rem;
  }
  .tags > li::before {
    height: 3rem;
  }
  .tag {
    min-height: 11.5rem;
    padding: 2.3rem 0.6rem 0.8rem;
  }
  .tag h2 {
    font-size: 1.35rem;
  }
  .tag p {
    font-size: 0.8rem;
  }
  .stamp {
    font-size: 0.8rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tags > li {
    animation: none;
  }
}

/* Sections */

.section {
  padding: clamp(3rem, 7vw, 4.75rem) var(--gutter);
  border-bottom: 1px solid var(--grid);
}

.section > h2 {
  margin: 0 0 1.75rem;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2rem, 4vw, 2.6rem);
  line-height: 1.05;
}

.section p {
  max-width: var(--measure);
}

/* App ledger: one row per app, aligned to the grid */

.ledger {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 2px solid var(--ink);
}

.ledger > li {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.35rem 2rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--grid);
}

@media (min-width: 760px) {
  .ledger > li {
    grid-template-columns: 14rem minmax(0, 1fr) 9rem;
    align-items: baseline;
  }
}

.ledger h3 {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.7rem;
  line-height: 1.05;
}

.ledger .kind {
  display: block;
  font-family: var(--text);
  font-weight: 500;
  font-size: 1rem;
  color: var(--ink-soft);
  margin-top: 0.2rem;
}

.ledger p {
  margin: 0;
}

.ledger .status {
  font-weight: 500;
  color: var(--stamp);
}

.ledger .status--planned {
  color: var(--ink-soft);
}

/* How they work: a checklist, like the boxes on a field form */

.checks {
  margin: 0;
  padding: 0;
  list-style: none;
  max-width: 40rem;
}

.checks li {
  position: relative;
  padding: 0.85rem 0 0.85rem 2.4rem;
  border-bottom: 1px solid var(--grid);
}

.checks li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1.05rem;
  width: 1.1rem;
  height: 1.1rem;
  border: 2px solid var(--ink);
}

.checks li::after {
  content: "";
  position: absolute;
  left: 0.33rem;
  top: 1.12rem;
  width: 0.45rem;
  height: 0.8rem;
  border-right: 2.5px solid var(--ink);
  border-bottom: 2.5px solid var(--ink);
  transform: rotate(40deg);
}

.checks strong {
  font-weight: 500;
}

/* Footer */

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem 2rem;
  padding: 2rem var(--gutter) 2.5rem;
  font-size: 0.95rem;
  color: var(--ink-soft);
}

.site-footer p {
  margin: 0;
  max-width: 40rem;
}

.site-footer ul {
  display: flex;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer a {
  color: var(--ink-soft);
}

/* Document pages (privacy, 404) */

.doc {
  padding: clamp(2.5rem, 6vw, 4rem) var(--gutter) clamp(3rem, 7vw, 5rem);
}

.doc article {
  max-width: 40rem;
}

.doc h1 {
  margin: 0 0 0.5rem;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2.4rem, 5vw, 3.2rem);
  line-height: 1;
}

.doc h2 {
  margin: 2.25rem 0 0.5rem;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.5rem;
}

.doc .effective {
  margin: 0 0 2rem;
  color: var(--ink-soft);
}
