/* ============================================================
   webinar.moscow — Industrial Terminal override
   Base: HTML5 UP Dimension (CCA 3.0)
   Restrained charcoal + single amber accent
   ============================================================ */

:root {
  --bg: #0a0a0b;
  --panel: #121416;
  --panel-2: #181b1e;
  --border: #2a2e33;
  --accent: #d4a017;          /* single primary accent: amber */
  --accent-dim: rgba(212, 160, 23, 0.35);
  --text: #e8e6e1;            /* off-white */
  --muted: #8a9099;           /* muted gray secondary */
  --mono: "IBM Plex Mono", "Courier New", Courier, monospace;
}

html {
  box-sizing: border-box;
  overflow-x: hidden;
  max-width: 100%;
}
*, *:before, *:after {
  box-sizing: inherit;
}

html, body, input, select, textarea, button {
  font-family: var(--mono) !important;
}

body {
  background: var(--bg) !important;
  color: var(--text) !important;
  letter-spacing: 0.02em;
  overflow-x: hidden;
  max-width: 100%;
}

body, input, select, textarea {
  color: var(--text) !important;
}

a {
  color: var(--accent) !important;
  border-bottom-color: var(--accent-dim) !important;
}
a:hover {
  color: var(--text) !important;
  border-bottom-color: transparent !important;
}

/* ---- Background: deep charcoal, no stock photo ---- */
#bg {
  background:
    radial-gradient(ellipse at 50% 28%, rgba(40, 36, 24, 0.35) 0%, transparent 55%),
    linear-gradient(180deg, #070708 0%, #0c0c0e 50%, #060607 100%) !important;
  background-size: auto !important;
  background-position: center !important;
  opacity: 1 !important;
  filter: none !important;
  transform: none !important;
}

#bg:before,
#bg:after {
  display: none !important;
}

/* Soft scanlines (subtle, not neon CRT soup) */
#scanlines,
#noise {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 2;
}

#scanlines {
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgba(0, 0, 0, 0.12) 3px,
    rgba(0, 0, 0, 0.12) 4px
  );
  opacity: 0.28;
  mix-blend-mode: multiply;
}

#noise {
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

#wrapper {
  position: relative;
  z-index: 3;
  overflow-x: hidden;
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
}

/* ---- Zero-scroll hub ---- */
html, body {
  height: 100%;
  overflow: hidden;
}

body.is-article-visible {
  overflow: hidden;
}

#wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 1.5rem;
  box-sizing: border-box;
}

body.is-article-visible #wrapper {
  overflow: hidden;
}

#main {
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
}

#main article {
  overflow-x: hidden;
  overflow-y: auto;
  max-height: calc(100vh - 3rem);
  max-height: calc(100dvh - 3rem);
  max-width: 100% !important;
  width: min(40rem, 100%) !important;
  box-sizing: border-box !important;
}

/* ---- Kill Dimension decorative vertical connectors ---- */
#header > *:before,
#header > *:after,
#header nav.use-middle:after {
  display: none !important;
  content: none !important;
  background: none !important;
  width: 0 !important;
  height: 0 !important;
}

/* ---- Header / console block ---- */
#header {
  max-width: 52rem;
  width: 100%;
  box-sizing: border-box;
}

#header .logo.terminal-logo {
  background: transparent !important;
  border: 1px solid var(--accent) !important;
  border-radius: 0 !important;
  box-shadow: none;
  width: 3.25rem !important;
  height: 3.25rem !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem !important;
}

#header .logo .tally-dot {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-dim);
  animation: tally-pulse 1.8s ease-in-out infinite;
}

@keyframes tally-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

#header .content {
  border-style: solid !important;
  border-color: var(--border) !important;
  border-top-width: 1px !important;
  border-bottom-width: 1px !important;
  border-left-width: 0 !important;
  border-right-width: 0 !important;
  background: rgba(18, 20, 22, 0.88);
  box-shadow: none;
  position: relative;
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
}

/* no corner ticks / pseudo-chrome */
#header .content::before,
#header .content::after {
  content: none !important;
  display: none !important;
}

#header .content .inner {
  max-width: 42rem !important;
  width: 100%;
  padding: 2rem 1.25rem !important;
  box-sizing: border-box;
}

