/* lemon-dark: dark, techy theme for lemon.zone. No external fonts or requests. */

:root {
    --bg: #0b0d10;
    --bg-2: #12151a;
    --bg-3: #181c23;
    --line: #242a33;
    --text: #d6dde6;
    --dim: #8b95a5;
    --accent: #ffd60a;
    --accent-soft: rgba(255, 214, 10, 0.12);
    --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Code", Menlo, Consolas, monospace;
    --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-heading: var(--gh-font-heading, var(--mono));
    --font-body: var(--gh-font-body, var(--sans));
    --radius: 10px;
}

*, *::before, *::after { box-sizing: border-box; }

/* No page-level color-scheme: declaring "dark" makes browsers paint opaque white behind
   Ghost's comments/pop-up iframes. The theme is dark by design, so style the scrollbar by hand. */
html { background: var(--bg); scrollbar-color: #343c47 var(--bg); -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background:
        radial-gradient(1200px 500px at 85% -10%, rgba(255, 214, 10, 0.06), transparent 60%),
        linear-gradient(var(--bg), var(--bg));
    color: var(--text);
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 1.7;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.site-main { flex: 1 0 auto; }

.bg-canvas { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.site-main, .site-footer { position: relative; z-index: 1; }

::selection { background: var(--accent); color: #000; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
img { max-width: 100%; height: auto; display: block; }
.dim { color: var(--dim); }

.wrap { width: min(1100px, 92vw); margin: 0 auto; }
.wrap-narrow { width: min(720px, 92vw); margin: 0 auto; }

/* ---------- header ---------- */
.site-header {
    position: sticky; top: 0; z-index: 20;
    background: rgba(11, 13, 16, 0.85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 24px; height: 64px; }
.brand { font-family: var(--mono); font-weight: 700; font-size: 1.05rem; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand img { height: 28px; width: auto; }
.brand-prompt { color: var(--accent); }
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand-mark { width: 32px; height: 32px; image-rendering: pixelated; transition: transform 0.18s steps(3); }
.brand:hover .brand-mark { transform: translateY(-2px) rotate(-6deg); }
@media (prefers-reduced-motion: reduce) { .brand-mark { transition: none; } .brand:hover .brand-mark { transform: none; } }

.brand-cursor { color: var(--accent); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.site-nav { flex: 1; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 22px; }
.site-nav a { font-family: var(--mono); font-size: 0.9rem; color: var(--dim); }
.site-nav a:hover, .site-nav .nav-current a { color: var(--text); text-decoration: none; }

.btn {
    display: inline-block;
    font-family: var(--mono); font-size: 0.85rem; font-weight: 600;
    padding: 8px 16px; border-radius: 8px;
    border: 1px solid var(--line); background: var(--bg-2); color: var(--text);
    cursor: pointer;
}
.btn:hover { border-color: var(--accent); text-decoration: none; }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #0b0d10; }
.btn-accent:hover { filter: brightness(1.08); }

/* ---------- terminal hero ---------- */
.terminal {
    margin: 48px 0 40px;
    border: 1px solid var(--line); border-radius: var(--radius);
    background: var(--bg-2);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
    overflow: hidden;
}
.terminal-bar {
    display: flex; align-items: center; gap: 7px;
    padding: 10px 14px; background: var(--bg-3); border-bottom: 1px solid var(--line);
    font-family: var(--mono); font-size: 0.75rem; color: var(--dim);
}
.terminal-bar i { width: 11px; height: 11px; border-radius: 50%; background: #3a414d; }
.terminal-bar i:first-child { background: #ff5f57; }
.terminal-bar i:nth-child(2) { background: #febc2e; }
.terminal-bar i:nth-child(3) { background: #28c840; }
.terminal-bar span { margin-left: 10px; }
.terminal-body { padding: 26px 28px 30px; font-family: var(--mono); }
.line { margin: 0; color: var(--text); font-size: 0.95rem; }
.hero-title {
    margin: 10px 0 6px; font-size: clamp(2rem, 6vw, 3.4rem); line-height: 1.1;
    color: var(--accent); letter-spacing: -0.02em;
}
.hero-sub { margin: 0 0 18px; color: var(--dim); font-family: var(--sans); font-size: 1.05rem; max-width: 60ch; }

/* ---------- post grid / cards ---------- */
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 22px; margin: 28px 0; }
.card {
    display: flex; flex-direction: column;
    background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius);
    overflow: hidden; transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 10px 30px var(--accent-soft); }
.card-image img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.card-body { padding: 18px 20px 22px; }
.card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; font-family: var(--mono); font-size: 0.75rem; color: var(--dim); }
.tag-chip { padding: 2px 8px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); }
.tag-chip:hover { text-decoration: none; background: rgba(255, 214, 10, 0.2); }
.card-title { margin: 12px 0 8px; font-family: var(--font-heading); font-size: 1.2rem; line-height: 1.3; }
.card-title a { color: var(--text); }
.card-title a:hover { color: var(--accent); text-decoration: none; }
.card-excerpt { margin: 0; color: var(--dim); font-size: 0.95rem; }

.archive-head { margin: 48px 0 12px; }
.archive-title { margin: 8px 0; font-family: var(--font-heading); font-size: clamp(1.8rem, 5vw, 2.6rem); color: var(--accent); }

.pagination.is-single { display: none; }
.pagination { display: flex; align-items: center; justify-content: space-between; margin: 36px 0; font-family: var(--mono); font-size: 0.85rem; }

/* ---------- article ---------- */
.article-head { padding: 56px 0 24px; }
.article-title { margin: 14px 0 12px; font-family: var(--font-heading); font-size: clamp(1.9rem, 5.5vw, 3rem); line-height: 1.15; letter-spacing: -0.02em; }
.article-excerpt { margin: 0 0 12px; font-size: 1.2rem; color: var(--dim); }
.article-byline { margin: 0; font-family: var(--mono); font-size: 0.85rem; }
.article-image { margin: 12px auto 32px; }
.article-image img { width: 100%; border-radius: var(--radius); border: 1px solid var(--line); }
.article-image figcaption { margin-top: 8px; text-align: center; font-size: 0.85rem; color: var(--dim); }

.gh-content { padding-bottom: 24px; }
.gh-content > * + * { margin-top: 1.3em; margin-bottom: 0; }
.gh-content h2, .gh-content h3, .gh-content h4 { font-family: var(--font-heading); line-height: 1.25; margin-top: 2em; }
.gh-content h2 { font-size: 1.6rem; }
.gh-content h3 { font-size: 1.25rem; }
.gh-content h2::before { content: "## "; color: var(--accent); }
.gh-content h3::before { content: "### "; color: var(--accent); }
.gh-content a { text-decoration: underline; text-underline-offset: 3px; }
.gh-content blockquote { margin-left: 0; padding: 4px 0 4px 20px; border-left: 3px solid var(--accent); color: var(--dim); }
.gh-content hr { border: 0; border-top: 1px dashed var(--line); margin: 2.4em 0; }
.gh-content ul, .gh-content ol { padding-left: 1.4em; }
.gh-content code {
    font-family: var(--mono); font-size: 0.88em; padding: 2px 6px;
    background: var(--bg-3); border: 1px solid var(--line); border-radius: 5px; color: #ffe566;
}
.gh-content pre {
    position: relative; overflow-x: auto; padding: 16px 18px;
    background: var(--bg-2); border: 1px solid var(--line); border-left: 3px solid var(--accent);
    border-radius: 8px; line-height: 1.55;
}
.gh-content pre code { padding: 0; background: none; border: 0; color: var(--text); font-size: 0.88rem; }
.copy-btn {
    position: absolute; top: 8px; right: 8px; padding: 3px 9px;
    font-family: var(--mono); font-size: 0.7rem; color: var(--dim);
    background: var(--bg-3); border: 1px solid var(--line); border-radius: 6px; cursor: pointer;
}
.copy-btn:hover { color: var(--accent); border-color: var(--accent); }
.gh-content table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.gh-content th, .gh-content td { padding: 8px 12px; border: 1px solid var(--line); text-align: left; }
.gh-content th { background: var(--bg-2); font-family: var(--mono); }
.gh-content img { border-radius: 8px; }
.gh-content figcaption { margin-top: 8px; text-align: center; font-size: 0.85rem; color: var(--dim); }

/* Koenig editor width classes (required by Ghost themes) */
.gh-content .kg-width-wide {
    position: relative; width: 85vw; min-width: 100%; max-width: 1000px;
    margin-left: 50%; transform: translateX(-50%);
}
.gh-content .kg-width-full {
    position: relative; width: 100vw; min-width: 100vw;
    margin-left: 50%; transform: translateX(-50%);
}
.gh-content .kg-width-full img { border-radius: 0; }


/* Ghost's comments and search draw in iframes. Because this page declares color-scheme: dark,
   browsers paint an opaque white behind iframes whose own scheme differs. Match them so they stay transparent. */
iframe { color-scheme: normal; }

/* ---------- subscribe call-to-action ---------- */
.cta {
    margin: 40px 0; padding: 26px 28px;
    background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius);
    background-image: radial-gradient(500px 160px at 100% 0%, var(--accent-soft), transparent 70%);
}
.cta-title { margin: 0 0 6px; font-family: var(--font-heading); font-size: 1.15rem; }
.cta p { margin: 0 0 16px; color: var(--dim); }


/* ---------- contact form ---------- */
.contact { padding-bottom: 24px; }
.contact-form { display: grid; gap: 18px; }
.field { display: grid; gap: 6px; font-family: var(--mono); font-size: 0.8rem; color: var(--dim); }
.field input, .field textarea {
    width: 100%; padding: 12px 14px;
    font: inherit; font-family: var(--font-body); font-size: 1rem; color: var(--text);
    background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px;
}
.field textarea { resize: vertical; min-height: 140px; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.contact-form .btn { justify-self: start; padding: 10px 22px; font-size: 0.9rem; }
.contact-form .btn[disabled] { opacity: 0.6; cursor: wait; }
.form-status { margin: 0; min-height: 1.5em; font-family: var(--mono); font-size: 0.85rem; color: var(--dim); }
.form-status.is-ok { color: var(--accent); }
.form-status.is-error { color: #ff7b72; }


/* ---------- store ---------- */
.store { padding-bottom: 24px; }
.store-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 22px; margin: 24px 0; }
.product { display: flex; flex-direction: column; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s; }
.product:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 10px 30px var(--accent-soft); }
.product-image { aspect-ratio: 1 / 1; width: 100%; object-fit: cover; background: var(--bg-3); }
.product-body { display: flex; flex: 1; flex-direction: column; gap: 8px; padding: 16px 18px 18px; }
.product-name { margin: 0; font-family: var(--font-heading); font-size: 1.1rem; }
.product-desc { margin: 0; color: var(--dim); font-size: 0.92rem; flex: 1; }
.product-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 6px; }
.product-price { font-family: var(--mono); font-weight: 700; color: var(--accent); }
.product .btn { padding: 8px 16px; }
.product .btn.is-disabled { opacity: 0.55; cursor: default; pointer-events: none; }
.store-empty { margin: 36px 0; padding: 22px 26px; font-family: var(--mono); font-size: 0.95rem; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); }
.store-note { margin: 8px 0 0; font-size: 0.8rem; }

/* ---------- footer ---------- */
.site-footer { margin-top: 72px; border-top: 1px solid var(--line); }
.footer-inner { display: flex; flex-wrap: wrap; gap: 14px 28px; align-items: center; padding: 26px 0 40px; font-family: var(--mono); font-size: 0.8rem; }
.footer-nav { flex: 1; }
.footer-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 18px; }
.footer-nav a { color: var(--dim); }

.error { padding-bottom: 40px; }

@media (max-width: 720px) {
    .header-inner { gap: 12px; }
    .site-nav ul { gap: 14px; }
    .terminal-body { padding: 20px; }
    body { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
    .brand-cursor { animation: none; }
    .card { transition: none; }
}

/* ---------- easter egg (tap the header lemon 5 times) ---------- */
.brand-mark.is-tapped { animation: lz-wobble 0.25s steps(3); }
@keyframes lz-wobble { 33% { transform: rotate(-14deg) scale(1.1); } 66% { transform: rotate(10deg) scale(1.1); } }
.lz-egg { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; background: rgba(5, 6, 8, 0.8); backdrop-filter: blur(4px); }
.lz-egg-box { display: flex; flex-direction: column; width: min(520px, 100%); height: min(640px, calc(100dvh - 32px)); background: var(--bg-2); border: 1px solid var(--accent); border-radius: var(--radius); overflow: hidden; box-shadow: 0 0 40px rgba(255, 214, 10, 0.15); }
.lz-egg-bar { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; border-bottom: 1px solid var(--line); font-family: var(--mono); font-size: 0.8rem; color: var(--dim); }
.lz-egg-close { background: none; border: 0; color: var(--text); font-size: 1.4rem; line-height: 1; cursor: pointer; padding: 0 4px; }
.lz-egg-close:hover { color: var(--accent); }
.lz-egg-canvas { display: block; flex: 1; touch-action: none; cursor: none; }
@media (prefers-reduced-motion: reduce) { .brand-mark.is-tapped { animation: none; } }
