/* Dark, minimal portfolio. Accent comes from Ghost Admin (Settings > Design > Accent color). */
:root {
    --bg: #0d0f12;
    --surface: #15181d;
    --border: #262a31;
    --text: #e6e8eb;
    --muted: #9aa0a8;
    --accent: var(--ghost-accent-color, #ff1a75);
    /* Ghost Admin's Design > Typography picker overrides these when set */
    --sans: var(--gh-font-body, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif);
    --mono: var(--gh-font-heading, ui-monospace, "JetBrains Mono", "Cascadia Code", "SF Mono", Menlo, Consolas, monospace);
    --wide: 1100px;
    --narrow: 720px;
    color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 17px/1.65 var(--sans);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); }
h1, h2, h3, h4 { font-family: var(--mono); line-height: 1.2; letter-spacing: -0.01em; }

.wrap { width: min(var(--wide), 100% - 32px); margin-inline: auto; }
.wrap-narrow { width: min(var(--narrow), 100% - 32px); margin-inline: auto; }
.section { padding-block: 48px; }
.label {
    font: 600 13px/1 var(--mono);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
    margin: 0 0 24px;
}
.label::before { content: "// "; color: var(--accent); }
.back { display: inline-block; text-decoration: none; }
.back::before { content: ""; }

/* Header and footer */
.site-header { border-bottom: 1px solid var(--border); }
.header-inner, .footer-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 24px;
    padding-block: 18px;
}
.site-logo { color: var(--text); font: 700 18px var(--mono); text-decoration: none; }
.site-logo img { max-height: 40px; width: auto; }
.nav { display: flex; flex-wrap: wrap; gap: 8px 0; margin: 0; padding: 0; list-style: none; }
.nav li::before { color: var(--accent); opacity: 0.7; font: 14px var(--mono); }
.nav li + li::before { content: "/"; margin: 0 14px; }
@media (max-width: 600px) {
    /* Phones: one item per line, each prefixed with a slash, instead of slashes at odd wrap points */
    .nav { flex-direction: column; gap: 6px; }
    .nav li::before, .nav li + li::before { content: "/"; margin: 0 10px 0 0; }
}
.nav a { color: var(--muted); font: 14px var(--mono); text-decoration: none; }
.nav a:hover, .nav-current a { color: var(--text); }
.site-footer { border-top: 1px solid var(--border); color: var(--muted); font: 13px var(--mono); margin-top: auto; }

/* Scroll hint: the script in default.hbs adds .is-visible while there is more page below */
.scroll-hint {
    position: fixed;
    left: 50%;
    bottom: 18px;
    z-index: 10;
    translate: -50% 0;
    padding: 6px;
    border: 0;
    border-radius: 50%;
    background: color-mix(in srgb, var(--bg) 70%, transparent);
    color: var(--accent);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s, visibility 0.4s;
}
.scroll-hint.is-visible { opacity: 0.85; visibility: visible; }
.scroll-hint svg { display: block; animation: hint-bob 2.4s ease-in-out infinite; }
@keyframes hint-bob { 50% { transform: translateY(5px); } }
@media (prefers-reduced-motion: reduce) { .scroll-hint svg { animation: none; } }
/* Hero */
.hero { display: grid; gap: 40px; align-items: center; padding-block: 72px 40px; }
@media (min-width: 860px) { .hero:has(.hero-image) { grid-template-columns: 1.1fr 1fr; } }
.hero h1 { font-size: clamp(36px, 6vw, 64px); margin: 0 0 20px; }
.hero-sub { color: var(--muted); font-size: clamp(20px, 2.4vw, 24px); line-height: 1.5; max-width: 52ch; margin: 0 0 32px; }
.hero-image { border-radius: 8px; border: 1px solid var(--border); }
.hero-cover { width: 100%; margin: 0 0 28px; }
.button {
    display: inline-block;
    padding: 12px 22px;
    border: 1px solid var(--accent);
    border-radius: 6px;
    color: var(--text);
    background: color-mix(in srgb, var(--accent) 18%, transparent);
    font: 600 14px var(--mono);
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s;
}
.button:hover { background: var(--accent); }

/* Home page body: any bullet list becomes service cards */
.home-content { padding-block: 8px 24px; }
.home-content ul {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    padding: 0;
    list-style: none;
}
.home-content li {
    margin: 0;
    padding: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--muted);
    font-size: 15px;
}
.home-content li strong { display: block; color: var(--text); font: 700 16px var(--mono); margin-bottom: 6px; }

