/* Firnox public-site styles. Pairs with tokens.css.
 *
 * tokens.css holds the design tokens + the small set of primitives (.btn,
 * .badge, .card, .input, .code-block, .fx-nav, .fx-footer, .eyebrow). This
 * file extracts the recurring layout / page-shell patterns that the design
 * handoff expressed as inline styles.
 */

/* ---------------------------------------------------------------------- */
/* Page shell                                                             */
/* ---------------------------------------------------------------------- */

.fx-section {
  max-width: 1280px;
  margin: 0 auto;
  padding-left: 40px;
  padding-right: 40px;
}
.fx-section--narrow { max-width: 1180px; }
.fx-section--article { max-width: 760px; }

.fx-section + .fx-section--rule { border-top: 1px solid var(--border-faint); }

.fx-section--py-hero { padding-top: 80px; padding-bottom: 60px; }
.fx-section--py-lg { padding-top: 60px; padding-bottom: 60px; }
.fx-section--py-md { padding-top: 32px; padding-bottom: 40px; }

/* ---------------------------------------------------------------------- */
/* Typography helpers                                                      */
/* ---------------------------------------------------------------------- */

.fx-h1-hero {
  font-family: var(--font-hero);
  font-weight: 600;
  font-size: 64px;
  line-height: 1.05;
  letter-spacing: -0.025em;
  margin: 0 0 22px;
}
.fx-h1-page {
  font-family: var(--font-hero);
  font-size: 52px;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
  font-weight: 600;
}
.fx-h1-article {
  font-family: var(--font-hero);
  font-size: 44px;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 10px 0 16px;
  font-weight: 600;
}
.fx-h2-section {
  font-family: var(--font-hero);
  font-size: 36px;
  margin: 0 0 6px;
  font-weight: 500;
  letter-spacing: -0.02em;
}
.fx-h2-block {
  font-family: var(--font-hero);
  font-size: 26px;
  margin: 0 0 16px;
  font-weight: 500;
}
.fx-lede {
  font-size: 18px;
  color: var(--fg-muted);
  line-height: 1.55;
  margin: 0 0 32px;
  max-width: 560px;
}
.fx-lede--centered { max-width: 640px; margin-left: auto; margin-right: auto; }

.fx-prose p { font-size: 16px; line-height: 1.7; color: var(--fg-muted); margin: 0 0 18px; }
.fx-prose p:first-child { font-size: 17px; color: var(--fg); margin-bottom: 18px; }
.fx-prose h2 { font-family: var(--font-hero); font-size: 26px; margin: 32px 0 14px; font-weight: 500; }
.fx-prose :not(pre) > code,
.fx-prose .fx-mono-inline {
  font-family: var(--font-mono);
  background: var(--bg-code);
  color: var(--primary);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.9em;
  border: 1px solid var(--border);
}

/* Code blocks rendered by python-markdown's codehilite extension.
   The Pygments `linenums=True` output is a <table> with two <td>:
   `.linenos` (gutter) and `.code` (highlighted source). The wrapper
   div carries the `.codehilite` class. */
.fx-prose .codehilite {
  margin: 0 0 18px;
  background: var(--bg-code);
  border: 1px solid var(--border-faint);
  border-radius: var(--r);
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.55;
}
.fx-prose .codehilite pre {
  margin: 0;
  background: transparent;
  color: var(--fg);
  white-space: pre;
}
.fx-prose .codehilite code {
  background: transparent;
  border: none;
  padding: 0;
  border-radius: 0;
  color: inherit;
  font-size: inherit;
}
.fx-prose .codehilite table.codehilitetable {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
}
.fx-prose .codehilite td { padding: 0; vertical-align: top; }
.fx-prose .codehilite td.linenos {
  width: 1%;
  user-select: none;
  text-align: right;
  background: var(--bg-elev);
  border-right: 1px solid var(--border-faint);
}
.fx-prose .codehilite td.linenos pre { padding: 12px 10px; color: var(--fg-dim); }
.fx-prose .codehilite td.code { width: 100%; }
.fx-prose .codehilite td.code pre { padding: 12px 14px; overflow-x: auto; }

/* Pygments token colours, mapped to design-system syntax variables. */
.fx-prose .codehilite .k,            /* keyword: def, class, if, for, return */
.fx-prose .codehilite .kc,           /* True / False / None */
.fx-prose .codehilite .kd,           /* declaration */
.fx-prose .codehilite .kn,           /* import */
.fx-prose .codehilite .ow            /* and / or / not / in */
  { color: var(--syn-keyword); }
.fx-prose .codehilite .s,            /* string */
.fx-prose .codehilite .s1,
.fx-prose .codehilite .s2,
.fx-prose .codehilite .sb            /* backticks */
  { color: var(--syn-string); }
.fx-prose .codehilite .mi,           /* integer */
.fx-prose .codehilite .mf,           /* float */
.fx-prose .codehilite .il            /* long */
  { color: var(--syn-number); }
.fx-prose .codehilite .c,            /* comment */
.fx-prose .codehilite .c1,
.fx-prose .codehilite .cm,
.fx-prose .codehilite .cp            /* preprocessor */
  { color: var(--syn-comment); font-style: italic; }
.fx-prose .codehilite .nf,           /* function name */
.fx-prose .codehilite .nb,           /* builtin: max, len, enumerate */
.fx-prose .codehilite .bp            /* self */
  { color: var(--syn-fn); }
