*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: #f8f9fd;
    color: #1D2659;
}

img {
    max-width: 100%;
    display: block;
}

/* 헤더 */
.header { position: sticky; top: 0; z-index: 1000; background: #fff; border-bottom: 1px solid rgba(78, 99, 217, 0.2); box-shadow: 0 1px 3px rgba(29, 38, 89, 0.1); }
.header-inner { max-width: 1280px; margin: 0 auto; padding: 1rem 2rem; display: flex; align-items: center; justify-content: space-between; }
.logo { display: flex; align-items: center; gap: 0.5rem; font-weight: 700; }
.logo-mark { background: #4E63D9; color: #fff; padding: 0.4rem 0.8rem; border-radius: 8px; font-size: 1.1rem; font-weight: 800; border: 2px solid #4E63D9; box-shadow: 0 2px 8px rgba(78, 99, 217, 0.3); }
.logo-text { display: none; }
.nav { display: flex; gap: 1rem; flex: 1; justify-content: center; margin-left: 3rem; flex-wrap: wrap; align-items: center; }
.nav a { color: #2E3C8C; font-weight: 500; transition: color 0.2s; white-space: nowrap; font-size: 0.85rem; text-decoration: none; }
.nav a:hover { color: #4E63D9; }
.nav-toggle { display: none; }

/* 공통 레이아웃 */
.container {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 16px;
}

.section-title {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #1D2659;
}

.section-desc {
    color: #555;
    margin-bottom: 24px;
}

/* 버튼 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: transform 0.1s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.btn-primary {
    background: #4E63D9;
    color: #fff;
    box-shadow: 0 12px 25px rgba(78, 99, 217, 0.35);
}

.btn-primary:hover {
    transform: translateY(-1px);
    background: #2E3C8C;
    box-shadow: 0 16px 30px rgba(78, 99, 217, 0.45);
}

.btn-secondary {
    width: 100%;
    background: #111827;
    color: #f9fafb;
    border-radius: 12px;
    font-size: 15px;
}

.btn-secondary:disabled {
    opacity: 0.4;
    cursor: default;
    box-shadow: none;
}

.btn-download {
    width: 100%;
    background: #4E63D9;
    color: #fff;
    border-radius: 12px;
    font-size: 15px;
    padding: 12px 20px;
    transition: transform 0.1s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.btn-download:disabled {
    opacity: 0.4;
    cursor: default;
    box-shadow: none;
}

.btn-download:hover:not(:disabled) {
    transform: translateY(-1px);
    background: #2E3C8C;
    box-shadow: 0 16px 30px rgba(78, 99, 217, 0.45);
}

/* 헤더 */
.header {
    position: sticky;
    top: 0;
    z-index: 20;
    background-color: rgba(248, 250, 252, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(148, 163, 184, 0.25);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    max-width: 1180px;
    margin: 0 auto;
}

.logo-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    object-fit: cover;
    background: #111827;
}

.logo-mark {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: #4E63D9;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 800;
    border: 2px solid #4E63D9;
}

.logo-text {
    font-size: 18px;
    font-weight: 700;
    color: #1D2659;
}

.nav {
    display: flex;
    align-items: center;
    gap: 18px;
}

.nav a {
    font-size: 14px;
    color: #475569;
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 999px;
}

.nav a:hover {
    background-color: rgba(78, 99, 217, 0.1);
    color: #4E63D9;
}

/* 히어로 섹션 */
.hero {
    padding: 40px 0 60px;
}

.hero-inner {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 32px;
    align-items: center;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 16px;
}

.hero-text h1 {
    font-size: 36px;
    margin-bottom: 12px;
}

.hero-text p {
    color: #4b5563;
    margin-bottom: 20px;
    line-height: 1.6;
}

.hero-preview {
    display: flex;
    justify-content: center;
}

.hero-preview-card {
    width: 100%;
    max-width: 340px;
    border-radius: 24px;
    background: #1D2659;
    padding: 18px;
    color: #e5e7eb;
    box-shadow:
        0 18px 35px rgba(29, 38, 89, 0.65),
        0 0 0 1px rgba(78, 99, 217, 0.4);
}

.hero-preview-img {
    border-radius: 18px;
    background: #4E63D9;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.hero-watermark-text {
    font-size: 42px;
    font-weight: 800;
    letter-spacing: 0.4em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.2);
    transform: rotate(-18deg);
}

.hero-preview-caption {
    margin-top: 10px;
    font-size: 13px;
    color: #9ca3af;
}

/* tool 영역 */
.tool {
    padding: 32px 0 56px;
}

.tool-inner {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.section-inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 16px;
}

.tool-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.3fr);
    gap: 24px;
}

/* 패널 공통 */
.panel {
    background-color: #ffffff;
    border-radius: 18px;
    padding: 18px 18px 20px;
    border: 2px solid rgba(78, 99, 217, 0.2);
    box-shadow:
        0 10px 25px rgba(29, 38, 89, 0.1);
}

.panel-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
    color: #2E3C8C;
}

