/* ==========================================================
   Infodesign — style.css
   1. Tokens   2. Base   3. Layout   4. Componentes   5. Seções
   ========================================================== */

/* 1. Tokens ------------------------------------------------- */
:root {
    --bg: #FAF7F0;
    --bg-alt: #F3EEE2;
    --surface: #FFFFFF;
    --ink: #16150F;
    --muted: #5C5A52;
    --line: rgb(22 21 15 / 0.12);
    --accent: #FFD43B;
    --on-accent: #16150F;
    --hover: rgb(22 21 15 / 0.06);
    --header-bg: rgb(250 247 240 / 0.9);
    --footer-bg: #16150F;
    --footer-text: rgb(250 247 240 / 0.72);
    --footer-heading: #FAF7F0;
    --footer-line: rgb(250 247 240 / 0.12);

    --font-display: "Geologica", system-ui, sans-serif;
    --font-body: "Instrument Sans", system-ui, sans-serif;

    --text-sm: 0.9375rem;
    --text-base: 1.0625rem;
    --text-lg: clamp(1.125rem, 1rem + 0.5vw, 1.3125rem);
    --h3: 1.25rem;
    --h2: clamp(1.75rem, 1.3rem + 1.8vw, 2.5rem);
    --h1: clamp(2.25rem, 1.5rem + 3.2vw, 4rem);

    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2.5rem;
    --space-xl: clamp(3.5rem, 2rem + 6vw, 7rem);

    --radius: 14px;
    --radius-pill: 999px;
    --shadow: 0 1px 2px rgb(22 21 15 / 0.04), 0 12px 32px rgb(22 21 15 / 0.08);
    --container: 1180px;
    --gutter: clamp(1rem, 4vw, 2rem);
    --header-h: 72px;
}

/* Tema secreto (código Konami): Catppuccin Mocha */
:root[data-theme="catppuccin"] {
    color-scheme: dark;
    --bg: #1E1E2E;
    --bg-alt: #181825;
    --surface: #313244;
    --ink: #CDD6F4;
    --muted: #A6ADC8;
    --line: rgb(205 214 244 / 0.12);
    --accent: #CBA6F7;
    --on-accent: #11111B;
    --hover: rgb(205 214 244 / 0.08);
    --header-bg: rgb(30 30 46 / 0.9);
    --footer-bg: #11111B;
    --footer-text: #A6ADC8;
    --footer-heading: #CDD6F4;
    --footer-line: rgb(205 214 244 / 0.12);
}
:root[data-theme="catppuccin"] .site-header__logo img { content: url("../img/logo-catppuccin.png"); }
:root[data-theme="catppuccin"] .card__logo { filter: invert(1) hue-rotate(180deg); }

/* 2. Base --------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 1rem);
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.3s, color 0.3s;
}

h1, h2, h3, .card__title {
    margin: 0 0 var(--space-sm);
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.02em;
    text-wrap: balance;
    overflow-wrap: break-word;
}
h1 { font-size: var(--h1); }
h2 { font-size: var(--h2); }
h3, .card__title { font-size: var(--h3); font-weight: 600; letter-spacing: -0.01em; }

p { margin: 0 0 var(--space-sm); text-wrap: pretty; }
a { color: inherit; }
img { display: block; max-width: 100%; height: auto; }
ul, ol { margin: 0; padding: 0; }

mark {
    padding: 0 0.12em;
    background: linear-gradient(transparent 14%, var(--accent) 14%, var(--accent) 88%, transparent 88%);
    color: var(--on-accent);
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
}

:focus-visible {
    outline: 2px solid var(--ink);
    outline-offset: 3px;
    border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition: none !important; }
}

/* 3. Layout ------------------------------------------------- */
.container {
    width: min(100% - 2 * var(--gutter), var(--container));
    margin-inline: auto;
}

.section { padding-block: var(--space-xl); }
.section--alt { background: var(--bg-alt); }

.section__head { max-width: 62ch; margin-bottom: var(--space-lg); }

.lead {
    max-width: 52ch;
    color: var(--muted);
    font-size: var(--text-lg);
}

.grid {
    display: grid;
    gap: var(--space-md);
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
}

/* 4. Componentes -------------------------------------------- */

