/* styles.css — f-start.com.ua — "Lavender Mist & Plum Ink" editorial/tech light theme */

:root {
    /* =============================================
       TEMPLATE VARIABLES (names preserved)
       ============================================= */
    --bg: #f5f2f6;
    --surface: #ffffff;
    --card: #faf8fb;
    --text: #251d29;
    --muted: #5d5462;
    --accent: #5a2760;
    --accent2: #8a5418;

    --radius: 14px;
    --font-main: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;

    --space-sm: clamp(8px, 2vw, 12px);
    --space-md: clamp(16px, 3vw, 24px);
    --space-lg: clamp(32px, 5vw, 48px);
    --container: 1200px;

    /* =============================================
       EXTENDED PALETTE
       ============================================= */
    --bg-deep: #ece6ee;
    --text-soft: #3a3140;
    --accent-hover: #43194a;
    --accent-soft: rgba(90, 39, 96, 0.08);
    --accent-softer: rgba(90, 39, 96, 0.045);
    --accent-line: rgba(90, 39, 96, 0.22);
    --accent2-soft: rgba(138, 84, 24, 0.09);
    --accent2-line: rgba(138, 84, 24, 0.28);
    --warn: #8f3e1e;
    --warn-soft: rgba(143, 62, 30, 0.09);

    --border: rgba(37, 29, 41, 0.1);
    --border-soft: rgba(37, 29, 41, 0.065);
    --code-bg: #f0ebf2;
    --code-border: rgba(90, 39, 96, 0.12);

    --shadow-sm: 0 1px 2px rgba(45, 25, 50, 0.04), 0 1px 1px rgba(45, 25, 50, 0.03);
    --shadow-md: 0 6px 22px -10px rgba(45, 25, 50, 0.14), 0 2px 6px rgba(45, 25, 50, 0.04);
    --shadow-lg: 0 18px 40px -18px rgba(45, 25, 50, 0.22);

    --focus: 0 0 0 3px #ffffff, 0 0 0 5px var(--accent);

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

    --fs-base: 1rem;
    --fs-sm: 0.875rem;
    --fs-xs: 0.75rem;
    --lh-body: 1.7;
    --lh-head: 1.3;
    --measure: 70ch;

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

    /* Radii */
    --r-xs: 4px;
    --r-sm: 8px;
    --r-md: 14px;
    --r-pill: 999px;

    --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
    --dur: 0.2s;
}

/* =============================================
   RESET & BASE
   ============================================= */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 100%;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: 96px;
}

body {
    min-height: 100vh;
    overflow-x: hidden;
    background-color: var(--bg);
    background-image:
        radial-gradient(rgba(90, 39, 96, 0.05) 1px, transparent 1px),
        linear-gradient(180deg, #f8f5f9 0%, var(--bg) 420px);
    background-size: 22px 22px, 100% 100%;
    background-attachment: fixed, scroll;
    color: var(--text);
    font-family: var(--font-main);
    font-size: 1.0625rem;
    font-weight: 400;
    line-height: var(--lh-body);
    overflow-wrap: break-word;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

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

img,
video {
    height: auto;
}

iframe {
    border: 0;
}

svg {
    flex-shrink: 0;
}

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

a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--dur) var(--ease), background-color var(--dur) var(--ease),
        border-color var(--dur) var(--ease), text-decoration-color var(--dur) var(--ease);
}

a:hover {
    color: var(--accent-hover);
}

a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: var(--r-xs);
}

ul,
ol {
    list-style: none;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-head);
    font-weight: 700;
    line-height: var(--lh-head);
    letter-spacing: -0.012em;
    color: var(--text);
    overflow-wrap: break-word;
    hyphens: auto;
}

p {
    overflow-wrap: break-word;
}

strong,
b {
    font-weight: 650;
}

hr {
    border: 0;
    height: 1px;
    background: var(--border);
    margin: var(--s-6) 0;
}

::selection {
    background: rgba(90, 39, 96, 0.16);
    color: var(--text);
}

