:root {
  /* typography */
  --measure: 60ch;

  /* colors */
  --main-color-light: #fff;
  --main-color-dark: #000;
  --main-color-light-gray: #ededed;
  --main-color-gray: #696969;
  --main-color-dark-gray: #1d1d1de0;
  --main-color-money: #5f9341;
  --main-color-accent: #31759d;
  --main-color-dark-accent: #134461;
  --google-blue: #4c8bf5;
  --facebook-blue: #1877f2;
  --debug: #ddccff;
  --info: #cceeff;
  --success: #ccffdd;
  --warning: #ffddcc;
  --error: #ffcccc;
  --color-draft: #995331;
  --color-private: #b82828;
  --striped-bg-1: repeating-linear-gradient(
    -45deg,
    var(--main-color-dark),
    var(--main-color-dark) 10px,
    var(--main-color-dark-gray) 10px,
    var(--main-color-dark-gray) 20px
  );
  --striped-bg-2: repeating-linear-gradient(
    45deg,
    var(--main-color-dark),
    var(--main-color-dark) 10px,
    var(--main-color-dark-gray) 10px,
    var(--main-color-dark-gray) 20px
  );

  /* modular scale */
  --ratio: 1.3;
  --s-5: calc(var(--s-4) / var(--ratio));
  --s-4: calc(var(--s-3) / var(--ratio));
  --s-3: calc(var(--s-2) / var(--ratio));
  --s-2: calc(var(--s-1) / var(--ratio));
  --s-1: calc(var(--s0) / var(--ratio));
  --s0: 1rem;
  --s1: calc(var(--s0) * var(--ratio));
  --s2: calc(var(--s1) * var(--ratio));
  --s3: calc(var(--s2) * var(--ratio));
  --s4: calc(var(--s3) * var(--ratio));
  --s5: calc(var(--s4) * var(--ratio));

  --stack-space: var(--s1);
  --stack-page-space: var(--s5);
  --border-thin: 2px;
}

* {
  max-width: var(--measure);
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: "Verdana", sans-serif;
  line-height: 1.5;
  font-size: 16px;
}

a,
button,
html,
body,
div,
header,
nav,
main,
footer {
  max-width: none;
}

.clear {
  border: none;
  background-color: inherit;
}

span {
  font-size: 1em;
}

input,
textarea,
select {
  padding: var(--s-1);
  border: var(--border-thin) solid;
  color: var(--main-color-dark-gray);
  background-color: var(--main-color-light);
  /* The following is a cool effect, but difficult to implement sitewide */
  /* box-shadow: 2px 3px var(--main-color-dark-gray); */
}

input *,
textarea * {
  color: inherit;
}

input:disabled,
textarea:disabled {
  background: var(--main-color-light-gray);
  font-style: italic;
}

input.invert,
textarea.invert {
  color: var(--color-light);
  background-color: var(--color-dark);
}

input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  background-color: #fff;
  margin: 0;
  font: inherit;
  color: var(--main-color-dark);
  width: 1.15em;
  height: 1.15em;
  transform: translateY(-0.175em);
  display: grid;
  place-content: center;
}

input[type="checkbox"]::before {
  content: "";
  width: 1em;
  height: 1em;
  transform: scale(0);
  transition: 120ms transform ease-in-out;
  box-shadow: inset 1em 1em var(--main-color-dark);
  background-color: var(--main-color-dark);
  transform-origin: bottom left;
  clip-path: polygon(6% 61%, 19% 45%, 40% 64%, 78% 8%, 94% 20%, 43% 94%);
}

input[type="checkbox"]:checked::before {
  transform: scale(1);
}

input[type="checkbox"]:focus {
  outline: max(2px, var(--s-5)) solid currentColor;
  outline-offset: max(2px, var(--s-5));
}

input[type="checkbox"]:disabled {
  color: #959495;
  cursor: not-allowed;
}

th {
  text-align: left;
  padding: var(--s0) var(--s3);
  background-color: #000;
  color: #fff;
}

td {
  padding: var(--s0) var(--s3);
}

::selection {
  color: var(--main-color-light);
  background-color: var(--main-color-dark);
}

::-moz-selection {
  color: var(--main-color-light);
  background-color: var(--main-color-dark);
}

/*
    THE BUTTON

    Based off of THE BOX
*/
.button {
  display: inline-block;
  text-decoration: none;
  cursor: pointer;
  padding: var(--s0);
  border: 0 solid;
  outline: var(--border-thin) solid transparent;
  /* for high contrast mode */
  outline-offset: calc(var(--border-thin) * -1);
  color: var(--main-color-light-gray);
  background-color: var(--main-color-dark);
}

