/* Informed Decisions Defense Consulting
   Palette: baked milk stock, oxide red annotation accent
   Type:  Fixel (MacPaw / AlfaBravo, free licence) for display and body
          IBM Plex Mono (SIL OFL) for labels and data
   Font binaries live in /fonts, see public/fonts/README.md */

@font-face {
  font-family: "Fixel Display";
  src: url("/fonts/FixelDisplay-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Fixel Text";
  src: url("/fonts/FixelText-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Fixel Text";
  src: url("/fonts/FixelText-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("/fonts/IBMPlexMono-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #efeae0;
  --panel: #e4ded1;
  --ink: #1d1b16;
  --ink-2: #625c52;
  --rule: #d5cec1;
  --signal: #8a2b18;

  --display: "Fixel Display", "Helvetica Neue", Arial, sans-serif;
  --body: "Fixel Text", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --gutter: 8rem;
  --measure: 41rem;
  --gap: 3rem;
  --pad: clamp(1.25rem, 5vw, 3.5rem);
  --frame: calc(var(--gutter) + var(--gap) + var(--measure));
}

/* large monitors get a wider column and a wider gutter, not just bigger type */
@media (min-width: 100rem) {
  :root {
    --gutter: 9.5rem;
    --measure: 46rem;
    --gap: 3.5rem;
  }
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: clamp(1.0625rem, 0.95rem + 0.4vw, 1.22rem);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
}

.skip {
  position: absolute;
  left: -9999px;
}

.skip:focus {
  left: 1rem;
  top: 1rem;
  z-index: 200;
  background: var(--ink);
  color: var(--paper);
  padding: 0.5rem 0.9rem;
}

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

/* ---------- paper grain ---------- */

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  opacity: 0.28;
  background-image: url("/img/grain.png");
  background-repeat: repeat;
  background-size: 192px 192px;
}

@media (prefers-contrast: more) {
  body::after {
    display: none;
  }
}

@media print {
  body::after {
    display: none;
  }
}

/* ---------- centred frame ---------- */

.wrap,
.frame {
  max-width: var(--frame);
  margin-inline: auto;
}

@media (min-width: 62rem) {
  .frame {
    display: grid;
    grid-template-columns: var(--gutter) minmax(0, var(--measure));
    column-gap: var(--gap);
    align-items: start;
  }

  .frame > .tag {
    grid-column: 1;
    grid-row: 1;
    margin: 0;
    padding-top: 0.5rem;
  }

  .frame > :not(.tag):not(.trace) {
    grid-column: 2;
  }
}

/* ---------- header ---------- */

.bar {
  position: sticky;
  top: 0;
  z-index: 5;
  padding: 0.95rem var(--pad);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}

.bar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.mark {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.mark__id {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.2rem;
  letter-spacing: 0.02em;
  line-height: 1;
  padding: 0.34rem 0.44rem 0.3rem;
  background: var(--signal);
  color: var(--paper);
}

.mark__words {
  display: flex;
  flex-direction: column;
  line-height: 1.18;
}

.mark__name {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.012em;
}

.mark__sub {
  font-family: var(--mono);
  font-size: 0.63rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-2);
}

/* ---------- shared ---------- */

.tag {
  margin: 0 0 1.2rem;
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.tag--signal {
  color: var(--signal);
}

.btn {
  display: inline-block;
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.9rem 1.5rem;
  background: var(--ink);
  color: var(--paper);
  transition:
    background 0.18s ease,
    transform 0.18s ease;
}

.btn:hover {
  background: var(--signal);
  transform: translateY(-1px);
}

.btn--sm {
  padding: 0.6rem 1rem;
  font-size: 0.72rem;
}

/* Lowercase on purpose. This class only ever wraps the email address, and an
   address is a literal string someone will type: setting it in caps misreports
   what to type, and the mono face already marks it as data. The buttons keep
   their caps, being labels rather than values. */

.link {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: var(--ink-2);
  border-bottom: 1px solid var(--rule);
  padding-bottom: 3px;
  transition: color 0.18s ease;
}

.link:hover {
  color: var(--signal);
  border-bottom-color: var(--signal);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.75rem;
  margin-top: 2.4rem;
}

/* ---------- hero ---------- */

.bluf {
  padding: clamp(4.5rem, 15vh, 10rem) var(--pad) clamp(4rem, 11vh, 7rem);
}

/* Traced from a map rather than drawn. A straight accent rule is what every
   template does; this is the line the whole business is about. */

.trace {
  display: none;
}

@media (min-width: 62rem) {
  .bluf__frame {
    position: relative;
  }

  .bluf__frame > .tag {
    padding-top: 0.85rem;
  }

  .trace {
    display: flex;
    align-items: stretch;
    gap: 0.5rem;
    position: absolute;
    left: -3.7rem;
    top: 0.6rem;
    bottom: 0.6rem;
    color: var(--signal);
  }

  .trace__line {
    width: 2rem;
    height: 100%;
    opacity: 0.9;
  }

  /* set along the line, the way a feature is annotated on a drawing */
  .trace__label {
    align-self: flex-end;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    white-space: nowrap;
    font-family: var(--mono);
    font-weight: 500;
    font-size: 0.5625rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--ink-2);
  }
}

/* Fixel ships stylistic alternates (single-storey a, descending f, bent t)
   that read like an upright italic and are distinctly Ukrainian. They suit
   short display text only. To try them, uncomment the line below. */

.bluf__line {
  margin: 0;
  /* font-feature-settings: "ss01", "salt"; */
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(2rem, 5.2vw, 4.3rem);
  line-height: 1.06;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.lede {
  margin: 1.8rem 0 0;
  max-width: 33rem;
  font-size: clamp(1.15rem, 0.95rem + 0.7vw, 1.45rem);
  line-height: 1.5;
  color: var(--ink-2);
}

/* ---------- blocks ---------- */

.block {
  padding: clamp(3.5rem, 9vh, 6.5rem) var(--pad);
  border-top: 1px solid var(--rule);
}

/* ---------- services spec list ---------- */

.specs {
  list-style: none;
  margin: 0;
  padding: 0;
}

.spec {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.55rem 1.75rem;
  padding: 2rem 0;
  border-top: 1px solid var(--rule);
}

.spec:first-child {
  border-top: 0;
  padding-top: 0;
}

.spec__format {
  margin: 0;
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--signal);
}

.spec__body {
  min-width: 0;
}

.spec__name {
  margin: 0 0 0.45rem;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.3rem, 1.05rem + 0.9vw, 1.72rem);
  letter-spacing: -0.02em;
  line-height: 1.16;
}

.spec__text {
  margin: 0;
  color: var(--ink-2);
}

.spec__term {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.note {
  margin: 2.1rem 0 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  max-width: 34rem;
  font-size: clamp(1rem, 0.95rem + 0.25vw, 1.12rem);
  color: var(--ink-2);
}

@media (min-width: 44rem) {
  .spec {
    grid-template-columns: 7rem minmax(0, 1fr) 7.5rem;
    align-items: start;
  }

  .spec__format {
    padding-top: 0.5rem;
  }

  .spec__term {
    padding-top: 0.5rem;
    text-align: right;
  }
}

/* ---------- statement ---------- */

.say {
  margin: 0 0 1.6rem;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.45rem, 1rem + 2.2vw, 2.45rem);
  line-height: 1.18;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.prose {
  margin: 0;
  max-width: 36rem;
  color: var(--ink-2);
}

/* ---------- facts ---------- */

.facts {
  margin: 0;
}

.fact {
  display: grid;
  gap: 0.35rem;
  padding: 1.4rem 0;
  border-top: 1px solid var(--rule);
}

.fact:first-child {
  border-top: 0;
  padding-top: 0;
}

.fact__key {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.fact__val {
  margin: 0;
}

@media (min-width: 44rem) {
  .fact {
    grid-template-columns: 9rem minmax(0, 1fr);
    gap: 1.75rem;
  }

  .fact__key {
    padding-top: 0.4rem;
  }
}

/* ---------- close ---------- */

.close {
  background: var(--panel);
}

.close__line {
  margin: 0;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.45rem, 1rem + 2.2vw, 2.45rem);
  line-height: 1.18;
  letter-spacing: -0.025em;
  max-width: 30rem;
  text-wrap: balance;
}

/* ---------- footer ---------- */

.foot {
  padding: 1.8rem var(--pad) 2.8rem;
  border-top: 1px solid var(--rule);
}

.foot__legal {
  margin: 0;
  max-width: 44rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  line-height: 1.7;
  letter-spacing: 0.03em;
  color: var(--ink-2);
}

/* ---------- motion ---------- */

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.bluf__frame > .tag,
.bluf__line,
.lede,
.bluf__frame .actions {
  animation: rise 0.7s ease both;
}

.bluf__frame > .tag {
  animation-delay: 0.15s;
}

.bluf__line {
  animation-delay: 0.25s;
}

.lede {
  animation-delay: 0.4s;
}

.bluf__frame .actions {
  animation-delay: 0.5s;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
