@import url('/css/stylecheat.css');

@font-face {
  font-family: 'Space Grotesk';
  font-weight: 500 600;
  font-display: swap;
  src: url('/assets/fonts/space-grotesk.woff2') format('woff2');
}

:root {
  --accent-lens: oklch(0.78 0.14 75);
  --font-display: 'Space Grotesk', var(--font-sans, system-ui, sans-serif);
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans, system-ui, sans-serif);
}

/* stylecheat tucks button children with negative margins, which cancels the
   gap between an icon and its label — zero them and keep an honest gap. */
:is(a, button):is([primary], [secondary], [tertiary]) {
  gap: calc(var(--unit) * 1.5);
}

:is(a, button):is([primary], [secondary], [tertiary]) > * {
  margin-inline: 0;
}

overlens-inspector {
  display: block;
  height: 100dvh;
}

inspector-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: calc(var(--unit) * 4);
  height: 100dvh;
  padding: calc(var(--unit) * 6);
  text-align: center;
}

inspector-state icon {
  --unit-size: 48px;
  opacity: 0.7;
}

inspector-state icon[checkmark] {
  --color: var(--green);
}

inspector-state p {
  max-width: 520px;
  color: var(--muted-foreground);
  line-height: 1.6;
}

inspector-state p[fine] {
  font-size: 13px;
  opacity: 0.7;
}

inspector-meta {
  background: oklch(from var(--card) l c h / 0.82);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: calc(var(--unit) * 1.5);
}

top-left {
  position: fixed;
  top: calc(var(--unit) * 3);
  left: calc(var(--unit) * 6);
  z-index: 10;
  display: flex;
  align-items: center;
  min-height: calc(var(--unit) * 11);
  gap: calc(var(--unit) * 3);
}

inspector-meta {
  display: flex;
  align-items: center;
  gap: calc(var(--unit) * 3);
  padding: calc(var(--unit) * 1) calc(var(--unit) * 3);
}

inspector-meta a {
  padding-inline: calc(var(--unit) * 2);
  margin-left: calc(var(--unit) * -2);
}

meta-detail {
  font-size: 13px;
  color: var(--muted-foreground);
  font-family: var(--font-mono, monospace);
}

top-right {
  position: fixed;
  top: calc(var(--unit) * 3);
  right: calc(var(--unit) * 6);
  z-index: 10;
  display: flex;
  align-items: center;
  min-height: calc(var(--unit) * 11);
  gap: calc(var(--unit) * 2);
}

inspector-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: calc(var(--unit) * 2);
}

auth-bar {
  display: flex;
}

auth-bar:not(:has(button)) {
  display: none;
}

control-group {
  display: flex;
}

control-group button {
  border-radius: 0;
}

control-group button:first-child {
  border-radius: calc(var(--unit) * 1) 0 0 calc(var(--unit) * 1);
}

control-group button:last-child {
  border-radius: 0 calc(var(--unit) * 1) calc(var(--unit) * 1) 0;
}

control-group button:not(:first-child) {
  margin-left: -1px;
}

inspector-controls button[active],
slide-tools button[active] {
  background: var(--accent);
  color: var(--accent-foreground);
  border-color: var(--accent-foreground);
  z-index: 1;
}

body {
  scrollbar-color: oklch(from var(--foreground) l c h / 0.2) oklch(from var(--foreground) l c h / 0.08);
}

::-webkit-scrollbar {
  width: calc(var(--unit) * 2.5);
}

::-webkit-scrollbar-track {
  background: oklch(from var(--foreground) l c h / 0.08);
}

::-webkit-scrollbar-thumb {
  background: oklch(from var(--foreground) l c h / 0.2);
  border-radius: 999px;
  border: 2px solid var(--background);
}

slides > section {
  flex-direction: column;
  gap: calc(var(--unit) * 3);
  height: 100dvh;
  padding: calc(var(--unit) * 16) calc(var(--unit) * 6) calc(var(--unit) * 6);
  box-sizing: border-box;
}

slide-header {
  display: flex;
  align-items: center;
  gap: calc(var(--unit) * 3);
  flex-wrap: wrap;
}

