/* King of the MD — visual style inspired by tiiny.host (light page,
   purple + blue accents, rounded cards, pill buttons, Lato body type).
   Colours are adjusted where needed for WCAG AA contrast.
   Brand, logo, name and copy remain King of the MD. */

:root {
  --bg: #ffffff;
  --bg-soft: #f9fafb;
  --bg-tint: #f8ecff;
  --text: #22122b;
  --muted: #4b5563;
  --purple: #6e2f9a;
  --purple-hover: #5b247f;
  --purple-bright: #ae5dd7;
  --purple-soft: #f3e8fb;
  --blue: #1d4ed8;
  --blue-bright: #2563eb;
  --border: #e5e7eb;
  --card-shadow: 0 1px 4px 0 #11182714, 0 8px 24px -12px #0000001a;
  --card-shadow-hover: 0 10px 25px #0000001a, 0 4px 8px #00000014;
  --radius-sm: 8px;
  --radius: 16px;
  --radius-lg: 20px;
  --radius-pill: 32px;
  --font: "Lato", "Segoe UI", sans-serif;
  --display: "Plus Jakarta Sans", "Lato", "Segoe UI", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "Cascadia Code", Consolas, "Liberation Mono", Menlo, monospace;
  --content: 70rem;
  --prose: 46rem;
  --header-h: 4.25rem;
}

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

html { scroll-behavior: smooth; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

body {
  font-family: var(--font);
  font-size: 1.125rem;
  font-weight: 400;
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img { max-width: 100%; height: auto; }

a { color: var(--purple); }

a:hover, a:focus-visible {
  color: var(--purple-hover);
}

:focus-visible {
  outline: 3px solid var(--blue-bright);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  z-index: 100;
  background: var(--text);
  color: #fff;
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-sm);
}

.skip-link:focus {
  top: 0.75rem;
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: #ffffffe6;
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: var(--content);
  margin: 0 auto;
  min-height: var(--header-h);
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text);
  text-decoration: none;
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: 1.15rem;
  line-height: 1.2;
}

.brand:hover,
.brand:focus-visible { color: var(--purple); }

.brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: block;
  object-fit: contain;
}

/* Shown only when a real logo file is wired up (body.has-brand-logo). */
body:not(.has-brand-logo) .brand-logo { display: none; }
body.has-brand-logo .brand-mark { display: none; }

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--purple) 0%, var(--blue-bright) 100%);
  color: #fff;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.03em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.35rem 1.1rem;
  font-family: var(--display);
  font-weight: 600;
  font-size: 0.98rem;
}

.site-nav a {
  color: var(--text);
  text-decoration: none;
  padding: 0.35rem 0.15rem;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] { color: var(--purple); }

.nav-cta {
  display: inline-flex;
  align-items: center;
  background: var(--purple);
  color: #fff !important;
  text-decoration: none;
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.55rem 1.05rem;
  border-radius: var(--radius-pill);
  border: none;
  line-height: 1.2;
}

.nav-cta:hover,
.nav-cta:focus-visible {
  background: var(--purple-hover);
  color: #fff !important;
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.2;
  text-decoration: none;
  padding: 0.8rem 1.35rem;
  border-radius: var(--radius-pill);
  border: 2px solid transparent;
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease, color 0.15s ease;
}

.btn-primary {
  background: var(--purple);
  color: #fff;
}

.btn-primary:hover,
.btn-primary:focus-visible {
  background: var(--purple-hover);
  color: #fff;
  box-shadow: 0 8px 20px #6e2f9a33;
}

.btn-secondary {
  background: #fff;
  color: var(--purple);
  border-color: var(--purple);
}

