@font-face {
    font-family: 'IBM Plex Sans KR';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('fonts/IBMPlexSansKR-Regular-subset.woff2') format('woff2');
    unicode-range: U+0020-007F, U+AC00-D7A3; /* 라틴 + 한글 */
}
@font-face {
    font-family: 'IBM Plex Sans KR';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('fonts/IBMPlexSansKR-Bold-subset.woff2') format('woff2');
    unicode-range: U+0020-007F, U+AC00-D7A3; /* 라틴 + 한글 */
}

:root {
    --font-body: 'IBM Plex Sans KR', sans-serif, monospace;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

    /* Contrast-balanced colours (WCAG AA for large text, AAA for body) */
    --fg: #2E2D2B;        /* 12:1 contrast on #fff */
    --fg-muted: #757575;
    --card: #FFF3E6;
    --point: #FFD6B0;
    --bg: #F6F7F9;
    --bg-alt: #F6F7F9;
    --link: #6D9DC5;
    --link-visited: #6D9DC5;
    --border: #E2E6EA;
    --code-bg: #f5f7fa;

    /* Spacing scale (4-point grid) */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 1rem;
    --space-4: 2rem;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-size: 100%;                /* 16 px base */
    -webkit-text-size-adjust: 100%; /* prevent iOS zoom */
    scroll-behavior: smooth;
}

/* 기본 글꼴로 설정 */
body {
    margin: 0;
    color: var(--fg);
    background: var(--bg);
    font-family: var(--font-body), serif;
    line-height: 1.5;               /* optimal 1.5–1.8 */
    font-size: 1rem;            /* ~18 px; high comprehension */
    word-wrap: break-word;
    -webkit-font-smoothing: antialiased;
}

main.content {
    display: flex;
    justify-content: center;
}

article {
    max-width: 800px;
    padding: var(--space-3);
}

article > header .post-info {
    display: flex;
    justify-content: space-between;

    color: rgb(113, 113, 122);
    font-size: 0.875rem;
    line-height: 1.25rem;
    padding: 0.5rem 0;
}

article > header {
    margin-bottom: 2rem;
}
article > header > h1 {
    margin: 0;
    font-size: 1.725rem;
    line-height: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.025em;
}
article > header > p.date {
    margin-left: 1em;
    display: flex;
    width: fit-content;
    align-items: flex-end;

    color: rgb(113, 113, 122);
    font-size: 0.875rem;
    line-height: 1.25rem;
}

.top-header {
    display: flex;
    justify-content: center;
}

.header-container {
    width:100%;
    max-width: 800px;
}

/* 4. Headings – clear visual hierarchy */
h1, h2, h3, h4, h5, h6 {
    line-height: 1.2;
    font-weight: 700;
    margin: var(--space-4) 0 var(--space-2);
}

article h1 { font-size: 1.5rem; }  /* 36 px ≈ 2× body – keeps ratio 1 : √2 */
article h2 { font-size: 1.35rem; }
article h3 { font-size: 1.2rem; }
article h4 { font-size: 1rem; }
article h5 { font-size: .9rem; }
article h6 { font-size: .8rem; color: var(--fg-muted); }

article > p {
    margin: 0 0 var(--space-3) 0;
}

/* 6. Links – colour + subtle underline appears only on hover/focus */
a {
    color: var(--fg);
    text-decoration: none;
}

a:hover,
a:focus {
    text-decoration: underline;
}


/* 7. Lists – comfortable spacing */
ul, ol {
    margin: 0 0 var(--space-1) var(--space-4);
    padding: 0;
}

article li {
    margin-bottom: var(--space-1);
}

pre {
    font-family: var(--font-mono), serif;
    border-radius: 0.5rem;
    background-color: rgb(17,24,39);
    padding: 1rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
    color: rgb(243,244,246);
    max-width: 100%;
    overflow-x: auto;
}
pre, code {
    white-space: pre-wrap;
    word-break: break-word;
}

blockquote {
    background: var(--card);
    color: var(--fg);
    border-left: 4px solid var(--border);
    margin: 1em 0;
    padding: 0.025em 1em;
    border-radius: 8px;
    font-style: italic;
}

blockquote cite {
    display: block;
    margin-top: 0.75em;
    font-size: 0.95em;
    font-style: normal;
    text-align: right;
}

/* 10. Tables – scroll on small screens */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: var(--space-3);
    table-layout: fixed;
    word-break: break-word;
}
th, td {
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--border);
    text-align: left;
    word-break: break-word;
}

/* 11. Images – scale responsively */
img, video, iframe {
    max-width: 100%;
    height: auto;
}

.top-header {
    background-color: var(--bg);
    border-bottom: 1px solid var(--fg);
    padding: 0.75rem 1rem;
}

.header-container {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--fg);
    margin: .5rem .25rem;

    cursor: pointer;
}

.main-menu .nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
}

.main-menu .nav-list li a {
    text-decoration: none;
    color: var(--fg);
}

footer {
    color: var(--fg-muted);
    text-align: center;
    padding: 1rem 0;
    font-size: 0.875rem;
}

.profile-section {
    display: flex;
    justify-content: center;
}
.profile > p {
    margin: 0.5rem;
}
.profile {
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    padding: 12px 18px;
    margin-top: 2rem;
}
.name {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 4px;
}
.name > h3 {
    margin-top: 0;
}

.role {
    color: #6b7280;
    font-size: 0.9rem;
    margin-bottom: 16px;
}

.bio {
    font-size: 0.9rem;
    color: #4b5563;
    line-height: 1.6;
    margin-bottom: 20px;
}
.profile > hr {
    border: none;
    border-top: 1px solid #e5e7eb;
    margin-bottom: 16px;
}
.email {
    font-weight: 600;
    color: #111827;
    font-size: 0.95rem;
    word-break: break-word;
}

/* 12. Dark-mode adaptation */
@media (prefers-color-scheme: dark) {
    :root {
        --fg: #F5F5F2;        /* 12:1 contrast on #fff */
        --fg-muted: #F5F5F2;
        --card: #2F3541;
        --point: #F6CBA1;
        --bg: #222C36;
        --bg-alt: #222C36;
        --link: #7AAFD9;
        --link-visited: #7AAFD9;
        --border: #38414C;
        --code-bg: #f5f7fa;
    }

}

@media (max-width: 45rem) {
    table {
        display: block;
        overflow-x: auto;
    }
}

@media (min-width: 768px) {
    article > header > h1 {
        font-size: 2.25rem;
        line-height: 1;
    }

    body {
        line-height: 1.6;               /* optimal 1.5–1.8 */
        font-size: 1.2rem;            /* ~18 px; high comprehension */
    }

    .logo {
        margin-bottom: 0;
        font-size: 1.5rem;
    }

    .main-menu .nav-list {
        gap: 1.5rem;
    }
}

@media (min-width: 1024px) {

    article > header > h1 {
        font-size: 2.5rem;
        line-height: 1;
    }
    body {
        line-height: 1.7;               /* optimal 1.5–1.8 */
        font-size: 1.25rem;            /* ~18 px; high comprehension */
    }



    .logo {
        font-size: 1.75rem;
    }

    .main-menu .nav-list li a {
        font-size: 1.125rem;
    }

    .profile {
        max-width: 480px;
    }
}