slide-header h2 {
  margin: 0;
  font-size: 20px;
  font-family: var(--font-mono, monospace);
}

diff-percent {
  font-size: 13px;
  color: var(--muted-foreground);
  font-family: var(--font-mono, monospace);
}

slide-tools {
  display: flex;
  align-items: center;
  gap: calc(var(--unit) * 3);
  margin-left: auto;
}

compare-pane {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: calc(var(--unit) * 3);
}

compare-pane:has(pane-note[stacked]) {
  align-items: center;
  justify-content: center;
}

compare-area {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: safe center;
  justify-content: safe center;
  scrollbar-gutter: stable both-edges;
}

compare-area[fit] {
  overflow: hidden;
  container-type: size;
}

compare-area:not([fit]) {
  overflow: auto;
  container-type: inline-size;
}

pane-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: calc(var(--unit) * 2);
  flex-wrap: wrap;
  padding: calc(var(--unit) * 4);
  color: var(--muted-foreground);
  font-size: 14px;
}

pane-note[danger] {
  color: var(--destructive);
}

pane-note[stacked] {
  flex-direction: column;
  font-size: 16px;
}

variant-jumps {
  display: flex;
  gap: calc(var(--unit) * 2);
  --unit-size: 24px;
}

compare-stack {
  position: relative;
  width: fit-content;
  display: grid;
  place-items: start;
  cursor: ew-resize;
  user-select: none;
  touch-action: pan-y;
}

compare-stack img {
  -webkit-user-drag: none;
}

compare-stack > img {
  grid-area: 1 / 1;
}

compare-pane img {
  display: block;
  background: white;
}

compare-stack img[clipped] {
  clip-path: inset(0 0 0 var(--split));
}

compare-slider {
  display: block;
  padding: calc(var(--unit) * 3) 0 0;
}

compare-slider input[type='range'] {
  width: 100%;
  min-width: 0;
}

compare-slider input[type='range']::-webkit-slider-thumb {
  width: calc(var(--unit) * 7);
}

split-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--split);
  width: 2px;
  margin-left: -1px;
  background: var(--accent-lens);
  cursor: ew-resize;
  touch-action: none;
}

split-handle::before {
  content: '';
  position: absolute;
  inset: 0 -8px;
}

split-handle::after {
  content: '◂▸';
  position: sticky;
  top: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  width: calc(var(--unit) * 8);
  aspect-ratio: 1;
  margin-left: calc(1px - var(--unit) * 4);
  font-size: 11px;
  color: oklch(0.2 0 0);
  background: var(--accent-lens);
  border-radius: 100%;
}

two-up {
  display: flex;
  align-items: flex-start;
  gap: calc(var(--unit) * 3);
  width: 100%;
}

two-up figure {
  flex: 1;
  min-width: 0;
  margin: 0;
}

two-up figure:first-child img {
  margin-inline: auto 0;
}

two-up figure:last-child img {
  margin-inline: 0 auto;
}

landing-page {
  display: flex;
  justify-content: center;
  align-items: safe center;
  min-height: 100dvh;
  padding: calc(var(--unit) * 12) calc(var(--unit) * 6);
  box-sizing: border-box;
}

a[logo-text] {
  align-self: center;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--foreground);
  text-decoration: none;
}

a[logo-text]:hover {
  color: var(--accent-lens);
}

landing-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(var(--unit) * 5);
  min-width: 0;
  max-width: 760px;
  text-align: center;
}

landing-hero crow {
  flex-wrap: wrap;
}

overlens-mark {
  width: 64px;
  height: 64px;
  margin-bottom: calc(var(--unit) * -1);
  border-radius: 100%;
  border: 3px solid var(--accent-lens);
  box-shadow:
    inset 0 0 0 8px var(--background),
    inset 0 0 0 11px oklch(from var(--accent-lens) l c h / 0.55),
    0 0 48px oklch(from var(--accent-lens) l c h / 0.25);
  background: radial-gradient(circle at 35% 35%, oklch(from var(--accent-lens) l c h / 0.35), transparent 60%);
}

landing-hero h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 54px;
  font-weight: 500;
  letter-spacing: -0.03em;
  color: var(--foreground);
}

