/*
 * George Salapa — Portfolio
 * Design: Dieter Rams / Mies van der Rohe inspired
 * "Less but better"
 */

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

html {
    font-size: 18px;
    scroll-behavior: smooth;
}

a {
    text-decoration: none;
}

body {
    --cream: #F5FBE6;
    --teal: #215E61;
    --slate: #233D4D;
    --orange: #FE7F2D;
    --black: #1a1a1a;
    --grey: #666;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--cream);
    color: var(--black);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

body.dark {
    --cream: #1a1a1a;
    --black: #f5f5f5;
    --grey: #aaa;
    --slate: #e0e0e0;
    --teal: #4db6ac;
    --orange: #ffab40;
}

/* === HEADER === */
header {
    display: flex;
    align-items: center;
    padding: 3rem 8vw;
}

.header-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.back-link {
    color: var(--black);
    display: flex;
    align-items: center;
}

.logo {
    width: 48px;
    height: auto;
}

.logo-dark { display: none; }
.logo-light { display: block; }
body.dark .logo-dark { display: block; }
body.dark .logo-light { display: none; }

.theme-toggle {
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.header-actions .theme-toggle {
    margin-left: 0;
}

.icon-sun { display: none; }
.icon-moon { display: block; }
body.dark .icon-sun { display: block; }
body.dark .icon-moon { display: none; }

.cross-white { display: none; }
.cross-black { display: block; }
body.dark .cross-white { display: block; }
body.dark .cross-black { display: none; }

/* === MAIN === */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 8vw;
}

/* === HERO === */
.hero {
    padding: 8rem 0 10rem 0;
    max-width: 720px;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 600;
    letter-spacing: -0.03em;
    color: var(--slate);
    margin-bottom: 1.5rem;
}

.tagline {
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--teal);
    margin-bottom: 1rem;
    line-height: 1.4;
}

.tagline .accent {
    color: var(--orange);
}

.subtitle {
    font-size: 1rem;
    color: var(--grey);
    line-height: 1.7;
}

/* === SECTION HEADINGS === */
section h2 {
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--teal);
    margin-bottom: 3rem;
}

/* paper */
.paper {
    padding: 2rem 0 3rem 0;
}

.paper-card {
    background: white;
    padding: 2.5rem;
}

body.dark .paper-card {
    background: #262626;
}

.paper-venue {
    font-size: 0.6875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--teal);
    display: block;
    margin-bottom: 1rem;
}

.paper-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--slate);
    margin-bottom: 0.75rem;
}

.paper-card p {
    font-size: 0.9375rem;
    color: var(--grey);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.paper-link {
    display: inline-block;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--orange);
}

.paper-link:hover {
    color: var(--teal);
}

/* articles */
.articles {
    padding: 2rem 0;
}

.articles-url {
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--teal);
    margin-bottom: 3rem;
}

.articles ul {
    list-style: none;
}

.articles li {
    margin-bottom: 0.75rem;
}

.articles a {
    color: var(--slate);
    font-size: 1.1rem;
}

.articles a:hover {
    color: var(--orange);
}

/* === ARTICLE PAGE === */
.article-layout {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 4rem;
    max-width: 1000px;
}

.toc {
    position: sticky;
    top: 2rem;
    align-self: start;
}

.toc ul {
    list-style: none;
}

.toc li {
    margin-bottom: 0.75rem;
}

.toc a {
    color: var(--grey);
    font-size: 0.875rem;
}

.toc a:hover {
    color: var(--orange);
}

.article-title {
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--slate);
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.article-subtitle {
    font-size: 1.25rem;
    color: var(--teal);
    margin-bottom: 0.5rem;
}

.article-date {
    font-size: 0.875rem;
    color: var(--grey);
    margin-bottom: 3rem;
}

.article-content h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--slate);
    margin: 2.5rem 0 1rem 0;
}

.article-content p {
    margin-bottom: 1.25rem;
    color: var(--black);
}

.article-content img {
    max-width: 100%;
    margin: 1.5rem 0;
}

.article-content ul,
.article-content ol {
    margin: 1.25rem 0;
    padding-left: 1.5rem;
}

.article-content li {
    margin-bottom: 0.5rem;
    color: var(--black);
}

.article-content blockquote {
    border-left: 3px solid var(--teal);
    padding-left: 1rem;
    margin: 1.5rem 0;
    color: var(--grey);
    font-style: italic;
}

/* inline code */
.article-content code {
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 0.875em;
    background: rgba(33, 94, 97, 0.1);
    color: var(--teal);
    padding: 0.15em 0.4em;
    border-radius: 4px;
}

/* fenced code blocks */
.article-content pre {
    background: var(--slate);
    border: 1px solid rgba(33, 94, 97, 0.25);
    border-radius: 8px;
    padding: 1.25rem 1.5rem;
    margin: 1.5rem 0;
    overflow-x: auto;
    line-height: 1.6;
}

.article-content pre code {
    background: none;
    color: var(--cream);
    padding: 0;
    border-radius: 0;
    font-size: 0.875rem;
}

@media (max-width: 768px) {
    .article-layout {
        grid-template-columns: 1fr;
    }

    .toc {
        position: static;
        margin-bottom: 2rem;
    }
}

/* === CAPABILITIES === */
.capabilities {
    padding: 6rem 0;
    border-top: 1px solid rgba(33, 94, 97, 0.25);
}

.capability-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4rem;
}

.capability h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--teal);
    margin-bottom: 0.75rem;
}

.capability p {
    font-size: 0.9375rem;
    color: var(--grey);
    line-height: 1.7;
}

