:root,
html[data-theme="night"] {
  color-scheme: dark;
  --page: #070b16;
  --page-deep: #040711;
  --page-soft: #0a1122;
  --surface: #0e1628;
  --surface-2: #111c33;
  --surface-3: #14213c;
  --surface-muted: #0b1222;
  --header: rgba(7, 11, 22, 0.94);
  --footer: #060a14;
  --text: #f7faff;
  --text-soft: #c7d3e6;
  --muted: #8fa3bf;
  --line: rgba(159, 184, 222, 0.16);
  --line-strong: rgba(159, 184, 222, 0.28);
  --brand: #6ea8ff;
  --brand-strong: #9ac3ff;
  --brand-deep: #2f72f2;
  --brand-soft: rgba(110, 168, 255, 0.16);
  --cyan: #64e3ff;
  --cyan-soft: rgba(100, 227, 255, 0.14);
  --success: #74efba;
  --success-soft: rgba(116, 239, 186, 0.15);
  --danger: #ff9baa;
  --danger-soft: rgba(255, 155, 170, 0.14);
  --warning: #fbd97f;
  --warning-soft: rgba(251, 217, 127, 0.14);
  --input: #0a1120;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.28);
  --shadow-md: 0 18px 55px rgba(0, 0, 0, 0.34);
  --shadow-lg: 0 34px 110px rgba(0, 0, 0, 0.5);
  --shadow-brand: 0 28px 90px rgba(56, 117, 255, 0.2);
  --container: min(1240px, calc(100vw - 56px));
}

html[data-theme="dusk"] {
  color-scheme: dark;
  --page: #0b1020;
  --page-deep: #060917;
  --page-soft: #10172a;
  --surface: #121b30;
  --surface-2: #17233b;
  --surface-3: #1b2946;
  --surface-muted: #0d1527;
  --header: rgba(11, 16, 32, 0.94);
  --footer: #090e1c;
  --text: #f7faff;
  --text-soft: #d0d9ea;
  --muted: #99a9c2;
  --line: rgba(180, 198, 224, 0.17);
  --line-strong: rgba(180, 198, 224, 0.3);
  --brand: #78a9ff;
  --brand-strong: #b5d0ff;
  --brand-deep: #3d7cf2;
  --brand-soft: rgba(120, 169, 255, 0.16);
  --cyan: #7ee7ff;
  --cyan-soft: rgba(126, 231, 255, 0.14);
  --success: #79eeb5;
  --success-soft: rgba(121, 238, 181, 0.15);
  --danger: #ff9cab;
  --danger-soft: rgba(255, 156, 171, 0.14);
  --warning: #fddc86;
  --warning-soft: rgba(253, 220, 134, 0.14);
  --input: #0d1527;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.24);
  --shadow-md: 0 18px 55px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 34px 110px rgba(0, 0, 0, 0.46);
  --shadow-brand: 0 28px 90px rgba(56, 117, 255, 0.18);
  --container: min(1240px, calc(100vw - 56px));
}

html[data-theme="light"] {
  color-scheme: light;
  --page: #eef4ff;
  --page-deep: #e5efff;
  --page-soft: #f5f8ff;
  --surface: rgba(255, 255, 255, 0.94);
  --surface-2: #ffffff;
  --surface-3: #f6f9ff;
  --surface-muted: #eaf1ff;
  --header: rgba(244, 248, 255, 0.92);
  --footer: #eff5ff;
  --text: #0b1221;
  --text-soft: #30415b;
  --muted: #60738f;
  --line: rgba(36, 67, 108, 0.14);
  --line-strong: rgba(36, 67, 108, 0.26);
  --brand: #2f72f2;
  --brand-strong: #1559db;
  --brand-deep: #1f63e9;
  --brand-soft: rgba(47, 114, 242, 0.12);
  --cyan: #0582b6;
  --cyan-soft: rgba(5, 130, 182, 0.12);
  --success: #11845c;
  --success-soft: rgba(17, 132, 92, 0.12);
  --danger: #b9394f;
  --danger-soft: rgba(185, 57, 79, 0.11);
  --warning: #9a6a11;
  --warning-soft: rgba(154, 106, 17, 0.12);
  --input: #ffffff;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 18px 55px rgba(27, 59, 105, 0.12);
  --shadow-lg: 0 34px 110px rgba(27, 59, 105, 0.16);
  --shadow-brand: 0 28px 90px rgba(47, 114, 242, 0.18);
  --container: min(1240px, calc(100vw - 56px));
}

