/* Editorial layout system: a second structural layer loaded after theme.css.
   It changes the page architecture on every route: two-row masthead, in-flow
   hero, dossier page headers, horizontal section index, open reading column,
   bento grids, stacked pricing rows and a lead block in the footer. */
:root {
    --layout-max: 1240px;
}

/* ---------- Announcement + two-row header ---------- */
.top-note {
    background: #24160f;
    color: #f2e1cf;
    font-size: 12px;
    letter-spacing: .04em;
}
.top-note .wrap {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding-block: 9px;
}
.top-note span:last-child { color: #d7ac84; }

.site-header {
    position: sticky;
    top: 0;
    width: 100%;
    margin: 0;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    background: rgba(252, 247, 241, .95);
    box-shadow: 0 6px 24px rgba(84, 49, 24, .06);
}
.header-inner {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto auto;
    column-gap: 24px;
    width: min(var(--layout-max), calc(100% - 56px));
    min-height: 0;
    margin: 0 auto;
    padding: 14px 0 0;
}
.brand { grid-column: 1; grid-row: 1; }
.header-note {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    align-self: center;
    color: var(--muted);
    font-size: 11px;
    letter-spacing: .12em;
    text-transform: uppercase;
}
.menu-toggle { display: none; grid-column: 3; grid-row: 1; }
.main-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    padding: 10px 0 12px;
    border-top: 1px solid var(--line);
    font-size: 14px;
}
.main-nav > a,
.nav-dropdown summary { padding: 8px 10px; border-radius: 999px; }
.main-nav > a:hover,
.nav-dropdown summary:hover { background: var(--accent-tint); }
.main-nav > a[aria-current="page"] { background: var(--accent-tint); color: var(--accent-deep); }
.main-nav > a[aria-current="page"]::after { display: none; }
.main-nav .language-link { margin-left: auto; }
.main-nav .nav-cta { margin-left: 6px; }
/* CSS chevrons stay optically centred in both closed and open states. */
.nav-dropdown summary { gap: 6px; }
.nav-dropdown summary span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 9px;
    height: 9px;
    border: 0;
    color: var(--accent);
    font-size: 0;
    line-height: 0;
    transform: none;
    transition: transform .2s ease;
}
.nav-dropdown summary span::before {
    display: block;
    width: 6px;
    height: 6px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    content: "";
    transform: rotate(45deg);
}
.nav-dropdown[open] summary span { transform: rotate(180deg); }

/* ---------- Home: stacked editorial hero ---------- */
.home-hero { min-height: 0; padding: 104px 0 76px; }
.home-hero-grid { grid-template-columns: 1fr; gap: 56px; }
.hero-copy { max-width: 1040px; }
.hero-copy h1 {
    margin: 24px 0 22px;
    font-size: clamp(48px, 7vw, 100px);
    line-height: 1.05;
    letter-spacing: -.05em;
}
.hero-description { max-width: 720px; font-size: 19px; }
.workbench-visual { display: block; min-height: 0; margin-top: 6px; }
.glass-workbench { width: min(100%, 960px); margin: 0 auto; transform: none; }
.hero-bottom-line { margin-top: 44px; }
.fact-band { margin-top: 0; border-radius: 0; border-inline: 0; }

/* ---------- Inner pages: dossier header ---------- */
.page-head { padding: 84px 0 58px; }
.page-head .wrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 230px;
    column-gap: 56px;
    align-items: end;
}
.page-head .breadcrumb { grid-column: 1 / -1; margin-bottom: 26px; }
.page-head .eyebrow { grid-column: 1; }
.page-head h1 {
    grid-column: 1;
    max-width: 1000px;
    margin: 10px 0 18px;
    font-size: clamp(38px, 4vw, 58px);
    line-height: 1.22;
    letter-spacing: -.025em;
}
.page-head p { grid-column: 1; max-width: 780px; margin: 6px 0 0; }
.page-meta {
    grid-column: 2;
    grid-row: 2 / 6;
    align-self: stretch;
    display: grid;
    align-content: start;
    gap: 8px;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fffdfa;
    box-shadow: var(--shadow-sm);
}
.page-meta strong { font: 400 62px/1 Georgia, "Times New Roman", serif; letter-spacing: -.03em; color: var(--accent); }
.meta-kicker { color: var(--muted); font-size: 10px; letter-spacing: .18em; }
.meta-status {
    padding-top: 10px;
    border-top: 1px solid var(--line);
    color: var(--accent-deep);
    font-size: 11px;
}
.meta-count {
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 12px;
}