.fx-prose .codehilite .nc            /* class name */
  { color: var(--syn-type); }
.fx-prose .codehilite .o,            /* operator */
.fx-prose .codehilite .p             /* punctuation */
  { color: var(--fg-muted); }
.fx-prose .codehilite .n             /* plain name */
  { color: var(--fg); }

.fx-prose details {
  margin: 0 0 18px;
  border: 1px solid var(--border-faint);
  border-radius: var(--r);
  background: var(--bg-elev);
  overflow: hidden;
}
.fx-prose details > summary {
  list-style: none;
  cursor: pointer;
  padding: 10px 14px;
  font-size: 13px;
  font-family: var(--font-mono);
  color: var(--fg-muted);
  user-select: none;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.12s, color 0.12s;
}
.fx-prose details > summary::-webkit-details-marker { display: none; }
.fx-prose details > summary::before {
  content: "›";
  display: inline-block;
  font-size: 16px;
  line-height: 1;
  color: var(--fg-dim);
  transition: transform 180ms ease, color 180ms ease;
}
.fx-prose details[open] > summary::before {
  transform: rotate(90deg);
  color: var(--accent);
}
.fx-prose details > summary:hover { background: var(--bg-elev-2); color: var(--fg); }
.fx-prose details[open] > summary { border-bottom: 1px solid var(--border-faint); }
.fx-prose details > img,
.fx-prose details p > img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 14px;
  border-radius: 6px;
}

/* ---------------------------------------------------------------------- */
/* Breadcrumb                                                             */
/* ---------------------------------------------------------------------- */

.fx-breadcrumb { font-size: 13px; color: var(--fg-dim); margin-bottom: 14px; }
.fx-breadcrumb a { text-decoration: none; }
.fx-breadcrumb a:hover { color: var(--fg); }
.fx-breadcrumb .sep { margin: 0 8px; }
.fx-breadcrumb .accent-unity { color: var(--unity); }
.fx-breadcrumb .accent-leetcode { color: var(--leetcode); }
.fx-breadcrumb .accent-muted { color: var(--fg-muted); }

/* ---------------------------------------------------------------------- */
/* Hero stats / inline meta                                                */
/* ---------------------------------------------------------------------- */

.fx-hero-stats { margin-top: 36px; display: flex; gap: 28px; font-size: 13px; color: var(--fg-dim); flex-wrap: wrap; }
.fx-hero-stats strong { color: var(--fg); font-weight: 600; }

.fx-meta-row { display: flex; gap: 24px; font-size: 13px; color: var(--fg-dim); flex-wrap: wrap; }

/* ---------------------------------------------------------------------- */
/* Cards                                                                  */
/* ---------------------------------------------------------------------- */

.fx-card-tight { padding: 18px; }
.fx-card-pad { padding: 24px; }
.fx-card-pad-lg { padding: 28px; }

.fx-card-flow { display: flex; flex-direction: column; }
.fx-card-flow > .grow { flex: 1; }

/* Course / tutorial card body */
.fx-cc-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.fx-cc-title { font-size: 17px; margin: 0 0 6px; font-weight: 500; line-height: 1.3; }
.fx-cc-desc { color: var(--fg-muted); font-size: 13px; line-height: 1.5; margin: 0 0 14px; flex: 1; }
.fx-cc-foot { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--fg-dim); padding-top: 10px; border-top: 1px solid var(--border-faint); }

/* Corner ribbon for the tier indicator on course cards. Sits flush to the
   bottom-right of the card: outer corner matches the card radius, inner
   (top-left) corner is a smaller round, the other two corners are square.
   The paid variant is a two-tone split (price | sub) with a diagonal slash
   between the halves to read as "or". */
.fx-card-ribbon {
  position: absolute;
  bottom: 0;
  right: 0;
  display: flex;
  align-items: stretch;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #fff;
  border-bottom-right-radius: var(--r-lg);
  border-top-left-radius: 10px;
  overflow: hidden;
  z-index: 1;
}
.fx-card-ribbon__half { display: inline-flex; align-items: center; padding: 6px 12px 7px; }
.fx-card-ribbon--free .fx-card-ribbon__half { background: var(--success); color: var(--accent-fg); }
.fx-card-ribbon--sub-only .fx-card-ribbon__half { background: var(--accent-deep); }
.fx-card-ribbon--owned .fx-card-ribbon__half { background: var(--accent); color: var(--accent-fg); }
.fx-card-ribbon--paid .fx-card-ribbon__half--buy {
  background: var(--accent);
  color: var(--accent-fg);
  padding-right: 18px;
  clip-path: polygon(0 0, 100% 0, calc(100% - 9px) 100%, 0 100%);
}
.fx-card-ribbon--paid .fx-card-ribbon__half--sub {
  background: var(--accent-deep);
  padding-left: 18px;
  margin-left: -9px;
  clip-path: polygon(9px 0, 100% 0, 100% 100%, 0 100%);
}

/* ---------------------------------------------------------------------- */
/* Pricing cards                                                          */
/* ---------------------------------------------------------------------- */

.fx-pricing-grid { display: grid; gap: 16px; align-items: stretch; }
.fx-pricing-grid--pricing { grid-template-columns: 1fr 1.25fr 1fr; }

