:root {
    /* Base Colors */
    --bg: #000000;
    --bg-card: #0a0a0a;
    --bg-hover: #1a1a1a;
    --fg: #f5f5f5;
    --fg-muted: #a3a3a3;
    --fg-faint: #525252;
    --accent: #ffffff;
    --border-light: #222222;

    /* Semantic Colors */
    --color-success: #10b981;
    --color-error: #ef4444;
    --color-warning: #f59e0b;
    --color-info: #3b82f6;

    /* Typography */
    --font-sans: 'Google Sans Flex', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
    --font-mono: 'Courier New', Courier, monospace;
    
    --text-xs: 0.75rem;   /* 12px */
    --text-sm: 0.875rem;  /* 14px */
    --text-base: 1rem;    /* 16px */
    --text-lg: 1.125rem;  /* 18px */
    --text-xl: 1.25rem;   /* 20px */
    --text-2xl: 1.5rem;   /* 24px */
    --text-3xl: 2rem;     /* 32px */
    --text-4xl: 2.5rem;   /* 40px */
    
    --font-regular: 400;
    --font-medium: 500;
    --font-bold: 600;

    /* Spacing (8px system) */
    --space-half: 0.25rem;  /* 4px — half-step para gaps finos */
    --space-1: 0.5rem;      /* 8px */
    --space-2: 1rem;        /* 16px */
    --space-3: 1.5rem;      /* 24px */
    --space-4: 2rem;        /* 32px */
    --space-5: 2.5rem;      /* 40px */
    --space-6: 3rem;        /* 48px */
    --space-8: 4rem;        /* 64px */
    --space-10: 5rem;       /* 80px */
    --space-12: 6rem;       /* 96px */
    --space-16: 8rem;       /* 128px */
    --space-20: 10rem;      /* 160px */
    --space-24: 12rem;      /* 192px */

    /* Layout */
    --max-width: 1000px;
    
    /* Radius */
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --radius-xl: 12px;
    --radius-2xl: 16px;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-slow: 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

:root[data-theme="light"] {
    --bg: #ffffff;
    --bg-card: #f7f7f7;
    --bg-hover: #ececec;
    --fg: #171717;
    --fg-muted: #525252;
    --fg-faint: #8c8c8c;
    --accent: #000000;
    --border-light: #e5e5e5;
}

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

html {
    font-size: 16px;
    background: var(--bg);
    min-height: 100vh;
    scrollbar-width: thin;
    scrollbar-color: var(--border-light) var(--bg);
    transition: background-color var(--transition-normal);
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: transparent;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-full);
    color: var(--fg-muted);
    cursor: pointer;
    transition: color var(--transition-fast), border-color var(--transition-fast);
}

.theme-toggle:hover {
    color: var(--accent);
    border-color: var(--fg-faint);
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--fg-faint);
}

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--fg);
    line-height: 1.6;
    margin: 0 auto;
    max-width: var(--max-width);
    padding: var(--space-8) var(--space-6);
    transition: background-color var(--transition-normal), color var(--transition-normal);
}

.skip-link {
    position: absolute;
    top: -999px;
    left: 1rem;
}

/* Conteudo apenas para leitores de tela */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -4px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Indicador de foco visivel para navegacao por teclado (WCAG 2.4.7 / 1.4.11) */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: var(--radius-sm, 4px);
}

/* Cabecalhos e barras fixas nao devem cobrir o elemento focado (WCAG 2.4.11) */
:focus-visible,
:target {
    scroll-margin-top: 6rem;
    scroll-margin-bottom: 3rem;
}

.skip-link:focus {
    top: 1rem;
    background: var(--bg-hover);
    padding: 0.5rem;
    color: var(--accent);
    z-index: 100;
}

h2 {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--fg);
    margin-bottom: 1.5rem;
    letter-spacing: -0.01em;
}

.page-back {
    margin-bottom: 2.5rem;
}

.page-back a {
    color: var(--fg-faint);
    text-decoration: none;
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
    gap: var(--space-half);
    transition: color 0.2s ease, gap 0.2s ease;
    letter-spacing: 0.01em;
}

.page-back a:hover {
    color: var(--fg-muted);
    gap: var(--space-1);
}

.page-hero {
    margin-bottom: 3rem;
    padding-bottom: 2.5rem;
    border-bottom: 1px solid var(--border-light);
}

.page-hero h1 {
    font-size: 2.25rem;
    color: var(--fg);
    margin-bottom: 0.5rem;
    font-weight: 600;
    letter-spacing: -0.03em;
    line-height: 1.2;
}

.page-hero-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-1);
    margin-bottom: var(--space-3);
}

.page-hero-desc {
    color: var(--fg-muted);
    font-size: 1.1rem;
    margin-bottom: 0;
    line-height: 1.5;
}

.page-content p {
    font-size: 1.05rem;
    line-height: 1.75;
    color: var(--fg-muted);
    margin-bottom: 1.5rem;
}

.page-content p:last-child {
    margin-bottom: 0;
}

.page-content h2 {
    font-size: 1.1rem;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    color: var(--fg);
}

.page-content a {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
    text-decoration-color: var(--fg-faint);
    transition: text-decoration-color 0.2s;
}

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

.page-content.article-content {
    margin-top: 3rem;
    padding-top: 2.5rem;
}

.page-gallery {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 0;
}

.page-gallery img {
    width: 100%;
    height: auto;
    border-radius: 6px;
    border: 1px solid var(--border-light);
    cursor: zoom-in;
    transition: opacity 0.2s ease;
}

.page-gallery img:hover {
    opacity: 0.92;
}

.shot-frame {
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    overflow: hidden;
}

.shot-frame-bar {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-2);
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-hover);
}

.shot-frame-dots {
    display: flex;
    gap: var(--space-1);
    flex-shrink: 0;
}

.shot-frame-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border-light);
}

.shot-frame-dots span:first-child {
    background: var(--color-warning);
    opacity: 0.7;
}

.shot-frame-dots span:nth-child(2) {
    background: var(--color-success);
    opacity: 0.7;
}

.shot-frame-dots span:nth-child(3) {
    background: var(--color-error);
    opacity: 0.7;
}

.shot-frame-url {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--fg-muted);
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-full);
    padding: var(--space-half) var(--space-2);
}

.shot-frame-body {
    overflow-y: auto;
    overflow-x: hidden;
    height: 72vh;
}

.shot-frame-body img {
    display: block;
    width: 100%;
    height: auto;
    border: none;
    border-radius: 0;
    cursor: default;
}

.shot-frame--mobile {
    max-width: 430px;
    margin: 0 auto;
}

.shot-frame--mobile .shot-frame-body {
    height: 72vh;
}

@media (max-width: 600px) {
    .shot-frame-body,
    .shot-frame--mobile .shot-frame-body {
        height: 56vh;
    }
}

@media (max-width: 600px) {
    body {
        padding: var(--space-12) var(--space-5);
    }

    .page-hero h1 {
        font-size: 1.75rem;
    }
}