/* ============================================================
   Shared styles for Creme project pages.
   Tokens mirror index.html exactly (one design system, no drift).
   ============================================================ */

:root {
  --primary: #5F4A8B;
  --primary-dark: #49366E;
  --primary-deep: #251B3A;
  --secondary: #EAA824;
  --secondary-dark: #C68910;
  --tertiary: #846FAE;
  --neutral-bg: #FEF8D4;
  --accent-lavender: #D8CCE8;
  --accent-moss: #52B788;
  --surface-terracotta: #C1440E;
  --text-main: #241A38;
  --text-muted: #5F5474;
  --border-subtle: rgba(95, 74, 139, 0.15);
  --border-medium: rgba(95, 74, 139, 0.28);

  --font-display: 'Nunito', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius-sm: 20px;
  --radius-md: 40px;
  --radius-btn: 24px;

  --transition-spring: 220ms cubic-bezier(0.34, 1.4, 0.64, 1);
  --transition-standard: 200ms ease;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-display);
  background-color: var(--neutral-bg);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  padding: 0 1.5rem;
  position: relative;
}

/* ---------- Top bar ---------- */
.top-bar {
  padding: 1.25rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
  transition: color var(--transition-standard);
}

.back-link:hover {
  color: var(--primary-dark);
}

.repo-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition-standard);
}

.repo-link:hover {
  color: var(--secondary-dark);
}

/* ---------- Hero ---------- */
.project-hero {
  padding: 1rem 0 2.5rem;
}

.project-hero h1 {
  font-size: clamp(2.4rem, 5vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--primary-deep);
  margin-bottom: 0.75rem;
}

.project-tagline {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 62ch;
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
}

/* Project logo — sits leftmost inside the dark download card */
.download-logo {
  width: clamp(56px, 9vw, 88px);
  height: auto;
  flex-shrink: 0;
  user-select: none;
}

/* ---------- Download card ---------- */
.download-card {
  background: var(--primary-deep);
  color: var(--neutral-bg);
  border-radius: var(--radius-md);
  padding: clamp(1.75rem, 4vw, 2.5rem);
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
}

.download-info {
  flex: 1 1 auto;
  min-width: 0;
}

.download-action {
  margin-left: auto;
}

.download-info h2 {
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 0.35rem;
}

.download-meta {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: rgba(254, 248, 212, 0.7);
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  padding: 0.85rem 1.5rem;
  border-radius: var(--radius-btn);
  text-decoration: none;
  cursor: pointer;
  border: 1.5px solid transparent;
  line-height: 1;
  transition: all var(--transition-spring);
}

.btn:active {
  transform: translateY(1px);
}

.btn-solar {
  background-color: var(--secondary);
  color: #3b2800;
}

.btn-solar:hover {
  background-color: var(--secondary-dark);
  transform: translateY(-2px);
}

.btn-ghost {
  background: rgba(254, 248, 212, 0.06);
  border-color: rgba(254, 248, 212, 0.25);
  color: var(--neutral-bg);
}

.btn-ghost:hover {
  background: rgba(254, 248, 212, 0.12);
  border-color: var(--secondary);
}

/* ---------- README body ---------- */
.readme {
  background: #FFFFFF;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: clamp(1.75rem, 4vw, 3rem);
  margin-bottom: 3rem;
}

.readme h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary-deep);
  margin: 2.25rem 0 0.75rem;
  letter-spacing: -0.01em;
}

.readme h2:first-child {
  margin-top: 0;
}

.readme h3 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--primary-dark);
  margin: 1.75rem 0 0.5rem;
}

.readme p {
  color: var(--text-main);
  font-size: 1rem;
  max-width: 72ch;
  margin-bottom: 0.9rem;
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
}

.readme ul,
.readme ol {
  margin: 0 0 1rem 1.25rem;
  max-width: 68ch;
}

.readme li {
  margin-bottom: 0.45rem;
}

.readme a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1.5px solid rgba(95, 74, 139, 0.35);
  transition: color var(--transition-standard), border-color var(--transition-standard);
}

.readme a:hover {
  color: var(--secondary-dark);
  border-color: var(--secondary-dark);
}

.readme code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: rgba(95, 74, 139, 0.08);
  color: var(--primary-dark);
  padding: 0.15em 0.45em;
  border-radius: 6px;
}

.readme pre {
  background: var(--primary-deep);
  color: var(--neutral-bg);
  font-family: var(--font-mono);
  font-size: 0.84rem;
  line-height: 1.65;
  padding: 1.15rem 1.35rem;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  margin: 0 0 1.25rem;
}

.readme pre code {
  background: none;
  color: inherit;
  padding: 0;
  font-size: inherit;
}

.readme blockquote {
  border-left: 3px solid var(--secondary);
  background: rgba(234, 168, 36, 0.08);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 0.9rem 1.15rem;
  margin: 0 0 1.25rem;
  color: var(--text-main);
  max-width: 68ch;
}

.readme blockquote p {
  margin-bottom: 0;
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
}


/* ---------- Footer ---------- */
footer {
  padding: 2rem 0 3rem;
  border-top: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: auto;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

footer a {
  color: var(--text-muted);
  font-weight: 700;
  text-decoration: none;
  transition: color var(--transition-standard);
}

footer a:hover {
  color: var(--primary);
}

/* ---------- Icons ---------- */
.glyph {
  font-size: 18px;
  line-height: 1;
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

.glyph-sm {
  font-size: 15px;
}

/* ---------- Mobile ---------- */
@media (max-width: 768px) {
  .download-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .download-logo {
    width: 64px;
  }

  .download-action {
    margin-left: 0;
    width: 100%;
  }

  .download-action .btn {
    width: 100%;
  }

  .readme {
    padding: 1.5rem 1.25rem;
  }
}

.readme table {
  width: 100%;
  max-width: 68ch;
  border-collapse: collapse;
  font-size: 0.92rem;
  margin-bottom: 1.25rem;
}

.readme th,
.readme td {
  text-align: left;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--border-subtle);
}

.readme th {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary-dark);
  background: rgba(95, 74, 139, 0.06);
}

.readme td code {
  white-space: nowrap;
}

.readme hr {
  border: none;
  border-top: 1px solid var(--border-subtle);
  margin: 2rem 0;
}

/* WIP state (no release yet) */
.wip-note {
  font-size: 0.95rem;
  color: rgba(254, 248, 212, 0.85);
  max-width: 52ch;
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
}