* {
  box-sizing: border-box;
}

html {
  overflow-x: clip;
  scroll-behavior: smooth;
  background: var(--page);
}

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  max-width: 100%;
  overflow-x: clip;
  color: var(--text);
  background:
    radial-gradient(1200px 700px at 84% -15%, rgba(95, 147, 255, 0.24), transparent 68%),
    radial-gradient(900px 620px at 15% 4%, rgba(66, 215, 255, 0.11), transparent 72%),
    linear-gradient(180deg, var(--page) 0%, var(--page-deep) 60%, var(--page) 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.34;
  background-image:
    linear-gradient(rgba(255,255,255,0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.018) 1px, transparent 1px);
  background-size: 76px 76px;
  mask-image: radial-gradient(circle at 50% 0%, black 0%, transparent 75%);
}

html[data-theme="light"] body::before {
  opacity: 0.2;
  background-image:
    linear-gradient(rgba(25,61,108,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(25,61,108,0.03) 1px, transparent 1px);
}

@supports not (overflow: clip) {
  html,
  body {
    overflow-x: hidden;
  }
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

img {
  max-width: 100%;
}

.container {
  width: var(--container);
  max-width: 100%;
  margin: 0 auto;
}

main,
section,
header,
footer {
  max-width: 100%;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0,0,0,0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Typography */
h1,
h2,
h3,
p,
ul,
ol {
  margin-top: 0;
}

h1 {
  margin-bottom: 28px;
  max-width: 920px;
  font-size: clamp(3.25rem, 6vw, 6.15rem);
  line-height: 0.95;
  letter-spacing: -0.075em;
  font-weight: 850;
}

h2 {
  margin-bottom: 20px;
  font-size: clamp(2rem, 3.55vw, 3.65rem);
  line-height: 1.02;
  letter-spacing: -0.055em;
  font-weight: 810;
}

h3 {
  margin-bottom: 14px;
  font-size: clamp(1.35rem, 2vw, 1.72rem);
  line-height: 1.12;
  letter-spacing: -0.035em;
  font-weight: 790;
}

p,
li {
  color: var(--text-soft);
  line-height: 1.75;
}

strong {
  color: var(--text);
}

.lead {
  max-width: 790px;
  margin-bottom: 36px;
  color: var(--text-soft);
  font-size: 1.18rem;
  line-height: 1.78;
}

.section-copy {
  max-width: 760px;
  margin-bottom: 30px;
  font-size: 1.05rem;
}

.eyebrow,
.subtle-label {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  margin-bottom: 16px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--brand-strong);
  background: var(--brand-soft);
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.inline-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--brand-strong);
  font-weight: 850;
  transition: color 160ms ease, transform 160ms ease;
}

.inline-link:hover {
  color: var(--cyan);
  transform: translateX(2px);
}

/* Global surfaces */
.card {
  border: 1px solid var(--line);
  border-radius: 30px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.032), transparent 24%),
    var(--surface);
  box-shadow: var(--shadow-md);
}

.section {
  position: relative;
  padding: 124px 0;
}

.section-soft {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.018), transparent 24%),
    color-mix(in srgb, var(--page-soft) 90%, transparent);
}

@supports not (background: color-mix(in srgb, white 50%, black)) {
  .section-soft {
    background: var(--page-soft);
  }
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  min-height: 88px;
  border-bottom: 1px solid var(--line);
  background: var(--header);
  backdrop-filter: blur(18px);
}

.header-grid {
  min-height: 88px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 28px;
  min-width: 0;
}

.brand,
.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-icon {
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  border-radius: 16px;
  object-fit: cover;
  box-shadow: var(--shadow-brand);
}

.brand-text {
  display: grid;
  line-height: 1.02;
}

.brand-text strong {
  font-size: 1.08rem;
  font-weight: 900;
  letter-spacing: -0.045em;
}

