/* OptiGein Design documentation.
   Self-contained stylesheet: no web fonts, no CDN, so the folder can be copied
   straight onto the website or opened from disk. */

:root {
    --slate: #1e2a33;
    --slate-soft: #2a3844;
    --teal: #0e7c86;
    --teal-dark: #0a5d65;
    --accent: #16c2c8;
    --page: #ffffff;
    --page-alt: #f4f7f8;
    --border: #d9e2e5;
    --text: #21313b;
    --text-muted: #5d6f7a;
    --note: #eef7f8;
    --warn-bg: #fff6e5;
    --warn-border: #f0d9a6;
    --sidebar-w: 292px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.65;
    color: var(--text);
    background: var(--page);
}

/* ---- Sidebar ---------------------------------------------------------- */

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-w);
    background: var(--slate);
    color: #c9d6dc;
    overflow-y: auto;
    padding-bottom: 40px;
}

.sidebar .brand {
    display: block;
    padding: 22px 24px 18px;
    background: var(--slate-soft);
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.sidebar .brand .name { font-size: 20px; font-weight: 600; color: #ffffff; }
.sidebar .brand .name span { color: var(--accent); }
.sidebar .brand .ver { font-size: 12px; color: #90a4ad; letter-spacing: 0.08em; text-transform: uppercase; }

.sidebar nav { padding: 14px 0; }
.sidebar h3 {
    margin: 18px 24px 6px;
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #7e939d;
    font-weight: 600;
}
.sidebar a {
    display: block;
    padding: 7px 24px;
    color: #c9d6dc;
    text-decoration: none;
    font-size: 14.5px;
    border-left: 3px solid transparent;
}
.sidebar a:hover { background: rgba(255, 255, 255, 0.05); color: #ffffff; }
.sidebar a.current {
    background: rgba(22, 194, 200, 0.12);
    border-left-color: var(--accent);
    color: #ffffff;
    font-weight: 600;
}

/* ---- Page ------------------------------------------------------------- */

main {
    margin-left: var(--sidebar-w);
    padding: 40px 56px 96px;
    max-width: 1080px;
}

.crumbs { font-size: 13.5px; color: var(--text-muted); margin-bottom: 18px; }
.crumbs a { color: var(--teal); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }

h1 { font-size: 34px; line-height: 1.25; margin: 0 0 8px; color: var(--slate); }
h2 {
    font-size: 24px;
    margin: 44px 0 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border);
    color: var(--slate);
}
h3 { font-size: 19px; margin: 30px 0 8px; color: var(--slate); }
h4 { font-size: 16.5px; margin: 22px 0 6px; color: var(--slate); }

.lead { font-size: 18px; color: var(--text-muted); margin: 0 0 26px; }

p { margin: 0 0 14px; }
ul, ol { margin: 0 0 16px; padding-left: 24px; }
li { margin-bottom: 6px; }

a { color: var(--teal); }

code {
    background: var(--page-alt);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1px 5px;
    font-family: Consolas, "Courier New", monospace;
    font-size: 14px;
}

kbd {
    background: #ffffff;
    border: 1px solid #b9c6cc;
    border-bottom-width: 2px;
    border-radius: 4px;
    padding: 1px 6px;
    font-family: Consolas, monospace;
    font-size: 13px;
}

/* ---- Figures ---------------------------------------------------------- */

figure {
    margin: 22px 0 28px;
    padding: 0;
}
figure img {
    display: block;
    max-width: 100%;
    height: auto;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #ffffff;
}
figcaption {
    margin-top: 8px;
    font-size: 13.5px;
    color: var(--text-muted);
    font-style: italic;
}

/* ---- Callouts --------------------------------------------------------- */

.note, .tip, .warn {
    border-radius: 6px;
    padding: 14px 18px;
    margin: 20px 0;
    font-size: 15.5px;
}
.note { background: var(--note); border-left: 4px solid var(--teal); }
.tip { background: #f1f8f1; border-left: 4px solid #3d8a4a; }
.warn { background: var(--warn-bg); border-left: 4px solid #d8a13a; }
.note strong, .tip strong, .warn strong { display: block; margin-bottom: 3px; }

/* ---- Tables ----------------------------------------------------------- */

.table-wrap { overflow-x: auto; margin: 20px 0 26px; }
table { border-collapse: collapse; width: 100%; font-size: 15px; }
th, td { border: 1px solid var(--border); padding: 9px 12px; text-align: left; vertical-align: top; }
th { background: var(--page-alt); font-weight: 600; color: var(--slate); }
tbody tr:nth-child(even) { background: #fbfcfd; }

/* ---- Numbered steps --------------------------------------------------- */

.steps { counter-reset: step; list-style: none; padding-left: 0; }
.steps > li {
    counter-increment: step;
    position: relative;
    padding-left: 46px;
    margin-bottom: 26px;
}
.steps > li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: 1px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--teal);
    color: #ffffff;
    font-weight: 600;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ---- Card grid (index page) ------------------------------------------- */

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(272px, 1fr)); gap: 18px; margin: 26px 0; }
.card {
    display: block;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 18px 20px;
    text-decoration: none;
    color: var(--text);
    background: var(--page);
}
.card:hover { border-color: var(--teal); box-shadow: 0 2px 10px rgba(14, 124, 134, 0.1); }
.card h3 { margin: 0 0 6px; font-size: 17px; color: var(--teal-dark); }
.card p { margin: 0; font-size: 14.5px; color: var(--text-muted); }

/* ---- Video tutorials (tutorials.html) --------------------------------- */

[hidden] { display: none !important; }

.player { margin: 10px 0 8px; scroll-margin-top: 72px; }
.vframe { position: relative; width: 100%; aspect-ratio: 16 / 9; background: var(--slate); border-radius: 8px; overflow: hidden; }
.vframe iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.vnow { margin-top: 8px; font-size: 14.5px; color: var(--text-muted); }
.vnow strong { color: var(--text); }
.vnow a { margin-left: 10px; white-space: nowrap; }

.vlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; margin: 18px 0 26px; }
.vlist:empty { display: none; }
.vitem {
    display: flex; gap: 12px; align-items: flex-start; text-align: left;
    font: inherit; color: var(--text); cursor: pointer;
    border: 1px solid var(--border); border-radius: 8px; padding: 10px; background: var(--page);
}
.vitem:hover { border-color: var(--teal); box-shadow: 0 2px 10px rgba(14, 124, 134, 0.1); }
.vitem.active { border-color: var(--teal); background: var(--note); }
.vitem:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.vthumb { position: relative; flex: 0 0 128px; aspect-ratio: 16 / 9; border-radius: 5px; overflow: hidden; background: var(--slate-soft); }
.vthumb img { display: block; width: 100%; height: 100%; object-fit: cover; border: 0; margin: 0; }
.vplay {
    position: absolute; left: 50%; top: 50%; width: 34px; height: 34px; margin: -17px 0 0 -17px;
    border-radius: 50%; background: rgba(30, 42, 51, 0.78);
}
.vplay::after {
    content: ""; position: absolute; left: 13px; top: 10px;
    border-style: solid; border-width: 7px 0 7px 11px; border-color: transparent transparent transparent #fff;
}
.vitem:hover .vplay, .vitem.active .vplay { background: var(--teal); }
.vtext { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.vtext strong { font-size: 15px; line-height: 1.35; color: var(--teal-dark); }
.vtext > span:last-child { font-size: 13.5px; line-height: 1.45; color: var(--text-muted); }
.vnum { font-size: 12px; font-weight: 600; color: var(--text-muted); }

/* ---- Footer ----------------------------------------------------------- */

.page-nav { display: flex; justify-content: space-between; gap: 16px; margin-top: 54px; padding-top: 20px; border-top: 1px solid var(--border); }
.page-nav a { text-decoration: none; font-weight: 600; }

footer.site {
    margin-top: 40px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
    font-size: 13.5px;
    color: var(--text-muted);
}

/* ---- Mobile top bar + drawer toggle ---------------------------------- */
/* Hidden on desktop; shown as a sticky bar on small screens. */
.docs-topbar {
    display: none;
    position: sticky;
    top: 0;
    z-index: 1100;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: var(--slate);
    color: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}
.docs-topbar .menu-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.docs-topbar .menu-btn:active { background: rgba(255, 255, 255, 0.12); }
.docs-topbar .title { font-size: 17px; font-weight: 600; }
.docs-topbar .title span { color: var(--accent); }

/* Backdrop shown behind the open drawer */
.docs-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1150;
}
.docs-backdrop.open { display: block; }

/* ---- Responsive ------------------------------------------------------- */

@media (max-width: 980px) {
    .docs-topbar { display: flex; }

    /* Sidebar becomes an off-canvas slide-in drawer. */
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 82vw;
        max-width: 320px;
        z-index: 1200;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        box-shadow: 2px 0 18px rgba(0, 0, 0, 0.25);
    }
    .sidebar.open { transform: translateX(0); }

    main {
        margin-left: 0;
        padding: 22px 18px 64px;
        max-width: 100%;
    }

    /* Tighter typography for small screens */
    body { font-size: 15.5px; }
    h1 { font-size: 27px; }
    h2 { font-size: 21px; margin-top: 34px; }
    h3 { font-size: 17.5px; }
    .lead { font-size: 16.5px; }

    /* One-column card grid */
    .cards { grid-template-columns: 1fr; gap: 14px; }

    /* Steps: a touch less indent */
    .steps > li { padding-left: 42px; }

    /* Page nav wraps instead of overflowing */
    .page-nav { flex-direction: column; }
}

@media (max-width: 560px) {
    main { padding: 18px 14px 56px; }
    .vlist { grid-template-columns: 1fr; }
    .vthumb { flex-basis: 104px; }
    h1 { font-size: 23px; }
    h2 { font-size: 19px; }
    body { font-size: 15px; }
    table { font-size: 14px; }
    th, td { padding: 7px 9px; }
    .note, .tip, .warn { padding: 12px 14px; font-size: 14.5px; }
}
