/* buildwithpt — light gray editorial theme
   Palette: neutral gray surfaces, near-black text, soft blue accent (#1F5BFF).
   Mechanics (type scale, radius, solid buttons, no shadow) borrowed from Novitckii. */

:root {
    --bg: #F4F4F5;
    --surface: #FFFFFF;
    --surface-2: #FAFAFA;
    --border: #E4E4E7;
    --text: #18181B;
    --muted: #71717A;
    --accent: #1F5BFF;
    --accent-soft: #A7BBEF;
    --radius: 14px;
    --radius-sm: 12px;
    --wrap: 600px;
    --wrap-wide: 720px;
    --font-head: "Space Grotesk", "Inter Tight", sans-serif;
    --font-body: "Inter Tight", system-ui, -apple-system, sans-serif;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 18px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
    font-family: var(--font-head);
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin: 0 0 0.4em;
}

a { color: inherit; text-decoration: none; }
a:focus-visible,
button:focus-visible,
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 4px;
}

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

.wrap {
    width: 100%;
    max-width: var(--wrap);
    margin: 0 auto;
    padding: 0 20px;
}

.site { display: flex; flex-direction: column; min-height: 100vh; }
.site-main { flex: 1 0 auto; }

/* ---------- Header / footer ---------- */
.site-header { padding: 22px 0; }
.site-header-inner {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.site-brand {
    font-family: var(--font-head);
    font-weight: 600;
    font-size: 17px;
    letter-spacing: -0.01em;
}
.nav { list-style: none; display: flex; gap: 18px; margin: 0; padding: 0; }
.nav li { margin: 0; }
.nav a { color: var(--muted); font-size: 15px; }
.nav a:hover { color: var(--text); }

.site-footer { padding: 40px 0; margin-top: 48px; border-top: 1px solid var(--border); }
.site-footer-inner {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    color: var(--muted); font-size: 14px;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 8px;
    padding: 13px 22px;
    border-radius: var(--radius-sm);
    font-family: var(--font-head);
    font-weight: 500;
    font-size: 16px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform .12s ease, background .15s ease, color .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-solid { background: var(--text); color: #fff; }
.btn-solid:hover { background: #000; }
.btn-outline { background: var(--surface); color: var(--text); border-color: var(--text); }
.btn-outline:hover { background: var(--text); color: #fff; }

/* ---------- Link-in-bio (index) ---------- */
.bio { max-width: 560px; padding-top: 8px; padding-bottom: 24px; }
.bio > * + * { margin-top: 22px; }

.bio-hero { text-align: center; }
.avatar {
    position: relative;
    width: 112px; height: 112px;
    margin: 0 auto 18px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--surface-2);
    border: 1px solid var(--border);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-initials {
    position: absolute; inset: 0;
    display: none;
    align-items: center; justify-content: center;
    font-family: var(--font-head); font-weight: 600; font-size: 40px;
    color: var(--muted);
}
.avatar--fallback .avatar-initials { display: flex; }

.bio-name { font-size: 40px; margin-bottom: 2px; }
.bio-handle { color: var(--muted); font-size: 16px; margin: 0 0 16px; }
.bio-taglines { list-style: none; margin: 0; padding: 0; color: var(--text); }
.bio-taglines li { font-size: 17px; line-height: 1.5; }
.bio-taglines li + li { margin-top: 2px; }

.socials {
    display: flex; flex-wrap: wrap; justify-content: center; gap: 8px;
    margin-top: 18px;
}
.social {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 8px 13px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 14px; font-weight: 500;
    color: var(--text);
    transition: border-color .15s ease, transform .12s ease;
}
.social:hover { border-color: var(--text); transform: translateY(-1px); }
.social svg { width: 16px; height: 16px; fill: currentColor; }

/* Featured */
.featured-card {
    display: flex; align-items: center; gap: 12px;
    padding: 18px 20px;
    background: var(--text); color: #fff;
    border-radius: var(--radius);
}
.featured-eyebrow {
    font-size: 12px; text-transform: uppercase; letter-spacing: .08em;
    color: var(--accent-soft);
}
.featured-title { font-family: var(--font-head); font-weight: 500; font-size: 18px; flex: 1; }
.featured-cta { font-size: 20px; }

/* Signup */
.signup {
    text-align: center;
    padding: 26px 22px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.signup .btn { margin-top: 6px; width: 100%; }
.signup-sub { color: var(--muted); font-size: 15px; margin: 4px 0 14px; }

.section-title { font-size: 15px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; margin-bottom: 12px; }

/* Projects */
.project-list { display: flex; flex-direction: column; gap: 10px; }
.project {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: border-color .15s ease, transform .12s ease;
}
.project:hover { border-color: var(--text); transform: translateY(-1px); }
.project-icon {
    flex: 0 0 auto;
    width: 44px; height: 44px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-head); font-weight: 700; font-size: 15px;
    color: #fff;
}
.project-icon--pct { background: #1F5BFF; }
.project-icon--sensei { background: #18181B; }
.project-icon--droppr { background: #7C3AED; }
.project-body { flex: 1; display: flex; flex-direction: column; }
.project-name { font-family: var(--font-head); font-weight: 600; font-size: 17px; }
.project-desc { color: var(--muted); font-size: 14px; }
.project-status { flex: 0 0 auto; font-size: 12px; color: var(--muted); }
.project-status.is-live { color: #16A34A; }

.book-call { width: 100%; }

/* Latest */
.latest-list { display: flex; flex-direction: column; }
.latest-item {
    display: flex; align-items: baseline; justify-content: space-between; gap: 14px;
    padding: 12px 2px;
    border-bottom: 1px solid var(--border);
}
.latest-item:hover .latest-title { color: var(--accent); }
.latest-title { font-family: var(--font-head); font-weight: 500; font-size: 16px; }
.latest-date { color: var(--muted); font-size: 13px; flex: 0 0 auto; }

/* ---------- Post / page ---------- */
.post { max-width: var(--wrap-wide); padding-top: 12px; padding-bottom: 40px; }
.post-header { margin-bottom: 24px; }
.post-tag, .post-card-tag {
    display: inline-block; margin-bottom: 12px;
    font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
    color: var(--accent);
}
.post-title { font-size: 44px; }
.post-meta { color: var(--muted); font-size: 15px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.post-dot { color: var(--border); }
.post-feature { margin: 0 0 28px; }
.post-feature img { width: 100%; border-radius: var(--radius); }
.post-feature figcaption { color: var(--muted); font-size: 13px; text-align: center; margin-top: 8px; }

.gh-content { font-size: 19px; line-height: 1.7; }
.gh-content > * { margin: 0 0 1.4em; }
.gh-content h2 { font-size: 30px; margin-top: 1.6em; }
.gh-content h3 { font-size: 23px; margin-top: 1.4em; }
.gh-content a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.gh-content img { border-radius: var(--radius); }
.gh-content blockquote {
    margin: 1.6em 0; padding: 4px 0 4px 20px;
    border-left: 3px solid var(--text); color: var(--muted); font-style: italic;
}
.gh-content pre {
    background: #18181B; color: #F4F4F5;
    padding: 18px; border-radius: var(--radius); overflow-x: auto; font-size: 15px;
}
.gh-content code {
    background: var(--surface); border: 1px solid var(--border);
    padding: 2px 6px; border-radius: 6px; font-size: .9em;
}
.gh-content pre code { background: none; border: none; padding: 0; }

.post-footer { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 18px; }
.post-tags, .chip { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-block; padding: 5px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; font-size: 13px; color: var(--muted); }

/* ---------- Archives (tag / author) ---------- */
.archive-header { text-align: center; padding: 32px 20px 8px; }
.archive-eyebrow { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.archive-title { font-size: 40px; margin-top: 6px; }
.archive-desc { color: var(--muted); max-width: 520px; margin: 8px auto 0; }

.post-feed { display: grid; gap: 16px; max-width: var(--wrap-wide); padding-top: 16px; padding-bottom: 24px; }
.post-card {
    display: flex; flex-direction: column;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    overflow: hidden;
    transition: border-color .15s ease, transform .12s ease;
}
.post-card:hover { border-color: var(--text); transform: translateY(-2px); }
.post-card-image img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.post-card-body { padding: 18px 20px; }
.post-card-title { font-size: 22px; margin: 6px 0 8px; }
.post-card-excerpt { color: var(--muted); font-size: 15px; margin: 0 0 12px; }
.post-card-meta { color: var(--muted); font-size: 13px; display: flex; gap: 8px; align-items: center; }

/* Pagination */
.pagination { max-width: var(--wrap-wide); margin: 0 auto; padding: 8px 20px 32px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pagination a { color: var(--text); font-weight: 500; }
.pagination .page-number { color: var(--muted); font-size: 14px; }

/* Error */
.error { text-align: center; padding: 80px 20px; }
.error-code { font-family: var(--font-head); font-size: 72px; font-weight: 700; margin: 0; color: var(--accent-soft); }
.error-title { font-size: 26px; margin: 4px 0 24px; }

/* ---------- Koenig editor cards ---------- */
.kg-width-wide { position: relative; width: 85vw; min-width: 100%; margin: auto calc(50% - 50vw); transform: translateX(calc(50vw - 50%)); }
.kg-width-full { position: relative; width: 100vw; margin: auto calc(50% - 50vw); }
.gh-content .kg-width-full img { border-radius: 0; }
.kg-image { margin: auto; }
.kg-image-card img { margin: auto; }
.kg-image-card figcaption, .kg-embed-card figcaption { text-align: center; color: var(--muted); font-size: 13px; margin-top: 8px; }
.kg-gallery-container { display: flex; flex-direction: column; }
.kg-gallery-row { display: flex; flex-direction: row; justify-content: center; }
.kg-gallery-image { margin: 6px; }
.kg-gallery-image img { display: block; width: 100%; height: 100%; }
.kg-embed-card { display: flex; flex-direction: column; align-items: center; width: 100%; }

.kg-bookmark-card, .kg-bookmark-card * { box-sizing: border-box; }
.kg-bookmark-card { width: 100%; }
.kg-bookmark-container { display: flex; min-height: 148px; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; text-decoration: none; }
.kg-bookmark-container:hover { border-color: var(--text); }
.kg-bookmark-content { display: flex; flex-direction: column; flex-grow: 1; align-items: flex-start; justify-content: flex-start; padding: 20px; overflow: hidden; }
.kg-bookmark-title { font-family: var(--font-head); font-weight: 600; font-size: 16px; }
.kg-bookmark-description { display: -webkit-box; overflow-y: hidden; margin-top: 8px; max-height: 44px; color: var(--muted); font-size: 14px; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.kg-bookmark-metadata { display: flex; align-items: center; margin-top: 14px; color: var(--muted); font-size: 14px; }
.kg-bookmark-icon { width: 20px; height: 20px; margin-right: 8px; }
.kg-bookmark-thumbnail { position: relative; min-width: 33%; max-height: 100%; }
.kg-bookmark-thumbnail img { width: 100%; height: 100%; object-fit: cover; }

.kg-callout-card { display: flex; padding: 16px 20px; border-radius: var(--radius); }
.kg-callout-card-grey { background: var(--surface-2); border: 1px solid var(--border); }
.kg-callout-emoji { padding-right: 12px; font-size: 20px; }

.kg-button-card { display: flex; }
.kg-button-card.kg-align-center { justify-content: center; }
.kg-btn { display: inline-block; padding: 12px 22px; border-radius: var(--radius-sm); font-family: var(--font-head); font-weight: 500; text-decoration: none; }
.kg-btn-accent { background: var(--text); color: #fff; }

.kg-toggle-card { border-bottom: 1px solid var(--border); }
.kg-toggle-heading { display: flex; justify-content: space-between; align-items: center; }
.kg-toggle-heading-text { font-family: var(--font-head); font-weight: 600; }

/* ---------- Responsive ---------- */
@media (max-width: 500px) {
    body { font-size: 17px; }
    .bio-name { font-size: 34px; }
    .post-title { font-size: 32px; }
    .archive-title { font-size: 30px; }
    .gh-content { font-size: 18px; }
    .gh-content h2 { font-size: 26px; }
    .featured-title { font-size: 16px; }
    .project-status { display: none; }
    .site-footer-inner { flex-direction: column; align-items: flex-start; gap: 4px; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; }
    .btn:hover, .project:hover, .social:hover, .post-card:hover { transform: none; }
}

/* Icone real da App Store dentro do quadrado do card. object-fit cover garante que
   o artwork quadrado da Apple preencha sem distorcer, e o border-radius acompanha
   o do proprio quadrado. */
.project-icon img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block; }

/* Empilhamento defensivo dos cards clicaveis.
   O Ghost injeta dois widgets de terceiro no body (Portal e sodo-search) que criam
   containers proprios. Se algum deles ficar sobre a pagina, o clique morre em
   silencio: o toque registra no overlay e nao no link. Isto garante que o conteudo
   clicavel fique acima, sem mexer nos widgets nem desligar nada deles. */
.projects, .project-list, .link-list, .btn { position: relative; z-index: 2; }
.project { position: relative; z-index: 2; }
