/* ==========================================================================
   Aralis Studio — Stylesheet
   ========================================================================== */

:root {
    --bg-color: #0b0d10;
    --bg-card: #15191e;
    --bg-card-hover: #1c2228;
    --text-main: #dbd3be;
    --text-muted: #a39d8f;
    --accent: #ede5d2;
    --brand-accent: #98d4de;
    --brand-accent-hover: #bcecf5;
    --border-color: #262d35;
    --border-hover: #36404a;
    --code-bg: #101317;
    --tag-bg: #161b21;
    --tag-border: #262d35;
    --container-width: 760px;
    --transition: all 0.2s ease;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: 'Jost', system-ui, sans-serif;
    font-size: 1.125rem;
    font-weight: 400;
    line-height: 1.75;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Page Layout Wrapper to pin header top and footer bottom */
.page-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Container */
.container {
    max-width: var(--container-width);
    width: 100%;
    margin: 0 auto;
    padding: 0 20px;
}

main {
    flex: 1;
    padding: 50px 0 80px 0;
}

/* ==========================================================================
   Header & Navigation (Always stays at top)
   ========================================================================== */

header.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: rgba(11, 13, 16, 0.94);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border-color);
    width: 100%;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 0;
    gap: 20px;
}

.brand-group {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.brand-logo {
    height: 81px;
    width: auto;
    flex-shrink: 0;
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-group:hover .brand-title {
    color: var(--brand-accent-hover);
}

.brand-title {
    font-family: 'Jost', sans-serif;
    font-size: clamp(1.95rem, 6vw, 2.3rem);
    font-weight: 300;
    color: var(--brand-accent);
    letter-spacing: 0.08em;
    margin: 0;
    transition: var(--transition);
    line-height: 1;
    white-space: nowrap;
}

.brand-subtitle {
    font-family: 'Jost', system-ui, sans-serif;
    color: var(--text-main);
    font-size: 1.08rem;
    letter-spacing: 0.01em;
    line-height: 1.3;
    margin-top: 2px;
    white-space: nowrap;
}

/* Navigation menu */
nav.main-nav {
    display: flex;
    align-items: center;
    gap: 24px;
}

nav.main-nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 400;
    transition: var(--transition);
    padding: 6px 0;
    position: relative;
    white-space: nowrap;
}

nav.main-nav a:hover,
nav.main-nav a.active {
    color: var(--brand-accent);
}

nav.main-nav a.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--brand-accent);
}

/* ==========================================================================
   General Typography & Elements
   ========================================================================== */

h1, h2, h3, h4 {
    color: var(--accent);
    letter-spacing: -0.02em;
    font-weight: 500;
    line-height: 1.3;
}

h1 {
    font-size: 2.1rem;
    margin: 0 0 16px 0;
}

h2 {
    font-size: 1.45rem;
    margin: 60px 0 25px 0;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 14px;
}

h3 {
    font-size: 1.2rem;
    margin: 36px 0 16px 0;
}

p {
    margin: 0 0 22px 0;
}

a {
    color: var(--text-main);
    text-decoration: underline;
    text-decoration-color: var(--border-color);
    text-underline-offset: 4px;
    transition: var(--transition);
}

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

/* Monospace Badges & Dates */
.mono-date {
    font-family: 'Jost', system-ui, sans-serif;
    color: var(--text-muted);
    font-size: 0.95rem;
    letter-spacing: 0.02em;
}

.tag-badge {
    display: inline-block;
    font-family: 'Jost', system-ui, sans-serif;
    font-size: 0.85rem;
    padding: 2px 8px;
    border-radius: 3px;
    background-color: var(--tag-bg);
    border: 1px solid var(--tag-border);
    color: var(--text-muted);
    margin-right: 6px;
    margin-bottom: 6px;
}

/* ==========================================================================
   Home Page View
   ========================================================================== */

.hero-about {
    margin-bottom: 60px;
}

.hero-about h2 {
    margin-top: 0;
}

.hero-lead {
    font-size: 1.25rem;
    color: var(--text-main);
    line-height: 1.75;
    margin-bottom: 24px;
}

/* Section Header with Action Link */
.section-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin: 60px 0 25px 0;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 14px;
}

.section-header-row h2 {
    margin: 0;
    border-bottom: none;
    padding-bottom: 0;
}

