/* Reset & base */
*,
*::before,
*::after {
    box-sizing: border-box;
}

:root {
    --bg: #f9fafb;
    --surface: #ffffff;
    --text: #111827;
    --muted: #6b7280;
    --border: #e5e7eb;
    --border-strong: #d1d5db;
    --accent: #ef4444;   /* 빨간 하트 포인트 */
    --shadow-soft: 0 14px 40px rgba(15, 23, 42, 0.06);
    --radius-lg: 18px;
    --radius-md: 12px;
    --radius-sm: 8px;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text);
    background-color: var(--bg);
    -webkit-font-smoothing: antialiased;
}

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

img {
    max-width: 100%;
    display: block;
}

.wrapper {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background-color: rgba(249, 250, 251, 0.94);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: none;
}

.logo-image {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-text span {
    display: block;
    line-height: 1.1;
}

.logo-heart {
    position: relative;
    width: 10px;
    height: 10px;
    background: var(--accent);
    box-shadow:
        10px 0 var(--accent),
        0 10px var(--accent),
        10px 10px var(--accent),
        20px 10px var(--accent),
        5px 20px var(--accent),
        15px 20px var(--accent),
        10px 30px var(--accent);
}

/* Navigation */

.site-nav {
    display: flex;
    gap: 20px;
    font-size: 0.92rem;
}

.site-nav a {
    padding: 6px 0;
    color: var(--muted);
}

.site-nav a:hover,
.site-nav a:focus-visible {
    color: var(--text);
}

/* Sections */

.section {
    padding: 80px 0;
}

.section-header {
    margin-bottom: 32px;
}

.section-header h2 {
    font-size: 1.6rem;
    margin: 0 0 8px;
}

.section-header p {
    margin: 0;
    color: var(--muted);
    max-width: 520px;
}

/* Hero */

.hero-inner {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 2.4fr);
    gap: 48px;
    align-items: center;
}

.hero-eyebrow {
    color: var(--muted);
    font-size: 0.85rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin: 0 0 10px;
}

.hero h1 {
    margin: 0 0 16px;
    font-size: 2.4rem;
    line-height: 1.18;
}

.hero-desc {
    margin: 0 0 24px;
    color: var(--muted);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 16px;
    border-radius: 999px;
    font-size: 0.9rem;
    border: 1px solid var(--border-strong);
    background-color: #f3f4f6;
    color: var(--text);
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.btn-secondary:hover {
    background-color: #e5e7eb;
    transform: translateY(-1px);
}

/* Buttons */

.btn-primary,
.btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 11px 20px;
    border-radius: 999px;
    font-size: 0.95rem;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.btn-primary {
    background-color: var(--accent);
    color: #fff;
}

.btn-primary:hover {
    transform: translateY(-1px);
    background-color: #dc2626;
}

.btn-ghost {
    border-color: var(--border-strong);
    color: var(--text);
    background-color: transparent;
}

.btn-ghost:hover {
    background-color: #f3f4f6;
}

.btn-full {
    width: 100%;
}

/* Pixel windows (mock) */

.pixel-window {
    background-color: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
}

.pixel-window-header,
.pixel-window-toolbar {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    font-size: 0.78rem;
    color: var(--muted);
    gap: 8px;
}

.pixel-window-header {
    justify-content: flex-start;
}

.pixel-window-toolbar {
    justify-content: space-between;
}

.dot {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    display: inline-block;
}

.dot-red { background-color: #f87171; }
.dot-yellow { background-color: #facc15; }
.dot-green { background-color: #4ade80; }

.pixel-window-title {
    margin-left: 10px;
}

.pixel-window-icon {
    margin-left: auto;
}

.pixel-window-body {
    padding: 18px;
    background-color: #f9fafb;
}

.pixel-window-body--grid {
    padding: 0;
    position: relative;
    background-image:
        linear-gradient(to right, var(--border) 1px, transparent 1px),
        linear-gradient(to bottom, var(--border) 1px, transparent 1px);
    background-size: 16px 16px;
    min-height: 260px;
}

.pixel-window-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    border-top: 1px solid var(--border);
    font-size: 0.8rem;
    color: var(--muted);
}

.pixel-window-footer .coord {
    font-family: "SF Mono", ui-monospace, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

/* Pixel heart mock */

.pixel-heart-mock {
    position: relative;
    width: 120px;
    height: 100px;
    margin: 26px auto;
    background-image:
        linear-gradient(to right, var(--border) 1px, transparent 1px),
        linear-gradient(to bottom, var(--border) 1px, transparent 1px);
    background-size: 16px 16px;
}

.pixel-heart-mock::before {
    content: "";
    position: absolute;
    top: 16px;
    left: 24px;
    width: 16px;
    height: 16px;
    background: var(--accent);
    box-shadow:
        16px 0 var(--accent),
        32px 0 var(--accent),
        48px 0 var(--accent),
        0 16px var(--accent),
        16px 16px var(--accent),
        32px 16px var(--accent),
        48px 16px var(--accent),
        64px 16px var(--accent),
        16px 32px var(--accent),
        32px 32px var(--accent),
        48px 32px var(--accent),
        32px 48px var(--accent);
}

/* Board preview */

.board-preview {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 2.2fr);
    gap: 32px;
    align-items: center;
}

.board-copy {
    font-size: 0.96rem;
    color: var(--muted);
}

.board-tagline {
    margin: 0 0 14px;
    color: var(--text);
}

.board-list {
    padding-left: 18px;
    margin: 0 0 20px;
}

.board-list li {
    margin-bottom: 6px;
}

/* Steps */

.steps-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
}

.step-card {
    background-color: var(--surface);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    padding: 18px 18px 20px;
    font-size: 0.94rem;
}

.step-card h3 {
    margin: 0 0 8px;
    font-size: 1.02rem;
}

.step-card--accent {
    border-color: var(--accent);
}

/* Mission */

.section-mission {
    background-color: #f3f4f6;
}

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

.mission-card {
    background-color: var(--surface);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    padding: 18px 18px 22px;
}

.mission-card h3 {
    margin: 0 0 10px;
    font-size: 1rem;
}

/* Stats */

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

.stat-card {
    background-color: var(--surface);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    padding: 18px;
}

.stat-label {
    display: block;
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 6px;
}

.stat-value {
    font-size: 1.4rem;
    font-weight: 600;
}

/* Contact */

.section-contact {
    background-color: #f9fafb;
}

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

.contact-card {
    background-color: var(--surface);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    padding: 18px;
    font-size: 0.95rem;
}

.contact-card h3 {
    margin: 0 0 8px;
    font-size: 1rem;
}

.contact-email {
    display: inline-block;
    margin-top: 10px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.9rem;
}

/* Footer */

.site-footer {
    border-top: 1px solid var(--border);
    padding: 18px 0 22px;
    background-color: #f9fafb;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--muted);
}

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

/* Board page */

.board-body {
    background-color: #f3f4f6;
}

.board-section {
    padding-top: 60px;
}

.board-header {
    margin-bottom: 24px;
}

.board-title-group {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 8px;
}

.board-label {
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.08em;
}

.board-domain {
    font-size: 0.8rem;
    color: var(--muted);
}

.board-instruction {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.board-layout {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 2.1fr);
    gap: 24px;
    align-items: flex-start;
}

@media (max-width: 768px) {
    .board-layout {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .board-side {
        order: -1; /* 모바일에서 패널을 위로 */
    }
    
    .mobile-zoom-btn {
        display: inline-block !important;
    }
    
    .mini-map {
        width: 120px !important;
        height: 120px !important;
        top: 50px !important;
        left: 12px !important;
    }
    
    #miniMap {
        width: 120px !important;
        height: 120px !important;
    }
    
    .board-canvas-inner {
        touch-action: none;
        -webkit-overflow-scrolling: touch;
    }
    
    #pixelBoard {
        touch-action: none;
    }
}

@media (min-width: 769px) {
    .mobile-zoom-btn {
        display: none;
    }
}

.board-canvas-wrap {
    position: relative;             /* 추가 */
    background-color: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-soft);
    padding: 14px 14px 12px;
}


