/* styles.css */

/* ==========================================================================
   1. Design tokens
   ========================================================================== */
:root {
    color-scheme: dark;

    /* Palette: graphite + amber, with a muted sage secondary */
    --bg: #0f1115;
    --surface: #161a20;
    --surface-2: #1d222a;
    --surface-3: #242a34;
    --border: #272d37;
    --border-strong: #353d4a;

    --text: #e1e4e9;
    --text-strong: #f2f4f7;
    --muted: #a4acb8;
    --muted-2: #8b93a0;

    --accent: #d9a441;
    --accent-soft: rgba(217, 164, 65, 0.14);
    --accent-2: #8fbfae;
    --accent-2-soft: rgba(143, 191, 174, 0.14);
    --visited: #c79f63;
    --focus: #f5cf7a;

    --code-bg: #0b0d11;
    --code-text: #f0dcae;
    --selection: rgba(217, 164, 65, 0.28);

    /* Typography */
    --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

    --fs-base: 1rem;
    --lh-base: 1.7;
    --fs-small: 0.875rem;
    --fs-xs: 0.75rem;

    /* Spacing scale: 4 / 8 / 12 / 16 / 24 / 32 / 48 / 64 */
    --s-1: 4px;
    --s-2: 8px;
    --s-3: 12px;
    --s-4: 16px;
    --s-5: 24px;
    --s-6: 32px;
    --s-7: 48px;
    --s-8: 64px;

    /* Shape */
    --radius-sm: 6px;
    --radius: 12px;
    --border-w: 1px;

    /* Layout */
    --gutter: var(--s-4);
    --container: 1120px;
    --measure: 68ch;
    --touch: 44px;
    --transition: 0.2s ease;
}

@media (min-width: 480px) {
    :root {
        --gutter: 20px;
    }
}

@media (min-width: 768px) {
    :root {
        --fs-base: 1.0625rem;
        --gutter: 24px;
    }
}

@media (min-width: 1024px) {
    :root {
        --fs-base: 1.125rem;
        --gutter: 32px;
    }
}

/* ==========================================================================
   2. Reset & base
   ========================================================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    background-color: var(--bg);
    scrollbar-color: var(--border-strong) var(--bg);
    scrollbar-width: thin;
}

body {
    min-height: 100vh;
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: var(--fs-base);
    font-weight: 400;
    line-height: var(--lh-base);
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

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

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: 10px;
    border: 2px solid var(--bg);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--muted-2);
}

img,
picture,
video,
canvas,
svg {
    display: block;
    max-width: 100%;
}

img,
video {
    height: auto;
    border-radius: var(--radius-sm);
    filter: brightness(0.92);
}

/* ==========================================================================
   3. Typography
   ========================================================================== */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--text-strong);
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -0.01em;
    overflow-wrap: anywhere;
    hyphens: auto;
}

h1,
h2,
h3 {
    font-family: var(--font-display);
}

h4,
h5,
h6 {
    font-family: var(--font-body);
    font-weight: 600;
}

p {
    margin-bottom: var(--s-4);
}

strong,
b {
    font-weight: 600;
    color: var(--text-strong);
}

em,
i {
    font-style: italic;
}

small,
.small {
    font-size: var(--fs-small);
    color: var(--muted);
}

a {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    text-decoration-color: rgba(217, 164, 65, 0.45);
    transition: color var(--transition), text-decoration-color var(--transition);
}

a:hover {
    color: var(--focus);
    text-decoration-thickness: 2px;
    text-decoration-color: var(--focus);
}

a:visited {
    color: var(--visited);
}

a:active {
    color: var(--text-strong);
}

/* ==========================================================================
   4. Focus & interactive base
   ========================================================================== */
:focus {
    outline: none;
}

:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 3px;
    border-radius: var(--radius-sm);
}