.fx-pricing-card { display: flex; flex-direction: column; }
.fx-pricing-card .price-big { font-size: 36px; font-weight: 500; margin-bottom: 4px; }
.fx-pricing-card .price-sub { color: var(--fg-dim); font-size: 13px; margin-bottom: 22px; }
.fx-pricing-card ul.feat { list-style: none; padding: 0; margin: 0 0 24px; flex: 1; }
.fx-pricing-card ul.feat li { display: flex; gap: 10px; padding: 7px 0; font-size: 14px; color: var(--fg-muted); }
.fx-pricing-card ul.feat li .tick { color: var(--success); }
.fx-pricing-card ul.feat li .tick--primary { color: var(--primary); }

.fx-pricing-card--featured {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary), 0 30px 60px -30px oklch(0.74 0.16 55 / 0.4);
  background: linear-gradient(180deg, oklch(0.24 0.014 60) 0%, var(--bg-elev) 60%);
  position: relative;
}
.fx-pricing-card .most-popular {
  position: absolute; top: -10px; right: 24px;
  background: var(--primary); color: var(--primary-fg);
  font-family: var(--font-mono); font-size: 10px;
  padding: 3px 10px; border-radius: 999px;
  font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase;
}
.fx-pricing-card .one-line {
  color: var(--fg); font-size: 14px; margin: 14px 0 18px; font-weight: 500;
}
.fx-pricing-card .one-line .accent { color: var(--primary); }

.fx-counter-well {
  padding: 14px 16px;
  background: var(--bg-code);
  border-radius: var(--r);
  border: 1px solid var(--border-faint);
  margin-bottom: 18px;
}

/* ---------------------------------------------------------------------- */
/* SubPrice (the strikethrough + founding badge block)                    */
/* ---------------------------------------------------------------------- */

.fx-subprice { }
.fx-subprice .row {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 6px;
}
.fx-subprice .now {
  font-size: 44px; font-weight: 600; line-height: 1;
  letter-spacing: -0.02em;
  color: var(--fg);
}
.fx-subprice.discount .now { color: var(--primary); }
.fx-subprice .per { font-size: 13px; color: var(--fg-dim); }
.fx-subprice .was {
  font-size: 20px; color: var(--fg-faint);
  text-decoration: line-through; text-decoration-thickness: 1.5px; margin-left: 2px;
}
.fx-subprice .yearly { font-size: 13px; color: var(--fg-dim); }
.fx-subprice .badge-tier {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  background: linear-gradient(135deg, oklch(0.30 0.10 55), oklch(0.26 0.08 55));
  border: 1px solid var(--primary);
  align-self: center;
}
.fx-subprice .badge-tier .label {
  font-size: 11px; color: var(--primary);
  font-family: var(--font-mono); font-weight: 600; letter-spacing: 0.04em;
}
.fx-subprice .badge-tier .pct { font-size: 11px; color: var(--fg); font-weight: 600; }

/* Smaller variant for course detail right rail */
.fx-subprice--md .row { gap: 6px; }
.fx-subprice--md .now { font-size: 30px; }
.fx-subprice--md .was { font-size: 14px; }
.fx-subprice--md .per { font-size: 12px; }
.fx-subprice--md .yearly { font-size: 12px; }
.fx-subprice--md .badge-tier { padding: 2px 8px; gap: 4px; margin-left: auto; }
.fx-subprice--md .badge-tier .label { font-size: 10px; letter-spacing: 0.03em; }
.fx-subprice--md .badge-tier .pct { font-size: 10px; }

/* ---------------------------------------------------------------------- */
/* Founding counter                                                       */
/* ---------------------------------------------------------------------- */

.fx-counter { font-size: 12px; line-height: 1.5; }
.fx-counter .label { color: var(--fg); font-weight: 500; display: block; margin-bottom: 6px; }
.fx-counter .bar { height: 4px; background: var(--bg-elev-2); border-radius: 999px; overflow: hidden; }
.fx-counter .bar > span { display: block; height: 100%; border-radius: 999px; background: var(--primary); }
.fx-counter .bar.danger > span { background: var(--danger); }
.fx-counter .bar.leetcode > span { background: var(--leetcode); }
.fx-counter .sub { color: var(--fg-dim); margin-top: 6px; display: block; }

/* ---------------------------------------------------------------------- */
/* Filter chips (track page)                                              */
/* ---------------------------------------------------------------------- */

.fx-chip-row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.fx-chip {
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
  text-decoration: none;
}
.fx-chip--diff {
  font-family: var(--font-sans);
  letter-spacing: 0;
}
.fx-chip--active-unity { background: var(--unity-bg); border-color: var(--unity); color: var(--unity); }
.fx-chip--active-leetcode { background: var(--leetcode-bg); border-color: var(--leetcode); color: var(--leetcode); }

/* Level chips: text colour signals the level so the meaning reads even when
   inactive. Selected adds a matching outline + faint tinted fill. */
.fx-chip--level-all { color: var(--fg); }
.fx-chip--level-beginner { color: var(--success); }
.fx-chip--level-intermediate { color: var(--warn); }
.fx-chip--level-advanced { color: var(--danger); }
.fx-chip--level-all.fx-chip--active { background: var(--bg-elev-2); border-color: var(--fg-muted); }
.fx-chip--level-beginner.fx-chip--active { background: oklch(0.24 0.04 150); border-color: var(--success); }
.fx-chip--level-intermediate.fx-chip--active { background: oklch(0.26 0.04 75); border-color: var(--warn); }
.fx-chip--level-advanced.fx-chip--active { background: oklch(0.24 0.05 25); border-color: var(--danger); }

