/* ============================================================================
   XLMind Studio - public site design system (redesign v2)
   Concept: "a professional desktop productivity studio living inside Excel".
   Deep-navy chrome (header, hero, footer) framing a light worksheet body;
   one green accent; Segoe UI Variable (native to the Windows audience);
   cell/grid/ribbon motifs used as fine detail, never as pastiche.
   Server-rendered, no build step. No em/en dashes anywhere.
   ========================================================================= */

:root {
    /* Surfaces */
    --bg: #ffffff;
    --surface: #f4f7f5;
    --surface-2: #eef3f0;
    --panel: #ffffff;
    --ink: #0c1b2a;              /* deep navy: header, hero, footer */
    --ink-2: #13273b;
    --ink-soft: #1b3247;
    --ink-3: #0a1622;

    /* Text */
    --text: #101f30;
    --text-soft: #33465c;
    --muted: #5d6b7a;
    --on-ink: #eef3f8;
    --on-ink-muted: #9fb2c3;

    /* Lines */
    --border: #e6ece8;
    --border-strong: #d3ddd6;
    --border-ink: rgba(255,255,255,.10);
    --border-ink-strong: rgba(255,255,255,.18);

    /* Brand: one green accent (+ controlled teal in gradients only) */
    --accent: #0f8149;
    --accent-strong: #0b6b3c;
    --accent-bright: #17a35f;    /* on dark surfaces */
    --accent-2: #0d8a98;
    --accent-soft: #e8f5ee;
    --accent-ring: rgba(15,129,73,.24);
    --excel: #217346;
    --brand-grad: linear-gradient(135deg, #16a35a 0%, #0d8a98 100%);

    /* Status */
    --success-bg: #ecfdf5; --success-bd: #a7f3d0; --success-tx: #047857;
    --danger-bg: #fef2f2; --danger-bd: #fecaca; --danger-tx: #b91c1c;
    --warn-bg: #fffbeb; --warn-bd: #fde68a; --warn-tx: #92600a;

    /* Shape & depth */
    --radius: 12px;
    --radius-sm: 9px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 2px rgba(12,27,42,.05);
    --shadow: 0 1px 2px rgba(12,27,42,.04), 0 8px 24px rgba(12,27,42,.07);
    --shadow-lg: 0 12px 40px rgba(12,27,42,.14);
    --shadow-ink: 0 24px 70px rgba(4,12,20,.45);

    /* Type */
    --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Roboto", "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    --font-display: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, "Roboto", Arial, sans-serif;
    --mono: ui-monospace, "Cascadia Code", "SFMono-Regular", "Segoe UI Mono", Menlo, monospace;

    /* Motion */
    --ease: cubic-bezier(.16, 1, .3, 1);

    --header-h: 64px;
    --container: 1200px;
}

/* Reset ------------------------------------------------------------------- */
* { box-sizing: border-box; }
/* overflow-x: clip kills layout overflow from off-canvas elements (the closed
   mobile drawer at translateX(100%)) WITHOUT creating a scroll container, so
   position: sticky keeps working. Fallback hides the closed drawer instead. */
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: clip; }
@supports not (overflow-x: clip) {
    .js .drawer:not([data-open="true"]) { display: none; }
}
html, body { margin: 0; padding: 0; }
body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 15.5px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, h5 { margin: 0; line-height: 1.15; font-weight: 700; letter-spacing: -.015em; font-family: var(--font-display); }
img, svg { max-width: 100%; }
button { font-family: inherit; }
:target { scroll-margin-top: calc(var(--header-h) + 16px); }

