:root {
  color-scheme: light;
  --background: 48 30% 96%;
  --foreground: 30 8% 10%;
  --card: 45 25% 93%;
  --secondary: 45 22% 90%;
  --muted-foreground: 40 6% 39%;
  --accent: 217 84% 46%;
  --accent-foreground: 0 0% 98%;
  --border: 45 18% 85%;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --font-display: "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --background: 30 8% 8%;
    --foreground: 45 25% 90%;
    --card: 30 7% 11%;
    --secondary: 30 6% 15%;
    --muted-foreground: 40 6% 60%;
    --accent: 217 90% 62%;
    --accent-foreground: 30 8% 8%;
    --border: 30 6% 20%;
  }
}

*, *::before, *::after { box-sizing: border-box; border-radius: 0; }
[hidden] { display: none !important; }

html, body { margin: 0; }
body {
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  font: 400 13.5px/1.55 var(--font-mono);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: hsl(var(--accent)); text-decoration: none; }
a:hover { text-decoration: underline; }
code, kbd, pre { font-family: var(--font-mono); }
:focus-visible { outline: 1px solid hsl(var(--accent)); outline-offset: 2px; }

.top, .foot {
  display: flex;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
  padding: 14px 24px;
  border-bottom: 1px solid hsl(var(--border));
}
.foot {
  border-bottom: 0;
  border-top: 1px solid hsl(var(--border));
  justify-content: space-between;
  color: hsl(var(--muted-foreground));
  font-size: 12px;
  margin-top: auto;
}
.brand { color: hsl(var(--foreground)); font-weight: 700; font-size: 15.5px; }
.brand:hover { text-decoration: none; }
.mark { color: hsl(var(--accent)); font-weight: 400; }
.tagline { color: hsl(var(--muted-foreground)); }
.caret::after { content: "▋"; color: hsl(var(--accent)); margin-left: 2px; animation: blink 1s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }
.privacy { margin-left: auto; color: hsl(var(--muted-foreground)); font-size: 12px; }

