/* Full Stack Flutter: shared styles on top of Tailwind. */

:root {
  --brand: #db2777;
  --brand-dark: #be185d;
  --violet: #7c3aed;
  --ink: #0b1020;
  --muted: #64748b;
  --line: #e2e8f0;
  --surface: #f8fafc;
  --radius: 14px;
  --header-h: 64px;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  font-feature-settings: 'cv11', 'ss01', 'ss03';
  text-rendering: optimizeLegibility;
}

::selection {
  background: rgba(219, 39, 119, 0.16);
}

[hidden] {
  display: none !important;
}

.focus-ring:focus-visible,
a:focus-visible,
button:focus-visible {
  outline: 2px solid rgba(219, 39, 119, 0.55);
  outline-offset: 2px;
  border-radius: 8px;
}

/* ------------------------------------------------------------------ */
/* Header                                                             */
/* ------------------------------------------------------------------ */

.nav-link {
  border-radius: 9999px;
  padding: 6px 12px;
  font-size: 14px;
  font-weight: 500;
  color: #475569;
  transition: background-color 0.15s, color 0.15s;
}
.nav-link:hover {
  background: #f1f5f9;
  color: #0f172a;
}
.nav-link.is-active {
  color: #0f172a;
  background: #f1f5f9;
}

.mobile-nav-link {
  display: block;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 15px;
  font-weight: 500;
  color: #334155;
}
.mobile-nav-link.is-active,
.mobile-nav-link:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.icon-button {
  display: inline-flex;
  height: 36px;
  width: 36px;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  color: #475569;
  transition: background-color 0.15s, color 0.15s;
}
.icon-button:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.badge-dot {
  position: absolute;
  top: 2px;
  right: 1px;
  min-width: 17px;
  height: 17px;
  border-radius: 9999px;
  background: var(--brand);
  color: white;
  font-size: 10px;
  font-weight: 700;
  line-height: 17px;
  padding: 0 4px;
  text-align: center;
  box-shadow: 0 0 0 2px white;
}

.menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  z-index: 60;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  background: white;
  padding: 6px;
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.04), 0 24px 48px -16px rgba(15, 23, 42, 0.22);
  transform-origin: top right;
  animation: menu-in 0.14s ease-out;
}
@keyframes menu-in {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
  }
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 9px;
  padding: 8px 10px;
  font-size: 14px;
  color: #334155;
  transition: background-color 0.12s;
}
.menu-item:hover {
  background: #f1f5f9;
  color: #0f172a;
}
.menu-item.is-danger {
  color: #be123c;
}
.menu-item.is-danger:hover {
  background: #fff1f2;
}

.footer-heading {
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
}
.footer-list {
  margin-top: 14px;
  display: grid;
  gap: 10px;
  font-size: 14px;
  color: #64748b;
}
.footer-list a:hover {
  color: #0f172a;
}

/* ------------------------------------------------------------------ */
/* Buttons and inputs                                                 */
/* ------------------------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 36px;
  border-radius: 10px;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  transition: background-color 0.15s, color 0.15s, box-shadow 0.15s, transform 0.15s, opacity 0.15s;
  user-select: none;
}
.btn:active {
  transform: translateY(0.5px);
}
.btn[disabled],
.btn.is-loading {
  opacity: 0.6;
  pointer-events: none;
}
.btn-lg {
  height: 46px;
  padding: 0 20px;
  font-size: 15px;
  border-radius: 12px;
}
.btn-sm {
  height: 30px;
  padding: 0 10px;
  font-size: 13px;
  border-radius: 8px;
}
.btn-primary {
  background: var(--brand);
  color: white;
  box-shadow: 0 1px 2px rgba(190, 24, 93, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.btn-primary:hover {
  background: var(--brand-dark);
}
.btn-dark {
  background: #0f172a;
  color: white;
}
.btn-dark:hover {
  background: #1e293b;
}
.btn-secondary {
  background: white;
  color: #0f172a;
  box-shadow: inset 0 0 0 1px #e2e8f0, 0 1px 2px rgba(15, 23, 42, 0.04);
}
.btn-secondary:hover {
  background: #f8fafc;
  box-shadow: inset 0 0 0 1px #cbd5e1, 0 1px 2px rgba(15, 23, 42, 0.04);
}
.btn-ghost {
  color: #334155;
}
.btn-ghost:hover {
  background: #f1f5f9;
  color: #0f172a;
}
.btn-glass {
  background: rgba(255, 255, 255, 0.14);
  color: white;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(8px);
}
.btn-glass:hover {
  background: rgba(255, 255, 255, 0.22);
}
.btn-danger {
  background: #e11d48;
  color: white;
}
.btn-danger:hover {
  background: #be123c;
}

.btn .spinner {
  width: 14px;
  height: 14px;
}
.spinner {
  display: inline-block;
  border-radius: 9999px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: spin 0.7s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.field-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 6px;
}
.field-hint {
  margin-top: 6px;
  font-size: 12.5px;
  color: #64748b;
}
/* `.input[type]` outranks the Tailwind forms plugin's `[type='text']` rules,
   which are injected after this stylesheet. */
