/*
 * Shared styling for the SEO content pages under /openings, /puzzles and the tool landing pages.
 *
 * The homepage (index.html) keeps its own copy of these design tokens inline: it is the LCP-
 * sensitive entry page, and inlining avoids a render-blocking request there. These content pages
 * are read rather than bounced through, so a cached external stylesheet is the better trade.
 * If a token changes here, change it in index.html's <style> block too.
 */

/* Montserrat, latin + latin-ext only. Copied verbatim from index.html's inline block so the two
   stay byte-identical and the browser reuses the same cached font files across the whole site. */
/* latin-ext */
@font-face {
    font-family: 'Montserrat';
    font-style: normal;
    font-weight: 200;
    font-display: swap;
    src: local('Montserrat ExtraLight'), local('Montserrat-ExtraLight'), url(https://fonts.gstatic.com/s/montserrat/v14/JTURjIg1_i6t8kCHKm45_aZA3gfD_u50.woff2) format('woff2');
    unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
    font-family: 'Montserrat';
    font-style: normal;
    font-weight: 200;
    font-display: swap;
    src: local('Montserrat ExtraLight'), local('Montserrat-ExtraLight'), url(https://fonts.gstatic.com/s/montserrat/v14/JTURjIg1_i6t8kCHKm45_aZA3gnD_g.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
    font-family: 'Montserrat';
    font-style: normal;
    font-weight: 300;
    font-display: swap;
    src: local('Montserrat Light'), local('Montserrat-Light'), url(https://fonts.gstatic.com/s/montserrat/v14/JTURjIg1_i6t8kCHKm45_cJD3gfD_u50.woff2) format('woff2');
    unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
    font-family: 'Montserrat';
    font-style: normal;
    font-weight: 300;
    font-display: swap;
    src: local('Montserrat Light'), local('Montserrat-Light'), url(https://fonts.gstatic.com/s/montserrat/v14/JTURjIg1_i6t8kCHKm45_cJD3gnD_g.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
    font-family: 'Montserrat';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: local('Montserrat Regular'), local('Montserrat-Regular'), url(https://fonts.gstatic.com/s/montserrat/v14/JTUSjIg1_i6t8kCHKm459Wdhyzbi.woff2) format('woff2');
    unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
    font-family: 'Montserrat';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: local('Montserrat Regular'), local('Montserrat-Regular'), url(https://fonts.gstatic.com/s/montserrat/v14/JTUSjIg1_i6t8kCHKm459Wlhyw.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    --bg: #1b1818;
    --bg-elevated: #232020;
    --bg-card: #211d1d;
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.14);
    --text: #ececec;
    --text-muted: #9d9794;
    --accent: #489e5d;
    --accent-hover: #57b26e;
    --accent-glow: rgba(72, 158, 93, 0.35);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    margin: 0;
    background-color: var(--bg);
    background-image: radial-gradient(120% 60% at 50% -10%, rgba(72, 158, 93, 0.12) 0%, rgba(72, 158, 93, 0) 60%);
    background-repeat: no-repeat;
    font-family: "Montserrat", sans-serif;
    font-weight: 300;
    color: var(--text);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }

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

/* ---------- Chrome (mirrors index.html) ---------- */
.topbar {
    position: sticky; top: 0; z-index: 20;
    backdrop-filter: blur(10px);
    background: rgba(27, 24, 24, 0.72);
    border-bottom: 1px solid var(--border);
}
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; white-space: nowrap; font-weight: 400; font-size: 20px; letter-spacing: 0.3px; }
.brand img { width: 34px; height: 34px; }
.topbar nav { display: flex; gap: 22px; font-size: 15px; color: var(--text-muted); }
.topbar nav a:hover { color: var(--text); }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    font-family: inherit; font-weight: 400; font-size: 16px; line-height: 1;
    padding: 14px 28px; border-radius: 8px; border: 1px solid transparent; cursor: pointer;
    transition: background-color .2s ease, transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.btn-primary { color: #fff; background: var(--accent); box-shadow: 0 8px 24px var(--accent-glow); }
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-2px); box-shadow: 0 12px 30px var(--accent-glow); }
.btn-ghost { color: var(--text); background: transparent; border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--bg-elevated); border-color: var(--accent); transform: translateY(-2px); }
.btn-sm { padding: 10px 20px; font-size: 15px; }

/* ---------- Article layout ---------- */
.crumbs { font-size: 14px; color: var(--text-muted); padding: 28px 0 0; }
.crumbs a:hover { color: var(--text); }
.crumbs span { margin: 0 8px; opacity: .5; }

article { padding: 8px 0 56px; }
article > .wrap { max-width: 820px; }
.page-wide > .wrap { max-width: 1140px; }

h1 { font-weight: 300; font-size: clamp(30px, 4.4vw, 46px); line-height: 1.2; margin: 18px 0 14px; }
h1 strong { font-weight: 400; color: var(--accent); }
h2 { font-weight: 400; font-size: clamp(22px, 2.6vw, 28px); margin: 44px 0 12px; }
h3 { font-weight: 400; font-size: 19px; margin: 28px 0 8px; }
p { margin: 0 0 16px; }
.lead { font-size: 19px; color: var(--text-muted); margin-bottom: 26px; }

article ul, article ol { margin: 0 0 16px; padding-left: 22px; }
article li { margin-bottom: 8px; }

.eyebrow {
    display: inline-block; margin-top: 18px; font-size: 13px; letter-spacing: 1.4px;
    text-transform: uppercase; color: var(--accent);
    border: 1px solid var(--border-strong); border-radius: 999px; padding: 6px 14px;
}

/* For move orders and ECO codes, which upper-casing would mangle. */
.eyebrow.notation { text-transform: none; letter-spacing: 0.6px; }

.cta-group { display: flex; flex-wrap: wrap; gap: 14px; margin: 28px 0 8px; }

/* ---------- Cards / grids ---------- */
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin: 26px 0; }
.card-grid.two { grid-template-columns: repeat(2, 1fr); }
.card {
    display: block; background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 12px; padding: 20px 22px;
    transition: border-color .2s ease, transform .2s ease;
}
a.card:hover { border-color: var(--accent); transform: translateY(-2px); }
.card h3 { margin: 0 0 6px; font-size: 18px; }
.card p { margin: 0; color: var(--text-muted); font-size: 15px; }
.card .meta { display: block; margin-top: 10px; font-size: 13px; color: var(--accent); }

/* ---------- Move list ---------- */
.moves {
    background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 10px;
    padding: 16px 20px; margin: 0 0 22px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 15px; line-height: 1.7;
}
/* Long lines wrap at a move boundary rather than scrolling sideways - the actions on the right
   have to stay in view, and so do the moves themselves on a phone. */
.line-moves { white-space: normal; overflow-wrap: anywhere; }
/* Each variation: the moves and name on the left, its two destinations on the right. */
.moves .line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 12px;
    margin: 0 -12px;
    border-radius: 8px;
    transition: background-color .15s ease;
}
.moves .line:hover { background: rgba(255, 255, 255, 0.06); }
.line-text { min-width: 0; }
.line-moves { display: block; }
.line-name { display: block; font-family: "Montserrat", sans-serif; font-size: 14px; color: var(--text-muted); white-space: normal; }
.line-actions {
    display: flex; gap: 6px; flex-shrink: 0;
    font-family: "Montserrat", sans-serif; font-size: 13px; white-space: nowrap;
}
.line-actions a {
    color: var(--accent); border: 1px solid var(--border-strong); border-radius: 999px;
    padding: 5px 12px; transition: border-color .15s ease, background-color .15s ease;
}
.line-actions a:hover { border-color: var(--accent); background: rgba(72, 158, 93, 0.12); }
@media (max-width: 560px) {
    .moves .line { flex-direction: column; align-items: flex-start; gap: 8px; }
}
.moves-hint { font-size: 14px; color: var(--text-muted); margin: 0 0 8px; }