/* ---------- Horizontal section index ---------- */
.page-index {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    overflow-x: auto;
    padding: 10px 24px;
    border-block: 1px solid var(--line);
    background: #fffdfa;
    scrollbar-width: none;
    overscroll-behavior-x: contain;
}
.page-index::-webkit-scrollbar { display: none; }
.index-track {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 8px;
    margin-inline: auto;
}
.page-index a {
    flex: 0 0 auto;
    padding: 6px 12px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: #faf4ec;
    color: var(--ink-2);
    font-size: 12px;
    white-space: nowrap;
}
.page-index a:hover { background: var(--accent-tint); border-color: var(--accent-line); color: var(--accent-deep); }

/* ---------- Content sheet ---------- */
body[data-page] .article {
    position: relative;
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    padding: 52px 58px 60px;
    border: 1px solid #eaded1;
    border-radius: 28px;
    background: #fffdfa;
    box-shadow: 0 26px 64px rgba(84, 49, 24, .09);
    overflow: hidden;
}
body[data-page="authorize.html"] .article { margin-top: 44px; }
body[data-page] .article::before {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent), #e5b184 58%, transparent);
    content: "";
}
.reading-layout { display: block; }
.article h2 {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 64px 0 22px;
    padding: 28px 0 0;
    border-top: 1px solid var(--line);
    font-size: clamp(25px, 2.5vw, 33px);
    line-height: 1.4;
}
.article h2::before {
    position: static;
    display: block;
    flex: 0 0 auto;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 6px var(--accent-tint);
    content: "";
}
.article h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.article p, .article li { color: #4a3729; font-size: 16.5px; line-height: 1.95; }
.article p { max-width: none; }
.article .table-scroll { margin-block: 28px; }
.article h3 { margin-top: 34px; }

/* Tables inside the sheet: crisper header, quieter rows, stronger first column. */
body[data-page] .table-scroll {
    border: 1px solid #eaded1;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 10px 26px rgba(84, 49, 24, .05);
}
body[data-page] .tbl { font-size: 14.5px; line-height: 1.8; }
body[data-page] .tbl th,
body[data-page] .tbl td { padding: 14px 18px; border-color: #efe4d8; }
body[data-page] .tbl thead th,
body[data-page] .tbl tbody th {
    background: #f7ede2;
    color: #6a4226;
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: .04em;
}
body[data-page] .tbl tbody tr:nth-child(even) { background: #fcf7f0; }
body[data-page] .tbl tbody tr:hover { background: #fbf0e2; }
body[data-page] .tbl tbody td:first-child { color: #3a281c; font-weight: 650; }

/* ---------- Bento and mosaic grids ---------- */
.section { padding-block: 96px; }
.section-head { margin-bottom: 44px; }
.section-head h2, .split-head h2, .home-group h2, .privacy-band h2, .closing-cta h2 {
    font-size: clamp(32px, 3.6vw, 48px);
    line-height: 1.3;
}
.split-head { display: grid; grid-template-columns: 1.2fr .8fr; align-items: end; gap: 56px; }
.grid { gap: 18px; }
.grid-2 { grid-template-columns: 1.15fr .85fr; gap: 24px; }
.capability-grid { grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 18px; }
.capability-grid > * { grid-column: span 4; }
.capability-grid > *:nth-child(1) { grid-column: span 7; min-height: 280px; }
.capability-grid > *:nth-child(2) { grid-column: span 5; }
.capability-grid > *:nth-child(3) { grid-column: span 5; }
.capability-grid > *:nth-child(4) { grid-column: span 7; }
.capability-grid > *:nth-child(5) { grid-column: span 6; }
.capability-grid > *:nth-child(6) { grid-column: span 6; }
.workflow-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    border: 0;
    background: none;
    box-shadow: none;
}
.workflow-grid article {
    min-height: 190px;
    padding: 30px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--surface);
}
.workflow-grid article:nth-child(-n+2) { border-color: var(--line); }
.privacy-band .grid { grid-template-columns: 1.1fr .9fr; }
.privacy-points { grid-template-columns: 1fr 1fr; gap: 14px; }
body[data-page="support.html"] .grid-3 { grid-template-columns: 1.2fr 1fr 1fr; }

/* ---------- Pricing as stacked comparison rows ---------- */
.price-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
.price {
    display: grid;
    grid-template-columns: minmax(0, 220px) minmax(0, 1fr) minmax(0, 200px);
    column-gap: 32px;
    row-gap: 8px;
    align-items: start;
    padding: 30px 34px;
}
.price h3 { grid-column: 1; grid-row: 1; margin: 0; font-size: 24px; }
.price .desc { grid-column: 1; grid-row: 2; margin: 0; max-width: 220px; font-size: 14px; }
.price .amount { grid-column: 3; grid-row: 1; margin: 0; text-align: right; font-size: 30px; }
.price .small.muted { grid-column: 3; grid-row: 2; margin: 0; text-align: right; font-size: 12px; }
.price > ul {
    grid-column: 2;
    grid-row: 1 / 4;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 22px;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 14px;
}
.price > ul li { position: relative; padding-left: 18px; }
.price > ul li::before {
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: 700;
    content: "✓";
}
.price .btn { grid-column: 3; grid-row: 3; justify-self: end; min-width: 170px; margin: 0; }
.price.featured { background: linear-gradient(150deg, #fff8ee, #fbe8d2); }

/* ---------- Footer lead ---------- */
.footer-lead {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 40px;
    padding: 56px 0 46px;
    border-bottom: 1px solid rgba(255, 255, 255, .14);
}
.footer-lead h2 {
    max-width: 760px;
    margin: 8px 0 0;
    color: #fdf3e8;
    font-size: clamp(28px, 3.4vw, 46px);
    font-weight: 600;
    line-height: 1.3;
}
.footer-lead .eyebrow { color: #e0a97c; }
.footer-lead .btn-primary { flex: 0 0 auto; }
.footer-top { padding-top: 46px; }

/* ---------- Responsive ---------- */
@media (max-width: 1050px) {
    .header-inner {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: calc(100% - 32px);
        min-height: 70px;
        padding: 12px 0;
    }
    .header-note { display: none; }
    .menu-toggle { display: flex; }
    .main-nav {
        position: absolute;
        top: calc(100% + 8px);
        right: 0;
        left: 0;
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        margin: 0;
        padding: 14px;
        border: 1px solid var(--line);
        border-radius: 18px;
        background: #fffaf4;
        box-shadow: var(--shadow-md);
    }
    .main-nav.is-open { display: flex; }
    .main-nav .language-link,
    .main-nav .nav-cta { align-self: flex-start; margin-left: 0; }
    .home-hero { padding: 72px 0 52px; }
    .home-hero-grid { gap: 38px; }
    .hero-copy h1 { font-size: clamp(40px, 10vw, 64px); }
    .page-head { padding: 58px 0 40px; }
    .page-head .wrap { display: block; }
    .page-meta { display: none; }
    .page-head h1 { font-size: clamp(34px, 7vw, 48px); }
    body[data-page] .article { padding: 40px 34px 46px; border-radius: 24px; }
    .split-head { grid-template-columns: 1fr; gap: 22px; }
    .capability-grid > *,
    .capability-grid > *:nth-child(n) { grid-column: span 6; }
    .grid-2, .privacy-band .grid { grid-template-columns: 1fr; }
    .price {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        column-gap: 22px;
    }
    .price h3, .price .desc { grid-column: 1; }
    .price .amount, .price .small.muted { grid-column: 2; }
    .price > ul { grid-column: 1 / -1; grid-row: 3; margin-top: 10px; }
    .price .btn { grid-column: 2; grid-row: 4; margin-top: 12px; }
    .footer-lead { flex-direction: column; align-items: flex-start; gap: 24px; }
}

@media (max-width: 640px) {
    .top-note .wrap { justify-content: center; text-align: center; font-size: 11px; }
    .top-note span:last-child { display: none; }
    .header-inner { width: calc(100% - 24px); }
    .home-hero { padding: 56px 0 42px; overflow-wrap: anywhere; }
    .hero-copy h1 { font-size: clamp(32px, 10.5vw, 48px); }
    .hero-copy h1 span { white-space: normal; }
    .hero-description { font-size: 17px; }
    .workflow-grid { grid-template-columns: 1fr; }
    .capability-grid > *,
    .capability-grid > *:nth-child(n) { grid-column: span 12; }
    .price { display: block; padding: 24px; }
    .price .amount { margin: 12px 0 4px; text-align: left; }
    .price .small.muted { text-align: left; }
    .price > ul { grid-template-columns: 1fr; margin: 16px 0; }
    .price .btn { width: 100%; margin-top: 8px; }
    .page-index { padding-inline: 18px; }
    .article h2 { gap: 12px; margin-top: 48px; font-size: 24px; }
    body[data-page] .article { padding: 28px 20px 34px; border-radius: 20px; }
    body[data-page] .tbl th,
    body[data-page] .tbl td { padding: 12px 13px; }
    .section { padding-block: 64px; }
    .footer-lead { padding-top: 42px; }
    .footer-lead .btn { width: 100%; }
}
