/* ============================================
   개인 홈페이지 - 메인 스타일시트
   에디토리얼 다크 테마 + Noto Serif KR
   ============================================ */

:root {
    --bg-primary:   #0d0d0d;
    --bg-secondary: #141414;
    --bg-card:      #1a1a1a;
    --bg-hover:     #222222;
    --border:       #2a2a2a;
    --border-light: #333333;

    --text-primary:   #e8e4dd;
    --text-secondary: #a09890;
    --text-muted:     #5c5550;
    --text-accent:    #c8a96e;  /* 따뜻한 골드 */

    --accent:       #c8a96e;
    --accent-dark:  #a08040;
    --red:          #c0392b;
    --green:        #27ae60;

    --font-serif: 'Noto Serif KR', 'Georgia', serif;
    --font-mono:  'JetBrains Mono', 'Courier New', monospace;

    --radius: 2px;
    --transition: 200ms ease;
    --shadow: 0 4px 24px rgba(0,0,0,0.5);

    --header-h: 64px;
    --container: 900px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-serif);
    line-height: 1.75;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--text-primary); }
ul, ol { list-style: none; }
button { cursor: pointer; font-family: inherit; }

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-serif);
    font-weight: 500;
    line-height: 1.3;
    color: var(--text-primary);
}

/* ── Layout ── */
.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 24px;
}
.site-main { flex: 1; padding-top: calc(var(--header-h) + 40px); }

/* ── Header ── */
.site-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--header-h);
    background: rgba(13,13,13,0.95);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(12px);
    z-index: 100;
}
.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}
.logo {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    font-weight: 500;
}
.logo:hover { color: var(--accent); }
.logo-bracket { color: var(--accent); }

.main-nav ul {
    display: flex;
    gap: 8px;
}
.main-nav a {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-secondary);
    padding: 8px 14px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    transition: all var(--transition);
}
.main-nav a:hover,
.main-nav a.active {
    color: var(--accent);
    border-color: var(--accent);
    background: rgba(200,169,110,0.06);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    padding: 8px;
}
.nav-toggle span {
    display: block;
    width: 24px;
    height: 1px;
    background: var(--text-primary);
    transition: all var(--transition);
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: rotate(45deg) translate(4px, 4px); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: rotate(-45deg) translate(4px, -4px); }

/* ── Footer ── */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 32px 0;
    margin-top: 80px;
}
.site-footer .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}
.footer-text {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
}
.social-links {
    display: flex;
    gap: 16px;
}
.social-links a {
    color: var(--text-muted);
    transition: color var(--transition);
}
.social-links a:hover { color: var(--accent); }

/* ── Page Header ── */
.page-header {
    padding: 60px 0 40px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 48px;
}
.page-header .label {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 12px;
}
.page-header h1 {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 300;
}

/* ── Cards ── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color var(--transition), transform var(--transition);
}
.card:hover { border-color: var(--accent); transform: translateY(-2px); }

/* ── Blog ── */
.post-grid {
    display: grid;
    gap: 24px;
}
.post-item {
    display: block;
    padding: 28px;
    border-bottom: 1px solid var(--border);
    transition: all var(--transition);
}
.post-item:last-child { border-bottom: none; }
.post-item:hover { background: var(--bg-hover); }
.post-meta {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    margin-bottom: 10px;
    display: flex;
    gap: 16px;
    align-items: center;
}
.post-category {
    color: var(--accent);
    border: 1px solid var(--accent);
    padding: 2px 8px;
    border-radius: var(--radius);
    font-size: 0.65rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}