.input,
.input[type],
.select,
.textarea {
  display: block;
  width: 100%;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: white;
  padding: 9px 12px;
  font-size: 14.5px;
  color: #0f172a;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input::placeholder,
.input[type]::placeholder,
.textarea::placeholder {
  color: #94a3b8;
}
.input:focus,
.input[type]:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: #f472b6;
  box-shadow: 0 0 0 4px rgba(236, 72, 153, 0.12);
}
.input.is-invalid,
.input[type].is-invalid,
.select.is-invalid,
.textarea.is-invalid {
  border-color: #fb7185;
  box-shadow: 0 0 0 4px rgba(244, 63, 94, 0.1);
}
.field-error {
  margin-top: 6px;
  font-size: 12.5px;
  font-weight: 500;
  color: #e11d48;
}

.checkbox {
  height: 18px;
  width: 18px;
  border-radius: 6px;
  border-color: #cbd5e1;
  color: var(--brand);
}
.checkbox:focus {
  --tw-ring-color: rgba(236, 72, 153, 0.25);
}

.switch {
  position: relative;
  display: inline-flex;
  height: 24px;
  width: 42px;
  flex-shrink: 0;
  cursor: pointer;
  border-radius: 9999px;
  background: #cbd5e1;
  transition: background-color 0.18s;
}
.switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  height: 18px;
  width: 18px;
  border-radius: 9999px;
  background: white;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.25);
  transition: transform 0.18s;
}
.switch[aria-checked='true'] {
  background: var(--brand);
}
.switch[aria-checked='true']::after {
  transform: translateX(18px);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 9999px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 600;
  line-height: 18px;
}
.chip-soft {
  background: #f1f5f9;
  color: #334155;
}
.chip-brand {
  background: #fdf2f8;
  color: #be185d;
}
.chip-violet {
  background: #f5f3ff;
  color: #6d28d9;
}
.chip-amber {
  background: #fffbeb;
  color: #b45309;
}
.chip-sky {
  background: #f0f9ff;
  color: #0369a1;
}
.chip-emerald {
  background: #ecfdf5;
  color: #047857;
}
.chip-rose {
  background: #fff1f2;
  color: #be123c;
}

.filter-chip {
  border-radius: 9999px;
  padding: 6px 14px;
  font-size: 13.5px;
  font-weight: 500;
  color: #475569;
  background: white;
  box-shadow: inset 0 0 0 1px #e2e8f0;
  transition: all 0.15s;
}
.filter-chip:hover {
  color: #0f172a;
  box-shadow: inset 0 0 0 1px #cbd5e1;
}
.filter-chip.is-active {
  background: #0f172a;
  color: white;
  box-shadow: none;
}

.card {
  border-radius: var(--radius);
  border: 1px solid #e8edf3;
  background: white;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.eyebrow {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand);
}

.section-title {
  font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  color: #0b1020;
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--brand);
}
.link-arrow svg {
  transition: transform 0.15s;
}
.link-arrow:hover {
  color: var(--brand-dark);
}
.link-arrow:hover svg {
  transform: translateX(2px);
}

/* ------------------------------------------------------------------ */
/* Avatars                                                            */
/* ------------------------------------------------------------------ */