/* === WORK === */
.work {
    padding: 6rem 0;
    border-top: 1px solid rgba(33, 94, 97, 0.25);
}

.work-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.case {
    background: white;
    padding: 2.5rem;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

body.dark .case {
    background: #262626;
}

.case:hover {
    transform: translateY(-2px);
}

.case-industry {
    font-size: 0.6875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--teal);
    display: block;
    margin-bottom: 1rem;
}

.case h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--slate);
    margin-bottom: 0.75rem;
}

.case p {
    font-size: 0.9375rem;
    color: var(--grey);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.case-metric {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--orange);
}

/* === NEWSLETTER === */
.newsletter {
    padding: 6rem 0;
    border-top: 1px solid rgba(33, 94, 97, 0.25);
    max-width: 480px;
}

.newsletter .subtitle {
    margin-bottom: 2rem;
}

.newsletter-form {
    display: flex;
    gap: 0.75rem;
}

.newsletter-form input[type="email"] {
    flex: 1;
    min-width: 0;
    padding: 0.75rem 1rem;
    border: 1px solid rgba(33, 94, 97, 0.3);
    background: white;
    color: var(--black);
    font-family: inherit;
    font-size: 0.9375rem;
}

body.dark .newsletter-form input[type="email"] {
    background: #262626;
    border-color: rgba(77, 182, 172, 0.3);
}

.newsletter-form input[type="email"]:focus {
    outline: none;
    border-color: var(--teal);
}

.newsletter-form button {
    padding: 0.75rem 1.5rem;
    background: var(--slate);
    color: var(--cream);
    border: none;
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
    white-space: nowrap;
}

.newsletter-form button:hover {
    background: var(--orange);
}

.hp-field {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.newsletter-status {
    margin-top: 1rem;
    font-size: 0.875rem;
    color: var(--grey);
    min-height: 1.2em;
}

.newsletter-toggle {
    margin-top: 0.75rem;
    font-size: 0.8125rem;
}

.newsletter-toggle a {
    color: var(--grey);
}

.newsletter-toggle a:hover {
    color: var(--orange);
}

/* === CONTACT === */
.contact {
    padding: 8rem 0;
    border-top: 1px solid rgba(33, 94, 97, 0.25);
    text-align: center;
}

.contact h2 {
    margin-bottom: 2rem;
}

.email {
    display: inline-block;
    font-size: 1.75rem;
    font-weight: 500;
    color: var(--slate);
    text-decoration: none;
    border-bottom: 2px solid var(--orange);
    padding-bottom: 0.25rem;
    transition: color 0.2s ease;
}

.email:hover {
    color: var(--orange);
}

.links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 2.5rem;
}

.links a {
    color: var(--teal);
    transition: color 0.2s ease;
}

.links a:hover {
    color: var(--orange);
}

/* === FOOTER === */
footer {
    padding: 3rem 8vw;
    border-top: 1px solid rgba(33, 94, 97, 0.25);
}

footer p {
    font-size: 0.75rem;
    color: var(--grey);
    letter-spacing: 0.05em;
}

/* === AI LINK (subtle, bottom corner) === */
.ai-link {
    position: fixed;
    bottom: 1.25rem;
    right: 1.5rem;
    font-size: 0.6875rem;
    font-weight: 400;
    letter-spacing: 0.04em;
    color: var(--grey);
    opacity: 0.45;
    transition: opacity 0.25s ease, color 0.25s ease;
    z-index: 10;
}

.ai-link:hover {
    opacity: 1;
    color: var(--orange);
}

/* === AI PAGE (raw markdown view) === */
.ai-page {
    max-width: 760px;
    margin: 0 auto;
    padding: 4rem 8vw 6rem 8vw;
}

.ai-page .back-link {
    display: inline-block;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    color: var(--grey);
    margin-bottom: 2.5rem;
    transition: color 0.2s ease;
}

.ai-page .back-link:hover {
    color: var(--orange);
}

.ai-page pre {
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 0.8125rem;
    line-height: 1.7;
    color: var(--black);
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* === RESPONSIVE === */
@media (max-width: 900px) {
    html {
        font-size: 16px;
    }

    .capability-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .work-grid {
        grid-template-columns: 1fr;
    }

    .hero {
        padding: 4rem 0 6rem 0;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .tagline {
        font-size: 1.25rem;
    }
}

@media (max-width: 600px) {
    header {
        padding: 2rem 6vw;
    }

    main {
        padding: 0 6vw;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .case {
        padding: 1.75rem;
    }

    .email {
        font-size: 1.25rem;
    }

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

    footer {
        padding: 2rem 6vw;
    }
}

/* === MICRO·CC BOX (below the article) === */
.micro-box {
    grid-column: 2;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem 1.5rem;
    margin: 4rem 0 5rem;
    padding: 1.5rem 1.75rem;
    border: 1px solid rgba(33, 94, 97, 0.25);
    color: var(--grey);
    transition: border-color 0.2s ease;
}

.micro-box:hover {
    border-color: var(--teal);
}

.micro-banner {
    font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
    font-size: 5px;
    line-height: 1.22;
    letter-spacing: 0;
    white-space: pre;
    text-align: left;
    color: var(--teal);
    user-select: none;
}

.micro-text {
    font-size: 0.8rem;
    letter-spacing: 0.02em;
}

.micro-side {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.micro-url {
    font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
    font-size: 0.7rem;
    color: var(--teal);
}

.articles + .micro-box {
    grid-column: auto;
    max-width: 720px;
    margin: 3.5rem 0 4rem;
}

@media (max-width: 768px) {
    .micro-box { grid-column: 1; }
}