/* Header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--header-bg);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}

.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    min-height: var(--header-h);
}

.site-header__logo img { width: auto; height: 52px; }

.site-nav {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.site-nav ul {
    display: flex;
    gap: 0.25rem;
    list-style: none;
}

.site-nav ul a {
    display: block;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-pill);
    color: var(--muted);
    font-size: var(--text-sm);
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s, background-color 0.2s;
}
.site-nav ul a:hover,
.site-nav ul a[aria-current] {
    background: var(--hover);
    color: var(--ink);
}

.menu-toggle { display: none; }

@media (max-width: 960px) {
    .menu-toggle {
        display: inline-flex;
        flex-direction: column;
        justify-content: center;
        gap: 5px;
        width: 44px;
        height: 44px;
        padding: 0 11px;
        border: 1px solid var(--line);
        border-radius: var(--radius-pill);
        background: var(--surface);
        cursor: pointer;
    }
    .menu-toggle span {
        height: 2px;
        border-radius: 2px;
        background: var(--ink);
        transition: transform 0.2s;
    }
    .menu-toggle[aria-expanded="true"] span:first-child { transform: translateY(3.5px) rotate(45deg); }
    .menu-toggle[aria-expanded="true"] span:last-child { transform: translateY(-3.5px) rotate(-45deg); }

    .site-nav {
        position: absolute;
        inset: 100% 0 auto;
        display: none;
        flex-direction: column;
        align-items: stretch;
        padding: var(--space-sm) var(--gutter) var(--space-md);
        background: var(--bg);
        border-bottom: 1px solid var(--line);
    }
    .site-nav.is-open { display: flex; }
    .site-nav ul { flex-direction: column; }
    .site-nav ul a { padding: 0.75rem; font-size: var(--text-base); }
}

/* Botões */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 1.4rem;
    border: 1px solid transparent;
    border-radius: var(--radius-pill);
    background: var(--accent);
    color: var(--on-accent);
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
}
.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgb(22 21 15 / 0.12);
}
.btn--dark { background: var(--ink); color: var(--bg); }
.btn--ghost { background: transparent; border-color: var(--ink); color: var(--ink); }
.btn--small { padding: 0.55rem 1.1rem; font-size: var(--text-sm); }

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

/* Cards */
.card {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    padding: var(--space-md);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    color: inherit;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
}
.card h2, .card h3, .card p { margin: 0; }
.card p { color: var(--muted); }
a.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
}

.card__more {
    margin-top: auto;
    padding-top: var(--space-sm);
    font-size: var(--text-sm);
    font-weight: 600;
}
.card__more::after { content: " →"; }

.card__logo { align-self: flex-start; width: auto; height: 72px; margin-bottom: var(--space-xs); }

.card--media { padding: 0; overflow: hidden; }
.card--media > img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}
.card__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: var(--space-xs);
    padding: var(--space-md);
}
.card__excerpt {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
}

/* Tags */
.tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
    list-style: none;
}
.tags li {
    padding: 0.35rem 0.9rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    background: var(--surface);
    font-size: var(--text-sm);
    font-weight: 500;
}

/* Checklist */
.checklist {
    display: grid;
    gap: 0.75rem;
    list-style: none;
}
.checklist li {
    position: relative;
    padding-left: 2rem;
    font-weight: 500;
}
.checklist li::before {
    content: "";
    position: absolute;
    top: 0.2em;
    left: 0;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 50%;
    background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2316150F' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E") center / 0.75rem no-repeat;
}

.checklist--grid {
    gap: var(--space-sm);
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
}
.checklist--grid li {
    padding: var(--space-md) var(--space-md) var(--space-md) 3.25rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}
.checklist--grid li::before {
    top: calc(var(--space-md) + 0.2em);
    left: var(--space-md);
}

/* Footer */
.site-footer :focus-visible { outline-color: var(--accent); }
.site-footer {
    padding-block: var(--space-xl) var(--space-md);
    background: var(--footer-bg);
    color: var(--footer-text);
    font-size: var(--text-sm);
}

.site-footer__grid {
    display: grid;
    gap: var(--space-lg);
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
}

.site-footer h2 {
    margin-bottom: var(--space-sm);
    color: var(--footer-heading);
    font-size: 1rem;
    letter-spacing: 0;
}

.site-footer ul,
.site-footer address {
    display: grid;
    gap: 0.5rem;
    font-style: normal;
    list-style: none;
}

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

.site-footer__bottom {
    margin-top: var(--space-lg);
    padding-top: var(--space-md);
    border-top: 1px solid var(--footer-line);
}

/* 5. Seções ------------------------------------------------- */

