/* =========================================================
   styles.css
   Palette: deep aubergine + violet + rose (full dark theme)
   Mobile-first.
   ========================================================= */

:root {
    /* --- Dark surfaces --- */
    --bg-950:        #08050f;
    --bg-900:        #0e0a18;
    --bg-800:        #150f26;
    --bg-700:        #1d1636;
    --bg-600:        #271e46;

    /* --- Text --- */
    --ink:           #f6f3ff;
    --text:          #cdc6e6;
    --muted:         #958db8;
    --faint:         #6e668f;

    /* --- Accents --- */
    --violet:        #9b7bff;
    --violet-400:    #c1adff;
    --violet-soft:     rgba(139, 92, 246, .12);
    --coral:         #ff6b8a;
    --coral-600:     #ff97ae;
    --coral-soft:    rgba(255, 107, 138, .14);
    --indigo:        #5b6cff;

    /* --- Lines & shadows --- */
    --border:        #261e42;
    --border-strong: #3a2f63;
    --shadow-sm:     0 1px 2px rgba(0, 0, 0, .35);
    --shadow-md:     0 14px 32px -16px rgba(0, 0, 0, .7);
    --shadow-lg:     0 28px 60px -28px rgba(0, 0, 0, .85);

    /* --- Radii --- */
    --r-sm: 8px;
    --r-md: 14px;
    --r-lg: 22px;
    --r-pill: 999px;

    /* --- Type --- */
    --font-sans: "Inter", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;

    /* --- Layout --- */
    --gutter: clamp(16px, 5vw, 32px);
    --container: 1180px;
    --header-h: 64px;
}

/* =========================================================
   Reset & base
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); color-scheme: dark; }
body, h1, h2, h3, h4, p, figure, blockquote, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg { max-width: 100%; display: block; }
img { height: auto; }
button { font: inherit; }

body {
    font-family: var(--font-sans);
    font-size: 17px;
    line-height: 1.72;
    color: var(--text);
    background: var(--bg-900);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

::selection { background: var(--violet); color: var(--bg-950); }

h1, h2, h3, h4 {
    color: var(--ink);
    font-weight: 750;
    line-height: 1.25;
    letter-spacing: -.015em;
    overflow-wrap: break-word;
}

a {
    color: var(--violet);
    text-decoration: none;
    transition: color .18s ease, background-color .18s ease, border-color .18s ease;
}
a:hover { color: var(--coral); text-decoration: underline; }
a:focus-visible, summary:focus-visible {
    outline: 2px solid var(--violet);
    outline-offset: 3px;
    border-radius: 4px;
}

/* =========================================================
   Header (sticky)
   ========================================================= */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(8, 5, 15, .88);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}
.header-inner {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 var(--gutter);
    min-height: var(--header-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); }
.logo:hover { color: #fff; text-decoration: none; }
.logo img { width: 38px; height: 38px; flex: 0 0 auto; }
.logo-word {
    font-weight: 800;
    font-size: 17px;
    letter-spacing: .2em;
    text-transform: uppercase;
    line-height: 1;
}

.main-nav { display: none; align-items: center; gap: 4px; }
.main-nav a {
    padding: 8px 14px;
    border-radius: var(--r-sm);
    color: var(--muted);
    font-size: 14px;
    font-weight: 600;
}
.main-nav a:hover { color: var(--ink); background: var(--bg-700); text-decoration: none; }
.main-nav a[aria-current] { color: var(--violet-400); background: var(--violet-soft); }

/* =========================================================
   Hero
   ========================================================= */
.hero {
    position: relative;
    color: var(--text);
    background: linear-gradient(115deg, #150c2b 0%, var(--bg-950) 62%);
    border-bottom: 1px solid var(--border);
    overflow: hidden;
}
/* open concentric rings, echoing the logo mark */
.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 900 900' fill='none' stroke='%239b7bff' stroke-width='3' stroke-linecap='round'%3E%3Cg transform='rotate(40 450 450)'%3E%3Ccircle cx='450' cy='450' r='100' stroke-dasharray='488.7 139.6' stroke-opacity='.45'/%3E%3Ccircle cx='450' cy='450' r='190' stroke-dasharray='928.6 265.2' stroke-opacity='.34'/%3E%3Ccircle cx='450' cy='450' r='280' stroke-dasharray='1368.4 390.9' stroke-opacity='.25'/%3E%3Ccircle cx='450' cy='450' r='370' stroke-dasharray='1808.2 516.6' stroke-opacity='.17'/%3E%3Ccircle cx='450' cy='450' r='440' stroke-dasharray='2150.4 614.2' stroke-opacity='.1'/%3E%3C/g%3E%3C/svg%3E") no-repeat right -240px center / 760px 760px;
    pointer-events: none;
}
.hero-inner {
    position: relative;
    max-width: var(--container);
    margin: 0 auto;
    padding: 28px var(--gutter) 56px;
    display: grid;
    gap: 32px;
}
.hero-content { min-width: 0; }

.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 22px;
    font-size: 13px;
    color: var(--muted);
}
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--ink); }
.breadcrumbs .sep { opacity: .5; }