/* Accessibility ----------------------------------------------------------- */
:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 2px; border-radius: 4px; }
.site-header :focus-visible, .site-footer :focus-visible { outline-color: var(--accent-bright); }
.skip-link {
    position: absolute; left: 12px; top: -60px; z-index: 100;
    background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 8px;
    transition: top .15s ease;
}
.skip-link:focus { top: 12px; }
.visually-hidden {
    position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Layout ------------------------------------------------------------------ */
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 28px; }
.container-narrow { max-width: 800px; }
section { padding: 84px 0; }
.section-head { text-align: center; max-width: 680px; margin: 0 auto 44px; }
.section-head h1, .section-head h2 { font-size: clamp(27px, 3.6vw, 36px); letter-spacing: -.025em; font-weight: 800; text-wrap: balance; }
.section-head p { color: var(--muted); margin: 12px auto 0; font-size: 16.5px; max-width: 58ch; }
.eyebrow {
    display: inline-block; color: var(--accent); font-weight: 700; font-size: 12.5px;
    letter-spacing: .08em; text-transform: uppercase; margin-bottom: 12px;
}
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: var(--mono); }
.center { text-align: center; }

/* Cell badge: a tiny spreadsheet cell holding a letter/number. Signature motif. */
.cellb {
    display: inline-flex; align-items: center; justify-content: center;
    width: 26px; height: 26px; flex: none;
    font-family: var(--mono); font-size: 12px; font-weight: 700; color: var(--accent-strong);
    background: var(--accent-soft); border: 1px solid #cfe8db; border-radius: 6px;
}

