/* Fintech Horizon — pastel palette taken from cover3:
   powder-aqua shirt, cream table, sand/wood shelf, soft concrete grey. */
:root {
    --bg: #f6f1e7;
    --bg-soft: #fbf8f2;
    --surface: #ffffff;
    --aqua: #cfe7ec;
    --aqua-mid: #a9d3dc;
    --aqua-deep: #5e8f9b;
    --sand: #efe3cf;
    --sand-mid: #e3cfb1;
    --wood: #b98d64;
    --blush: #f1ddd5;
    --stone: #e4e1dc;
    --ink: #2f3b42;
    --ink-soft: #5b6870;
    --line: #e6ddcf;
    --radius: 20px;
    --shadow: 0 18px 40px -22px rgba(64, 86, 96, .35);
    --header-h: 76px;
    --serif: "Lora", Georgia, "Times New Roman", serif;
    --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 16px);
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    background-image:
        radial-gradient(900px 500px at 100% -10%, rgba(169, 211, 220, .35), transparent 70%),
        radial-gradient(700px 420px at -10% 30%, rgba(239, 227, 207, .7), transparent 70%);
    background-attachment: fixed;
    color: var(--ink);
    font: 400 17px/1.75 var(--sans);
    overflow-x: hidden;
}

img { display: block; max-width: 100%; }
a { color: var(--aqua-deep); }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--aqua-mid); outline-offset: 3px; border-radius: 6px; }

.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 24px; }

/* ---------- Header ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(246, 241, 231, .88);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}
.header-inner {
    min-height: var(--header-h);
    display: flex;
    align-items: center;
    gap: 28px;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); flex-shrink: 0; }
.brand-mark { width: 40px; height: 40px; flex-shrink: 0; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font: 700 19px/1.1 var(--serif); letter-spacing: .01em; }
.brand-sub { font-size: 12px; color: var(--ink-soft); }

.main-nav { display: flex; gap: 6px; margin-left: auto; }
.main-nav a, .footer-nav a, .link-btn {
    padding: 8px 14px;
    border-radius: 999px;
    color: var(--ink);
    text-decoration: none;
    font: 500 15px/1.3 var(--sans);
    transition: background-color .2s, color .2s;
}
.main-nav a:hover, .footer-nav a:hover, .link-btn:hover { background: var(--aqua); color: var(--ink); }

.lang-switcher {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 4px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 999px;
    font: 600 13px/1 var(--sans);
}
.lang-switcher a {
    padding: 7px 10px;
    border-radius: 999px;
    color: var(--ink-soft);
    text-decoration: none;
}
.lang-switcher a:hover { color: var(--ink); background: var(--sand); }
.lang-switcher a.active { background: var(--aqua-mid); color: var(--ink); }
.lang-switcher .sep { color: var(--stone); font-weight: 400; }

/* ---------- Article ---------- */
.article { padding-top: 36px; padding-bottom: 72px; }

.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 22px; padding: 0; font-size: 14px; color: var(--ink-soft); }
.breadcrumbs li + li::before { content: "›"; margin-right: 8px; color: var(--wood); }
.breadcrumbs a { color: var(--ink-soft); text-decoration: none; }
.breadcrumbs a:hover { color: var(--aqua-deep); text-decoration: underline; }

/* Framed images: the frame keeps the exact aspect ratio of the file,
   so pictures are never stretched and stay centered. */
.frame {
    margin: 0 auto;
    padding: 12px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: calc(var(--radius) + 6px);
    box-shadow: var(--shadow);
}
.frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    border-radius: var(--radius);
    background: var(--aqua);
}
.frame--portrait { width: 100%; }
.frame--portrait img { aspect-ratio: 2 / 3; }
.frame--wide { width: 100%; }
.frame--wide img { aspect-ratio: 3 / 2; }

