/* Orbsen Keep — design tokens are the source of truth for brand colours/fonts. */

:root {
    --primary: #008264;
    --primary-deep: #003B2B;
    --primary-soft: #4ECCA3;
    --nav-bg: #003B2B;
    --ink: #003B2B;
    --ink-muted: #3d5f54;
    --bg: #E6F7F2;
    --surface: #ffffff;
    --border: #c5e8dc;
    --accent: #4ECCA3;
    --font: "Segoe UI", system-ui, -apple-system, sans-serif;
    --font-display: "Segoe UI", system-ui, -apple-system, sans-serif;
    --radius: 12px;
    --shadow: 0 12px 40px rgba(0, 59, 43, 0.10);
    --max: 1080px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: var(--font);
    color: var(--ink);
    background: var(--bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

main { flex: 1; }

/* --- nav ------------------------------------------------------------- */
header.nav {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--nav-bg);
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 14px 28px;
    flex-wrap: wrap;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06);
}

header.nav .brand {
    font-weight: 700;
    margin-right: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    text-decoration: none;
    letter-spacing: 0.02em;
}

header.nav .brand img { max-height: 38px; }
header.nav .brand-text { display: flex; flex-direction: column; line-height: 1.15; }
header.nav .bt { font-weight: 700; font-size: 1.05rem; }
header.nav .bs { font-size: .7rem; opacity: .85; font-weight: 400; }

/* animated orb mark (green palette) */
.orb-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.orb-svg {
    width: 30px;
    height: 30px;
    overflow: visible;
    filter: drop-shadow(0 0 5px rgba(78, 204, 163, 0.45));
}

.orb-ring {
    transform-origin: 40px 40px;
    animation: orbRingSpin 9s linear infinite;
}

@keyframes orbRingSpin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .orb-ring { animation: none; }
}

header.nav .links { display: flex; gap: 4px; flex-wrap: wrap; }
header.nav .item { position: relative; }

header.nav .item > a {
    display: inline-block;
    text-decoration: none;
    color: #fff;
    opacity: .88;
    font-size: .95rem;
    padding: 8px 12px;
    border-radius: 6px;
    transition: opacity .15s ease, background .15s ease;
}

header.nav .item > a:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
}

header.nav .sub {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--nav-bg);
    padding: 8px;
    border-radius: 0 0 8px 8px;
    min-width: 170px;
    flex-direction: column;
    gap: 4px;
    box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .2);
    z-index: 20;
}

header.nav .item:hover .sub,
header.nav .item:focus-within .sub { display: flex; }

header.nav .sub a {
    color: #fff;
    opacity: .85;
    text-decoration: none;
    font-size: .9rem;
    padding: 4px 6px;
}

header.nav .sub a:hover { opacity: 1; }

.nt { display: none; }

.hamb {
    display: none;
    cursor: pointer;
    color: #fff;
    font-size: 1.5rem;
    line-height: 1;
    user-select: none;
}

@media (max-width: 768px) {
    .hamb { display: block; }
    header.nav .links {
        display: none;
        flex-basis: 100%;
        flex-direction: column;
        gap: 6px;
        padding-top: 8px;
    }
    .nt:checked ~ .links { display: flex; }
    header.nav .sub {
        position: static;
        display: flex;
        padding: 2px 0 2px 16px;
        box-shadow: none;
        background: transparent;
    }
}

/* --- hero ------------------------------------------------------------ */
.hero {
    position: relative;
    background:
        radial-gradient(ellipse 80% 60% at 50% 0%, var(--primary-soft) 0%, transparent 55%),
        linear-gradient(165deg, var(--primary) 0%, var(--primary-deep) 100%);
    color: #fff;
    padding: 120px 24px 110px;
    text-align: center;
    overflow: hidden;
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 15% 80%, rgba(78, 204, 163, 0.18) 0%, transparent 40%),
        radial-gradient(circle at 85% 30%, rgba(255, 255, 255, 0.08) 0%, transparent 35%);
    pointer-events: none;
}

.hero-inner {
    position: relative;
    max-width: 720px;
    margin: 0 auto;
}

.hero .eyebrow {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    opacity: 0.85;
    margin: 0 0 1.1rem;
    padding: 6px 14px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
}

