:root {
    /* Toolkit palette */
    --bg-base: #161618;
    --bg-base-end: #1f1f23;
    --bg-panel: #26262b;
    --bg-panel-hover: #2f2f36;
    --bg-input: #1c1c1f;
    --border: #808080;
    --divider: #34343a;
    /* Rim fades into a dark neutral: the tool accents are darker than #808080, so fading into it would make the lit corner the dimmest edge */
    --card-rim-dark: #3d3d44;
    --card-rim-neutral: #5a5a62;
    --text-main: #f0f0f2;
    --text-muted: #a0a0a8;

    /* Kittashi functional colors (shared with DTF Prep) */
    --c-purple: #8e44ad;
    --c-purple-hover: #9b59b6;
    --c-green: #27ae60;
    --c-green-hover: #2ecc71;
    --c-orange: #d35400;
    --c-orange-hover: #e67e22;
    --c-blue: #0F5934;
    --c-blue-hover: #188D53;
    --c-gray: #444;
    --c-gray-hover: #555;

    --radius-btn: 4px;
    --radius-panel: 8px;
    --radius-pill: 20px;
    --shadow-panel: 0 4px 10px rgba(0, 0, 0, 0.3);
    --shadow-modal: 0 8px 24px rgba(0, 0, 0, 0.5);
    --header-h: 50px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-main);
    background-color: var(--bg-base);
    background-image: linear-gradient(180deg, var(--bg-base) 0%, var(--bg-base-end) 100%);
    background-attachment: fixed;
}

h1, h2, h3, p {
    margin: 0;
}

a {
    color: inherit;
}

/* --- HEADER (mirrors DTF Prep's full-bleed halftone .app-header) --- */
.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--header-h);
    display: flex;
    align-items: center;
    overflow: hidden;
    background-color: #121212;
    background-image: url('assets/halftone-strip.png');
    background-size: cover;
    background-position: right center;
    background-repeat: no-repeat;
    border-bottom: 1px solid var(--divider);
}

.brand-block {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 100%;
    padding-left: 24px;
    text-decoration: none;
    flex-shrink: 0;
}

.brand-logo {
    display: block;
    height: 100%;
    max-height: var(--header-h);
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 0 4px rgba(15, 89, 52, 0.35));
}

.tagline {
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 1px;
    color: var(--text-muted);
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
    white-space: nowrap;
}

.header-auth-slot {
    margin-left: auto;
    padding-right: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
    height: 100%;
}

/* Exact match of DTF Prep's #authSignInBtn (global button reset + .auth-signin-btn) */
.auth-signin-btn {
    width: auto;
    padding: 7px 20px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    line-height: normal;
    color: white;
    background-color: var(--c-green);
    border: none;
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: all 0.15s ease;
}

.auth-signin-btn:hover {
    background-color: var(--c-green-hover);
}

/* Clerk's mounted <UserButton> sizes its avatar to its container -- same
   small fixed square the apps' header pill uses. */
.clerk-user-button-mount {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

/* --- HERO --- */
.hero {
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid var(--divider);
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url('assets/halftone-strip.png');
    background-size: auto 100%;
    background-position: right center;
    background-repeat: no-repeat;
    opacity: 0.07;
    -webkit-mask-image: linear-gradient(90deg, transparent 20%, #000 75%);
    mask-image: linear-gradient(90deg, transparent 20%, #000 75%);
    pointer-events: none;
}

.hero::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 2px;
    background: linear-gradient(90deg, var(--c-blue-hover), var(--c-purple) 40%, transparent 80%);
    opacity: 0.6;
}

.hero-content {
    position: relative;
    max-width: 1280px;
    margin: 0 auto;
    padding: 48px 24px 44px;
}

.hero h1 {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.3px;
    line-height: 1.2;
    margin-bottom: 8px;
}

.hero p {
    max-width: 560px;
    font-size: 15px;
    color: var(--text-muted);
}

/* --- SECTIONS --- */
.section {
    max-width: 1280px;
    margin: 0 auto;
    padding: 32px 24px 8px;
}

.section:last-of-type {
    padding-bottom: 48px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-muted);
}

.section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--divider);
}

.suite-grid,
.utility-grid,
.resource-grid {
    display: grid;
    gap: 16px;
}

.suite-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(360px, 100%), 1fr));
}

.utility-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
}

.resource-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
}

