/* fidem.dev 공통 뼈대. 색 토큰, 글자, 레이아웃, 머리말, 꼬리말, 버튼.
   화면 하나에만 필요한 스타일은 여기에 넣지 않는다. */

:root {
    /* 다크를 기본으로 삼는다. 밝은 화면으로 바꾸지 않는다. */
    color-scheme: dark;

    --bg: #0e1013;
    --surface: #161a20;
    --surface2: #12161b;
    --fg: #e9ecf1;
    --sub: #a8b0bd;
    --muted: #7d8695;
    --line: #262c35;
    --key: #7fb0e0;
    --key-fg: #0e1013;
    --key-hover: #9cc4ec;
    --ok: #6fc39c;
    --danger: #e2868b;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .3);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--fg);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI",
                 "Noto Sans KR", "Apple SD Gothic Neo", sans-serif;
    font-size: 15px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

.wrap {
    max-width: 880px;
    margin: 0 auto;
    padding: 40px 20px 96px;
}

.wrap.narrow { max-width: 480px; }

/* --- 머리말 --- */

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 18px;
    margin-bottom: 40px;
    border-bottom: 1px solid var(--line);
}

.topbar .brand {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.14em;
    color: var(--fg);
    margin: 0;
    text-decoration: none;
}

/* 로그인 여부를 자바스크립트가 알려 줄 때까지 자리를 비워 둔다.
   폭을 미리 잡아 두어야 내용이 채워질 때 옆 요소가 밀리지 않는다. */
.account {
    min-width: 132px;
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    font-size: 13.5px;
}

.account a {
    color: var(--sub);
    text-decoration: none;
    padding: 5px 10px;
    border-radius: 6px;
}

.account a:hover { color: var(--fg); background: var(--surface); }
.account a.key { color: var(--key); font-weight: 600; }
.account a:focus-visible { outline: 2px solid var(--key); outline-offset: 1px; }

/* --- 제목 영역 --- */

header.page { margin-bottom: 40px; }

h1 {
    font-size: 27px;
    font-weight: 650;
    letter-spacing: -0.02em;
    margin: 0 0 8px;
}

.tagline {
    font-size: 15px;
    color: var(--sub);
    margin: 0;
}

h2.section {
    font-size: 15px;
    font-weight: 650;
    letter-spacing: -0.01em;
    margin: 0 0 18px;
}

/* --- 버튼 --- */

button.buy,
a.buy {
    appearance: none;
    display: block;
    width: 100%;
    padding: 11px 16px;
    border: 0;
    border-radius: 8px;
    background: var(--key);
    color: var(--key-fg);
    font: inherit;
    font-size: 14.5px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background .15s;
}

button.buy:hover:not(:disabled),
a.buy:hover { background: var(--key-hover); }

button.buy:focus-visible,
a.buy:focus-visible {
    outline: 2px solid var(--key);
    outline-offset: 2px;
}

button.buy:disabled { opacity: .55; cursor: default; }

button.ghost,
a.ghost {
    appearance: none;
    display: inline-block;
    padding: 8px 18px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: transparent;
    color: var(--fg);
    font: inherit;
    font-size: 14px;
    text-decoration: none;
    cursor: pointer;
}

button.ghost:hover,
a.ghost:hover { border-color: var(--fg); }

button.ghost:focus-visible,
a.ghost:focus-visible { outline: 2px solid var(--key); outline-offset: 2px; }

/* --- 안내 상자 --- */

.notice {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 28px 24px;
    text-align: center;
    color: var(--sub);
    font-size: 14.5px;
}

.notice.error { border-color: var(--danger); color: var(--danger); }

/* --- 꼬리말 --- */

footer {
    margin-top: 56px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
    font-size: 12.5px;
    color: var(--muted);
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

footer a { color: var(--muted); text-decoration: none; }
footer a:hover { color: var(--sub); }

@media (prefers-reduced-motion: reduce) {
    button.buy, a.buy { transition: none; }
}