.brand-text small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.site-nav {
  justify-self: center;
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.site-nav a {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  padding: 0 17px;
  border-radius: 999px;
  color: var(--text-soft);
  font-size: 0.95rem;
  font-weight: 780;
  transition: color 160ms ease, background 160ms ease, transform 160ms ease;
}

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

.site-nav a:hover {
  transform: translateY(-1px);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.theme-switcher {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}

.theme-switcher span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 820;
}

.theme-switcher select {
  min-width: 124px;
  min-height: 36px;
  padding: 0 34px 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  background: var(--surface-2);
  font-size: 0.9rem;
  font-weight: 790;
  outline: none;
}

.theme-switcher select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-soft);
}

.menu-toggle {
  display: none;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.menu-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 4px auto;
  border-radius: 999px;
  background: var(--text);
}

/* Buttons */
.button,
.text-button {
  border: 0;
}

.button {
  min-height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 26px;
  border-radius: 999px;
  color: #fff;
  background:
    linear-gradient(135deg, var(--brand-deep), var(--brand));
  font-weight: 850;
  box-shadow: 0 18px 40px rgba(47, 114, 242, 0.24);
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

.button:hover {
  transform: translateY(-2px);
  box-shadow: 0 26px 58px rgba(47, 114, 242, 0.32);
  filter: brightness(1.05);
}

.button-secondary {
  color: var(--text);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  box-shadow: none;
}

.button-secondary:hover {
  color: var(--brand-strong);
  box-shadow: var(--shadow-sm);
  background: var(--surface-2);
}

.button-compact {
  min-height: 48px;
  padding: 0 20px;
  font-size: 0.95rem;
}

.text-button {
  min-height: 52px;
  padding: 0 12px;
  color: var(--muted);
  background: transparent;
  font-weight: 830;
}

.text-button:hover {
  color: var(--brand-strong);
}

.action-row,
.form-actions,
.chip-row,
.tag-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

/* Hero */
.hero-section {
  position: relative;
  padding: 118px 0 136px;
}

.hero-section::after {
  content: "";
  position: absolute;
  inset: 10% 0 auto;
  height: 54%;
  pointer-events: none;
  background: radial-gradient(circle at 72% 50%, rgba(81, 137, 255, 0.13), transparent 62%);
}

.hero-layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 0.98fr) minmax(460px, 1.02fr);
  align-items: center;
  gap: 68px;
}

.hero-copy {
  max-width: 760px;
}

.tag-row {
  margin-top: 30px;
}

.tag-row span,
.chip-row span {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text-soft);
  background: var(--surface);
  font-size: 0.86rem;
  font-weight: 790;
}

.hero-visual {
  position: relative;
  overflow: hidden;
  padding: 16px;
  border-radius: 36px;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.055), transparent 26%),
    var(--surface-muted);
  box-shadow: var(--shadow-lg), var(--shadow-brand);
}

.visual-frame {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--surface-muted);
}

.visual-frame img,
.explore-visual img {
  display: block;
  width: 100%;
  height: auto;
}

.visual-frame-hero {
  border-radius: 30px;
}

.hero-visual-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 8px 4px;
}

.hero-visual-caption strong {
  display: block;
  max-width: 410px;
  font-size: 1.03rem;
  line-height: 1.5;
}

.status-pill {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  border-radius: 999px;
  color: var(--success);
  background: var(--success-soft);
  font-size: 0.84rem;
  font-weight: 850;
  white-space: nowrap;
}

/* Intro / concept areas */
.intro-split,
.workflow-layout,
.page-hero-layout,
.builder-layout,
.viewer-layout,
.explore-header,
.workspace-grid {
  display: grid;
  gap: 42px;
  min-width: 0;
}

.intro-split {
  grid-template-columns: minmax(0, 1fr) 470px;
  align-items: end;
  margin-bottom: 48px;
}

.intro-split p {
  margin-bottom: 0;
  font-size: 1.05rem;
}

.concept-grid,
.mini-directory-grid,
.listing-grid,
.visual-story-grid {
  display: grid;
  gap: 26px;
  min-width: 0;
}

.concept-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.concept-card,
.directory-card,
.summary-card,
.workspace-card,
.empty-view-card {
  padding: 34px;
}

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

.concept-card::before {
  content: "";
  position: absolute;
  inset: auto -80px -80px auto;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(91, 150, 255, 0.14), transparent 70%);
}

.concept-index {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  margin-bottom: 22px;
  border-radius: 16px;
  color: var(--brand-strong);
  background: var(--brand-soft);
  font-weight: 900;
}

.concept-card ul {
  position: relative;
  z-index: 1;
  padding-left: 20px;
  margin-bottom: 22px;
}