.hero h1 {
    font-family: var(--font-display);
    font-size: clamp(2.4rem, 5vw, 3.4rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.12;
    margin: 0 0 1rem;
}

.hero .lede {
    opacity: 0.92;
    font-size: clamp(1.1rem, 2vw, 1.35rem);
    margin: 0 auto;
    max-width: 28em;
    font-weight: 400;
    line-height: 1.5;
}

.hero-rule {
    width: 48px;
    height: 3px;
    background: var(--accent);
    border-radius: 2px;
    margin: 1.75rem auto 0;
}

/* --- page head (inner pages) ---------------------------------------- */
.page-head {
    background: linear-gradient(165deg, var(--primary) 0%, var(--primary-deep) 100%);
    color: #fff;
    padding: 56px 24px;
    text-align: center;
}

.page-head h1 {
    margin: 0;
    font-size: clamp(1.75rem, 3vw, 2.15rem);
    letter-spacing: -0.01em;
}

/* --- content --------------------------------------------------------- */
.prose {
    max-width: 720px;
    margin: 0 auto;
    padding: 64px 24px 80px;
}

.prose h2 {
    margin-top: 0;
    font-size: 1.5rem;
    letter-spacing: -0.01em;
    color: var(--ink);
}

.prose p {
    color: var(--ink-muted);
    font-size: 1.1rem;
    line-height: 1.7;
    margin: 0 0 1.1em;
}

.prose p:last-child { margin-bottom: 0; }
.prose a { color: var(--primary); }

.welcome-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 40px 36px;
    text-align: center;
}

.welcome-card p {
    font-size: 1.25rem;
    color: var(--ink);
    margin: 0;
}

.welcome-card .mark {
    display: block;
    width: 40px;
    height: 3px;
    background: var(--primary);
    border-radius: 2px;
    margin: 0 auto 1.25rem;
}

/* --- buttons / steps / demo ------------------------------------------ */
.btn {
    display: inline-block;
    appearance: none;
    border: none;
    cursor: pointer;
    font: inherit;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.65rem 1.15rem;
    border-radius: 8px;
    background: var(--primary);
    color: #fff;
    text-decoration: none;
    transition: background .15s ease, transform .1s ease;
}

.btn:hover { background: var(--primary-soft); }
.btn:active { transform: translateY(1px); }

.btn-on-dark {
    background: #fff;
    color: var(--primary-deep);
}

.btn-on-dark:hover {
    background: var(--accent);
    color: var(--primary-deep);
}

.hero-cta { margin: 1.75rem 0 0; }

.cta-row { margin-top: 1.75rem; }

.steps {
    color: var(--ink-muted);
    font-size: 1.05rem;
    line-height: 1.7;
    padding-left: 1.25rem;
    margin: 0 0 1.25rem;
}

.steps li { margin-bottom: 0.6rem; }
.steps strong { color: var(--ink); }

.demo-page { max-width: 960px; }

.demo-page .lede-inline {
    font-size: 1.1rem;
    color: var(--ink-muted);
    margin-bottom: 1.75rem;
}

.how-to h2 {
    margin-bottom: 1rem;
}

.how-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 1rem;
}

@media (max-width: 700px) {
    .how-grid { grid-template-columns: 1fr; }
}

.how-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.1rem 1.2rem 1.2rem;
    box-shadow: 0 4px 16px rgba(0, 59, 43, 0.05);
}

.how-card h3 {
    margin: 0 0 0.6rem;
    font-size: 1.05rem;
    color: var(--primary-deep);
}

.how-card ol {
    margin: 0;
    padding-left: 1.15rem;
    color: var(--ink-muted);
    font-size: 0.95rem;
}

.how-card li { margin-bottom: 0.4rem; }

.how-summary {
    font-size: 1rem !important;
    color: var(--ink) !important;
    background: rgba(0, 130, 100, 0.06);
    border-left: 3px solid var(--primary);
    padding: 0.75rem 1rem;
    border-radius: 0 8px 8px 0;
}

.demo-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-top: 2rem;
    align-items: stretch;
}

@media (max-width: 700px) {
    .demo-panel { grid-template-columns: 1fr; }
}

.demo-box {
    margin: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    padding: 1.6rem 1.35rem 1.4rem;
    box-shadow: var(--shadow);
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.demo-box legend {
    font-weight: 700;
    color: var(--primary-deep);
    padding: 0 0.4rem;
    margin-left: 0.15rem;
    float: left;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 0.85rem;
}

.demo-box::after {
    content: "";
    display: table;
    clear: both;
}

.demo-box .demo-fields {
    flex: 1 1 auto;
    display: grid;
    grid-template-rows: auto auto auto auto;
    align-content: start;
    row-gap: 0.85rem;
    min-height: 0;
}

.demo-box .demo-slot {
    min-width: 0;
    min-height: 4.5rem;
}

.demo-box .demo-slot-spacer {
    visibility: hidden;
    pointer-events: none;
}

.demo-box label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--ink);
    margin: 0;
}

.demo-box .hint {
    font-weight: 400;
    color: var(--ink-muted);
}