.avatar {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  object-fit: cover;
  background: #e2e8f0;
}
.avatar-initials {
  color: white;
  font-weight: 600;
  letter-spacing: -0.02em;
  user-select: none;
}
.avatar.ring-first {
  box-shadow: 0 0 0 2px white, 0 0 0 3.5px rgba(219, 39, 119, 0.35);
}
.avatar-stack {
  display: flex;
}
.avatar-stack > * + * {
  margin-left: -6px;
}
.avatar-stack .avatar {
  box-shadow: 0 0 0 2px white;
}
.avatar-slot .avatar {
  width: 32px;
  height: 32px;
}

/* ------------------------------------------------------------------ */
/* Hero                                                               */
/* ------------------------------------------------------------------ */

.hero-card {
  position: relative;
  overflow: hidden;
  border-radius: 28px;
  background: #1e0a4f;
  isolation: isolate;
}
.hero-card::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(1200px 400px at 10% 110%, rgba(11, 16, 32, 0.55), transparent 60%);
}
.hero-grid {
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.18;
  background-image: linear-gradient(rgba(255, 255, 255, 0.35) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.35) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse at 70% 40%, black 10%, transparent 70%);
}
.hero-float {
  animation: float 9s ease-in-out infinite;
}
@keyframes float {
  50% {
    transform: translateY(-10px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .hero-float,
  .menu-panel {
    animation: none;
  }
}

.stat-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.1);
  padding: 10px 14px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(8px);
}

/* ------------------------------------------------------------------ */
/* Blog                                                               */
/* ------------------------------------------------------------------ */