.eyebrow {
    display: inline-block;
    margin-bottom: 16px;
    padding: 6px 12px;
    border-left: 3px solid var(--coral);
    background: var(--coral-soft);
    border-radius: 0 var(--r-sm) var(--r-sm) 0;
    color: var(--coral-600);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.article-title {
    color: #fff;
    font-size: clamp(28px, 6.2vw, 44px);
    line-height: 1.14;
    font-weight: 800;
    letter-spacing: -.025em;
    margin-bottom: 20px;
}
.article-title em { font-style: normal; color: var(--violet); }

.lead {
    font-size: clamp(16.5px, 3.3vw, 18px);
    line-height: 1.7;
    color: var(--text);
    max-width: 62ch;
}
.lead strong { color: #fff; font-weight: 650; }

.hero-visual {
    position: relative;
    border-radius: var(--r-md);
    overflow: hidden;
    border: 1px solid var(--border-strong);
    box-shadow: var(--shadow-lg), 0 0 0 6px rgba(139, 92, 246, .07);
    background: var(--bg-800);
}
.hero-visual img { width: 100%; aspect-ratio: 1200 / 630; object-fit: cover; }

/* =========================================================
   Layout
   ========================================================= */
main {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

.home-main { padding-top: 44px; }
.layout { display: grid; gap: 28px; align-items: start; }

/* --- Table of contents --- */
.toc {
    background: var(--bg-800);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 18px 20px;
    box-shadow: var(--shadow-sm);
}
.toc-title {
    margin-bottom: 10px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--violet);
}
.toc ol { counter-reset: toc; }
.toc li { counter-increment: toc; }
.toc a {
    display: flex;
    gap: 10px;
    padding: 7px 0;
    color: var(--text);
    font-size: 14.5px;
    line-height: 1.4;
    font-weight: 550;
}
.toc a::before {
    content: counter(toc, decimal-leading-zero);
    flex: 0 0 auto;
    color: var(--coral);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}
.toc a:hover { color: var(--violet-400); text-decoration: none; }

/* =========================================================
   Article body
   ========================================================= */
.content-body { min-width: 0; max-width: 780px; }
.content-body > * + * { margin-top: 18px; }

.content-body p { color: var(--text); }
.content-body a { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.content-body strong { color: var(--ink); }

.content-body h2 {
    position: relative;
    margin-top: 52px;
    padding-left: 18px;
    font-size: clamp(22px, 4.6vw, 30px);
}
.content-body h2::before {
    content: "";
    position: absolute;
    left: 0;
    top: .16em;
    bottom: .16em;
    width: 5px;
    border-radius: 3px;
    background: linear-gradient(180deg, var(--violet), var(--indigo));
}
.content-body h3 { margin-top: 32px; font-size: clamp(18px, 3.8vw, 22px); color: var(--violet-400); }

/* --- Info box --- */
.info-box {
    background: var(--bg-800);
    border: 1px solid var(--border);
    border-left: 3px solid var(--violet);
    border-radius: var(--r-md);
    padding: 20px 22px;
    box-shadow: var(--shadow-sm);
}
.info-box .list-lead {
    margin-bottom: 14px;
    font-weight: 700;
    color: var(--ink);
}
.info-box ul.cols { display: grid; gap: 0 32px; }
.info-box li {
    position: relative;
    padding-left: 22px;
    margin-bottom: 10px;
    font-size: 16px;
}
.info-box li:last-child { margin-bottom: 0; }
.info-box li::before {
    content: "";
    position: absolute;
    left: 0;
    top: .6em;
    width: 8px;
    height: 8px;
    background: var(--violet);
    border-radius: 2px;
    transform: rotate(45deg);
    box-shadow: 0 0 0 3px var(--violet-soft);
}

/* --- Steps --- */
.steps { counter-reset: step; display: grid; gap: 12px; }
.steps li {
    counter-increment: step;
    position: relative;
    padding: 16px 18px 16px 62px;
    background: var(--bg-800);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-sm);
}
.steps li::before {
    content: counter(step);
    position: absolute;
    left: 16px;
    top: 14px;
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--violet), var(--indigo));
    color: var(--bg-950);
    font-weight: 800;
    font-size: 15px;
}
.steps strong { display: block; color: var(--ink); }