/* Buttons ----------------------------------------------------------------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px 22px; border-radius: 10px; font-size: 15px; font-weight: 600;
    border: 1px solid var(--border-strong); background: #fff; color: var(--text);
    cursor: pointer; white-space: nowrap;
    transition: transform .14s var(--ease), box-shadow .2s var(--ease), background .18s ease, border-color .18s ease, color .18s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(0) scale(.99); }
.btn-primary {
    background: var(--accent); border-color: var(--accent); color: #fff;
    box-shadow: 0 6px 18px rgba(15,129,73,.24);
}
.btn-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-soft); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-on-ink { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.26); color: #fff; }
.btn-on-ink:hover { background: rgba(255,255,255,.16); }
.btn-sm { padding: 9px 16px; font-size: 14px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn[disabled], .btn.is-disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }

/* Cards / forms ------------------------------------------------------------ */
.card {
    background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 28px; box-shadow: var(--shadow);
}
.card-narrow { max-width: 460px; margin: 0 auto; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 7px; }
.input, .textarea, .select {
    width: 100%; padding: 12px 14px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
    font-size: 15px; background: #fff; color: var(--text); outline: none; font-family: inherit;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.textarea { resize: vertical; min-height: 128px; }
.input:focus, .textarea:focus, .select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.input[aria-invalid="true"], .textarea[aria-invalid="true"], .select[aria-invalid="true"] { border-color: var(--danger-tx); }
.field-error { color: var(--danger-tx); font-size: 13px; margin: 6px 0 0; }
.check { display: flex; align-items: flex-start; gap: 9px; font-size: 14px; color: var(--muted); margin-bottom: 18px; }
.check input { margin-top: 3px; flex: none; }
.alert { padding: 13px 16px; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 18px; }
.alert-success { background: var(--success-bg); border: 1px solid var(--success-bd); color: var(--success-tx); }
.alert-error { background: var(--danger-bg); border: 1px solid var(--danger-bd); color: var(--danger-tx); }
.alert-warn { background: var(--warn-bg); border: 1px solid var(--warn-bd); color: var(--warn-tx); }

/* Brand / logo -------------------------------------------------------------- */
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; letter-spacing: -.02em; color: var(--text); }
.brand .logo-mark { width: 30px; height: 30px; flex: none; display: block; }
.brand .brand-name { white-space: nowrap; }
.brand .brand-name b { font-weight: 800; }
.brand--on-ink { color: #fff; }

/* ========================================================================= */
/* Header: dark navy chrome (the desktop-app frame of the whole site)         */
/* ========================================================================= */
.site-header {
    position: sticky; top: 0; z-index: 60;
    background: rgba(12,27,42,.94);
    backdrop-filter: saturate(140%) blur(10px);
    border-bottom: 1px solid var(--border-ink);
}
.site-header .bar { display: flex; align-items: center; gap: 18px; height: var(--header-h); }
.nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav .link {
    color: var(--on-ink-muted); font-weight: 600; font-size: 14px; padding: 8px 12px;
    border-radius: 8px; transition: color .15s ease, background .15s ease;
}
.nav .link:hover { color: #fff; background: rgba(255,255,255,.07); }
.nav .sep { width: 1px; height: 22px; background: var(--border-ink-strong); margin: 0 6px; }
.nav .btn-nav-ghost { border-color: var(--border-ink-strong); background: transparent; color: var(--on-ink); }
.nav .btn-nav-ghost:hover { background: rgba(255,255,255,.08); }

/* Language switch (dark chrome variant) */
.langsw { display: inline-flex; border: 1px solid var(--border-ink-strong); border-radius: 8px; overflow: hidden; }
.langsw a { padding: 6px 10px; font-size: 12.5px; font-weight: 700; color: var(--on-ink-muted); background: transparent; }
.langsw a.active { background: var(--accent); color: #fff; }
.langsw a:hover:not(.active) { background: rgba(255,255,255,.08); color: #fff; }
/* light-surface variant (drawer) */
.langsw--light { border-color: var(--border-strong); }
.langsw--light a { color: var(--muted); background: #fff; }
.langsw--light a.active { background: var(--accent-soft); color: var(--accent-strong); }
.langsw--light a:hover:not(.active) { background: var(--surface-2); }

/* Mega dropdown: fixed, viewport-centered under the header (overflow-safe) */
.has-mega { position: relative; }
.mega-toggle { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; cursor: pointer; }
.mega-toggle .caret { transition: transform .18s var(--ease); }
.mega-toggle[aria-expanded="true"] .caret { transform: rotate(180deg); }
.mega-panel {
    position: fixed; left: 50%; top: calc(var(--header-h) + 10px); width: min(980px, calc(100vw - 32px));
    max-height: calc(100vh - var(--header-h) - 28px); overflow-y: auto;
    background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg); padding: 0; opacity: 0; visibility: hidden;
    transform: translate(-50%, -8px); transition: opacity .18s var(--ease), transform .22s var(--ease), visibility .2s;
    z-index: 70;
}
.mega-panel[data-open="true"] { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.no-js .has-mega:hover .mega-panel,
.no-js .has-mega:focus-within .mega-panel { opacity: 1; visibility: visible; transform: translate(-50%, 0); }

/* Mega interior: groups zone + featured rail */
.mgx { display: grid; grid-template-columns: 1.55fr 1fr; }
.mgx-groups { padding: 22px 24px; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 22px; align-content: start; }
.mgx-g { display: flex; gap: 11px; align-items: flex-start; padding: 10px; border-radius: 10px; transition: background .14s ease; }
.mgx-g:hover { background: var(--surface); }
.mgx-g .cellb { margin-top: 2px; }
.mgx-g-t { display: block; font-size: 14px; font-weight: 700; color: var(--text); line-height: 1.25; }
.mgx-g-d { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; line-height: 1.4; }
.mgx-g-n { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.mgx-side {
    background: linear-gradient(180deg, var(--surface), var(--accent-soft));
    border-left: 1px solid var(--border); padding: 22px 24px;
    display: flex; flex-direction: column; gap: 4px; border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
}
.mgx-side-h { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: var(--accent-strong); margin: 0 0 8px; }
.mgx-f { display: block; padding: 9px 10px; border-radius: 9px; transition: background .14s ease; }
.mgx-f:hover { background: rgba(255,255,255,.75); }
.mgx-f-t { display: block; font-size: 13.5px; font-weight: 700; color: var(--text); }
.mgx-f-d { display: block; font-size: 12.5px; color: var(--text-soft); margin-top: 1px; line-height: 1.4; }
.mgx-cta { margin-top: auto; padding-top: 14px; }
.mega-foot {
    grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
    padding: 13px 24px; border-top: 1px solid var(--border); background: var(--surface);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.mega-foot .explore { font-weight: 700; font-size: 14px; color: var(--accent-strong); }
.mega-foot .explore:hover { color: var(--accent); }

/* back-to-top: stylized spreadsheet cell */
.to-top { position: fixed; right: 22px; bottom: 22px; z-index: 80; width: 46px; height: 46px; padding: 0; border: 0; background: none; cursor: pointer; opacity: 0; transform: translateY(10px) scale(.9); transition: opacity .22s var(--ease), transform .22s var(--ease); }
.to-top.is-on { opacity: 1; transform: none; }
.to-top svg { width: 46px; height: 46px; display: block; filter: drop-shadow(0 6px 16px rgba(12,27,42,.22)); }
.to-top .tt-cell { fill: #fff; stroke: var(--border-strong); stroke-width: 1.4; transition: fill .18s ease, stroke .18s ease; }
.to-top .tt-head { fill: none; stroke: var(--border-strong); stroke-width: 1.4; transition: stroke .18s ease; }
.to-top .tt-arrow { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: stroke .18s ease; }
.to-top:hover .tt-cell { fill: var(--ink); stroke: var(--ink); }
.to-top:hover .tt-head { stroke: rgba(255,255,255,.28); }
.to-top:hover .tt-arrow { stroke: #7fe0ad; }
.to-top:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 3px; border-radius: 12px; }
@media (prefers-reduced-motion: reduce) { .to-top { transition: opacity .01ms; } }
@media (max-width: 560px) { .to-top { right: 14px; bottom: 14px; width: 42px; height: 42px; } .to-top svg { width: 42px; height: 42px; } }

/* mobile feature accordion (drawer) */
.d-grp > summary { font-weight: 600; font-size: 13.5px; color: var(--text-soft); padding: 8px 10px; cursor: pointer; list-style: none; display: flex; justify-content: space-between; }
.d-grp[open] > summary { color: var(--accent-strong); }
.d-grp-n { font-size: 11px; color: var(--muted); font-family: var(--mono); }
.d-tool { display: block; padding: 6px 10px 6px 20px; font-size: 13px; color: var(--text-soft); }

/* Mobile nav toggle (on dark header) + drawer */
.nav-toggle { display: none; align-items: center; justify-content: center; width: 42px; height: 42px; border: 1px solid var(--border-ink-strong); border-radius: 10px; background: transparent; cursor: pointer; margin-left: auto; }
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after { content: ""; display: block; width: 18px; height: 2px; background: #fff; border-radius: 2px; position: relative; transition: transform .2s ease, opacity .2s ease; }
.nav-toggle span::before { position: absolute; top: -6px; }
.nav-toggle span::after { position: absolute; top: 6px; }
.drawer-backdrop { position: fixed; inset: 0; background: rgba(10,22,34,.55); opacity: 0; visibility: hidden; transition: opacity .2s ease, visibility .2s; z-index: 80; }
.drawer-backdrop[data-open="true"] { opacity: 1; visibility: visible; }
.drawer {
    position: fixed; top: 0; right: 0; height: 100%; width: min(370px, 90vw); background: #fff;
    z-index: 90; transform: translateX(100%); visibility: hidden;
    transition: transform .26s var(--ease), visibility .26s; overflow-y: auto;
    box-shadow: var(--shadow-lg); padding: 18px 18px 40px;
}
.drawer[data-open="true"] { transform: translateX(0); visibility: visible; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.drawer-close { width: 40px; height: 40px; border: 1px solid var(--border-strong); border-radius: 10px; background: #fff; font-size: 20px; cursor: pointer; line-height: 1; }
.drawer a.d-link { display: block; padding: 13px 8px; border-bottom: 1px solid var(--border); font-weight: 600; font-size: 15px; }
.drawer details.d-acc summary { list-style: none; cursor: pointer; padding: 13px 8px; border-bottom: 1px solid var(--border); font-weight: 600; font-size: 15px; display: flex; justify-content: space-between; align-items: center; }
.drawer details.d-acc summary::-webkit-details-marker { display: none; }
.drawer details.d-acc[open] summary .caret { transform: rotate(180deg); }
.drawer .d-sub { padding: 6px 8px 12px; }
.drawer .d-sub a { display: block; padding: 8px 10px; color: var(--text-soft); font-size: 14px; border-radius: 8px; }
.drawer .d-sub a:hover { background: var(--surface); }
.drawer .d-cta { display: grid; gap: 10px; margin-top: 18px; }

/* ========================================================================= */
/* Footer: brand close + compact link architecture                            */
/* ========================================================================= */
.site-footer { background: var(--ink); color: var(--on-ink); padding: 0; margin-top: 0; }
.footer-cta {
    display: flex; align-items: center; justify-content: space-between; gap: 22px; flex-wrap: wrap;
    padding: 40px 0 34px; border-bottom: 1px solid var(--border-ink);
}
.footer-cta h2 { color: #fff; font-size: clamp(20px, 2.6vw, 26px); font-weight: 800; letter-spacing: -.02em; max-width: 30ch; }
.footer-cta .f-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.footer-grid { display: grid; grid-template-columns: 1.7fr 1fr 1fr 1.2fr; gap: 30px; padding: 38px 0 8px; }
.site-footer a { color: var(--on-ink-muted); transition: color .14s ease; }
.site-footer a:hover { color: #fff; }
.footer-brand p { color: var(--on-ink-muted); font-size: 14px; margin: 14px 0 16px; max-width: 34ch; }
.footer-brand .f-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.footer-brand .f-tags span { font-size: 12px; color: var(--on-ink-muted); border: 1px solid var(--border-ink); border-radius: 999px; padding: 3px 10px; }
.footer-col h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--on-ink-muted); margin: 0 0 14px; font-family: var(--font); }
.footer-col a { display: block; font-size: 14px; padding: 5px 0; }
.footer-credit { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-top: 32px; padding-top: 22px; border-top: 1px solid var(--border-ink); }
.footer-credit .fc-by { font-size: 13px; color: var(--on-ink-muted); }
.footer-credit .fc-by b { color: #fff; font-weight: 650; }
.footer-credit .fc-mvp { height: 40px; width: auto; opacity: .95; }
.footer-credit .fc-bymmb { margin-left: auto; display: inline-flex; }
.footer-credit .fc-bymmb img { height: 15px; width: auto; opacity: .9; }
.footer-bottom { border-top: 1px solid var(--border-ink); margin-top: 24px; padding: 20px 0 26px; font-size: 12.5px; color: var(--on-ink-muted); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer-bottom .trademark { max-width: 70ch; }

/* ========================================================================= */
/* Motion: tasteful, opt-out aware                                            */
/* ========================================================================= */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
    .reveal { opacity: 1; transform: none; }
}

/* ========================================================================= */
/* Responsive                                                                 */
/* ========================================================================= */
@media (max-width: 1060px) {
    .nav { display: none; }
    .nav-toggle { display: inline-flex; }
}
@media (max-width: 1000px) {
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 26px; }
    .footer-brand { grid-column: 1 / -1; }
    .mgx { grid-template-columns: 1fr; }
    .mgx-side { border-left: 0; border-top: 1px solid var(--border); border-radius: 0; }
}
@media (max-width: 860px) {
    section { padding: 60px 0; }
    .footer-credit .fc-bymmb { margin-left: 0; }
}
@media (max-width: 560px) {
    .container { padding: 0 18px; }
    .footer-grid { grid-template-columns: 1fr; }
    .footer-bottom { flex-direction: column; }
    .footer-cta { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 480px) {
    .card { padding: 20px; }
    .btn-lg { padding: 13px 20px; }
}
