/* ========================================
   Fonts
======================================== */

@font-face {
    font-family: "Telegraf";
    src: url("../fonts/PPTelegraf-Regular.otf") format("opentype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Telegraf";
    src: url("../fonts/PPTelegraf-Ultrabold.otf") format("opentype");
    font-weight: 800;
    font-style: normal;
    font-display: swap;
}

/* ========================================
   Design tokens
======================================== */

:root {
    --font-body:
        "Telegraf",
        "Apple SD Gothic Neo",
        "Noto Sans KR",
        Arial,
        sans-serif;

    --content-width: 1440px;
    --page-gutter: clamp(24px, 5vw, 80px);
    --section-space: clamp(64px, 9vw, 140px);

    --text-small: 12px;
    --text-body: 16px;

    --motion-fast: 180ms;
}

/* 기본 테마: 밝은 내부 페이지 */
body {
    --color-background: #f3f2ee;
    --color-surface: #eae9e4;
    --color-text: #252525;
    --color-muted: #686862;
    --color-line: #d6d5cf;
}

/* 어두운 첫 화면 */
body[data-theme="dark"] {
    --color-background: #242424;
    --color-surface: #2d2d2d;
    --color-text: #f3f2ee;
    --color-muted: #b7b7af;
    --color-line: #494945;
}

/* ========================================
   Base
======================================== */

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 24px;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100svh;
    margin: 0;
    background: var(--color-background);
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: var(--text-body);
    line-height: 1.7;
    word-break: keep-all;
    overflow-wrap: anywhere;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
p {
    margin: 0;
}

h1,
h2,
h3,
h4 {
    line-height: 1.2;
}

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

button,
input,
textarea,
select {
    font: inherit;
}

button {
    color: inherit;
}

button:not(:disabled) {
    cursor: pointer;
}

img,
video {
    display: block;
    max-width: 100%;
    height: auto;
}

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

[hidden] {
    display: none !important;
}

::selection {
    background: var(--color-text);
    color: var(--color-background);
}

:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 6px;
}

/* ========================================
   Shared layout
======================================== */

.container {
    width: 100%;
    max-width: var(--content-width);
    margin-inline: auto;
    padding-inline: var(--page-gutter);
}

.site-main {
    flex: 1;
    min-width: 0;
}

.section {
    padding-block: var(--section-space);
}

.section-label {
    font-size: 11px;
    font-weight: 400;
    line-height: 1.6;
    letter-spacing: 0.14em;
}

.section-title {
    font-size: clamp(36px, 4.8vw, 72px);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.05em;
}

.section-description {
    max-width: 560px;
    color: var(--color-muted);
    font-size: clamp(14px, 1.4vw, 17px);
    line-height: 1.9;
}

.text-link {
    display: inline-flex;
    align-items: center;
    gap: 24px;
    min-height: 44px;
    border-bottom: 1px solid var(--color-line);
}

.text-link:hover {
    border-bottom-color: currentColor;
}

/* ========================================
   Skip link
======================================== */

.skip-link {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 100;
    padding: 12px 18px;
    transform: translateY(calc(-100% - 24px));
    background: var(--color-text);
    color: var(--color-background);
}

.skip-link:focus {
    transform: translateY(0);
}

/* ========================================
   Header
======================================== */

.site-header {
    position: relative;
    z-index: 20;
    background: var(--color-background);
    border-bottom: 1px solid var(--color-line);
}

.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    min-height: 88px;
}

.site-brand {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    flex-shrink: 0;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 0.18em;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: clamp(24px, 3.5vw, 56px);
}

.site-nav__link {
    position: relative;
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    font-size: 11px;
    letter-spacing: 0.14em;
}

.site-nav__link::after {
    position: absolute;
    right: 0;
    bottom: 5px;
    left: 0;
    height: 1px;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--motion-fast) ease;
    content: "";
}

.site-nav__link:hover::after,
.site-nav__link[aria-current="page"]::after {
    transform: scaleX(1);
}

/* ========================================
   Mobile menu button
======================================== */

.menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-width: 44px;
    min-height: 44px;
    padding: 8px 0 8px 12px;
    border: 0;
    background: transparent;
}

