:root {
  --terracotta: #9a3d22;
  --ink: #231f1c;
  --paper: #fbf8f5;
  --warm: #f6efe9;
  --clay: #c7a18f;
  --green: #4e6b61;
  --muted: #7b6d66;
  --line: rgba(154, 61, 34, 0.2);
  font-family: "Poppins", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  overflow-x: hidden;
  background:
    linear-gradient(90deg, rgba(154, 61, 34, 0.035) 1px, transparent 1px) 0 0 / 80px 80px,
    var(--paper);
}

img {
  max-width: 100%;
  display: block;
}

.rail {
  position: fixed;
  z-index: 5;
  right: 28px;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  gap: 14px;
}

.rail a {
  position: relative;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(35, 31, 28, 0.18);
  transition: background 180ms ease, transform 180ms ease;
}

.rail a::before {
  content: attr(data-label);
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  min-width: 120px;
  text-align: right;
  color: var(--terracotta);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  opacity: 0;
  pointer-events: none;
}

.rail a.active,
.rail a:hover {
  background: var(--terracotta);
  transform: scale(1.22);
}

.rail a.active::before,
.rail a:hover::before {
  opacity: 1;
}

main {
  overflow: hidden;
}

.panel {
  min-height: 100vh;
  padding: 72px clamp(24px, 7vw, 116px);
  display: grid;
  align-content: center;
  gap: 36px;
  position: relative;
}

.section-index {
  position: absolute;
  top: 46px;
  left: clamp(24px, 7vw, 116px);
  color: var(--clay);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0;
}

.eyebrow,
.label {
  margin: 0 0 12px;
  color: var(--terracotta);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  max-width: 980px;
  font-size: 116px;
  line-height: 0.9;
  letter-spacing: 0;
  overflow-wrap: break-word;
}

h2 {
  max-width: 900px;
  font-size: 92px;
  line-height: 0.93;
  letter-spacing: 0;
  overflow-wrap: break-word;
}

.lead {
  max-width: 880px;
  color: var(--muted);
  font-size: 42px;
  line-height: 1.08;
}

.cover {
  grid-template-rows: 1fr auto auto;
  background: var(--paper);
}

.cover-mark {
  align-self: start;
  width: min(680px, 82vw);
  border: 1px solid var(--line);
  padding: 24px;
  background: white;
}

.cover-copy {
  align-self: end;
}

.cover-copy p:last-child {
  max-width: 620px;
  margin-top: 24px;
  color: var(--muted);
  font-size: 20px;
  line-height: 1.45;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  color: var(--muted);
  font-size: 13px;
}

.principles,
.logo-grid,
.mockups,
.digital-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.principles article {
  border-top: 2px solid var(--terracotta);
  padding-top: 18px;
}

.principles span {
  display: block;
  margin-bottom: 10px;
  font-size: 28px;
  font-weight: 700;
}

.principles p,
.rule-notes p,
.type-specimen p {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.45;
}

.logo-stage {
  padding: clamp(24px, 5vw, 72px);
  background: white;
  border: 1px solid var(--line);
}

.sample {
  min-height: 220px;
  padding: 28px;
  display: grid;
  place-items: center;
  background: var(--warm);
  border: 1px solid var(--line);
}

.logo-grid {
  grid-template-columns: 2fr 1fr;
}

.emblem img {
  width: min(168px, 70%);
  height: auto;
}

.contrast-block,
.palette-applications {
  display: grid;
  gap: 18px;
}

.contrast-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 14px;
}

.contrast-card {
  padding: 22px;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 18px;
  align-items: center;
  justify-items: center;
  background: var(--bg);
  border: 1px solid rgba(35, 31, 28, 0.12);
  color: white;
}

.contrast-card[data-size="sm"] {
  grid-column: span 2;
  min-height: 170px;
  --mark-scale: 0.72;
}

.contrast-card[data-size="md"] {
  grid-column: span 2;
  min-height: 230px;
  --mark-scale: 1;
}

.contrast-card[data-size="lg"] {
  grid-column: span 3;
  min-height: 280px;
  --mark-scale: 1.18;
}

.contrast-card:nth-child(3) {
  color: var(--ink);
}

.contrast-card span {
  width: 100%;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  opacity: 0.85;
}

.emblem-mask,
.logo-mask {
  background: var(--logo-color);
}

.emblem-mask {
  width: min(100%, calc(120px * var(--mark-scale, 1)));
  aspect-ratio: 1251.88 / 1320.54;
  mask: url("assets/emblema.svg") center / contain no-repeat;
  -webkit-mask: url("assets/emblema.svg") center / contain no-repeat;
}

