/* bodyga.me - Responsive, readable, light */

:root {
    --bg: #ffffff;
    --bg-subtle: #f8f9fa;
    --text: #1a1a1a;
    --text-secondary: #5f6368;
    --text-muted: #9aa0a6;
    --accent: #d93025;
    --border: #e0e0e0;
    --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'SF Mono', Consolas, monospace;
}

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

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    font-size: clamp(15px, 2vw, 17px);
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Header */
header {
    padding: 5vh 5vw 2vh;
    border-bottom: 1px solid var(--border);
}

header h1 {
    font-size: clamp(1.25rem, 4vw, 1.75rem);
    font-weight: 600;
}

.subtitle {
    color: var(--text-secondary);
    font-size: clamp(0.9rem, 2vw, 1rem);
}

/* Navigation */
nav {
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 0 3vw;
}

nav ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0;
}

nav a {
    display: block;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.75rem 1rem;
}

nav a:hover {
    color: var(--text);
    text-decoration: none;
    background: var(--bg-subtle);
}

/* Container - responsive padding */
.container {
    padding: 3vh 5vw;
}

/* Home */
.hero {
    margin-bottom: 3vh;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
    gap: 1rem;
    margin-bottom: 4vh;
}

.tool-card {
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 1.25rem;
    color: inherit;
    transition: border-color 0.15s;
}

.tool-card:hover {
    border-color: var(--accent);
    text-decoration: none;
}

.tool-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.tool-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Section headers */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.section-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
}

/* Blog */
.posts-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.post-card {
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
}

.post-card:last-child {
    border-bottom: none;
}

.post-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
}

.post-card h3 a {
    color: var(--text);
}

.post-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.3rem;
}

.post-excerpt {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Calculator controls */
.controls {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.control-group {
    flex: 1;
    min-width: 150px;
}

.control-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}

.control-group input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    margin-bottom: 0.4rem;
}

.control-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: var(--accent);
    border-radius: 50%;
    cursor: pointer;
}

.control-group input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: var(--accent);
    border: none;
    border-radius: 50%;
    cursor: pointer;
}

.control-group .value {
    font-size: clamp(1.25rem, 3vw, 1.5rem);
    font-weight: 600;
    font-family: var(--font-mono);
}

.control-group .unit {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-left: 0.2rem;
}

/* Canvas - fully responsive */
.canvas-container {
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 2%;
    margin-bottom: 1.5rem;
}

canvas {
    display: block;
    width: 100%;
    height: auto;
    max-height: 60vh;
}

/* Legend */
.legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 0.5rem 0;
    margin-bottom: 1rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.legend-color {
    width: 16px;
    height: 3px;
    border-radius: 1px;
}

/* Results */
.results {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 120px), 1fr));
    gap: 0.75rem;
}

.result-item {
    background: var(--bg-subtle);
    border-radius: 6px;
    padding: 0.875rem;
    text-align: center;
}

.result-label {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    margin-bottom: 0.25rem;
}

.result-value {
    font-size: clamp(1.1rem, 2.5vw, 1.35rem);
    font-weight: 600;
    font-family: var(--font-mono);
}

.result-detail {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

/* Info */
.info {
    margin-top: 1.5rem;
    padding: 1rem;
    background: var(--bg-subtle);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.info strong {
    color: var(--text);
}

/* Summary */
.summary {
    background: var(--bg-subtle);
    border-radius: 6px;
    padding: 1.25rem;
    text-align: center;
    margin-bottom: 1.5rem;
}

.summary-value {
    font-size: clamp(1.75rem, 5vw, 2.25rem);
    font-weight: 700;
    color: var(--accent);
    font-family: var(--font-mono);
}

.summary-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Videos */
.category-section {
    margin-bottom: 3vh;
}

.category-header {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--border);
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
    gap: 1rem;
}

.video-card {
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
}

.video-embed {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    background: #000;
}

.video-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.video-info {
    padding: 0.75rem;
}

.channel-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 0.2rem;
}

.video-title {
    font-size: 0.85rem;
    line-height: 1.4;
}

.published-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

/* Loading & error */
.loading, .error {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}

.error {
    color: var(--accent);
}

/* Blog content */
.post-content {
    line-height: 1.8;
    max-width: 65ch;
}

.post-content h2 {
    margin-top: 2rem;
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.post-content p {
    margin-bottom: 1rem;
}

.post-content ul, .post-content ol {
    margin-bottom: 1rem;
    padding-left: 1.25rem;
}

.post-content li {
    margin-bottom: 0.4rem;
}

.post-content a {
    text-decoration: underline;
}

.post-content img {
    max-width: 100%;
    border-radius: 6px;
    margin: 1rem 0;
}

.back-link {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.post-list {
    list-style: none;
}