/* =============================================
   HEADER
   ============================================= */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(245, 242, 246, 0.9);
    backdrop-filter: saturate(140%) blur(12px);
    -webkit-backdrop-filter: saturate(140%) blur(12px);
    border-bottom: 1px solid var(--border-soft);
}

.site-header::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 2px;
    background: linear-gradient(90deg, var(--accent) 0, var(--accent) 64px, transparent 64px);
    pointer-events: none;
}

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

.logo-name {
    display: inline-flex;
    align-items: center;
    gap: var(--s-2);
    min-height: 44px;
    font-family: var(--font-head);
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text);
}

.logo-name::before {
    content: "";
    width: 10px;
    height: 10px;
    border-radius: 3px;
    background: var(--accent);
    box-shadow: 4px 4px 0 var(--accent2-line);
    flex-shrink: 0;
}

a.logo-name:hover,
.logo-name a:hover {
    color: var(--accent);
}

.main-nav {
    order: 3;
    flex: 1 0 100%;
    display: flex;
    gap: var(--s-1);
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    margin: 0 calc(var(--gutter) * -1);
    padding: 0 var(--gutter) var(--s-1);
    font-family: var(--font-mono);
    font-size: var(--fs-xs);
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.main-nav::-webkit-scrollbar {
    display: none;
}

.main-nav a {
    position: relative;
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 var(--s-3);
    white-space: nowrap;
    color: var(--muted);
    border-radius: var(--r-sm);
}

.main-nav a::after {
    content: "";
    position: absolute;
    left: var(--s-3);
    right: var(--s-3);
    bottom: 8px;
    height: 2px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--dur) var(--ease);
}

.main-nav a:hover,
.main-nav a[aria-current="page"],
.main-nav a.active {
    color: var(--accent);
    background: var(--accent-softer);
}

.main-nav a:hover::after,
.main-nav a[aria-current="page"]::after,
.main-nav a.active::after {
    transform: scaleX(1);
}

.lang-switcher {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 3px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-pill);
    font-family: var(--font-mono);
    font-size: var(--fs-xs);
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.lang-switcher a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 38px;
    padding: 0 var(--s-2);
    color: var(--muted);
    border-radius: var(--r-pill);
}

.lang-switcher a:hover {
    color: var(--accent);
    background: var(--accent-soft);
}

.lang-switcher a.active {
    color: #ffffff;
    background: var(--accent);
}

/* =============================================
   MAIN LAYOUT
   ============================================= */
main {
    max-width: var(--container);
    margin: 0 auto;
    padding: var(--s-6) var(--gutter) var(--s-7);
}

/* =============================================
   HERO
   ============================================= */
.hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--s-5);
    align-items: center;
    margin-bottom: var(--s-7);
}

.hero-visual {
    position: relative;
    aspect-ratio: 16 / 10;
    border-radius: var(--radius);
    overflow: hidden;
    background:
        linear-gradient(135deg, rgba(90, 39, 96, 0.9), rgba(138, 84, 24, 0.55)),
        var(--bg-deep);
    border: 1px solid var(--border-soft);
    box-shadow: var(--shadow-md);
}

.hero-visual::after {
    content: "";
    position: absolute;
    inset: 10px;
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: calc(var(--radius) - 6px);
    pointer-events: none;
}

.hero-visual img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    transition: transform 0.6s var(--ease);
}

.hero-visual:hover img {
    transform: scale(1.02);
}

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

.hero-tag {
    display: inline-flex;
    align-items: center;
    gap: var(--s-2);
    width: fit-content;
    max-width: 100%;
    padding: 5px 12px;
    font-family: var(--font-mono);
    font-size: var(--fs-xs);
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent2);
    background: var(--accent2-soft);
    border: 1px solid var(--accent2-line);
    border-radius: var(--r-xs);
}

.hero-tag::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}

.article-title {
    font-family: var(--font-head);
    font-size: clamp(1.25rem, 1.05rem + 1vw, 1.45rem);
    font-weight: 800;
    line-height: 1.3;
    letter-spacing: -0.018em;
    color: var(--text);
    max-width: 32ch;
    overflow-wrap: break-word;
    hyphens: auto;
    text-wrap: balance;
}

.lead {
    max-width: 60ch;
    font-family: var(--font-serif);
    font-size: 1.0625rem;
    font-weight: 400;
    line-height: 1.7;
    color: var(--text-soft);
}

.meta-panel {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: var(--s-3);
    padding-top: var(--s-4);
    border-top: 1px dashed var(--border);
}

.meta-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    padding: var(--s-2) var(--s-3);
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--r-sm);
}

.meta-item .label {
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.meta-item .value {
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--text);
    overflow-wrap: anywhere;
}

.meta-divider {
    display: none;
}

/* =============================================
   CONTENT WRAPPER
   ============================================= */
.content-wrapper {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--s-6);
    align-items: start;
    margin-bottom: var(--s-7);
}

.author-sidebar {
    order: -1;
}

/* =============================================
   ARTICLE CONTENT
   ============================================= */
.content-body {
    min-width: 0;
    max-width: var(--measure);
    width: 100%;
    margin: 0 auto;
}

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

.content-body p {
    margin-bottom: 1.25em;
    font-size: 1.0625rem;
    font-weight: 400;
    line-height: 1.72;
    color: var(--text-soft);
}

.content-body a {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-decoration-color: var(--accent-line);
    text-underline-offset: 0.2em;
    overflow-wrap: anywhere;
}

.content-body a:hover {
    color: var(--accent-hover);
    text-decoration-thickness: 2px;
    text-decoration-color: currentColor;
    background: var(--accent-softer);
}

.content-body h2 {
    position: relative;
    margin: 2.2em 0 0.7em;
    padding-top: var(--s-4);
    font-size: clamp(1.15rem, 1rem + 0.7vw, 1.3rem);
    font-weight: 750;
    line-height: 1.32;
    color: var(--accent);
    border-top: 1px solid var(--border);
}

.content-body h2::before {
    content: "";
    position: absolute;
    top: -1px;
    left: 0;
    width: 40px;
    height: 3px;
    background: var(--accent2);
    border-radius: 0 0 2px 2px;
}

.content-body h3 {
    margin: 1.8em 0 0.6em;
    font-size: clamp(1.05rem, 0.98rem + 0.4vw, 1.15rem);
    font-weight: 700;
    line-height: 1.35;
    color: var(--text);
}

.content-body h4 {
    margin: 1.6em 0 0.5em;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
}

.content-body ul,
.content-body ol {
    margin: 0 0 1.4em;
    padding-left: 1.4em;
    color: var(--text-soft);
}

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

.content-body ul > li {
    position: relative;
}

.content-body ul > li::before {
    content: "";
    position: absolute;
    left: -1.05em;
    top: 0.72em;
    width: 6px;
    height: 6px;
    border-radius: 2px;
    background: var(--accent);
    transform: rotate(45deg);
}

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

.content-body ol > li::marker {
    color: var(--accent);
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 0.9em;
}

.content-body li {
    margin-bottom: 0.5em;
    line-height: 1.68;
}

.content-body li > ul,
.content-body li > ol {
    margin-top: 0.5em;
    margin-bottom: 0.25em;
}

/* Blockquote */
.content-body blockquote {
    position: relative;
    margin: 2em 0;
    padding: var(--s-4) var(--s-4) var(--s-4) var(--s-5);
    background: linear-gradient(90deg, var(--accent-soft), var(--accent-softer) 60%, transparent);
    border-left: 3px solid var(--accent);
    border-radius: 0 var(--r-md) var(--r-md) 0;
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 1.0625rem;
    line-height: 1.65;
    color: var(--text);
}

.content-body blockquote p {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    margin-bottom: 0.6em;
}

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

.content-body blockquote cite {
    display: block;
    margin-top: var(--s-3);
    font-family: var(--font-mono);
    font-style: normal;
    font-size: var(--fs-xs);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
}

