:root {
  --bg: #0b0f1a;
  --panel: #121a2b;
  --panel-soft: rgba(18, 26, 43, 0.75);
  --text: #ecf2ff;
  --muted: #a7b4d1;
  --accent: #7c9cff;
  --accent-2: #8affd4;
  --border: #273250;
  --bg-grad: radial-gradient(circle at top, #16213a 0%, #0b0f1a 45%);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; scroll-behavior: smooth; }
html { scrollbar-gutter: stable; }
body {
  font-family: Inter, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, sans-serif;
  background: var(--bg-grad);
  color: var(--text);
  line-height: 1.6;
  transition: background 220ms ease, color 220ms ease;
  overflow-y: scroll;
}

.container { width: min(1080px, 92%); margin: 0 auto; }
.row { display: flex; align-items: center; justify-content: space-between; }

.topbar {
  position: sticky; top: 0;
  z-index: 1000;
  backdrop-filter: blur(10px);
  background: rgba(11, 15, 26, 0.75);
  border-bottom: 1px solid var(--border);
}
.topbar .brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  letter-spacing: 0.2px;
  padding: 12px 0;
  text-decoration: none;
}

.brand-mark {
  font-size: 1rem;
  filter: drop-shadow(0 0 8px rgba(122, 157, 255, 0.45));
}

.brand-word {
  font-family: "Orbitron", Inter, sans-serif;
  font-size: 1rem;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  background: linear-gradient(120deg, #c7d8ff 0%, #8affd4 45%, #87a7ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.top-actions {
  display: flex;
  align-items: center;
}

.topbar nav a {
  color: var(--muted); text-decoration: none; margin-left: 16px; font-size: 0.95rem;
}
.topbar nav a:hover { color: var(--text); }

.topbar nav a.active {
  color: var(--text);
  border-bottom: 1px solid var(--accent);
  padding-bottom: 2px;
}

.topbar .brand:hover .brand-word {
  filter: brightness(1.12);
}

.theme-switch,
.lang-switch {
  position: relative;
  margin-left: 10px;
}

.theme-toggle,
.lang-toggle {
  border: none;
  background: transparent;
  color: var(--muted);
  border-radius: 8px;
  padding: 4px 6px;
  font-size: 0.9rem;
  cursor: pointer;
}

.theme-toggle:hover,
.lang-toggle:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.theme-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 170px;
  background: rgba(9, 14, 24, 0.96);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px;
  display: none;
  z-index: 10;
}

.theme-menu.open {
  display: grid;
  gap: 4px;
}

.theme-btn {
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  border-radius: 8px;
  padding: 7px 8px;
  font-size: 0.82rem;
  text-align: left;
  cursor: pointer;
}

.theme-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.theme-btn.active {
  color: #0b1222;
  background: #9fb6ff;
  border-color: transparent;
  font-weight: 700;
}

.lang-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: min(340px, 92vw);
  background: rgba(9, 14, 24, 0.96);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px;
  display: none;
  z-index: 10;
}

.lang-menu.open {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}

.lang-btn {
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 0.8rem;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.lang-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.lang-btn.active {
  color: #0b1222;
  background: #9fb6ff;
  border-color: transparent;
  font-weight: 700;
}

.lang-state {
  margin-left: 6px;
  font-size: 0.66rem;
  border: 1px solid #4a5c83;
  border-radius: 999px;
  padding: 1px 6px;
  color: #98add9;
}

.lang-state.full {
  border-color: #3d8c69;
  color: #b9f5db;
}

.hero { padding: 88px 0 44px; }
.eyebrow { color: var(--accent-2); margin: 0 0 8px; font-weight: 700; }
h1 { font-size: clamp(2rem, 5vw, 4rem); margin: 0 0 14px; line-height: 1.1; }
.lead { color: var(--muted); max-width: 720px; margin-bottom: 24px; }

.cta-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn {
  border: 1px solid var(--border);
  cursor: pointer;
  color: var(--text);
  text-decoration: none;
  padding: 10px 14px;
  border-radius: 10px;
  display: inline-block;
  background: transparent;
}
.btn.primary {
  background: linear-gradient(135deg, var(--accent), #5d7cff);
  border-color: transparent;
}

.page-section { display: none; }

.section { padding: 38px 0; scroll-margin-top: 84px; }
.section h2 { margin: 0 0 10px; }
.section p { color: var(--muted); }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.card {
  background: var(--panel-soft);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
}
.card h3 { margin-top: 0; margin-bottom: 6px; }

.status.done {
  border-color: #2a5d52;
  background: rgba(20, 42, 37, 0.55);
}

.status.wip {
  border-color: #5f4e2a;
  background: rgba(48, 39, 21, 0.55);
}

.live-slot {
  margin-top: 14px;
  padding: 14px;
  border: 1px dashed #34507f;
  border-radius: 12px;
  background: color-mix(in srgb, var(--panel-soft) 70%, transparent);
}

.live-slot .label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #97aee3;
  margin-bottom: 4px;
}

.chip {
  font-size: 0.75rem;
  border: 1px solid #4869a8;
  border-radius: 999px;
  padding: 2px 8px;
  margin-left: 8px;
  color: #b8cbf3;
}

.chip.live {
  border-color: #3d8c69;
  color: #b9f5db;
}

.live-slot a {
  color: #c9d9ff;
}

.hint {
  font-size: 0.9rem;
}

.board-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.board-note {
  margin-top: 0;
  margin-bottom: 14px;
  font-size: 0.92rem;
}

.board-shell {
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: var(--panel-soft);
  margin-bottom: 14px;
}

.board-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 10px;
  border-bottom: 1px solid var(--border);
}

