:root {
  --phi: 1.618;
  --space-1: 10px;
  --space-2: 16px;
  --space-3: 26px;
  --space-4: 42px;
  --space-5: 68px;
  --space-6: 110px;
  color: #f7f2e8;
  background: #070907;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.eyebrow,
.briefing-kicker {
  margin: 0 0 14px;
  color: #e1ba4c;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.portal-shell,
.app-dashboard,
.login-shell {
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(225, 186, 76, 0.045) 1px, transparent 1px),
    linear-gradient(rgba(225, 186, 76, 0.045) 1px, transparent 1px),
    linear-gradient(128deg, rgba(241, 216, 136, 0.18), rgba(241, 216, 136, 0.05) 18%, transparent 43%),
    linear-gradient(112deg, rgba(123, 177, 136, 0.13), transparent 36%),
    #070907;
  background-size: 42px 42px, 42px 42px, auto, auto, auto;
}

.portal-shell::before,
.app-dashboard::before,
.login-shell::before {
  content: "";
  position: fixed;
  inset: -18% -10% auto auto;
  width: min(78vw, 920px);
  height: min(62vw, 720px);
  pointer-events: none;
  background:
    linear-gradient(102deg, rgba(225, 186, 76, 0.2), transparent 28%),
    linear-gradient(118deg, rgba(248, 244, 234, 0.12), transparent 24%),
    linear-gradient(136deg, rgba(123, 177, 136, 0.13), transparent 30%);
  clip-path: polygon(0 0, 100% 0, 62% 100%, 0 38%);
  opacity: 0.72;
  transform: rotate(-6deg);
  z-index: 0;
}

.portal-shell > *,
.app-dashboard > *,
.login-shell > * {
  position: relative;
  z-index: 1;
}

.portal-shell,
.app-dashboard {
  padding: var(--space-3) clamp(18px, 4vw, 52px) var(--space-5);
}

.portal-nav,
.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-2);
  margin: 0 auto;
  max-width: 1200px;
}

.wordmark,
.ghost-link,
.member-button,
.primary-cta,
.secondary-cta,
.text-cta,
.rail-link {
  border: 0;
  border-radius: 8px;
  font-weight: 820;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #f9f5eb;
  background: transparent;
  font-size: 1rem;
  text-align: left;
}

.wordmark img {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  object-fit: contain;
}

.wordmark.dark,
.ghost-link.dark {
  color: #f9f5eb;
}

.portal-actions,
.hero-ctas,
.dashboard-header > div,
.login-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}

.ghost-link {
  padding: 10px 12px;
  color: rgba(249, 245, 235, 0.78);
  background: transparent;
}

.member-button,
.primary-cta {
  padding: 11px 16px;
  color: #121813;
  background: #e1ba4c;
  box-shadow: 0 12px 30px rgba(225, 186, 76, 0.18);
}

.secondary-cta {
  padding: 11px 16px;
  color: #f9f5eb;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.primary-cta.compact {
  padding: 10px 13px;
}

.portal-hero,
.dashboard-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.618fr) minmax(320px, 1fr);
  gap: clamp(var(--space-3), 5vw, var(--space-5));
  align-items: center;
  max-width: 1200px;
  margin: var(--space-5) auto 0;
}