.workflow-layout {
  grid-template-columns: minmax(0, 1fr) 480px;
  align-items: start;
}

.steps-card {
  padding: 16px 32px;
  list-style: none;
}

.steps-card li {
  display: grid;
  gap: 6px;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}

.steps-card li:last-child {
  border-bottom: 0;
}

.steps-card strong {
  font-size: 1.06rem;
}

.directory-preview-header,
.listing-top,
.section-title-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 32px;
}

.mini-directory-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.directory-card {
  display: grid;
  align-content: start;
  min-height: 250px;
}

.directory-card p {
  margin-bottom: 18px;
}

/* Visual storytelling */
.atlas-visual-section {
  padding-top: 36px;
}

.visual-story-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.visual-story-card {
  overflow: hidden;
  padding: 16px;
  border-radius: 34px;
}

.visual-story-card.visual-story-wide {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  align-items: center;
  gap: 28px;
}

.visual-story-copy {
  padding: 22px 14px 14px;
}

.visual-story-copy h3 {
  margin-bottom: 10px;
}

.visual-story-copy p {
  margin-bottom: 0;
}

/* Page hero / directories */
.page-hero {
  position: relative;
  padding: 102px 0 92px;
}

.page-hero-compact {
  padding-bottom: 72px;
}

.page-hero-layout {
  grid-template-columns: minmax(0, 1fr) 500px;
  align-items: center;
}

.page-visual-card {
  overflow: hidden;
  padding: 16px;
  border-radius: 34px;
}

.page-visual-copy {
  padding: 22px 10px 10px;
}

.summary-list {
  display: grid;
  gap: 12px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.summary-list li {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  color: var(--text-soft);
  background: var(--surface-2);
  font-weight: 730;
}

.filter-panel {
  display: grid;
  grid-template-columns: 300px 200px;
  gap: 14px;
}

.filter-panel label,
.explore-search-card label {
  display: grid;
  gap: 9px;
}

.filter-panel span,
.explore-search-card span,
.field > span,
.meta-grid span,
.note-box > span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 840;
  letter-spacing: 0.02em;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  color: var(--text);
  background: var(--input);
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

input,
select {
  min-height: 56px;
  padding: 0 16px;
}

textarea {
  min-height: 138px;
  padding: 16px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-soft);
  background: var(--surface);
}

.listing-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.listing-card {
  min-height: 350px;
  display: grid;
  align-content: start;
  gap: 18px;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 30px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.032), transparent 22%),
    var(--surface);
  box-shadow: var(--shadow-md);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.listing-card:hover {
  transform: translateY(-4px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-lg);
}

.listing-card-head {
  display: flex;
  align-items: center;
  gap: 16px;
}

.avatar {
  width: 60px;
  height: 60px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 21px;
  color: white;
  background: linear-gradient(135deg, var(--brand-deep), var(--cyan));
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  box-shadow: 0 18px 40px rgba(47, 114, 242, 0.22);
}

.avatar-large {
  width: 78px;
  height: 78px;
  border-radius: 26px;
  font-size: 1.18rem;
}

.listing-card h3 {
  margin-bottom: 4px;
}

.listing-card small,
.preview-path,
.viewer-path {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 760;
}

.listing-card p {
  margin-bottom: 0;
}

.listing-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.listing-meta span {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text-soft);
  background: var(--surface-2);
  font-size: 0.79rem;
  font-weight: 790;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: auto;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 36px;
  border: 1px dashed var(--line-strong);
  border-radius: 30px;
  color: var(--text-soft);
  background: var(--surface);
}

/* Explore */
.explore-header {
  grid-template-columns: minmax(0, 1fr) 480px;
  align-items: start;
}

.explore-search-card {
  padding: 26px;
}

.segmented-control {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 16px;
}

.segmented-control button {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text-soft);
  background: var(--surface);
  font-weight: 840;
}

.segmented-control button[aria-pressed="true"] {
  color: var(--brand-strong);
  background: var(--brand-soft);
}

.explore-visual {
  grid-column: 1 / -1;
  overflow: hidden;
  padding: 16px;
  margin: 6px 0 0;
  border-radius: 34px;
}

.explore-visual img {
  border: 1px solid var(--line);
  border-radius: 28px;
}

