/* ==========================================================================
   Lion Code — main stylesheet
   Dark developer theme. Design tokens up top; everything derives from them.
   ========================================================================== */

:root {
    --bg: #0c0e11;
    --bg-raised: #12151a;
    --bg-card: #14181e;
    --text: #e9e7e2;
    --muted: #a09d94;
    --faint: #6d6b64;
    --accent: #e8a33d;
    --accent-soft: rgba(232, 163, 61, 0.12);
    --line: rgba(255, 255, 255, 0.08);
    --line-strong: rgba(255, 255, 255, 0.16);
    --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
    --container: 1100px;
    --radius: 10px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 90px;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 17px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

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

.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 24px;
}

/* --------------------------------------------------------------------------
   Typography helpers
   -------------------------------------------------------------------------- */

h1, h2, h3, h4 {
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
}

.eyebrow {
    font-family: var(--font-mono);
    font-size: 13px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
    display: block;
    margin-bottom: 14px;
}

.section-title {
    font-size: clamp(28px, 4vw, 40px);
    margin-bottom: 18px;
}

.section-intro {
    color: var(--muted);
    max-width: 640px;
    margin-bottom: 48px;
}

.mono {
    font-family: var(--font-mono);
}

/* --------------------------------------------------------------------------
   Header / navigation
   -------------------------------------------------------------------------- */

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(12, 14, 17, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s ease;
}

.site-header.scrolled {
    border-bottom-color: var(--line);
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-weight: 700;
    font-size: 18px;
    letter-spacing: 0.02em;
}

.brand:hover {
    text-decoration: none;
}

.brand img {
    height: 34px;
    width: auto;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
    list-style: none;
}

.nav-links a {
    color: var(--muted);
    font-size: 15px;
    font-weight: 500;
    transition: color 0.2s ease;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text);
    text-decoration: none;
}

.nav-links a.nav-cta {
    color: var(--accent);
    border: 1px solid var(--accent);
    padding: 8px 18px;
    border-radius: 999px;
    transition: background 0.2s ease, color 0.2s ease;
}

.nav-links a.nav-cta:hover {
    background: var(--accent);
    color: #0c0e11;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text);
    margin: 5px 0;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.hero {
    position: relative;
    padding: 200px 0 120px;
    overflow: hidden;
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 700px 500px at 75% 10%, rgba(232, 163, 61, 0.09), transparent 65%),
        linear-gradient(var(--line) 1px, transparent 1px),
        linear-gradient(90deg, var(--line) 1px, transparent 1px);
    background-size: auto, 56px 56px, 56px 56px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.9), transparent 90%);
    -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.9), transparent 90%);
    pointer-events: none;
}

.hero .container {
    position: relative;
}

.hero-tag {
    font-family: var(--font-mono);
    font-size: 14px;
    color: var(--faint);
    margin-bottom: 22px;
}

.hero-tag .prompt {
    color: var(--accent);
}

.hero h1 {
    font-size: clamp(38px, 6.5vw, 68px);
    max-width: 800px;
    margin-bottom: 26px;
}

.hero h1 em {
    font-style: normal;
    color: var(--accent);
}

.hero-sub {
    font-size: clamp(17px, 2vw, 20px);
    color: var(--muted);
    max-width: 620px;
    margin-bottom: 40px;
}

.hero-actions {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 13px 28px;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.btn:hover {
    text-decoration: none;
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--accent);
    color: #0c0e11;
}

.btn-primary:hover {
    background: #f0b155;
}

.btn-ghost {
    color: var(--text);
    border-color: var(--line-strong);
}

.btn-ghost:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* --------------------------------------------------------------------------
   Sections
   -------------------------------------------------------------------------- */

.section {
    padding: 100px 0;
}

.section.alt {
    background: var(--bg-raised);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

/* --------------------------------------------------------------------------
   About
   -------------------------------------------------------------------------- */

.about-grid {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 60px;
    align-items: start;
}

.about-photo {
    position: relative;
}

.about-photo img {
    border-radius: var(--radius);
    filter: saturate(0.85);
}

.about-photo::after {
    content: "";
    position: absolute;
    inset: 14px -14px -14px 14px;
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    opacity: 0.35;
    z-index: -1;
}

.about-text p {
    color: var(--muted);
    margin-bottom: 18px;
}

.about-text p strong {
    color: var(--text);
}

.about-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 28px;
    padding: 0;
    list-style: none;
}

.about-facts li {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--muted);
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    padding: 6px 14px;
}