.logo-mask {
  width: min(100%, calc(220px * var(--mark-scale, 1)));
  aspect-ratio: 3801.88 / 1320.54;
  mask: url("assets/logo-master-opl.svg") center / contain no-repeat;
  -webkit-mask: url("assets/logo-master-opl.svg") center / contain no-repeat;
}

.rule-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.6fr);
  gap: 28px;
  align-items: stretch;
}

.clearspace {
  display: grid;
  place-items: center;
  padding: 72px;
  background:
    linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 48px 48px,
    linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 48px 48px,
    white;
  border: 18px solid var(--warm);
}

.rule-notes {
  display: grid;
  gap: 18px;
}

.rule-notes article {
  padding: 24px;
  border: 1px solid var(--line);
  background: white;
}

.rule-notes strong {
  display: block;
  margin-bottom: 12px;
  color: var(--terracotta);
  font-size: 18px;
}

.swatches {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 14px;
}

.swatches article {
  min-height: 280px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: var(--swatch);
  color: white;
  border: 1px solid rgba(35, 31, 28, 0.12);
}

.swatches article:nth-child(3) {
  color: var(--ink);
}

.swatches span {
  font-size: 15px;
  font-weight: 700;
}

.swatches strong {
  margin-top: 8px;
  font-size: 24px;
}

.type-specimen {
  display: grid;
  grid-template-columns: 1.35fr 0.65fr;
  gap: 42px;
  align-items: end;
}

.display {
  color: var(--terracotta);
  font-size: 132px;
  font-weight: 700;
  line-height: 0.86;
  overflow-wrap: break-word;
}

.applications,
.digital,
.typography {
  background: var(--warm);
}

.mockups article,
.screen,
.social {
  min-height: 340px;
  background: white;
  border: 1px solid var(--line);
  padding: 26px;
}

.poster {
  display: grid;
  align-content: space-between;
  color: white;
  background: var(--terracotta) !important;
}

.poster img {
  filter: brightness(0) invert(1);
}

.poster span,
.badge span {
  font-size: 12px;
  text-transform: uppercase;
  font-weight: 700;
}

.poster strong {
  max-width: 220px;
  font-size: 54px;
  line-height: 0.95;
}

.badge {
  display: grid;
  align-content: space-between;
}

.badge img {
  width: 260px;
}

.badge strong {
  font-size: 34px;
}

.letter {
  display: grid;
  align-content: start;
  gap: 82px;
}

.letter img {
  width: 250px;
}

.letter p {
  padding-top: 28px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.digital-grid {
  grid-template-columns: 1.3fr 0.7fr;
}

.screen {
  min-height: 440px;
  display: grid;
  align-content: start;
  gap: 42px;
}

.screen-top {
  height: 14px;
  background: repeating-linear-gradient(
    90deg,
    var(--terracotta) 0 14px,
    transparent 14px 24px
  );
}

.screen img {
  width: min(520px, 100%);
}

.screen p {
  color: var(--muted);
  font-size: 28px;
}

.social {
  display: grid;
  align-content: space-between;
  background: var(--green);
  color: white;
}

.social span {
  font-size: 120px;
  font-weight: 700;
  line-height: 0.8;
}

.social p {
  font-size: 24px;
  line-height: 1.1;
}

.closing {
  place-items: center;
  text-align: center;
  background: var(--terracotta);
  color: white;
  gap: 18px;
}

.closing img {
  width: min(680px, 82vw);
  filter: brightness(0) invert(1);
}

.closing h2 {
  max-width: 860px;
}

.closing a {
  color: white;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.5);
  padding: 14px 20px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

@media (max-width: 860px) {
  .rail {
    right: 14px;
    gap: 10px;
  }

  .rail a::before {
    display: none;
  }

  .panel {
    padding: 72px 48px 72px 24px;
  }

  .principles,
  .logo-grid,
  .contrast-grid,
  .rule-layout,
  .swatches,
  .type-specimen,
  .mockups,
  .digital-grid {
    grid-template-columns: 1fr;
  }

  .contrast-card[data-size] {
    grid-column: auto;
    min-height: 190px;
  }

  .swatches article {
    min-height: 170px;
  }

  .clearspace {
    padding: 28px;
  }

  .cover-mark {
    padding: 14px;
  }

  h1 {
    font-size: 46px;
  }

  h2 {
    font-size: 42px;
  }

  .lead {
    font-size: 26px;
  }

  .display {
    font-size: 52px;
  }

  .poster strong {
    font-size: 42px;
  }

  .social span {
    font-size: 82px;
  }
}

@media (min-width: 861px) and (max-width: 1120px) {
  h1 {
    font-size: 86px;
  }

  h2 {
    font-size: 72px;
  }

  .lead {
    font-size: 34px;
  }

  .display {
    font-size: 96px;
  }
}