.copy-btn {
  cursor: pointer;
  font-size: var(--s-1);
}

.copy-btn:hover,
.copy-btn:focus {
  text-decoration: underline;
}

.button:hover,
.button:focus {
  text-decoration: underline;
}

img {
  max-width: 100%;
}

ul {
  padding: revert;
}

/*
    FORMS
*/

input[type="radio"] {
  color: var(--main-color-accent);
  font-size: var(--s4);
}

select {
  border: var(--border-thin) solid var(--main-color-dark);
}

input:focus,
select:focus {
  outline: var(--border-thin) solid var(--main-color-dark);
}

fieldset {
  border: none;
}

form label {
  font-weight: 700;
}

.form-control {
  display: grid;
  grid-template-columns: 1em auto;
  gap: var(--s1);
}

.stack-form fieldset {
  margin-top: 0;
  padding: var(--s1);
  border: var(--s-5) solid var(--main-color-dark-gray);
}

/* make sure .stack-form doesn't combine with .box padding */
.stack-form fieldset div:first-of-type {
  margin-top: 0;
}

legend {
  background: var(--main-color-dark-gray);
  color: var(--main-color-light-gray);
  padding: var(--s-3);
  font-size: var(--s-1);
}

.stack-form button {
  width: fit-content;
}

/*
    TYPOGRAPHY
*/
h1 {
  font-size: var(--s3);
  line-height: normal;
  text-align: center;
  max-width: unset;
}

h2 {
  font-size: var(--s2);
}

h3 {
  font-size: var(--s1);
}

h4 {
  font-size: var(--s0);
}

h5 {
  font-size: var(--s-1);
}

h6 {
  font-size: var(--s-2);
}

a {
  color: var(--main-color-accent);
  text-decoration: none;
}

a:hover,
a:focus,
a:active {
  text-decoration: underline;
}

.navbar a {
  color: var(--main-color-light-gray);
  text-decoration: none;
}

.navbar a:hover,
.navbar a:focus,
.navbar a:active {
  color: var(--main-color-light-gray);
  background-color: unset;
  text-decoration: underline;
}

/*
    TYPOGRAPHY EXCEPTIONS
*/
.product-switcher h1 {
  text-align: unset;
  line-height: unset;
}

