/* ==========================================================================
   Page · K03 Typography & Notation
   ========================================================================== */

/* ---- Intro -------------------------------------------------------------- */

/* "120 Nm": the mega size instead of display-1 */
.type-hero__title {
  font-size: var(--fs-mega);
  line-height: .8;
  max-width: none;
}

/* ---- Families ----------------------------------------------------------- */

.font-families {
  display: grid;
  gap: 1px;
  background: var(--line-strong);
  border: 1px solid var(--line-strong);
}

.font-family {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 24px;
  align-items: end;
  padding: 28px;
  background: var(--canvas);
}

.font-family__token {
  font: 500 12px/1.6 var(--f-mono);
  color: var(--muted);
}

.font-family__name--display {
  font: 700 28px/1.1 var(--f-display);
  text-transform: uppercase;
}

.font-family__name--text {
  font: 600 28px/1.1 var(--f-text);
}

.font-family__name--mono {
  font: 500 28px/1.1 var(--f-mono);
}

.font-family__weights {
  font-size: 15px;
  color: var(--ink-2);
}

.font-family__sample--display {
  font: 800 clamp(56px, 7vw, 112px)/.85 var(--f-display);
  text-transform: uppercase;
}

.font-family__sample--text {
  font: 400 clamp(20px, 2vw, 26px)/1.45 var(--f-text);
  max-width: 40ch;
}

.font-family__sample--mono {
  font: 500 clamp(20px, 2vw, 26px)/1.45 var(--f-mono);
}

/* ---- Fluid scale -------------------------------------------------------- */

.type-scale {
  border-top: 1.5px solid var(--ink);
}

.type-scale__row {
  display: grid;
  grid-template-columns: minmax(120px, 200px) minmax(0, 1fr);
  gap: 8px 24px;
  align-items: baseline;
  padding: 18px 0;
  border-bottom: 1px solid var(--line-strong);
}

.type-scale__spec {
  font: 400 12px/1.6 var(--f-mono);
  color: var(--ink-2);
}

.type-scale__token {
  color: var(--ink);
  font-weight: 500;
}

.type-scale__sample {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1;
}

/* one modifier per scale step: family, size, weight, case */
.type-scale__sample--mega  { font-family: var(--f-display); font-size: var(--fs-mega);  font-weight: 800; text-transform: uppercase; }
.type-scale__sample--d1    { font-family: var(--f-display); font-size: var(--fs-d1);    font-weight: 800; text-transform: uppercase; }
.type-scale__sample--d2    { font-family: var(--f-display); font-size: var(--fs-d2);    font-weight: 700; text-transform: uppercase; }
.type-scale__sample--h3    { font-family: var(--f-display); font-size: var(--fs-h3);    font-weight: 700; text-transform: uppercase; }
.type-scale__sample--lead  { font-family: var(--f-text);    font-size: var(--fs-lead);  font-weight: 400; }
.type-scale__sample--body  { font-family: var(--f-text);    font-size: var(--fs-body);  font-weight: 400; }
.type-scale__sample--small { font-family: var(--f-text);    font-size: var(--fs-small); font-weight: 400; }
.type-scale__sample--cap   { font-family: var(--f-mono);    font-size: var(--fs-cap);   font-weight: 500; text-transform: uppercase; }

/* ---- Engineering notation ---------------------------------------------- */

.notation-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line-strong);
}

.notation-table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  table-layout: fixed;
}

/* column widths mirror a 1.3fr 1fr 1fr grid */
.notation-table th:nth-child(1) { width: calc(100% * 1.3 / 3.3); }
.notation-table th:nth-child(2) { width: calc(100% / 3.3); }

.notation-table th {
  padding: 12px 16px;
  background: var(--surface);
  font: 500 12px/1 var(--f-mono);
  letter-spacing: .06em;
  text-align: left;
}

.notation-table .notation-table__ok-head {
  color: var(--sig-green);
}

.notation-table .notation-table__bad-head {
  color: var(--sig-red);
}

.notation-table td {
  padding: 14px 16px;
  border-top: 1px solid var(--line);
  font-size: 16px;
  vertical-align: top;
}

.notation-table .notation-table__rule {
  color: var(--ink-2);
}

.notation-table .notation-table__ok {
  font: 500 17px/1.3 var(--f-mono);
}

.notation-table .notation-table__bad {
  font: 400 17px/1.3 var(--f-mono);
  color: var(--muted);
  text-decoration: line-through;
}

/* ---- Order codes -------------------------------------------------------- */

.order-code {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: stretch;
}

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

.order-code__value {
  padding: 14px 18px;
  border: 1.5px solid var(--ink);
  background: var(--canvas);
  font: 500 clamp(32px, 4.4vw, 64px)/1 var(--f-mono);
}

.order-code__key {
  padding-left: 4px;
  font: 500 11px/1.4 var(--f-mono);
  letter-spacing: .06em;
  color: var(--muted);
}

.order-code__note {
  margin: 24px 0 0;
  max-width: 60ch;
  font-size: var(--fs-small);
  color: var(--ink-2);
}

/* ---- Tabular numerals & measure ---------------------------------------- */

.type-rules {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
  gap: 48px;
}

.type-rule__label {
  margin-bottom: 12px;
  font: 500 12px/1 var(--f-mono);
  color: var(--muted);
}

.type-rule__title {
  margin-bottom: 20px;
}

.tabular-sample {
  max-width: 280px;
  padding: 8px 0;
  border-top: 1.5px solid var(--ink);
  border-bottom: 1px solid var(--line-strong);
  font: 500 22px/1.7 var(--f-mono);
  text-align: right;
}

/* the dashed rules mark the 68ch measure */
.measure-sample {
  margin: 0;
  max-width: 68ch;
  padding: 0 12px;
  border-left: 1px dashed var(--accent);
  border-right: 1px dashed var(--accent);
}