.demo-box input[type="text"] {
    width: 100%;
    box-sizing: border-box;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.9rem;
    margin: 0.3rem 0 0;
    padding: 0.55rem 0.7rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    color: var(--ink);
}

.demo-box input[type="text"]:focus {
    outline: 2px solid var(--accent);
    border-color: var(--primary-soft);
}

.demo-box .btn-row {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
    margin: 0.15rem 0 0;
}

.demo-box .btn-sm {
    margin: 0;
    padding: 0.4rem 0.85rem;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.demo-box .btn-desc {
    font-size: 0.85rem;
    color: var(--ink-muted);
    line-height: 1.35;
}

.demo-box code.out {
    display: block;
    background: var(--bg);
    border: 1px dashed var(--border);
    border-radius: 8px;
    padding: 0.6rem 0.75rem;
    word-break: break-all;
    min-height: 1.4em;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.85rem;
    color: var(--ink);
    margin-top: 0.3rem;
    flex: 1;
    min-width: 0;
}

.demo-box .out-row {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-top: 0.3rem;
}

.demo-box .out-row code.out { margin-top: 0; }

.demo-box .btn-copy {
    appearance: none;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--primary-deep);
    font: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.45rem 0.7rem;
    border-radius: 8px;
    cursor: pointer;
    flex-shrink: 0;
    line-height: 1.2;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.demo-box .btn-copy:hover {
    background: rgba(0, 130, 100, 0.08);
    border-color: var(--primary-soft);
}

.demo-box .btn-copy.is-copied {
    background: rgba(34, 120, 72, 0.12);
    border-color: #2f8f57;
    color: #1f6b40;
}

.demo-box .lock-status,
.demo-box .demo-result {
    margin-top: auto;
    padding-top: 0.85rem;
}

.demo-box .lock-status {
    margin-bottom: 0;
    padding: 0.6rem 0.75rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: #1f6b40;
    background: rgba(34, 120, 72, 0.1);
    border: 1px solid rgba(47, 143, 87, 0.35);
    border-radius: 8px;
}

.demo-box .key-note {
    margin: 0.4rem 0 0;
    font-size: 0.85rem;
    color: var(--ink-muted);
    font-weight: 400;
}

.demo-box code.door-out.is-ok {
    color: #1f6b40;
    background: rgba(34, 120, 72, 0.1);
    border-style: solid;
    border-color: rgba(47, 143, 87, 0.4);
    font-weight: 700;
}

.demo-box code.door-out.is-fail {
    color: #8a2f3a;
    background: rgba(160, 50, 60, 0.08);
    border-style: solid;
    border-color: rgba(160, 50, 60, 0.28);
}

/* --- footer ---------------------------------------------------------- */
footer.foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 28px 28px;
    font-size: .85rem;
    flex-wrap: wrap;
    border-top: 1px solid var(--border);
    color: var(--ink-muted);
    background: var(--surface);
}

footer.foot .tag {
    opacity: 0.85;
}

/* --- shared layout helpers (blog + admin) ---------------------------- */
.section {
    max-width: var(--max);
    margin: 0 auto;
    padding: 48px 24px 64px;
}

.page-head .lede {
    margin: 14px auto 0;
    max-width: 36em;
    color: rgba(255, 255, 255, 0.88);
    font-size: 1.05rem;
}

.card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.card-interactive {
    transition: transform .15s ease, box-shadow .15s ease;
}

.card-interactive:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 48px rgba(0, 59, 43, 0.14);
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-soft);
    color: #fff;
}

.btn-secondary {
    background: transparent;
    color: var(--primary-deep);
    border: 1px solid var(--primary);
}

.btn-secondary:hover {
    background: rgba(0, 130, 100, 0.08);
    color: var(--primary-deep);
}

footer.foot .foot-links {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

footer.foot .foot-links a {
    color: var(--ink-muted);
    text-decoration: none;
    font-size: .85rem;
}

footer.foot .foot-links a:hover {
    color: var(--primary);
}

/* --- blog (public) --------------------------------------------------- */
.blog-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 760px;
    margin: 0 auto;
}

.blog-card {
    padding: 0;
    overflow: hidden;
}

.blog-card-cover-link {
    display: block;
    line-height: 0;
}

.blog-card-cover {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    background: var(--bg);
}

.blog-card-body {
    padding: 28px 32px;
}

.blog-date {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--primary);
    margin-bottom: 10px;
}

.blog-card-title {
    font-size: 1.35rem;
    margin: 0 0 12px;
    line-height: 1.25;
    letter-spacing: -0.01em;
}

.blog-card-title a {
    color: var(--ink);
    text-decoration: none;
}

.blog-card-title a:hover {
    color: var(--primary);
}

.blog-card-summary {
    color: var(--ink-muted);
    font-size: 1rem;
    line-height: 1.65;
    margin: 0 0 14px;
}