/*
    THE STACK

    Description: use with modular scale system for consistent appearance

    Usage: place children inside div.stack

    Ex:
      <div class="stack">
        <div><!-- child --></div>
        <div><!-- child --></div>
        <div><!-- child --></div>
      </div>
*/
.stack {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.stack > * {
  margin-top: 0;
  margin-bottom: 0;
}

.stack > * + * {
  margin-top: var(--stack-space);
}

.stack-all {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.stack-all * {
  margin-top: 0;
  margin-bottom: 0;
}

.stack-all * + * {
  margin-top: var(--stack-space);
}

.stack-auth-form {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.stack-auth-form * {
  margin-top: 0;
  margin-bottom: 0;
}

.stack-auth-form * + * {
  margin-top: var(--s-5);
}

.stack-auth-form > form > * + * {
  margin-top: var(--s1);
}

.stack-form {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.stack-form * {
  margin-top: 0;
  margin-bottom: 0;
}

.stack-form * + * {
  margin-top: var(--stack-space);
}

/* Tighter spacing for form fields within stack-form */
.stack-form .field + .field {
  margin-top: var(--s0);
}

/* Remove excess margin from first field in stack-form */
.stack-form .field:first-of-type {
  margin-top: 0;
}

/* Button spacing in forms */
.stack-form button,
.stack-form .button {
  margin-top: var(--stack-space);
}

.stack-page {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.stack-page > * {
  padding-top: var(--stack-page-space);
  padding-bottom: var(--stack-page-space);
  margin-top: 0;
  margin-bottom: 0;
  margin-left: 0;
  margin-right: 0;
}

.stack-page > * + * {
  padding-top: var(--stack-page-space);
  padding-bottom: var(--stack-page-space);
}

/*
    THE CENTER
*/
.center {
  box-sizing: content-box;
  margin-left: auto;
  margin-right: auto;
  max-width: var(--measure);
}

/*
    THE BOX

    Description: the best box is one that fits the content and no more. Padding should
    be applied evenly to all sides. Use utility class margin to get specific
    placement.

    Usage: place contents inside div.box

    Ex:
      <div class="box">
        <!-- content here -->
      </div>
*/
.box,
.errorlist li {
  padding: var(--s1);
  border: 0 solid;
  outline: var(--border-thin) solid transparent;
  /* for high contrast mode */
  outline-offset: calc(var(--border-thin) * -1);
  --color-light: #fff;
  --color-dark: #000;
  color: var(--color-dark);
  background-color: var(--color-light);
}

ul.errorlist {
  list-style-type: none;
  padding: 0;
}

.box > *,
.errorlist li > * {
  color: inherit;
}

.errorlist li {
  background-color: var(--error);
}

.box.invert {
  color: var(--color-light);
  background-color: var(--color-dark);
}

.box.invert.download:hover {
  background: repeating-linear-gradient(
    -45deg,
    var(--color-dark),
    var(--color-dark) 5px,
    var(--main-color-dark) 5px,
    var(--main-color-dark) 10px
  );
}

.box.transparent {
  background-color: unset;
}

.box.purchase {
  letter-spacing: 0.2ch;
  font-family: monospace;
  font-size: var(--s0);
  font-weight: 700;
  color: var(--main-color-light);
  background-color: var(--main-color-accent);
}

.box.purchase:active,
.box.purchase:hover,
.box.purchase:focus {
  cursor: pointer;
  text-decoration: underline;
}

.box.owned {
  color: black;
  background: linear-gradient(
    150deg,
    rgba(193, 0, 0, 0.8),
    rgba(191, 127, 63, 0.8),
    rgba(191, 191, 63, 0.8),
    rgba(127, 191, 63, 0.8),
    rgba(63, 127, 191, 0.6),
    rgba(63, 63, 191, 0.6),
    rgba(127, 63, 191, 0.6),
    rgba(191, 63, 191, 0.6)
  );
  background-size: 400% 400%;
  animation: gradient 15s ease infinite;
}

@keyframes gradient {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

.box.login {
  padding: var(--s-2);
  text-align: center;
  border: var(--border-thin) solid var(--main-color-dark-gray);
  text-decoration: none;
}

.box.login h2 {
  font-size: unset;
  font-weight: unset;
}

a.box.login:hover,
a.box.login:focus {
  color: unset;
  background-color: unset;
  text-decoration: underline;
}

a.box.login:active {
  opacity: 0.8;
}

.or-separator {
  display: flex;
  align-items: center;
}

.or-separator i {
  padding: 3px;
  font-size: 18px;
  color: #6f6f6f;
}

.or-separator > div {
  flex: 1;
  height: 1px;
  background-color: #cac7c7;
}

/*
    THE CARD BOX

    Description: just a BOX with no padding and an outline

    Usage: see above

    Adapted from:
    * https://inclusive-components.design/cards/
    * https://every-layout.dev/layouts/box/
*/
.card-box {
  --color-light: #fff;
  --color-dark: #000;
  padding: 0;
  border: var(--border-thin) solid;
  color: var(--color-dark);
  background-color: var(--color-light);
  position: relative;
  overflow: hidden;
  border-radius: var(--s-2);
}

.card-box * {
  color: inherit;
}

.card-box.invert {
  color: var(--color-light);
  background-color: var(--color-dark);
}

.card-box a {
  text-decoration: none;
}

.card-box a:hover,
.card-box a:focus {
  color: inherit;
  background-color: inherit;
  outline: none;
}

/* make the whole card clickable */
.card-box a::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
}

/* affordance - show user that the whole card is clickable */
.card-box:hover {
  box-shadow: 0 0 0 var(--border-thin);
}

/* a fallback for old browers */
.card-box:focus {
  text-decoration: underline;
}

/* add fancy outline */
.card-box:focus-within {
  box-shadow: 0 0 0 var(--border-thin);
}

/* remove fallback style if browser is new and hip */
.card-box:focus-within a:focus {
  text-decoration: none;
}

/* pretty styles for photo */
.card-box .frame > img {
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 calc(100% - 1rem));
}

/*
    THE CARD STACK

    Description: get the less important things to line up on the bottom
*/
.card-stack h3 {
  margin: 0;
}

.card-stack h3 > a {
  font-size: var(--s1);
}

.card-stack {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.card-stack > * {
  margin-top: 0;
  margin-bottom: 0;
}

.card-stack > * + * {
  margin-top: var(--s-1);
}

.card-stack:only-child {
  height: 100%;
}

.card-stack > :nth-child(2) {
  margin-bottom: auto;
}

/*
    THE SIDEBAR

    Ex:

    <div class="with-sidebar">
      <div> <!-- intermediary wrapper -->
        <div><!-- non-sidebar --></div>
        <div><!-- sidebar --></div>
      </div>
    </div>
*/
.with-sidebar {
  overflow: hidden;
}

.with-sidebar > * {
  display: flex;
  flex-wrap: wrap;
  margin: calc(var(--s1) / 2 * -1);
}

.with-sidebar > * > * {
  margin: calc(var(--s1) / 2);
  flex-grow: 1;
}

.with-sidebar > * > :last-child {
  flex-basis: 0;
  flex-grow: 999;
  min-width: calc(50% - var(--s1));
}

.with-sidebar-right {
  overflow: hidden;
}

.with-sidebar-right > * {
  display: flex;
  flex-wrap: wrap;
  margin: calc(var(--s1) / 2 * -1);
}

.with-sidebar-right > * > * {
  margin: calc(var(--s1) / 2);
  flex-basis: 33%;
  flex-grow: 1;
}

.with-sidebar-right > * > :first-child {
  flex-basis: 0;
  flex-grow: 999;
  min-width: calc(50% - var(--s1));
}

/*
    THE FORM SIDEBAR
*/

.form-with-sidebar {
  overflow: hidden;
}

.form-with-sidebar > * {
  display: flex;
  flex-wrap: wrap;
  margin: calc(0px / 2 * -1);
}

.form-with-sidebar > * > * {
  margin: calc(0px / 2);
  flex-grow: 1;
}

.form-with-sidebar > * > :first-child {
  flex-basis: 0;
  flex-grow: 999;
  min-width: calc(70% - var(--s1));
}

.form-with-sidebar input,
.form-with-sidebar button {
  box-shadow: none;
}

/*
    THE CLUSTER

    Description: a group of items that should stay close together

    Usage: use intermediary wrapper between items and the outer div.cluster

    Ex:
      <div class="cluster">
        <div> <!-- intermediary wrapper -->
          <div><!-- child --></div>
          <div><!-- child --></div>
          <div><!-- etc --></div>
        </div>
      </div>
*/
/* generic cluster */
.cluster {
  --cluster-space: var(--s0);
  overflow: hidden;
}

.cluster.categories {
  --cluster-space: var(--s-2);
}

.cluster > * {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: center;
  margin: calc(var(--cluster-space) / 2 * -1);
}

.cluster > * > * {
  margin: calc(var(--cluster-space) / 2);
}

/* logo and right-aligned menu */
.nav-cluster {
  --nav-space: var(--s1);
  overflow: hidden;
}

.nav-cluster > * {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  margin: calc(var(--nav-space) / 2 * -1);
}

.nav-cluster > * > * {
  margin: calc(var(--nav-space) / 2);
}

/* the <a> tags in nav bar */
.menu-cluster {
  --menu-space: var(--s-1);
  overflow: hidden;
}

.menu-cluster > * {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: center;
  margin: calc(var(--menu-space) / 2 * -1);
}

.menu-cluster > * > * {
  margin: calc(var(--menu-space) / 2);
}

/*
    THE SIDEBAR

    Description: Sidebar has suggested width, main content adapts width until
    it becomes too thin to tolerate.

    Usage: div.with-sidebar, intemediary wrapper, then side bar and non-sidebar
    as children

    Ex:
    <div class="with-sidebar">
      <div> <!-- intermediary wrapper -->
        <div><!-- sidebar --></div>
        <div><!-- non-sidebar --></div>
      </div>
    </div>
*/
.with-sidebar {
  overflow: hidden;
}

.with-sidebar > * {
  display: flex;
  flex-wrap: wrap;
  margin: calc(var(--s5) / 2 * -1);
}

.with-sidebar > * > * {
  margin: calc(var(--s5) / 2);
  flex-basis: 40vw;
  flex-grow: 1;
}

.with-sidebar > * > :last-child {
  flex-basis: 0;
  flex-grow: 999;
  min-width: calc(50% - var(--s5));
}

/*
    THE SWITCHER

    Description: switch between horizontal and vertical layouts

    Usage: use intermediary wrapper between div.product-switcher and child elements

    Ex:
      <div class="product-switcher">
        <div> <!-- intermediary wrapper -->
          <div><!-- child element --></div>
          <div><!-- another child element --></div>
          <div><!-- etc --></div>
        </div>
      </div>
*/
.product-switcher > * {
  display: flex;
  flex-wrap: wrap;
  margin: calc((var(--s5) / 2) * -1);
}

.product-switcher > * > * {
  flex-grow: 1;
  flex-basis: calc((var(--measure) - (100% - var(--s5))) * 999);
  margin: calc(var(--s5) / 2);
}

.product-switcher > * > :nth-last-child(n + 3),
.product-switcher > * > :nth-last-child(n + 3) ~ * {
  flex-basis: 100%;
}

/* Max two children in a row */
.two-switcher {
  container-type: inline-size;
}

.two-switcher > * {
  display: grid;
  gap: var(--s1);
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
}

@container (max-width: 700px) {
  .two-switcher > * {
    grid-template-columns: 1fr;
  }
}

/* Max three children in a row */
.three-switcher > * {
  display: flex;
  flex-wrap: wrap;
  margin: calc((var(--s5) / 3) * -1);
}

.three-switcher > * > * {
  flex-grow: 1;
  flex-basis: calc((var(--measure) - (100% - var(--s5))) * 999);
  margin: calc(var(--s5) / 3);
}

.three-switcher > * > :nth-last-child(n + 4),
.three-switcher > * > :nth-last-child(n + 4) ~ * {
  flex-basis: 100%;
}

/*
    THE GRID

    Usage: place child elements inside div.grid

    Ex:
      <div class="grid">
        <div class="box">One</div>
        <div class="box">Two</div>
        <div class="box">Three</div>
      </div>
*/
ul.grid {
  padding: 0;
}

.grid {
  display: grid;
  grid-gap: var(--s0);
}

@supports (width: min(250px, 100%)) {
  .grid {
    grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr));
  }
}

/*
    THE COVER

    Usage:

    Ex:
      <div class="cover">
        <div><!-- header --></div>
        <div><!-- centered --></div>
        <div><!-- footer --></div>
      </div>
*/
.cover {
  display: flex;
  flex-direction: column;
  min-height: 80vh;
  padding: 0;
  background-color: #000;
  color: #fff;
}

.cover > * {
  margin-top: 1rem;
  margin-bottom: 1rem;
}

.cover > :first-child:not(h1) {
  margin-top: 0;
}

.cover > :last-child:not(h1) {
  margin-bottom: 0;
}

.cover > h1 {
  margin-top: auto;
  margin-bottom: auto;
  padding: 0 clamp(1rem, 4vw, 2.5rem);
}

.cover > .center.box {
  padding-left: clamp(1rem, 4vw, 2.5rem);
  padding-right: clamp(1rem, 4vw, 2.5rem);
}

/*
    THE FRAME

    Usage: place the image or video inside a div.frame. Must be used in
    conjunction with a size declaration, such as .landscape or .portrait.

    Ex:
      <div class="frame">
        <img src="image.png">
      </div>
*/
.square.frame {
  --n: 1;
  --d: 1;
}

.landscape.frame {
  --n: 9;
  --d: 16;
}

.movie.frame {
  --n: 9;
  --d: 24;
}

.portrait.frame {
  --n: 4;
  --d: 3;
}

.frame {
  /* --n: 9; */
  /* --d: 16; */
  padding-bottom: calc(var(--n) / var(--d) * 100%);
  position: relative;
}

.frame > * {
  overflow: hidden;
  position: absolute;
  /* ok bc bound to frame */
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

.frame > img,
.frame > video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/*
    THE ICON

    Description: proper sizing and spacing for icons

    Usage:
    <span class="with-icon">
      <svg class="icon">
        <use href="/path/to/icons.svg#my-icon"></use>
      </svg>
      Download
    </span>
*/
.icon {
  width: 0.75em;
  height: 0.75em;
}

.icon-medium {
  width: 1rem;
  height: 1rem;
}

.icon-large {
  width: 1.25em;
  height: 1.25em;
}

.with-icon {
  display: inline-flex;
  align-items: baseline;
}

.with-icon .icon {
  margin-inline-end: 1rem;
  font-size: 100%;
}

.with-icon .icon-medium {
  margin-inline-end: 1rem;
  font-size: 100%;
}

.with-icon .icon-large {
  margin-inline-end: var(--s-2);
  font-size: 100%;
}

.with-icon .icon-right {
  margin-inline-end: unset;
  margin-inline-start: 1rem;
}

/*
    THE TAG

    Description: small text with a fun color background

    Usage: just wrap in span.tag
*/
.tag {
  color: var(--main-color-light);
  background-color: var(--main-color-dark);
  padding: var(--s-5) var(--s-3);
  border-radius: var(--s0);
  font-size: var(--s-1);
}

.tag.filter-btn {
  padding: 2px var(--s0);
  font-size: var(--s0);
  color: var(--main-color-light);
  background-color: var(--main-color-dark-gray);
  border-radius: 0;
}

.tag.copy-btn {
  padding: 1px var(--s-1);
  font-size: 0.8rem;
  color: var(--main-color-dark-gray);
  background-color: lightgray;
}

.tag.price {
  background-color: var(--main-color-money);
}

.tag.duration {
  background-color: var(--main-color-dark-gray);
}

.tag.frequency {
  background-color: var(--main-color-dark-gray);
}

.tag.draft {
  background-color: var(--color-draft);
}

.tag.private {
  background-color: var(--color-private);
}

.inline-tag {
  display: inline-flex;
  align-items: center;
}

.inline-tag > :first-child {
  margin-right: var(--s-2);
}

/*
    UTILITY CLASSES
*/
.flex-row {
  display: flex;
  align-items: center;
}

.flex-row-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.gap-s-2 {
  gap: var(--s-2);
}

.gap-s-1 {
  gap: var(--s-1);
}

.margin-0 {
  margin: 0;
}

.max-width\:measure {
  max-width: var(--measure);
}

.max-width\:measure\*2 {
  max-width: calc(var(--measure) * 2);
}

.max-width\:measure\/2 {
  max-width: calc(var(--measure) / 2);
}

/* Functional layout for interface-heavy pages */
.functional-width {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 2rem);
  width: 100%;
}

@media (max-width: 768px) {
  /* Stack grid columns on mobile */
  .sidebar-main-layout {
    grid-template-columns: 1fr !important;
    gap: 1rem;
  }

  /* Ensure grid items don't overflow on mobile */
  .sidebar-main-layout > * {
    min-width: 0; /* Allow grid items to shrink below content size */
    width: 100%;
  }

  /* Reduce horizontal padding on mobile for functional layouts */
  .functional-width {
    padding: 0 clamp(0.5rem, 2vw, 1rem);
  }

  .box {
    padding: var(--s-1);
  }

  .scores-section .stack {
    padding: var(--s-1);
  }

  /* Add more space between performance section and records table on mobile */
  .sidebar-main-layout .stack > * + * {
    margin-top: var(--s2);
  }

  /* Better mobile form styling */
  .stack-form input,
  .stack-form select,
  .stack-form textarea {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  /* Form spacing improvements on mobile */
  .stack-form {
    width: 100%;
  }

  /* Tighter field spacing on mobile */
  .stack-form .field {
    margin-bottom: var(--s-1);
  }

  /* Tighter form container spacing on mobile */
  .stack-form .stack > * + * {
    margin-top: var(--s-1);
  }

  /* Handle long content that might break layout */
  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    word-wrap: break-word;
    overflow-wrap: break-word;
  }
}

.sidebar-main-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 2rem;
}

.padding\:s0 {
  padding: var(--s0);
}

.padding\:s-1 {
  padding: var(--s-1);
}

.padding\:s-2 {
  padding: var(--s-2);
}

.space-between {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.font-monospace {
  font-family: monospace;
}

.font-size\:big {
  font-size: var(--s3);
}

.font-size\:biggish {
  font-size: var(--s2);
}

.font-size\:smallish {
  font-size: var(--s1);
}

.font-size\:small {
  font-size: var(--s-1);
}

.text-center {
  text-align: center;
}

.money {
  color: var(--main-color-money);
  font-weight: 700;
}

.debug {
  background-color: var(--debug);
}

.info {
  background-color: var(--info);
}

.success {
  background-color: var(--success);
}

.warning {
  background-color: var(--warning);
}

.error {
  background-color: var(--error);
}

.button.debug,
.button.info,
.button.success,
.button.warning,
.button.error {
  color: var(--main-color-dark);
}

.button.outline {
  color: var(--main-color-dark);
  background-color: unset;
  border: solid var(--border-thin) var(--main-color-dark);
}

.inherit-colors {
  color: inherit;
  background-color: inherit;
}

.edgy {
  filter: saturate(0) contrast(2);
}

/*
    PAGINATION STYLING
*/
.pagination-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: var(--s1);
  padding: var(--s0);
  gap: var(--s0);
}

.pagination-info {
  font-weight: bold;
  color: var(--main-color-dark-gray);
  padding: var(--s-1) var(--s0);
  background-color: var(--main-color-light-gray);
  border-radius: var(--border-thin);
  border: 1px solid var(--main-color-gray);
}

.pagination-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--s-1) var(--s1);
  text-decoration: none;
  font-weight: bold;
  color: var(--main-color-light);
  background-color: var(--main-color-dark);
  border: var(--border-thin) solid var(--main-color-dark);
  border-radius: var(--border-thin);
  transition: all 0.2s ease;
  min-width: 5rem;
}