/* Per-card track accent. Cards appear in mixed-track contexts (search, landing)
   so each one needs to carry its own --accent rather than inheriting the
   page-level body[data-track] override. */
.card--track-unity {
  --accent: var(--unity);
  --accent-fg: oklch(0.18 0.012 60);
  --accent-deep: var(--unity-bg);
}
.card--track-leetcode {
  --accent: var(--leetcode);
  --accent-fg: oklch(0.18 0.012 60);
  --accent-deep: var(--leetcode-bg);
}

/* Track chips: same pattern as level chips. Text colour signals which track,
   selected adds a tinted fill + matching outline. */
.fx-chip--track-all,
.fx-chip--track-unity,
.fx-chip--track-leetcode {
  font-family: var(--font-sans);
  letter-spacing: 0;
}
.fx-chip--track-all { color: var(--fg); }
.fx-chip--track-unity { color: var(--unity); }
.fx-chip--track-leetcode { color: var(--leetcode); }
.fx-chip--track-all.fx-chip--active { background: var(--bg-elev-2); border-color: var(--fg-muted); }
.fx-chip--track-unity.fx-chip--active { background: var(--unity-bg); border-color: var(--unity); }
.fx-chip--track-leetcode.fx-chip--active { background: var(--leetcode-bg); border-color: var(--leetcode); }

/* ---------------------------------------------------------------------- */
/* Course grid + tutorial list                                            */
/* ---------------------------------------------------------------------- */

.fx-course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }

.fx-tutorial-list .row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border-faint);
  align-items: center;
}
.fx-tutorial-list .row:last-child { border-bottom: none; }
.fx-tutorial-list .row .title { font-size: 15px; font-weight: 500; margin-bottom: 4px; }
.fx-tutorial-list .row .meta { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--fg-dim); flex-wrap: wrap; }
.fx-tutorial-list .row .read { color: var(--fg-muted); font-size: 13px; }

.fx-tutorial-list--leetcode .row {
  grid-template-columns: 60px 1fr 90px auto;
  padding: 16px 20px;
  font-size: 13px;
}
.fx-tutorial-list--leetcode .row .num { font-family: var(--font-mono); color: var(--fg-dim); }

.fx-empty {
  padding: 32px;
  text-align: center;
  color: var(--fg-muted);
}
.fx-empty .label {
  font-family: var(--font-mono); font-size: 12px;
  margin-bottom: 8px; color: var(--fg-dim); letter-spacing: 0.08em;
}

/* ---------------------------------------------------------------------- */
/* Course detail                                                          */
/* ---------------------------------------------------------------------- */

.fx-cd-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 36px; align-items: flex-start; }
.fx-cd-rail { position: sticky; top: 24px; }
.fx-cd-info-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 40px; }
@media (max-width: 1000px) {
  .fx-cd-grid,
  .fx-cd-info-grid { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .fx-cd-rail { position: static; }
}

.fx-cd-rail .or {
  font-family: var(--font-mono); font-size: 11px; color: var(--fg-dim);
  text-transform: uppercase; letter-spacing: 0.12em;
  margin: 0 0 10px;
}
.fx-cd-rail .own-row {
  display: flex; align-items: baseline; gap: 8px; margin-bottom: 14px;
}
.fx-cd-rail .own-row .num { font-size: 30px; font-weight: 600; line-height: 1; letter-spacing: -0.02em; }
.fx-cd-rail .own-row .meta { color: var(--fg-dim); font-size: 12px; }
.fx-cd-rail .signin-line { font-size: 12px; color: var(--fg-dim); text-align: center; margin-top: 14px; }

.fx-sub-block {
  padding: 16px; margin-bottom: 14px;
  border-radius: var(--r);
  background: var(--bg-elev-2);
  border: 1px solid var(--accent);
}
.fx-sub-block .copy {
  font-size: 13px; color: var(--fg); line-height: 1.5; margin: 12px 0;
}
.fx-sub-block .copy strong { color: var(--accent); font-weight: 600; }

.fx-payg-block {
  padding: 16px;
  border-radius: var(--r);
  background: var(--bg-elev-2);
  border: 1px solid var(--border-faint);
}

.fx-chapter-row {
  display: grid;
  grid-template-columns: 44px 1fr auto auto;
  gap: 16px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-faint);
  align-items: center;
}
.fx-chapter-row:last-child { border-bottom: none; }
.fx-chapter-row.active { background: oklch(0.24 0.04 55); }
.fx-chapter-row .num {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--bg-elev-2); color: var(--fg-muted);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; font-family: var(--font-mono);
}
.fx-chapter-row .num.done,
.fx-chapter-row .num.active { background: var(--primary); color: var(--primary-fg); }
.fx-chapter-row .title { font-size: 14px; font-weight: 500; }
.fx-chapter-row .title.locked { color: var(--fg-muted); }
.fx-chapter-row .duration { font-family: var(--font-mono); font-size: 12px; color: var(--fg-dim); }