.sys-status {
  font-size: 0.72rem !important;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 0 0 0.65rem !important;
  color: var(--muted) !important;
  line-height: 1.7 !important;
}
.sys-status .ok { color: var(--accent) !important; }
.sys-status .dim { color: var(--muted) !important; }
.sys-status .sep { color: var(--border); margin: 0 0.35rem; }

.term-id {
  font-size: 0.7rem !important;
  letter-spacing: 0.16em;
  color: var(--accent) !important;
  margin: 0 0 1.1rem !important;
  text-transform: uppercase;
}

#header h1 {
  font-family: var(--mono) !important;
  font-size: clamp(1.1rem, 3.4vw, 1.75rem) !important;
  font-weight: 700 !important;
  letter-spacing: 0.06em !important;
  text-transform: uppercase;
  color: var(--text) !important;
  margin: 0 0 0.85rem !important;
  line-height: 1.3 !important;
  text-shadow: none;
  animation: none !important;
}

#header .sub {
  font-size: 0.85rem !important;
  line-height: 1.55 !important;
  color: var(--muted) !important;
  margin: 0 !important;
  max-width: 36rem;
  text-transform: none !important;
  letter-spacing: 0.02em !important;
}

/* Nav as terminal buttons */
#header nav {
  margin-top: 0 !important;
  border-top: 0 !important;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

#header nav ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  border: none !important;
  border-radius: 0 !important;
  margin: 1.25rem 0 0 !important;
  padding: 0 !important;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

#header nav ul li {
  border: none !important;
  padding: 0 !important;
  display: block !important;
}

#header nav ul li a {
  display: inline-block;
  font-family: var(--mono) !important;
  font-size: 0.72rem !important;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text) !important;
  border: 1px solid var(--border) !important;
  border-bottom-color: var(--border) !important;
  background: var(--panel-2);
  padding: 0.7rem 0.95rem !important;
  min-width: 0;
  line-height: 1.2;
  box-shadow: none;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  box-sizing: border-box;
}

#header nav ul li a:hover {
  background: rgba(212, 160, 23, 0.1) !important;
  border-color: var(--accent) !important;
  color: var(--accent) !important;
  box-shadow: none;
}

/* ---- Articles (modal panels) ---- */
#main {
  background: transparent !important;
}

#main article {
  background: var(--panel) !important;
  border: 1px solid var(--border) !important;
  border-radius: 0 !important;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
  /* keep Dimension-like top room for close; avoid custom title chrome */
  padding: 3.5rem 1.75rem 2rem !important;
}

/* no ASCII / pseudo-window frame */
#main article::before,
#main article::after {
  content: none !important;
  display: none !important;
}

#main article h2.major {
  font-family: var(--mono) !important;
  font-size: clamp(0.9rem, 2.6vw, 1.2rem) !important;
  font-weight: 700 !important;
  letter-spacing: 0.04em;
  text-transform: none;
  color: var(--accent) !important;
  border-bottom: 1px solid var(--border) !important;
  padding-bottom: 0.85rem !important;
  margin: 0 2.5rem 0.85rem 0 !important; /* leave room for close */
  line-height: 1.35 !important;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}

#main article h2.major:after {
  display: none !important;
}

.article-sub {
  color: var(--muted) !important;
  font-size: 0.9rem !important;
  margin: 0 0 1.5rem !important;
  line-height: 1.5 !important;
  text-transform: none !important;
  letter-spacing: 0.02em !important;
}

/*
  Close button: DO NOT override Dimension's original .close.
  Stock uses :before with circular hit area + SVG X.
  Only tint the SVG stroke to match palette if needed via filter —
  but leave structure/position/sizes alone.
*/
#main article .close {
  /* revert any prior custom chrome — restore Dimension defaults */
  background-color: transparent !important;
  background-image: none !important;
  border: 0 !important;
  border-radius: 0 !important;
  color: transparent !important;
  width: 4rem !important;
  height: 4rem !important;
  top: 0 !important;
  right: 0 !important;
  text-indent: 4rem !important;
  overflow: hidden !important;
  white-space: nowrap !important;
}
#main article .close:before {
  /* restore Dimension circle + SVG close */
  content: '' !important;
  display: block !important;
  position: absolute !important;
  top: 0.75rem !important;
  left: 0.75rem !important;
  width: 2.5rem !important;
  height: 2.5rem !important;
  border-radius: 100% !important;
  background-color: transparent !important;
  background-position: center !important;
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' width='20px' height='20px' viewBox='0 0 20 20' zoomAndPan='disable'%3E%3Cstyle%3Eline %7B stroke: %23e8e6e1%3B stroke-width: 1%3B %7D%3C/style%3E%3Cline x1='2' y1='2' x2='18' y2='18' /%3E%3Cline x1='18' y1='2' x2='2' y2='18' /%3E%3C/svg%3E") !important;
  background-size: 20px 20px !important;
  background-repeat: no-repeat !important;
}
#main article .close:after {
  content: none !important;
  display: none !important;
}
#main article .close:hover:before {
  background-color: rgba(255, 255, 255, 0.075) !important;
}
#main article .close:active:before {
  background-color: rgba(255, 255, 255, 0.175) !important;
}

