* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Noto Sans KR', -apple-system, sans-serif;
    font-size: 16px;
    color: #333;
    background: #fff;
    line-height: 1.6;
}

a { color: inherit; text-decoration: none; }

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.site-header {
    border-bottom: 1px solid #e5e5e5;
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.site-logo {
    font-size: 18px;
    font-weight: 700;
    color: #333;
}

.main-nav {
    display: flex;
    gap: 28px;
}

.main-nav a {
    font-size: 15px;
    color: #555;
}

.main-nav a:hover { color: #007cba; }

.studio-link {
    font-size: 14px;
    color: #888;
    padding: 6px 14px;
    border: 1px solid #ddd;
    border-radius: 20px;
}

.studio-link:hover {
    border-color: #007cba;
    color: #007cba;
}

/* Hero */
.hero-slider {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
}

.slide {
    height: 400px;
    display: flex;
    align-items: center;
}

.slide-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    color: #fff;
}

.slide-inner h2 {
    font-size: 36px;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 12px;
}

.slide-inner p {
    font-size: 18px;
    opacity: 0.9;
}

/* Tools */
.tools-section {
    padding: 50px 0;
}

.section-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 24px;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.tool-card {
    border: 1px solid #e5e5e5;
    background: #fff;
    cursor: pointer;
    transition: box-shadow 0.2s;
}

.tool-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

/* Card Thumbnails */
.card-thumb {
    height: 180px;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.gradient-thumb {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.shadow-thumb {
    background: #f5f5f5;
}

.shadow-thumb .shadow-box {
    width: 100px;
    height: 100px;
    background: #fff;
    box-shadow: 8px 8px 20px rgba(0,0,0,0.15);
}

.palette-thumb {
    display: flex;
    padding: 0;
    background: none;
}

.palette-thumb > div {
    flex: 1;
    height: 180px;
}

.palette-thumb > div:nth-child(1) { background: #6366f1; }
.palette-thumb > div:nth-child(2) { background: #8b5cf6; }
.palette-thumb > div:nth-child(3) { background: #a855f7; }
.palette-thumb > div:nth-child(4) { background: #d946ef; }
.palette-thumb > div:nth-child(5) { background: #ec4899; }

.flex-thumb {
    background: #e8e8e8;
    display: flex;
    gap: 8px;
    padding: 30px;
}

.flex-thumb > div {
    width: 50px;
    height: 120px;
    background: #007cba;
}

.radius-thumb {
    background: #f5f5f5;
}

.radius-thumb > div {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, #007cba, #00a8e8);
    border-radius: 30px 10px 30px 10px;
}

.picker-thumb {
    background: conic-gradient(red, yellow, lime, aqua, blue, magenta, red);
}

.text-thumb {
    background: #f5f5f5;
}

.text-thumb span {
    font-size: 60px;
    font-weight: 700;
    color: #333;
    text-shadow: 3px 3px 6px rgba(0,0,0,0.2);
}

.transform-thumb {
    background: #f5f5f5;
}

.transform-thumb > div {
    width: 80px;
    height: 80px;
    background: #007cba;
    transform: rotate(15deg);
}

.contrast-thumb {
    display: flex;
    background: none;
}

.contrast-thumb .dark {
    flex: 1;
    height: 180px;
    background: #222;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 700;
}

.contrast-thumb .light {
    flex: 1;
    height: 180px;
    background: #fff;
    color: #222;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 700;
}

.unit-thumb {
    background: #e8e8e8;
}

.unit-thumb span {
    font-size: 28px;
    font-weight: 700;
    color: #007cba;
}

.code-thumb {
    background: #2d2d2d;
}

.code-thumb code {
    font-size: 24px;
    color: #98c379;
    font-family: monospace;
}

.mixer-thumb {
    background: linear-gradient(135deg, #ff6b6b, #4ecdc4);
}

.card-body {
    padding: 16px;
}

.tag {
    display: inline-block;
    font-size: 12px;
    color: #007cba;
    background: #e8f4fc;
    padding: 3px 8px;
    border-radius: 3px;
    margin-bottom: 8px;
}

.card-body h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 6px;
}

.card-body p {
    font-size: 14px;
    color: #666;
    margin-bottom: 12px;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #999;
}

/* Guide */
.guide-section {
    padding: 50px 0;
    background: #f9f9f9;
}

.guide-list {
    display: flex;
    gap: 16px;
}

.guide-item {
    flex: 1;
    padding: 20px;
    background: #fff;
    border: 1px solid #e5e5e5;
    font-size: 15px;
    color: #333;
}

.guide-item:hover {
    border-color: #007cba;
}

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 200;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: #fff;
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e5e5;
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: #f0f0f0;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: #e5e5e5;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

/* Tool UI */
.tool-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.tool-controls {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.control-group label {
    font-size: 14px;
    color: #333;
}

.control-group input[type="range"] {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    background: #ddd;
    border-radius: 3px;
}

.control-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: #007cba;
    border-radius: 50%;
    cursor: pointer;
}

.control-group input[type="color"] {
    width: 48px;
    height: 32px;
    border: 1px solid #ddd;
    padding: 2px;
    cursor: pointer;
}

.control-group input[type="text"],
.control-group input[type="number"],
.control-group select,
.control-group textarea {
    padding: 8px 12px;
    border: 1px solid #ddd;
    font-size: 14px;
    font-family: inherit;
}

.control-group input:focus,
.control-group select:focus,
.control-group textarea:focus {
    outline: none;
    border-color: #007cba;
}

.tool-preview {
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 280px;
    padding: 24px;
}

.preview-box {
    width: 180px;
    height: 180px;
    background: #fff;
}

.code-output {
    background: #2d2d2d;
    color: #ddd;
    padding: 14px;
    font-family: monospace;
    font-size: 13px;
    white-space: pre-wrap;
    word-break: break-all;
}

.copy-btn {
    display: inline-block;
    padding: 10px 20px;
    background: #333;
    color: #fff;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
}

.copy-btn:hover {
    background: #222;
}

.color-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
}

.btn-primary {
    background: #333;
    color: #fff;
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
}

/* Palette */
.palette-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.palette-display {
    display: flex;
    height: 100px;
}

.palette-color {
    flex: 1;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 10px;
    cursor: pointer;
}

.palette-color:hover {
    flex: 1.2;
}

.palette-color span {
    background: rgba(0,0,0,0.3);
    color: #fff;
    padding: 3px 6px;
    font-size: 11px;
    font-family: monospace;
}

.palette-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Flexbox */
.flexbox-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.flexbox-preview {
    background: #f5f5f5;
    padding: 20px;
    min-height: 260px;
}

.flex-parent {
    display: flex;
    background: #fff;
    border: 2px dashed #ddd;
    padding: 14px;
    min-height: 200px;
    gap: 10px;
}

.flex-child {
    background: #007cba;
    color: #fff;
    padding: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 50px;
}

.flexbox-controls {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
}

/* Color Picker */
.color-picker-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.color-picker-preview {
    height: 100px;
    border: 1px solid #ddd;
}

.color-values {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.color-value-box {
    background: #f5f5f5;
    padding: 14px;
    text-align: center;
}

.color-value-box label {
    display: block;
    font-size: 12px;
    color: #888;
    margin-bottom: 6px;
}

.color-value-box input {
    width: 100%;
    text-align: center;
    font-family: monospace;
    border: 1px solid #ddd;
    padding: 6px;
    font-size: 12px;
}

/* Contrast */
.contrast-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.contrast-preview {
    padding: 30px;
    text-align: center;
    border: 1px solid #ddd;
}

.contrast-preview h3 {
    font-size: 24px;
    margin-bottom: 6px;
}

.contrast-results {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.contrast-result {
    background: #f5f5f5;
    padding: 16px;
    text-align: center;
}

.contrast-ratio {
    font-size: 28px;
    font-weight: 700;
    color: #007cba;
}

.contrast-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    margin-top: 6px;
}

.badge-pass { background: #d4edda; color: #155724; }
.badge-fail { background: #f8d7da; color: #721c24; }

/* Converter */
.converter-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.converter-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 14px;
    align-items: end;
}

.converter-arrow {
    font-size: 20px;
    color: #999;
    padding-bottom: 8px;
}

.base-size-setting {
    background: #f5f5f5;
    padding: 14px;
}

/* Footer */
.site-footer {
    background: #f5f5f5;
    border-top: 1px solid #e5e5e5;
    padding: 40px 0 24px;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    margin-bottom: 24px;
}

.footer-brand strong {
    font-size: 16px;
}

.footer-brand p {
    font-size: 13px;
    color: #888;
    margin-top: 4px;
}

.footer-links {
    display: flex;
    gap: 24px;
}

.footer-links a {
    font-size: 14px;
    color: #666;
}

.footer-links a:hover {
    color: #007cba;
}

.copyright {
    font-size: 13px;
    color: #999;
    border-top: 1px solid #e5e5e5;
    padding-top: 16px;
}

/* Responsive */
@media (max-width: 900px) {
    .tools-grid { grid-template-columns: repeat(2, 1fr); }
    .guide-list { flex-wrap: wrap; }
    .guide-item { flex: 1 1 45%; }
}

@media (max-width: 600px) {
    .main-nav, .studio-link { display: none; }
    .slide { height: 280px; }
    .slide-inner h2 { font-size: 26px; }
    .tools-grid { grid-template-columns: 1fr; }
    .tool-container { grid-template-columns: 1fr; }
    .guide-item { flex: 1 1 100%; }
    .footer-inner { flex-direction: column; gap: 20px; }
    .color-values { grid-template-columns: 1fr; }
    .converter-row { grid-template-columns: 1fr; }
}
