/*
Theme Name: Nocturne
Theme URI: https://example.com/nocturne
Author: Your Name
Description: A dark AI research news theme. A split "paper abstract" hero, research-paper cards on stories with a one-sentence summary and a link to the paper, lab labels on cards, a model leaderboard drawn as bars, a latest-headline bar and header social links. Dark by default with a light mode, self-hosted fonts and one-click demo content with original artwork.
Version: 1.0.0
Requires at least: 6.4
Tested up to: 7.1
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: nocturne
Tags: news, blog, education, two-columns, right-sidebar, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready
*/

:root {
  color-scheme: dark;
  --bg: #0a0f1c;
  --surface: #111829;
  --surface-2: #172036;
  --text: #e8edf7;
  --text-2: #c2cbdf;
  --muted: #8b97b3;
  --line: #1f2a44;
  --accent: #8cc8ff;
  --accent-ink: #081021;
  --amber: #ffb454;
  --font-display: "Syne", system-ui, sans-serif;
  --font-body: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --w-display: 700;
  --track-display: -0.02em;
  --lh-display: 1.06;
  --radius: 16px;
  --radius-ui: 12px;
  --footer-bg: #070b15;
  --footer-text: #e8edf7;
  --footer-muted: #8b97b3;
  --footer-line: rgba(255,255,255,.08);
  --overlay: linear-gradient(180deg, rgba(8,12,24,0) 25%, rgba(8,12,24,.93) 100%);
  --accent-hover: #e8edf7;
  --accent-hover-ink: #0a0f1c;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #e9eef7;
  --text: #0d1426;
  --text-2: #36415c;
  --muted: #5f6b8b;
  --line: #d8dfed;
  --accent: #1f5fbf;
  --accent-ink: #ffffff;
  --amber: #c26a00;
  --footer-bg: #0d1426;
  --accent-hover: #0d1426;
  --accent-hover-ink: #ffffff;
}

body { font-size: 16.5px; }

/* ---------- Header with socials ---------- */
.site-header { background: var(--bg); border-bottom: 1px solid var(--line); }
.site-header__inner { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; grid-template-areas: "brand social nav actions"; align-items: center; column-gap: 1.4rem; }
.site-brand { grid-area: brand; }
.site-header__social { grid-area: social; display: block; padding-left: 1.4rem; border-left: 1px solid var(--line); }
.site-header__social .social a { width: 30px; height: 30px; border: 0; background: transparent; }
.primary-nav { grid-area: nav; }
.primary-menu { justify-content: center; }
.site-header__actions { grid-area: actions; margin-left: 0; }
.brand__name { font-size: 1.55rem; font-weight: 800; letter-spacing: -.02em; }
.brand__mark { width: 34px; height: 34px; }
.primary-menu > li > a { font-weight: 600; }
.header-cta { background: var(--accent); color: var(--accent-ink); }
@media (max-width: 1023px) {
  .site-header__inner { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "brand actions"; }
  .site-header__social { display: none; }
}
@media (max-width: 480px) { .brand__name { font-size: 1.28rem; } .brand__mark { width: 30px; height: 30px; } }

/* ---------- Latest bar ---------- */
.nc-live { background: var(--accent); color: var(--accent-ink); font-size: .88rem; }
.nc-live__inner { display: flex; align-items: center; gap: 1.5rem; min-height: 42px; }
.nc-live__news { display: flex; align-items: center; gap: .7rem; flex: 1; min-width: 0; margin: 0; }
.nc-live__label { flex: 0 0 auto; padding: .12rem .55rem; border-radius: 999px; background: var(--accent-ink); color: var(--accent); font-weight: 700; font-size: .78rem; }
.nc-live__news a { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-weight: 600; }
.nc-live__topics { display: flex; list-style: none; margin: 0; padding: 0; }
.nc-live__topics li + li { border-left: 1px solid rgba(8,16,33,.25); }
.nc-live__topics a { display: block; padding: 0 .85rem; font-weight: 600; white-space: nowrap; }
.nc-live a:hover { text-decoration: underline; }
@media (max-width: 900px) { .nc-live__topics { display: none; } }

.cat, .entry-cat { font-size: .8rem; font-weight: 700; color: var(--accent); }
.card__title { font-size: 1.3rem; line-height: 1.12; }
.section-title { font-size: clamp(1.8rem, 3.4vw, 2.6rem); }
.card, .card-row { --media-radius: 14px; }
.nc-lab { display: inline-block; margin-top: .4rem; padding: .15rem .6rem; border-radius: 999px; border: 1px solid var(--line); font-size: .8rem; font-weight: 600; color: var(--amber); }