/* Project cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    color: inherit;
    text-decoration: none;
    transition: border-color 0.15s, transform 0.15s;
}
.card:hover { border-color: var(--accent); transform: translateY(-2px); }
.card img { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; }
.card-body { padding: 16px 18px 20px; }
.card h3 { margin: 0 0 8px; font-size: 18px; }
.card p { margin: 0; color: var(--muted); font-size: 15px; }
.more { margin: 24px 0 0; font: 14px var(--mono); }
.more a { text-decoration: none; }
.pagination { display: flex; justify-content: space-between; margin-top: 32px; font: 14px var(--mono); color: var(--muted); }

/* Articles: project posts and pages */
.article-header { padding-top: 56px; }
.article-header h1 { font-size: clamp(30px, 5vw, 48px); margin: 8px 0 12px; }
.article-sub { color: var(--muted); font-size: 19px; margin: 0; }
.article-image { margin: 40px auto 0; }
.article-image img { border-radius: 8px; width: 100%; }
figcaption { color: var(--muted); font: 13px var(--mono); text-align: center; margin-top: 10px; }

/* Editor content */
.gh-content { padding-block: 40px; }
.gh-content > * { width: min(var(--narrow), 100% - 32px); margin-inline: auto; }
.home-content.gh-content > * { width: auto; }
.gh-content > .kg-width-wide { width: min(var(--wide), 100% - 32px); }
.gh-content > .kg-width-full { width: 100%; }
.gh-content h2 { font-size: 28px; margin-top: 2em; }
.gh-content h3 { font-size: 21px; margin-top: 1.6em; }
.gh-content figure { margin-block: 32px; }
.gh-content img { margin-inline: auto; border-radius: 6px; }
.gh-content blockquote { border-left: 3px solid var(--accent); margin-left: 0; padding-left: 20px; color: var(--muted); }
.gh-content hr { border: 0; border-top: 1px solid var(--border); margin-block: 40px; }
.gh-content code { font: 0.9em var(--mono); background: var(--surface); padding: 2px 6px; border-radius: 4px; }
.gh-content pre { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 16px; overflow-x: auto; }
.gh-content pre code { background: none; padding: 0; }
.gh-content table { border-collapse: collapse; display: block; overflow-x: auto; }
.gh-content th, .gh-content td { border: 1px solid var(--border); padding: 8px 12px; text-align: left; }

/* Forms in HTML cards (contact form) */
.gh-content input, .gh-content textarea {
    width: 100%;
    padding: 10px 12px;
    margin-top: 6px;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 6px;
    font: inherit;
}
.gh-content input:focus, .gh-content textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.gh-content button, .gh-content input[type="submit"] {
    padding: 12px 22px;
    border: 1px solid var(--accent);
    border-radius: 6px;
    background: color-mix(in srgb, var(--accent) 18%, transparent);
    color: var(--text);
    font: 600 14px var(--mono);
    cursor: pointer;
}
.gh-content button:hover { background: var(--accent); }
/* Contact form busy state (assets/js/contact.js): greyed Send button and a spinner beside it */
.form-spinner {
    display: none;
    width: 20px;
    height: 20px;
    margin-left: 14px;
    vertical-align: middle;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
form.is-busy .form-spinner { display: inline-block; }
form.is-busy [type="submit"] { opacity: 0.45; pointer-events: none; cursor: default; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .form-spinner { animation-duration: 2s; } }

/* Contact form result popup (assets/js/contact.js) */
.contact-dialog {
    width: min(420px, 100% - 32px);
    padding: 28px;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-top: 3px solid var(--accent);
    border-radius: 10px;
}
.contact-dialog[open] { animation: dialog-in 0.2s ease-out; }
.contact-dialog::backdrop { background: rgb(0 0 0 / 0.6); }
.contact-dialog h2 { margin: 0 0 8px; font-size: 22px; }
.contact-dialog p { margin: 0 0 24px; color: var(--muted); }
.contact-dialog form { margin: 0; }
@keyframes dialog-in { from { opacity: 0; transform: translateY(8px) scale(0.98); } }
@media (prefers-reduced-motion: reduce) { .contact-dialog[open] { animation: none; } }

/* ALTCHA spam-check widget (assets/js/altcha.min.js), loaded by the contact form's HTML card */
altcha-widget {
    --altcha-color-base: var(--surface);
    --altcha-border-color: var(--border);
    --altcha-color-primary: var(--accent);
}