.view-all-link {
    font-family: 'Jost', system-ui, sans-serif;
    font-size: 1rem;
    color: var(--brand-accent);
    text-decoration: none;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.view-all-link:hover {
    color: var(--brand-accent-hover);
}

/* Devlog Card / Feed Items */
.devlog-list {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.devlog-card {
    background-color: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 20px 24px;
    margin: 0 -24px;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.devlog-card:hover {
    background-color: var(--bg-card);
    border-color: var(--border-color);
}

.devlog-meta-top {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.devlog-readtime {
    font-family: 'Jost', system-ui, sans-serif;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.devlog-card-title {
    font-size: 1.4rem;
    font-weight: 500;
    color: var(--accent);
    text-decoration: none;
    margin: 0 0 8px 0;
    transition: var(--transition);
}

.devlog-card-title:hover {
    color: var(--brand-accent);
    text-decoration: underline;
    text-underline-offset: 4px;
}

.devlog-card-subtitle {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin: 0 0 14px 0;
    line-height: 1.6;
}

.devlog-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 4px;
}

.read-more-btn {
    font-family: 'Jost', system-ui, sans-serif;
    font-size: 1rem;
    color: var(--brand-accent);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}

.read-more-btn:hover {
    color: var(--brand-accent-hover);
    transform: translateX(3px);
}

/* ==========================================================================
   Full Article View
   ========================================================================== */

.article-view {
    animation: fadeIn 0.25s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.back-nav-bar {
    margin-bottom: 35px;
}

.back-link {
    font-family: 'Jost', system-ui, sans-serif;
    font-size: 0.88rem;
    color: var(--text-muted);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.back-link:hover {
    color: var(--accent);
    transform: translateX(-4px);
}

.article-header {
    margin-bottom: 40px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
}

.article-title {
    font-size: 2.6rem;
    line-height: 1.2;
    margin: 12px 0 14px 0;
}

.article-subtitle {
    font-size: 1.3rem;
    color: var(--text-muted);
    margin: 0 0 20px 0;
    line-height: 1.6;
}

.article-meta-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

/* Article Content Formatting */
.article-body {
    font-size: 1.15rem;
    line-height: 1.85;
}

.article-body p {
    margin-bottom: 28px;
}

.article-body h2 {
    margin-top: 54px;
    margin-bottom: 22px;
    font-size: 1.65rem;
}

.article-body h3 {
    margin-top: 40px;
    margin-bottom: 18px;
    font-size: 1.4rem;
}

/* Blockquotes */
blockquote {
    margin: 35px 0;
    padding: 18px 24px;
    background-color: var(--bg-card);
    border-left: 3px solid var(--accent);
    border-radius: 0 4px 4px 0;
    color: #e2e8f0;
    font-style: italic;
}

blockquote p:last-child {
    margin-bottom: 0;
}

/* Code Snippets */
pre.code-block {
    background-color: var(--code-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 20px;
    overflow-x: auto;
    font-family: 'Jost', system-ui, sans-serif;
    font-size: 0.88rem;
    line-height: 1.6;
    margin: 30px 0;
    color: #e5e7eb;
}

pre.code-block code {
    font-family: inherit;
    background: none;
    padding: 0;
    border: none;
}

code.inline-code {
    font-family: 'Jost', system-ui, sans-serif;
    font-size: 0.88em;
    background-color: var(--code-bg);
    border: 1px solid var(--border-color);
    padding: 2px 6px;
    border-radius: 3px;
    color: #f3f4f6;
}

/* Figures & Images */
figure.article-image {
    margin: 40px 0;
    padding: 0;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
}

figure.article-image img {
    width: 100%;
    height: auto;
    display: block;
}

figcaption {
    padding: 12px 18px;
    font-family: 'Jost', system-ui, sans-serif;
    font-size: 0.82rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
    background-color: #121418;
}

/* Article Footer Navigation */
.article-footer-nav {
    margin-top: 60px;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.article-nav-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 16px 20px;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
}

.article-nav-card:hover {
    border-color: var(--border-hover);
    background-color: var(--bg-card-hover);
}

.article-nav-label {
    font-family: 'Jost', system-ui, sans-serif;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.article-nav-title {
    font-size: 0.95rem;
    color: var(--accent);
    font-weight: 500;
}

/* ==========================================================================
   Devlogs Subpage / Archive View
   ========================================================================== */

.archive-header {
    margin-bottom: 40px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
}

.archive-header h1 {
    margin-bottom: 8px;
}

.archive-description {
    color: var(--text-muted);
    font-size: 1.05rem;
    margin: 0;
}

.archive-timeline {
    display: flex;
    flex-direction: column;
    gap: 36px;
}

/* ==========================================================================
   Newsletter / Substack Box
   ========================================================================== */

.subscribe-box {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 36px;
    margin-top: 20px;
    border-radius: 6px;
}

.subscribe-box h3 {
    margin-top: 0;
    color: var(--accent);
    font-weight: 500;
    font-size: 1.2rem;
    margin-bottom: 8px;
}

.subscribe-box p {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.subscribe-feedback {
    margin-top: 14px;
    font-size: 0.9rem;
    min-height: 1.2em;
}

/* Two classes so these colours win over .subscribe-box p */
.subscribe-feedback.subscribe-feedback--ok {
    color: var(--brand-accent);
}

.subscribe-feedback.subscribe-feedback--warn {
    color: var(--brand-accent);
}

.subscribe-feedback.subscribe-feedback--error {
    color: #d46b6b;
}

.form-group {
    display: flex;
    gap: 12px;
}

input[type="email"] {
    flex: 1;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 13px 18px;
    font-family: inherit;
    font-size: 0.95rem;
    border-radius: 4px;
    outline: none;
    transition: var(--transition);
}

input[type="email"]::placeholder {
    color: #555b68;
}

input[type="email"]:focus {
    border-color: #8892b0;
}

button.btn-primary {
    background-color: var(--brand-accent);
    color: var(--bg-color);
    border: none;
    padding: 13px 26px;
    font-family: inherit;
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    border-radius: 4px;
    transition: var(--transition);
    white-space: nowrap;
}

button.btn-primary:hover {
    background-color: var(--brand-accent-hover);
}

/* ==========================================================================
   Contact Page View
   ========================================================================== */

.contact-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 36px 40px;
    margin-top: 25px;
}

.contact-lead {
    font-size: 1.15rem;
    color: #e5e7eb;
    margin-bottom: 20px;
}

.contact-email-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background-color: var(--code-bg);
    border: 1px solid var(--border-color);
    padding: 12px 18px;
    border-radius: 6px;
    margin-bottom: 22px;
    flex-wrap: wrap;
}

.contact-email-link {
    font-family: 'Jost', system-ui, sans-serif;
    font-size: 1.1rem;
    color: var(--brand-accent);
    text-decoration: none;
    font-weight: 500;
    letter-spacing: -0.01em;
    transition: var(--transition);
}

.contact-email-link:hover {
    color: #ffffff;
    text-decoration: underline;
    text-underline-offset: 4px;
}

.contact-copy-btn {
    font-family: 'Jost', system-ui, sans-serif;
    font-size: 0.78rem;
    background-color: var(--tag-bg);
    border: 1px solid var(--tag-border);
    color: var(--text-muted);
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
}

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

.contact-copy-btn.copied {
    color: var(--brand-accent);
    border-color: var(--brand-accent);
}

.contact-note {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.65;
    margin: 0;
}

/* ==========================================================================
   Footer (Always stays at bottom)
   ========================================================================== */

footer.site-footer {
    margin-top: auto;
    border-top: 1px solid var(--border-color);
    background-color: var(--bg-color);
    width: 100%;
}

.footer-inner {
    padding: 32px 0 45px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    font-size: 0.9rem;
}

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

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

.footer-links a:hover {
    color: var(--brand-accent);
}

.footer-note {
    font-family: 'Jost', system-ui, sans-serif;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* ==========================================================================
   Responsive Breakpoints (Mobile Friendly)
   ========================================================================== */

@media (max-width: 640px) {
    .container {
        padding: 0 16px;
    }

    main {
        padding: 32px 0 60px 0;
    }

    /* Small enough to stay on one line from 360px-wide phones up; may still wrap on narrower screens */
    .brand-subtitle {
        font-size: 0.82rem;
        white-space: normal;
    }

    .header-inner {
        flex-direction: column;
        align-items: flex-start;
        padding: 14px 0;
        gap: 12px;
    }

    nav.main-nav {
        width: 100%;
        gap: 18px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
    }

    nav.main-nav a {
        font-size: 1rem;
        white-space: nowrap;
    }

    h1 {
        font-size: 1.75rem;
    }

    .article-title {
        font-size: 1.75rem;
    }

    .article-subtitle {
        font-size: 1rem;
    }

    .article-body {
        font-size: 1rem;
        line-height: 1.72;
    }

    .section-header-row {
        flex-direction: row;
        align-items: center;
        margin: 45px 0 20px 0;
    }

    .section-header-row h2 {
        font-size: 1.3rem;
    }

    .form-group {
        flex-direction: column;
    }

    .article-footer-nav {
        grid-template-columns: 1fr;
    }

    .devlog-card {
        margin: 0;
        padding: 16px 14px;
    }

    .contact-card {
        padding: 24px 18px;
    }

    .contact-email-wrapper {
        width: 100%;
        justify-content: space-between;
    }

    .subscribe-box {
        padding: 24px 18px;
    }

    pre.code-block {
        padding: 14px;
        margin: 20px 0;
        font-size: 0.82rem;
        -webkit-overflow-scrolling: touch;
    }

    .footer-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        padding: 24px 0 36px 0;
    }

    .footer-links {
        flex-wrap: wrap;
        gap: 20px;
    }
}