.hero-copy h1,
.dashboard-hero h1,
.login-panel h1 {
  margin: 0;
  color: #f9f5eb;
  font-size: clamp(3.2rem, 8vw, 6.8rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.portal-subhead,
.dashboard-hero p,
.login-panel p {
  max-width: 68ch;
  color: rgba(249, 245, 235, 0.76);
  font-size: 1.08rem;
  line-height: 1.75;
}

.author-byline {
  display: inline-grid;
  grid-template-columns: auto 1fr;
  grid-template-areas:
    "avatar label"
    "avatar name";
  column-gap: 10px;
  align-items: center;
}

.author-byline img {
  grid-area: avatar;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid rgba(225, 186, 76, 0.45);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}

.author-byline span {
  grid-area: label;
  color: #e1ba4c;
  font-size: 0.68rem;
  font-weight: 850;
  text-transform: uppercase;
}

.author-byline strong {
  grid-area: name;
  color: rgba(249, 245, 235, 0.9);
  font-size: 0.9rem;
}

.hero-author {
  margin-bottom: var(--space-3);
}

.card-author {
  margin-top: 16px;
}

.card-author img {
  width: 34px;
  height: 34px;
}

.card-author strong {
  font-size: 0.82rem;
}

.preview-stack {
  display: grid;
  gap: var(--space-2);
}

.live-preview,
.latest-card,
.archive-card,
.teaser-card,
.login-panel,
.module-grid article {
  border: 1px solid rgba(249, 245, 235, 0.12);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.045), transparent 32%),
    rgba(20, 31, 27, 0.82);
  box-shadow: 0 26px 68px rgba(0, 0, 0, 0.34);
}

.live-preview,
.latest-card,
.archive-card,
.teaser-card,
.login-panel {
  padding: var(--space-3);
}

.preview-topline,
.card-kicker {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #e1ba4c;
  font-size: 0.76rem;
  font-weight: 850;
  text-transform: uppercase;
}

.live-preview h2,
.latest-card h2,
.archive-card h2,
.teaser-card h3 {
  margin: 18px 0 10px;
  color: #f9f5eb;
  font-size: clamp(1.55rem, 3vw, 2.5rem);
  line-height: 1.06;
}

.live-preview p,
.latest-card p,
.archive-card p,
.teaser-card p,
.module-grid p,
.disclaimer-strip span {
  color: rgba(249, 245, 235, 0.72);
  line-height: 1.65;
}

.preview-meta,
.tag-row,
.category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.preview-meta span,
.tag-row span,
.category-tab {
  border: 1px solid rgba(249, 245, 235, 0.12);
  border-radius: 999px;
  padding: 6px 9px;
  color: rgba(249, 245, 235, 0.72);
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.78rem;
}

.blurred-list {
  display: grid;
  gap: 10px;
  filter: blur(0.25px);
}

.blurred-row {
  padding: 14px;
  border: 1px solid rgba(249, 245, 235, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.blurred-row span,
.archive-card dt {
  display: block;
  color: rgba(249, 245, 235, 0.45);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.blurred-row strong {
  display: block;
  margin-top: 5px;
  color: rgba(249, 245, 235, 0.9);
}

.portal-band,
.demo-archive,
.disclaimer-strip {
  max-width: 1200px;
  margin: var(--space-5) auto 0;
}

.portal-band h2,
.demo-archive h2 {
  margin: 0;
  color: #f9f5eb;
  font-size: clamp(1.8rem, 4vw, 3rem);
}

.demo-archive {
  scroll-margin-top: var(--space-4);
}

.demo-archive-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.teaser-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-2);
}

.teaser-card {
  position: relative;
  overflow: hidden;
}

.teaser-card::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 84px;
  pointer-events: none;
  background: linear-gradient(transparent, rgba(20, 31, 27, 0.98));
}

.teaser-card dl {
  display: grid;
  gap: 8px;
  margin: 18px 0;
}

.teaser-card dt {
  display: block;
  color: rgba(249, 245, 235, 0.45);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.teaser-card dd {
  margin: 3px 0 0;
  color: rgba(249, 245, 235, 0.88);
}

.teaser-card .text-cta {
  position: relative;
  z-index: 1;
}

.portal-band > div:first-child p {
  max-width: 66ch;
  color: rgba(249, 245, 235, 0.72);
  line-height: 1.7;
}

.module-grid,
.brief-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-2);
}

.module-grid article {
  padding: var(--space-3);
}

.module-grid h3 {
  margin: 0 0 8px;
  color: #f9f5eb;
}

.disclaimer-strip {
  display: flex;
  gap: 14px;
  align-items: baseline;
  border-top: 1px solid rgba(249, 245, 235, 0.12);
  padding-top: 20px;
}