button,
input,
textarea,
select {
    font: inherit;
    color: var(--text);
    background-color: var(--surface-2);
    border: var(--border-w) solid var(--border-strong);
    border-radius: var(--radius-sm);
    padding: var(--s-2) var(--s-3);
    min-height: var(--touch);
    max-width: 100%;
    color-scheme: dark;
    transition: border-color var(--transition), background-color var(--transition);
}

input::placeholder,
textarea::placeholder {
    color: var(--muted-2);
    opacity: 1;
}

input:hover,
textarea:hover,
select:hover {
    border-color: var(--muted-2);
}

input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    border-color: var(--focus);
}

textarea {
    min-height: 120px;
    resize: vertical;
}

select option {
    background-color: var(--surface-2);
    color: var(--text);
}

button {
    cursor: pointer;
    font-weight: 500;
}

button:hover {
    background-color: var(--surface-3);
    border-color: var(--accent);
    color: var(--text-strong);
}

button:active {
    background-color: var(--accent-soft);
}

button:disabled,
input:disabled,
textarea:disabled,
select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ==========================================================================
   5. Layout base
   ========================================================================== */
main {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: var(--s-6) var(--gutter) var(--s-7);
}

@media (min-width: 768px) {
    main {
        padding-top: var(--s-7);
        padding-bottom: var(--s-8);
    }
}

/* ==========================================================================
   6. Header
   ========================================================================== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: var(--bg);
    border-bottom: var(--border-w) solid var(--border);
}

.header-inner {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: var(--s-3) var(--gutter);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: var(--s-2) var(--s-4);
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: var(--s-2);
    min-height: var(--touch);
    font-family: var(--font-display);
    font-size: 1.125rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--text-strong);
    text-decoration: none;
}

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

.lang-switcher {
    display: flex;
    align-items: center;
    gap: var(--s-1);
    font-size: var(--fs-small);
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.lang-switcher a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: var(--touch);
    min-height: var(--touch);
    padding: 0 var(--s-2);
    color: var(--muted);
    text-decoration: none;
    border-radius: var(--radius-sm);
    border-bottom: 2px solid transparent;
}

.lang-switcher a:hover {
    color: var(--text-strong);
    background-color: var(--surface-2);
}

.lang-switcher a.active,
.lang-switcher a[aria-current="page"] {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* ==========================================================================
   7. Article title & hero
   ========================================================================== */
.article-title {
    font-family: var(--font-display);
    font-size: clamp(1.3125rem, 1.05rem + 1vw, 2rem);
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -0.01em;
    color: var(--text-strong);
    max-width: 36em;
    margin-bottom: var(--s-5);
    text-wrap: balance;
}

.hero {
    display: grid;
    gap: var(--s-5);
    margin-bottom: var(--s-7);
    min-width: 0;
}

.hero-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: var(--s-4);
    min-width: 0;
}

.hero-content .lead {
    font-size: 1.125rem;
    line-height: 1.6;
    color: var(--text);
    margin-bottom: 0;
}

.meta-info {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--s-2) var(--s-3);
    font-size: var(--fs-small);
    color: var(--muted);
    padding-top: var(--s-3);
    border-top: var(--border-w) solid var(--border);
}

.hero-visual {
    position: relative;
    width: 100%;
    height: 220px;
    overflow: hidden;
    background-color: var(--surface);
    border: var(--border-w) solid var(--border);
    border-radius: var(--radius);
}

.hero-visual img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    border-radius: var(--radius);
    filter: brightness(0.88) saturate(0.9);
}

.visual-texture {
    width: 100%;
    height: 100%;
    background-image:
        repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 12px),
        linear-gradient(180deg, var(--surface-2), var(--surface));
}

@media (min-width: 480px) {
    .hero-visual {
        height: 280px;
    }
}

@media (min-width: 768px) {
    .hero-visual {
        height: 340px;
    }
}

@media (min-width: 1024px) {
    .hero {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
        gap: var(--s-7);
        align-items: center;
    }

    .hero-visual {
        height: 100%;
        min-height: 380px;
    }
}

