/* Reset */

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

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

body {
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

img, picture, video, canvas, svg {
    display: block;
    max-width: 100%;
}

input, button, textarea, select {
    font: inherit;
    color: inherit;
}

button {
    cursor: pointer;
    background: none;
    border: none;
}

ul, ol {
    list-style: none;
}

h1, h2, h3, h4, h5, h6 {
    font-size: inherit;
    font-weight: inherit;
}

h1 {
    line-height: 1;
}

table {
    border-collapse: collapse;
    border-spacing: 0;
}

/* Tokens */

:root {
    /* Brand */
    --brand-1: #1a7a5a;
    --brand-2: #2ea67a;
    --brand-3: #4cc99a;
    --accent: #50c8a0;

    /* Light mode (default) */
    --bg: #f5f5f0;
    --bg-surface: #fff;
    --text: #333333;
    --btn-bg: #222222;
    --btn-text: #f5f5f0;
    --muted: rgba(0, 0, 0, 0.4);
    --text-secondary: #666;
    --subtle: rgba(0, 0, 0, 0.1);
    --subtle-hover: rgba(0, 0, 0, 0.2);
    --border: #eee;
    --error: #c0392b;
    --placeholder: #ccc;
    --code-bg: #f5f5f5;

    /* Typography */
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 0.9375rem;
    --font-size-md: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.5rem;
    --font-size-2xl: 2rem;
    --font-size-logo: 4.5rem;

    /* Font weights */
    --font-weight-semibold: 500;
    --font-weight-bold: 700;
    --font-weight-extrabold: 800;

    /* Spacing (4px grid) */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-7: 28px;
    --space-8: 32px;
    --space-9: 36px;
    --space-10: 40px;
    --space-12: 56px;

    /* Border radius */
    --radius-sm: 6px;
    --radius-lg: 16px;
    --radius-pill: 50px;

    /* Content width */
    --content-width: 720px;
    --measure: 70em;

    /* Published page typography */
    --site-font-body: Georgia, "Charter", "Bitstream Charter", "Sitka Text", Cambria, serif;
    --site-font-heading: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --site-font-size: 1.25rem;
    --site-line-height: 1.7;
    --site-max-width: 680px;
    --site-color-text: #333;
    --site-color-heading: #111;
    --site-color-muted: #999;
    --site-color-nav: #848484;

    /* Breakpoints (used in media queries) */
    /* --bp-sm: 640px */
    /* --bp-md: 864px */
    /* --bp-lg: 1152px */
}


/* Classless base */

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
}

/* Components */

.btn {
    display: inline-block;
    padding: var(--space-2) var(--space-5);
    font-size: var(--font-size-sm);
    font-weight: 600;
    border: 1px solid transparent;
    border-radius: var(--radius-pill);
    transition: opacity 0.15s, border-color 0.15s;
}

.btn:hover {
    opacity: 0.9;
}

.btn-solid {
    background: var(--btn-bg);
    color: var(--btn-text);
    border: 1px solid var(--btn-bg);
}

.btn-outline {
    background: transparent;
    color: var(--muted);
    border-color: var(--subtle);
}

.btn-outline:hover {
    opacity: 0.7;
}

.btn-lg {
    padding: var(--space-2) var(--space-5);
    font-size: var(--font-size-md);
}

.btn-publish {
    background: var(--accent);
    color: #fff;
}

.btn-sm {
    padding: var(--space-1) 14px;
    font-size: var(--font-size-sm);
}

/* Layout */

.shell {
    max-width: 400px;
    margin: 0 auto;
    padding: 80px var(--space-5);
}

.shell-wide {
    max-width: var(--site-max-width);
    padding: var(--space-10) var(--space-5);
}

@media (min-width: 640px) {
    .shell-wide {
        padding: 80px var(--space-10);
    }
}

.shell-centered {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: var(--space-8);
    text-align: center;
}

/* Panel */

.panel-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-8);
}

.panel-back {
    display: block;
    font-size: var(--font-size-lg);
    color: var(--site-color-muted);
    margin-bottom: var(--space-5);
    width: 100%;
    max-width: 500px;
    text-align: center;
}

.panel {
    background: var(--bg-surface);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    border-radius: var(--radius-pill);
    padding: var(--space-12);
    width: 100%;
    max-width: 500px;
}

/* Typography */

.title {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    margin-bottom: var(--space-5);
    text-align: center;
}

.subtitle {
    color: var(--text-secondary);
    font-size: var(--font-size-md);
    margin-bottom: var(--space-5);
}

.subtitle a {
    color: var(--text);
    text-decoration: underline;
}

/* Feedback */

.error {
    color: var(--error);
    font-size: var(--font-size-sm);
    margin-bottom: var(--space-3);
}

/* Forms */

.field {
    margin-bottom: var(--space-5);
}

.label {
    display: block;
    font-size: var(--font-size-md);
    font-weight: 600;
    margin-bottom: var(--space-2);
    color: var(--text);
}

.input {
    width: 100%;
    padding: var(--space-2);
    font-size: var(--font-size-md);
    border: 1px solid var(--subtle);
    border-radius: 4px;
    background: var(--bg-surface);
    color: var(--text);
}

.input:focus {
    outline: none;
    border-color: var(--text);
}

/* Lists */

.item-list {
    margin-bottom: var(--space-5);
}

.item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-2) 0;
}

.item a {
    font-weight: 600;
    text-decoration: underline;
}

/* Utilities */

.section-title {
    font-size: var(--font-size-md);
    font-weight: 600;
    margin-bottom: var(--space-3);
}

.muted-link {
    display: block;
    margin-top: var(--space-5);
    font-size: var(--font-size-sm);
    color: var(--site-color-muted);
}

.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-5 { margin-bottom: var(--space-5); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }
