/* =========================
   Global Theme + Layout
   ========================= */

:root {
  --bg: #f7f8fa;
  --card: #ffffff;
  --text: #222222;
  --muted: #555555;
  --shadow: 0 4px 10px rgba(0,0,0,0.05);
  --shadow-hover: 0 8px 18px rgba(0,0,0,0.08);
  --border: rgba(0,0,0,0.08);
  --btn-bg: rgba(0,0,0,0.06);
  --btn-bg-hover: rgba(0,0,0,0.10);
  --btn-text: #222;
}

/* Auto dark mode if user prefers dark */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0f14;
    --card: #121823;
    --text: #e9eef5;
    --muted: #a9b4c2;
    --shadow: 0 4px 12px rgba(0,0,0,0.35);
    --shadow-hover: 0 10px 22px rgba(0,0,0,0.45);
    --border: rgba(255,255,255,0.10);
    --btn-bg: rgba(255,255,255,0.10);
    --btn-bg-hover: rgba(255,255,255,0.16);
    --btn-text: #e9eef5;
  }
}

/* Manual override via data-theme on <html> */
html[data-theme="light"] {
  --bg: #f7f8fa;
  --card: #ffffff;
  --text: #222222;
  --muted: #555555;
  --shadow: 0 4px 10px rgba(0,0,0,0.05);
  --shadow-hover: 0 8px 18px rgba(0,0,0,0.08);
  --border: rgba(0,0,0,0.08);
  --btn-bg: rgba(0,0,0,0.06);
  --btn-bg-hover: rgba(0,0,0,0.10);
  --btn-text: #222;
}
html[data-theme="dark"] {
  --bg: #0b0f14;
  --card: #121823;
  --text: #e9eef5;
  --muted: #a9b4c2;
  --shadow: 0 4px 12px rgba(0,0,0,0.35);
  --shadow-hover: 0 10px 22px rgba(0,0,0,0.45);
  --border: rgba(255,255,255,0.10);
  --btn-bg: rgba(255,255,255,0.10);
  --btn-bg-hover: rgba(255,255,255,0.16);
  --btn-text: #e9eef5;
}

/* Base */

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

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

a {
  color: inherit;
}

a:hover {
  text-decoration: underline;
}

/* Container helpers */

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px;
}

.page-wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

/* =========================
   Site Header / Navigation
   ========================= */

.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav {
  max-width: 960px;
  margin: 0 auto;
  padding: 12px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  letter-spacing: -0.02em;
  color: var(--text);
}

.logo:hover {
  text-decoration: none;
}

.nav-links {
  display: flex;
  align-items: center;
}

.nav-links a {
  margin-left: 18px;
  text-decoration: none;
  font-size: 0.9rem;
  color: var(--text);
}

.nav-links a:hover {
  text-decoration: underline;
}

/* Mobile nav layout */
@media (max-width: 640px) {
  .nav {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .nav-links {
    flex-wrap: wrap;
  }

  .nav-links a {
    margin-left: 0;
    margin-right: 16px;
    margin-bottom: 4px;
  }
}

/* =========================
   Home Hero + Grid
   ========================= */

.home-header {
  text-align: center;
  padding: 56px 20px 28px;
  position: relative;
}

h1 {
  font-size: 2.5rem;
  margin: 0 0 10px;
  letter-spacing: -0.02em;
}

.subtitle {
  font-size: 1.1rem;
  color: var(--muted);
}

/* Reusable grid for tools */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-top: 32px;
}