/* Hero */
.hero { padding-block: var(--space-xl); }
.hero h1 { max-width: 18ch; }
.hero .lead,
.hero .actions { margin-bottom: var(--space-md); }

/* Números do hero */
.stats {
    display: grid;
    gap: var(--space-sm);
    grid-template-columns: repeat(2, 1fr);
    list-style: none;
}
.stats li {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: var(--space-md);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}
.stats li:first-child {
    border-color: transparent;
    background: var(--accent);
    color: var(--on-accent);
}
.stats__value {
    font-family: var(--font-display);
    font-size: clamp(2rem, 1.5rem + 2vw, 3rem);
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.02em;
}
.stats__label { color: var(--muted); font-size: var(--text-sm); }
.stats li:first-child .stats__label { color: inherit; }

/* Split: texto + imagem */
.split > * { min-width: 0; }
.split {
    display: grid;
    gap: var(--space-lg);
    align-items: center;
}
@media (min-width: 860px) {
    .split { grid-template-columns: 1.1fr 0.9fr; }
    .split--reverse { grid-template-columns: 0.9fr 1.1fr; }
    .split--reverse > :first-child { order: 2; }
}

.split__media img {
    width: auto;
    max-height: 480px;
    margin-inline: auto;
}
.split__media--photo img {
    width: 100%;
    max-height: none;
    border-radius: var(--radius);
}

/* Faixa de chamada */
.cta-band {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    padding: var(--space-lg) clamp(1.5rem, 5vw, 4rem);
    border-radius: calc(var(--radius) * 2);
    background: var(--accent);
    color: var(--on-accent);
}
.cta-band h2 { max-width: 22ch; margin: 0; }
.cta-band p { max-width: 52ch; margin: var(--space-xs) 0 0; }

/* Mockups do Plugdrop (cores da própria ferramenta) */
.pd-mock {
    --pd-bg: #1B1B23;
    --pd-panel: #23242B;
    --pd-mute: #2C2C36;
    --pd-line: #3E3E45;
    --pd-text: #D9D9F2;
    --pd-muted: #8C8C9C;
    --pd-blue: #4778FF;
    border: 1px solid var(--pd-line);
    border-radius: var(--radius);
    background: var(--pd-bg);
    color: var(--pd-text);
    font-size: 0.8125rem;
    box-shadow: var(--shadow), 0 24px 48px rgb(22 21 15 / 0.16);
}