#pixelBoard {
    width: 100%;
    height: auto;
    display: block;
    transform-origin: center center;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background-color: #f9fafb;
}

.board-toolbar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.board-toolbar .btn-ghost.btn-xs {
    padding: 4px 10px;
    font-size: 0.78rem;
}

/* 미니맵 */
.mini-map {
    position: absolute;
    top: 42px;
    left: 18px;
    width: 160px;
    padding: 4px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-soft);
    z-index: 5;
}

.mini-map canvas {
    width: 100%;
    height: auto;
    display: block;
    image-rendering: pixelated;
}

.board-footer-caption {
    margin-top: 10px;
    border-radius: var(--radius-md);
}

/* Side panels */

.board-side {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.panel {
    background-color: var(--surface);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    padding: 16px 16px 18px;
    font-size: 0.93rem;
}

.panel-title {
    margin: 0 0 8px;
    font-size: 1rem;
}

.panel-desc {
    margin: 0 0 16px;
    color: var(--muted);
}

.field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 10px;
}

.field-label {
    font-size: 0.78rem;
    color: var(--muted);
}

.field input {
    border-radius: 999px;
    border: 1px solid var(--border-strong);
    padding: 8px 12px;
    font-size: 0.9rem;
    outline: none;
    background-color: #f9fafb;
}

.field input:focus-visible {
    border-color: var(--accent);
    background-color: #fff;
}

.panel-note {
    font-size: 0.9rem;
}

.panel-list {
    margin: 0;
    padding-left: 18px;
    color: var(--muted);
}

.panel-list li {
    margin-bottom: 4px;
}

/* Responsive */

@media (max-width: 960px) {
    .hero-inner,
    .board-preview,
    .steps-grid,
    .mission-grid,
    .stats-grid,
    .contact-grid,
    .board-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .site-nav {
        gap: 14px;
        font-size: 0.88rem;
    }

    .header-inner {
        height: 64px;
    }

    .section {
        padding: 64px 0;
    }
}

@media (max-width: 640px) {
    .hero-inner {
        gap: 36px;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .footer-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}
.board-toolbar {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 0.85rem;
    color: var(--muted);
}

.board-canvas-inner {
    overflow: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background-color: #f9fafb;
}

.btn-xs {
    padding: 4px 10px;
    font-size: 0.78rem;
    border-radius: 999px;
}

.color-palette {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 6px;
}

.color-swatch {
    width: 100%;
    padding-top: 100%;
    border-radius: 6px;
    border: 1px solid var(--border);
    position: relative;
    cursor: pointer;
}

.color-swatch-inner {
    position: absolute;
    inset: 2px;
    border-radius: 4px;
}

.color-swatch.is-active {
    outline: 2px solid #111827;
    outline-offset: 2px;
}

.checkout-note {
    margin-top: 8px;
    font-size: 0.78rem;
    color: var(--muted);
}
/* 픽셀 Hover 툴팁 */
.pixel-tooltip {
    position: fixed;
    padding: 6px 8px;
    border-radius: 6px;
    background: rgba(17, 24, 39, 0.92); /* 거의 검은색 */
    color: #f9fafb;
    font-size: 11px;
    pointer-events: none;
    z-index: 9999;
    max-width: 240px;
    white-space: normal;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.4);
}
