@font-face { font-family: 'Right Serif'; src: url(fonts/PPRightSerif-Medium.otf) format('opentype'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Radio Grotesk'; src: url(fonts/PPRadioGrotesk-Regular.otf) format('opentype'); font-weight: 400; font-display: swap; }

:root {
  --dark: #171B26; --light: #F4EFED; --stone: #EBE6E4; --peach: #F0B091;
  --line: rgba(23, 27, 38, .14); --muted: rgba(23, 27, 38, .6);
  --serif: 'Right Serif', Georgia, serif; --sans: 'Radio Grotesk', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--light); color: var(--dark); font: 15px/1.45 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }

/* header */
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 28px; border-bottom: 1px solid var(--line); }
.top .logo { display: block; width: 150px; color: var(--dark); }
.top .logo svg { display: block; width: 100%; height: auto; }
.top nav { display: flex; gap: 4px; }
.top nav a { text-decoration: none; padding: 8px 14px; border-radius: 999px; }
.top nav a.on { background: var(--dark); color: var(--light); }
.top nav a:not(.on):hover { background: var(--stone); }

h1, h2, h3 { font-family: var(--serif); font-weight: 500; letter-spacing: -.01em; margin: 0; }
h2 { font-size: 30px; line-height: 1.1; }
h3 { font-size: 13px; font-family: var(--sans); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 10px; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 36px 28px 80px; }
section + section { margin-top: 56px; }
.sec-head { margin-bottom: 20px; }

/* ready-made cards */
.ready { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.card { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: #fff; }
.card .art { aspect-ratio: 4 / 3; display: grid; place-items: center; padding: 32px; }
.card .art img { height: 100%; max-height: 300px; width: auto; display: block; }
.card .art.dark { background: #000; }
.card .meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.card .meta strong { font-family: var(--serif); font-weight: 500; font-size: 18px; }
.links { display: flex; gap: 6px; flex-wrap: wrap; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--dark); background: transparent; border-radius: 999px; padding: 8px 14px; cursor: pointer; text-decoration: none; font-size: 14px; line-height: 1; white-space: nowrap; }
.btn:hover { background: var(--stone); }
.btn.solid { background: var(--dark); color: var(--light); }
.btn.solid:hover { background: #2a3040; }
.btn.sm { padding: 6px 11px; font-size: 13px; }

/* editor layout */
.editor { display: grid; grid-template-columns: 1fr 360px; gap: 24px; align-items: start; }
.stage { background: var(--stone); border-radius: 16px; display: grid; place-items: center; padding: 40px; min-height: 520px; position: relative; }
.stage.checker { background-color: #fff; background-image: linear-gradient(45deg, #e9e5e3 25%, transparent 25%), linear-gradient(-45deg, #e9e5e3 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #e9e5e3 75%), linear-gradient(-45deg, transparent 75%, #e9e5e3 75%); background-size: 20px 20px; background-position: 0 0, 0 10px, 10px -10px, -10px 0; }
.stage canvas { max-width: 100%; height: auto; display: block; }

.panel { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 18px; display: flex; flex-direction: column; gap: 18px; }
.group { display: flex; flex-direction: column; gap: 10px; }
.group + .group { border-top: 1px solid var(--line); padding-top: 16px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.row > label, .lbl { font-size: 13px; color: var(--muted); }
input[type=text], input[type=url], input[type=number], select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; background: #fff; }
textarea { resize: vertical; min-height: 64px; }
input[type=range] { width: 100%; accent-color: var(--dark); }
input[type=checkbox] { accent-color: var(--dark); width: 16px; height: 16px; }

.color { display: flex; align-items: center; gap: 8px; }
.color input[type=color] { -webkit-appearance: none; appearance: none; width: 32px; height: 32px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: none; cursor: pointer; overflow: hidden; }
.color input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
.color input[type=color]::-webkit-color-swatch { border: none; border-radius: 50%; }
.color input[type=text] { width: 96px; font-family: ui-monospace, monospace; font-size: 13px; padding: 7px 9px; }

.seg { display: flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; gap: 2px; }
.seg button { flex: 1; border: 0; background: none; padding: 6px 8px; border-radius: 999px; cursor: pointer; font-size: 13px; }
.seg button.on { background: var(--dark); color: var(--light); }

.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch { width: 44px; height: 44px; border-radius: 10px; border: 1px solid var(--line); cursor: pointer; display: grid; place-items: center; padding: 0; }
.swatch span { width: 16px; height: 16px; border-radius: 3px; }

@media (max-width: 900px) {
  .editor { grid-template-columns: 1fr; }
  .ready { grid-template-columns: 1fr; }
  .top { padding: 14px 16px; }
  .top .logo { width: 120px; }
  .wrap { padding: 24px 16px 60px; }
  .stage { padding: 20px; min-height: 0; }
}