/* ---------------------------------------------------------------------- */
/* Course-page accordion ("What you'll learn")                            */
/* ---------------------------------------------------------------------- */
.fx-accordion {
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  background: var(--bg-elev);
}
.fx-accordion-row { border-bottom: 1px solid var(--border-faint); }
.fx-accordion-row:last-child { border-bottom: none; }
.fx-accordion-row > summary {
  display: grid;
  grid-template-columns: 28px 24px 1fr auto;
  gap: 14px;
  padding: 14px 18px;
  cursor: pointer;
  align-items: center;
  list-style: none;
  user-select: none;
  transition: background 0.12s;
}
.fx-accordion-row > summary::-webkit-details-marker { display: none; }
.fx-accordion-row > summary:hover { background: var(--bg-elev-2); }
.fx-accordion-row > summary .num {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--bg-elev-2); color: var(--fg-muted);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; font-family: var(--font-mono);
}
.fx-accordion-row > summary .chev {
  color: var(--fg-muted); font-size: 18px; line-height: 1;
  display: inline-block;
  transition: transform 180ms ease, color 180ms ease;
  transform-origin: center;
  text-align: center;
}
.fx-accordion-row[open] > summary .chev {
  transform: rotate(90deg);
  color: var(--accent);
}
.fx-accordion-row > summary .title {
  font-size: 14px; font-weight: 500;
}
.fx-accordion-row.is-locked > summary .title { color: var(--fg-muted); }
.fx-accordion-row > summary .meta {
  display: flex; gap: 10px; align-items: center;
  font-family: var(--font-mono); font-size: 12px; color: var(--fg-dim);
}
.fx-accordion-row[open] > summary,
.fx-accordion-row[open] .fx-accordion-body {
  background: var(--bg-elev-2);
}
.fx-accordion-row[open] > summary {
  border-bottom: 1px solid var(--border-faint);
}

.fx-accordion-body {
  padding: 16px 18px 20px 66px;
}
.fx-accordion-body .summary {
  margin: 0 0 14px; font-size: 14px; line-height: 1.55; color: var(--fg-muted);
}
.fx-accordion-body .actions {
  display: flex; gap: 8px; flex-wrap: wrap;
  justify-content: flex-end;
}
.fx-chapter-outline-label { margin: 4px 0 8px; }
.fx-chapter-outline {
  list-style: none;
  counter-reset: outline;
  margin: 0 0 16px; padding: 0;
  display: flex; flex-direction: column; gap: 6px;
}
.fx-chapter-outline li {
  counter-increment: outline;
  display: flex; align-items: center; gap: 12px;
  font-size: 13px; line-height: 1.4; color: var(--fg);
}
.fx-chapter-outline li::before {
  content: counter(outline);
  flex-shrink: 0;
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px;
  background: var(--outline-bg, var(--bg-elev-2));
  border: 1px solid var(--outline-accent, var(--border-faint));
  color: var(--outline-accent, var(--fg-muted));
  font-size: 11px; font-weight: 600;
  font-feature-settings: "tnum";
}
.fx-chapter-outline.accent-leetcode { --outline-accent: var(--leetcode); --outline-bg: var(--leetcode-bg); }
.fx-chapter-outline.accent-unity { --outline-accent: var(--unity); --outline-bg: var(--unity-bg); }

/* ---------------------------------------------------------------------- */
/* Watch page                                                             */
/* ---------------------------------------------------------------------- */
.fx-watch-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 32px;
  align-items: start;
}
@media (max-width: 1000px) {
  .fx-watch-grid { grid-template-columns: minmax(0, 1fr); }
  .fx-watch-sidebar { position: static !important; }
}

.fx-watch-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 18px;
}
.fx-watch-tabs-wrapper > .tab-input { position: absolute; opacity: 0; pointer-events: none; }
.fx-watch-tabs label {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 16px;
  font-size: 14px; font-weight: 500;
  color: var(--fg-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.fx-watch-tabs label:hover { color: var(--fg); }
.fx-watch-pane { display: none; }
#watch-tab-watch:checked ~ .fx-watch-tabs label[for="watch-tab-watch"],
#watch-tab-read:checked ~ .fx-watch-tabs label[for="watch-tab-read"] {
  color: var(--fg);
  border-bottom-color: var(--accent);
}
#watch-tab-watch:checked ~ .fx-watch-pane--watch,
#watch-tab-read:checked ~ .fx-watch-pane--read { display: block; }

.fx-watch-sidebar {
  position: sticky;
  top: 24px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  background: var(--bg-elev);
}
.fx-watch-sidebar .head {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-faint);
  font-size: 11px; font-weight: 600; letter-spacing: 0.5px;
  color: var(--fg-dim); text-transform: uppercase;
  font-family: var(--font-mono);
}
.fx-watch-sidebar a.row {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-faint);
  align-items: center;
  text-decoration: none; color: inherit;
  font-size: 13px;
}
.fx-watch-sidebar a.row:last-child { border-bottom: none; }
.fx-watch-sidebar a.row:hover { background: var(--bg-elev-2); }
.fx-watch-sidebar a.row.is-current { background: var(--accent-deep); }
.fx-watch-sidebar a.row.is-current .title { color: var(--fg); font-weight: 600; }
.fx-watch-sidebar a.row.is-current .dur { color: var(--fg-muted); }
.fx-watch-sidebar a.row .num {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--bg-elev-2); color: var(--fg-muted);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600; font-family: var(--font-mono);
}
.fx-watch-sidebar a.row.is-current .num,
.fx-watch-sidebar a.row.is-watched .num {
  background: var(--accent); color: var(--accent-fg);
}
.fx-watch-sidebar a.row .title {
  font-size: 13px; line-height: 1.35;
}
.fx-watch-sidebar a.row.is-locked .title { color: var(--fg-muted); }
.fx-watch-sidebar a.row .dur {
  font-family: var(--font-mono); font-size: 11px; color: var(--fg-dim);
}
.fx-watch-sidebar__sections {
  list-style: none;
  margin: 0;
  padding: 4px 0 8px 36px;
  border-bottom: 1px solid var(--border-faint);
  background: var(--bg-elev-2);
}
.fx-watch-sidebar[data-tab="watch"] .fx-watch-sidebar__sections--text { display: none; }
.fx-watch-sidebar[data-tab="read"]  .fx-watch-sidebar__sections--video { display: none; }
.fx-watch-sidebar__section {
  display: block;
  padding: 4px 12px 4px 8px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--fg-muted);
  text-decoration: none;
  border-radius: 4px;
}
.fx-watch-sidebar__section:hover { color: var(--fg); background: var(--accent-deep); }
.fx-prose h2 { scroll-margin-top: 16px; }
.fx-watch-sidebar .footer {
  padding: 14px 16px;
  border-top: 1px solid var(--border-faint);
  font-size: 12px; color: var(--fg-muted);
  display: flex; flex-direction: column; gap: 6px;
}
.fx-watch-sidebar .footer .signin { color: var(--accent); font-weight: 500; }

