/* Estilos do site. Sem etapa de build. */
@layer base, components;

:root {
    /* Identidade "ulisses.": grafite, off-white, laranja e amarelo. O site usa somente o tema escuro. */
    --graphite: #16181b;
    --paper: #f4f4f2;
    --orange: #ff8a3d;
    --yellow: #fbc23c;
    --trace: #33373d;
    --gray: #a8abb1;

    --bg: var(--graphite);
    --surface: #1d2024;
    --ink: var(--paper);
    --muted: var(--gray);
    --line: var(--trace);
    --soft: #282c31;
    --accent: var(--orange);
    --dark: #101214;
    --dark-2: #1d2024;
    --dark-ink: var(--paper);
    --dark-muted: var(--gray);

    --sans: "Inter", system-ui, sans-serif;
    --mono: "DM Mono", ui-monospace, monospace;
    --code: "JetBrains Mono", ui-monospace, monospace;
    color-scheme: dark;
}

@layer base {
    *, ::before, ::after { box-sizing: border-box; margin: 0; padding: 0; border: 0 solid; }
    html { line-height: 1.5; -webkit-text-size-adjust: 100%; }
    h1, h2, h3, h4 { font-size: inherit; font-weight: inherit; }
    ol, ul { list-style: none; }
    img, svg, video, iframe { display: block; vertical-align: middle; }
    img, video { max-width: 100%; height: auto; }
    button, input, select, textarea { font: inherit; letter-spacing: inherit; color: inherit; background: transparent; }
    textarea { resize: vertical; }
    table { border-collapse: collapse; }
    strong, b { font-weight: bolder; }
    small { font-size: 80%; }
    a { text-decoration: inherit; }
    body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); line-height: 1.5; }
    h1, h2, h3 { text-wrap: balance; letter-spacing: -0.015em; }
    h1 { font-size: clamp(2rem, 4vw, 2.75rem); line-height: 1.12; font-weight: 700; letter-spacing: -0.03em; }
    a { color: inherit; text-underline-offset: 3px; }
    :focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; }
    ::selection { background: var(--orange); color: var(--graphite); }
    iframe { border: 0; }
}

