:root {
  --brand: #6366F1;
  --brand-dark: #0F172A;
  --bg: #F9FAFB;
  --surface: #ffffff;
  --text: #1F2937;
  --text-muted: #6B7280;
  --border: #E5E7EB;
  --radius: 8px;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
}

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

a:hover {
  text-decoration: underline;
}

/* Layout */

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
}

.site-header .logo {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--brand);
  display: flex;
  align-items: center;
  gap: 10px;
}

.site-header .logo img {
  height: 22px;
  width: auto;
}

.site-header nav a {
  margin-left: 1.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.site-header nav a:hover {
  color: var(--brand);
  text-decoration: none;
}

.container {
  max-width: 820px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

/* Typography */

h1 {
  font-size: 2rem;
  line-height: 1.25;
  margin-bottom: 0.75rem;
}

h2 {
  font-size: 1.4rem;
  margin-top: 2.5rem;
  margin-bottom: 0.6rem;
}

h3 {
  font-size: 1.1rem;
  margin-top: 1.8rem;
  margin-bottom: 0.4rem;
}

p,
ul,
ol {
  margin-bottom: 1rem;
}

ul,
ol {
  padding-left: 1.4rem;
}

li + li {
  margin-top: 0.35rem;
}

/* Cards */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.card h3 {
  margin-top: 0;
}

.card .meta {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

/* Experiment entries */

.experiment {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
}

.experiment h3 {
  margin-top: 0;
  font-size: 1.05rem;
}

.experiment .tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.2em 0.55em;
  border-radius: 4px;
  background: #eef2ff;
  color: var(--brand);
}

.tag--risk-low   { background: #ecfdf5; color: #047857; }
.tag--risk-med   { background: #fefce8; color: #a16207; }
.tag--risk-high  { background: #fef2f2; color: #b91c1c; }

/* CTA banner */

.cta-banner {
  margin-top: 3rem;
  padding: 1.5rem 2rem;
  background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
  border-radius: var(--radius);
  text-align: center;
}

.cta-banner p {
  margin-bottom: 0.75rem;
}

.btn {
  display: inline-block;
  background: var(--brand);
  color: #fff;
  padding: 0.6rem 1.4rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
}

.btn:hover {
  background: var(--brand-dark);
  text-decoration: none;
}

/* Footer */

.site-footer {
  text-align: center;
  padding: 2rem 1rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  margin-top: 4rem;
}

/* Calculator page */

.calc-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 2rem;
  margin-top: 1.5rem;
}

.calc-form label {
  display: block;
  font-weight: 600;
  margin-top: 1rem;
  margin-bottom: 0.25rem;
  font-size: 0.92rem;
}

.calc-form input,
.calc-form select {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.95rem;
}

.calc-result {
  margin-top: 1.25rem;
  padding: 1rem 1.25rem;
  background: #ecfdf5;
  border-radius: var(--radius);
  font-weight: 600;
  display: none;
}

/* Brief template */

.brief-field {
  margin-bottom: 1.25rem;
}

.brief-field label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.brief-field textarea,
.brief-field input,
.brief-field select {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-family: inherit;
}

.brief-field textarea {
  min-height: 80px;
  resize: vertical;
}

/* Responsive */

@media (max-width: 600px) {
  .site-header {
    flex-direction: column;
    gap: 0.5rem;
  }

  .site-header nav a {
    margin-left: 0;
    margin-right: 1rem;
  }

  h1 {
    font-size: 1.6rem;
  }

  .container {
    padding: 1.5rem 1rem 3rem;
  }
}