.cover {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #ede9fe, #fce7f3);
}
.cover img {
  height: 100%;
  width: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.group:hover .cover img {
  transform: scale(1.025);
}
.cover-fallback {
  display: flex;
  height: 100%;
  width: 100%;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 20% 20%, #f9a8d4, transparent 45%),
    radial-gradient(circle at 80% 60%, #c4b5fd, transparent 50%), linear-gradient(135deg, #7c3aed, #db2777);
}

.article {
  font-size: 17.5px;
  line-height: 1.75;
  color: #1e293b;
}
.article > * + * {
  margin-top: 1.15em;
}
.article h2 {
  margin-top: 2em;
  font-size: 1.55em;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: #0b1020;
}
.article h3 {
  margin-top: 1.7em;
  font-size: 1.25em;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: #0b1020;
}
.article h4 {
  margin-top: 1.5em;
  font-size: 1.05em;
  font-weight: 700;
  color: #0b1020;
}
.article img {
  border-radius: 14px;
  margin-left: auto;
  margin-right: auto;
}
.article figure figcaption {
  margin-top: 8px;
  text-align: center;
  font-size: 14px;
  color: #64748b;
}

.cooked {
  font-size: 15.5px;
  line-height: 1.7;
  color: #1e293b;
  overflow-wrap: anywhere;
}
.cooked > * + * {
  margin-top: 0.85em;
}
.cooked h3,
.cooked h4,
.cooked h5,
.cooked h6 {
  margin-top: 1.3em;
  font-weight: 700;
  color: #0b1020;
}
.cooked h3 {
  font-size: 1.2em;
}
.cooked h4 {
  font-size: 1.08em;
}

.article a,
.cooked a {
  color: var(--brand);
  text-decoration: underline;
  text-decoration-color: rgba(219, 39, 119, 0.3);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.15s;
}
.article a:hover,
.cooked a:hover {
  text-decoration-color: currentColor;
}
.cooked a.mention {
  border-radius: 6px;
  background: #fdf2f8;
  padding: 1px 5px;
  font-weight: 600;
  text-decoration: none;
}
.cooked a.mention:hover {
  background: #fce7f3;
}

.article ul,
.cooked ul {
  list-style: disc;
  padding-left: 1.4em;
}
.article ol,
.cooked ol {
  list-style: decimal;
  padding-left: 1.4em;
}
.article li + li,
.cooked li + li {
  margin-top: 0.35em;
}
.article li > ul,
.article li > ol,
.cooked li > ul,
.cooked li > ol {
  margin-top: 0.35em;
}
.article li::marker,
.cooked li::marker {
  color: #94a3b8;
}
.article ul.contains-task-list,
.cooked ul.contains-task-list {
  list-style: none;
  padding-left: 0.2em;
}
.task-list-item input {
  margin-right: 8px;
  border-radius: 4px;
}

.article blockquote,
.cooked blockquote {
  border-left: 3px solid #f9a8d4;
  background: #fdf8fb;
  border-radius: 0 12px 12px 0;
  padding: 10px 16px;
  color: #475569;
}
.cooked blockquote > * + * {
  margin-top: 0.6em;
}

.article hr,
.cooked hr {
  border: 0;
  border-top: 1px solid #e2e8f0;
  margin: 2em 0;
}

.article table,
.cooked table {
  display: block;
  width: 100%;
  overflow-x: auto;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.92em;
}
.article th,
.article td,
.cooked th,
.cooked td {
  border-bottom: 1px solid #e2e8f0;
  padding: 8px 12px;
  text-align: left;
}
.article th,
.cooked th {
  font-weight: 600;
  color: #0f172a;
  background: #f8fafc;
}

.article :not(pre) > code,
.cooked :not(pre) > code {
  border-radius: 6px;
  background: #f1f5f9;
  padding: 0.15em 0.4em;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.86em;
  color: #9d174d;
}

.code-block {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  background: #0f1324;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}
.code-block[data-language]:not([data-language=''])::before {
  content: attr(data-language);
  position: absolute;
  right: 12px;
  top: 8px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: #64748b;
}
.code-block pre {
  overflow-x: auto;
  padding: 18px 20px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 13.5px;
  line-height: 1.65;
  color: #e2e8f0;
  tab-size: 2;
}
.code-block .copy-code {
  position: absolute;
  right: 8px;
  bottom: 8px;
  opacity: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  padding: 4px 8px;
  font-size: 12px;
  color: #cbd5e1;
  transition: opacity 0.15s, background-color 0.15s;
}
.code-block:hover .copy-code {
  opacity: 1;
}
.code-block .copy-code:hover {
  background: rgba(255, 255, 255, 0.16);
}

/* ------------------------------------------------------------------ */
/* Wonky Markdown directives (lib/src/markdown/wonky_directives.dart)  */
/* ------------------------------------------------------------------ */

/* Spacing inside directive containers, like `.article > * + *`. */
.blog-callout > * + *,
.blog-card > * + *,
.blog-details-body > * + * {
  margin-top: 0.85em;
}
.blog-card > :first-child,
.blog-details-body > :first-child {
  margin-top: 0;
}

/* Inline: button and arrow link */
.article a.blog-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--brand);
  padding: 10px 20px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  color: #fff;
  text-decoration: none;
  transition: background-color 0.15s;
}
.article a.blog-button:hover {
  background: var(--brand-dark);
  color: #fff;
}
.article a.blog-button-secondary {
  background: #1e293b;
  font-weight: 500;
}
.article a.blog-button-secondary:hover {
  background: #0f172a;
}
.article a.blog-link {
  display: inline-flex;
  align-items: center;
  font-size: 0.875em;
  font-weight: 600;
  text-decoration: none;
}
.article a.blog-link:hover {
  color: var(--brand-dark);
}
.blog-link-arrow {
  width: 1em;
  height: 1em;
  margin-left: 0.25em;
}
.article p:has(> a.blog-button),
.article p:has(> a.blog-link) {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
}
.article p:has(> .blog-chip) {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

/* Inline: chip */
.blog-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: 9999px;
  background: #f1f5f9;
  padding: 0.35rem 0.9rem;
  font-size: 0.9em;
  font-weight: 500;
  color: #334155;
}
.blog-chip-icon {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}
.blog-chip-icon svg,
.blog-callout-icon svg {
  width: 100%;
  height: 100%;
}
.blog-chip-icon svg[fill='none'] {
  stroke-width: 2.25;
}
.blog-chip-dotted {
  gap: 0.375rem;
  border: 1px solid var(--line);
  background: #fff;
  padding: 0 0.5rem;
  font-size: 0.8125rem;
  line-height: 1.5rem;
  white-space: nowrap;
}
.blog-chip-dot {
  width: 0.375rem;
  height: 0.375rem;
  flex-shrink: 0;
  border-radius: 9999px;
}
.blog-chip-dot-pink { background: #ec4899; }
.blog-chip-dot-amber { background: #f59e0b; }
.blog-chip-dot-green { background: #10b981; }
.blog-chip-dot-blue { background: #3b82f6; }
.blog-chip-dot-violet { background: #8b5cf6; }
.blog-chip-dot-red { background: #ef4444; }
.blog-chip-dot-cyan { background: #06b6d4; }
.blog-chip-dot-lime { background: #84cc16; }

/* Numbered headings */
.article h2.blog-step,
.article h3.blog-step {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}
.blog-step-number {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 9999px;
  background: var(--brand);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0;
  color: #fff;
}

/* Callouts */
.blog-callout {
  border: 1px solid;
  border-radius: 12px;
  padding: 14px 18px;
  font-size: 0.94em;
}
.blog-callout-title {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.025em;
  text-transform: uppercase;
}
.blog-callout-title + * {
  margin-top: 0.4em !important;
}
.blog-callout-icon {
  width: 1.0625rem;
  height: 1.0625rem;
  flex-shrink: 0;
}
.blog-callout-info { background: #f0f9ff; border-color: #bae6fd; }
.blog-callout-info .blog-callout-title { color: #075985; }
.blog-callout-tip { background: #ecfdf5; border-color: #a7f3d0; }
.blog-callout-tip .blog-callout-title { color: #065f46; }
.blog-callout-note { background: var(--surface); border-color: var(--line); }
.blog-callout-note .blog-callout-title { color: #334155; }
.blog-callout-warning,
.blog-callout-caution { background: #fffbeb; border-color: #fde68a; }
.blog-callout-warning .blog-callout-title,
.blog-callout-caution .blog-callout-title { color: #92400e; }
.blog-callout-danger { background: #fef2f2; border-color: #fecaca; }
.blog-callout-danger .blog-callout-title { color: #991b1b; }

/* Details */
.blog-details {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 16px 20px;
}
.blog-details-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  list-style: none;
  font-weight: 600;
  color: var(--ink);
}
.blog-details-summary::-webkit-details-marker {
  display: none;
}
.blog-details-chevron {
  width: 1.25rem;
  height: 1.25rem;
  margin-left: 1rem;
  flex-shrink: 0;
  color: #94a3b8;
  transition: transform 0.15s;
}
.blog-details[open] .blog-details-chevron {
  transform: rotate(180deg);
}
.blog-details-body {
  margin-top: 0.75rem;
}
.blog-details-row {
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: none;
  padding: 0;
}
.blog-details-row:first-child,
:not(.blog-details-row) + .blog-details-row {
  border-top: 1px solid var(--line);
}
.article .blog-details-row + .blog-details-row {
  margin-top: 0;
}
.blog-details-row > .blog-details-summary {
  padding: 0.875rem 0;
}
.blog-details-row > .blog-details-body {
  margin-top: 0;
  padding-bottom: 1rem;
}

/* Video */
.article .blog-video {
  margin-top: 2em;
  margin-bottom: 2em;
}
.blog-video video,
.blog-video-frame {
  display: block;
  width: 100%;
  border-radius: var(--radius);
  background: #000;
}
.blog-video video {
  height: auto;
}
.blog-video-frame {
  aspect-ratio: 16 / 9;
  overflow: hidden;
}
.blog-video-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

/* Grid */
.blog-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  column-gap: 2rem;
  row-gap: 0.75rem;
}
@media (min-width: 640px) {
  .blog-grid-2,
  .blog-grid-3,
  .blog-grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (min-width: 1024px) {
  .blog-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .blog-grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
.blog-grid-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}
.blog-grid-text {
  color: #334155;
}
.blog-grid-bullet-check,
.blog-grid-bullet-circle {
  width: 1.25rem;
  height: 1.25rem;
  margin-top: 0.3rem;
  flex-shrink: 0;
  color: var(--brand);
}

/* Card */
.blog-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 20px 24px;
}
.hljs-comment,
.hljs-quote {
  color: #7280a0;
  font-style: italic;
}
.hljs-keyword,
.hljs-selector-tag,
.hljs-built_in.hljs-keyword,
.hljs-meta-keyword {
  color: #f472b6;
}
.hljs-string,
.hljs-attr-value,
.hljs-template-string {
  color: #a5e3a0;
}
.hljs-number,
.hljs-literal {
  color: #fbbf75;
}
.hljs-title,
.hljs-function .hljs-title,
.hljs-title.function_ {
  color: #93c5fd;
}
.hljs-built_in,
.hljs-type,
.hljs-class .hljs-title,
.hljs-title.class_ {
  color: #67e8f9;
}
.hljs-attr,
.hljs-variable,
.hljs-params,
.hljs-attribute {
  color: #c4b5fd;
}
.hljs-meta,
.hljs-symbol {
  color: #94a3b8;
}

/* ------------------------------------------------------------------ */
/* Forum                                                              */
/* ------------------------------------------------------------------ */

.forum-shell {
  display: grid;
  gap: 32px;
}
@media (min-width: 1024px) {
  .forum-shell {
    grid-template-columns: 232px minmax(0, 1fr);
  }
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 9px;
  padding: 7px 10px;
  font-size: 14px;
  font-weight: 500;
  color: #475569;
  transition: background-color 0.12s, color 0.12s;
}
.sidebar-link:hover {
  background: #f1f5f9;
  color: #0f172a;
}
.sidebar-link.is-active {
  background: #fdf2f8;
  color: #be185d;
}
.sidebar-link .count {
  margin-left: auto;
  font-size: 12px;
  font-weight: 500;
  color: #94a3b8;
}
.sidebar-link.is-active .count {
  color: #f472b6;
}
.sidebar-heading {
  padding: 0 10px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #94a3b8;
}

.category-square {
  display: inline-block;
  height: 10px;
  width: 10px;
  flex-shrink: 0;
  border-radius: 3px;
}
.category-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 500;
  color: #475569;
}
.category-badge:hover {
  color: #0f172a;
}

.topic-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}
.topic-table th {
  border-bottom: 1px solid #e2e8f0;
  padding: 10px 8px;
  font-size: 12px;
  font-weight: 600;
  color: #94a3b8;
  text-align: center;
  white-space: nowrap;
}
.topic-table th:first-child {
  text-align: left;
  padding-left: 4px;
}
.topic-table td {
  border-bottom: 1px solid #f1f5f9;
  padding: 14px 8px;
  vertical-align: middle;
}
.topic-table td:first-child {
  padding-left: 4px;
}
.topic-table tr:hover td {
  background: #fcfcfd;
}
.topic-title {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: #0b1020;
}
.topic-title:visited {
  color: #475569;
}
.topic-title:hover {
  color: var(--brand);
}
.topic-num {
  width: 64px;
  text-align: center;
  font-size: 14px;
  font-weight: 500;
  color: #64748b;
  font-variant-numeric: tabular-nums;
}
.topic-num.is-hot {
  color: var(--brand);
  font-weight: 700;
}

.post {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 16px;
  padding: 24px 0;
  border-top: 1px solid #eef2f6;
  scroll-margin-top: calc(var(--header-h) + 24px);
}
.post:first-child {
  border-top: 0;
}
.post.is-highlighted {
  animation: highlight 2.4s ease-out;
}
@keyframes highlight {
  0%,
  30% {
    background: #fdf2f8;
    box-shadow: -16px 0 0 #fdf2f8, 16px 0 0 #fdf2f8;
  }
}
.post[data-state='pending'],
.post[data-state='shadow'],
.post[data-state='hidden'] {
  position: relative;
}
.post[data-state='hidden'] .cooked {
  opacity: 0.55;
}
.post-action {
  display: inline-flex;
  height: 32px;
  align-items: center;
  gap: 6px;
  border-radius: 9px;
  padding: 0 9px;
  font-size: 13px;
  font-weight: 500;
  color: #64748b;
  transition: background-color 0.12s, color 0.12s;
}
.post-action:hover {
  background: #f1f5f9;
  color: #0f172a;
}
.post-action.is-liked {
  color: #e11d48;
}
.post-action.is-liked svg {
  fill: currentColor;
  animation: pop 0.3s ease-out;
}
@keyframes pop {
  50% {
    transform: scale(1.3);
  }
}
.post-action.is-reply {
  color: #334155;
}

/* ------------------------------------------------------------------ */
/* Composer                                                           */
/* ------------------------------------------------------------------ */

.composer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 70;
  transform: translateY(105%);
  transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.composer.is-open {
  transform: translateY(0);
}
.composer-inner {
  margin: 0 auto;
  max-width: 900px;
  border-radius: 18px 18px 0 0;
  border: 1px solid #e2e8f0;
  border-bottom: 0;
  background: white;
  box-shadow: 0 -24px 60px -24px rgba(15, 23, 42, 0.3);
}
.composer.is-minimized {
  transform: translateY(calc(100% - 52px));
}
.composer-editor {
  height: min(46vh, 420px);
  overflow-y: auto;
}
.composer.is-expanded .composer-editor {
  height: calc(100vh - 220px);
}
.composer-textarea {
  height: 100%;
  width: 100%;
  resize: none;
  border: 0;
  padding: 16px 20px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 14px;
  line-height: 1.6;
}
.composer-textarea:focus {
  outline: none;
  box-shadow: none;
}

/* Milkdown (Crepe) adjustments */
.composer .milkdown {
  --crepe-color-background: #ffffff;
  --crepe-color-on-background: #0f172a;
  --crepe-color-surface: #f8fafc;
  --crepe-color-surface-low: #f1f5f9;
  --crepe-color-on-surface: #1e293b;
  --crepe-color-on-surface-variant: #64748b;
  --crepe-color-outline: #cbd5e1;
  --crepe-color-primary: #db2777;
  --crepe-color-secondary: #fce7f3;
  --crepe-color-on-secondary: #831843;
  --crepe-color-inverse: #0f172a;
  --crepe-color-on-inverse: #f8fafc;
  --crepe-color-inline-code: #9d174d;
  --crepe-color-error: #e11d48;
  --crepe-color-hover: #f1f5f9;
  --crepe-color-selected: #fce7f3;
  --crepe-color-inline-area: #f1f5f9;
  --crepe-font-title: 'Inter', ui-sans-serif, system-ui, sans-serif;
  --crepe-font-default: 'Inter', ui-sans-serif, system-ui, sans-serif;
  --crepe-font-code: 'JetBrains Mono', ui-monospace, monospace;
  background: transparent;
}
.composer .milkdown .ProseMirror {
  padding: 16px 20px 24px;
  min-height: 100%;
  font-size: 15.5px;
  line-height: 1.7;
}
@media (max-width: 640px) {
  .composer .milkdown .ProseMirror {
    padding: 14px 16px 20px;
  }
}
.composer .milkdown .milkdown-top-bar {
  padding: 0 8px;
  min-height: 40px;
  background: #ffffff;
  border-bottom-color: #f1f5f9;
}
.composer .milkdown .milkdown-top-bar .top-bar-divider {
  margin: 8px 4px;
  height: 20px;
}
.composer .milkdown .milkdown-top-bar .top-bar-heading-selector {
  padding: 4px;
}
.composer .milkdown .milkdown-top-bar .top-bar-heading-button,
.composer .milkdown .milkdown-top-bar .top-bar-item {
  border-radius: 8px;
}
.composer .milkdown .milkdown-top-bar .top-bar-item {
  margin: 4px 1px;
  width: 30px;
  height: 30px;
}
/* Crepe draws toolbar icons in its pale outline colour, which reads as disabled. */
.composer .milkdown .milkdown-top-bar .top-bar-item svg,
.composer .milkdown .milkdown-top-bar .top-bar-heading-button .top-bar-chevron svg {
  width: 20px;
  height: 20px;
  color: #475569;
  fill: #475569;
}
.composer .milkdown .milkdown-top-bar .top-bar-heading-button .top-bar-chevron svg {
  fill: none;
  stroke: #475569;
}
.composer .milkdown .milkdown-top-bar .top-bar-item.active {
  background: #fce7f3;
}
.composer .milkdown .milkdown-top-bar .top-bar-item.active svg {
  color: #be185d;
  fill: #be185d;
}
.composer .milkdown .milkdown-top-bar .top-bar-heading-dropdown {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #ffffff;
}
.composer .milkdown .ProseMirror h1,
.composer .milkdown .ProseMirror h2,
.composer .milkdown .ProseMirror h3 {
  font-family: 'Inter', sans-serif;
  letter-spacing: -0.02em;
}

/* ------------------------------------------------------------------ */
/* Dialogs and toasts                                                 */
/* ------------------------------------------------------------------ */

.dialog {
  width: min(92vw, 460px);
  border: 0;
  border-radius: 18px;
  padding: 0;
  box-shadow: 0 30px 80px -20px rgba(15, 23, 42, 0.45);
}
.dialog::backdrop {
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(3px);
}
.dialog[open] {
  animation: dialog-in 0.18s ease-out;
}
@keyframes dialog-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
}

.toast-stack {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 100;
  display: grid;
  gap: 8px;
  transform: translateX(-50%);
  width: min(92vw, 420px);
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border-radius: 14px;
  background: #0f172a;
  padding: 12px 16px;
  font-size: 14px;
  line-height: 1.45;
  color: white;
  box-shadow: 0 16px 40px -12px rgba(15, 23, 42, 0.5);
  animation: toast-in 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.toast.is-error {
  background: #9f1239;
}
.toast.is-leaving {
  opacity: 0;
  transform: translateY(6px);
  transition: all 0.2s;
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
}

.skeleton {
  border-radius: 8px;
  background: linear-gradient(90deg, #f1f5f9 25%, #e8edf3 37%, #f1f5f9 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
}
@keyframes shimmer {
  0% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0 50%;
  }
}

.notification-item {
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid #f1f5f9;
  transition: background-color 0.12s;
}
.notification-item:hover {
  background: #f8fafc;
}
.notification-item.is-unread {
  background: #fdf8fb;
}
.notification-item.is-unread:hover {
  background: #fcf1f7;
}

.auth-card {
  width: min(100%, 420px);
}
.code-input {
  letter-spacing: 0.4em;
  text-align: center;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 20px;
}

.date-badge {
  display: flex;
  height: 60px;
  width: 56px;
  flex-shrink: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: white;
  box-shadow: inset 0 0 0 1px #e2e8f0, 0 1px 2px rgba(15, 23, 42, 0.04);
}
.date-badge .month {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--brand);
}
.date-badge .day {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: #0b1020;
}

.lift {
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.lift:hover {
  transform: translateY(-2px);
  border-color: #e2e8f0;
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.03), 0 18px 40px -18px rgba(15, 23, 42, 0.22);
}

.empty-state {
  border-radius: 18px;
  border: 1px dashed #e2e8f0;
  background: #fcfcfd;
  padding: 40px 24px;
  text-align: center;
}

mark {
  border-radius: 4px;
  background: #fde68a;
  padding: 0 2px;
  color: inherit;
}

/* Assume a stored session is valid until the header has loaded. */
html[data-auth='1'] [data-signed-out] {
  display: none !important;
}
html[data-auth='1'] [data-signed-in] {
  display: flex !important;
}
html[data-auth='1'] [data-auth-hide] {
  display: none !important;
}
html:not([data-auth='1']) [data-auth-only] {
  display: none !important;
}
.avatar-slot:empty {
  display: inline-block;
  height: 32px;
  width: 32px;
  border-radius: 9999px;
  background: #e2e8f0;
}
.composer-editor {
  cursor: text;
}
.composer-editor .milkdown {
  min-height: 100%;
}

.no-scrollbar {
  scrollbar-width: none;
}
.no-scrollbar::-webkit-scrollbar {
  display: none;
}

@media (max-width: 640px) {
  .post {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 12px;
    padding: 20px 0;
  }
  .post > a .avatar {
    width: 34px !important;
    height: 34px !important;
    font-size: 14px !important;
  }
  .cooked {
    font-size: 15px;
  }
  .article {
    font-size: 16.5px;
  }
}