.tool-card {
  background: var(--card);
  padding: 22px;
  border-radius: 14px;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.tool-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.tool-title {
  font-size: 1.15rem;
  font-weight: 650;
  margin-bottom: 8px;
}

.tool-desc {
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.35;
}

/* Homepage songwriting/AI links section */

.homepage-links {
  max-width: 760px;
  margin: 40px auto 10px;
  text-align: center;
}

.homepage-links h2 {
  font-size: 1.4rem;
  margin-bottom: 8px;
}

.homepage-links p {
  font-size: 0.98rem;
  color: var(--muted);
}

/* =========================
   Shared Article Styles
   (songwriting guides + AI tools page)
   ========================= */

main {
  display: grid;
  grid-template-columns: minmax(0, 3fr);
  gap: 2rem;
}

@media (min-width: 960px) {
  main {
    grid-template-columns: minmax(0, 3fr) minmax(260px, 1fr);
  }
}

article {
  background: var(--card);
  border-radius: 1rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 1.5rem 1.5rem 2rem;
}

article h2 {
  font-size: 1.4rem;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

article h3 {
  font-size: 1.1rem;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

article p {
  font-size: 0.98rem;
  margin: 0.4rem 0 0.7rem;
}

article ul,
article ol {
  padding-left: 1.4rem;
  margin: 0.4rem 0 0.9rem;
  font-size: 0.98rem;
}

article li {
  margin: 0.2rem 0;
}

/* Breadcrumbs (AI tools + guides) */

.breadcrumbs {
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.breadcrumbs a {
  color: var(--muted);
  text-decoration: none;
}

.breadcrumbs a:hover {
  text-decoration: underline;
}

/* Cards, notes, CTAs */

.card {
  background: var(--card);
  border-radius: 14px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 18px 16px;
  margin: 20px 0;
}

.note {
  font-size: 0.9rem;
  color: var(--muted);
}

.cta-box {
  border-radius: 0.9rem;
  border: 1px solid var(--border);
  background: rgba(15,23,42,0.02);
  padding: 1rem 1.1rem;
  margin: 1.4rem 0;
}

.cta-box strong {
  display: block;
  margin-bottom: 0.25rem;
}

.inline-link {
  color: #2563eb;
  text-decoration: none;
}

.inline-link:hover {
  text-decoration: underline;
}

/* Sidebar */

aside {
  display: none;
}

@media (min-width: 960px) {
  aside {
    display: block;
    position: sticky;
    top: 1.5rem;
    align-self: flex-start;
  }
}

.sidebar-card {
  background: var(--card);
  border-radius: 1rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.25rem 1.5rem;
  margin-bottom: 1rem;
  font-size: 0.93rem;
}

.sidebar-card h2 {
  font-size: 1.05rem;
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.sidebar-card ul {
  list-style: none;
  padding-left: 0;
  margin: 0.4rem 0 0.3rem;
}

.sidebar-card li {
  margin: 0.25rem 0;
}

.sidebar-card a {
  color: var(--text);
  text-decoration: none;
}

.sidebar-card a:hover {
  text-decoration: underline;
}

/* Tool grid inside articles (AI tools page) */

.tool-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
  margin: 1rem 0 1.5rem;
}

@media (min-width: 720px) {
  .tool-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.tool-card-small {
  border-radius: 0.9rem;
  border: 1px solid var(--border);
  background: rgba(15,23,42,0.015);
  padding: 1rem 1.1rem 1.1rem;
}

.tool-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 0.15rem;
}

.tool-card-small h3 {
  margin-top: 0;
  margin-bottom: 0.35rem;
  font-size: 1rem;
}

.tool-card-small p {
  font-size: 0.93rem;
  margin-bottom: 0.6rem;
}

.tool-card-small a.tool-link {
  display: inline-block;
  font-size: 0.88rem;
  padding: 0.38rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(37,99,235,0.4);
  color: #2563eb;
  text-decoration: none;
}

.tool-card-small a.tool-link:hover {
  background: rgba(37,99,235,0.08);
}

/* Workflow steps */

.workflow-step {
  margin-bottom: 0.9rem;
}

.workflow-step strong {
  display: block;
  margin-bottom: 0.1rem;
}

/* Theme toggle/button (used on home) */

.topbar {
  position: absolute;
  top: 14px;
  right: 14px;
  display: flex;
  gap: 10px;
  align-items: center;
}

.theme-btn {
  border: 1px solid var(--border);
  background: var(--btn-bg);
  color: var(--btn-text);
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.92rem;
  line-height: 1;
  transition: background 0.15s ease;
  user-select: none;
}

.theme-btn:hover {
  background: var(--btn-bg-hover);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* Footer */

footer {
  text-align: center;
  padding: 38px 20px;
  font-size: 0.85rem;
  color: var(--muted);
}