.fx-watch-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--border-faint);
}
.fx-watch-nav a { font-size: 14px; }

.fx-included-list > div {
  display: flex; gap: 12px;
  padding: 8px 0; font-size: 14px; color: var(--fg-muted);
  border-bottom: 1px dashed var(--border-faint);
}
.fx-included-list > div:last-child { border-bottom: none; }
.fx-included-list .icon { width: 20px; }

/* ---------------------------------------------------------------------- */
/* Comparison table                                                       */
/* ---------------------------------------------------------------------- */

.fx-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.fx-table thead th {
  text-align: left; padding: 14px 20px; font-weight: 500;
  background: var(--bg-elev-2);
  color: var(--fg);
  border-bottom: 1px solid var(--border);
}
.fx-table thead th.muted { color: var(--fg-muted); width: 40%; }
.fx-table thead th.primary { color: var(--primary); }
.fx-table tbody td { padding: 14px 20px; color: var(--fg-dim); border-bottom: 1px solid var(--border-faint); }
.fx-table tbody tr:last-child td { border-bottom: none; }
.fx-table tbody td.label { color: var(--fg-muted); }
.fx-table tbody td.yes { color: var(--success); }
.fx-table tbody td.yes-primary { color: var(--primary); font-weight: 500; }
.fx-table tbody td.no { color: var(--fg-dim); }

/* ---------------------------------------------------------------------- */
/* Newsletter strip                                                       */
/* ---------------------------------------------------------------------- */

.fx-newsletter {
  display: flex; justify-content: space-between; align-items: center;
  gap: 24px; flex-wrap: wrap;
  padding: 28px;
}
.fx-newsletter h3 { font-size: 20px; margin: 0 0 6px; font-weight: 500; }
.fx-newsletter p { color: var(--fg-muted); font-size: 14px; margin: 0; }
.fx-newsletter form { display: flex; gap: 8px; min-width: 360px; flex: 1; max-width: 480px; }
.fx-newsletter--unity { background: var(--unity-bg); border-color: var(--unity); }
.fx-newsletter--leetcode { background: var(--leetcode-bg); border-color: var(--leetcode); }

.fx-newsletter-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center;
}
.fx-newsletter-topics {
  display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--fg-muted);
}
.fx-newsletter-topics label { display: flex; gap: 6px; align-items: center; cursor: pointer; }
.fx-newsletter-topics input[type="checkbox"] { accent-color: var(--primary); cursor: pointer; }

.fx-footer-newsletter {
  display: flex; justify-content: space-between; align-items: center;
  gap: 24px; flex-wrap: wrap;
  padding: 16px 0;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 16px;
}

/* ---------------------------------------------------------------------- */
/* Flash messages (django.contrib.messages)                               */
/* ---------------------------------------------------------------------- */

.fx-messages {
  display: flex; flex-direction: column; gap: 8px;
  max-width: 720px; margin: 16px auto 0; padding: 0 24px;
}
.fx-messages__item {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-elev);
  padding: 12px 16px;
  font-size: 14px;
  color: var(--fg);
}
.fx-messages__item--success {
  border-color: var(--success, var(--primary));
  background: oklch(0.24 0.02 150);
}
.fx-messages__item--error {
  border-color: var(--danger, oklch(0.6 0.2 25));
  background: oklch(0.24 0.04 25);
}

/* ---------------------------------------------------------------------- */
/* Dialog (native <dialog>; opened with showModal)                        */
/* ---------------------------------------------------------------------- */

.fx-dialog {
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--bg-elev);
  color: var(--fg);
  padding: 28px;
  max-width: 440px;
  width: calc(100vw - 40px);
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.6);
}
.fx-dialog::backdrop {
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
}
.fx-dialog h3 {
  font-family: var(--font-hero);
  font-size: 22px; font-weight: 500;
  margin: 0 0 8px;
}
.fx-dialog p {
  color: var(--fg-muted);
  font-size: 14px; line-height: 1.55;
  margin: 0 0 20px;
}
.fx-dialog__actions {
  display: flex; gap: 8px; justify-content: flex-end;
}