/* ==========================================================================
   8. Article content
   ========================================================================== */
.content-body {
    width: 100%;
    max-width: var(--measure);
    margin: 0 auto var(--s-7);
    font-size: var(--fs-base);
    line-height: var(--lh-base);
    color: var(--text);
}

.content-body > * + * {
    margin-top: 0;
}

.content-body p {
    margin-bottom: var(--s-5);
    color: var(--text);
}

.content-body h2,
.content-body h3 {
    margin-top: var(--s-7);
    margin-bottom: var(--s-4);
    color: var(--text-strong);
}

.content-body h2 {
    font-size: clamp(1.25rem, 1.1rem + 0.5vw, 1.5rem);
    padding-top: var(--s-5);
    border-top: var(--border-w) solid var(--border);
}

.content-body h3 {
    font-size: clamp(1.125rem, 1rem + 0.4vw, 1.3125rem);
}

.content-body h2:first-child,
.content-body h3:first-child {
    margin-top: 0;
}

.content-body ul,
.content-body ol {
    margin-bottom: var(--s-5);
    padding-left: var(--s-5);
}

.content-body ul {
    list-style: disc;
}

.content-body ol {
    list-style: decimal;
}

.content-body li {
    margin-bottom: var(--s-2);
    color: var(--text);
    padding-left: var(--s-1);
}

.content-body li::marker {
    color: var(--accent);
}

.content-body li > ul,
.content-body li > ol {
    margin-top: var(--s-2);
    margin-bottom: var(--s-2);
}

.content-body ul ul {
    list-style: circle;
}

.content-body ul li strong {
    color: var(--text-strong);
}

.content-body blockquote {
    position: relative;
    margin: var(--s-6) 0;
    padding: var(--s-4) var(--s-5);
    border-left: 3px solid var(--accent);
    border-radius: 0 var(--radius) var(--radius) 0;
    background-color: var(--surface);
    font-size: 1.0625rem;
    font-style: italic;
    line-height: 1.65;
    color: var(--muted);
}

.content-body blockquote p:last-child,
.content-body blockquote footer,
.content-body blockquote cite {
    margin-bottom: 0;
}

.content-body blockquote cite,
.content-body blockquote footer {
    display: block;
    margin-top: var(--s-2);
    font-style: normal;
    font-size: var(--fs-small);
    color: var(--muted-2);
}

.content-body hr,
hr {
    border: 0;
    height: var(--border-w);
    background-color: var(--border);
    margin: var(--s-7) 0;
}

.content-body figure,
figure {
    margin: var(--s-6) 0;
}

.content-body figure img {
    margin: 0 auto;
}

figcaption {
    margin-top: var(--s-2);
    font-size: var(--fs-small);
    color: var(--muted-2);
    text-align: center;
}

mark {
    background-color: var(--accent-soft);
    color: var(--text-strong);
    padding: 0 var(--s-1);
    border-radius: 3px;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}

kbd {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.85em;
    line-height: 1;
    padding: 3px 6px;
    color: var(--text-strong);
    background-color: var(--surface-3);
    border: var(--border-w) solid var(--border-strong);
    border-bottom-width: 2px;
    border-radius: var(--radius-sm);
    white-space: nowrap;
}

/* Inline code */
code,
kbd,
samp {
    font-family: var(--font-mono);
}