.blog-readmore {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--primary);
    text-decoration: none;
}

.blog-readmore:hover {
    color: var(--primary-deep);
}

.blog-date-on-dark {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    margin: 0 0 12px;
}

.blog-feature {
    max-width: 760px;
    margin: -24px auto 0;
    padding: 0 24px;
}

.blog-feature-img {
    display: block;
    width: 100%;
    max-height: 420px;
    object-fit: cover;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.blog-body {
    padding-top: 40px;
}

.blog-body h2,
.blog-body h3 {
    margin-top: 1.6em;
    color: var(--ink);
}

.blog-body ul,
.blog-body ol {
    color: var(--ink-muted);
    padding-left: 1.4em;
    margin: 0 0 1em;
}

.blog-body blockquote {
    margin: 1.2em 0;
    padding: 12px 20px;
    border-left: 3px solid var(--primary);
    background: rgba(0, 130, 100, 0.06);
    color: var(--ink-muted);
    border-radius: 0 8px 8px 0;
}

.blog-body pre {
    background: var(--primary-deep);
    color: #fff;
    padding: 16px 18px;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 0.9rem;
}

.blog-body code {
    font-size: 0.92em;
}

.blog-back {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.blog-back a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

.blog-back a:hover {
    color: var(--primary-deep);
}

/* --- admin ----------------------------------------------------------- */
.admin-panel {
    max-width: 720px;
    margin: 0 auto;
    padding: 32px;
}

.admin-panel-wide {
    max-width: 860px;
}

.admin-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 28px;
    max-width: 960px;
    margin-inline: auto;
}

.admin-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.admin-form .field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.admin-form label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--ink);
}

.admin-form .hint {
    font-weight: 400;
    color: var(--ink-muted);
}

.admin-form input[type="text"],
.admin-form input[type="email"],
.admin-form input[type="password"],
.admin-form input[type="date"],
.admin-form input[type="url"],
.admin-form input[type="number"],
.admin-form textarea {
    font: inherit;
    font-size: 1rem;
    color: var(--ink);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 14px;
    width: 100%;
}

.admin-form input:focus-visible,
.admin-form textarea:focus-visible {
    outline: 2px solid var(--accent);
    border-color: var(--primary-soft);
}

.admin-body {
    min-height: 280px;
    line-height: 1.65;
    resize: vertical;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.95rem;
}

.admin-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 8px;
}

.admin-fieldset {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 22px 22px;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 18px;
    background: var(--bg);
}

.admin-fieldset legend {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--primary-deep);
    padding: 0 8px;
}

.admin-form .field-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
}

.field-error {
    color: #8a2f3a;
    font-size: 0.85rem;
}

.admin-error {
    background: #fdecea;
    color: #8a2f3a;
    border: 1px solid #f0c2be;
    border-radius: 8px;
    padding: 12px 14px;
    margin: 0 0 18px;
}

.admin-status {
    max-width: 960px;
    margin: 0 auto 20px;
    background: rgba(34, 120, 72, 0.1);
    color: #1f6b40;
    border: 1px solid rgba(47, 143, 87, 0.35);
    border-radius: 8px;
    padding: 12px 14px;
}

.admin-table-wrap {
    max-width: 960px;
    margin: 0 auto;
    padding: 0;
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.admin-table th,
.admin-table td {
    text-align: left;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.admin-table th {
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-muted);
    font-weight: 700;
    background: var(--bg);
}

.admin-table tr:last-child td {
    border-bottom: none;
}

.admin-table code {
    font-size: 0.9em;
    color: var(--ink-muted);
}

.admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    white-space: nowrap;
}

.admin-actions a {
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
}

.admin-actions a:hover {
    color: var(--primary-deep);
}

.inline-form {
    display: inline;
    margin: 0;
}

button.linkish {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    font-weight: 600;
    color: var(--primary);
    cursor: pointer;
}

button.linkish:hover {
    color: var(--primary-deep);
}

button.linkish.danger {
    color: #8a2f3a;
}

button.linkish.danger:hover {
    color: #6a1f28;
}

.admin-badge-row {
    margin: 0 0 8px;
}

.status-pill {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border-radius: 999px;
    padding: 4px 10px;
    line-height: 1.2;
}

.status-live {
    background: rgba(34, 120, 72, 0.1);
    color: #1f6b40;
    border: 1px solid rgba(47, 143, 87, 0.35);
}

.status-draft {
    background: rgba(0, 59, 43, 0.06);
    color: var(--ink-muted);
    border: 1px solid var(--border);
}

.welcome-card h2 {
    margin: 0 0 0.65rem;
    font-size: 1.35rem;
    color: var(--ink);
}