/* Hero: title and lead on the left, image with the author card on the right. */
.hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 32px 64px;
    align-items: stretch;
    margin: 8px 0 64px;
    padding-bottom: 56px;
    border-bottom: 1px solid var(--line);
}
.hero--portrait { grid-template-columns: minmax(0, 1fr) minmax(0, 440px); }
/* Text starts level with the top of the photo; the author card sits level with its bottom. */
.hero-text { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; padding-top: 16px; }
.hero-text .subtitle { margin-bottom: 32px; }
.hero-text .byline { margin-top: auto; }
.article-header.hero--wide h1 { font-size: clamp(28px, 3vw, 42px); line-height: 1.2; }
.hero-media { align-self: start; min-width: 0; margin: 0; }
.kicker {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 999px;
    background: var(--sand);
    color: #7b5c40;
    font: 600 12px/1.2 var(--sans);
    letter-spacing: .08em;
    text-transform: uppercase;
}
.article-header h1 {
    margin: 20px 0 22px;
    font: 700 clamp(30px, 4vw, 52px)/1.15 var(--serif);
    letter-spacing: -.01em;
    color: var(--ink);
    overflow-wrap: break-word;
}
.subtitle {
    margin: 0;
    padding-left: 20px;
    border-left: 3px solid var(--sand-mid);
    font: 500 clamp(18px, 1.8vw, 22px)/1.6 var(--serif);
    color: var(--ink-soft);
}

.byline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 18px;
    padding: 16px 20px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.avatar {
    width: 52px;
    height: 52px;
    flex-shrink: 0;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--aqua);
    background: var(--aqua);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 18%; }
.avatar .brand-mark { width: 100%; height: 100%; }
.byline-text { display: flex; flex-direction: column; line-height: 1.3; }
.byline-name { font-weight: 600; }
.byline-role { font-size: 14px; color: var(--aqua-deep); font-weight: 500; }
.byline-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 14px;
    width: 100%;
    padding-top: 12px;
    border-top: 1px solid var(--line);
    font-size: 14px;
    color: var(--ink-soft);
}

.article-body { max-width: 940px; margin: 0 auto; font-size: 18px; }
.article-body > p:first-child::first-letter {
    float: left;
    margin: 6px 10px 0 0;
    font: 700 64px/.8 var(--serif);
    color: var(--wood);
}
.article-body p { margin: 0 0 1.2em; }
.article-body h2 {
    margin: 2em 0 .7em;
    padding-left: 16px;
    border-left: 4px solid var(--aqua-mid);
    font: 700 clamp(23px, 3vw, 29px)/1.3 var(--serif);
}
.article-body h3 { margin: 1.6em 0 .5em; font: 600 21px/1.35 var(--serif); }
.article-body ul, .article-body ol { margin: 0 0 1.4em; padding-left: 1.3em; }
.article-body li { margin-bottom: .55em; }
.article-body li::marker { color: var(--wood); }
.article-body ul.highlights {
    list-style: none;
    padding: 22px 26px;
    background: linear-gradient(135deg, var(--aqua) 0%, #e3f1f3 100%);
    border-radius: var(--radius);
}
.article-body ul.highlights li { position: relative; padding-left: 30px; }
.article-body ul.highlights li::before {
    content: "";
    position: absolute;
    left: 4px;
    top: .62em;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--wood);
}
.article-body blockquote, .article-body .note {
    margin: 1.6em 0;
    padding: 20px 26px;
    background: var(--sand);
    border-radius: var(--radius);
    font: 500 19px/1.6 var(--serif);
    color: #5a4634;
}
.article-body blockquote p:last-child { margin-bottom: 0; }
.article-body .table-wrap { overflow-x: auto; margin: 0 0 1.4em; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.article-body table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.5; }
.article-body th, .article-body td { padding: 12px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.article-body th { background: var(--aqua); font-weight: 600; }
.article-body tr:last-child td { border-bottom: 0; }
.article-body .disclaimer {
    margin-top: 2.4em;
    padding-top: 18px;
    border-top: 1px dashed var(--sand-mid);
    font-size: 15px;
    font-style: italic;
    color: var(--ink-soft);
}

/* ---------- Related materials ---------- */
.materials {
    padding: 72px 0 84px;
    background: linear-gradient(180deg, rgba(207, 231, 236, .55), rgba(239, 227, 207, .45));
    border-top: 1px solid var(--line);
}
.section-head { max-width: 720px; margin: 0 auto 40px; text-align: center; }
.section-head h2 { margin: 0 0 10px; font: 700 clamp(28px, 3.6vw, 36px)/1.2 var(--serif); }
.section-head p { margin: 0; color: var(--ink-soft); }

.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: calc(var(--radius) + 4px);
    padding: 10px;
    box-shadow: var(--shadow);
    transition: transform .25s, box-shadow .25s;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 26px 46px -24px rgba(64, 86, 96, .45); }