:not(pre) > code {
    padding: 2px 6px;
    font-size: 0.9em;
    color: var(--code-text);
    background-color: var(--surface-3);
    border: var(--border-w) solid var(--border);
    border-radius: var(--radius-sm);
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* Code blocks */
pre {
    position: relative;
    max-width: 100%;
    margin: var(--s-5) 0;
    padding: var(--s-4) var(--s-5);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    background-color: var(--code-bg);
    border: var(--border-w) solid var(--border);
    border-radius: var(--radius);
    font-size: var(--fs-small);
    line-height: 1.6;
    color: var(--text);
    tab-size: 4;
}

pre code {
    display: block;
    min-width: max-content;
    padding: 0;
    font-size: inherit;
    color: inherit;
    background: none;
    border: 0;
    border-radius: 0;
    white-space: pre;
    overflow-wrap: normal;
    word-break: normal;
}

/* ==========================================================================
   9. Tables
   ========================================================================== */
table {
    display: block;
    width: 100%;
    max-width: 100%;
    margin: var(--s-5) 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-collapse: separate;
    border-spacing: 0;
    font-size: var(--fs-small);
    background-color: var(--surface);
    border: var(--border-w) solid var(--border);
    border-radius: var(--radius);
}

thead,
tbody,
tfoot {
    display: table-row-group;
}

tr {
    display: table-row;
}

th,
td {
    padding: var(--s-3) var(--s-4);
    text-align: left;
    vertical-align: top;
    border-bottom: var(--border-w) solid var(--border);
    overflow-wrap: anywhere;
    min-width: 96px;
}

th {
    background-color: var(--surface-2);
    color: var(--text-strong);
    font-weight: 600;
    white-space: nowrap;
}

tbody tr:nth-child(even) td {
    background-color: rgba(255, 255, 255, 0.012);
}

tbody tr:hover td {
    background-color: var(--surface-2);
}

tr:last-child td {
    border-bottom: 0;
}

@media (min-width: 768px) {
    table {
        display: table;
        width: 100%;
        overflow: visible;
    }

    thead {
        display: table-header-group;
    }

    tbody {
        display: table-row-group;
    }

    tfoot {
        display: table-footer-group;
    }
}

/* ==========================================================================
   10. Related materials & cards
   ========================================================================== */
.related-materials {
    margin-top: var(--s-7);
}

.section-header {
    display: flex;
    align-items: center;
    gap: var(--s-4);
    margin-bottom: var(--s-5);
}

.section-header h2,
.section-header h3 {
    flex-shrink: 0;
    font-size: 1.25rem;
    color: var(--text-strong);
}

.divider-line {
    flex-grow: 1;
    height: var(--border-w);
    background-color: var(--border);
}

.cards-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--s-4);
}

.card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: var(--s-5);
    background-color: var(--surface);
    border: var(--border-w) solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color var(--transition), background-color var(--transition), transform var(--transition);
}

.card:hover {
    transform: translateY(-2px);
    border-color: var(--border-strong);
    background-color: var(--surface-2);
}

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

.card-top {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: var(--s-2) var(--s-3);
    margin-bottom: var(--s-3);
    font-size: var(--fs-xs);
    color: var(--muted);
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    border: var(--border-w) solid rgba(217, 164, 65, 0.3);
    background-color: var(--accent-soft);
    color: var(--accent);
    font-size: var(--fs-xs);
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    line-height: 1.4;
}

.badge.accent-badge {
    background-color: var(--accent-2-soft);
    border-color: rgba(143, 191, 174, 0.3);
    color: var(--accent-2);
}

.date {
    color: var(--muted-2);
    font-variant-numeric: tabular-nums;
}

.card h4 {
    margin-bottom: var(--s-2);
    font-size: 1.0625rem;
    line-height: 1.4;
    color: var(--text-strong);
}

.card h4 a {
    color: inherit;
    text-decoration: none;
}

.card h4 a:hover {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-thickness
: 1px;
    text-underline-offset: 3px;
}

.card p {
    margin: 0;
    font-size: var(--fs-small);
    line-height: 1.6;
    color: var(--muted);
}

.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-3);
    margin-top: auto;
    padding-top: var(--s-4);
    font-size: var(--fs-xs);
    color: var(--muted-2);
}

.card-link {
    display: inline-flex;
    align-items: center;
    gap: var(--s-1);
    color: var(--accent);
    font-weight: 500;
    text-decoration: none;
}