@layer components {
    .wrap { max-width: 1120px; margin-inline: auto; padding-inline: 24px; }
    .section { padding-block: 72px; }
    .stack { display: flex; flex-direction: column; gap: 32px; }
    .band-surface { background: var(--surface); border-block: 1px solid var(--line); }
    .band-dark { background: var(--dark); color: var(--dark-ink); scroll-margin-top: 16px; }
    .muted { color: var(--muted); }
    .meta { font-family: var(--mono); font-size: 12px; color: var(--muted); }
    .kicker { font-family: var(--mono); font-size: 16px; font-weight: 500; color: var(--accent); }
    .eyebrow { font-family: var(--mono); font-size: 14px; font-weight: 500; color: var(--yellow); }
    .title { font-size: 28px; line-height: 1.25; font-weight: 600; }
    .title-large { font-size: 34px; line-height: 1.2; font-weight: 600; }
    .lead { font-size: 18px; line-height: 1.65; color: var(--muted); max-width: 60ch; }
    .accent { color: var(--accent); font-weight: 600; font-size: 15px; }
    .more { display: inline-flex; align-items: center; min-height: 44px; font-size: 15px; font-weight: 600; text-decoration: underline; }
    .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
    .skip { position: absolute; left: -999px; }
    .skip:focus { left: 8px; top: 8px; z-index: 10; background: var(--surface); padding: 8px 12px; }

    .topbar { background: var(--surface); border-bottom: 1px solid var(--line); }
    .topbar-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 32px; padding-block: 14px; }
    .brand { display: inline-flex; align-items: center; min-height: 44px; font-size: 27px; font-weight: 700; letter-spacing: -0.04em; text-decoration: none; }
    .brand-dot { display: inline-block; width: 0.29em; height: 0.29em; margin-left: 0.07em; border-radius: 50%; background: var(--orange); transform: translateY(0.21em); }
    .menu { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 28px; font-size: 15px; }
    .menu > a:not(.button) { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; cursor: pointer; }
    .menu > a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 2px; text-decoration-color: var(--orange); text-underline-offset: 8px; }
    .menu-button { display: none; min-height: 44px; padding-inline: 16px; border: 1px solid var(--line); border-radius: 6px; cursor: pointer; }

    .button { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding-inline: 22px; border: 1px solid transparent; border-radius: 6px; font-weight: 600; font-size: 15px; text-decoration: none; cursor: pointer; }
    .button-primary { background: var(--orange); color: var(--graphite); }
    .button-primary:hover { background: #ffa066; }
    .button-outline { border-color: var(--line); background: var(--surface); }
    .button-light { background: var(--orange); color: var(--graphite); }
    .button-light:hover { background: #ffa066; }
    .button-small { min-height: 44px; padding-inline: 18px; border-color: var(--orange); }
    .actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }

    /* A abertura segue a capa do canal. */
    .hero-band { --surface: #1d2024; --line: #3d4249; --accent: var(--orange); position: relative; overflow: hidden; background: var(--graphite); color: var(--paper); padding-bottom: 28px; }
    .hero-band .lead { color: var(--gray); }
    .traces { position: absolute; width: 190px; fill: none; stroke: var(--trace); stroke-width: 5; pointer-events: none; }
    .traces-tl { top: 0; left: 0; width: 130px; }
    .traces-tr { top: 0; right: 0; width: 130px; transform: scaleX(-1); }
    .traces-bl { bottom: 0; left: 0; transform: scaleY(-1); }
    .traces-br { bottom: 0; right: 0; transform: scale(-1); }
    .trace-orange { stroke: var(--orange); }
    .trace-yellow { stroke: var(--yellow); }
    .wave { position: relative; height: 22px; max-width: 1072px; margin: 0 auto; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='22'%3E%3Cpath d='M0 20H18V2H54V20H72' fill='none' stroke='%23ff8a3d' stroke-width='2'/%3E%3C/svg%3E") repeat-x center; }

    .hero { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; padding-block: 120px 104px; }
    .hero-text { display: flex; flex-direction: column; align-items: center; gap: 22px; width: 100%; }
    .hero h1 { width: 100%; max-width: 12em; font-size: clamp(1.75rem, 7.6vw, 3.75rem); line-height: 1.12; }
    .typing-ready { display: grid; }
    .typing-ready > span { grid-area: 1 / 1; }
    .typing-sizer, .typing-pending { visibility: hidden; }
    .typing-word { color: var(--orange); }
    .typing-cursor { position: relative; }
    .typing-cursor::after { content: ""; position: absolute; left: 0.04em; bottom: -0.02em; width: 0.08em; height: 0.95em; background: var(--orange); }
    .typing-cursor.is-waiting::after { animation: typing-blink 0.8s steps(1) infinite; }
    @keyframes typing-blink { 50% { opacity: 0; } }


    .section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
    .thumb { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; background: var(--soft); }
    .featured { position: relative; display: flex; flex-wrap: wrap; gap: 32px; align-items: center; }
    .featured .thumb { flex: 1 1 480px; min-width: 0; height: auto; border-radius: 10px; }
    .featured-text { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
    .featured-title { font-size: 30px; line-height: 1.2; font-weight: 600; letter-spacing: -0.015em; }
    .grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 32px 28px; }
    .grid-wide { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 24px; }
    .with-sidebar { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 40px; align-items: start; }
    .sidebar { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
    .side-block { padding: 20px; scroll-margin-top: 16px; }
    .side-title { font-family: var(--mono); font-size: 14px; font-weight: 500; color: var(--accent); margin-bottom: 8px; }
    .side-block li { border-top: 1px solid var(--soft); }
    .side-block a { display: flex; align-items: center; gap: 12px; min-height: 48px; font-size: 15px; text-decoration: none; }
    .side-block a:hover .side-name, .side-block a[aria-current="page"] .side-name { text-decoration: underline; text-decoration-color: var(--orange); text-decoration-thickness: 2px; text-underline-offset: 6px; }
    .side-label { flex: 0 0 38px; font-family: var(--mono); color: var(--accent); }
    .side-name { flex: 1; min-width: 0; }
    .divided { border-top: 1px solid var(--line); padding-top: 32px; }
    .card { position: relative; display: flex; flex-direction: column; gap: 12px; }
    .card-title { font-size: 18px; line-height: 1.35; font-weight: 600; }
    .stretched { text-decoration: none; }
    .stretched::after { content: ""; position: absolute; inset: 0; }
    .card:hover .stretched, .featured:hover .stretched, .track-item:hover .stretched { text-decoration: underline; }

    .panel { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 24px; }
    .serie-card { display: flex; flex-direction: column; gap: 14px; }
    .serie-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
    .serie-label { font-family: var(--mono); font-size: 22px; font-weight: 500; color: var(--accent); }
    .serie-name { font-size: 20px; font-weight: 600; }
    .serie-list { flex-grow: 1; font-size: 14px; }
    .serie-list li { padding-block: 10px; border-top: 1px solid var(--soft); }
    .serie-list a { text-decoration: none; }
    .serie-list a:hover { text-decoration: underline; }

    .waitlist { display: flex; flex-wrap: wrap; gap: 40px; align-items: flex-end; }
    .waitlist-text { flex: 1 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
    .waitlist-text p { color: var(--dark-muted); max-width: 50ch; }
    .waitlist-form { flex: 1 1 360px; min-width: 0; display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
    .field-row { display: flex; flex-wrap: wrap; gap: 10px; }
    .field-row input { flex: 1 1 200px; min-width: 0; min-height: 48px; padding-inline: 14px; border-radius: 6px; border: 1px solid #6b7077; background: var(--dark-2); color: var(--dark-ink); }
    .waitlist-form input { accent-color: var(--orange); }
    .consent { display: flex; gap: 10px; align-items: flex-start; color: var(--dark-muted); }
    .consent input { width: 18px; height: 18px; margin-top: 2px; }
    .trap { position: absolute; left: -9999px; }
    .notice { padding: 12px 14px; border: 1px solid currentColor; border-radius: 6px; }


    .page-head { display: flex; flex-direction: column; gap: 12px; }
    .search { display: flex; gap: 8px; }
    .search input { flex: 1; width: 100%; min-width: 0; min-height: 48px; padding-inline: 14px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
    .pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; }

    .lesson { display: flex; flex-direction: column; gap: 28px; padding-block: 48px 80px; }
    .crumbs { font-size: 14px; color: var(--muted); }
    .video { aspect-ratio: 16 / 9; background: #000; border-radius: 12px; overflow: hidden; }
    .video iframe { width: 100%; height: 100%; }
    .reading { width: 100%; max-width: 760px; display: flex; flex-direction: column; gap: 32px; }
    .siblings { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 16px; }
    .siblings a { display: flex; flex-direction: column; gap: 6px; text-decoration: none; }
    .siblings .next { text-align: right; }
    .promo { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
    .price { font-size: 20px; }
    .login { width: 100%; max-width: 420px; margin-inline: auto; display: flex; flex-direction: column; gap: 10px; }
    .login h1 { font-size: 24px; margin-bottom: 8px; }
    .login input:not([type="hidden"]) { min-height: 48px; padding-inline: 14px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); }

    .contact-form { display: flex; flex-direction: column; gap: 18px; }
    .contact-form > div { display: flex; flex-direction: column; gap: 6px; }
    .contact-form label { font-size: 14px; font-weight: 600; }
    .contact-form input:not([type="hidden"]), .contact-form textarea { width: 100%; min-height: 48px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--ink); }
    .contact-form textarea { resize: vertical; }
    .contact-form [aria-invalid="true"] { border-color: var(--orange); }
    .contact-form ul { font-size: 14px; color: var(--accent); }
    .contact-form .trap { position: absolute; left: -9999px; }
    .contact-form .button { align-self: flex-start; }
    .small-note { font-size: 14px; }
    .whatsapp { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; }
    .whatsapp-number { font-size: 22px; font-weight: 600; }

    .track { display: flex; flex-direction: column; gap: 16px; }
    .track-item { position: relative; display: grid; grid-template-columns: 40px 220px minmax(0, 1fr); gap: 20px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 16px; }
    .track-number { font-family: var(--mono); font-size: 20px; color: var(--accent); text-align: center; }

    .prose { font-size: 17px; line-height: 1.75; overflow-wrap: anywhere; }
    .prose > * + * { margin-top: 1.1em; }
    .prose h1, .prose h2 { font-size: 1.5rem; line-height: 1.3; font-weight: 600; margin-top: 2em; }
    .prose h3 { font-size: 1.2rem; font-weight: 600; margin-top: 1.6em; }
    .prose a { text-decoration: underline; }
    .prose ul { list-style: disc; padding-left: 1.4em; }
    .prose ol { list-style: decimal; padding-left: 1.4em; }
    .prose img { max-width: 100%; border-radius: 8px; }
    .prose blockquote { border-left: 3px solid var(--line); padding-left: 16px; color: var(--muted); }
    .prose table { display: block; overflow-x: auto; border-collapse: collapse; }
    .prose th, .prose td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; }
    .prose code { font-family: var(--code); font-size: 0.9em; background: var(--soft); border-radius: 4px; padding: 1px 5px; }
    .prose pre { position: relative; background: #0f1113; border: 1px solid var(--trace); color: var(--paper); border-radius: 10px; padding: 20px; overflow-x: auto; font-size: 14px; line-height: 1.7; overflow-wrap: normal; }
    .prose pre code { background: none; padding: 0; }
    .code-block { position: relative; }
    .copy-button { position: absolute; top: 8px; right: 8px; padding: 6px 12px; font-size: 12px; border: 1px solid #4a4f56; border-radius: 5px; background: #24282d; color: var(--paper); cursor: pointer; }
    .hljs-keyword, .hljs-type { color: var(--orange); }
    .hljs-string { color: var(--yellow); }
    .hljs-number, .hljs-literal { color: var(--yellow); }
    .hljs-comment { color: #8f949c; }
    .hljs-meta, .hljs-built_in { color: #8fc7ff; }

    .footer { background: var(--surface); border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
    .footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 24px; padding-block: 24px; }
    .footer-links { display: flex; flex-wrap: wrap; gap: 4px 24px; }
    .footer-links a { display: inline-flex; align-items: center; min-height: 44px; }

    @media (max-width: 900px) {
        .with-sidebar { grid-template-columns: minmax(0, 1fr); gap: 32px; }
        /* Em telas estreitas a lateral vem antes das aulas. */
        .sidebar { order: -1; }
    }

    @media (max-width: 700px) {
        .section { padding-block: 48px; }
        .hero { padding-block: 72px 48px; }
        .traces-tl, .traces-tr { width: 80px; }
        .traces-bl, .traces-br { display: none; }
        .menu-button { display: inline-flex; align-items: center; }
        .js .menu { display: none; }
        .menu { flex-basis: 100%; flex-direction: column; align-items: flex-start; }
        .js .menu.is-open { display: flex; }
        .track-item { grid-template-columns: 32px minmax(0, 1fr); gap: 12px; }
        .track-item .thumb { display: none; }
        .siblings .next { text-align: left; }
    }
}

@layer components {
    .admin-nav { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; border-bottom: 1px solid var(--line); padding-bottom: 12px; font-size: 15px; }
    .admin-nav a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; }
    .admin-nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--orange); text-decoration-thickness: 2px; text-underline-offset: 8px; }
    .admin-nav form { margin-left: auto; }
    .admin-nav button, .row-actions button { min-height: 44px; cursor: pointer; color: var(--muted); }
    .admin-search { max-width: 420px; }
    .table-scroll { overflow-x: auto; }
    .admin-table { width: 100%; background: var(--surface); font-size: 14px; }
    .admin-table th, .admin-table td { border: 1px solid var(--line); padding: 10px 12px; text-align: left; vertical-align: middle; }
    .row-actions { white-space: nowrap; }
    .row-actions > div { display: flex; gap: 16px; align-items: center; }
    .row-actions .publish-button { min-width: 112px; min-height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); }
    .row-actions .publish-button.is-draft { border-color: var(--orange); background: var(--orange); color: var(--graphite); font-weight: 600; }
    .contact-form select { width: 100%; min-height: 48px; padding: 0 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); }
    .contact-form .check { flex-direction: row; align-items: center; gap: 12px; }
    .contact-form .check input { width: 20px; min-height: 20px; accent-color: var(--orange); }
    .contact-form .code-field { font-family: var(--code); font-size: 14px; line-height: 1.7; }
    .notice-error { color: var(--accent); }
}