/* Modules in SIGNAL */
.module-grid {
  display: grid;
  gap: 0.85rem;
  width: 100%;
  max-width: 100%;
}
.module {
  border: 1px solid var(--border);
  background: var(--panel-2);
  padding: 1rem 1.1rem;
  position: relative;
  box-sizing: border-box;
  max-width: 100%;
}
.module .mod-id {
  position: absolute;
  top: 0.75rem;
  right: 0.9rem;
  font-size: 0.7rem;
  color: var(--accent);
  letter-spacing: 0.15em;
  margin: 0;
}
.module h3 {
  font-family: var(--mono) !important;
  font-size: 0.85rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text) !important;
  margin: 0 2rem 0.45rem 0 !important;
  border: none !important;
  padding: 0 !important;
}
.module h3:before,
.module h3:after { display: none !important; }
.module p {
  margin: 0 !important;
  font-size: 0.82rem !important;
  color: var(--muted) !important;
  line-height: 1.5 !important;
  text-transform: none !important;
  letter-spacing: 0.02em !important;
}

/* Presets */
.preset-list {
  display: grid;
  gap: 1rem;
  margin-bottom: 1.5rem;
  width: 100%;
  max-width: 100%;
}
.preset {
  border: 1px solid var(--border);
  background: var(--panel-2);
  padding: 1.15rem 1.15rem 1.25rem;
  box-sizing: border-box;
  max-width: 100%;
}
.preset.recommended {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent-dim);
}
.preset-id {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin: 0 0 0.35rem;
}
.preset-id .badge {
  color: var(--text);
  margin-left: 0.35rem;
}
.preset h3 {
  font-family: var(--mono) !important;
  font-size: 0.95rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text) !important;
  margin: 0 0 0.55rem !important;
  border: none !important;
  padding: 0 !important;
  overflow-wrap: anywhere;
}
.preset h3 .alias {
  color: var(--muted);
  font-weight: 500;
}
.preset .purpose {
  font-size: 0.82rem !important;
  color: var(--muted) !important;
  margin: 0 0 0.75rem !important;
  line-height: 1.5 !important;
  text-transform: none !important;
  letter-spacing: 0.02em !important;
}
.preset .spec {
  list-style: none;
  padding: 0;
  margin: 0;
  border-top: 1px dashed var(--border);
  padding-top: 0.65rem;
}
.preset .spec li {
  font-size: 0.72rem;
  color: var(--text);
  letter-spacing: 0.03em;
  padding: 0.2rem 0;
  border: none !important;
  overflow-wrap: anywhere;
}
.preset .spec li::before {
  content: "> ";
  color: var(--accent);
}

/* Format tags */
.payload-tags {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  max-width: 100%;
}
.payload-tags li {
  border: 1px solid var(--border) !important;
  background: var(--panel-2);
  color: var(--text);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.65rem 0.85rem !important;
  margin: 0 !important;
  box-sizing: border-box;
  max-width: 100%;
  overflow-wrap: anywhere;
}

/* Connect */
.packet {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
  border: 1px solid var(--border);
  background: var(--panel-2);
  max-width: 100%;
  box-sizing: border-box;
}
.packet li {
  font-size: 0.8rem;
  color: var(--text);
  letter-spacing: 0.06em;
  padding: 0.75rem 1rem !important;
  border-bottom: 1px solid var(--border) !important;
  margin: 0 !important;
  overflow-wrap: anywhere;
}
.packet li:last-child { border-bottom: none !important; }
.packet li::before {
  content: "→ ";
  color: var(--accent);
}