.card-link::after {
    content: "→";
    transition: transform var(--transition);
}

.card-link:hover::after {
    transform: translateX(3px);
}

/* ==========================================================================
   11. Pagination
   ========================================================================== */
.pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: var(--s-2);
    margin: var(--s-7) 0 var(--s-5);
    list-style: none;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 var(--s-3);
    border: var(--border-w) solid var(--border);
    border-radius: var(--radius-sm);
    background-color: var(--surface);
    color: var(--text);
    font-size: var(--fs-small);
    text-decoration: none;
    transition: border-color var(--transition), color var(--transition), background-color var(--transition);
}

.pagination a:hover {
    border-color: var(--border-strong);
    color: var(--text-strong);
    background-color: var(--surface-2);
}

.pagination .is-current {
    border-color: var(--accent);
    color: var(--accent);
    background-color: var(--accent-soft);
    font-weight: 600;
}

.pagination .is-disabled {
    opacity: 0.4;
    pointer-events: none;
}

/* ==========================================================================
   12. Forms
   ========================================================================== */
input,
textarea,
select,
button {
    font: inherit;
    color: inherit;
}

input[type="text"],
input[type="email"],
input[type="search"],
input[type="password"],
textarea,
select {
    width: 100%;
    padding: var(--s-3) var(--s-4);
    background-color: var(--surface);
    border: var(--border-w) solid var(--border-strong);
    border-radius: var(--radius-sm);
    color: var(--text-strong);
    transition: border-color var(--transition), box-shadow var(--transition);
}

input::placeholder,
textarea::placeholder {
    color: var(--muted-2);
    opacity: 1;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

textarea {
    min-height: 120px;
    resize: vertical;
}

label {
    display: block;
    margin-bottom: var(--s-2);
    font-size: var(--fs-small);
    font-weight: 500;
    color: var(--text-strong);
}

.form-hint {
    margin-top: var(--s-2);
    font-size: var(--fs-xs);
    color: var(--muted-2);
}

.form-error {
    color: var(--danger);
    font-size: var(--fs-xs);
}

/* ==========================================================================
   13. Buttons
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--s-2);
    min-height: 40px;
    padding: 0 var(--s-5);
    border: var(--border-w) solid transparent;
    border-radius: var(--radius-sm);
    background-color: var(--surface-3);
    color: var(--text-strong);
    font-size: var(--fs-small);
    font-weight: 500;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    transition: background-color var(--transition), border-color var(--transition), color var(--transition);
}

.btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.btn:disabled,
.btn[aria-disabled="true"] {
    opacity: 0.5;
    cursor: not-allowed;
}

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

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

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

.btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* ==========================================================================
   14. Utilities
   ========================================================================== */
.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.text-center {
    text-align: center;
}

.text-muted {
    color: var(--muted);
}

.mt-0 { margin-top: 0 !important; }
.mb-0 { margin-bottom: 0 !important; }
.mt-auto { margin-top: auto !important; }
.hidden { display: none !important; }

/* ==========================================================================
   15. Responsive
   ========================================================================== */
@media (min-width: 640px) {
    .cards-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .cards-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: var(--s-5);
    }

    .section-header h2,
    .section-header h3 {
        font-size: 1.375rem;
    }
}

@media (max-width: 767px) {
    .pagination a,
    .pagination span {
        min-width: 32px;
        height: 32px;
    }

    .card {
        padding: var(--s-4);
    }
}

/* ==========================================================================
   16. Motion & print
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
    }

    .card:hover {
        transform: none;
    }
}

@media print {
    body {
        background: #fff;
        color: #000;
    }

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

    pre,
    blockquote,
    table,
    figure {
        break-inside: avoid;
    }

    .btn,
    .pagination,
    .site-header,
    .site-footer {
        display: none !important;
    }
}
===end file===
===end file===
===end file===
===end file===
===end file===
===end file===