@import url("/external/sng-design/css/shared.css");

:root {
  --font-ui: "Avenir Next", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-display: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", "Times New Roman", serif;
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --radius-lg: 18px;
  --radius-md: 12px;

  --bg: #f3f7ff;
  --bg-top: #f9fbff;
  --bg-grad-a: #dbe8ff80;
  --bg-grad-b: #dcf7e77a;
  --orb-a: #2563eb2d;
  --orb-b: #22c55e29;

  --ink: #0b1220;
  --ink-soft: #2e3d59;
  --muted: #5a6887;
  --surface: #ffffff;
  --surface-soft: #eef4ff;
  --surface-raise: #f7faff;
  --border: #d7e1f4;
  --shadow: 0 24px 48px #1f2b4522;

  --header-bg: #fffffff2;
  --logo-frame-bg: transparent;

  --nav-link: #243250;
  --nav-hover-bg: #ecf3ff;
  --nav-hover-border: #cddaf4;
  --nav-active-bg: #2563eb14;
  --nav-active-border: #2563eb4a;
  --nav-active-text: #1f56cf;

  --link: #1f56cf;
  --link-hover: #1a4bb3;

  --btn-bg: #eef3ff;
  --btn-border: #cdd7ec;
  --btn-text: #1f2f4f;
  --btn-bg-hover: #e2ebff;
  --btn-primary-bg: #2563eb;
  --btn-primary-bg-hover: #1f56cf;
  --btn-primary-border: #4d83ef;
  --btn-primary-text: #ffffff;

  --pill-bg: #eef4ff;
  --pill-border: #cfe0fb;

  --panel-alert-bg: #fff6ea;
  --panel-alert-border: #ffd8b3;
  --panel-alert-text: #68431d;

  --footer-bg: #ffffff;
  --footer-ink: #0b1220;
  --footer-border: #d7e1f4;
  --footer-title: #1f2f4f;
  --footer-text: #5a6887;
  --footer-link: #1f56cf;
  --footer-divider: #e3ebfb;
  --footer-bottom: #7785a3;
}

html[data-theme="dark"] {
  color-scheme: dark;

  --bg: #0d1422;
  --bg-top: #0b1220;
  --bg-grad-a: #23407a66;
  --bg-grad-b: #1f6a4859;
  --orb-a: #2563eb26;
  --orb-b: #22c55e1c;

  --ink: #e7efff;
  --ink-soft: #c4d3f0;
  --muted: #9fb0d1;
  --surface: #121c2d;
  --surface-soft: #172338;
  --surface-raise: #162132;
  --border: #2a3a55;
  --shadow: 0 24px 48px #00000055;

  --header-bg: #101a2be6;
  --logo-frame-bg: #0f1a2b;

  --nav-link: #d3e0fa;
  --nav-hover-bg: #1a2a43;
  --nav-hover-border: #34507c;
  --nav-active-bg: #2563eb2b;
  --nav-active-border: #4d7fdc;
  --nav-active-text: #9ec2ff;

  --link: #8db6ff;
  --link-hover: #b2ceff;

  --btn-bg: #1b2b44;
  --btn-border: #35507d;
  --btn-text: #d8e8ff;
  --btn-bg-hover: #223655;
  --btn-primary-bg: #2d6df0;
  --btn-primary-bg-hover: #3f7df9;
  --btn-primary-border: #5d93ff;
  --btn-primary-text: #ffffff;

  --pill-bg: #1c2d49;
  --pill-border: #35507d;

  --panel-alert-bg: #3c2d1d;
  --panel-alert-border: #735533;
  --panel-alert-text: #ffd9ad;

  --footer-bg: #0a111c;
  --footer-ink: #e7efff;
  --footer-border: #22324f;
  --footer-title: #d6e2ff;
  --footer-text: #8fa5cb;
  --footer-link: #8db6ff;
  --footer-divider: #22324f;
  --footer-bottom: #7489b0;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  min-height: 100%;
}