/* ---------- Split hero ---------- */
.nc-hero { padding-block: clamp(32px, 5vw, 72px); border-bottom: 1px solid var(--line); }
.nc-hero__grid { display: grid; gap: clamp(28px, 4vw, 56px); align-items: center; }
@media (min-width: 980px) { .nc-hero__grid { grid-template-columns: minmax(0, 1.2fr) minmax(0, .95fr); } }
.nc-hero__text { display: flex; flex-direction: column; gap: 1rem; }
.nc-hero__title { font-size: clamp(2.2rem, 3.9vw, 3.4rem); font-weight: 700; line-height: 1.04; letter-spacing: -.03em; text-wrap: balance; overflow-wrap: break-word; }
.nc-hero__title a:hover { color: var(--accent); }
.nc-hero__dek { font-size: 1.15rem; line-height: 1.6; color: var(--text-2); max-width: 54ch; }
.nc-hero__tldr { padding: .9rem 1.1rem; border-left: 3px solid var(--amber); background: var(--surface); border-radius: 0 12px 12px 0; color: var(--text-2); max-width: 56ch; }
.nc-hero__tldr strong { color: var(--amber); }
.nc-hero__btn { align-self: flex-start; }
.nc-hero__art .media { aspect-ratio: 4 / 3; border-radius: 24px; box-shadow: 0 40px 80px -40px rgba(140,200,255,.35); }

/* ---------- Research, leaderboard, feed ---------- */
.nc-research .card { padding: 10px 10px 18px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); }
.nc-research .card .media { border-radius: 14px; }
.nc-research .card__body { padding-inline: 8px; }
.nc-board { background: var(--surface); border-block: 1px solid var(--line); }
.nc-board__grid { display: grid; gap: 28px; }
@media (min-width: 960px) { .nc-board__grid { grid-template-columns: minmax(0, .7fr) minmax(0, 1.3fr); align-items: start; } }
.nc-board__note { margin-top: .8rem; color: var(--muted); max-width: 40ch; }
.nc-board__list { list-style: none; margin: 0; padding: 0; display: grid; gap: .9rem; counter-reset: rank; }
.nc-board__row { counter-increment: rank; display: grid; grid-template-columns: 1.8rem minmax(0, 12rem) minmax(0, 1fr) 3.4rem; align-items: center; gap: 1rem; }
.nc-board__row::before { content: counter(rank); font-family: var(--font-display); font-weight: 800; color: var(--muted); }
.nc-board__who { display: flex; flex-direction: column; min-width: 0; }
.nc-board__name { font-weight: 700; }
.nc-board__lab { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: .82rem; color: var(--muted); }
.nc-board__bar { height: 12px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.nc-board__bar span { display: block; width: var(--w); height: 100%; border-radius: inherit; background: var(--amber); }
.nc-board__row:first-child .nc-board__bar span { background: var(--accent); }
.nc-board__score { font-family: var(--font-display); font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.nc-board__list.is-compact { gap: .75rem; }
.nc-board__list.is-compact .nc-board__row { grid-template-columns: 1.4rem minmax(0, 1fr) 3rem; grid-template-areas: "rank who score" "rank bar bar"; row-gap: .35rem; column-gap: .6rem; }
.nc-board__list.is-compact .nc-board__row::before { grid-area: rank; }
.nc-board__list.is-compact .nc-board__who { grid-area: who; }
.nc-board__list.is-compact .nc-board__bar { grid-area: bar; height: 8px; }
.nc-board__list.is-compact .nc-board__score { grid-area: score; }
@media (max-width: 640px) {
  .nc-board__row { grid-template-columns: 1.4rem minmax(0, 1fr) 3rem; grid-template-areas: "rank who score" "rank bar bar"; row-gap: .35rem; column-gap: .6rem; }
  .nc-board__row::before { grid-area: rank; }
  .nc-board__who { grid-area: who; }
  .nc-board__bar { grid-area: bar; height: 8px; }
  .nc-board__score { grid-area: score; }
}
.nc-feed { display: flex; flex-direction: column; }
.nc-feed .card-row { grid-template-columns: minmax(0, 36%) minmax(0, 1fr); align-items: center; padding-block: 20px; border-bottom: 1px solid var(--line); }
.nc-feed .card-row:first-child { padding-top: 0; }
.nc-feed .media { border-radius: 14px; }
.nc-feed .card__title { font-size: clamp(1.25rem, 2vw, 1.5rem); }
@media (max-width: 560px) { .nc-feed .card-row { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Sidebar and single ---------- */
.signup--sidebar { background: var(--surface-2); color: var(--text); border: 1px solid var(--line); }
.signup--sidebar .signup__button { background: var(--accent); color: var(--accent-ink); }
.signup--sidebar input[type="email"] { background: var(--bg); border-color: var(--line); color: var(--text); }
.nc-paper { margin: 0 0 2.2rem; padding: 1.4rem 1.5rem; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); }
.entry-content .nc-paper__title { margin: 0; font-size: 1.35rem; line-height: 1.25; }
.nc-paper .nc-paper__by { margin: .4rem 0 0; font-size: .92rem; color: var(--muted); }
.nc-paper .nc-paper__tldr { margin: .9rem 0 0; }
.nc-paper__tldr strong { color: var(--amber); }
.entry-content .nc-paper__link { margin-top: 1rem; text-decoration: none; }
.entry-title { font-size: clamp(2.2rem, 4.8vw, 3.6rem); font-weight: 800; letter-spacing: -.035em; }
.entry-content blockquote { border-left-color: var(--amber); font-weight: 600; }
.site-footer .signup { background: rgba(255,255,255,.04); color: var(--footer-text); padding: 1.4rem; }
.site-footer .signup__title { font-size: 1.2rem; }
.site-footer .signup__button { background: var(--accent); color: var(--accent-ink); }
