:root {
  color-scheme: light;
  --section-title-size: clamp(1.45rem, 3vw, 2.45rem);
  --section-title-line-height: 1.15;
  --bg: #f8faff;
  --paper: #fff;
  --ink: #211737;
  --muted: #665b76;
  --line: #e6e0f0;
  --accent: #4b2aad;
  --accent-soft: #f0eafb;
  --cover: #edf2fe;
  --cover-dark: #dfe8fd;
  --hero: #281545;
  --hero-end: #462486;
  --hero-text: #fff;
  --hero-muted: #e3d6fc;
  --card-bg: #f5f7ff;
  --card-edge: rgb(75 42 173 / .55);
  --card-edge-hover: #ececec;
  --card-shadow: 0 0 0 2px rgb(106 141 255 / .16), 0 12px 30px rgb(75 42 173 / .22);
  --card-shadow-hover: 0 0 0 4px rgb(75 42 173 / .55), 0 0 0 7px rgb(236 236 236 / .42), 0 0 28px rgb(75 42 173 / .32), 0 0 52px rgb(106 141 255 / .28), 0 18px 42px rgb(75 42 173 / .32);
  --button-gold: #c99f37;
  --button-silver: #ececec;
  --header-logo: url('masterskillia-day.webp');
  --header-logo-size: 100%;
  --header-logo-position: 46%;
  --header-logo-blend: normal;
  font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  scroll-behavior: smooth;
  --header-height: 73px;
  scroll-padding-top: var(--header-height);
}
:root[data-theme="night"] { color-scheme: dark; }
@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] { color-scheme: dark; }
}