body {
  font-family: var(--font-ui);
  color: var(--ink);
  line-height: 1.55;
  background:
    radial-gradient(circle at 8% 0%, var(--bg-grad-a) 0, #0000 45%),
    radial-gradient(circle at 95% 12%, var(--bg-grad-b) 0, #0000 48%),
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg) 100%);
}

.bg-orb {
  position: fixed;
  border-radius: 999px;
  filter: blur(18px);
  pointer-events: none;
  z-index: -1;
  animation: orb-diagonal 22s linear infinite;
}

.bg-orb-a {
  width: 280px;
  height: 280px;
  right: -90px;
  top: 110px;
  background: var(--orb-a);
  animation-duration: 20s;
}

.bg-orb-b {
  width: 240px;
  height: 240px;
  left: -80px;
  bottom: 80px;
  background: var(--orb-b);
  animation-duration: 28s;
  animation-delay: -10s;
}

.site-shell {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 12px 12px 0;
  display: flex;
  flex-direction: column;
}

.site-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  background: var(--header-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 10px 14px;
  margin-bottom: 10px;
  box-shadow: 0 8px 24px #1c284208;
  backdrop-filter: blur(6px);
}

.logo-link {
  display: inline-flex;
  align-items: center;
}

.logo-frame {
  display: block;
  width: min(360px, 40vw);
  border-radius: 10px;
  background: var(--logo-frame-bg);
  padding: 0;
}

.logo-image {
  display: block;
  width: 100%;
  height: auto;
}

.logo-dark {
  display: none;
}

html[data-theme="dark"] .logo-light {
  display: none;
}

html[data-theme="dark"] .logo-dark {
  display: block;
}

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

.main-nav {
  justify-self: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.nav-link {
  text-decoration: none;
  color: var(--nav-link);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 11px;
  border-radius: 9px;
  border: 1px solid transparent;
  transition: all 140ms var(--ease-out);
}

.nav-link:hover {
  background: var(--nav-hover-bg);
  border-color: var(--nav-hover-border);
}

.nav-link.active {
  background: var(--nav-active-bg);
  border-color: var(--nav-active-border);
  color: var(--nav-active-text);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--btn-border);
  background: var(--btn-bg);
  color: var(--btn-text);
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 700;
  padding: 0 10px;
  cursor: pointer;
  transition: all 140ms var(--ease-out);
}

.theme-toggle:hover {
  background: var(--btn-bg-hover);
}

.theme-toggle-indicator {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: #f8b84e;
  box-shadow: inset 0 0 0 1px #00000018;
}

html[data-theme="dark"] .theme-toggle-indicator {
  background: #7ec0ff;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border: 1px solid var(--btn-border);
  background: var(--btn-bg);
  color: var(--btn-text);
  border-radius: 10px;
  padding: 0 14px;
  height: 38px;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 140ms var(--ease-out);
}

.btn:hover {
  transform: translateY(-1px);
  background: var(--btn-bg-hover);
}

.btn-primary,
.btn.primary {
  background: var(--btn-primary-bg);
  border-color: var(--btn-primary-border);
  color: var(--btn-primary-text);
}

.btn-primary:hover,
.btn.primary:hover {
  background: var(--btn-primary-bg-hover);
}

.btn-secondary,
.btn.outline {
  background: var(--btn-bg);
  border-color: var(--btn-border);
  color: var(--btn-text);
}

.btn-danger {
  background: #b53f4a;
  border-color: #dc6570;
  color: #ffffff;
}

.btn-danger:hover {
  background: #ca4c58;
}

.btn-compact {
  height: 34px;
}

.page-main {
  display: grid;
  gap: 14px;
  flex: 1;
  margin-bottom: 10px;
}

.hero {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 12px;
}

.hero-copy,
.hero-panel,
.panel,
.page-intro,
.article {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.hero-copy,
.page-intro,
.article,
.panel {
  padding: 18px;
}

.hero-panel {
  padding: 16px;
}

.eyebrow {
  margin: 0;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--link);
  font-weight: 700;
}