.content-body blockquote cite::before {
    content: "— ";
    color: var(--accent2);
}

/* Code */
code,
kbd,
samp {
    font-family: var(--font-mono);
    font-size: 0.875em;
}

:not(pre) > code {
    padding: 0.12em 0.4em;
    background: var(--code-bg);
    border: 1px solid var(--code-border);
    border-radius: var(--r-xs);
    color: var(--accent-hover);
    overflow-wrap: anywhere;
    word-break: break-word;
}

pre {
    margin: 1.5em 0;
    padding: var(--s-4);
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    background: var(--code-bg);
    border: 1px solid var(--code-border);
    border-left: 3px solid var(--accent2);
    border-radius: var(--r-sm);
    font-family: var(--font-mono);
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--text);
    tab-size: 4;
}

pre code {
    padding: 0;
    background: none;
    border: 0;
    font-size: inherit;
    color: inherit;
    white-space: pre;
}

kbd {
    padding: 0.1em 0.4em;
    background: var(--surface);
    border: 1px solid var(--border);
    border-bottom-width: 2px;
    border-radius: var(--r-xs);
}

/* Tables */
.content-body table,
table {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 1.5em 0;
    border-collapse: collapse;
    border-spacing: 0;
    font-size: 0.9375rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
}

th,
td {
    padding: 10px 14px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--border-soft);
    min-width: 120px;
}

th {
    font-family: var(--font-mono);
    font-size: var(--fs-xs);
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--accent);
    background: var(--card);
    border-bottom: 1px solid var(--accent-line);
    white-space: nowrap;
}

tbody tr:nth-child(even) {
    background: var(--accent-softer);
}

tbody tr:hover {
    background: var(--accent-soft);
}

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

/* Figures */
.content-body figure {
    margin: 1.8em 0;
}

.content-body figure img,
.content-body img {
    border-radius: var(--r-sm);
    border: 1px solid var(--border-soft);
}

.content-body figcaption {
    margin-top: var(--s-2);
    font-size: var(--fs-sm);
    color: var(--muted);
}

/* Info Box */
.info-box {
    position: relative;
    margin: 1.5em 0 2em;
    padding: var(--s-5) var(--s-4) var(--s-4);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.info-box::before {
    content: "";
    position: absolute;
    top: 0;
    left: var(--s-4);
    right: var(--s-4);
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--accent2));
    border-radius: 0 0 3px 3px;
}

.info-box ul {
    display: flex;
    flex-direction: column;
    gap: var(--s-3);
    margin: 0;
    padding: 0;
}

.info-box ul li {
    position: relative;
    margin: 0;
    padding-left: 26px;
    font-size: 0.98rem;
    font-weight: 400;
    line-height: 1.65;
    color: var(--text-soft);
}

.info-box ul li::before {
    content: "";
    position: absolute;
    left: 2px;
    top: 0.45em;
    width: 14px;
    height: 14px;
    border-radius: 4px;
    background: var(--accent-soft);
    border: 1px solid var(--accent-line);
    transform: none;
}

.info-box ul li::after {
    content: "";
    position: absolute;
    left: 7px;
    top: calc(0.45em + 4px);
    width: 4px;
    height: 6px;
    border: solid var(--accent);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.info-box ul li strong {
    color: var(--text);
    font-weight: 650;
}

/* =============================================
   AUTHOR SIDEBAR
   ============================================= */
.author-sidebar {
    display: flex;
    flex-direction: column;
    gap: var(--s-4);
    min-width: 0;
}

.author-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.author-avatar {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
}

.author-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
}

.author-info {
    display: flex;
    flex-direction: column;
    gap: var(--s-2);
    padding: var(--s-4);
    min-width: 0;
}

.author-label {
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent2);
}

.author-name {
    font-family: var(--font-head);
    font-size: 1.125rem;
    font-weight: 750;
    line-height: 1.3;
    color: var(--text);
}

.author-bio {
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--muted);
}

.author-socials {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-2);
    margin-top: var(--s-1);
    padding-top: var(--s-3);
    border-top: 1px solid var(--border-soft);
}

