/* ==========================================================================
   finely.day — shared stylesheet (Calm Paper design system)
   Brand: indigo #534AB7 · coral #D85A30 · paper #fafaf8 · navy #13172E
   Type: DM Serif Display (display) · DM Sans (body)
   ========================================================================== */

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

:root {
  --ink: #1a1a1a;
  --muted: #6b7280;
  --rule: #e5e7eb;
  --accent: #534AB7;
  --accent-dark: #423a99;
  --accent-light: #EEEDFE;
  --coral: #D85A30;
  --bg: #fafaf8;
  --card: #ffffff;
  --navy: #13172E;
  --cream: #F5F0E4;
  --success: #16a34a;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(19, 23, 46, 0.05), 0 8px 24px rgba(19, 23, 46, 0.06);
  --shadow-lift: 0 2px 4px rgba(19, 23, 46, 0.06), 0 16px 40px rgba(19, 23, 46, 0.12);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  font-weight: 300;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

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

.container { max-width: 1080px; margin: 0 auto; padding: 0 1.5rem; }
.container--narrow { max-width: 720px; }

/* ---------- Navigation ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 250, 248, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--rule);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  gap: 1rem;
}

.nav__brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink);
}

.nav__logo {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  box-shadow: 0 1px 3px rgba(19, 23, 46, 0.25);
}

.nav__name {
  font-family: 'DM Serif Display', serif;
  font-size: 1.3rem;
  letter-spacing: -0.01em;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  list-style: none;
}

.nav__links a {
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 400;
  transition: color 0.15s ease;
}

.nav__links a:hover { color: var(--accent); }

.nav__links a.nav__cta {
  background: var(--accent);
  color: #fff;
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  font-weight: 500;
  transition: background 0.15s ease;
}

.nav__links a.nav__cta:hover { background: var(--accent-dark); color: #fff; }

.nav__toggle { display: none; }

@media (max-width: 780px) {
  .nav__links { display: none; }
  .nav__links.is-open {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    background: var(--card);
    border-bottom: 1px solid var(--rule);
    box-shadow: var(--shadow);
    padding: 0.5rem 0;
  }
  .nav__links.is-open li { width: 100%; }
  .nav__links.is-open a { display: block; padding: 0.85rem 1.5rem; }
  .nav__links.is-open a.nav__cta {
    margin: 0.5rem 1.5rem 0.75rem;
    display: inline-block;
    padding: 0.5rem 1.1rem;
  }
  .nav__toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    padding: 0 8px;
    background: none;
    border: none;
    cursor: pointer;
  }
  .nav__toggle span {
    height: 2px;
    background: var(--ink);
    border-radius: 2px;
    transition: transform 0.2s ease, opacity 0.2s ease;
  }
  .nav__toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav__toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .nav__toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.85rem 1.6rem;
  border-radius: 999px;
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.btn--primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 14px rgba(83, 74, 183, 0.35);
}
.btn--primary:hover { background: var(--accent-dark); transform: translateY(-1px); }

.btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: #d1d5db;
}
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }

.btn--dark {
  background: var(--navy);
  color: var(--cream);
}
.btn--dark:hover { background: #1e2440; transform: translateY(-1px); }

.btn svg { flex-shrink: 0; }

/* ---------- Sections ---------- */

.section { padding: 5.5rem 0; }
.section--tint { background: #f3f2ee; }
.section--navy { background: var(--navy); color: var(--cream); }

.eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-light);
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  margin-bottom: 1.1rem;
}

.section--navy .eyebrow { background: rgba(238, 237, 254, 0.12); color: #A9A3EC; }

.section__title {
  font-family: 'DM Serif Display', serif;
  font-weight: 400;
  font-size: clamp(1.9rem, 4vw, 2.7rem);
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 1rem;
}

.section__lede {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 620px;
}

.section--navy .section__lede { color: rgba(245, 240, 228, 0.75); }

/* ---------- Cards ---------- */

.card {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1.8rem;
  box-shadow: var(--shadow);
}

/* ---------- Code blocks / copy ---------- */

.codeblock {
  position: relative;
  background: var(--navy);
  color: #E8E6FA;
  border-radius: 12px;
  padding: 1.1rem 3.4rem 1.1rem 1.25rem;
  font-family: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9rem;
  line-height: 1.6;
  overflow-x: auto;
  white-space: pre;
}

.codeblock--inlineurl { white-space: nowrap; }

.copy-btn {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  background: rgba(238, 237, 254, 0.12);
  color: #C9C5F2;
  border: none;
  border-radius: 8px;
  padding: 0.4rem 0.7rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease;
}

.copy-btn:hover { background: rgba(238, 237, 254, 0.22); }
.copy-btn.copied { background: var(--success); color: #fff; }

code.inline {
  font-family: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88em;
  background: var(--accent-light);
  color: var(--accent-dark);
  border-radius: 6px;
  padding: 0.12em 0.4em;
}

/* ---------- Badges ---------- */

.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  border-radius: 999px;
  padding: 0.18rem 0.65rem;
  vertical-align: middle;
}

.badge--read { background: var(--accent-light); color: var(--accent-dark); }
.badge--write { background: #FBE3D9; color: #A83E1D; }

/* ---------- Prose pages (terms, privacy, support) ---------- */

.prose { padding: 4rem 0 6rem; }

.prose h1 {
  font-family: 'DM Serif Display', serif;
  font-weight: 400;
  font-size: 2.5rem;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.prose .subtitle { color: var(--muted); font-size: 0.95rem; margin-bottom: 3rem; }

.prose h2 {
  font-family: 'DM Serif Display', serif;
  font-weight: 400;
  font-size: 1.5rem;
  letter-spacing: -0.01em;
  margin: 3rem 0 1rem;
}

.prose h3 { font-size: 1rem; font-weight: 500; margin: 1.5rem 0 0.5rem; }

.prose p, .prose li { margin-bottom: 1rem; }
.prose ul { padding-left: 1.5rem; margin-bottom: 1rem; }
.prose li { margin-bottom: 0.5rem; }
.prose strong { font-weight: 500; }
.prose a { border-bottom: 1px solid currentColor; }
.prose a:hover { opacity: 0.7; }

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.95rem;
}

.prose th, .prose td {
  text-align: left;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}

.prose th { font-weight: 500; font-size: 0.85rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }

/* ---------- Footer ---------- */

.footer {
  background: var(--navy);
  color: rgba(245, 240, 228, 0.7);
  padding: 3.5rem 0 2.5rem;
  font-size: 0.92rem;
}

.footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}

@media (max-width: 780px) { .footer__grid { grid-template-columns: 1fr 1fr; } }

.footer__brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.9rem;
}

.footer__brand img { width: 30px; height: 30px; border-radius: 8px; }

.footer__brand span {
  font-family: 'DM Serif Display', serif;
  font-size: 1.2rem;
  color: var(--cream);
}

.footer h4 {
  color: var(--cream);
  font-weight: 500;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
}

.footer ul { list-style: none; }
.footer li { margin-bottom: 0.6rem; }
.footer a { color: rgba(245, 240, 228, 0.7); transition: color 0.15s ease; }
.footer a:hover { color: var(--cream); }

.footer__legal {
  border-top: 1px solid rgba(245, 240, 228, 0.12);
  padding-top: 1.75rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: rgba(245, 240, 228, 0.5);
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
