/* ─────────────────────────────────────────────────────────────────────
   No Code Girl — editorial design system
   Instrument Serif (display) + Lato (text), warm paper palette, square brand.
   ───────────────────────────────────────────────────────────────────── */
@import url("https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Lato:ital,wght@0,300;0,400;0,700;0,900;1,400&display=swap");

:root {
  /* ── No Code Girl base ramps ──────────────────────────────────── */
  --ncg-ink: #0A0A0A;
  --ncg-ink-80: #33322F;
  --ncg-ink-60: #5C5A55;
  --ncg-ink-40: #8B8880;
  --ncg-ink-20: #B6B2A9;
  --ncg-paper: #FFFFFF;
  --ncg-bone: #F5F4EF;
  --ncg-linen: #EBE9E0;
  --ncg-oyster: #DAD8CC;
  --ncg-ash: #C6C3B8;
  --ncg-chrome-100: #F0F1F2;
  --ncg-chrome-200: #D3D5D7;
  --ncg-chrome-400: #AFB2B5;
  --ncg-chrome-600: #8B8E91;
  --ncg-blush-100: #FBEFF2;
  --ncg-blush-200: #F0D6DE;
  --ncg-blush-400: #E3B0C0;
  --ncg-blush-600: #C4788F;
  --ncg-sage-200: #DDE7E5;
  --ncg-sage-400: #A9C2C0;
  --ncg-sage-600: #7A9895;
  --ncg-positive: #4E6B54;
  --ncg-caution: #B08744;
  --ncg-critical: #A3453F;
  --ncg-informative: #6A8A99;

  /* ── semantic aliases (used directly in product code) ─────────── */
  --text-primary: var(--ncg-ink);
  --text-secondary: var(--ncg-ink-60);
  --text-muted: var(--ncg-ink-40);
  --text-disabled: var(--ncg-ink-20);
  --text-inverse: var(--ncg-paper);
  --text-accent: var(--ncg-blush-600);
  --text-link: var(--ncg-ink);
  --text-link-hover: var(--ncg-blush-600);

  --surface-page: var(--ncg-paper);
  --surface-page-warm: var(--ncg-bone);
  --surface-card: var(--ncg-paper);
  --surface-sunken: var(--ncg-linen);
  --surface-inverse: var(--ncg-ink);
  --surface-accent: var(--ncg-blush-100);
  --surface-still: var(--ncg-bone);

  --border-hairline: #E3E1D9;
  --border-quiet: var(--ncg-oyster);
  --accent: var(--ncg-blush-400);
  --accent-strong: var(--ncg-blush-600);
  --accent-quiet: var(--ncg-blush-100);
  --accent-alt: var(--ncg-sage-400);

  /* ── type system ──────────────────────────────────────────────── */
  --font-serif-display: "Instrument Serif", "Times New Roman", Times, serif;
  --fw-light: 300;
  --fw-regular: 400;
  --fw-bold: 700;
  --fw-black: 900;

  --type-display-lg: var(--fw-regular) 64px/0.98 var(--font-serif-display);
  --type-display-md: var(--fw-regular) 44px/1.04 var(--font-serif-display);
  --type-body: var(--fw-regular) 15px/1.6 "Lato", sans-serif;
  --type-body-sm: var(--fw-regular) 13px/1.55 "Lato", sans-serif;

  --tracking-display: -0.02em;

  /* ═══ platform semantic tokens mapped to the NCG palette ═══════ */
  --background: #FFFFFF;
  --foreground: #0A0A0A;
  --card: #FFFFFF;
  --card-foreground: #0A0A0A;
  --popover: #FFFFFF;
  --popover-foreground: #0A0A0A;
  --primary: #0A0A0A;
  --primary-foreground: #FFFFFF;
  --secondary: #F5F4EF;
  --secondary-foreground: #0A0A0A;
  --muted: #F5F4EF;
  --muted-foreground: #8B8880;
  --accent-foreground: #0A0A0A;
  --destructive: #A3453F;
  --destructive-foreground: #FFFFFF;
  --border: #E3E1D9;
  --input: #DAD8CC;
  --ring: #0A0A0A;
  --success: #4E6B54;
  --warning: #B08744;
  --chart-1: #C4788F;
  --chart-2: #A9C2C0;
  --chart-3: #6A8A99;
  --chart-4: #B08744;
  --chart-5: #4E6B54;
  --sidebar: #F5F4EF;
  --sidebar-foreground: #0A0A0A;
  --sidebar-primary: #0A0A0A;
  --sidebar-primary-foreground: #FFFFFF;
  --sidebar-accent: #FBEFF2;
  --sidebar-accent-foreground: #0A0A0A;
  --sidebar-border: #E3E1D9;
  --sidebar-ring: #0A0A0A;

  --background-secondary: #F5F4EF;
  --surface-hover: #F5F4EF;
  --surface-active: #EBE9E0;
  --surface-elevated: #FFFFFF;

  --border-subtle: #EBE9E0;
  --border-muted: #E3E1D9;
  --border-strong: #0A0A0A;

  --foreground-secondary: #5C5A55;

  --primary-hover: #33322F;
  --primary-muted: #EBE9E0;
  --primary-soft: #F5F4EF;
  --primary-tint: #FBEFF2;

  --focus-ring: rgba(10, 10, 10, 0.35);
  --error: #A3453F;
  --error-foreground: #FFFFFF;

  /* ── radius — brand is square; controls & cards get deliberate rounding ── */
  --radius: 0.625rem;      /* 10px — controls */
  --radius-none: 0rem;
  --radius-sm: 0.125rem;
  --radius-lg: 0.9375rem;  /* 15px — cards */
  --radius-xl: 1.125rem;   /* 18px — dialogs */
  --radius-full: 9999px;

  /* ── typography (platform display/sans point at NCG fonts) ────── */
  --font-display: "Instrument Serif", "Times New Roman", Times, serif;
  --font-sans: "Lato", -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --font-weight-display: 400;
  --line-height-display: 1.0;
  --tracking-body: -0.02em;
  --font-weight-body: 400;
  --line-height-body: 1.6;
  --font-weight-mono: 400;

  --shadow-sm: 0 1px 2px rgba(10, 10, 10, 0.05);
  --shadow-md: 0 2px 10px -4px rgba(10, 10, 10, 0.10);
  --shadow-lg: 0 28px 70px -24px rgba(10, 10, 10, 0.22);

  --duration-fast: 140ms;
  --duration-normal: 220ms;
  --duration-slow: 400ms;
  --ease-standard: cubic-bezier(0.2, 0.6, 0.2, 1);
  --ease-accelerate: cubic-bezier(0.5, 0, 0.9, 0.3);
  --ease-decelerate: cubic-bezier(0.16, 1, 0.3, 1);

  --spacing-base: 0.25rem;
}