.explore-results {
  display: grid;
  gap: 96px;
}

/* Builders */
.builder-section,
.viewer-section {
  padding: 94px 0 126px;
}

.builder-layout {
  grid-template-columns: minmax(0, 1.22fr) 460px;
  align-items: start;
}

.form-card,
.preview-card,
.viewer-main,
.viewer-side {
  padding: 36px;
}

.builder-title h1 {
  max-width: 820px;
  font-size: clamp(2.7rem, 4.3vw, 4.55rem);
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
  margin-top: 34px;
}

.field {
  display: grid;
  gap: 10px;
}

.field-full {
  grid-column: 1 / -1;
}

.field small {
  min-height: 18px;
  color: var(--danger);
  font-size: 0.82rem;
  font-weight: 760;
}

.form-actions {
  margin-top: 30px;
}

.preview-card {
  position: sticky;
  top: 116px;
}

.preview-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 24px;
}

.space-preview,
.resource-preview-full {
  display: grid;
  gap: 22px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface-2);
}

.preview-identity,
.space-view-head {
  display: flex;
  align-items: center;
  gap: 18px;
}

.preview-identity h2,
.resource-preview-full h2 {
  margin-bottom: 4px;
  font-size: 1.8rem;
}

.preview-identity p,
.space-preview > p,
.resource-preview-full > p {
  margin-bottom: 0;
}

.preview-highlight,
.viewer-highlight {
  padding: 17px 19px;
  border: 1px solid var(--line);
  border-radius: 20px;
  color: var(--text-soft);
  background: var(--surface-3);
  font-weight: 760;
}

.compact-highlight {
  display: grid;
  gap: 4px;
}

/* Viewers */
.viewer-layout {
  grid-template-columns: minmax(0, 1fr) 390px;
  align-items: start;
}

.viewer-main h1 {
  max-width: 900px;
  font-size: clamp(2.85rem, 4.7vw, 5rem);
}

.viewer-description {
  max-width: 860px;
  margin: 30px 0 26px;
  font-size: 1.14rem;
}

.viewer-chips {
  margin-bottom: 24px;
}

.viewer-highlight {
  margin-bottom: 28px;
}

.viewer-side h2 {
  font-size: 1.9rem;
}

.viewer-resource-list,
.related-panel {
  display: grid;
  gap: 12px;
  margin-top: 22px;
}

.viewer-resource-item,
.related-space-card,
.workspace-row {
  display: grid;
  gap: 8px;
  padding: 19px;
  border: 1px solid var(--line);
  border-radius: 20px;
  color: var(--text-soft);
  background: var(--surface-2);
}

.viewer-resource-item strong,
.related-space-card strong,
.workspace-row strong {
  color: var(--text);
}

.viewer-resource-item a,
.related-space-card a,
.workspace-row a {
  color: var(--brand-strong);
  font-weight: 840;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.meta-grid div {
  padding: 19px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface-2);
}

.meta-grid span,
.note-box > span {
  display: block;
  margin-bottom: 8px;
}

.note-box {
  padding: 22px;
  margin-bottom: 30px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface-2);
}

.note-box p {
  margin-bottom: 0;
}

/* Workspace */
.workspace-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
}

.workspace-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.workspace-card:last-child {
  grid-column: 1 / -1;
}

.workspace-list,
.workspace-drafts {
  display: grid;
  gap: 14px;
}

.workspace-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.workspace-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mini-button,
.danger-button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text-soft);
  background: var(--surface);
  font-weight: 840;
}

.danger-button {
  color: var(--danger);
  background: var(--danger-soft);
}

.workspace-draft-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 19px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface-2);
}

.workspace-draft-row p {
  margin-bottom: 0;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.02), transparent 30%),
    var(--footer);
}

.footer-grid {
  min-height: 280px;
  display: grid;
  grid-template-columns: 1.45fr 0.85fr 0.95fr;
  align-items: center;
  gap: 46px;
}

.brand-lockup-footer .brand-text strong {
  font-size: 1.15rem;
}

.footer-brand p {
  max-width: 430px;
  margin-top: 18px;
  margin-bottom: 0;
}

.footer-links {
  display: grid;
  gap: 12px;
}

.footer-links a,
.footer-links span {
  color: var(--text-soft);
  font-weight: 770;
}

.footer-links a:hover {
  color: var(--brand-strong);
}

