/* ============================================================
   CutMeOut design system
   ============================================================ */
:root {
    --bg:        #0a0a0f;
    --bg-soft:   #12121b;
    --surface:   #16161f;
    --surface-2: #1d1d29;
    --border:    #272733;
    --border-lt: #33334a;

    --text:      #f4f4f6;
    --text-mid:  #a8a8bd;
    --text-dim:  #6f6f88;

    --accent:    #7c5cff;
    --accent-2:  #b06bff;
    --accent-lo: rgba(124, 92, 255, 0.14);
    --success:   #34d399;
    --warn:      #fbbf24;
    --danger:    #f87171;

    --radius:    14px;
    --radius-lg: 22px;
    --shadow:    0 10px 40px rgba(0, 0, 0, 0.45);
    --glow:      0 0 0 1px rgba(124, 92, 255, 0.35), 0 8px 34px rgba(124, 92, 255, 0.22);

    --maxw:      1180px;
    --font:      'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* Ambient glow behind the page */
body::before {
    content: '';
    position: fixed;
    inset: -30% 0 auto 0;
    height: 70vh;
    background:
        radial-gradient(55% 60% at 22% 0%, rgba(124, 92, 255, 0.22), transparent 70%),
        radial-gradient(45% 55% at 82% 12%, rgba(176, 107, 255, 0.16), transparent 70%);
    pointer-events: none;
    z-index: 0;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

h1, h2, h3, h4 { line-height: 1.18; margin: 0 0 .5em; letter-spacing: -0.022em; font-weight: 680; }
h1 { font-size: clamp(2.2rem, 5.2vw, 3.9rem); }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.4rem); }
h3 { font-size: 1.16rem; }
p  { margin: 0 0 1em; color: var(--text-mid); }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 22px; position: relative; z-index: 1; }
.narrow { max-width: 560px; }
.mid { max-width: 860px; }

.muted { color: var(--text-dim); }
.small { font-size: .875rem; }
.center { text-align: center; }
.mono { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; }

.grad {
    background: linear-gradient(115deg, #fff 10%, var(--accent-2) 55%, var(--accent) 95%);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ---------- Header ---------- */
.site-head {
    position: sticky; top: 0; z-index: 60;
    backdrop-filter: blur(16px);
    background: rgba(10, 10, 15, 0.78);
    border-bottom: 1px solid var(--border);
}
.site-head .wrap { display: flex; align-items: center; gap: 28px; height: 66px; }

.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.12rem; letter-spacing: -.02em; }
.brand-mark {
    width: 28px; height: 28px; border-radius: 9px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    display: grid; place-items: center; flex: none;
    box-shadow: 0 4px 14px rgba(124, 92, 255, .4);
}
.brand-mark svg { width: 16px; height: 16px; }

.nav { display: flex; gap: 4px; align-items: center; margin-left: auto; }
.nav a {
    padding: 8px 13px; border-radius: 9px; font-size: .925rem;
    color: var(--text-mid); font-weight: 500; transition: .16s;
}
.nav a:hover { color: var(--text); background: var(--surface-2); }
.nav a.active { color: var(--text); }

.credit-pill {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 6px 13px; border-radius: 999px;
    background: var(--accent-lo); border: 1px solid rgba(124, 92, 255, .32);
    font-size: .845rem; font-weight: 600; color: #c9bbff;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 9px;
    padding: 11px 20px; border-radius: 11px; border: 1px solid transparent;
    font: inherit; font-weight: 600; font-size: .935rem;
    cursor: pointer; transition: .17s; white-space: nowrap;
    background: var(--surface-2); color: var(--text);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff; box-shadow: 0 6px 22px rgba(124, 92, 255, .35);
}
.btn-primary:hover { box-shadow: 0 10px 30px rgba(124, 92, 255, .48); }
.btn-ghost { background: transparent; border-color: var(--border-lt); color: var(--text-mid); }
.btn-ghost:hover { color: var(--text); border-color: var(--accent); background: var(--accent-lo); }
.btn-lg { padding: 15px 30px; font-size: 1.02rem; border-radius: 13px; }
.btn-sm { padding: 7px 13px; font-size: .84rem; border-radius: 9px; }
.btn-danger { background: rgba(248, 113, 113, .12); color: var(--danger); border-color: rgba(248, 113, 113, .3); }
.btn-block { width: 100%; }

/* ---------- Cards / surfaces ---------- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 26px;
}
.card-pad-lg { padding: 34px; }

.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}

.grid { display: grid; gap: 20px; }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }

.section { padding: 84px 0; position: relative; z-index: 1; }
.section-sm { padding: 52px 0; }

.eyebrow {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 6px 14px; border-radius: 999px;
    background: var(--accent-lo); border: 1px solid rgba(124, 92, 255, .3);
    font-size: .8rem; font-weight: 600; color: #c4b2ff;
    margin-bottom: 20px; letter-spacing: .01em;
}

/* ---------- Forms ---------- */
label { display: block; font-size: .875rem; font-weight: 600; margin-bottom: 7px; color: var(--text); }

input[type=text], input[type=email], input[type=password], input[type=number], select, textarea {
    width: 100%; padding: 12px 14px;
    background: var(--bg-soft); color: var(--text);
    border: 1px solid var(--border-lt); border-radius: 11px;
    font: inherit; font-size: .95rem; transition: .16s;
}
input:focus, select:focus, textarea:focus {
    outline: none; border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-lo);
}
.field { margin-bottom: 17px; }
.field-hint { font-size: .8rem; color: var(--text-dim); margin-top: 6px; }