.post-title {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
    transition: color var(--transition);
}
.post-item:hover .post-title { color: var(--accent); }
.post-excerpt {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── Single Post Content ── */
.post-content {
    font-size: 1rem;
    line-height: 1.9;
    color: var(--text-primary);
}
.post-content h1, .post-content h2, .post-content h3 {
    margin: 2em 0 0.8em;
    padding-bottom: 0.3em;
    border-bottom: 1px solid var(--border);
}
.post-content p { margin-bottom: 1.2em; }
.post-content ul, .post-content ol {
    margin: 1em 0 1em 1.5em;
    list-style: disc;
}
.post-content ol { list-style: decimal; }
.post-content li { margin-bottom: 0.4em; }
.post-content blockquote {
    border-left: 3px solid var(--accent);
    margin: 1.5em 0;
    padding: 12px 20px;
    background: var(--bg-card);
    color: var(--text-secondary);
    font-style: italic;
}
.post-content pre, .post-content code {
    font-family: var(--font-mono);
    font-size: 0.85em;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.post-content pre {
    padding: 16px;
    overflow-x: auto;
    margin: 1.5em 0;
}
.post-content code { padding: 2px 6px; }
.post-content pre code { padding: 0; border: none; background: none; }
.post-content img { margin: 1.5em auto; border-radius: var(--radius); }
.post-content table { width: 100%; border-collapse: collapse; margin: 1.5em 0; }
.post-content th, .post-content td {
    border: 1px solid var(--border);
    padding: 10px 14px;
    text-align: left;
}
.post-content th {
    background: var(--bg-secondary);
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.post-content a { color: var(--accent); border-bottom: 1px solid rgba(200,169,110,0.3); }
.post-content a:hover { border-bottom-color: var(--accent); }

/* ── Notice ── */
.notice-list { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.notice-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    transition: background var(--transition);
    text-decoration: none;
    color: inherit;
}
.notice-item:last-child { border-bottom: none; }
.notice-item:hover { background: var(--bg-hover); }
.notice-badge {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    padding: 2px 8px;
    border-radius: var(--radius);
    border: 1px solid;
    white-space: nowrap;
    flex-shrink: 0;
}
.notice-badge.important { color: var(--red); border-color: var(--red); }
.notice-badge.normal { color: var(--text-muted); border-color: var(--border); }
.notice-title { flex: 1; font-size: 0.95rem; }
.notice-date { font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-muted); white-space: nowrap; }

/* ── Guestbook ── */
.guestbook-form {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    margin-bottom: 40px;
}
.guestbook-form h2 { font-size: 1.1rem; font-weight: 400; margin-bottom: 24px; }
.guestbook-entries { display: flex; flex-direction: column; gap: 20px; }
.guestbook-entry {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
}
.entry-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.entry-author { font-weight: 500; font-size: 0.95rem; }
.entry-date { font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-muted); }
.entry-message { font-size: 0.95rem; color: var(--text-secondary); line-height: 1.7; }
.admin-reply {
    margin-top: 16px;
    padding: 16px;
    background: var(--bg-secondary);
    border-left: 2px solid var(--accent);
}
.admin-reply-label {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 8px;
}
.admin-reply-text { font-size: 0.9rem; color: var(--text-secondary); }

/* ── Forms ── */
.form-group { margin-bottom: 20px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
label {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 6px;
}
input[type="text"], input[type="email"], input[type="password"],
input[type="search"], textarea, select {
    width: 100%;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: var(--font-serif);
    font-size: 0.95rem;
    padding: 10px 14px;
    transition: border-color var(--transition);
    outline: none;
    appearance: none;
}
input:focus, textarea:focus, select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(200,169,110,0.1);
}
textarea { resize: vertical; min-height: 120px; }

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 10px 22px;
    border-radius: var(--radius);
    border: 1px solid;
    transition: all var(--transition);
    cursor: pointer;
    white-space: nowrap;
}
.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #0d0d0d;
}
.btn-primary:hover { background: var(--text-primary); border-color: var(--text-primary); color: #0d0d0d; }
.btn-outline {
    background: transparent;
    border-color: var(--border-light);
    color: var(--text-secondary);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-danger {
    background: transparent;
    border-color: var(--red);
    color: var(--red);
}
.btn-danger:hover { background: var(--red); color: white; }
.btn-sm { padding: 6px 14px; font-size: 0.7rem; }

/* ── Pagination ── */
.pagination {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-top: 48px;
}
.pagination a, .pagination span {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-secondary);
    transition: all var(--transition);
}
.pagination a:hover { border-color: var(--accent); color: var(--accent); }
.pagination .current { background: var(--accent); border-color: var(--accent); color: #0d0d0d; }

/* ── Alerts ── */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius);
    border: 1px solid;
    font-size: 0.9rem;
    margin-bottom: 20px;
}
.alert-success { background: rgba(39,174,96,0.08); border-color: var(--green); color: var(--green); }
.alert-error { background: rgba(192,57,43,0.08); border-color: var(--red); color: var(--red); }
.alert-info { background: rgba(200,169,110,0.08); border-color: var(--accent); color: var(--accent); }