/* Toasts */
.toast-region {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 60;
  width: min(390px, calc(100vw - 48px));
  display: grid;
  gap: 12px;
}

.toast {
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 20px;
  color: var(--text);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  font-weight: 840;
}

.toast-success {
  border-color: rgba(116, 239, 186, 0.32);
}

.toast-error {
  border-color: rgba(255, 155, 170, 0.32);
}


.compact-row {
  margin-bottom: 24px;
}

.visual-frame-wide {
  min-width: 0;
}

/* Responsive */
@media (max-width: 1180px) {
  .hero-layout,
  .page-hero-layout,
  .builder-layout,
  .viewer-layout,
  .workflow-layout,
  .intro-split,
  .explore-header {
    grid-template-columns: 1fr;
  }

  .hero-visual,
  .page-visual-card,
  .preview-card {
    max-width: 840px;
  }

  .preview-card {
    position: static;
  }

  .listing-grid,
  .mini-directory-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workspace-grid,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .workspace-card:last-child {
    grid-column: auto;
  }
}

@media (max-width: 980px) {
  .site-header {
    position: static;
  }

  .header-grid {
    grid-template-columns: auto 1fr auto;
    gap: 16px;
  }

  .menu-toggle {
    display: block;
    justify-self: end;
    grid-column: 2;
    grid-row: 1;
  }

  .site-nav {
    position: absolute;
    top: 76px;
    left: 24px;
    right: 24px;
    display: none;
    justify-self: stretch;
    flex-direction: column;
    align-items: stretch;
    padding: 12px;
    border-radius: 24px;
    z-index: 50;
    background: var(--surface);
    box-shadow: var(--shadow-lg);
  }

  .site-nav[data-open="true"] {
    display: flex;
  }

  .site-nav a {
    justify-content: center;
  }

  .header-actions {
    grid-column: 3;
    grid-row: 1;
  }

  .theme-switcher span {
    display: none;
  }

  .theme-switcher {
    padding-left: 8px;
    padding-right: 8px;
  }

  .theme-switcher select {
    min-width: 116px;
  }

  .section,
  .hero-section,
  .page-hero,
  .builder-section,
  .viewer-section {
    padding-top: 82px;
    padding-bottom: 88px;
  }

  .concept-grid,
  .listing-grid,
  .mini-directory-grid,
  .workspace-grid,
  .meta-grid,
  .showcase-metrics {
    grid-template-columns: 1fr;
  }

  .filter-panel {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .listing-top,
  .directory-preview-header,
  .section-title-row,
  .showcase-top,
  .workspace-header,
  .hero-visual-caption,
  .preview-heading-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .visual-story-card.visual-story-wide {
    grid-template-columns: 1fr;
  }

  .workspace-row,
  .workspace-draft-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  :root,
  html[data-theme="night"],
  html[data-theme="dusk"],
  html[data-theme="light"] {
    --container: min(100vw - 28px, 1240px);
  }

  h1 {
    font-size: clamp(2.65rem, 11.5vw, 4.2rem);
  }

  h2 {
    font-size: clamp(1.9rem, 8.2vw, 2.9rem);
  }

  .lead {
    font-size: 1.04rem;
  }

  .header-grid {
    min-height: 80px;
  }

  .brand-text small {
    display: none;
  }

  .brand-icon {
    width: 42px;
    height: 42px;
  }

  .header-actions .button {
    display: none;
  }

  .theme-switcher select {
    min-width: 104px;
    width: 104px;
  }

  .hero-layout {
    gap: 40px;
  }

  .form-card,
  .preview-card,
  .viewer-main,
  .viewer-side,
  .concept-card,
  .directory-card,
  .summary-card,
  .workspace-card,
  .hero-visual,
  .page-visual-card,
  .empty-view-card {
    padding: 22px;
  }

  .visual-story-grid {
    grid-template-columns: 1fr;
  }

  .visual-story-card.visual-story-wide {
    grid-column: auto;
  }

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

  .field-full {
    grid-column: auto;
  }

  .action-row,
  .form-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .button,
  .button-secondary,
  .text-button {
    width: 100%;
  }

  .preview-identity,
  .space-view-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .footer-grid {
    min-height: auto;
    padding: 48px 0;
    gap: 30px;
  }

  .explore-visual,
  .visual-story-card {
    padding: 12px;
  }
}