.pd-status {
    padding: 0.15rem 0.6rem;
    border-radius: var(--radius-pill);
    font-size: 0.6875rem;
    font-weight: 600;
    white-space: nowrap;
}
.pd-status--normal { background: rgb(71 120 255 / 0.2); color: #A5B8FF; }
.pd-status--warning { background: rgb(245 159 0 / 0.18); color: #FFC078; }
.pd-status--success { background: rgb(47 158 68 / 0.2); color: #8CE99A; }

/* Fluxo de um pedido */
.pd-flow {
    display: grid;
    gap: var(--space-sm);
    width: 100%;
    max-width: 26rem;
    margin: 0 auto var(--space-lg);
    padding: var(--space-md);
}
.pd-flow__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.pd-flow__order { color: #F2F2F8; font-weight: 600; }
.pd-flow__steps {
    display: grid;
    gap: 0.9rem;
    list-style: none;
}
.pd-flow__steps li {
    position: relative;
    display: flex;
    justify-content: space-between;
    gap: var(--space-sm);
    padding-left: 1.75rem;
    color: var(--pd-muted);
}
.pd-flow__steps li::before {
    content: "";
    position: absolute;
    top: 0.2rem;
    left: 0;
    width: 0.9rem;
    height: 0.9rem;
    border: 2px solid var(--pd-line);
    border-radius: 50%;
}
.pd-flow__steps li:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 1.25rem;
    left: calc(0.45rem - 1px);
    width: 2px;
    height: 1rem;
    background: var(--pd-line);
}
.pd-flow__steps .is-done { color: var(--pd-text); }
.pd-flow__steps .is-done::before { border-color: var(--pd-blue); background: var(--pd-blue); }
.pd-flow__steps .is-done::after { background: var(--pd-blue); }
.pd-flow__steps .is-current { color: #F2F2F8; font-weight: 600; }
.pd-flow__steps .is-current::before {
    border-color: var(--pd-blue);
    box-shadow: 0 0 0 4px rgb(71 120 255 / 0.25);
}
.pd-flow__steps span { font-size: 0.6875rem; }

/* Janela do app */
.pd-app { position: relative; }
.pd-app__window { overflow: hidden; }

.pd-app__bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0.6rem 0.9rem;
    background: #101012;
}
.pd-app__bar span {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--pd-line);
}
.pd-app__bar em {
    margin-left: 0.5rem;
    color: var(--pd-muted);
    font-size: 0.6875rem;
    font-style: normal;
}

.pd-app__body {
    display: grid;
    grid-template-columns: 9.5rem 1fr;
    min-height: 19rem;
}

.pd-app__side {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0.75rem 0.5rem;
    border-right: 1px solid var(--pd-line);
    background: var(--pd-panel);
}
.pd-app__brand {
    padding: 0.25rem 0.5rem 0.6rem;
    color: #F2F2F8;
    font-weight: 700;
}
.pd-app__nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.35rem 0.5rem;
    border-radius: 6px;
    color: var(--pd-muted);
    font-size: 0.75rem;
}
.pd-app__nav.is-active { background: var(--pd-mute); color: var(--pd-text); }
.pd-app__nav b {
    min-width: 1.15rem;
    padding: 0 0.3rem;
    border-radius: var(--radius-pill);
    background: var(--pd-blue);
    color: #FFFFFF;
    font-size: 0.625rem;
    text-align: center;
}

.pd-app__main {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    min-width: 0;
    padding: 0.9rem;
}
.pd-app__title { color: #F2F2F8; font-size: 0.9375rem; font-weight: 600; }
.pd-app__search {
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--pd-line);
    border-radius: 6px;
    color: var(--pd-muted);
    font-size: 0.75rem;
}
.pd-app__order {
    display: grid;
    gap: 0.4rem;
    padding: 0.6rem 0.7rem;
    border: 1px solid var(--pd-line);
    border-radius: 8px;
    background: var(--pd-panel);
}
.pd-app__order-head {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
}
.pd-app__order-head b { color: #F2F2F8; }
.pd-app__order-head span { color: var(--pd-muted); }
.pd-app__statuses {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.pd-app__toast {
    position: absolute;
    right: -0.75rem;
    bottom: -1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.9rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--ink);
    font-size: var(--text-sm);
    font-weight: 500;
    box-shadow: var(--shadow);
    animation: float 4s ease-in-out infinite;
}
.pd-app__toast i {
    display: grid;
    place-items: center;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 50%;
    background: #2F9E44;
    color: #FFFFFF;
    font-size: 0.75rem;
    font-style: normal;
}

@keyframes float {
    50% { transform: translateY(-6px); }
}

@media (max-width: 560px) {
    .pd-app__body { grid-template-columns: 1fr; }
    .pd-app__side { display: none; }
    .pd-app__toast { right: 0.5rem; }
}

@media (prefers-reduced-motion: reduce) {
    .pd-app__toast { animation: none; }
}

/* Contato */
.contact { text-align: center; }
.contact h1, .contact .lead { margin-inline: auto; }
.contact .actions { justify-content: center; }

/* Artigo do blog */
.article { padding-block: var(--space-lg) var(--space-xl); }

.article__header,
.prose {
    max-width: 68ch;
    margin-inline: auto;
}

.article__header h1 { font-size: clamp(2rem, 1.4rem + 2.4vw, 3.25rem); }

.article__back {
    display: inline-block;
    margin-bottom: var(--space-md);
    color: var(--muted);
    font-size: var(--text-sm);
    font-weight: 600;
    text-decoration: none;
}
.article__back:hover { color: var(--ink); }

.article__cover {
    max-width: 900px;
    margin: var(--space-lg) auto;
}
.article__cover img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: var(--radius);
}

.prose h2 {
    margin-top: var(--space-lg);
    font-size: clamp(1.4rem, 1.2rem + 0.8vw, 1.75rem);
}
.prose h3 { margin-top: var(--space-md); }

.prose ul,
.prose ol {
    display: grid;
    gap: 0.5rem;
    margin-bottom: var(--space-sm);
    padding-left: 1.25rem;
}
.prose li::marker { color: var(--muted); }

.prose a {
    text-decoration-color: currentColor;
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}
.prose a:hover { text-decoration-color: var(--accent); }

/* Aviso rápido (tema secreto) */
.toast {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    z-index: 20;
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-pill);
    background: var(--ink);
    color: var(--bg);
    font-weight: 600;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 1rem);
    transition: opacity 0.3s, transform 0.3s;
}
.toast.is-visible {
    opacity: 1;
    transform: translate(-50%, 0);
}