.demo-link { font-size: 15px; margin: -2px 0 8px; }
.demo-link a { color: var(--accent); border-bottom: 1px solid transparent; }
.demo-link a:hover { border-bottom-color: var(--accent); }
.demo-link span { color: var(--text-muted); }

/* Keyboard focus must stay visible on every interactive element. */
a:focus-visible, summary:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 4px;
}

.fact-table { width: 100%; border-collapse: collapse; margin: 0 0 24px; font-size: 15px; }
.fact-table th, .fact-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.fact-table th { width: 34%; color: var(--text-muted); font-weight: 400; }

.callout {
    background: var(--bg-card); border: 1px solid var(--border-strong); border-left: 3px solid var(--accent);
    border-radius: 10px; padding: 18px 22px; margin: 26px 0;
}
.callout p:last-child { margin-bottom: 0; }

/* ---------- FAQ ---------- */
.faq { margin: 26px 0; }
.faq details {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px;
    padding: 16px 20px; margin-bottom: 12px;
}
.faq summary { cursor: pointer; font-weight: 400; font-size: 17px; }
.faq details[open] summary { color: var(--accent); margin-bottom: 10px; }
.faq p:last-child { margin-bottom: 0; }

/* ---------- Footer ---------- */
footer { border-top: 1px solid var(--border); padding: 40px 0; margin-top: 24px; }
footer .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; color: var(--text-muted); font-size: 14px; }
footer .footer-links { display: flex; gap: 22px; flex-wrap: wrap; align-items: center; }
footer a:hover { color: var(--text); }

@media (max-width: 900px) {
    .card-grid, .card-grid.two { grid-template-columns: repeat(2, 1fr); }
    .topbar nav { display: none; }
}
@media (max-width: 560px) {
    .wrap { padding: 0 18px; }
    .topbar .btn { display: none; }
    .brand { font-size: 18px; }
    .card-grid, .card-grid.two { grid-template-columns: 1fr; }
    .cta-group .btn { flex: 1 1 100%; }
}