.btn-secondary:hover,
.btn-secondary:focus-visible {
  background: var(--purple-soft);
  color: var(--purple-hover);
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

/* Hero */

.hero {
  background:
    radial-gradient(1200px 400px at 80% -10%, #f8ecff 0%, transparent 60%),
    radial-gradient(900px 360px at 0% 0%, #eef2ff 0%, transparent 55%),
    var(--bg);
  padding: 3.5rem 1.5rem 2.75rem;
  text-align: center;
}

.hero-inner { max-width: 46rem; margin: 0 auto; }

.kicker {
  display: inline-block;
  font-family: var(--display);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--purple);
  background: var(--purple-soft);
  border-radius: var(--radius-pill);
  padding: 0.3rem 0.75rem;
  margin: 0 0 1rem;
}

.hero h1 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2.15rem, 5vw, 3.4rem);
  letter-spacing: -0.04em;
  line-height: 1.15;
  margin: 0 0 0.85rem;
}

.gradient-text {
  background: linear-gradient(90deg, var(--purple) 0%, var(--blue) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lede {
  color: var(--muted);
  font-size: 1.15rem;
  margin: 0 auto;
  max-width: 38rem;
}

.lede code,
.prose code,
.post-card code,
.back code,
.hint code {
  font-family: var(--mono);
  font-size: 0.9em;
  background: var(--purple-soft);
  color: var(--text);
  padding: 0.1em 0.4em;
  border-radius: 6px;
}

/* Layout sections */

.section {
  padding: 3rem 1.5rem 4rem;
  width: 100%;
}

.section-narrow { max-width: var(--prose); margin: 0 auto; }
.section-wide { max-width: var(--content); margin: 0 auto; }

.section-soft { background: var(--bg-soft); }

.section-header {
  text-align: center;
  max-width: 38rem;
  margin: 0 auto 2rem;
}

.section-header h1,
.section-header h2 {
  font-family: var(--display);
  letter-spacing: -0.03em;
  margin: 0 0 0.6rem;
  line-height: 1.2;
}

.section-header h1 { font-size: clamp(2rem, 4vw, 2.75rem); }
.section-header h2 { font-size: clamp(1.65rem, 3vw, 2.1rem); }

.section-header p {
  margin: 0;
  color: var(--muted);
}

main { flex: 1; }

/* Post cards */

.posts {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 1.1rem;
}

.post-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  padding: 1.4rem 1.5rem 1.35rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

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

.post-card h2 {
  margin: 0 0 0.3rem;
  font-family: var(--display);
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

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

.post-card a:hover,
.post-card a:focus-visible { color: var(--purple); }

time {
  display: block;
  color: var(--muted);
  font-family: var(--display);
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.55rem;
}

.post-card p { margin: 0; color: var(--muted); }

/* Post page */

.post {
  max-width: var(--prose);
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
  width: 100%;
}

.post-header h1 {
  font-family: var(--display);
  margin: 0 0 0.4rem;
  font-size: clamp(1.85rem, 4vw, 2.5rem);
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.prose { margin-top: 1.75rem; }
.prose > :first-child { margin-top: 0; }

.prose a { color: var(--purple); font-weight: 700; }

.prose h1,
.prose h2,
.prose h3,
.prose h4 {
  font-family: var(--display);
  letter-spacing: -0.02em;
  line-height: 1.3;
  margin-top: 1.8em;
}

.prose code,
.prose pre { font-family: var(--mono); }

.prose :not(pre) > code {
  padding: 0.1em 0.4em;
  border-radius: 6px;
  font-size: 0.9em;
  background: var(--purple-soft);
}

.prose pre {
  background: #111827;
  color: #f3f4f6;
  padding: 1.05rem 1.15rem;
  overflow-x: auto;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  line-height: 1.5;
}

.prose pre code {
  background: none;
  color: inherit;
  padding: 0;
}

.prose blockquote {
  margin: 1.4em 0;
  padding: 0.2rem 0 0.2rem 1.1rem;
  border-left: 4px solid var(--purple-bright);
  color: var(--muted);
}

.back { margin-top: 3rem; font-family: var(--display); }

.back a { text-decoration: none; font-weight: 700; }
.back a:hover { text-decoration: underline; }

/* Pricing */

.billing-toggle {
  display: inline-flex;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 0.25rem;
  gap: 0.15rem;
  margin: 0 auto 0.75rem;
}

.billing-toggle button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.45rem 1.05rem;
  border-radius: var(--radius-pill);
  cursor: pointer;
}

.billing-toggle button[aria-pressed="true"] {
  background: var(--purple);
  color: #fff;
}

.hint {
  text-align: center;
  color: var(--muted);
  font-size: 0.92rem;
  margin: 0 0 1.75rem;
}

.tier-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.15rem;
  align-items: stretch;
}

.tier-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow);
  padding: 1.6rem 1.4rem 1.45rem;
  display: flex;
  flex-direction: column;
  position: relative;
}