/* Only explicitly selected night, or system dark, selects the dark palette. */
:root[data-theme="night"] {
  --header-logo: url('masterskillia-night.webp');
  --header-logo-size: 110%;
  --header-logo-position: 38%;
  --header-logo-blend: screen;
  --bg: #101010; --paper: #191919; --ink: #ececec; --muted: #c6c1b8;
  --line: #3a3730; --accent: #d9b453; --accent-soft: #282318;
  --cover: #22211f; --cover-dark: #2d2820;
  --hero: #070707; --hero-end: #29251e; --hero-muted: #f0d7a8;
  --card-bg: #171717;
  --card-edge: rgb(201 159 55 / .65);
  --card-edge-hover: #c99f37;
  --card-shadow: 0 0 0 2px rgb(201 159 55 / .18), 0 14px 30px rgb(0 0 0 / .65);
  --card-shadow-hover: 0 0 0 4px rgb(201 159 55 / .45), 0 0 28px rgb(201 159 55 / .35), 0 18px 42px rgb(0 0 0 / .8);
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] {
    --header-logo: url('masterskillia-night.webp');
    --header-logo-size: 110%;
    --header-logo-position: 38%;
    --header-logo-blend: screen;
    --bg: #101010; --paper: #191919; --ink: #ececec; --muted: #c6c1b8;
    --line: #3a3730; --accent: #d9b453; --accent-soft: #282318;
    --cover: #22211f; --cover-dark: #2d2820;
    --hero: #070707; --hero-end: #29251e; --hero-muted: #f0d7a8;
    --card-bg: #171717;
    --card-edge: rgb(201 159 55 / .65);
    --card-edge-hover: #c99f37;
    --card-shadow: 0 0 0 2px rgb(201 159 55 / .18), 0 14px 30px rgb(0 0 0 / .65);
    --card-shadow-hover: 0 0 0 4px rgb(201 159 55 / .45), 0 0 28px rgb(201 159 55 / .35), 0 18px 42px rgb(0 0 0 / .8);
  }
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); line-height: 1.55; }
a { color: inherit; }
button, input, select { font: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
h1, h2, h3, p { margin: 0; }
[id] { scroll-margin-block: 12px; }
.shell { width: min(100% - 88px, 1280px); margin-inline: auto; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: fixed; inset: .75rem auto auto .75rem; z-index: 9; transform: translateY(-180%); background: var(--paper); padding: .6rem 1rem; }
.skip:focus { transform: translateY(0); }

.header { position: sticky; top: 0; z-index: 5; background: var(--paper); border-bottom: 1px solid var(--line); }
.header-inner { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; min-height: 72px; gap: 24px; }
.header-logo { width: min(156px, 100%); height: 34px; }
.header-logo::before {
  content: '';
  display: block;
  height: 100%;
  background: var(--header-logo) center var(--header-logo-position) / var(--header-logo-size) auto no-repeat;
  /* The gold source has a black background that blends into the night header. */
  mix-blend-mode: var(--header-logo-blend);
}
.main-nav { display: flex; gap: clamp(1rem, 3vw, 2.4rem); }
.main-nav a, .footer-links a, .footer-top { color: var(--muted); font-size: .86rem; font-weight: 650; text-decoration: none; }
.main-nav a:hover, .footer-links a:hover, .footer-top:hover { color: var(--accent); text-decoration: underline; text-underline-offset: .25em; }
.theme { justify-self: end; display: flex; align-items: center; gap: .45rem; padding: .28rem .45rem .28rem .65rem; border: 1px solid var(--line); border-radius: 9px; background: var(--bg); color: var(--ink); }
.theme-icon { color: var(--accent); }
.theme select { min-height: 30px; padding: 0 .2rem; border: 0; background: transparent; color: inherit; font-size: .84rem; }

/* Reserve the controls' space while the deferred script initializes them. */
:root[data-enhanced] .theme[hidden] { display: flex !important; visibility: hidden; }
:root[data-enhanced] .search[hidden] { display: block !important; visibility: hidden; }

.hero { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr); align-items: center; gap: clamp(2rem, 5.4vw, 5rem); margin: 36px 0 15px; padding: clamp(1.8rem, 3.4vw, 3rem); color: var(--hero-text); background: radial-gradient(ellipse at 95% 0%, rgb(208 166 255 / .21), transparent 55%), linear-gradient(125deg, var(--hero), var(--hero-end)); border-radius: 22px; }
.eyebrow { display: flex; align-items: center; gap: .55rem; font-size: .72rem; font-weight: 800; letter-spacing: .1em; line-height: 1.4; text-transform: uppercase; color: var(--accent); }
.eyebrow::before { content: ''; width: 8px; height: 8px; border-radius: 2px; transform: rotate(45deg); background: currentColor; flex: none; }
.hero h1 { margin-bottom: .9rem; font-size: clamp(2.1rem, 4vw, 3.45rem); font-weight: 800; letter-spacing: -.045em; line-height: 1.05; text-wrap: balance; }
.hero-copy > p { max-width: 60ch; font-size: clamp(.94rem, 1.25vw, 1.08rem); line-height: 1.48; }
.hero-reassurance, .hero-guidance { margin-top: .6rem; }
.hero-reassurance { color: var(--hero-muted); }
.hero-guidance { color: #ffe098; font-weight: 650; }
.hero-tools { min-width: 0; align-self: center; padding: 1.2rem 1.35rem; background: rgb(16 8 32 / .26); border: 1px solid rgb(228 211 255 / .32); border-radius: 15px; }
.hero-stats { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; }
.hero-stats > div + div { padding-inline-start: .9rem; border-inline-start: 1px solid rgb(228 211 255 / .32); }
.hero-stats strong, .hero-stats span { display: block; }
.hero-stats strong { line-height: 1.05; font-size: clamp(1.65rem, 3vw, 2.5rem); font-weight: 800; letter-spacing: -.055em; }
.hero-stats span { margin-top: .32rem; font-size: .76rem; color: var(--hero-muted); }
.search { margin-top: 1.05rem; }
.search label { display: block; color: var(--hero-muted); margin-bottom: .28rem; font-size: .76rem; font-weight: 680; }
.search-controls { display: flex; flex-wrap: wrap; gap: .55rem; }
.search-field { position: relative; flex: 1 1 132px; min-width: 0; }
.search-icon { position: absolute; inset: 50% auto auto 15px; width: 13px; height: 13px; margin-top: -8px; border: 1.7px solid var(--accent); border-radius: 50%; pointer-events: none; }
.search-icon::after { content: ''; position: absolute; width: 6px; height: 1.7px; top: 10px; left: 8px; background: var(--accent); transform: rotate(45deg); }
.search input { padding: .62rem .75rem .62rem 2.45rem; width: 100%; min-height: 46px; border: 1px solid var(--line); border-radius: 9px; background: var(--paper); color: var(--ink); }
.search input::placeholder { color: var(--muted); }
.search input:focus-visible, .hero a:focus-visible { outline-color: var(--hero-muted); }
#search-status:empty { display: none; }
#search-status { font-size: .76rem; color: var(--hero-muted); margin-top: .35rem; }
.hero-link { display: inline-flex; gap: .5rem; margin-top: .85rem; color: var(--hero-text); font-size: .83rem; font-weight: 650; text-decoration-color: var(--hero-muted); text-underline-offset: .24rem; }
.empty { margin: 1.2rem 0; padding: 1rem; border-radius: 10px; background: var(--accent-soft); color: var(--ink); }

.catalogue-section {
  --section-spacing: 2.45rem;
  margin-block: calc(var(--section-spacing) + var(--section-title-size) * var(--section-title-line-height)) var(--section-spacing);
}
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-block-end: 1rem; }
.section-heading h2, .directory h2 { font-size: var(--section-title-size); letter-spacing: -.048em; line-height: var(--section-title-line-height); font-weight: 775; }
.section-heading .eyebrow, .directory .eyebrow { margin-block-end: .45rem; }
.section-intro { margin-top: .35rem; color: var(--muted); }
.section-count { white-space: nowrap; color: var(--muted); font-size: .76rem; font-weight: 700; border: 1px solid var(--line); border-radius: 100px; padding: .2rem .65rem; }
.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 19px; }
.card { display: flex; flex-direction: column; overflow: hidden; min-width: 0; padding: 10px; background: var(--card-bg); border: 2px solid var(--card-edge); border-radius: 18px; box-shadow: var(--card-shadow); transition: transform .35s ease, box-shadow .35s ease, border-color .35s ease; }
.card:focus-within { border-color: var(--accent); }
@media (hover: hover) and (pointer: fine) {
  .card:hover { position: relative; z-index: 1; transform: translateY(-3px); border-color: var(--card-edge-hover); box-shadow: var(--card-shadow-hover); }
  .card:hover .cover img { transform: scale(1.03); }
}
.cover { aspect-ratio: 3 / 2; background: var(--cover); border-radius: 12px; overflow: hidden; }
.cover img { display: block; width: 100%; height: 100%; object-fit: contain; transition: transform .4s ease; }
.cover-placeholder { display: grid; place-content: center; justify-items: center; gap: .5rem; background: radial-gradient(ellipse at 50% 42%, var(--cover-dark), transparent 65%), var(--cover); color: var(--muted); font-size: .7rem; font-weight: 650; }
.placeholder-icon { position: relative; display: block; width: 29px; height: 23px; border: 1px solid currentColor; border-radius: 5px; overflow: hidden; opacity: .72; }
.placeholder-icon::before { content: ''; position: absolute; width: 4px; height: 4px; top: 4px; right: 5px; background: currentColor; border-radius: 50%; }
.placeholder-icon::after { content: ''; position: absolute; width: 13px; height: 13px; top: 10px; left: 4px; border: 1px solid currentColor; transform: rotate(45deg); }
.card-content { display: flex; flex: 1; flex-direction: column; min-width: 0; padding: .85rem .52rem .45rem; }
.card-title { margin: 0; color: var(--accent); font-size: 1.02rem; line-height: 1.32; letter-spacing: -.026em; overflow-wrap: anywhere; }
.card-content > p { color: var(--muted); font-size: .84rem; margin-top: .45rem; }
.card-bottom { margin-top: auto; padding-top: .9rem; }
.price { font-size: .86rem; }
.price strong { font-size: 1.02rem; color: var(--ink); }
.price small { display: block; color: var(--muted); font-size: .73rem; }
.price del { color: var(--muted); }
.price-reduced del { color: light-dark(#aa222c, #ff9ca1); }
.price-reduced strong { color: light-dark(#15723b, #80e3a7); }
.price-reduced small strong { font-size: inherit; }
.primary-button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 24px; border: 2px solid var(--button-gold); border-radius: 25px; background-color: var(--button-gold); color: var(--button-silver); box-shadow: 0 0 6px rgb(201 159 55 / .55); font-size: 1rem; font-weight: 700; line-height: 1.4; text-align: center; text-decoration: none; transition: background-color .25s ease-in-out, color .25s ease-in-out, box-shadow .25s ease-in-out; }
.primary-button:not(:disabled) { cursor: pointer; }
.primary-button:focus-visible, .primary-button:active { background-color: var(--button-silver); color: var(--button-gold); box-shadow: 0 0 10px rgb(201 159 55 / .75); }
.search .primary-button:focus-visible { outline-color: var(--hero-muted); }
.price + .primary-button { margin-top: .68rem; }
.packs-group:not([hidden]) + .packs-group {
  margin-block-start: calc(var(--section-spacing) + var(--section-title-size) * var(--section-title-line-height));
}
.packs-group > h3 {
  margin-block-end: 1rem;
  color: var(--ink);
  font-size: clamp(1.2rem, 2.25vw, 1.75rem);
  line-height: var(--section-title-line-height);
  letter-spacing: -.035em;
}
@media (hover: hover) and (pointer: fine) {
  .primary-button:hover { background-color: var(--button-silver); color: var(--button-gold); box-shadow: 0 0 10px rgb(201 159 55 / .75); }
}
.catalogue-divider { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1.15rem 0; border-bottom: 1px solid var(--line); }
.catalogue-divider h2 { font-size: clamp(1.4rem, 3.5vw, 2.7rem); letter-spacing: -.055em; line-height: 1.12; }
.catalogue-divider a { white-space: nowrap; font-size: .84rem; color: var(--accent); font-weight: 650; }
.directory { display: grid; grid-template-columns: minmax(170px, .28fr) 1fr; gap: 1.45rem; margin-block: 3.2rem; padding: clamp(1rem, 3vw, 2rem); background: var(--paper); border: 1px solid var(--line); border-radius: 17px; }
.directory ul { display: flex; align-content: flex-start; flex-wrap: wrap; gap: .45rem; list-style: none; margin: 0; padding: 0; }
.directory li { max-width: 100%; }
.directory li a, .directory li span { display: block; padding: .32rem .6rem; border: 1px solid var(--line); border-radius: 7px; color: var(--muted); font-size: .78rem; }
.directory li a { color: var(--accent); text-decoration: none; background: var(--accent-soft); }
.directory li a:hover { border-color: var(--accent); }
.footer { margin-top: 3.4rem; border-top: 1px solid var(--line); background: var(--paper); }
.footer-inner { min-height: 90px; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .65rem 1rem; padding-block: 1rem calc(80px + env(safe-area-inset-bottom, 0px)); }
.footer-links { display: flex; flex-wrap: wrap; gap: .55rem 1.25rem; }
.footer-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem 1rem; }
.footer-top { display: inline-flex; align-items: center; gap: .35rem; min-height: 44px; }
.floating-top { position: fixed; right: calc(16px + env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 4; display: grid; place-items: center; width: 48px; height: 48px; border: 1px solid #101010; border-radius: 50%; background: var(--button-gold); color: #101010; box-shadow: 0 3px 12px rgb(0 0 0 / .2); font-size: 1.7rem; line-height: 1; text-decoration: none; }
.floating-top:hover { background: #d9b453; }

@media (width > 1120px) {
  #challenges > .grid:not(:has(> .card[hidden])) > [data-product="100170"]:nth-child(8) {
    grid-column: 1;
  }
}
@media (max-width: 1120px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  :root { --header-height: 110px; }
  .shell { width: calc(100% - 48px); }
  .header-inner { grid-template-columns: 1fr auto; gap: .65rem 1rem; padding-block: .7rem; }
  .main-nav { grid-row: 2; grid-column: 1 / -1; flex-wrap: wrap; }
  .hero { grid-template-columns: minmax(0, 1fr); gap: 1.4rem; margin-top: 22px; }
  .hero-tools { max-width: 480px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .directory { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  :root { --header-height: 104px; }
  .shell { width: calc(100% - 36px); }
  .header-inner { width: calc(100% - 28px); min-height: 0; gap: .15rem .55rem; padding-block: .3rem; }
  .header-logo { width: min(138px, 100%); height: 30px; }
  .footer-links { flex-basis: 100%; }
  .theme { gap: .28rem; padding: .1rem .3rem .1rem .45rem; }
  .theme select { min-height: 34px; font-size: .82rem; }
  .main-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 .6rem; }
  .main-nav a { display: flex; align-items: center; min-height: 26px; padding-block: .15rem; font-size: .8rem; line-height: 1.25; }
  .hero { gap: .65rem; margin: 6px -4px 8px; border-radius: 16px; padding: .75rem; }
  .hero h1 { margin-bottom: .55rem; font-size: clamp(1.65rem, 6.6vw, 2.2rem); }
  .hero-copy > p { font-size: .875rem; line-height: 1.32; }
  .hero-reassurance, .hero-guidance { margin-top: .34rem; }
  .hero-tools { padding: .6rem .7rem; }
  .hero-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
  .hero-stats > div + div { padding-inline-start: .5rem; }
  .hero-stats strong { font-size: 1.4rem; }
  .hero-stats span { margin-top: .15rem; line-height: 1.3; }
  .search { margin-top: .55rem; }
  .search label { margin-bottom: .2rem; }
  .search-controls { gap: .35rem; }
  .search-field { flex-basis: 7rem; }
  .search-icon { inset-inline-start: 10px; }
  .search input { min-height: 44px; padding: .4rem .45rem .4rem 1.8rem; }
  .search .primary-button { padding: .35rem .65rem; font-size: .825rem; }
  .hero-link { margin-top: .4rem; font-size: .78rem; }
  #challenges { margin-block-start: .7rem; }
  .grid { grid-template-columns: minmax(0, 1fr); }
  .catalogue-section { --section-spacing: 1.95rem; }
  .catalogue-divider { align-items: flex-start; flex-direction: column; gap: .5rem; }
}
@media (prefers-reduced-motion: reduce) {
  :root { scroll-behavior: auto; }
  .card, .cover img, .primary-button { transition: none; }
  .card:hover, .card:hover .cover img { transform: none; }
}