.author-socials a,
.footer-socials a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    color: var(--muted);
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
}

.author-socials a:hover,
.footer-socials a:hover {
    color: #ffffff;
    background: var(--accent);
    border-color: var(--accent);
}

.author-socials svg,
.footer-socials svg {
    width: 18px;
    height: 18px;
}

/* TOC */
.toc-card {
    padding: var(--s-4);
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.toc-title {
    display: flex;
    align-items: center;
    gap: var(--s-2);
    margin-bottom: var(--s-3);
    font-family: var(--font-mono);
    font-size: var(--fs-xs);
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
}

.toc-title::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border);
}

.toc-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    list-style: none;
    counter-reset: toc-counter;
}

.toc-list li {
    counter-increment: toc-counter;
    display: flex;
    align-items: baseline;
    gap: var(--s-2);
    font-size: 0.9375rem;
    color: var(--muted);
}

.toc-list li::before {
    content: counter(toc-counter, decimal-leading-zero);
    min-width: 22px;
    font-family: var(--font-mono);
    font-size: var(--fs-xs);
    font-weight: 600;
    color: var(--accent2);
}

.toc-list li a {
    display: flex;
    align-items: center;
    flex: 1;
    min-height: 44px;
    padding: 4px var(--s-2);
    line-height: 1.4;
    color: var(--text-soft);
    border-radius: var(--r-xs);
    border-left: 2px solid transparent;
    overflow-wrap: anywhere;
}

.toc-list li a:hover {
    color: var(--accent);
    background: var(--accent-soft);
    border-left-color: var(--accent);
}

/* =============================================
   RELATED SECTION
   ============================================= */
.related-section {
    margin-top: var(--s-7);
    padding-top: var(--s-6);
    border-top: 1px solid var(--border);
}

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

.section-header h3 {
    font-family: var(--font-head);
    font-size: clamp(1.1rem, 1rem + 0.6vw, 1.3rem);
    font-weight: 750;
    color: var(--text);
    white-space: normal;
    min-width: 0;
}

.decoder-line {
    flex: 1 1 40px;
    min-width: 24px;
    height: 6px;
    background-image: repeating-linear-gradient(90deg, var(--accent-line) 0 6px, transparent 6px 10px);
    background-size: 100% 1px;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.9;
}

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

.card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: var(--s-3);
    min-width: 0;
    padding: var(--s-4);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease),
        border-color var(--dur) var(--ease);
}

.card::before {
    content: "";
    position: absolute;
    top: -1px;
    left: var(--s-4);
    width: 28px;
    height: 3px;
    background: var(--accent);
    border-radius: 0 0 3px 3px;
    transition: width var(--dur) var(--ease);
}

.card:hover {
    transform: translateY(-2px);
    border-color: var(--accent-line);
    box-shadow: var(--shadow-lg);
}

.card:hover::before {
    width: 56px;
}

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

.card-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--s-2);
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--accent);
    background: var(--accent-soft);
    border: 1px solid var(--accent-line);
    border-radius: var(--r-xs);
}

.badge.warning {
    color: var(--warn);
    background: var(--warn-soft);
    border-color: rgba(143, 62, 30, 0.25);
}

.card h4 {
    font-family: var(--font-head);
    font-size: 1.0625rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--text);
}

.card h4 a {
    color: inherit;
}

.card h4 a:hover {
    color: var(--accent);
}

.card p {
    flex-grow: 1;
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--muted);
}

.card-status {
    display: flex;
    align-items: center;
    gap: var(--s-2);
    margin-top: auto;
    padding-top: var(--s-3);
    border-top: 1px dashed var(--border);
    font-family: var(--font-mono);
    font-size: var(--fs-xs);
    letter-spacing: 0.02em;
    color: var(--muted);
}

.status-dot {
    display: inline-block;
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent2);
    box-shadow: 0 0 0 3px var(--accent2-soft);
}

/* =============================================
   FOOTER
   ============================================= */