/* --- Table --- */
.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    background: var(--bg-800);
    box-shadow: var(--shadow-sm);
}
table { width: 100%; min-width: 520px; border-collapse: collapse; font-size: 15px; }
thead { background: var(--bg-600); }
th {
    padding: 12px 16px;
    text-align: left;
    color: var(--ink);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    white-space: nowrap;
}
td { padding: 13px 16px; vertical-align: top; border-top: 1px solid var(--border); }
td:first-child { font-weight: 650; color: var(--ink); }
tbody tr:hover { background: var(--bg-700); }

/* --- Inner pages --- */
.hero--page .hero-inner { display: block; padding-top: 28px; padding-bottom: 56px; }
.hero--page .article-title { max-width: 24ch; font-size: clamp(28px, 5.4vw, 42px); }
.page-main { padding-top: 44px; }
.page-main .content-body { margin: 0 auto; }
.page-main .related-section { margin-top: 64px; }
.updated { color: var(--muted); font-size: 14px; }

/* --- Tiles (2-column cards) --- */
.tile-list { display: grid; gap: 12px; }
.tile-list li {
    position: relative;
    padding: 20px 20px 18px 24px;
    background: var(--bg-800);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-sm);
    font-size: 16px;
    line-height: 1.6;
}
.tile-list li::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    border-radius: var(--r-md) 0 0 var(--r-md);
    background: linear-gradient(180deg, var(--violet), var(--coral));
}

/* --- Quote --- */
blockquote {
    position: relative;
    margin-top: 30px;
    padding: 30px 28px 26px 34px;
    background: linear-gradient(160deg, var(--bg-700), var(--bg-800));
    border: 1px solid var(--border-strong);
    border-radius: var(--r-lg);
    color: var(--ink);
    font-size: clamp(17px, 3.4vw, 20px);
    line-height: 1.6;
    box-shadow: var(--shadow-md);
    overflow: hidden;
}
blockquote::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 6px;
    background: linear-gradient(180deg, var(--coral), var(--violet));
}
blockquote::after {
    content: "\201C";
    position: absolute;
    top: -6px;
    right: 22px;
    font-size: 96px;
    line-height: 1;
    font-weight: 800;
    color: var(--violet);
    opacity: .14;
    pointer-events: none;
}
.content-body blockquote p { color: var(--ink); }
blockquote cite {
    display: block;
    margin-top: 14px;
    color: var(--coral-600);
    font-style: normal;
    font-size: 15px;
    font-weight: 700;
}

/* =========================================================
   Related cards
   ========================================================= */
.related-section { margin-top: 72px; }
.section-header { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; }
.section-header h2 {
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--violet);
    white-space: nowrap;
}
.divider-line { flex: 1; height: 1px; background: linear-gradient(90deg, var(--border-strong), transparent); }

