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

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

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

@font-face {
  font-family: "Montserrat";
  src: url("fonts/montserrat-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "League Spartan";
  src: url("fonts/league-spartan-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "League Spartan";
  src: url("fonts/league-spartan-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "League Spartan";
  src: url("fonts/league-spartan-800.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --flix-red: #ed0000;
  --flix-red-dark: #bd0000;
  --flix-red-soft: #fff0f0;
  --ink: #111827;
  --muted: #5e6675;
  --line: #e5e7eb;
  --paper: #ffffff;
  --canvas: #f4f5f7;
  --sidebar-width: 316px;
}

* {
  box-sizing: border-box;
}

html {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
}

body {
  width: 100%;
  max-width: 100%;
  margin: 0;
  overflow-x: hidden;
  background: var(--canvas);
  color: var(--ink);
  font-family: "Montserrat", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
}

::selection {
  background: var(--flix-red);
  color: #ffffff;
}

.site-shell {
  width: 100%;
  min-height: 100vh;
  overflow-x: hidden;
}

.reading-progress {
  position: fixed;
  inset: 0 auto auto 0;
  z-index: 90;
  height: 4px;
  background: var(--flix-red);
  box-shadow: 0 0 14px rgba(237, 0, 0, 0.35);
  transition: width 120ms linear;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 50;
  width: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  padding: 38px 28px 24px;
  overflow-y: auto;
  background: #ffffff;
  border-right: 1px solid var(--line);
}

.sidebar-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.brand-link {
  display: block;
  width: 120px;
  height: 48px;
  margin-bottom: 27px;
  overflow: hidden;
}

.brand-link img {
  display: block;
  width: 240px;
  height: 48px;
  object-fit: contain;
  object-position: left center;
  max-width: none;
}

.document-kicker,
.hero-eyebrow,
.chapter-label,
.nav-label,
.search-field > span,
.callout > span {
  color: var(--flix-red);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.sidebar-head h2 {
  max-width: 220px;
  margin: 9px 0 7px;
  font-family: "League Spartan", sans-serif;
  font-size: 1.72rem;
  font-weight: 700;
  line-height: 1;
}

.sidebar-head p {
  max-width: 220px;
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.55;
}

.search-field {
  display: block;
  margin: 30px 0 24px;
}

.search-field > span {
  display: block;
  margin-bottom: 9px;
  color: #7b8190;
  letter-spacing: 0.1em;
}

.search-field input {
  width: 100%;
  padding: 12px 13px;
  border: 1px solid #dfe2e7;
  border-radius: 10px;
  outline: none;
  background: #f8f9fa;
  color: var(--ink);
  font-size: 0.77rem;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.search-field input:focus {
  border-color: var(--flix-red);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(237, 0, 0, 0.09);
}

.chapter-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-label {
  margin: 0 0 7px 10px;
  color: #858b97;
  letter-spacing: 0.11em;
}

.chapter-nav a {
  display: grid;
  grid-template-columns: 27px 1fr;
  gap: 6px;
  align-items: start;
  padding: 9px 10px;
  border-radius: 9px;
  color: #525a68;
  font-size: 0.73rem;
  font-weight: 500;
  line-height: 1.35;
  text-decoration: none;
  transition: color 160ms ease, background 160ms ease;
}

.chapter-nav a > span {
  color: #a6abb4;
  font-family: "League Spartan", sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
}

.chapter-nav a:hover,
.chapter-nav a:focus-visible {
  background: #f5f6f7;
  color: var(--ink);
  outline: none;
}

.chapter-nav a.active {
  background: var(--flix-red-soft);
  color: var(--flix-red-dark);
  font-weight: 700;
}

.chapter-nav a.active > span {
  color: var(--flix-red);
}

.sidebar-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: auto;
  padding-top: 26px;
  color: #8b909a;
  font-size: 0.67rem;
  line-height: 1.5;
}

.manual-main {
  margin-left: var(--sidebar-width);
  min-width: 0;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 230px;
  gap: 42px;
  align-items: end;
  min-height: 610px;
  padding: clamp(48px, 7vw, 102px);
  overflow: hidden;
  background:
    radial-gradient(circle at 93% 8%, rgba(237, 0, 0, 0.33), transparent 31%),
    linear-gradient(145deg, #151517 0%, #09090a 72%);
  color: #ffffff;
}

.hero::after {
  content: "";
  position: absolute;
  right: -120px;
  bottom: -260px;
  width: 520px;
  height: 520px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  box-shadow: 0 0 0 74px rgba(255, 255, 255, 0.025), 0 0 0 148px rgba(255, 255, 255, 0.018);
}

.hero-copy {
  position: relative;
  z-index: 1;
  width: 100%;
  min-width: 0;
  max-width: 790px;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 22px;
  color: #ff6969;
}

.hero-eyebrow::before {
  content: "";
  width: 34px;
  height: 2px;
  background: var(--flix-red);
}

.hero h1 {
  min-width: 0;
  max-width: 820px;
  margin: 0;
  font-family: "League Spartan", sans-serif;
  font-size: clamp(3.6rem, 6.6vw, 6.9rem);
  font-weight: 700;
  letter-spacing: -0.048em;
  line-height: 0.89;
  text-wrap: balance;
}

.hero h1 em {
  display: block;
  color: var(--flix-red);
  font-style: normal;
}

.hero-copy > p {
  width: 100%;
  max-width: 690px;
  margin: 28px 0 32px;
  color: #c9c9cf;
  font-size: clamp(0.98rem, 1.4vw, 1.13rem);
  line-height: 1.75;
}

.primary-link {
  display: inline-flex;
  gap: 18px;
  align-items: center;
  padding: 14px 19px;
  border-radius: 10px;
  background: var(--flix-red);
  color: #ffffff;
  font-size: 0.83rem;
  font-weight: 700;
  text-decoration: none;
  transition: transform 160ms ease, background 160ms ease;
}

.primary-link:hover,
.primary-link:focus-visible {
  background: #ff1515;
  transform: translateY(-2px);
  outline: none;
}

.primary-link span {
  font-size: 1.2rem;
  line-height: 1;
}

.hero-mark {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 17px;
  align-items: flex-end;
  padding: 22px 0 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.25);
}

.hero-mark > span {
  color: var(--flix-red);
  font-family: "League Spartan", sans-serif;
  font-size: 5.2rem;
  font-weight: 700;
  letter-spacing: -0.06em;
  line-height: 0.75;
}

.hero-mark p {
  margin: 0;
  color: #b9bac1;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  line-height: 1.45;
  text-transform: uppercase;
}

.document-info {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: #dedfe3;
  border-bottom: 1px solid #dedfe3;
}

.document-info > div {
  min-width: 0;
  padding: 26px clamp(24px, 4vw, 54px);
  background: #ffffff;
}

.document-info span,
.document-info strong,
.document-info small {
  display: block;
}

.document-info span {
  margin-bottom: 8px;
  color: #8a909b;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.document-info strong {
  font-family: "League Spartan", sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
}

.document-info small {
  margin-top: 4px;
  color: #747b88;
  font-size: 0.72rem;
}

.content-area {
  width: min(100%, 1040px);
  margin: 0 auto;
  padding: 70px 42px 90px;
}

.search-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding: 18px 20px;
  border: 1px solid #f3caca;
  border-radius: 14px;
  background: var(--flix-red-soft);
  color: #742222;
  font-size: 0.8rem;
}

.search-summary strong {
  color: var(--flix-red);
}

.search-summary button,
.empty-state button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--flix-red-dark);
  cursor: pointer;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.chapter-card {
  margin-bottom: 42px;
  padding: clamp(35px, 6vw, 68px);
  scroll-margin-top: 24px;
  border: 1px solid #e3e5e9;
  border-radius: 24px;
  background: var(--paper);
  box-shadow: 0 16px 60px rgba(17, 24, 39, 0.055);
}

.chapter-header {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 24px;
  align-items: start;
  margin-bottom: 34px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--line);
}

.chapter-number {
  color: var(--flix-red);
  font-family: "League Spartan", sans-serif;
  font-size: clamp(3.2rem, 6vw, 4.8rem);
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 0.8;
}

.chapter-label {
  display: block;
  margin-bottom: 7px;
}

.chapter-header h2 {
  max-width: 720px;
  margin: 0;
  font-family: "League Spartan", sans-serif;
  font-size: clamp(2rem, 4vw, 3.4rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 0.98;
  text-wrap: balance;
}

.lead-text {
  margin: 0 0 30px;
  padding-left: 21px;
  border-left: 4px solid var(--flix-red);
  color: #262d39;
  font-size: clamp(1.02rem, 1.8vw, 1.25rem);
  font-weight: 500;
  line-height: 1.68;
}

.body-text {
  margin: 0 0 17px;
  color: #505865;
  font-size: 0.92rem;
  line-height: 1.85;
}

.manual-section {
  margin-top: 39px;
}

.manual-section h3,
.callout h3 {
  margin: 0 0 14px;
  color: #1c2430;
  font-family: "League Spartan", sans-serif;
  font-size: clamp(1.35rem, 2.2vw, 1.78rem);
  font-weight: 700;
  line-height: 1.15;
}

.arrow-list {
  display: grid;
  gap: 12px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.opening-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 28px;
  margin: 22px 0 30px;
  padding: 20px 24px;
  border-radius: 14px;
  background: #f7f8f9;
}

.after-list {
  margin-top: 21px;
}

.inline-callout {
  margin-top: 24px;
}

.arrow-list li {
  position: relative;
  padding: 3px 0 3px 31px;
  color: #4f5764;
  font-size: 0.88rem;
  line-height: 1.7;
}

.arrow-list li::before {
  content: "→";
  position: absolute;
  top: 4px;
  left: 0;
  color: var(--flix-red);
  font-size: 1.06rem;
  font-weight: 700;
}

.step-list {
  display: grid;
  gap: 14px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: steps;
}

.step-list li {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 15px;
  align-items: start;
  counter-increment: steps;
  color: #4d5562;
  font-size: 0.86rem;
  line-height: 1.7;
}

.step-list li::before {
  content: counter(steps, decimal-leading-zero);
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--flix-red);
  color: #ffffff;
  font-family: "League Spartan", sans-serif;
  font-size: 0.76rem;
  font-weight: 700;
}

.step-list li > span {
  padding-top: 5px;
}

.callout {
  position: relative;
  margin-top: 34px;
  padding: 26px 28px 26px 31px;
  overflow: hidden;
  border: 1px solid #f1cccc;
  border-radius: 16px;
  background: linear-gradient(135deg, #fff4f4, #ffffff);
}

.callout::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--flix-red);
}

.callout > span {
  display: block;
  margin-bottom: 8px;
}

.callout p {
  margin: 0;
  color: #5f4a4a;
  font-size: 0.84rem;
  line-height: 1.75;
}

.organogram-figure {
  margin: 34px 0 0;
  overflow: hidden;
  border: 1px solid #e0e3e7;
  border-radius: 18px;
  background: #f1f3f5;
}

.organogram-figure img {
  display: block;
  width: 100%;
  height: auto;
}

.organogram-figure figcaption {
  padding: 14px 18px;
  border-top: 1px solid #dfe2e7;
  background: #ffffff;
  color: #737b87;
  font-size: 0.72rem;
}

.empty-state {
  padding: 70px 40px;
  border: 1px dashed #d5d8de;
  border-radius: 24px;
  background: #ffffff;
  text-align: center;
}

.empty-state > span {
  color: var(--flix-red);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.empty-state h2 {
  margin: 12px 0 8px;
  font-family: "League Spartan", sans-serif;
  font-size: 2rem;
}

.empty-state p {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 0.86rem;
}

.site-footer {
  display: flex;
  gap: 22px;
  align-items: center;
  padding: 28px clamp(28px, 6vw, 76px);
  background: #0d0d0f;
  color: #ffffff;
}

.site-footer img {
  width: 144px;
  margin-right: -72px;
  object-fit: contain;
  object-position: left;
}

.site-footer p {
  margin: 0;
  color: #a8a8ad;
  font-size: 0.72rem;
}

.site-footer a {
  margin-left: auto;
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 700;
  text-decoration: none;
}

.mobile-header,
.page-overlay {
  display: none;
}

.back-to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 40;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--flix-red);
  box-shadow: 0 10px 30px rgba(177, 0, 0, 0.28);
  color: #ffffff;
  font-size: 1.15rem;
  text-decoration: none;
}