.pagination-button:hover,
.pagination-button:focus {
  color: var(--main-color-dark);
  background-color: var(--main-color-light);
  border-color: var(--main-color-dark);
  text-decoration: none;
}

.pagination-button:active {
  background-color: var(--main-color-light-gray);
}

/* For mobile responsiveness */
@media (max-width: 640px) {
  .pagination-container {
    flex-direction: column;
    gap: var(--s-1);
  }

  .pagination-info {
    order: -1;
  }
}

/*
  CHALLENGE GROUP
*/
.challenge-group-expanded {
  max-height: 0;
  overflow: hidden;
  margin-top: 0;
  opacity: 0;
  transition:
    max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    margin-top 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.3s ease;
}

.challenge-group.expanded .challenge-group-expanded {
  margin-top: var(--s-2);
  opacity: 1;
  overflow: visible;
}

.challenge-group .expand-arrow {
  transform: rotate(0deg);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.challenge-group.expanded .expand-arrow {
  transform: rotate(180deg);
}

/* Fix focus outline for cards within expanded challenge groups */
.challenge-group-expanded .card-box {
  position: relative;
}

.challenge-group-expanded .card-box:focus-within {
  box-shadow: 0 0 0 2px currentColor !important;
  outline: none !important;
  z-index: 1 !important;
}

.challenge-group-expanded .card-box:hover {
  box-shadow: 0 0 0 2px currentColor !important;
  z-index: 1 !important;
}

/* Override stack spacing for tighter card spacing */
.challenge-group-expanded .stack {
  --stack-space: var(--s-3);
}

/* Shadow cards underneath group header */
.challenge-shadow-cards {
  position: relative;
  margin-top: -8px;
  z-index: 0;
}

.challenge-shadow-card {
  height: 12px;
  background: #e8e8e8;
  border: 1px solid #c0c0c0;
  border-radius: 0 0 4px 4px;
  margin: 2px 4px 0;
  opacity: 0.8;
  transition:
    opacity 0.3s ease,
    transform 0.3s ease;
  border-top: none;
}

.challenge-shadow-card:last-child {
  margin: 2px 8px 0;
  opacity: 0.6;
  height: 10px;
  background: #eeeeee;
  border-color: #d0d0d0;
}

/* Hide shadows when expanded */
.challenge-group.expanded .challenge-shadow-cards {
  opacity: 0;
  transform: translateY(-10px);
}

/*
    CUSTOMIZING ELEMENTS
*/
.navbar {
  background-color: var(--main-color-dark);
  color: var(--main-color-light-gray);
  padding: clamp(1rem, 4vw, var(--s2));
}

.nav-menu ul {
  list-style-type: none;
}

.logo {
  font-weight: 700;
}

.content {
  background-color: var(--main-color-light);
  padding: clamp(1rem, 4vw, 2.5rem);
}

.content.full-width {
  padding-left: 0;
  padding-right: 0;
}

.cta {
  background: var(--striped-bg-2);
}

.cta h2,
.testimonials h2 {
  background: var(--main-color-light);
  margin: auto;
  padding: var(--s-5) var(--s0);
}

.cta .button {
  box-shadow: white 0 0 12px 5px;
  padding: var(--s4) var(--s0);
}

.cta .button:hover,
.cta .button:focus,
.cta .button:active {
  box-shadow: white 0 0 20px 5px;
  transition-duration: 0.2s;
}

.newsletter {
  background-color: var(--main-color-light-gray);
}

.footer {
  color: var(--main-color-light-gray);
  background-color: var(--main-color-dark);
  padding: var(--s1);
}

.footer a {
  font-weight: 700;
  color: var(--main-color-light-gray);
  text-decoration: none;
}

.footer a:hover {
  color: var(--main-color-light);
  text-decoration: underline;
}

.navbar a:focus,
.navbar a:active,
.footer a:focus,
.footer a:active {
  color: var(--main-color-dark);
  background-color: var(--main-color-light-gray);
}

.messages {
  margin-bottom: var(--s1);
}

.messages ul {
  list-style-type: none;
  padding: 0;
}

.messages li {
  margin-bottom: var(--s1);
}

.messages li:last-child {
  margin-bottom: 0;
}

.messages .errorlist {
  background-color: var(--error);
}

.testimonials > * {
  /* max-width: 1000px; */
  margin: auto;
}

.about .box,
.cta .box,
.newsletter .box,
.testimonials .box {
  padding-top: 0;
  padding-bottom: 0;
}

.testimonial,
table {
  background: var(--main-color-light);
  padding: var(--s2);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

table {
  border-collapse: collapse;
  border: none;
  width: 100%;
}

table tr:nth-child(even) {
  background: var(--main-color-light-gray);
}

/* Mobile table container for horizontal scrolling */
.table-container {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--border-radius);
}

@media (max-width: 768px) {
  .table-container {
    margin: 0 calc(-1 * var(--s-1));
    border-radius: 0;
  }

  /* Add some breathing room for the heading above tables */
  .box h3 + .table-container {
    margin-top: var(--s0);
  }

  table {
    min-width: 500px;
    font-size: var(--s-1);
  }

  table th,
  table td {
    padding: var(--s-1);
    white-space: nowrap;
  }
}

.testimonial-footer {
  display: flex;
  flex-direction: row;
  align-items: center;
}

.testimonial-footer > * {
  margin-top: 0;
}

.testimonial-footer img {
  border-radius: 50%;
  margin-right: var(--s-1);
}

.testimonial-footer .byline {
  display: flex;
  flex-direction: column;
}

.testimonial-footer .byline > * {
  margin-top: 0;
  font-size: var(--s-1);
  letter-spacing: 0.1rem;
  text-transform: uppercase;
}

.testimonial-footer .name {
  font-weight: 700;
}

.testimonial-footer .job-title {
  color: var(--main-color-gray);
}

.search {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
}

.search input[name="search"] {
  flex-grow: 1;
}

.search .htmx-indicator {
  margin-left: 10px;
}

.video {
  position: relative;
  height: 0;
  padding-bottom: 56.25%;
  overflow: hidden;
}

.video > iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* Shadow utility classes */
.shadow-sm {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.shadow {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.shadow-md {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.shadow-lg {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

/* Elevated background utility classes */
.elevated {
  background-color: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.elevated-light {
  background-color: #f8f9fa;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

/* Legacy box-shadow class for compatibility */
.box-shadow {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Scores section styling - maintains visual consistency without box padding */
.scores-section {
  background-color: var(--main-color-light);
  border: 0 solid;
  outline: var(--border-thin) solid transparent;
  outline-offset: calc(var(--border-thin) * -1);
}

.scores-section .stack {
  padding: var(--s1);
}

/* Challenge description enhancement */
.challenge-description {
  background: var(--main-color-light);
  border: 2px solid var(--main-color-accent);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(49, 117, 157, 0.15);
  position: relative;
  overflow: hidden;
  padding: var(--s2);
}

.challenge-description::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(
    90deg,
    var(--main-color-accent),
    var(--main-color-dark-accent),
    var(--main-color-accent)
  );
}

.challenge-description::after {
  content: "🎯";
  position: absolute;
  top: var(--s0);
  right: var(--s1);
  font-size: var(--s2);
  opacity: 0.3;
}

.challenge-description .stack > div:first-child {
  font-size: var(--s1);
  line-height: 1.7;
  color: var(--main-color-dark);
  margin-top: var(--s-1);
}

.challenge-description p {
  margin-bottom: var(--s0);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.challenge-description p:last-child {
  margin-bottom: 0;
}

.challenge-description .cluster.categories {
  margin-top: var(--s1);
  padding-top: var(--s1);
  border-top: 1px solid rgba(49, 117, 157, 0.2);
}

.challenge-description .tag {
  background: var(--main-color-accent);
  color: var(--main-color-light);
  padding: var(--s-2) var(--s0);
  border-radius: 20px;
  font-size: var(--s-1);
  font-weight: 500;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(49, 117, 157, 0.3);
  transition: all 0.2s ease;
}

.challenge-description .tag:hover {
  background: var(--main-color-dark-accent);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(49, 117, 157, 0.4);
}

/* Info box component styles */
.info-box {
  background: var(--color-light);
  padding: var(--s-1);
  border-radius: var(--border-radius);
  margin-bottom: var(--s0);
}

.info-title {
  font-weight: bold;
  color: var(--color-dark);
}

.info-subtitle {
  font-size: var(--s-1);
  color: var(--color-gray);
}

/* Improved Django Crispy Forms styling */
.stack-form .field {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  margin-bottom: var(--s0);
}

.stack-form .field .label {
  font-weight: 500;
  margin-bottom: 0;
}

.stack-form .field .control {
  margin: 0;
}

.stack-form .field .help {
  font-size: var(--s-1);
  color: var(--color-gray);
  margin-top: 0;
  line-height: 1.3;
}

.help-text {
  font-size: var(--s-1);
  font-weight: normal;
  color: var(--main-color-gray);
  margin-top: var(--s-5);
}

.breadcrumbs,
.breadcrumbs a {
  font-size: var(--s-1);
}

.hidden {
  display: none;
}

/*
    DIFFICULTY INDICATORS
*/
.difficulty-indicator {
  font-size: var(--s0);
  font-weight: bold;
}

.difficulty-beginner {
  color: #22c55e; /* Green for beginner */
}

.difficulty-intermediate {
  color: #f59e0b; /* Amber/orange for intermediate */
}

.difficulty-advanced {
  color: #ef4444; /* Red for advanced */
}