footer {
    margin-top: var(--s-7);
    background: var(--surface);
    border-top: 1px solid var(--border);
}

.footer-inner {
    max-width: var(--container);
    margin: 0 auto;
    padding: var(--s-6) var(--gutter) var(--s-5);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--s-5);
}

.footer-left {
    display: flex;
    flex-direction: column;
    gap: var(--s-1);
}

.footer-left .brand {
    font-family: var(--font-head);
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text);
}

.footer-left .copy {
    font-size: var(--fs-sm);
    color: var(--muted);
}

.footer-nav {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-1) var(--s-2);
    font-family: var(--font-mono);
    font-size: var(--fs-xs);
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.footer-nav a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 var(--s-2);
    color: var(--muted);
    border-radius: var(--r-xs);
    text-decoration: underline;
    text-decoration-color: transparent;
    text-underline-offset: 0.3em;
}

.footer-nav a:hover {
    color: var(--accent);
    text-decoration-color: var(--accent-line);
}

.footer-socials {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--s-2);
}

.footer-bottom {
    max-width: var(--container);
    margin: 0 auto;
    padding: var(--s-4) var(--gutter) var(--s-5);
    border-top: 1px solid var(--border-soft);
    display: flex;
    flex-direction: column;
    gap: var(--s-1);
}

.footer-bottom p {
    font-size: var(--fs-xs);
    line-height: 1.55;
    letter-spacing: 0.02em;
    color: var(--muted);
}

/* =============================================
   BREAKPOINT ~480px
   ============================================= */
@media (min-width: 480px) {
    :root {
        --gutter: 20px;
    }

    .hero-visual {
        aspect-ratio: 16 / 9;
    }

    .author-card {
        grid-template-columns: 160px minmax(0, 1fr);
    }

    .author-avatar {
        aspect-ratio: auto;
        height: 100%;
        min-height: 180px;
    }

    .meta-divider {
        display:
inline-block;
    }

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

    .card::before {
        left: var(--s-5);
    }

    .footer-bottom {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-between;
        gap: var(--s-2) var(--s-4);
    }
}

/* =============================================
   BREAKPOINT ~640px
   ============================================= */
@media (min-width: 640px) {
    .cards-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: var(--s-5);
    }

    .author-card {
        grid-template-columns: 180px minmax(0, 1fr);
    }

    .footer-inner {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
    }

    .footer-nav {
        justify-content: center;
    }
}

/* =============================================
   BREAKPOINT ~768px
   ============================================= */
@media (min-width: 768px) {
    :root {
        --gutter: 28px;
    }

    .hero-visual {
        aspect-ratio: 21 / 9;
    }

    .section-header {
        gap: var(--s-5);
    }

    .related-section {
        margin-top: var(--s-8, 96px);
    }
}

/* =============================================
   BREAKPOINT ~1024px
   ============================================= */
@media (min-width: 1024px) {
    :root {
        --gutter: 32px;
    }

    .cards-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .footer-inner {
        flex-wrap: nowrap;
    }

    .toc-list li a {
        min-height: 36px;
    }
}

/* =============================================
   BREAKPOINT ~1280px
   ============================================= */
@media (min-width: 1280px) {
    :root {
        --gutter: 40px;
    }

    .cards-grid {
        gap: var(--s-6);
    }
}

/* =============================================
   HOVER-CAPABLE DEVICES ONLY
   ============================================= */
@media (hover: none) {
    .card:hover {
        transform: none;
        box-shadow: var(--shadow-sm);
        border-color: var(--border);
    }

    .card:hover::before {
        width: 28px;
    }
}

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

    .card:hover {
        transform: none;
    }
}

/* =============================================
   PRINT
   ============================================= */
@media print {
    footer,
    .footer-socials,
    .related-section,
    .decoder-line {
        display: none !important;
    }

    body {
        background: #fff;
        color: #000;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ccc;
        break-inside: avoid;
    }

    a {
        color: #000;
        text-decoration: underline;
    }
}
===end file===
===end file===
===end file===
===end file===
===end file===
===end file===