/*
 * adCartoon.com /styles and /styles/{slug} in the "Ink & Paint" system. Loaded after site/base.css and site/frame.css.
 * Markup: landing/styles.blade.php (.p-st-*), landing/style.blade.php (.p-sd-*). Script: site/styles.js (filters).
 *
 *  1 Shared: style cards and grids, actions
 *  2 /styles: hero and launch styles, filter panel, family sections, empty state, closing
 *  3 /styles/{slug}: hero, frames, about cards, similar and previous/next, call to action
 *  4 Ink & Paint layer: cel cards that tilt, the sun filter panel, the night hero with its iris and name band
 */

/* ---------- 1. Shared ---------- */
.p-st-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 0; }

.p-st-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr));
  gap: 28px var(--gap);
  margin: 0;
  padding: 0;
  list-style: none;
}
.p-st-grid--five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.p-st-tile[hidden] { display: none; }

.p-st-card { display: grid; gap: 4px; color: var(--ink); text-decoration: none; }
.p-st-card .p-frame { margin-bottom: 8px; }
.p-st-card img { transition: transform 400ms var(--ease-out); }
.p-st-card__name { font-weight: 600; line-height: 1.3; }
.p-st-card__meta { color: var(--muted); font-size: var(--step-small); }
@media (hover: hover) and (pointer: fine) {
  .p-st-card:hover img { transform: scale(1.03); }
  .p-st-card:hover .p-st-card__name { text-decoration: underline; text-underline-offset: 0.2em; }
}

/* ---------- 2. /styles ---------- */
.p-st-hero { padding-top: clamp(40px, 6vw, 80px); }
.p-st-hero__top {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 24px clamp(32px, 5vw, 72px);
  align-items: end;
}
.p-st-hero__intro { display: grid; gap: 20px; }
.p-st-pile__title { margin: clamp(40px, 5vw, 64px) 0 20px; font-size: var(--step-body); font-weight: 600; color: var(--muted); }
.p-st-pile { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--gap); margin: 0; padding: 0; list-style: none; }

/* The filter panel: shown only when the script can run it */
html:not(.js) .p-st-board { display: none; }
.p-st-board__panel {
  display: grid;
  gap: 28px;
  padding: clamp(20px, 3vw, 36px);
  border-radius: calc(var(--radius) + 4px);
  background: var(--paper);
}
.p-st-board__head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: 16px 40px;
  align-items: end;
}
.p-st-search { display: grid; gap: 6px; }
.p-st-search__input { width: 100%; }
.p-st-label { margin: 0; font-size: var(--step-small); font-weight: 600; }
.p-st-controls { display: grid; gap: 20px; }
.p-st-group { display: grid; grid-template-columns: 7rem minmax(0, 1fr); gap: 8px 20px; align-items: start; }
.p-st-group .p-st-label { padding-top: 10px; }
.p-st-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.p-st-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font: 500 var(--step-small)/1 var(--font-text);
  cursor: pointer;
  transition: background-color var(--t-hover) ease, border-color var(--t-hover) ease, color var(--t-hover) ease;
}
.p-st-chip__count { color: var(--muted); }
.p-st-chip[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: #fff; }
.p-st-chip[aria-pressed="true"] .p-st-chip__count { color: #cfcac0; }
@media (hover: hover) and (pointer: fine) {
  .p-st-chip[aria-pressed="false"]:hover { background: var(--surface); border-color: #c9c2b5; }
}
.p-st-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; padding-top: 20px; box-shadow: 0 -1px 0 var(--line); }
.p-st-status { margin: 0; font-weight: 600; }
.p-st-note { margin-top: 16px; max-width: 80ch; }

.p-st-family[hidden] { display: none; }
.p-st-family__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 40px;
  margin-bottom: clamp(28px, 3.5vw, 40px);
}
.p-st-family__head > div { display: grid; gap: 10px; max-width: 46rem; }
.p-st-count { margin: 0; color: var(--muted); font-weight: 500; }

.p-st-empty__box { display: grid; gap: 14px; justify-items: start; max-width: 40rem; padding: clamp(24px, 3vw, 40px); border-radius: var(--radius); background: var(--surface); }
.p-st-empty__box p { margin: 0; }

.p-st-close__grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 24px clamp(32px, 5vw, 72px); align-items: start; }
.p-st-close__body { display: grid; gap: 16px; }