/* ---------------------------------------------------------------------- */
/* Source-code gate / inline upsell card                                  */
/* ---------------------------------------------------------------------- */

.fx-upsell {
  padding: 20px; margin: 32px 0;
  border-color: var(--primary);
  background: linear-gradient(180deg, oklch(0.24 0.014 60) 0%, var(--bg-elev) 100%);
}
.fx-upsell .row {
  display: flex; justify-content: space-between; align-items: center; gap: 18px; flex-wrap: wrap;
}
.fx-upsell .head { font-size: 14px; font-weight: 500; margin-bottom: 4px; }
.fx-upsell .body { font-size: 13px; color: var(--fg-muted); }

/* ---------------------------------------------------------------------- */
/* Inline newsletter (article)                                            */
/* ---------------------------------------------------------------------- */

.fx-inline-newsletter {
  border-top: 1px solid var(--border-faint);
  border-bottom: 1px solid var(--border-faint);
  padding: 28px 0; margin: 40px 0; text-align: center;
}
.fx-inline-newsletter h3 { font-size: 20px; margin: 0 0 8px; font-weight: 500; }
.fx-inline-newsletter p { font-size: 14px; color: var(--fg-muted); margin: 0 0 16px; }
.fx-inline-newsletter form { display: flex; gap: 8px; max-width: 420px; margin: 0 auto; }

/* ---------------------------------------------------------------------- */
/* Carousel (most-watched)                                                 */
/* ---------------------------------------------------------------------- */

.fx-carousel-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 24px; padding: 0 40px;
}
.fx-carousel-head .arrows { display: flex; gap: 8px; }
.fx-carousel-head .arrows .btn {
  width: 38px; height: 38px; padding: 0; font-size: 16px;
}
.fx-carousel {
  display: flex; gap: 16px;
  overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 4px 40px 20px;
  scrollbar-width: none;
}
.fx-carousel::-webkit-scrollbar { display: none; }
.fx-carousel > .card { flex: 0 0 320px; scroll-snap-align: start; overflow: hidden; display: flex; flex-direction: column; }
.fx-carousel-links {
  display: flex; justify-content: center; gap: 18px; margin-top: 4px; padding: 0 40px;
}
.fx-carousel-links a { text-decoration: none; font-size: 14px; }
.fx-carousel-links .unity { color: var(--unity); }
.fx-carousel-links .leetcode { color: var(--leetcode); }

/* ---------------------------------------------------------------------- */
/* Hero layout                                                            */
/* ---------------------------------------------------------------------- */

.fx-hero {
  display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 60px; align-items: center;
}
.fx-hero h1 .accent { color: var(--primary); }
.fx-hero-cta { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

.fx-hero-visual { position: relative; height: 460px; }
.fx-hero-visual .top { position: absolute; top: 0; left: 0; right: 40px; transform: rotate(-1.5deg); }
.fx-hero-visual .bottom { position: absolute; bottom: 0; left: 60px; right: 0; transform: rotate(1.5deg); }
.fx-hero-visual img {
  display: block;
  width: 100%;
  object-fit: cover;
  border-radius: var(--r);
  border: 1px solid var(--border);
}
.fx-hero-visual .top img { height: 260px; }
.fx-hero-visual .bottom img { height: 240px; }

/* ---------------------------------------------------------------------- */
/* Unity scene mock — pure CSS                                            */
/* ---------------------------------------------------------------------- */

.fx-scene {
  position: relative; overflow: hidden;
  border-radius: var(--r);
  border: 1px solid var(--border);
  font-family: var(--font-mono); font-size: 10px;
  color: rgba(255, 255, 255, 0.7);
  background: linear-gradient(180deg, oklch(0.32 0.04 240) 0%, oklch(0.22 0.04 240) 60%, oklch(0.36 0.05 60) 100%);
}
.fx-scene .menubar {
  height: 22px; padding: 0 8px;
  background: oklch(0.20 0.005 60);
  border-bottom: 1px solid oklch(0.30 0.01 60);
  display: flex; align-items: center; gap: 12px;
  color: var(--fg-muted);
}
.fx-scene .menubar .label { margin-left: auto; color: var(--fg-dim); }
.fx-scene .ground {
  position: absolute; left: 10%; right: 10%; bottom: 18%; height: 30%;
  background: linear-gradient(180deg, oklch(0.35 0.06 130) 0%, oklch(0.28 0.05 130) 100%);
  transform: perspective(400px) rotateX(55deg); transform-origin: center bottom;
  border-radius: 4px;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.4);
}
.fx-scene .ground::after {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(0deg, rgba(255,255,255,0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.08) 1px, transparent 1px);
  background-size: 20px 20px;
}
.fx-scene .player {
  position: absolute; left: 44%; bottom: 38%; width: 42px; height: 42px;
  background: linear-gradient(135deg, oklch(0.78 0.15 55) 0%, oklch(0.60 0.15 55) 100%);
  border-radius: 4px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.4), inset -4px -4px 0 rgba(0,0,0,0.2);
}
.fx-scene .pickup {
  position: absolute; left: 62%; bottom: 42%; width: 18px; height: 18px;
  background: oklch(0.78 0.15 130); transform: rotate(45deg);
  box-shadow: 0 0 16px oklch(0.78 0.15 130 / 0.6);
}
.fx-scene .gizmo {
  position: absolute; left: 44%; bottom: 78%; width: 8px; height: 8px;
  border-radius: 50%; background: oklch(0.85 0.12 60);
}
.fx-scene .hierarchy,
.fx-scene .inspector {
  position: absolute; top: 22px; bottom: 0;
  width: 18%; padding: 8px 6px; line-height: 1.6;
  background: oklch(0.18 0.01 60); color: var(--fg-muted);
}
.fx-scene .hierarchy { left: 0; border-right: 1px solid oklch(0.28 0.01 60); }
.fx-scene .inspector { right: 0; width: 20%; border-left: 1px solid oklch(0.28 0.01 60); }
.fx-scene .h-head { color: var(--fg-dim); margin-bottom: 4px; }
.fx-scene .h-row { padding-left: 8px; }
.fx-scene .h-row.nested { padding-left: 16px; color: var(--fg-dim); }
.fx-scene .h-row.player-active { color: var(--unity); }
.fx-scene .insp-head { color: var(--unity); margin-bottom: 4px; }
.fx-scene .insp-dim { color: var(--fg-dim); }