.board-tab-btn {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  border-radius: 9px;
  padding: 6px 10px;
  font-size: 0.82rem;
  cursor: pointer;
}

.board-tab-btn.active {
  color: #0b1222;
  background: #9fb6ff;
  border-color: transparent;
  font-weight: 700;
}

.board-frame {
  width: 100%;
  height: min(68vh, 640px);
  border: 0;
  background: #0d1324;
}

.board-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 14px;
}

.board-feed {
  display: grid;
  gap: 10px;
}

.post-card {
  background: var(--panel-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
}

.post-card h3 {
  margin-top: 0;
  margin-bottom: 8px;
  font-size: 1rem;
}

.post-meta {
  font-size: 0.85rem;
  color: var(--muted);
}

.board-side {
  display: grid;
  gap: 10px;
  align-content: start;
}

.side-card {
  background: var(--panel-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
}

.side-card h4 {
  margin: 0 0 8px;
}

.side-card button {
  width: 100%;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #202b45;
  color: #9bb0de;
}

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

.tags span {
  font-size: 0.85rem;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 10px;
}

.checklist {
  margin: 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 8px;
  color: var(--muted);
}

.checklist code {
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 6px;
}

.text-link {
  color: #c9d9ff;
  text-decoration: none;
  border-bottom: 1px dashed #5f79ad;
}

.text-link:hover {
  color: #ecf2ff;
  border-bottom-color: #9ab3e6;
}

.footer {
  margin-top: 40px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
}
.footer .container { padding: 20px 0 40px; }

@media (max-width: 860px) {
  .topbar nav { display: none; }
  .board-layout { grid-template-columns: 1fr; }
  .board-frame { height: 58vh; }
}


body[data-theme="atelier"] {
  --bg: #f6efe6;
  --text: #261b14;
  --muted: #6f5f52;
  --border: #dbc8b2;
  --accent: #c87e42;
  --accent-2: #8f5cff;
  --panel-soft: rgba(255, 247, 238, 0.84);
  --bg-grad: radial-gradient(circle at top, #fff7ec 0%, #f4eadc 48%, #efe0cd 100%);
}

body[data-theme="atelier"] .topbar {
  background: rgba(251, 241, 228, 0.9);
}

body[data-theme="atelier"] .btn.primary {
  background: linear-gradient(135deg, #c87e42, #b96634);
  color: #fff6ef;
}

body[data-theme="atelier"] .status.done {
  border-color: #8b6a4d;
  background: rgba(219, 198, 171, 0.45);
}

body[data-theme="atelier"] .chip.live {
  border-color: #7f6be6;
  color: #5e46d4;
}

body[data-theme="atelier"] .brand-word {
  background: linear-gradient(120deg, #7f57e8 0%, #c97a3f 52%, #5745b3 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

body[data-theme="atelier"] .eyebrow {
  color: #6d46d6;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.45);
}

body[data-theme="atelier"] .lead,
body[data-theme="atelier"] .section p,
body[data-theme="atelier"] .post-meta,
body[data-theme="atelier"] .hint,
body[data-theme="atelier"] .lang-state {
  color: #5f5247;
}

body[data-theme="atelier"] .theme-toggle,
body[data-theme="atelier"] .lang-toggle {
  color: #6f5f52;
}

body[data-theme="atelier"] .theme-toggle:hover,
body[data-theme="atelier"] .lang-toggle:hover {
  color: #2f241c;
  background: rgba(122, 93, 63, 0.14);
}

body[data-theme="atelier"] .theme-menu,
body[data-theme="atelier"] .lang-menu {
  background: rgba(255, 246, 236, 0.94);
  border-color: #d8c2a9;
  box-shadow: 0 10px 24px rgba(78, 48, 22, 0.14);
}

body[data-theme="atelier"] .theme-btn,
body[data-theme="atelier"] .lang-btn {
  color: #5f5247;
}

body[data-theme="atelier"] .theme-btn:hover,
body[data-theme="atelier"] .lang-btn:hover {
  background: rgba(194, 146, 95, 0.16);
  color: #2b2017;
}

body[data-theme="atelier"] .theme-btn.active,
body[data-theme="atelier"] .lang-btn.active {
  background: #c87e42;
  color: #fff8f2;
}

body[data-theme="atelier"] .live-slot a,
body[data-theme="atelier"] .text-link {
  color: #3e2f22;
  border-bottom-color: #a67a52;
}

body[data-theme="atelier"] .live-slot a:hover,
body[data-theme="atelier"] .text-link:hover {
  color: #20160f;
  border-bottom-color: #7d5a3a;
}


body[data-theme="atelier"] .board-shell {
  background: rgba(255, 247, 237, 0.92);
}

body[data-theme="atelier"] .board-tab-btn {
  color: #5f5247;
  background: rgba(122, 93, 63, 0.08);
}

body[data-theme="atelier"] .board-tab-btn.active {
  background: #c87e42;
  color: #fff8f2;
}

.main-nav .community-link {
  color: #d6e4ff;
}

.main-nav .community-link::after {
  content: '•';
  margin-left: 6px;
  font-size: 0.78rem;
  color: rgba(124, 156, 255, 0.75);
}

.main-nav .community-link.active::after {
  color: var(--accent-2);
}

.progress-log {
  margin-top: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel-soft);
  padding: 14px;
}

.progress-log h3 {
  margin: 0 0 10px;
  font-size: 0.98rem;
}

.progress-log ul {
  margin: 0;
  padding-left: 1rem;
  display: grid;
  gap: 8px;
  color: var(--muted);
}

.embed-help {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 0.88rem;
}

.ops-visual {
  margin-top: 8px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel-soft);
  padding: 12px 14px;
}

.ops-visual h3 {
  margin: 0 0 8px;
}

.ops-visual .flow {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.ops-visual .flow > div {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  font-weight: 700;
}

.ops-visual .flow > div span {
  display: block;
  margin-top: 6px;
  font-weight: 400;
  color: var(--muted);
  font-size: 0.88rem;
}

body[data-theme="atelier"] .main-nav .community-link {
  color: #473628;
}

body[data-theme="atelier"] .main-nav .community-link::after {
  color: rgba(185, 130, 76, 0.8);
}

body[data-theme="atelier"] .progress-log,
body[data-theme="atelier"] .ops-visual {
  background: rgba(255, 247, 237, 0.92);
}

@media (max-width: 860px) {
  .ops-visual .flow {
    grid-template-columns: 1fr;
  }
}


.deploy-intro {
  margin-top: 0;
  margin-bottom: 14px;
  font-size: 0.95rem;
}

.ops-note {
  margin-top: 0;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.9rem;
}

#deploy {
  margin-top: 10px;
}

#contact {
  margin-top: 14px;
}


body[data-theme="atelier"] .deploy-intro,
body[data-theme="atelier"] .ops-note {
  color: #5f5247;
}


.community-board {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel-soft);
  overflow: hidden;
}

.community-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px;
  border-bottom: 1px solid var(--border);
}

.board-table-wrap {
  overflow-x: auto;
}

.board-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.board-table th,
.board-table td {
  border-bottom: 1px solid var(--border);
  padding: 10px 12px;
  text-align: left;
}

.board-table th {
  color: var(--muted);
  font-weight: 700;
}

.board-table tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

.row-link {
  color: inherit;
  text-decoration: none;
}

.row-link:hover {
  text-decoration: underline;
}

body[data-theme="atelier"] .community-board {
  background: rgba(255, 247, 237, 0.92);
}

body[data-theme="atelier"] .board-table tr:hover td {
  background: rgba(160, 118, 73, 0.1);
}


/* Keep layout stable when switching to community/deploy views */
main {
  min-height: calc(100vh - 150px);
}

.page-section {
  min-height: calc(100vh - 210px);
}

.community-board {
  min-height: 460px;
}


.community-header {
  text-align: center;
  margin-bottom: 10px;
}

.community-header h2 {
  margin-bottom: 8px;
}

.api-link {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.api-link:hover { text-decoration: underline; }

.community-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.community-count {
  margin: 0;
  color: var(--muted);
}

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

.board-table td:last-child,
.board-table th:last-child {
  text-align: center;
}

body[data-theme="atelier"] .api-link {
  color: #915329;
}

@media (max-width: 860px) {
  .community-toolbar {
    align-items: stretch;
    gap: 8px;
    flex-direction: column;
  }
}


/* Community board redesign (reference-driven) */
.community-shell {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: color-mix(in srgb, var(--panel-soft) 92%, transparent);
  padding: 24px;
}

.community-header {
  text-align: center;
  margin-bottom: 18px;
}

.community-header h2 {
  margin: 0 0 10px;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
}

.api-link {
  color: #5c7cff;
  font-weight: 700;
  text-decoration: none;
}

.community-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.community-count {
  margin: 0;
  color: var(--muted);
}

.write-btn {
  background: linear-gradient(135deg, #6a74ff, #7f63ff);
  border-color: transparent;
  font-weight: 700;
}

.board-table-wrap {
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}

.board-table {
  width: 100%;
  border-collapse: collapse;
}

.board-table thead th {
  background: #1e2d48;
  color: #dce8ff;
  font-size: 0.92rem;
  border-bottom: 1px solid #38527f;
}

.board-table th,
.board-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

.board-table tbody tr:hover td {
  background: rgba(255,255,255,0.03);
}

.row-link {
  color: inherit;
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
}

.row-link:hover { text-decoration: underline; }

.comment-badge {
  display: inline-flex;
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  border-radius: 999px;
  align-items: center;
  justify-content: center;
  background: #6b72ff;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
}

body[data-theme="atelier"] .community-shell {
  background: rgba(255, 247, 237, 0.97);
}

body[data-theme="atelier"] .board-table thead th {
  background: #ccb494;
  color: #2e2219;
  border-bottom-color: #b59d7f;
}

body[data-theme="atelier"] .board-table tbody tr:hover td {
  background: rgba(160, 118, 73, 0.11);
}

body[data-theme="atelier"] .api-link {
  color: #8f5428;
}

body[data-theme="atelier"] .comment-badge {
  background: #be7a42;
}

@media (max-width: 860px) {
  .community-shell { padding: 14px; }
  .community-toolbar { flex-direction: column; align-items: stretch; gap: 8px; }
  .board-table th,
  .board-table td { padding: 10px 8px; font-size: 0.86rem; }
}


.hidden { display: none !important; }

.community-panel {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
  background: color-mix(in srgb, var(--panel-soft) 92%, transparent);
}

.community-form label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.88rem;
}

.community-form input,
.community-form textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  color: var(--text);
  background: rgba(255,255,255,0.02);
  margin-bottom: 10px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

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

.comment-mini-list {
  display: grid;
  gap: 8px;
}

.comment-mini {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  background: rgba(255,255,255,0.02);
}

.comment-mini p { margin: 6px 0 0; }

@media (max-width: 860px) {
  .form-grid { grid-template-columns: 1fr; }
}

.write-btn.active {
  filter: brightness(1.18);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.24) inset;
}


.detail-content {
  white-space: pre-wrap;
  line-height: 1.7;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

button { cursor: pointer; }


.board-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 12px;
}

.comment-form {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}


.card-link {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.card-link:hover {
  transform: translateY(-2px);
}

.labs-details {
  margin-top: 18px;
  display: grid;
  gap: 12px;
}

.lab-detail {
  scroll-margin-top: 92px;
}

.lab-detail h3 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.detail-arrow {
  text-decoration: none;
  font-size: 1.1rem;
  opacity: 0.85;
}

.detail-arrow:hover {
  opacity: 1;
}


.section-arrow {
  margin-left: 8px;
  text-decoration: none;
  font-size: 0.95em;
  opacity: 0.85;
}

.section-arrow:hover { opacity: 1; }

.cta-row .btn {
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.cta-row .btn:hover {
  transform: translateY(-2px);
}