.connect-meta {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.35rem 1rem;
  margin: 0 0 1.5rem;
  font-size: 0.85rem;
  max-width: 100%;
}
.connect-meta dt {
  color: var(--accent);
  letter-spacing: 0.12em;
  font-size: 0.7rem;
}
.connect-meta dd {
  margin: 0;
  color: var(--text);
  overflow-wrap: anywhere;
}
.connect-meta a {
  color: var(--accent) !important;
  border-bottom: 1px dashed var(--accent-dim) !important;
}

/* Buttons */
.button,
.button.primary,
ul.actions li a.button {
  font-family: var(--mono) !important;
  font-size: 0.72rem !important;
  font-weight: 600 !important;
  letter-spacing: 0.08em !important;
  text-transform: uppercase !important;
  border-radius: 0 !important;
  border: 1px solid var(--accent) !important;
  color: #0a0a0b !important;
  background: var(--accent) !important;
  box-shadow: none;
  padding: 0.85rem 1.15rem !important;
  height: auto !important;
  line-height: 1.3 !important;
  max-width: 100%;
  white-space: normal;
  text-align: center;
  box-sizing: border-box;
}
.button:hover,
.button.primary:hover {
  background: var(--text) !important;
  border-color: var(--text) !important;
  color: #0a0a0b !important;
}

ul.actions {
  margin-top: 0.5rem !important;
  max-width: 100%;
}
ul.actions li {
  max-width: 100%;
}

/* Footer */
#footer {
  margin-top: 1.5rem !important;
  width: 100%;
  max-width: 52rem;
  box-sizing: border-box;
  padding: 0 0.25rem;
}
#footer .copyright {
  font-size: 0.65rem !important;
  letter-spacing: 0.06em;
  color: var(--muted) !important;
  border: none !important;
  margin: 0 !important;
  opacity: 0.85;
  overflow-wrap: anywhere;
}
#footer .copyright a {
  color: var(--muted) !important;
  border-bottom: 1px dotted var(--border) !important;
}
#footer .copyright:before,
#footer .copyright:after {
  display: none !important;
}

/* ---- Responsive / mobile overflow guard ---- */
@media screen and (max-width: 736px) {
  html, body {
    overflow-x: hidden;
    overflow-y: auto;
  }
  #wrapper {
    justify-content: flex-start;
    padding: 1rem 0.75rem 2rem;
    min-height: 100vh;
    width: 100%;
    max-width: 100%;
  }
  #header,
  #header .content,
  #header .content .inner,
  #header nav,
  #header nav ul {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  #header .content .inner {
    padding: 1.35rem 1rem !important;
  }
  #header nav ul {
    flex-direction: column;
  }
  #header nav ul li {
    width: 100%;
  }
  #header nav ul li a {
    display: block;
    text-align: center;
    width: 100%;
  }
  #main {
    width: 100%;
    max-width: 100%;
    padding: 0;
  }
  #main article {
    width: 100% !important;
    max-width: 100% !important;
    padding: 3rem 1rem 1.5rem !important;
    max-height: calc(100vh - 1.5rem);
    max-height: calc(100dvh - 1.5rem);
    margin: 0 !important;
  }
  #main article h2.major {
    margin-right: 2.25rem !important;
    font-size: 0.9rem !important;
  }
  #main article .close {
    width: 3.5rem !important;
    height: 3.5rem !important;
  }
  #main article .close:before {
    top: 0.7rem !important;
    left: 0.7rem !important;
    width: 2.1rem !important;
    height: 2.1rem !important;
    background-size: 14px 14px !important;
  }
  .sys-status {
    font-size: 0.62rem !important;
  }
  .sys-status .sep { display: none; }
  .sys-status span { display: inline-block; margin-right: 0.4rem; }
  .connect-meta {
    grid-template-columns: 1fr;
  }
  .button,
  .button.primary,
  ul.actions li a.button {
    display: block;
    width: 100%;
  }
}

@media screen and (max-width: 480px) {
  #wrapper {
    padding: 0.75rem 0.5rem 1.5rem;
  }
  #main article {
    padding: 2.75rem 0.85rem 1.25rem !important;
  }
  #header .content .inner {
    padding: 1.15rem 0.75rem !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  #header .logo .tally-dot {
    animation: none !important;
  }
}