.panel-subtitle {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 10px;
}

.panel-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* 업로드 그룹 */
.upload-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 4px;
}

.upload-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background-color: #1D2659;
    color: #fff;
    border-radius: 999px;
    padding: 10px 14px;
    font-size: 13px;
    cursor: pointer;
    border: 1px solid rgba(78, 99, 217, 0.4);
    transition: background-color 0.15s ease, transform 0.08s ease, box-shadow 0.15s ease;
}

.upload-label:hover {
    background-color: #2E3C8C;
    box-shadow: 0 14px 24px rgba(29, 38, 89, 0.35);
    transform: translateY(-0.5px);
}

.upload-label input {
    display: none;
}

.divider {
    border-bottom: 1px dashed rgba(148, 163, 184, 0.7);
    margin: 10px 0;
}

/* 토글 그룹 */
.toggle-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.toggle-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #374151;
}

/* 옵션 그룹 */
.option-group {
    margin-top: 6px;
    padding: 8px 10px;
    border-radius: 12px;
    background-color: rgba(78, 99, 217, 0.05);
    border: 1px solid rgba(78, 99, 217, 0.3);
}

.option-title {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #2E3C8C;
}

.option-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
    font-size: 13px;
    color: #374151;
}

.option-row span:first-child {
    flex: 0 0 90px;
}

.option-row input[type="range"] {
    flex: 1;
}

.option-row input[type="text"] {
    flex: 1;
    padding: 6px 8px;
    border-radius: 999px;
    border: 1px solid #d1d5db;
    font-size: 13px;
}

.option-row input[type="color"] {
    width: 50px;
    height: 28px;
    border-radius: 999px;
    border: 1px solid #d1d5db;
    padding: 0;
    background-color: #f9fafb;
}

.option-row select {
    flex: 1;
    padding: 6px 8px;
    border-radius: 999px;
    border: 1px solid #d1d5db;
    font-size: 13px;
}

.value-display {
    flex: 0 0 auto;
    font-weight: 600;
    color: #4E63D9;
    min-width: 50px;
    text-align: right;
}

/* 캔버스 패널 */
.panel-preview {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.canvas-wrap {
    position: relative;
    border-radius: 18px;
    border: 2px solid rgba(78, 99, 217, 0.6);
    background-color: #1D2659;
    min-height: 260px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

#previewCanvas {
    max-width: 100%;
    max-height: 450px;
}

#previewCanvas.active {
    display: block;
}

.canvas-placeholder {
    text-align: center;
    color: #9ca3af;
    font-size: 13px;
}

/* howto 섹션 */
.howto {
    padding: 10px 0 40px;
}

.howto-list {
    margin: 10px 0 0;
    padding-left: 18px;
    color: #4b5563;
    font-size: 14px;
    line-height: 1.7;
}

/* footer */
.footer {
    padding: 18px 0 22px;
    border-top: 1px solid rgba(148, 163, 184, 0.3);
    background-color: #f9fafb;
}

.footer-inner {
    text-align: center;
    font-size: 13px;
    color: #6b7280;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 16px;
}

/* 반응형 */
@media (max-width: 960px) {
    .hero-inner {
        grid-template-columns: minmax(0, 1fr);
        padding-top: 10px;
    }

    .hero-preview {
        order: -1;
    }

    .tool-layout {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 640px) {
    .header-inner {
        flex-direction: row;
        gap: 8px;
    }

    .nav {
        display: none; /* 모바일에선 메뉴 생략(필요하면 햄버거로 확장 가능) */
    }

    .hero-text h1 {
        font-size: 26px;
    }

    .panel {
        padding: 14px 12px 16px;
    }

    .option-row span:first-child {
        flex: 0 0 80px;
        font-size: 12px;
    }

    .option-row input[type="text"],
    .option-row select {
        font-size: 12px;
    }

    .btn-secondary {
        font-size: 14px;
    }
}