/* --- CARDS (DTF Prep panel language) --- */
.card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 190px;
    padding: 20px;
    --card-fill: var(--bg-panel);
    --card-accent: var(--card-rim-neutral);
    border: 1.5px solid transparent;
    background:
        linear-gradient(var(--card-fill), var(--card-fill)) padding-box,
        linear-gradient(135deg, var(--card-accent) 0%, var(--card-accent) 15%, var(--card-rim-dark) 75%) border-box;
    border-radius: var(--radius-panel);
    box-shadow: var(--shadow-panel);
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    --card-fill: var(--bg-panel-hover);
    transform: translateY(-1px);
}

/* 135deg rim light: each tool's signature color at top-left, fading to neutral gray */
.card-dtf { --card-accent: var(--c-blue-hover); }
.card-vectorizer { --card-accent: #73634E; }
.card-gangsheet { --card-accent: #355F73; }
.card-upscaler { --card-accent: #591D59; }
.card-photopea { --card-accent: #24716A; }

.card h3 {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 8px;
    padding-right: 112px;
}

.card p {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.card .btn {
    margin-top: auto;
}

.suite-card {
    min-height: 220px;
    padding: 24px;
}

.suite-card h3 {
    font-size: 20px;
}

.suite-card p {
    font-size: 14px;
    max-width: 440px;
}

/* Glow borrowed from DTF Prep's AI Upscale entry module */
.card-featured {
    box-shadow: 0 0 10px rgba(24, 141, 83, 0.35);
}

.card-featured:hover {
    box-shadow: 0 0 16px rgba(24, 141, 83, 0.6);
}

.card.is-inactive:hover {
    --card-fill: var(--bg-panel);
    transform: none;
}

.card.is-inactive h3 {
    color: var(--text-muted);
}

/* --- BADGES (pill form of DTF Prep's .brand-beta-badge) --- */
.badge {
    position: absolute;
    top: 16px;
    right: 16px;
    padding: 2px 10px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    line-height: 1.6;
    white-space: nowrap;
    border: 1px solid;
    border-radius: 12px;
}

.badge-free {
    color: var(--c-green-hover);
    background: rgba(39, 174, 96, 0.12);
    border-color: rgba(46, 204, 113, 0.45);
}

.badge-pro {
    color: #c39bd3;
    background: rgba(142, 68, 173, 0.16);
    border-color: rgba(155, 89, 182, 0.55);
}

.badge-soon {
    color: #f0a35e;
    background: rgba(211, 84, 0, 0.14);
    border-color: rgba(230, 126, 34, 0.45);
}

.badge-library {
    color: var(--text-muted);
    background: transparent;
    border-color: var(--c-gray-hover);
}

/* --- BUTTONS (DTF Prep global button + functional colors) --- */
.btn {
    display: block;
    width: 100%;
    padding: 8px 15px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    line-height: normal;
    text-align: center;
    text-decoration: none;
    color: white;
    border: none;
    border-radius: var(--radius-btn);
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-primary {
    background-color: var(--c-blue);
}

.btn-primary:hover {
    background-color: var(--c-blue-hover);
}

.btn-vectorizer { background-color: #73634E; }
.btn-vectorizer:hover { background-color: #8A7760; }

.btn-gangsheet { background-color: #355F73; }
.btn-gangsheet:hover { background-color: #43778F; }

.btn-upscaler { background-color: #591D59; }
.btn-upscaler:hover { background-color: #702670; }

.btn-photopea { background-color: #24716A; }
.btn-photopea:hover { background-color: #2D8A81; }

.btn-actions { background-color: #666666; }
.btn-actions:hover { background-color: #777777; }

.btn-secondary,
.btn-gray {
    background-color: var(--c-gray);
}

.btn-secondary:hover,
.btn-gray:hover {
    background-color: var(--c-gray-hover);
}

.btn-disabled {
    color: var(--text-muted);
    background-color: transparent;
    border: 1px dashed var(--c-gray-hover);
    cursor: not-allowed;
}

.btn:focus-visible,
.auth-signin-btn:focus-visible,
.brand-block:focus-visible {
    outline: 2px solid var(--c-green-hover);
    outline-offset: 2px;
}

/* --- FOOTER (DTF Prep .app-footer; email in the dashboard's green accent) --- */
.app-footer {
    max-width: 1280px;
    margin: 0 auto;
    padding: 16px 24px 24px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-top: 1px solid var(--divider);
    font-size: 12px;
    color: var(--text-muted);
}

.app-footer a {
    color: var(--c-green-hover);
    text-decoration: none;
}

.app-footer a:hover {
    text-decoration: underline;
}

.app-footer a:focus-visible {
    outline: 2px solid var(--c-green-hover);
    outline-offset: 2px;
}

/* --- MODAL (DTF Prep .modal-box shell) --- */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0.6);
}

.modal[hidden] {
    display: none;
}

.modal-box {
    position: relative;
    width: 100%;
    max-width: 420px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 24px;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-panel);
    box-shadow: var(--shadow-modal);
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 26px;
    height: 26px;
    padding: 0;
    font-family: inherit;
    font-size: 16px;
    line-height: 1;
    color: white;
    background-color: var(--c-gray);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.15s ease;
}

.modal-close:hover {
    background-color: var(--c-gray-hover);
}

.modal-box h3 {
    margin: 0 28px 6px 0;
    font-size: 18px;
    font-weight: 600;
}

.modal-box > p {
    margin-bottom: 18px;
    font-size: 13px;
    color: var(--text-muted);
}

.modal-form label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    color: var(--text-muted);
}

.modal-form input {
    width: 100%;
    margin-bottom: 16px;
    padding: 8px 10px;
    font-family: inherit;
    font-size: 14px;
    color: var(--text-main);
    background: var(--bg-input);
    border: 1px solid var(--c-gray-hover);
    border-radius: var(--radius-btn);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.modal-form input:focus {
    outline: none;
    border-color: var(--c-blue-hover);
    box-shadow: 0 0 0 3px rgba(15, 89, 52, 0.35);
}

.modal-form input::placeholder {
    color: #6c6c74;
}

.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.modal-box .modal-status {
    margin: 12px 0 0;
    font-size: 13px;
    color: var(--c-green-hover);
}

.modal-box .modal-status:empty {
    display: none;
}

.modal-box .modal-disclaimer {
    margin: 16px 0 0;
    font-size: 11px;
    color: #74747c;
    text-align: center;
}

/* --- BETA FEEDBACK MODAL (the apps' #feedbackModal form, in this page's
   .modal shell; field styling scoped so it can't leak elsewhere) --- */
#feedbackModal .modal-box {
    max-width: 460px;
}

#feedbackModal .modal-title {
    margin: 0 28px 18px 0;
    font-size: 16px;
    font-weight: 700;
}

.feedback-field {
    margin-bottom: 16px;
}

.feedback-field label {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

#feedbackModal select,
#feedbackModal textarea,
#feedbackModal input[type="email"] {
    width: 100%;
    padding: 8px 10px;
    font-family: inherit;
    font-size: 13px;
    color: var(--text-main);
    background: var(--bg-input);
    border: 1px solid var(--c-gray-hover);
    border-radius: var(--radius-btn);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

#feedbackModal textarea {
    min-height: 90px;
    line-height: 1.4;
    resize: vertical;
}

#feedbackModal select:focus,
#feedbackModal textarea:focus,
#feedbackModal input[type="email"]:focus {
    outline: none;
    border-color: var(--c-blue-hover);
    box-shadow: 0 0 0 3px rgba(15, 89, 52, 0.35);
}

.feedback-actions {
    display: flex;
    gap: 10px;
    margin-top: 4px;
}

.btn-feedback-submit { background-color: var(--c-green); }
.btn-feedback-submit:hover { background-color: var(--c-green-hover); }
.btn-feedback-submit:disabled {
    opacity: 0.7;
    cursor: default;
}

/* --- HEADER PRICING LINK --- */
.header-pricing-link {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    text-decoration: none;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
    padding: 6px 4px;
}

.header-pricing-link:hover {
    color: #c39bd3;
}

.header-pricing-link:focus-visible {
    outline: 2px solid var(--c-green-hover);
    outline-offset: 2px;
}

/* --- CHECKOUT RETURN BANNER (after Stripe redirects back) --- */
.checkout-banner {
    max-width: 1280px;
    margin: 16px auto 0;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
    color: #f0a35e;
    background: rgba(211, 84, 0, 0.12);
    border: 1px solid rgba(230, 126, 34, 0.45);
    border-radius: var(--radius-panel);
}

.checkout-banner.is-success {
    color: var(--c-green-hover);
    background: rgba(39, 174, 96, 0.12);
    border-color: rgba(46, 204, 113, 0.45);
}

.checkout-banner[hidden] {
    display: none;
}

/* --- PRICING --- */
.pricing-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr));
}

.price-card {
    padding: 24px;
}

.price-card:hover {
    transform: none;
}

.price-card-pro {
    --card-accent: var(--c-purple-hover);
    box-shadow: 0 0 10px rgba(142, 68, 173, 0.35);
}

.price-card-pro:hover {
    box-shadow: 0 0 16px rgba(142, 68, 173, 0.55);
}

.price-card-desktop {
    --card-accent: #5f6b7a;
}

.price-card h3 {
    font-size: 20px;
    margin-bottom: 2px;
}

.card .price-subtitle {
    margin-bottom: 16px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--text-muted);
}

.price-amount {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 12px;
}

.price-value {
    font-size: 36px;
    font-weight: 700;
    letter-spacing: -0.5px;
    line-height: 1;
    color: var(--text-main);
}

.price-period {
    font-size: 14px;
    color: var(--text-muted);
}

.card .price-desc {
    margin-bottom: 16px;
    font-size: 14px;
    color: var(--text-main);
}

.price-features {
    margin: 0 0 20px;
    padding: 0;
    list-style: none;
}

.price-features li {
    position: relative;
    padding: 4px 0 4px 24px;
    font-size: 13px;
    color: var(--text-muted);
}

.price-features li::before {
    content: '\2713';
    position: absolute;
    left: 2px;
    top: 4px;
    font-weight: 700;
    color: #c39bd3;
}

/* Desktop Edition system requirements -- deliberately loud amber so
   nobody buys the Windows-only app without seeing it. */
.sys-req {
    margin-bottom: 20px;
    padding: 12px 14px;
    background: rgba(211, 84, 0, 0.14);
    border: 1px solid rgba(230, 126, 34, 0.6);
    border-left: 4px solid var(--c-orange-hover);
    border-radius: var(--radius-btn);
}

.sys-req-title {
    display: block;
    margin-bottom: 4px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #f0a35e;
}

.card .sys-req p {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
}

.btn-price-pro { background-color: var(--c-purple); }
.btn-price-pro:hover { background-color: var(--c-purple-hover); }

.btn-price-desktop { background-color: #4a5563; }
.btn-price-desktop:hover { background-color: #5b6878; }

.btn-price-pro:disabled,
.btn-price-desktop:disabled {
    opacity: 0.7;
    cursor: default;
}

.card .price-fineprint {
    margin: 8px 0 0;
    font-size: 11px;
    color: #74747c;
    text-align: center;
}

.card .price-status {
    margin: 8px 0 0;
    font-size: 13px;
    color: var(--c-green-hover);
    text-align: center;
}

.card .price-status.is-error {
    color: #f0a35e;
}

.card .price-status:empty {
    display: none;
}

/* --- RESPONSIVE --- */
/* Below ~1100px the strip compresses horizontally and its dense diamonds reach the brand block */
@media (max-width: 1100px) {
    .app-header {
        background-image:
            linear-gradient(90deg, rgba(18, 18, 18, 0.92) 0%, rgba(18, 18, 18, 0.92) 30%, rgba(18, 18, 18, 0) 65%),
            url('assets/halftone-strip.png');
    }
}

@media (max-width: 560px) {
    .brand-block {
        padding-left: 16px;
    }

    .brand-logo {
        max-height: 40px;
    }

    .tagline {
        display: none;
    }

    .header-auth-slot {
        padding-right: 16px;
    }

    .auth-signin-btn {
        padding: 7px 14px;
    }

    .hero-content {
        padding: 32px 16px 28px;
    }

    .hero h1 {
        font-size: 22px;
    }

    .hero p {
        font-size: 14px;
    }

    .section {
        padding: 24px 16px 4px;
    }

    .card,
    .suite-card {
        min-height: 0;
        padding: 16px;
    }

    .badge {
        top: 12px;
        right: 12px;
    }

    .suite-card h3 {
        font-size: 18px;
    }

    .price-card {
        padding: 16px;
    }

    .price-value {
        font-size: 30px;
    }

    .checkout-banner {
        margin: 12px 16px 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        transition: none !important;
    }
}