/* This brand is light-only. Keep dark identical so the editorial palette holds. */
.dark {
  --background: #FFFFFF;
  --foreground: #0A0A0A;
  --card: #FFFFFF;
  --card-foreground: #0A0A0A;
  --popover: #FFFFFF;
  --popover-foreground: #0A0A0A;
  --primary: #0A0A0A;
  --primary-foreground: #FFFFFF;
  --secondary: #F5F4EF;
  --secondary-foreground: #0A0A0A;
  --muted: #F5F4EF;
  --muted-foreground: #8B8880;
  --accent-foreground: #0A0A0A;
  --destructive: #A3453F;
  --destructive-foreground: #FFFFFF;
  --border: #E3E1D9;
  --input: #DAD8CC;
  --ring: #0A0A0A;
  --background-secondary: #F5F4EF;
  --surface-elevated: #FFFFFF;
  --border-subtle: #EBE9E0;
  --border-muted: #E3E1D9;
  --border-strong: #0A0A0A;
  --foreground-secondary: #5C5A55;
  --primary-tint: #FBEFF2;
  --focus-ring: rgba(10, 10, 10, 0.35);
  --error: #A3453F;
  --error-foreground: #FFFFFF;
}

body {
  letter-spacing: -0.02em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--ncg-blush-200);
  color: var(--ncg-ink);
}

/* ── No Code Girl interaction layer ───────────────────────────────── */
.ncg a { color: var(--text-primary); text-decoration: none; }
.ncg a:hover { color: var(--accent-strong); }
.ncg-card { transition: border-color var(--duration-fast) var(--ease-standard); }
.ncg-card:hover { border-color: var(--text-primary) !important; }
.ncg-card:hover .ncg-arrow { opacity: 1 !important; }
.ncg-arrow { transition: opacity var(--duration-fast) var(--ease-standard); }
.ncg-nudge { transition: color var(--duration-fast) var(--ease-standard); }
.ncg-nudge:hover { color: var(--accent-strong); }
.ncg-chip { transition: var(--duration-fast) var(--ease-standard); }
.ncg-suggest:hover { border-color: var(--accent) !important; background: var(--ncg-blush-100) !important; }
.ncg-rail { scrollbar-width: thin; scrollbar-color: var(--border-hairline) transparent; }
.ncg-rail::-webkit-scrollbar { height: 2px; }
.ncg-rail::-webkit-scrollbar-thumb { background: var(--border-hairline); }
.ncg-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ncg-navbtn { transition: color var(--duration-fast) var(--ease-standard); }
.ncg-navbtn:hover { color: var(--accent-strong); }
/* Sign out renders as a POST button; strip native button chrome to match nav links. */
.ncg-signout { appearance: none; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; font-family: var(--font-sans); font-size: 15px; white-space: nowrap; color: var(--text-primary); }

