/* ============================================================
   SSC Design System — "Fresh and Nutritious"
   Skördemarknad × laboratorium
   ============================================================ */

:root {
    /* Surfaces */
    --bg-paper:        #f7f5ed;   /* unbleached linen */
    --bg-card:         #ffffff;
    --bg-dark:         #1a2e1f;   /* deep forest moss */
    --bg-dark-2:       #243b2a;

    /* Accents */
    --accent-basil:    #3d8a4d;   /* ripe basil */
    --accent-lime:     #c7d96a;   /* lime peel */
    --warn-saffron:    #d97706;   /* burnt saffron */
    --crit-chili:      #8b2c2c;   /* dried chili */

    /* Text */
    --text-dark:       #1a1a1a;
    --text-muted:      #5a6058;
    --text-light:      #f7f5ed;
    --text-on-dark-muted: #a8b5ac;

    /* Borders */
    --border-soft:     rgba(0, 0, 0, 0.08);
    --border-medium:   rgba(0, 0, 0, 0.16);

    /* Type */
    --font-display:    'Fraunces', 'Iowan Old Style', Georgia, serif;
    --font-body:       'Inter', system-ui, sans-serif;
    --font-mono:       'JetBrains Mono', 'SF Mono', Consolas, monospace;

    /* Spacing scale */
    --space-xs:  0.5rem;
    --space-sm:  0.75rem;
    --space-md:  1.25rem;
    --space-lg:  2rem;
    --space-xl:  3.5rem;
    --space-2xl: 5.5rem;

    /* Radii */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 16px;

    /* Max-widths */
    --content-max: 1120px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg-paper);
    color: var(--text-dark);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

/* Subtle paper grain on body */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: 0.04;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/></filter><rect width='200' height='200' filter='url(%23n)'/></svg>");
    background-size: 240px;
}

main, header, footer { position: relative; z-index: 1; }

/* Typography */
h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 500;
    letter-spacing: -0.01em;
    line-height: 1.15;
    margin: 0 0 var(--space-md) 0;
}

h1 { font-size: clamp(2rem, 4.5vw, 3.25rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); }
h3 { font-size: 1.25rem; font-weight: 600; }
h4 { font-size: 1rem; font-weight: 600; font-family: var(--font-body); text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); }

a { color: var(--accent-basil); text-decoration: underline; text-underline-offset: 3px; }
a:hover { color: var(--bg-dark); }

code, pre, .mono { font-family: var(--font-mono); font-size: 0.875em; }

/* Layout primitives */
.container { max-width: var(--content-max); margin: 0 auto; padding: 0 var(--space-md); }

.section { padding: var(--space-2xl) 0; }
.section + .section { border-top: 1px solid var(--border-soft); }

/* Header */
.site-header {
    background: var(--bg-dark);
    color: var(--text-light);
    padding: var(--space-md) 0;
}
.site-header .container { display: flex; justify-content: space-between; align-items: center; }
.site-header .brand {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 500;
    color: var(--text-light);
    text-decoration: none;
}
.site-header .brand .dot { color: var(--accent-lime); }
.site-header nav a {
    color: var(--text-on-dark-muted);
    margin-left: var(--space-md);
    text-decoration: none;
    font-size: 0.9rem;
}
.site-header nav a:hover { color: var(--accent-lime); }

/* Hero */
.hero {
    padding: var(--space-2xl) 0 var(--space-xl);
}
.hero .eyebrow {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--accent-basil);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: var(--space-md);
}
.hero h1 { max-width: 800px; }
.hero .lede {
    font-size: 1.2rem;
    color: var(--text-muted);
    max-width: 640px;
    margin-top: var(--space-md);
}

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    position: relative;
}
.card-lg { padding: var(--space-lg); }
.card h3 { margin-top: 0; }

/* Severity badges */
.badge {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
}
.badge-high   { background: var(--crit-chili);   color: white; }
.badge-medium { background: var(--warn-saffron);  color: white; }
.badge-low    { background: var(--accent-lime);   color: var(--bg-dark); }
.badge-info   { background: var(--bg-dark);       color: var(--accent-lime); }

/* Section eyebrow */
.section-eyebrow {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--accent-basil);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    margin-bottom: var(--space-sm);
}

/* Grid */
.grid { display: grid; gap: var(--space-md); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 720px) {
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

/* Roadmap panel (Tier 2/3) */
.roadmap-panel {
    opacity: 0.55;
    filter: grayscale(0.5);
    border: 1px dashed var(--border-medium);
    background: transparent;
    padding: var(--space-lg);
    border-radius: var(--radius-md);
}
.roadmap-panel h3 { color: var(--text-muted); }
.roadmap-panel .roadmap-badge {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    padding: 2px 8px;
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    margin-left: var(--space-xs);
}

/* Footer */
.site-footer {
    background: var(--bg-dark);
    color: var(--text-on-dark-muted);
    padding: var(--space-xl) 0 var(--space-md);
    margin-top: var(--space-2xl);
    font-size: 0.85rem;
}
.site-footer .container {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}
.admin-cog {
    background: transparent;
    border: none;
    cursor: pointer;
    opacity: 0.3;
    transition: opacity 0.2s;
    padding: 4px;
}
.admin-cog:hover { opacity: 0.7; }
.admin-cog svg { width: 16px; height: 16px; fill: var(--text-on-dark-muted); }

/* Admin modal */
.modal-backdrop {
    position: fixed; inset: 0;
    background: rgba(26, 46, 31, 0.85);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
}
.modal-backdrop.open { display: flex; }
.modal {
    background: var(--bg-paper);
    padding: var(--space-lg);
    border-radius: var(--radius-md);
    width: min(380px, 92vw);
    box-shadow: 0 24px 60px rgba(0,0,0,0.35);
}
.modal h3 { margin-top: 0; }
.modal input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 1rem;
    margin-bottom: var(--space-sm);
    background: white;
}
.modal button {
    padding: 10px 16px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 0.95rem;
    cursor: pointer;
}
.modal button.primary { background: var(--accent-basil); color: white; }
.modal button.ghost   { background: transparent; color: var(--text-muted); }
.modal-error { color: var(--crit-chili); font-size: 0.85rem; margin-top: var(--space-xs); }

/* Admin-only inline actions */
.admin-only { display: none; }
body.is-admin .admin-only { display: inline-flex; }
.admin-bar {
    background: var(--accent-lime);
    color: var(--bg-dark);
    padding: 8px 0;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    display: none;
}
body.is-admin .admin-bar { display: block; }