@media (max-width: 1079.98px) {
  .p-st-pile { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .p-st-grid--five { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 899.98px) {
  .p-st-hero__top, .p-st-board__head, .p-st-close__grid { grid-template-columns: minmax(0, 1fr); }
  .p-st-group { grid-template-columns: minmax(0, 1fr); }
  .p-st-group .p-st-label { padding-top: 0; }
}
@media (max-width: 599.98px) {
  .p-st-pile, .p-st-grid, .p-st-grid--five { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 20px; }
  .p-st-actions .p-btn { flex: 1 1 100%; }
}

/* ---------- 3. /styles/{slug} ---------- */
.p-sd-hero { padding-top: clamp(24px, 3vw, 40px); }
.p-sd-hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}
.p-sd-hero__copy { display: grid; gap: 20px; justify-items: start; }
.p-sd-hero__pic { margin: 0; width: 100%; max-width: 440px; justify-self: end; }
.p-sd-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.p-sd-tag {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-size: var(--step-small);
  font-weight: 500;
}
a.p-sd-tag { text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: 0.2em; }

.p-sd-frames__grid {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 4fr) minmax(0, 4fr);
  gap: var(--gap);
  align-items: start;
}
.p-sd-frames__intro { display: grid; gap: 14px; align-content: start; }
.p-sd-frame { margin: 0; }

.p-sd-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); }
.p-sd-card { display: grid; align-content: start; gap: 14px; padding: clamp(20px, 2.4vw, 28px); border-radius: var(--radius); background: var(--paper); }
.p-sd-card .p-text { font-size: var(--step-body); }
.p-sd-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.p-sd-list li { display: flex; gap: 10px; line-height: 1.5; }
.p-sd-list li::before { content: "–"; flex: none; color: var(--muted); }
.p-sd-list--good li::before { content: "✓"; color: var(--green); font-weight: 600; }
.p-sd-k { margin: 4px 0 0; font-size: var(--step-small); font-weight: 600; }
.p-sd-scale { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; margin: 0; padding: 0; list-style: none; }
.p-sd-scale li {
  padding: 8px 4px;
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 500;
  text-align: center;
}
.p-sd-scale li[aria-current="true"] { background: var(--ink); color: #fff; font-weight: 600; }

.p-sd-similar__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; margin-bottom: clamp(24px, 3vw, 36px); }
.p-sd-near { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); margin-top: clamp(32px, 4vw, 48px); }
.p-sd-near__link {
  display: grid;
  gap: 4px;
  padding: 18px 22px;
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  text-decoration: none;
  transition: background-color var(--t-hover) ease;
}
.p-sd-near__link--next { text-align: right; }
.p-sd-near__dir { color: var(--muted); font-size: var(--step-small); }
.p-sd-near__name { font-weight: 600; }
@media (hover: hover) and (pointer: fine) {
  .p-sd-near__link:hover { background: var(--surface-2); }
}

.p-sd-cta__grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 24px clamp(32px, 5vw, 72px); align-items: center; }
.p-sd-cta__grid > div { display: grid; gap: 14px; }
.p-sd-cta__grid .p-st-actions { justify-content: flex-end; }

@media (max-width: 1079.98px) {
  .p-sd-cards { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .p-sd-cards > :last-child { grid-column: 1 / -1; }
  .p-sd-frames__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .p-sd-frames__intro { grid-column: 1 / -1; }
}
@media (max-width: 899.98px) {
  .p-sd-hero__grid, .p-sd-cta__grid { grid-template-columns: minmax(0, 1fr); }
  .p-sd-hero__pic { justify-self: start; max-width: 300px; }
  .p-sd-cta__grid .p-st-actions { justify-content: flex-start; }
}
@media (max-width: 599.98px) {
  .p-sd-cards { grid-template-columns: minmax(0, 1fr); }
  .p-sd-near { grid-template-columns: minmax(0, 1fr); }
  .p-sd-near__link--next { text-align: left; }
}

/* ---------- 4. Ink & Paint layer ---------- */
/* Style cards: cels with a thick outline and hard shadow, tilted a little, straightening under the pointer */
.p-st-card { color: var(--fg); gap: 6px; }
.p-st-card .p-frame {
  margin-bottom: 8px;
  border: 3px solid var(--night);
  border-radius: 18px;
  box-shadow: 6px 6px 0 var(--card-shadow, var(--night));
  transition: transform 500ms var(--ease-back), box-shadow 500ms var(--ease-back);
}
[data-chapter="black"], [data-chapter="night"] { --card-shadow: var(--sun); }
[data-chapter="blue"] { --card-shadow: var(--night); }
.p-st-card__name { font: 760 var(--step-body)/1.2 var(--font-display); font-stretch: 90%; }
.p-st-card__meta { color: var(--muted); }
.p-st-tile:nth-child(4n + 1) .p-frame, .p-st-pile__item:nth-child(odd) .p-frame { rotate: -1.5deg; }
.p-st-tile:nth-child(4n + 3) .p-frame, .p-st-pile__item:nth-child(even) .p-frame { rotate: 1.5deg; }
@media (hover: hover) and (pointer: fine) {
  .p-st-card:hover .p-frame { rotate: 0deg; transform: translate(-4px, -6px) scale(1.03); box-shadow: 10px 12px 0 var(--card-shadow, var(--night)); }
  .p-st-card:hover img { transform: scale(1.06); }
  .p-st-card:hover .p-st-card__name { text-decoration: underline; text-decoration-thickness: 2px; text-decoration-color: var(--sun); }
}

/* /styles hero: night, the six launch styles as a pile of cels */
.p-st-hero { padding-bottom: clamp(64px, 8vw, 120px); }
.p-st-hero .p-lead { color: #ffffff; }
.p-st-pile__title { color: var(--sun); font: 800 var(--step-title)/1 var(--font-display); font-stretch: 85%; }
.p-st-pile { gap: clamp(14px, 2vw, 28px); }

/* Filter panel: a white cel on the sun field */
.p-st-board__panel {
  --fg: var(--night);
  --muted: #4b5873;
  --line: #d3d9e8;
  --surface: #e6eaf4;
  --ring: var(--night);
  color: var(--night);
  background: #ffffff;
  border: 3px solid var(--night);
  border-radius: var(--radius-lg);
  box-shadow: 10px 10px 0 var(--night);
}
.p-st-chip {
  min-height: 44px;
  padding: 0 16px;
  border: 2px solid var(--night);
  background: #ffffff;
  color: var(--night);
  font-weight: 600;
  transition: background-color var(--t-hover) ease, color var(--t-hover) ease, transform 400ms var(--ease-back);
}
.p-st-chip[aria-pressed="true"] { background: var(--night); color: var(--sun); border-color: var(--night); transform: rotate(-3deg); }
.p-st-chip[aria-pressed="true"] .p-st-chip__count { color: #ffffff; }
.p-st-chip:active { transform: scale(0.94); }
@media (hover: hover) and (pointer: fine) {
  .p-st-chip[aria-pressed="false"]:hover { background: var(--sun); border-color: var(--night); transform: translateY(-2px); }
}
.p-st-foot { box-shadow: none; padding-top: 0; }
.p-st-status { font: 800 var(--step-title)/1.1 var(--font-display); font-stretch: 85%; }
.p-st-board .p-st-note { color: var(--night); }
.p-st-family__head .p-head { font-size: clamp(2.75rem, 1.4rem + 5vw, 6rem); }
.p-st-count { font: 800 var(--step-title)/1 var(--font-display); font-stretch: 85%; color: var(--fg); }
.p-st-empty__box { background: #ffffff; color: var(--night); border: 3px solid var(--night); box-shadow: 8px 8px 0 var(--night); }

/* /styles/{slug} hero: night, the scene on a white mat with the iris, then the style's name running past */
.p-sd-hero { padding-bottom: 0; }
.p-sd-hero .p-display { max-width: 12ch; }
.p-sd-hero__pic { position: relative; isolation: isolate; }
.p-sd-hero__pic::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: 50%;
  top: 50%;
  width: 125%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--blue);
  transform: translate(-50%, -50%);
}
.p-sd-hero__pic .p-frame { border: 10px solid #ffffff; border-radius: 26px; box-shadow: 12px 12px 0 var(--sun); rotate: 2.5deg; background: #ffffff; }
@media (prefers-reduced-motion: no-preference) {
  .js .p-sd-hero__pic::before { animation: p-sd-iris 1000ms var(--ease-expo) 150ms both; }
}
@keyframes p-sd-iris { from { transform: translate(-50%, -50%) scale(0); } to { transform: translate(-50%, -50%) scale(1); } }
.p-sd-tag { min-height: 36px; padding: 0 14px; background: var(--night-2); color: #ffffff; font-weight: 600; }
a.p-sd-tag { background: var(--sun); color: var(--night); text-decoration: none; transition: transform 400ms var(--ease-back); }
a.p-sd-tag:hover { transform: rotate(-3deg) scale(1.05); }
.p-sd-band { --marquee-gap: 0px; margin: clamp(56px, 7vw, 104px) calc(-1 * var(--inline) - 20px) 0; width: calc(100% + 2 * var(--inline) + 40px); padding-block: 14px; background: var(--sun); color: var(--night); rotate: -1.5deg; translate: 0 22px; }
.p-sd-band__words { margin: 0; }
.p-sd-band__words span:not(.p-sd-band__star) { font: 880 clamp(2rem, 1.2rem + 3vw, 4rem)/1 var(--font-display); font-stretch: 76%; text-transform: uppercase; white-space: nowrap; }
.p-sd-band__star { flex: none; width: 22px; aspect-ratio: 1; margin-inline: 28px; background: var(--night); clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); }
.p-sd-frames { padding-top: calc(var(--chapter-y) + 24px); }
.p-sd-frames .p-text { color: #ffffff; }
.p-sd-frame .p-frame { border: 8px solid #ffffff; border-radius: 22px; box-shadow: 10px 10px 0 var(--night); }
.p-sd-frame:nth-of-type(1) { rotate: -2deg; }
.p-sd-frame:nth-of-type(2) { rotate: 2deg; margin-top: 40px; }
.p-sd-frame .p-caption { color: #ffffff; font-weight: 600; }
.p-sd-card { background: #ffffff; color: var(--night); border: 3px solid var(--night); box-shadow: 7px 7px 0 var(--night); --fg: var(--night); --muted: #4b5873; --surface: #e6eaf4; }
.p-sd-list--good li::before { content: ""; width: 20px; height: 20px; margin-top: 0.15em; border-radius: 50%; background: var(--night) no-repeat center / 11px 11px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 6.4 4.8 9 10 3' fill='none' stroke='%23ffcc1f' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.p-sd-scale li[aria-current="true"] { background: var(--sun); color: var(--night); font-weight: 800; box-shadow: 0 0 0 2px var(--night); }
.p-sd-near__link {
  padding: 22px 26px;
  background: #ffffff;
  color: var(--night);
  border: 3px solid var(--night);
  box-shadow: 7px 7px 0 var(--sun);
  transition: transform 450ms var(--ease-back), box-shadow 450ms var(--ease-back);
}
.p-sd-near__name { font: 800 var(--step-title)/1.1 var(--font-display); font-stretch: 86%; }
.p-sd-near__dir { color: #4b5873; font-weight: 600; }
@media (hover: hover) and (pointer: fine) {
  .p-sd-near__link:hover { background: #ffffff; transform: translate(-4px, -4px) rotate(-1deg); box-shadow: 11px 11px 0 var(--sun); }
  .p-sd-near__link--next:hover { transform: translate(-4px, -4px) rotate(1deg); }
}
@media (max-width: 899.98px) {
  .p-sd-frame:nth-of-type(2) { margin-top: 0; }
}