/* Player overlay (course-detail video block) */
.fx-video-shell { position: relative; border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--border); }
.fx-video-shell .play {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, transparent 50%, rgba(0,0,0,0.4));
}
.fx-video-shell .play .btn-circle {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--primary); color: var(--primary-fg);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}
.fx-video-shell .timestamp {
  position: absolute; bottom: 16px; left: 16px; right: 16px;
  display: flex; justify-content: space-between;
  color: rgba(255, 255, 255, 0.85);
  font-family: var(--font-mono); font-size: 12px;
}

/* ---------------------------------------------------------------------- */
/* Misc                                                                   */
/* ---------------------------------------------------------------------- */

a { color: inherit; }
a.text-link { color: var(--fg-muted); text-decoration: none; }
a.text-link:hover { color: var(--fg); }
a.text-link--primary { color: var(--primary); text-decoration: none; }
a.text-link--primary:hover { color: var(--primary-hover); }

.fx-eyebrow-primary { color: var(--primary); }
.fx-eyebrow-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; }

.fx-faq-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin-top: 60px; }
.fx-faq-grid .q { font-size: 15px; font-weight: 500; margin-bottom: 6px; }
.fx-faq-grid .a { font-size: 14px; color: var(--fg-muted); line-height: 1.55; }

.fx-stack-md > * + * { margin-top: 16px; }

/* ---------------------------------------------------------------------- */
/* Responsive — narrow viewport (tablet & mobile)                          */
/* ---------------------------------------------------------------------- */

@media (max-width: 880px) {
  .fx-section { padding-left: 20px; padding-right: 20px; }
  .fx-section--py-hero { padding-top: 48px; padding-bottom: 40px; }
  .fx-section--py-lg { padding-top: 40px; padding-bottom: 40px; }

  .fx-nav { padding: 14px 20px; gap: 12px; }
  .fx-account-chip { order: 2; margin-left: auto; }
  .fx-nav-toggle { display: inline-flex; order: 3; }
  .fx-nav-collapsible {
    order: 4;
    flex-basis: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    display: none;
    padding-top: 14px;
    margin-top: 4px;
    border-top: 1px solid var(--border-faint);
  }
  .fx-nav-toggle-input:checked ~ .fx-nav-collapsible { display: flex; }
  .fx-nav-toggle-input:checked + .fx-nav-toggle .fx-nav-toggle-icon--bars { display: none; }
  .fx-nav-toggle-input:checked + .fx-nav-toggle .fx-nav-toggle-icon--close { display: inline-block; }
  .fx-nav-links { flex-direction: column; align-items: flex-start; gap: 14px; }
  .fx-nav-search { width: 100%; }
  .fx-nav-search input { width: 100%; font-size: 14px; }

  .fx-hero { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .fx-h1-hero { font-size: 44px; }
  .fx-hero-visual { display: none; }
  .fx-hero-stats { gap: 18px; margin-top: 24px; }

  .fx-pricing-grid--pricing { grid-template-columns: minmax(0, 1fr); }
  .fx-pricing-card--featured { order: -1; }
  .fx-card-pad-lg { padding: 22px; }

  .fx-newsletter-grid { grid-template-columns: minmax(0, 1fr); gap: 24px; }

  .fx-carousel-head { padding: 0 20px; }
  .fx-carousel { padding: 4px 20px 20px; }
  .fx-carousel-links { padding: 0 20px; flex-direction: column; gap: 10px; align-items: flex-start; }

  .fx-footer { padding: 24px 20px; }
}

@media (max-width: 600px) {
  .fx-h1-hero { font-size: 34px; }
  .fx-h2-section { font-size: 26px; }

  .fx-eyebrow-row { flex-direction: column; align-items: flex-start; gap: 6px; }
  .fx-carousel-head { flex-direction: column; align-items: flex-start; gap: 12px; }
  .fx-carousel > .card { flex: 0 0 270px; }

  .fx-faq-grid { grid-template-columns: minmax(0, 1fr); gap: 18px; margin-top: 40px; }
}