h1 {
  margin: 8px 0 0;
  font-family: var(--font-display);
  font-size: clamp(30px, 4.2vw, 48px);
  line-height: 1.05;
}

h2 {
  margin: 0;
  font-size: 21px;
}

h3 {
  margin: 0;
  font-size: 18px;
}

p {
  margin: 10px 0 0;
  color: var(--ink-soft);
}

code {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 6px;
}

.hero-actions {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.inline-link {
  display: inline-block;
  margin-top: 12px;
  color: var(--link);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.inline-link:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.check-list {
  margin: 12px 0 0;
  padding-left: 18px;
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

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

.flash-list li {
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--panel-alert-bg);
  border: 1px solid var(--panel-alert-border);
  color: var(--panel-alert-text);
  font-size: 13px;
}

.post-list {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}

.post-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  overflow: hidden;
}

.post-card .body {
  padding: 14px;
}

.post-card h3 a {
  color: var(--ink);
  text-decoration: none;
}

.post-card h3 a:hover {
  color: var(--link);
}

.post-meta {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.form-group {
  margin-top: 12px;
  display: grid;
  gap: 6px;
}

.form-group label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.form-control,
input[type="password"],
input[type="text"],
select,
textarea {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 13px;
  padding: 10px 11px;
  box-sizing: border-box;
}

.form-control:focus,
input[type="password"]:focus,
input[type="text"]:focus,
select:focus,
textarea:focus {
  outline: 2px solid #0000;
  border-color: var(--btn-primary-border);
  box-shadow: 0 0 0 3px #2563eb26;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  margin-top: 12px;
}

th,
td {
  border: 1px solid var(--border);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--surface-soft);
}

tr:nth-child(even) td {
  background: var(--surface-raise);
}

.inline-form {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-right: 8px;
}

.article.prose h1 {
  margin-top: 0;
}

.article.prose h2 {
  margin-top: 18px;
}

.article.prose figure {
  margin: 14px 0;
}

.article.prose img,
.article.prose video {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
}

.preview {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  padding: 12px;
  border-radius: 12px;
}

.align-left {
  float: left;
  margin: 0 1em 1em 0;
}

.align-right {
  float: right;
  margin: 0 0 1em 1em;
}

.align-center {
  display: table;
  margin: 0 auto 1em;
}

.size-small img,
.size-small video {
  max-width: 200px;
}

.size-medium img,
.size-medium video {
  max-width: 400px;
}

.size-large img,
.size-large video {
  max-width: 100%;
}

.img-desc {
  font-size: 0.85em;
  text-align: left;
  display: block;
  margin-top: 0.3em;
  color: var(--muted);
}

.preview .align-left,
.preview .align-right {
  float: none;
  display: block;
  margin: 0 0 1em 0;
}

.preview .align-left {
  margin-right: auto;
}

.preview .align-right {
  margin-left: auto;
}

.preview .align-center {
  display: table;
  margin: 0 auto 1em;
}

.editor-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}