/* --------------------------------------------------------------------------
   Services
   -------------------------------------------------------------------------- */

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.service-card {
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 30px 26px;
    transition: border-color 0.25s ease, transform 0.25s ease;
}

.service-card:hover {
    border-color: var(--accent);
    transform: translateY(-3px);
}

.service-card .icon {
    font-family: var(--font-mono);
    font-size: 15px;
    color: var(--accent);
    background: var(--accent-soft);
    display: inline-block;
    padding: 8px 12px;
    border-radius: 8px;
    margin-bottom: 18px;
}

.service-card h3 {
    font-size: 19px;
    margin-bottom: 10px;
}

.service-card p {
    color: var(--muted);
    font-size: 15px;
}

/* --------------------------------------------------------------------------
   Projects
   -------------------------------------------------------------------------- */

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
}

.project-card {
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 30px 28px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition: border-color 0.25s ease, transform 0.25s ease;
}

.project-card:hover {
    border-color: var(--line-strong);
    transform: translateY(-3px);
}

.project-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.project-card h3 {
    font-size: 20px;
}

.project-card h3 a {
    color: var(--text);
}

.project-card h3 a:hover {
    color: var(--accent);
    text-decoration: none;
}

.project-type {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--faint);
    white-space: nowrap;
}

.project-card p {
    color: var(--muted);
    font-size: 15px;
    flex-grow: 1;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
}

.tags li {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--accent);
    background: var(--accent-soft);
    border-radius: 6px;
    padding: 4px 10px;
}

.project-link {
    font-size: 14px;
    font-weight: 600;
}

/* --------------------------------------------------------------------------
   Open source strip
   -------------------------------------------------------------------------- */

.oss-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    list-style: none;
}

.oss-list a {
    display: block;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px 24px;
    color: var(--text);
    transition: border-color 0.25s ease;
}

.oss-list a:hover {
    border-color: var(--accent);
    text-decoration: none;
}

.oss-list .repo {
    font-family: var(--font-mono);
    font-size: 15px;
    color: var(--accent);
    margin-bottom: 6px;
}

.oss-list .desc {
    font-size: 14px;
    color: var(--muted);
}

/* --------------------------------------------------------------------------
   Client logos
   -------------------------------------------------------------------------- */

.client-logos {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    align-items: center;
    justify-items: center;
    margin-bottom: 28px;
}

.client-logos img {
    max-height: 90px;
    width: auto;
    /* source logos are black-on-transparent; invert to white, blend into the dark bg */
    filter: invert(1) grayscale(1);
    mix-blend-mode: screen;
    opacity: 0.55;
    transition: opacity 0.25s ease;
}

.client-logos img:hover {
    opacity: 0.95;
}

.client-names {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    list-style: none;
}

.client-names li {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--muted);
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    padding: 6px 14px;
}

/* --------------------------------------------------------------------------
   GitHub contribution graph
   -------------------------------------------------------------------------- */

.gh-graph {
    overflow-x: auto;
    padding-bottom: 12px;
    margin-bottom: 16px;
}

.gh-grid {
    display: grid;
    grid-auto-flow: column;
    grid-template-rows: repeat(7, 11px);
    gap: 3px;
    width: max-content;
}

.gh-grid span {
    width: 11px;
    height: 11px;
    border-radius: 2px;
    background: #1a2027;
}

.gh-grid .l1 { background: #0e4429; }
.gh-grid .l2 { background: #006d32; }
.gh-grid .l3 { background: #26a641; }
.gh-grid .l4 { background: #39d353; }

/* --------------------------------------------------------------------------
   Blog cards (listing + home teaser)
   -------------------------------------------------------------------------- */

.post-list {
    display: grid;
    gap: 20px;
}

.post-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 30px 28px;
    display: block;
    color: var(--text);
    background: var(--bg-card);
    transition: border-color 0.25s ease, transform 0.25s ease;
}

.post-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    text-decoration: none;
}

.post-card time {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--faint);
}

.post-card h3 {
    font-size: 21px;
    margin: 8px 0 10px;
}

.post-card p {
    color: var(--muted);
    font-size: 15px;
}

/* --------------------------------------------------------------------------
   Blog article
   -------------------------------------------------------------------------- */

.article {
    padding: 160px 0 80px;
}

.article-inner {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 24px;
}

.article header {
    margin-bottom: 40px;
}

.article time {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--faint);
}

.article h1 {
    font-size: clamp(30px, 5vw, 44px);
    margin: 12px 0 16px;
}