@media (max-width: 1160px) {
  :root {
    --sidebar-width: 282px;
  }

  .sidebar {
    padding-inline: 23px;
  }

  .hero {
    grid-template-columns: minmax(0, 1fr) 190px;
    min-height: 560px;
    padding-inline: 60px;
  }
}

@media (max-width: 860px) {
  html {
    scroll-padding-top: 82px;
  }

  .mobile-header {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 70;
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-width: 0;
    height: 72px;
    padding: 0 20px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
  }

  .mobile-brand {
    display: flex;
    flex: 1 1 auto;
    gap: 10px;
    align-items: center;
    min-width: 0;
    overflow: hidden;
    color: var(--ink);
    font-size: 0.74rem;
    font-weight: 700;
    text-decoration: none;
  }

  .mobile-brand::before {
    content: "";
    flex: 0 0 86px;
    width: 86px;
    height: 34px;
    background-image: url("assets/flix-logo.png");
    background-repeat: no-repeat;
    background-position: left center;
    background-size: auto 34px;
  }

  .mobile-brand img {
    display: none;
  }

  .mobile-brand span {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .menu-button {
    display: flex;
    flex: 0 0 42px;
    flex-direction: column;
    gap: 4px;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 10px;
    background: #f3f4f6;
    cursor: pointer;
  }

  .menu-button span {
    width: 18px;
    height: 2px;
    border-radius: 2px;
    background: var(--ink);
  }

  .sidebar {
    z-index: 80;
    width: min(86vw, 340px);
    transform: translateX(-105%);
    box-shadow: 22px 0 60px rgba(17, 24, 39, 0.16);
    transition: transform 220ms ease;
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .page-overlay {
    position: fixed;
    inset: 0;
    z-index: 75;
    display: block;
    border: 0;
    background: rgba(12, 14, 18, 0.56);
  }

  .manual-main {
    margin-left: 0;
    padding-top: 72px;
  }

  .hero {
    width: 100%;
    min-width: 0;
    min-height: 540px;
    padding: 70px 42px 58px;
  }

  .chapter-card,
  .chapter-header > div {
    min-width: 0;
  }

  .chapter-header h2 {
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .chapter-card {
    scroll-margin-top: 92px;
  }
}

@media (max-width: 640px) {
  .mobile-header {
    height: 66px;
    padding-inline: 14px;
  }

  .mobile-brand {
    gap: 8px;
    font-size: 0.7rem;
  }

  .mobile-brand::before {
    flex-basis: 76px;
    width: 76px;
    height: 30px;
    background-size: auto 30px;
  }

  .menu-button {
    flex-basis: 40px;
    width: 40px;
    height: 40px;
  }

  .manual-main {
    padding-top: 66px;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 38px;
    min-height: auto;
    padding: 52px 20px 42px;
  }

  .hero h1 {
    max-width: 100%;
    font-size: clamp(2.35rem, 11.3vw, 3.15rem);
    letter-spacing: -0.04em;
    line-height: 0.93;
    overflow-wrap: anywhere;
    word-break: normal;
    hyphens: auto;
  }

  .hero h1 em {
    max-width: 100%;
  }

  .hero-eyebrow {
    gap: 9px;
    max-width: 100%;
    font-size: 0.6rem;
    letter-spacing: 0.12em;
    line-height: 1.4;
  }

  .hero-eyebrow::before {
    flex: 0 0 26px;
    width: 26px;
  }

  .hero-copy > p {
    max-width: 100%;
    margin-block: 24px 27px;
    font-size: 0.9rem;
    line-height: 1.68;
    overflow-wrap: anywhere;
  }

  .hero-mark {
    max-width: 220px;
  }

  .document-info {
    grid-template-columns: 1fr;
  }

  .document-info > div {
    padding: 21px 24px;
  }

  .content-area {
    width: 100%;
    padding: 34px 14px 56px;
  }

  .chapter-card {
    margin-bottom: 22px;
    padding: 29px 22px 34px;
    border-radius: 18px;
    scroll-margin-top: 82px;
  }

  .chapter-header {
    grid-template-columns: 50px minmax(0, 1fr);
    gap: 15px;
    margin-bottom: 27px;
    padding-bottom: 25px;
  }

  .chapter-number {
    font-size: 3.2rem;
  }

  .chapter-header h2 {
    font-size: clamp(1.65rem, 8vw, 2.35rem);
    overflow-wrap: anywhere;
  }

  .lead-text {
    padding-left: 16px;
    font-size: 0.98rem;
    line-height: 1.65;
  }

  .body-text {
    font-size: 0.86rem;
    line-height: 1.77;
  }

  .manual-section {
    margin-top: 32px;
  }

  .manual-section h3,
  .callout h3 {
    font-size: 1.42rem;
  }

  .arrow-list li {
    padding-left: 26px;
    font-size: 0.83rem;
  }

  .opening-list {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 17px 18px;
  }

  .step-list li {
    grid-template-columns: 34px 1fr;
    gap: 12px;
    font-size: 0.82rem;
  }

  .step-list li::before {
    width: 34px;
    height: 34px;
  }

  .callout {
    padding: 23px 21px 23px 25px;
  }

  .site-footer {
    flex-wrap: wrap;
    gap: 12px 18px;
    padding: 26px 24px;
  }

  .site-footer img {
    width: 82px;
    height: 32px;
    margin: 0;
    object-fit: cover;
    object-position: left center;
  }

  .site-footer p {
    flex-basis: 100%;
    order: 3;
  }

  .site-footer a {
    margin-left: auto;
  }

  .back-to-top {
    right: 14px;
    bottom: 14px;
  }
}

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

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  .sidebar,
  .mobile-header,
  .reading-progress,
  .back-to-top,
  .primary-link,
  .search-summary {
    display: none !important;
  }

  .manual-main {
    margin: 0;
    padding: 0;
  }

  .hero {
    min-height: auto;
    break-after: page;
  }

  .chapter-card {
    break-before: page;
    border: 0;
    box-shadow: none;
  }
}