.cards-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
.card {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 0;
    background: var(--bg-800);
    border: 1px solid var(--border);
    border-bottom: 3px solid var(--violet);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease, background-color .2s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--border-strong); border-bottom-color: var(--coral); background: var(--bg-700); }
.card-body { display: flex; flex-direction: column; flex: 1; padding: 20px 22px 18px; }
.card h3 { margin: 12px 0 8px; font-size: 18px; line-height: 1.35; }
.card h3 a { color: var(--ink); }
.card h3 a::after { content: ""; position: absolute; inset: 0; }
.card h3 a:hover { color: var(--violet-400); text-decoration: none; }
.card p { flex: 1; margin-bottom: 16px; font-size: 15px; line-height: 1.6; color: var(--muted); }

.badge {
    align-self: flex-start;
    padding: 3px 11px;
    border-radius: var(--r-sm);
    background: var(--violet-soft);
    color: var(--violet-400);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.card-status { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--coral);
    box-shadow: 0 0 0 3px var(--coral-soft);
}

/* =========================================================
   Footer
   ========================================================= */
footer {
    margin-top: 72px;
    color: var(--muted);
    background: var(--bg-950);
    border-top: 1px solid var(--border);
    position: relative;
}
footer::before {
    content: "";
    position: absolute;
    top: -1px;
    left: 0;
    width: 180px;
    height: 3px;
    background: linear-gradient(90deg, var(--violet), var(--coral));
}
.footer-inner {
    max-width: var(--container);
    margin: 0 auto;
    padding: 44px var(--gutter) 28px;
    display: grid;
    gap: 32px;
}
.footer-brand { display: flex; flex-direction: column; gap: 12px; }
.footer-brand .logo { margin-bottom: 4px; }
.footer-brand .slogan { color: var(--muted); font-weight: 500; font-size: 15px; }

.footer-col h3 {
    margin-bottom: 12px;
    color: var(--ink);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .16em;
    text-transform: uppercase;
}
.footer-col li + li { margin-top: 8px; }
.footer-col a, .footer-col span { color: var(--muted); font-size: 14px; }
.footer-col a:hover { color: var(--violet-400); }

.footer-bottom {
    max-width: var(--container);
    margin: 0 auto;
    padding: 20px var(--gutter) 34px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 14px;
    font-size: 13px;
}
.copy { color: var(--faint); font-size: 12.5px; }

/* =========================================================
   ≥ 640px
   ========================================================= */
@media (min-width: 640px) {
    .cards-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .tile-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .info-box ul.cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* =========================================================
   ≥ 1000px (navigation fits in header)
   ========================================================= */
@media (min-width: 1000px) {
    .main-nav { display: flex; }
}

/* =========================================================
   ≥ 900px
   ========================================================= */
@media (min-width: 900px) {
    /* image on the left, text on the right */
    .hero-inner { grid-template-columns: .95fr 1.05fr; gap: 56px; align-items: center; padding-top: 40px; padding-bottom: 72px; }
    .hero-visual { order: -1; }

    /* table of contents moves to the right column */
    .layout { grid-template-columns: minmax(0, 1fr) 270px; gap: 56px; }
    .layout > .content-body { grid-column: 1; grid-row: 1; }
    .layout > .toc { grid-column: 2; grid-row: 1; position: sticky; top: calc(var(--header-h) + 20px); }

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

    .footer-inner { grid-template-columns: 1fr 1.2fr; gap: 48px; }
}

/* =========================================================
   Small phones
   ========================================================= */
@media (max-width: 420px) {
    body { font-size: 16px; }
    .logo img { width: 32px; height: 32px; }
    .logo-word { font-size: 15px; letter-spacing: .14em; }
    .steps li { padding-left: 56px; }
    blockquote { padding: 26px 20px 22px 26px; }
}

/* =========================================================
   Print & motion
   ========================================================= */
@media print {
    body { background: #fff; color: #000; }
    .site-header, .toc, .related-section, footer { display: none; }
    .hero { background: none; color: #000; }
    .article-title, .lead { color: #000; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition-duration: .001ms !important; animation-duration: .001ms !important; }
    .card:hover { transform: none; }
}