.article .lede {
    font-size: 19px;
    color: var(--muted);
}

.article h2 {
    font-size: 26px;
    margin: 44px 0 16px;
}

.article h3 {
    font-size: 20px;
    margin: 32px 0 12px;
}

.article p,
.article li {
    color: #c9c6bf;
    margin-bottom: 16px;
}

.article ul,
.article ol {
    padding-left: 24px;
    margin-bottom: 16px;
}

.article code {
    font-family: var(--font-mono);
    font-size: 0.88em;
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: 5px;
    padding: 2px 6px;
}

.article pre {
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
    overflow-x: auto;
    margin: 20px 0 28px;
    line-height: 1.5;
}

.article pre code {
    background: none;
    border: none;
    padding: 0;
    font-size: 14px;
    color: #a9bcbc;
    font-family: var(--font-mono);
}

/* highlight.js sets its own bg/padding; our pre already provides both */
.article pre code.hljs {
    background: transparent;
    padding: 0;
}

/* Syntax colors: John Sundell's Splash palette (sundellsColors), mapped to highlight.js tokens */
.hljs-keyword,
.hljs-literal { color: #e73289; }

.hljs-type,
.hljs-title.class_,
.hljs-selector-class { color: #8281ca; }

.hljs-title,
.hljs-title.function_,
.hljs-built_in { color: #348fe5; }

.hljs-attr,
.hljs-property,
.hljs-variable { color: #21ab9d; }

.hljs-number { color: #db6f57; }

.hljs-string,
.hljs-regexp { color: #fa641e; }

.hljs-comment,
.hljs-quote { color: #6b8a94; }

.hljs-symbol,
.hljs-operator { color: #92b300; }

.hljs-meta,
.hljs-params { color: #b68a00; }

.article-footer {
    margin-top: 56px;
    padding-top: 28px;
    border-top: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.author-line {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--muted);
    font-size: 14px;
}

.author-line img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

/* --------------------------------------------------------------------------
   Contact
   -------------------------------------------------------------------------- */

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: 60px;
    align-items: start;
}

.contact-info p {
    color: var(--muted);
    margin-bottom: 28px;
}

.contact-channels {
    list-style: none;
    display: grid;
    gap: 18px;
}

.contact-channels .label {
    font-family: var(--font-mono);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--faint);
    display: block;
    margin-bottom: 2px;
}

.contact-channels a {
    color: var(--text);
    font-weight: 500;
}

.contact-channels a:hover {
    color: var(--accent);
    text-decoration: none;
}

.contact-form {
    display: grid;
    gap: 16px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 15px;
    padding: 13px 16px;
    transition: border-color 0.2s ease;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
    color: var(--faint);
}

.contact-form textarea {
    min-height: 140px;
    resize: vertical;
}

.form-status {
    font-size: 14px;
    min-height: 20px;
}

.form-status.ok { color: #7fc97f; }
.form-status.err { color: #e07a6a; }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.site-footer {
    border-top: 1px solid var(--line);
    padding: 48px 0;
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--muted);
    font-size: 14px;
}

.footer-brand img {
    height: 28px;
    opacity: 0.8;
}

.footer-links {
    display: flex;
    gap: 24px;
    list-style: none;
}

.footer-links a {
    color: var(--muted);
    font-size: 14px;
}

.footer-links a:hover {
    color: var(--accent);
    text-decoration: none;
}

/* --------------------------------------------------------------------------
   Scroll reveal
   -------------------------------------------------------------------------- */

.reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .reveal { opacity: 1; transform: none; transition: none; }
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 860px) {
    .about-grid,
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .about-photo {
        max-width: 280px;
    }
}

@media (max-width: 720px) {
    .nav-toggle {
        display: block;
    }

    .nav-links {
        position: absolute;
        top: 72px;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
        background: var(--bg-raised);
        border-bottom: 1px solid var(--line);
        display: none;
        padding: 12px 24px 20px;
    }

    .nav-links.open {
        display: flex;
    }

    .nav-links li {
        width: 100%;
    }

    .nav-links a {
        display: block;
        padding: 12px 0;
        font-size: 16px;
    }

    .nav-links a.nav-cta {
        display: inline-block;
        margin-top: 10px;
    }

    .nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
    .nav-toggle.open span:nth-child(2) { opacity: 0; }
    .nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

    .hero {
        padding: 150px 0 80px;
    }

    .section {
        padding: 70px 0;
    }

    .form-row {
        grid-template-columns: 1fr;
    }
}