.menu-toggle__label {
    font-size: 12px;
}

.menu-toggle__icon {
    position: relative;
    display: block;
    width: 22px;
    height: 16px;
}

.menu-toggle__icon>span {
    position: absolute;
    left: 0;
    width: 22px;
    height: 1px;
    background: currentColor;
    transition:
        top var(--motion-fast) ease,
        transform var(--motion-fast) ease;
}

.menu-toggle__icon>span:first-child {
    top: 4px;
}

.menu-toggle__icon>span:last-child {
    top: 12px;
}

.menu-toggle[aria-expanded="true"] .menu-toggle__icon>span:first-child {
    top: 8px;
    transform: rotate(45deg);
}

.menu-toggle[aria-expanded="true"] .menu-toggle__icon>span:last-child {
    top: 8px;
    transform: rotate(-45deg);
}

/* ========================================
   Footer
======================================== */

.site-footer {
    margin-top: var(--section-space);
    padding-block: 40px 28px;
    border-top: 1px solid var(--color-line);
}

.site-footer__top,
.site-footer__bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.site-footer__email {
    display: inline-flex;
    align-items: center;
    gap: 24px;
    min-height: 44px;
    font-size: clamp(14px, 1.8vw, 22px);
}

.site-footer__email:hover {
    text-decoration: underline;
    text-underline-offset: 6px;
}

.site-footer__bottom {
    margin-top: 48px;
    color: var(--color-muted);
    font-size: 10px;
    letter-spacing: 0.08em;
}

/* ========================================
   Mobile
======================================== */

@media (max-width: 760px) {
    .site-header__inner {
        flex-wrap: wrap;
        gap: 0;
        min-height: 72px;
    }

    .site-brand {
        font-size: 14px;
    }

    .menu-toggle:not([hidden]) {
        display: inline-flex;
    }

    .site-nav {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        width: 100%;
        padding-block: 12px 24px;
    }

    .site-nav__link {
        min-height: 56px;
        border-top: 1px solid var(--color-line);
        font-size: 13px;
    }

    .site-nav__link::after {
        right: auto;
        bottom: 12px;
        width: 24px;
    }

    .site-footer__top,
    .site-footer__bottom {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .site-footer__bottom {
        margin-top: 32px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .site-nav__link::after,
    .menu-toggle__icon>span {
        transition: none;
    }
}

/* 회사소개서 2페이지의 원본 질감 적용 (밝은 페이지 전용).
   PNG는 글자/그림이 없는 검은 입자 + 투명 배경 원본입니다.
   PDF와 같이 흰 바탕 위에 15% 농도로 겹쳐 밝은 종이 질감을 만듭니다. */
body[data-theme="light"] {
    --color-background: #fff;
    --color-surface: transparent;
    --color-line: rgb(37 37 37 / 20%);
    background: var(--color-background);
    position: relative;
    isolation: isolate;
}

/* 별도 배경 레이어만 투명하게 하므로 본문 글자와 이미지는 흐려지지 않습니다.
   원본 3200px 이미지를 PDF 페이지 폭과 같은 1440px로 표시합니다.
   화면 폭에 따라 입자 크기가 달라지지 않도록 크기를 고정합니다. */
body[data-theme="light"]::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image: url("../image/paper-texture-light.png");
    background-repeat: repeat;
    background-size: 1440px 864px;
    opacity: 0.15;
}

/* 헤더와 푸터도 같은 배경이 이어지도록 단색 덮개를 없앱니다.
   dark 테마와 메인페이지에는 적용되지 않습니다. */
body[data-theme="light"] .site-header,
body[data-theme="light"] .site-footer {
    background: transparent;
}

/* 밝은 페이지 가독성 보정 */
body[data-theme="light"] {
    --color-text: #222;
    --color-muted: #4d4d49;

    /* 영문은 Telegraf, 지원하지 않는 한글은 다음 글꼴로 표시 */
    font-family:
        "Telegraf",
        "Apple SD Gothic Neo",
        "Noto Sans KR",
        "Malgun Gothic",
        sans-serif;
}

/* 종이 질감은 유지하되 작은 글자를 방해하지 않도록 농도 감소 */
body[data-theme="light"]::before {
    opacity: 0.1;
}