/* ── Home Hero ── */
.hero {
    min-height: calc(100vh - var(--header-h));
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 80px 0 60px;
    position: relative;
}
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 60% 40% at 70% 50%, rgba(200,169,110,0.05) 0%, transparent 70%);
    pointer-events: none;
}
.hero-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 80px; align-items: center; }
.hero-label {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.hero-label::before {
    content: '';
    display: block;
    width: 32px;
    height: 1px;
    background: var(--accent);
}
.hero-title {
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 300;
    line-height: 1.25;
    margin-bottom: 24px;
    white-space: pre-line;
}
.hero-title strong { font-weight: 700; color: var(--accent); }
.hero-desc { font-size: 0.95rem; color: var(--text-secondary); line-height: 1.8; margin-bottom: 36px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-visual {
    position: relative;
    aspect-ratio: 1;
    max-width: 320px;
    justify-self: center;
}
.hero-visual-inner {
    width: 100%;
    height: 100%;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}
.hero-visual-inner img { width: 100%; height: 100%; object-fit: cover; }
.hero-visual-placeholder {
    font-family: var(--font-mono);
    font-size: 4rem;
    opacity: 0.2;
}
.hero-visual::after {
    content: '';
    position: absolute;
    top: 12px; right: -12px;
    bottom: -12px; left: 12px;
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    opacity: 0.3;
    z-index: -1;
}

/* ── Section ── */
.section { padding: 64px 0; }
.section-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 32px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}
.section-title {
    font-size: 1.4rem;
    font-weight: 300;
}
.section-title span {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--accent);
    margin-left: 12px;
}
.section-more {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    text-transform: uppercase;
    transition: color var(--transition);
}
.section-more:hover { color: var(--accent); }

/* ── Responsive ── */
@media (max-width: 768px) {
    .main-nav {
        display: none;
        position: fixed;
        top: var(--header-h);
        left: 0; right: 0;
        background: var(--bg-primary);
        border-bottom: 1px solid var(--border);
        padding: 20px;
    }
    .main-nav.open { display: block; }
    .main-nav ul { flex-direction: column; gap: 4px; }
    .main-nav a { display: block; text-align: center; }
    .nav-toggle { display: flex; }

    .hero-grid { grid-template-columns: 1fr; gap: 48px; }
    .hero-visual { order: -1; max-width: 200px; }
    .hero-title { font-size: 2rem; }

    .form-row { grid-template-columns: 1fr; }
    .section-header { flex-direction: column; gap: 12px; }
    .site-footer .container { flex-direction: column; align-items: flex-start; }
}

/* ── Skeleton Loading ── */
.skeleton {
    background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-hover) 50%, var(--bg-card) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius);
}
@keyframes shimmer {
    from { background-position: 200% 0; }
    to   { background-position: -200% 0; }
}

/* ── View Counter ── */
.view-count {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* ── Breadcrumb ── */
.breadcrumb {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb-sep { opacity: 0.4; }

/* ── Empty State ── */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-muted);
}
.empty-state-icon { font-size: 3rem; margin-bottom: 16px; opacity: 0.3; }
.empty-state-text { font-size: 0.9rem; }

/* ── Filter Tabs ── */
.filter-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 32px;
}
.filter-tab {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 6px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-muted);
    transition: all var(--transition);
    background: none;
    cursor: pointer;
    text-decoration: none;
}
.filter-tab:hover, .filter-tab.active {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(200,169,110,0.06);
}

/* ── Scroll animations ── */
.fade-in {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}
.fade-in.visible { opacity: 1; transform: none; }