.disclaimer-strip strong {
  color: #e1ba4c;
  white-space: nowrap;
}

.login-shell {
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-panel {
  width: min(620px, 100%);
}

.auth-error {
  margin: 18px 0 0;
  color: #f1d888;
  font-size: 0.9rem;
  line-height: 1.55;
}

.app-dashboard {
  color: #f9f5eb;
}

.account-chip {
  align-self: center;
  max-width: 260px;
  overflow: hidden;
  color: rgba(249, 245, 235, 0.76);
  font-size: 0.82rem;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.library-controls {
  display: grid;
  gap: var(--space-2);
  max-width: 1200px;
  margin: var(--space-4) auto var(--space-3);
}

.library-search {
  display: grid;
  gap: 7px;
  color: rgba(249, 245, 235, 0.68);
  font-size: 0.78rem;
  font-weight: 800;
}

.library-search input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid rgba(249, 245, 235, 0.14);
  border-radius: 8px;
  color: #f9f5eb;
  background: rgba(255, 255, 255, 0.06);
}

.category-tab {
  border: 1px solid rgba(249, 245, 235, 0.12);
}

.category-tab.active {
  color: #121813;
  background: #e1ba4c;
}

.brief-card-grid {
  max-width: 1200px;
  margin: 0 auto;
}

.archive-card dl {
  display: grid;
  gap: 8px;
  margin: 18px 0;
}

.archive-card div {
  min-width: 0;
}

.archive-card dd {
  margin: 3px 0 0;
  color: rgba(249, 245, 235, 0.88);
}

.text-cta {
  margin-top: 18px;
  padding: 10px 0;
  color: #e1ba4c;
  background: transparent;
  text-align: left;
}

.progress-bar {
  position: fixed;
  z-index: 10;
  top: 0;
  left: 0;
  height: 4px;
  background: #c86b4f;
}

.reader-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1.618fr);
  min-height: 100vh;
  background:
    linear-gradient(118deg, rgba(225, 186, 76, 0.18), rgba(225, 186, 76, 0.04) 20%, transparent 46%),
    linear-gradient(90deg, rgba(23, 32, 28, 0.035) 1px, transparent 1px),
    #f5f1e8;
  background-size: auto, 42px 42px, auto;
}

.briefing-rail {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: var(--space-3);
  overflow: auto;
  color: #f8f4ea;
  background: #17201c;
}

.brand-button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-bottom: 10px;
  padding: 13px 14px;
  border: 1px solid rgba(248, 244, 234, 0.18);
  border-radius: 8px;
  color: #f8f4ea;
  background: transparent;
  font-weight: 850;
  text-align: left;
}

.brand-button img {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  object-fit: contain;
  flex: 0 0 auto;
}

.rail-link {
  width: 100%;
  margin-bottom: 18px;
  padding: 11px 14px;
  color: #e1ba4c;
  background: rgba(255, 255, 255, 0.04);
  text-align: left;
}

.briefing-list {
  display: grid;
  gap: 10px;
}

.briefing-tab {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  grid-template-areas:
    "logo title"
    "logo meta";
  column-gap: 10px;
  align-items: center;
  width: 100%;
  padding: 14px;
  border: 1px solid rgba(248, 244, 234, 0.12);
  border-radius: 8px;
  color: rgba(248, 244, 234, 0.76);
  background: rgba(255, 255, 255, 0.04);
  text-align: left;
}

.briefing-tab.active {
  color: #17201c;
  background: #e1ba4c;
}

.briefing-tab span,
.briefing-tab small {
  display: block;
}

.briefing-tab span {
  grid-area: title;
  font-weight: 760;
}

.briefing-tab small {
  grid-area: meta;
  margin-top: 6px;
  opacity: 0.82;
}

.publication-mark {
  grid-area: logo;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(225, 186, 76, 0.32);
  border-radius: 999px;
  background: rgba(248, 244, 234, 0.08);
  object-fit: cover;
}