/* Site navigation — fixed left sidebar on desktop, top bar + drawer on phones */
:root { --ncg-sidebar-w: 256px; --ncg-topbar-h: 0px; }
.ncg-sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 30;
  width: var(--ncg-sidebar-w);
  display: flex; flex-direction: column;
  background: var(--ncg-bone);
  border-right: 1px solid var(--border-hairline);
}
.ncg:has(> .ncg-sidebar) { padding-left: var(--ncg-sidebar-w); }
.ncg-side-top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 26px 20px 18px 28px;
}
/* The platform bell drops its panel right-aligned; from the sidebar it opens rightward instead. */
.ncg-sidebar [data-notifications-bell] > [role="dialog"] { left: 0; right: auto; }
.ncg-side-mark {
  font-family: var(--font-serif-display); font-weight: 400; font-size: 26px; line-height: 1;
  letter-spacing: var(--tracking-display); color: var(--text-primary); white-space: nowrap; border-bottom: 0;
}
.ncg-side-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 14px; scrollbar-width: none; }
.ncg-side-scroll::-webkit-scrollbar { display: none; }
.ncg-side-nav { display: flex; flex-direction: column; }
.ncg-side-group { display: flex; flex-direction: column; gap: 2px; }
.ncg-side-group + .ncg-side-group {
  margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border-hairline);
}
.ncg .ncg-side-link, .ncg-side-link {
  display: flex; align-items: center; gap: 14px; width: 100%;
  min-height: 44px; padding: 10px 14px; border-radius: 12px;
  font-family: var(--font-sans); font-size: 15px; font-weight: 400; line-height: 1.3; text-align: left;
  color: var(--ncg-ink-80); background: transparent; border: 0; cursor: pointer;
  transition: background-color var(--duration-fast) var(--ease-standard), color var(--duration-fast) var(--ease-standard);
}
.ncg .ncg-side-link:hover, .ncg-side-link:hover { background: var(--ncg-linen); color: var(--text-primary); }
.ncg .ncg-side-link[data-active], .ncg-side-link[data-active] {
  background: var(--ncg-blush-100); color: var(--text-primary); font-weight: 700;
}
.ncg-side-icon { width: 20px; height: 20px; flex: none; color: var(--ncg-ink-60); }
.ncg-side-link[data-active] .ncg-side-icon { color: var(--accent-strong); }
.ncg-side-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ncg-side-foot {
  display: flex; flex-direction: column; gap: 2px;
  margin: 0 14px; padding: 12px 0 18px; border-top: 1px solid var(--border-hairline);
}
.ncg .ncg-side-signout, .ncg-side-signout { color: var(--ncg-ink-60); }

.ncg-topbar { display: none; }
.ncg-topbar-btn {
  appearance: none; background: none; border: 0; padding: 0; cursor: pointer;
  width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 12px; color: var(--text-primary);
}
.ncg-topbar-btn:hover { background: var(--ncg-linen); }
.ncg-topbar-end { display: flex; justify-content: flex-end; }
.ncg-drawer { background: var(--ncg-bone) !important; width: min(300px, 86vw) !important; }
.ncg-drawer-body { display: flex; flex-direction: column; height: 100%; padding: 0 !important; gap: 0 !important; }

@media (max-width: 900px) {
  :root { --ncg-topbar-h: 56px; }
  .ncg-sidebar { display: none; }
  .ncg:has(> .ncg-sidebar) { padding-left: 0; }
  .ncg-topbar {
    position: sticky; top: 0; z-index: 30;
    display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; gap: 8px;
    height: var(--ncg-topbar-h); padding: 0 10px;
    background: var(--surface-page); border-bottom: 1px solid var(--border-hairline);
  }
  .ncg-topbar .ncg-side-mark { justify-self: center; font-size: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  .ncg-card, .ncg-arrow, .ncg-nudge, .ncg-chip, .ncg-navbtn, .ncg-side-link { transition: none; }
}

/* ── Mobile: keep the layout on the phone, not distracting from the text ── */
@media (max-width: 640px) {
  /* Floating decorative stills are hidden so they don't sit over the copy */
  .ncg-decor { display: none !important; }

  /* Display type is sized for the desktop hero — bring it down to fit a phone */
  :root {
    --type-display-lg: var(--fw-regular) 38px/1.02 var(--font-serif-display);
    --type-display-md: var(--fw-regular) 28px/1.08 var(--font-serif-display);
  }

  /* Trim the wide desktop side padding so content isn't pushed off-screen */
  .ncg-pad-x { padding-left: 20px !important; padding-right: 20px !important; }

  /* Two-column desktop layouts stack into one column on a phone */
  .ncg-stack-mobile { grid-template-columns: 1fr !important; gap: 32px !important; }

}

/* Tighten the gap between the nav and the page title on phones/tablets */
@media (max-width: 768px) {
  .ncg-hero-top { padding-top: 20px !important; padding-bottom: 32px !important; }
}

/* Community chat: a message's hover actions (reply / more / add-reaction) stay
   hidden until the bubble is hovered. Touch devices have no hover, so they show
   them permanently instead. */
.ncg-msg-actions {
  opacity: 0;
  transition: opacity 140ms ease;
  pointer-events: none;
}
.ncg-msg-row:hover .ncg-msg-actions,
.ncg-msg-row:focus-within .ncg-msg-actions,
.ncg-msg-actions[data-open="true"] {
  opacity: 1;
  pointer-events: auto;
}
@media (hover: none) {
  .ncg-msg-actions { opacity: 1; pointer-events: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .ncg-msg-actions { transition: none; }
}