.card--current { border-color: var(--aqua-mid); box-shadow: 0 0 0 3px var(--aqua), var(--shadow); }
.card-media { display: block; overflow: hidden; border-radius: var(--radius); background: var(--aqua); }
.card-media img { width: 100%; aspect-ratio: 3 / 2; height: auto; object-fit: cover; object-position: center; transition: transform .4s; }
.card:hover .card-media img { transform: scale(1.03); }
.card-head { display: flex; flex-direction: column; padding: 10px 10px 14px; }
.card-body { display: flex; flex-direction: column; flex: 1; padding: 14px 10px 10px; }
/* Cards in a row share title/image/text rows, so images line up even when titles differ in length. */
@supports (grid-template-rows: subgrid) {
    .cards { row-gap: 0; }
    .card { display: grid; grid-template-rows: subgrid; grid-row: span 3; row-gap: 0; margin-bottom: 24px; }
}
.card-tag {
    align-self: flex-start;
    margin-bottom: 10px;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--sand);
    color: #7b5c40;
    font: 600 11px/1.3 var(--sans);
    letter-spacing: .06em;
    text-transform: uppercase;
}
.card--current .card-tag { background: var(--aqua-mid); color: var(--ink); }
.card h3 { margin: 0; font: 700 18px/1.35 var(--serif); }
.card h3 a { color: var(--ink); text-decoration: none; }
.card h3 a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.card p { margin: 0 0 14px; font-size: 15px; line-height: 1.6; color: var(--ink-soft); }
.card-more { margin-top: auto; font: 600 14px/1.3 var(--sans); color: var(--aqua-deep); }

/* ---------- Footer ---------- */
.site-footer { background: #eef3f2; border-top: 1px solid var(--line); padding: 48px 0 28px; color: var(--ink); }
.footer-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding-bottom: 28px;
    border-bottom: 1px solid var(--line);
}
.footer-nav { display: flex; flex-wrap: wrap; gap: 4px; }
.link-btn { border: 0; background: transparent; cursor: pointer; }
.about { max-width: 820px; padding: 32px 0; }
.about h2 { margin: 0 0 12px; font: 700 24px/1.3 var(--serif); }
.about p { margin: 0 0 .9em; color: var(--ink-soft); font-size: 16px; }
.footer-bottom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-top: 22px;
    border-top: 1px solid var(--line);
    font-size: 14px;
    color: var(--ink-soft);
}
.to-top { color: var(--aqua-deep); text-decoration: none; font-weight: 600; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
    .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .main-nav a { padding: 8px 10px; }
}
@media (max-width: 900px) {
    .hero, .hero--portrait { grid-template-columns: 1fr; gap: 28px; margin-bottom: 40px; padding-bottom: 40px; }
    .hero--portrait .hero-media { width: 100%; max-width: 460px; margin: 0 auto; }
}
@media (max-width: 860px) {
    :root { --header-h: 116px; }
    .header-inner { flex-wrap: wrap; gap: 10px 16px; padding-top: 12px; padding-bottom: 12px; }
    .main-nav { order: 3; width: 100%; margin-left: 0; overflow-x: auto; }
    .lang-switcher { margin-left: auto; }
}
@media (max-width: 600px) {
    body { font-size: 16px; }
    .container { padding: 0 16px; }
    .brand-sub { display: none; }
    .main-nav a { padding: 7px 10px; font-size: 14px; white-space: nowrap; }
    .article { padding-top: 24px; }
    .frame { padding: 8px; border-radius: 22px; }
    .frame img { border-radius: 16px; }
    .article-body { font-size: 17px; }
    .subtitle { padding-left: 14px; }
    .cards { grid-template-columns: 1fr; }
    .footer-top, .footer-bottom { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .card, .card-media img { transition: none; }
}
