:root[data-preview] { scrollbar-width: none; }

:root[data-preview]::-webkit-scrollbar { display: none; }

:root[data-theme] {
  --page: var(--theme-background);
  --paper: var(--theme-panel);
  --ink: var(--theme-text);
  --muted: var(--theme-muted);
  --line: var(--theme-border);
  --accent: var(--theme-primary) !important;
  --on-accent: var(--theme-primaryText) !important;
  --serif: var(--theme-headingFont);
  --rhythm: calc(var(--theme-spacing) * var(--theme-density));
  font-family: var(--theme-bodyFont);
}

[data-theme] body { min-height: 100vh; }

[data-theme][data-background-mode="gradient"] body {
  background: linear-gradient(145deg, var(--theme-background), var(--theme-background2));
}

[data-theme][data-background-mode="image"] body {
  background-image: linear-gradient(
    color-mix(in srgb, #090807 var(--theme-overlay), transparent),
    color-mix(in srgb, #090807 var(--theme-overlay), transparent)
  ), var(--theme-image, linear-gradient(var(--page), var(--page)));
  background-size: cover;
  background-position: center;
}

[data-theme][data-background-mode="image"][data-background-position="top"] body { background-position: center top; }
[data-theme][data-background-mode="image"][data-background-position="bottom"] body { background-position: center bottom; }

[data-theme] .page { padding-top: calc(0.75rem * var(--rhythm)); }

[data-theme] .layout {
  border-radius: var(--theme-frameRadius);
  background: transparent;
  box-shadow: 0 14px 38px rgb(0 0 0 / var(--theme-shadow)), 0 0 0 var(--theme-borderWidth) var(--line);
}

[data-theme] .hero {
  min-height: calc(18.5rem * var(--theme-density));
  color: var(--theme-coverText);
  background: color-mix(in srgb, var(--theme-background2) 36%, #191613);
}

[data-theme] .hero-content {
  padding: calc(1.25rem * var(--rhythm)) clamp(1.15rem, 5vw, 2.25rem) calc(1.5rem * var(--rhythm));
}

[data-theme] h1, [data-theme] h2 { font-weight: var(--theme-headingWeight); }
[data-theme] h1 { font-size: var(--theme-headingSize); }
[data-theme] #description { color: var(--theme-coverText); font-size: var(--theme-descriptionSize); }
[data-theme] .hero-rule { background: var(--theme-icon); }

[data-theme] .panel {
  padding: calc(1.35rem * var(--rhythm)) clamp(1rem, 4.5vw, 2rem) calc(0.85rem * var(--rhythm));
  background: color-mix(in srgb, var(--paper) var(--theme-opacity), transparent);
}

[data-theme] .actions {
  display: grid;
  gap: var(--theme-buttonGap);
  margin-top: calc(1.05rem * var(--rhythm));
}

[data-theme] .action + .action { border: 0; }
[data-theme] .action.primary { margin: 0; }

[data-theme] .action-control {
  --button-paint: var(--theme-secondary);
  --button-label: var(--theme-buttonText);
  min-height: var(--theme-buttonHeight);
  border: var(--theme-borderWidth) solid transparent;
  border-radius: var(--theme-buttonRadius);
  background: color-mix(in srgb, var(--button-paint) var(--theme-opacity), transparent);
  color: var(--button-label);
}

[data-theme] .primary .action-control {
  --button-paint: var(--accent);
  --button-label: var(--on-accent);
  min-height: calc(var(--theme-buttonHeight) + 6px);
}

[data-theme] .action-detail {
  color: color-mix(in srgb, currentColor 76%, var(--theme-muted));
}

[data-theme] .primary .action-detail { color: inherit; }
[data-theme] .action-icon, [data-theme] .copy-icon { color: var(--theme-icon); }
[data-theme] .action-icon { border: var(--theme-borderWidth) solid var(--line); }
[data-theme] .primary .action-icon { border-color: currentColor; }

[data-theme][data-button-style="mixed"] .action:not(.primary) + .action {
  border-top: var(--theme-borderWidth) solid var(--line);
}

[data-theme][data-button-style="outline"] .action-control:not([data-cta-style]) {
  border-color: var(--line);
  background: color-mix(in srgb, var(--theme-secondary) 46%, transparent);
}

[data-theme][data-button-style="outline"] .primary .action-control:not([data-cta-style]) {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 7%, transparent);
}

[data-theme][data-button-style="minimal"] .action-control:not([data-cta-style]) {
  background: color-mix(in srgb, var(--button-paint) 9%, transparent);
}

[data-theme][data-button-style="minimal"] .action-icon { border-color: transparent; }

[data-theme] .action-control:focus-visible { outline-color: var(--ink); }
[data-theme] .pix-manual input { background: var(--paper); border-color: var(--line); }
[data-theme] .action-control[data-copied] { background: #dcead9; color: #243b20; }
[data-theme] .action-control[data-copied] .action-detail { color: #365530; }

@media (hover: hover) {
  [data-theme] .action-control:hover {
    background: color-mix(in srgb, var(--button-paint) 81%, var(--paper));
  }
  [data-theme][data-button-style="outline"] .action-control:not([data-cta-style]):hover,
  [data-theme][data-button-style="minimal"] .action-control:not([data-cta-style]):hover {
    background: color-mix(in srgb, var(--button-paint) 17%, var(--paper));
  }
  [data-theme] .action-control[data-copied]:hover,
  [data-theme][data-button-style] .action-control[data-copied]:hover { background: #d0e4cb; }
}

@media (min-width: 48rem) {
  [data-theme] .page { padding-top: calc(clamp(2rem, 8vh, 5rem) * var(--rhythm)); }
  [data-theme] .hero { min-height: calc(35rem * var(--theme-density)); }
  [data-theme] .hero-content { padding: calc(2.75rem * var(--rhythm)) clamp(1.7rem, 4vw, 3.1rem); }
  [data-theme] h1 { font-size: calc(var(--theme-headingSize) * 1.55); }
  [data-theme] #description { font-size: calc(var(--theme-descriptionSize) + 1px); }
  [data-theme] .panel { padding: calc(2.25rem * var(--rhythm)) clamp(1.65rem, 3.8vw, 3rem) calc(1.45rem * var(--rhythm)); }
  [data-theme] .actions { margin-top: calc(1.4rem * var(--rhythm)); }
}

@media (min-width: 64rem) {
  [data-theme] h1 { font-size: calc(var(--theme-headingSize) * 1.88); }
}

.action-control[data-cta-style], .action-control[data-cta-color] {
  --individual-paint: var(--cta-color, var(--button-paint, var(--theme-secondary, var(--page))));
  --individual-text: var(--cta-text, var(--button-label, var(--ink)));
}

.primary .action-control:is([data-cta-style], [data-cta-color]) {
  --individual-paint: var(--cta-color, var(--accent));
  --individual-text: var(--cta-text, var(--on-accent));
}

:root .action .action-control[data-cta-style="solid"],
:root:not([data-button-style="outline"], [data-button-style="minimal"]) .action .action-control[data-cta-color]:not([data-cta-style]) {
  background: var(--individual-paint);
  border-color: transparent;
  color: var(--individual-text);
}

:root .action .action-control[data-cta-style="outline"],
:root[data-button-style="outline"] .action .action-control[data-cta-color]:not([data-cta-style]) {
  background: color-mix(in srgb, var(--individual-paint) 8%, transparent);
  border: max(1px, var(--theme-borderWidth, 1px)) solid var(--individual-paint);
  color: var(--ink);
}

:root .action .action-control[data-cta-style="minimal"],
:root[data-button-style="minimal"] .action .action-control[data-cta-color]:not([data-cta-style]) {
  background: color-mix(in srgb, var(--individual-paint) 12%, transparent);
  border-color: transparent;
  color: var(--ink);
}

.action-control:is([data-cta-color], [data-cta-style]) .action-detail { color: inherit; }
:root .action .action-control[data-copied] { background: #dcead9; color: #243b20; }