/* ---------- Flash ---------- */
.flash { display: flex; align-items: flex-start; gap: 11px; padding: 13px 16px; border-radius: 11px; margin-bottom: 14px; font-size: .92rem; }
.flash-success { background: rgba(52, 211, 153, .1); border: 1px solid rgba(52, 211, 153, .3); color: #6ee7b7; }
.flash-error   { background: rgba(248, 113, 113, .1); border: 1px solid rgba(248, 113, 113, .3); color: #fca5a5; }

/* ---------- Dropzone ---------- */
.dropzone {
    position: relative;
    border: 2px dashed var(--border-lt);
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, rgba(124,92,255,.05), transparent);
    padding: 56px 28px; text-align: center;
    cursor: pointer; transition: .2s;
}
.dropzone:hover, .dropzone.drag {
    border-color: var(--accent);
    background: linear-gradient(180deg, rgba(124,92,255,.14), rgba(124,92,255,.03));
    box-shadow: var(--glow);
}
.dropzone.drag { transform: scale(1.008); }
.dz-icon {
    width: 62px; height: 62px; margin: 0 auto 18px; border-radius: 18px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    display: grid; place-items: center;
    box-shadow: 0 10px 30px rgba(124, 92, 255, .4);
}
.dz-icon svg { width: 28px; height: 28px; }
.dz-title { font-size: 1.22rem; font-weight: 650; margin-bottom: 7px; }
.dz-sub { color: var(--text-dim); font-size: .9rem; }
.dz-formats { margin-top: 18px; font-size: .78rem; color: var(--text-dim); letter-spacing: .04em; text-transform: uppercase; }

/* ---------- Checkerboard (transparency) ---------- */
.checker {
    background-color: #2a2a36;
    background-image:
        linear-gradient(45deg, #34344a 25%, transparent 25%, transparent 75%, #34344a 75%),
        linear-gradient(45deg, #34344a 25%, transparent 25%, transparent 75%, #34344a 75%);
    background-size: 22px 22px;
    background-position: 0 0, 11px 11px;
}

/* ---------- Before/after slider ---------- */
.ba {
    position: relative; border-radius: var(--radius-lg); overflow: hidden;
    user-select: none; touch-action: none; line-height: 0;
    border: 1px solid var(--border);
}
.ba img { width: 100%; display: block; }
.ba-after { position: absolute; inset: 0; overflow: hidden; width: 50%; }
.ba-after img { width: auto; height: 100%; max-width: none; }
.ba-handle {
    position: absolute; top: 0; bottom: 0; left: 50%;
    width: 2px; background: #fff; transform: translateX(-1px);
    box-shadow: 0 0 14px rgba(0, 0, 0, .6); cursor: ew-resize;
}
.ba-knob {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 42px; height: 42px; border-radius: 50%;
    background: #fff; color: #111; display: grid; place-items: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .45); font-size: 14px; font-weight: 700;
}
.ba-tag {
    position: absolute; bottom: 12px; padding: 5px 11px; border-radius: 8px;
    background: rgba(0, 0, 0, .66); backdrop-filter: blur(8px);
    font-size: .74rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase;
    line-height: 1.4; color: #fff;
}
.ba-tag.l { left: 12px; }
.ba-tag.r { right: 12px; }

/* ---------- Editor ---------- */
.editor-stage {
    border-radius: var(--radius-lg); overflow: hidden;
    border: 1px solid var(--border); position: relative;
    min-height: 320px; display: grid; place-items: center;
}
.editor-stage img { max-height: 62vh; width: auto; margin: 0 auto; }

.swatches { display: flex; gap: 9px; flex-wrap: wrap; }
.swatch {
    width: 34px; height: 34px; border-radius: 10px; cursor: pointer;
    border: 2px solid var(--border-lt); transition: .15s; padding: 0;
}
.swatch:hover { transform: scale(1.1); }
.swatch.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-lo); }

.spinner {
    width: 38px; height: 38px; border-radius: 50%;
    border: 3px solid var(--border-lt); border-top-color: var(--accent);
    animation: spin .8s linear infinite; margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.progress { height: 5px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .4s; }

/* ---------- Table ---------- */
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th {
    text-align: left; padding: 11px 13px; color: var(--text-dim);
    font-weight: 600; font-size: .76rem; text-transform: uppercase; letter-spacing: .06em;
    border-bottom: 1px solid var(--border);
}
.table td { padding: 13px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; }

.badge {
    display: inline-block; padding: 3px 10px; border-radius: 999px;
    font-size: .74rem; font-weight: 650; letter-spacing: .02em;
}
.badge-ok   { background: rgba(52, 211, 153, .14); color: #6ee7b7; }
.badge-wait { background: rgba(251, 191, 36, .14); color: #fcd34d; }
.badge-bad  { background: rgba(248, 113, 113, .14); color: #fca5a5; }
.badge-dim  { background: var(--surface-2); color: var(--text-dim); }

/* ---------- Pricing ---------- */
.price-card { position: relative; display: flex; flex-direction: column; }
.price-card.featured { border-color: rgba(124, 92, 255, .5); box-shadow: var(--glow); }
.price-tag { font-size: 2.5rem; font-weight: 700; letter-spacing: -.03em; line-height: 1.1; }
.price-per { color: var(--text-dim); font-size: .88rem; }
.price-feats { list-style: none; padding: 0; margin: 22px 0; flex: 1; }
.price-feats li { padding: 7px 0 7px 27px; position: relative; font-size: .92rem; color: var(--text-mid); }
.price-feats li::before {
    content: ''; position: absolute; left: 0; top: 14px;
    width: 15px; height: 8px; border-left: 2px solid var(--success); border-bottom: 2px solid var(--success);
    transform: rotate(-45deg);
}
.ribbon {
    position: absolute; top: -11px; left: 50%; transform: translateX(-50%);
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    padding: 4px 15px; border-radius: 999px; font-size: .74rem; font-weight: 700;
    letter-spacing: .04em; text-transform: uppercase; white-space: nowrap;
}

/* ---------- Code ---------- */
pre.code {
    background: #0c0c14; border: 1px solid var(--border);
    border-radius: var(--radius); padding: 18px 20px;
    overflow-x: auto; font-size: .855rem; line-height: 1.7;
    font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
    color: #d6d6e7; margin: 0 0 16px;
}
pre.code .k { color: #c4b2ff; }
pre.code .s { color: #86efac; }
pre.code .c { color: #5f5f7a; }
code.inline {
    background: var(--surface-2); padding: 2px 7px; border-radius: 6px;
    font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .875em; color: #c4b2ff;
}

.copy-wrap { position: relative; }
.copy-btn { position: absolute; top: 10px; right: 10px; }

/* ---------- Footer ---------- */
.site-foot { border-top: 1px solid var(--border); padding: 46px 0 34px; margin-top: 70px; }
.foot-grid { display: grid; grid-template-columns: 2fr repeat(3, 1fr); gap: 34px; }
.foot-grid h4 { font-size: .78rem; text-transform: uppercase; letter-spacing: .07em; color: var(--text-dim); margin-bottom: 13px; }
.foot-grid a { display: block; padding: 5px 0; color: var(--text-mid); font-size: .9rem; }
.foot-grid a:hover { color: var(--accent-2); }
.foot-bottom { margin-top: 34px; padding-top: 22px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: .85rem; color: var(--text-dim); }

/* ---------- Utility ---------- */
.flex { display: flex; }
.between { justify-content: space-between; }
.items-center { align-items: center; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.mt-0 { margin-top: 0; } .mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; } .mt-32 { margin-top: 32px; } .mt-48 { margin-top: 48px; }
.mb-0 { margin-bottom: 0; } .mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; } .mb-32 { margin-bottom: 32px; }
.hide { display: none !important; }
.stat-num { font-size: 2rem; font-weight: 700; letter-spacing: -.02em; }
.stat-lbl { font-size: .8rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: .05em; }

.fade-in { animation: fade .45s ease both; }
@keyframes fade { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- Editor + dashboard layouts ---------- */
.editor-grid {
    display: grid; gap: 22px; align-items: start;
    grid-template-columns: minmax(0, 1fr) 290px;
}
.dash-grid {
    display: grid; gap: 22px; align-items: start;
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
}
@media (max-width: 860px) {
    /* Stack, and float the controls above the image so the download button
       is reachable without scrolling past a tall render. */
    .editor-grid, .dash-grid { grid-template-columns: minmax(0, 1fr); }
    .editor-grid > div:last-child { order: -1; }
    .editor-stage img { max-height: 48vh; }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .g4 { grid-template-columns: repeat(2, 1fr); }
    .g3 { grid-template-columns: 1fr; }
    .foot-grid { grid-template-columns: 1fr 1fr; }
    .section { padding: 60px 0; }
}
@media (max-width: 680px) {
    .g2, .g4 { grid-template-columns: 1fr; }
    .nav .hide-sm { display: none; }
    .site-head .wrap { gap: 12px; }
    .card, .card-pad-lg { padding: 20px; }
    .dropzone { padding: 38px 18px; }
    .foot-grid { grid-template-columns: 1fr; gap: 24px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
    html { scroll-behavior: auto; }
}