.tier-card.featured {
  border-color: transparent;
  background:
    linear-gradient(#fff, #fff) padding-box,
    linear-gradient(180deg, var(--purple-bright), var(--blue-bright)) border-box;
  border: 2px solid transparent;
  box-shadow: 0 16px 40px -16px #6e2f9a55;
  transform: scale(1.02);
}

.tier-badge {
  align-self: flex-start;
  background: var(--purple);
  color: #fff;
  font-family: var(--display);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: var(--radius-pill);
  padding: 0.28rem 0.7rem;
  margin: 0 0 0.8rem;
}

.tier-card h3,
.tier-card h2 {
  font-family: var(--display);
  font-size: 1.45rem;
  letter-spacing: -0.02em;
  margin: 0 0 0.3rem;
}

.tier-tagline {
  color: var(--muted);
  font-size: 0.98rem;
  margin: 0 0 1rem;
  min-height: 2.8em;
}

.tier-price {
  font-family: var(--display);
  font-weight: 800;
  font-size: 2rem;
  letter-spacing: -0.03em;
  margin: 0 0 1rem;
  color: var(--text);
}

.tier-price .alt { display: none; }
body[data-billing="yearly"] .tier-price .alt { display: inline; }
body[data-billing="yearly"] .tier-price .pri { display: none; }

.tier-features,
.tier-limits {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  font-size: 0.98rem;
}

.tier-features li,
.tier-limits li {
  padding: 0.35rem 0 0.35rem 1.45rem;
  position: relative;
  color: var(--text);
}

.tier-features li::before,
.tier-limits li::before {
  position: absolute;
  left: 0;
  font-weight: 700;
}

.tier-features li::before { content: "✓"; color: var(--purple); }
.tier-limits li { color: var(--muted); }
.tier-limits li::before { content: "–"; color: var(--muted); }

.tier-card .btn { width: 100%; margin-top: auto; }

.tier-strip .tier-tagline { min-height: 0; display: none; }
.tier-strip .tier-limits { display: none; }
.tier-strip .tier-price { font-size: 1.55rem; }
.tier-strip .tier-features li:nth-child(n+5) { display: none; }

.pricing-more {
  text-align: center;
  margin: 1.5rem 0 0;
}

.pricing-more a {
  font-family: var(--display);
  font-weight: 700;
  text-decoration: none;
}

.pricing-more a:hover { text-decoration: underline; }

.contact-panel {
  max-width: 40rem;
  margin: 3rem auto 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  padding: 1.75rem 1.6rem;
  text-align: center;
}

.contact-panel h2 {
  font-family: var(--display);
  letter-spacing: -0.02em;
  margin: 0 0 0.5rem;
}

.contact-panel p {
  margin: 0;
  color: var(--muted);
}

/* Footer */

.site-footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  padding: 2rem 1.5rem;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.site-footer p { margin: 0; }

@media (max-width: 900px) {
  .tier-grid { grid-template-columns: 1fr; max-width: 26rem; margin: 0 auto; }
  .tier-card.featured { transform: none; }
}

@media (max-width: 640px) {
  body { font-size: 1.05rem; }
  .header-inner { padding: 0.75rem 1rem; }
  .hero, .section { padding-left: 1rem; padding-right: 1rem; }
  .site-nav .nav-text { display: none; }
  .hero { padding-top: 2.4rem; }
}