.editor-side {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.editor-panel {
  border: 1px solid var(--border);
  background: var(--surface-soft);
  border-radius: 12px;
  padding: 10px;
  min-height: 260px;
  max-height: 70vh;
  overflow-y: auto;
}

.preview-panel {
  overflow-y: auto;
  max-height: 70vh;
}

.editor-block {
  background: var(--surface);
  padding: 15px 20px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  margin-bottom: 12px;
  border: 1px solid var(--border);
}

.editor-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.editor-block-header .left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.editor-block-header .title {
  font-weight: bold;
  font-size: 1rem;
  cursor: pointer;
}

.arrow-icon {
  font-size: 1.2rem;
  transition: transform 0.2s ease;
  user-select: none;
  cursor: pointer;
}

.arrow-icon.expanded {
  transform: rotate(90deg);
}

.icon-button {
  border: 1px solid var(--btn-border);
  color: var(--btn-text);
  border-radius: 6px;
  padding: 0.2em 0.5em;
  cursor: pointer;
  font-size: 1rem;
  margin-left: 10px;
  user-select: none;
  background: var(--btn-bg);
}

.icon-button.btn-primary {
  background: var(--btn-primary-bg);
  color: #fff;
  border-color: var(--btn-primary-bg);
}

.icon-button.btn-danger {
  background: var(--danger, #b53f4a);
  color: #fff;
  border-color: var(--danger, #b53f4a);
}

.drag-handle {
  cursor: grab;
}

.properties-panel {
  background: var(--surface);
  color: var(--ink);
  padding: 15px;
  margin-top: 10px;
  border-radius: 8px;
  display: none;
  flex-direction: column;
  gap: 10px;
  border: 1px solid var(--border);
}

.properties-panel.show {
  display: flex;
}

.properties-panel input,
.properties-panel textarea,
.properties-panel select {
  background: var(--surface-soft);
  color: var(--ink);
  border: 1px solid var(--border);
  padding: 10px;
  font-size: 1rem;
  border-radius: 6px;
}

.properties-panel .preview-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.properties-panel .preview-thumb {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.component-type {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.component-type button {
  flex: 1;
  min-width: 110px;
}

.placeholder-block {
  height: 60px;
  border: 2px dashed var(--border);
  border-radius: 10px;
  background: var(--surface-alt, var(--surface-soft));
  margin: 6px 0;
}

.dragging {
  opacity: 0.4;
}

blockquote {
  border-left: 4px solid var(--border);
  margin: 0 0 1em;
  padding-left: 1em;
  font-style: italic;
}

pre {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  overflow-x: auto;
}

.site-footer {
  background: var(--footer-bg);
  border: 1px solid var(--footer-border);
  border-radius: var(--radius-lg);
  padding: 14px;
  color: var(--footer-ink);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.7fr 0.7fr;
  gap: 12px;
}

.footer-title {
  margin: 0;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--footer-title);
  font-weight: 700;
}

.footer-text {
  margin: 9px 0 0;
  color: var(--footer-text);
  font-size: 12px;
}

.footer-text.small {
  font-size: 11px;
}

.footer-grid a {
  display: block;
  margin-top: 8px;
  color: var(--footer-link);
  text-decoration: none;
  font-size: 13px;
}

.footer-grid a:hover {
  text-decoration: underline;
}

.footer-logo-link {
  display: block;
  margin-top: 12px;
  text-decoration: none;
  max-width: 320px;
}

.footer-logo-frame {
  display: block;
  width: 100%;
  border-radius: 10px;
  overflow: hidden;
}

.footer-logo {
  display: block;
  width: 100%;
  height: auto;
}

.footer-logo-dark {
  display: none;
}

html[data-theme="dark"] .footer-logo-light {
  display: none;
}

html[data-theme="dark"] .footer-logo-dark {
  display: block;
}

.version {
  font-weight: 700;
}

.reveal {
  opacity: 0;
  transform: translateY(14px) scale(0.99);
  transition:
    opacity 220ms var(--ease-out),
    transform 220ms var(--ease-out);
}

.reveal.in-view {
  opacity: 1;
  transform: translateY(0) scale(1);
}

@keyframes orb-diagonal {
  0% {
    transform: translate3d(0, 0, 0);
  }
  100% {
    transform: translate3d(-220px, 220px, 0);
  }
}

@media (max-width: 1080px) {
  .site-header {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .main-nav {
    justify-self: start;
  }

  .hero,
  .grid-2,
  .editor-wrapper,
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 840px) {
  .site-shell {
    padding: 8px;
  }

  .logo-frame {
    width: min(360px, 72vw);
  }

  .main-nav {
    overflow-x: auto;
    width: 100%;
    padding-bottom: 2px;
  }

  .main-nav .nav-link {
    white-space: nowrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bg-orb {
    animation: none;
  }

  .reveal {
    transition: none;
  }
}