.reader-stage {
  width: min(100%, 1120px);
  padding: var(--space-3) clamp(20px, 5vw, var(--space-5)) var(--space-5);
}

.reader-toolbar {
  position: sticky;
  z-index: 4;
  top: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: end;
  padding: var(--space-2) 0;
  background: rgba(245, 241, 232, 0.94);
  backdrop-filter: blur(12px);
}

.search-box,
.font-control {
  display: grid;
  gap: 7px;
  color: #536058;
  font-size: 0.78rem;
  font-weight: 800;
}

.search-box {
  flex: 1 1 260px;
}

.font-control {
  width: min(220px, 100%);
}

.search-box input {
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid #d9d0bc;
  border-radius: 8px;
  color: #17201c;
  background: #fffaf0;
}

.font-control input {
  accent-color: #c86b4f;
}

.briefing-reader {
  max-width: 864px;
  padding-top: clamp(var(--space-3), 6vw, var(--space-5));
}

.briefing-reader h1 {
  margin: 0;
  color: #17201c;
  font-size: clamp(2.4rem, 6vw, 5rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.reader-author {
  margin: -4px 0 18px;
}

.reader-author img {
  width: 42px;
  height: 42px;
}

.reader-author strong {
  color: #2d3932;
}

.reader-author span {
  color: #9a7a24;
}

.summary {
  margin: 24px 0;
  color: #536058;
  font-size: calc(1.18rem * var(--reader-scale));
  line-height: 1.75;
}

.brief-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(162px, 1fr));
  gap: var(--space-1);
  margin: var(--space-3) 0;
}

.brief-meta-grid div {
  padding: 13px;
  border: 1px solid #d9d0bc;
  border-radius: 8px;
  background: #fffaf0;
}

.brief-meta-grid span {
  display: block;
  margin-bottom: 5px;
  color: #7b827a;
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.brief-meta-grid strong {
  color: #17201c;
  font-size: 0.88rem;
  line-height: 1.35;
}

.signal-grid {
  display: grid;
  grid-template-columns: 1.618fr 1fr 1fr;
  gap: var(--space-2);
  margin: var(--space-4) 0 var(--space-5);
}

.signal-grid p {
  min-height: 132px;
  margin: 0;
  padding: 18px;
  border-left: 5px solid #7bb188;
  border-radius: 8px;
  background: #fffaf0;
  color: #243129;
  line-height: 1.55;
  box-shadow: 0 12px 32px rgba(23, 32, 28, 0.08);
}

.signal-grid p:nth-child(2) {
  border-left-color: #e1ba4c;
}

.signal-grid p:nth-child(3) {
  border-left-color: #c86b4f;
}

.briefing-section {
  padding: var(--space-4) 0;
  border-top: 1px solid #d9d0bc;
}

.briefing-section h2 {
  margin: 0 0 14px;
  color: #17201c;
  font-size: 1rem;
  letter-spacing: 0;
  text-transform: uppercase;
}

.briefing-section p {
  margin: 0 0 16px;
  color: #2d3932;
  font-size: calc(1.12rem * var(--reader-scale));
  line-height: 1.9;
}

.briefing-section p:last-child {
  margin-bottom: 0;
}

@media (max-width: 780px) {
  .portal-shell,
  .app-dashboard {
    padding: 18px;
  }

  .portal-nav,
  .dashboard-header,
  .demo-archive-head,
  .disclaimer-strip {
    align-items: flex-start;
    flex-direction: column;
  }

  .portal-hero,
  .dashboard-hero {
    grid-template-columns: 1fr;
    margin-top: 42px;
  }

  .hero-copy h1,
  .dashboard-hero h1,
  .login-panel h1 {
    font-size: clamp(2.6rem, 16vw, 4.4rem);
  }

  .reader-shell {
    grid-template-columns: 1fr;
  }

  .briefing-rail {
    position: static;
    height: auto;
  }

  .signal-grid {
    grid-template-columns: 1fr;
  }
}