.page {
  display: grid;
  grid-template-columns: minmax(300px, 380px) 1fr;
  gap: 16px;
  padding: 16px 24px 32px;
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  animation: page-in 0.35s ease-out both;
}
@keyframes page-in { from { opacity: 0; transform: translateY(4px); } }
.controls, .stage { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.card {
  border: 1px solid hsl(var(--border));
  background: hsl(var(--card));
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
.section-heading {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
}
.section-heading::before { content: "■ "; color: hsl(var(--accent)); font-weight: 400; }
.page-title {
  font-family: var(--font-mono);
  font-size: clamp(2rem, 4.6vw, 3.25rem);
  line-height: 1.04;
  letter-spacing: -0.045em;
  font-weight: 600;
  margin: 0;
}
.lede { margin: 0; color: hsl(var(--muted-foreground)); font-size: 14px; max-width: 46ch; }
.hint { margin: 0; color: hsl(var(--muted-foreground)); font-size: 12px; }

.seg { display: flex; border: 1px solid hsl(var(--border)); }
.seg button {
  flex: 1;
  font: inherit;
  font-size: 12.5px;
  padding: 7px 8px;
  border: 0;
  border-right: 1px solid hsl(var(--border));
  background: transparent;
  color: hsl(var(--muted-foreground));
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}
.seg button:last-child { border-right: 0; }
.seg button:hover { color: hsl(var(--foreground)); background: hsl(var(--secondary)); }
.seg button.on { background: hsl(var(--foreground)); color: hsl(var(--background)); }

.pane { display: flex; flex-direction: column; gap: 12px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > span { font-size: 12px; color: hsl(var(--muted-foreground)); }
.field code { font-size: 12px; color: hsl(var(--foreground)); }
.field input:not([type]), .field select {
  font: inherit;
  font-size: 13.5px;
  color: hsl(var(--foreground));
  background: hsl(var(--background));
  border: 1px solid hsl(var(--border));
  padding: 7px 9px;
  width: 100%;
  min-width: 0;
}
.field input[data-key="text"], .field input[data-key="emoji"] { font-size: 18px; padding: 6px 9px; }
.field.color { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; align-items: center; column-gap: 8px; }
.field.color > span { grid-column: 1 / -1; }
.field input[type="color"] {
  width: 34px;
  height: 30px;
  padding: 2px;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--background));
  cursor: pointer;
}
.field input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.field input[type="color"]::-webkit-color-swatch { border: 0; }
.field input[type="color"]::-moz-color-swatch { border: 0; }
.field.range input { width: 100%; accent-color: hsl(var(--accent)); }

.drop {
  display: grid;
  place-items: center;
  min-height: 110px;
  padding: 16px;
  text-align: center;
  border: 1px dashed hsl(var(--border));
  background: hsl(var(--background));
  color: hsl(var(--muted-foreground));
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.drop:hover, .drop.over { border-color: hsl(var(--accent)); color: hsl(var(--foreground)); }

.actions { display: flex; gap: 8px; flex-wrap: wrap; }
button.primary, button.ghost {
  font: inherit;
  font-size: 13px;
  padding: 8px 12px;
  border: 1px solid hsl(var(--foreground));
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}
button.primary { background: hsl(var(--accent)); border-color: hsl(var(--accent)); color: hsl(var(--accent-foreground)); font-weight: 600; }
button.primary:hover { filter: brightness(1.08); }
button.ghost { background: transparent; color: hsl(var(--foreground)); border-color: hsl(var(--border)); }
button.ghost:hover { border-color: hsl(var(--foreground)); }
button.small { padding: 4px 9px; font-size: 12px; }
kbd {
  font-size: 11px;
  padding: 0 5px;
  border: 1px solid currentColor;
  opacity: 0.7;
  line-height: 1.5;
}
.foot kbd { margin-left: 8px; margin-right: 2px; }
.foot kbd + kbd { margin-left: 0; }

.checker {
  background-color: hsl(var(--background));
  background-image: repeating-conic-gradient(hsl(var(--secondary)) 0 25%, transparent 0 50%);
  background-size: 16px 16px;
}

.hero-card { flex-direction: row; align-items: center; gap: 24px; }
.hero-icon { flex: none; width: 256px; height: 256px; border: 1px solid hsl(var(--border)); display: grid; place-items: center; }
.hero-icon img { width: 224px; height: 224px; display: block; }
.hero-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }

.previews { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }

/* browser tab mock (mock chrome colors, not theme tokens) */
.tabs { display: flex; gap: 2px; padding: 6px 6px 0; background: #dfe1e5; overflow: hidden; }
.tabs.dark { background: #202124; }
.tab {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px; min-width: 0; flex: 1 1 0;
  font: 12px/1.2 system-ui, -apple-system, "Segoe UI", sans-serif;
  color: #3c4043;
  clip-path: inset(0 round 8px 8px 0 0);
}
.tabs.dark .tab { color: #bdc1c6; }
.tab.on { background: #ffffff; color: #202124; }
.tabs.dark .tab.on { background: #35363a; color: #e8eaed; }
.tab img, .fav-blank { width: 16px; height: 16px; flex: none; }
.fav-blank { background: #9aa0a6; clip-path: circle(50%); opacity: 0.6; }
.tt { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.x { opacity: 0.6; }

/* ios mock */
.ios {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
  padding: 18px 12px 14px;
  background: #1c2b3a;
}
.ios .app { display: flex; flex-direction: column; align-items: center; gap: 5px; min-width: 0; }
.ios .app > span:last-child {
  font: 10.5px/1.2 system-ui, -apple-system, sans-serif; color: #ffffff;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ios img, .ios .ph { width: 52px; height: 52px; clip-path: inset(0 round 22.5%); display: block; }
.ios .ph { background: #f6c945; }
.ios .ph.p2 { background: #5ac35a; }
.ios .ph.p3 { background: #f2425e; }

/* android maskable mock */
.android { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 14px 8px; padding: 14px 10px; background: #e9ecef; }
@media (prefers-color-scheme: dark) { .android { background: #1d1f22; } }
.android figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.android figcaption { font-size: 11px; color: hsl(var(--muted-foreground)); }
.mask { position: relative; width: 100%; max-width: 64px; aspect-ratio: 1; }
.mask img { width: 100%; height: 100%; display: block; }
.mask.circle img { clip-path: circle(50%); }
.mask.squircle img { clip-path: inset(0 round 32%); }
.mask.rounded img { clip-path: inset(0 round 14%); }
.mask.tear img { clip-path: inset(0 round 50% 50% 16% 50%); }
.mask .safe {
  position: absolute; inset: 10%;
  border: 1px dashed #ffffff;
  clip-path: none;
  border-radius: 50%;
  mix-blend-mode: difference;
  pointer-events: none;
}

/* files */
.files { list-style: none; margin: 0; padding: 0; border-top: 1px solid hsl(var(--border)); }
.files li {
  display: grid;
  grid-template-columns: 32px minmax(0, 1.3fr) minmax(0, 1fr) 70px auto;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid hsl(var(--border));
}
.thumb { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid hsl(var(--border)); background: hsl(var(--background)); }
.thumb img { width: 28px; height: 28px; display: block; }
.thumb .ext { font-size: 9px; color: hsl(var(--muted-foreground)); }
.fname { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fnote, .fsize { color: hsl(var(--muted-foreground)); font-size: 12px; }
.fsize { text-align: right; font-variant-numeric: tabular-nums; }

.head-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.snippet {
  margin: 0;
  padding: 12px 14px;
  background: hsl(var(--background));
  border: 1px solid hsl(var(--border));
  overflow-x: auto;
  font-size: 12.5px;
  line-height: 1.6;
}

.toast {
  position: fixed; left: 50%; bottom: 20px;
  transform: translate(-50%, 12px);
  background: hsl(var(--foreground)); color: hsl(var(--background));
  padding: 8px 14px; font-size: 12.5px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.18s, transform 0.18s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1100px) {
  .previews { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .page { grid-template-columns: 1fr; padding: 12px; }
  .top, .foot { padding: 12px; }
  .privacy { margin-left: 0; width: 100%; }
  .stage { order: -1; }
  .hero-card { flex-direction: column; align-items: stretch; }
  .hero-icon { width: 100%; height: auto; aspect-ratio: 1; max-width: 256px; margin: 0 auto; }
  .hero-icon img { width: 87.5%; height: auto; }
  .previews { grid-template-columns: 1fr; }
  .files li { grid-template-columns: 32px minmax(0, 1fr) auto; }
  .files .fnote, .files .fsize { display: none; }
  .foot .keys { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