p[tagline] {
  margin: 0;
  max-width: 560px;
  font-size: 17px;
  line-height: 1.6;
  color: var(--muted-foreground);
}

hint-banner {
  display: flex;
  align-items: center;
  gap: calc(var(--unit) * 2);
  padding: calc(var(--unit) * 2.5) calc(var(--unit) * 4);
  background: oklch(from var(--accent-lens) l c h / 0.12);
  border: 1px solid oklch(from var(--accent-lens) l c h / 0.4);
  border-radius: var(--radius);
  font-size: 14px;
  text-align: left;
}

hint-banner[danger] {
  background: oklch(from var(--destructive) l c h / 0.12);
  border-color: oklch(from var(--destructive) l c h / 0.4);
}

url-sample {
  padding: calc(var(--unit) * 2.5) calc(var(--unit) * 4);
  font-family: var(--font-mono, monospace);
  font-size: 15px;
  color: var(--muted-foreground);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

url-sample strong {
  color: var(--accent-lens);
  font-weight: 600;
}

url-sample {
  perspective: 600px;
}

sample-flip {
  display: grid;
  transform-style: preserve-3d;
  transition: transform 500ms;
}

sample-face {
  grid-area: 1 / 1;
  backface-visibility: hidden;
  white-space: nowrap;
  text-align: center;
}

sample-face[back] {
  transform: rotateX(180deg);
}

crow:has(a[preview]:hover) + url-sample sample-flip {
  transform: rotateX(180deg);
}

landing-shot {
  display: block;
  margin-top: calc(var(--unit) * 3);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) * 1.5);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

landing-shot img {
  display: block;
  max-width: 100%;
}

guide-modal {
  display: flex;
  flex-direction: column;
  gap: calc(var(--unit) * 4);
  max-width: 760px;
  padding: calc(var(--unit) * 6);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: calc(var(--unit) * 1.5);
}

guide-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: calc(var(--unit) * 3);
}

guide-head button {
  padding: calc(var(--unit) * 2);
}

guide-head h2,
guide-step h3 {
  margin: 0;
}

guide-modal p {
  margin: 0;
  font-size: 16px;
  line-height: 1.7;
  color: oklch(from var(--muted-foreground) calc(l - 0.08 * var(--theme-sign)) c h);
}

guide-step {
  display: flex;
  flex-direction: column;
  gap: calc(var(--unit) * 2);
}

guide-step h3 {
  display: flex;
  align-items: center;
  gap: calc(var(--unit) * 2);
  font-size: 15px;
}

step-no {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 100%;
  background: var(--accent-lens);
  color: oklch(0.2 0 0);
  font-size: 13px;
}

guide-modal [codie] {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: calc(var(--unit) * 1);
  font-size: 12px;
}

@media (width <= 768px) {
  overlens-inspector {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: min-content min-content min-content 1fr;
    gap: calc(var(--unit) * 2);
    padding: calc(var(--unit) * 2) calc(var(--unit) * 2) 0;
    box-sizing: border-box;
  }

  overlens-inspector top-left,
  overlens-inspector top-right,
  overlens-inspector top-right > component {
    display: contents;
  }

  overlens-inspector [logo-text] {
    grid-area: 1 / 1;
    align-self: center;
  }

  overlens-inspector auth-bar {
    grid-area: 1 / 2;
  }

  inspector-meta {
    grid-area: 2 / 1 / 3 / 3;
    flex-direction: column;
    align-items: flex-start;
    gap: calc(var(--unit) * 1);
  }

  inspector-controls {
    grid-area: 3 / 1 / 4 / 3;
    justify-content: flex-start;
  }

  inspector-state,
  overlens-inspector carousel {
    grid-area: 4 / 1 / 5 / 3;
    height: auto;
    min-height: 0;
  }

  overlens-inspector slides > section {
    height: 100%;
    padding: 0 0 calc(var(--unit) * 2);
  }

  landing-page {
    padding-inline: calc(var(--unit) * 4);
  }

  landing-hero h1 {
    font-size: 40px;
  }

  url-sample {
    padding-inline: calc(var(--unit) * 3);
    font-size: 13px;
  }

  sample-host {
    display: none;
  }
}
