/* =========================================================
   arc: Modern 3D CAD Website Stylesheet
   Designed to match the arc CAD interface:
   Deep graphite surfaces, crisp hairlines, precision pill badges,
   matte contrast, and clean engineering typography.
   No pulsing lights, no glowing shadows, no neon halos.
   Optimized for mobile, tablet, and desktop viewports.
   ========================================================= */

:root {
  --bg-app: #12141a;
  --bg-surface: #171a22;
  --bg-surface-elevated: #1e222d;
  --bg-card: rgba(23, 26, 34, 0.88);
  --bg-panel: #161922;
  
  --line: #262c3a;
  --line-strong: #3b455c;
  --line-soft: rgba(255, 255, 255, 0.06);
  
  --ink: #dce4f2;
  --ink-bright: #ffffff;
  --ink-soft: #94a3b8;
  --ink-faint: #64748b;
  
  --accent: #00e8ff;
  --accent-hover: #53f0ff;
  --accent-ink: #00b8d8;
  --accent-soft: rgba(0, 232, 255, 0.08);

  --shadow: 0 16px 36px -12px rgba(0, 0, 0, 0.65);
  --shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.45);

  --kbd-bg: #1c202a;
  --kbd-border: #313a4d;
  --kbd-text: #dce4f2;

  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg-app: #0e1015;
    --bg-surface: #161922;
    --bg-surface-elevated: #1d212c;
    --bg-card: rgba(22, 25, 34, 0.92);
  }
}

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

html, body {
  overflow-x: hidden;
  width: 100%;
}

html {
  scroll-behavior: smooth;
  background-color: var(--bg-app);
}

body {
  margin: 0;
  background-color: var(--bg-app);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: var(--accent);
  color: #0b0e14;
}

.wrap {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
}

h1, h2, h3, h4 {
  margin: 0;
  color: var(--ink-bright);
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 140ms ease, text-decoration-color 140ms ease;
}
a:hover {
  color: var(--accent-hover);
}

.mono, code {
  font-family: var(--mono);
  font-size: 0.9em;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ---------------- header ---------------- */

header.site {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(18, 20, 26, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

header.site .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -0.02em;
  color: var(--ink-bright);
  text-decoration: none;
  flex-shrink: 0;
}

.brand img {
  display: block;
}

.brand .ver-badge {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--line);
  padding: 2px 7px;
  border-radius: 999px;
  margin-left: 2px;
}

nav.top {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

nav.top a {
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding: 7px 12px;
  border-radius: 6px;
  transition: all 120ms ease;
  display: inline-flex;
  align-items: center;
}

nav.top a:hover {
  color: var(--ink-bright);
  background: rgba(255, 255, 255, 0.06);
}

nav.top a.gh {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-bright);
  border: 1px solid var(--line);
  background: var(--bg-surface);
}
nav.top a.gh:hover {
  background: var(--bg-surface-elevated);
  border-color: var(--line-strong);
  color: #ffffff;
}

/* ---------------- hero & cad frame ---------------- */

main {
  padding-bottom: 60px;
}

.sheet {
  position: relative;
  margin-top: 36px;
  padding: 48px 44px;
  border: 1px solid var(--line);
  background: var(--bg-surface);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero {
  max-width: 720px;
}

h1 {
  font-family: var(--sans);
  font-weight: 800;
  font-size: clamp(2.4rem, 5vw, 3.8rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
  color: var(--ink-bright);
}

h1 .accent {
  color: var(--accent);
}

.tag {
  max-width: 62ch;
  margin: 22px 0 32px;
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink-soft);
}

.tag strong {
  color: var(--ink-bright);
}

.cta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
  padding: 13px 26px;
  border-radius: 10px;
  border: 1px solid transparent;
  transition: all 160ms ease;
  cursor: pointer;
  min-height: 46px;
}

.btn.primary {
  background: var(--accent);
  color: #0c1017;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.btn.primary:hover {
  background: var(--accent-hover);
  color: #06080c;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
  transform: translateY(-1px);
}

.btn.ghost {
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink-bright);
  border-color: var(--line-strong);
}

.btn.ghost:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--accent);
  color: #ffffff;
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(1px);
}

/* Title block (spec banner) */

.titleblock {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  background: rgba(18, 20, 26, 0.6);
  border-bottom-left-radius: 16px;
  border-bottom-right-radius: 16px;
}

.titleblock > div {
  padding: 16px 18px;
  border-right: 1px solid var(--line);
}

.titleblock > div:last-child {
  border-right: 0;
}

.titleblock em {
  display: block;
  font-family: var(--mono);
  font-style: normal;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 4px;
}

.titleblock b {
  font-family: var(--mono);
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink-bright);
}

/* ---------------- sections ---------------- */

section > .wrap {
  padding-top: 84px;
  padding-bottom: 84px;
  border-bottom: 1px solid var(--line);
}

section:last-of-type > .wrap {
  border-bottom: 0;
}

.progress {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--accent);
}

.progress i {
  flex: 1;
  border-top: 1px solid var(--line);
}

.progress span {
  opacity: 0.9;
}

.section-title {
  font-family: var(--sans);
  font-weight: 800;
  font-size: clamp(2rem, 3.8vw, 2.8rem);
  letter-spacing: -0.03em;
  line-height: 1.12;
  margin-top: 16px;
  color: var(--ink-bright);
}

.sect {
  max-width: 66ch;
  margin: 16px 0 0;
  color: var(--ink-soft);
  font-size: 17px;
  line-height: 1.65;
}

/* Features Grid (Sheet 02) */

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  margin-top: 44px;
}

.feature-card {
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px;
  transition: all 180ms ease;
  display: flex;
  flex-direction: column;
}

.feature-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

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

.feature-card .num {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
}

.feature-card h3 {
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink-bright);
  margin-bottom: 8px;
}

.feature-card p {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--ink-soft);
}

/* keysline */

.keysline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
  margin-top: 36px;
  padding: 16px 20px;
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 13.5px;
  color: var(--ink-soft);
}

.keysline span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

kbd {
  font-family: var(--mono);
  font-size: 0.85em;
  font-weight: 700;
  padding: 2px 7px;
  border: 1px solid var(--kbd-border);
  border-radius: 5px;
  background: var(--kbd-bg);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  color: var(--kbd-text);
  display: inline-block;
}

/* Architecture Chart */

.chart {
  margin-top: 44px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px minmax(0, 1.25fr) 140px minmax(0, 1fr);
  align-items: stretch;
}

.chart .box {
  border: 1px solid var(--line);
  background: var(--bg-surface);
  border-radius: 12px;
  padding: 22px 22px 24px;
  transition: all 180ms ease;
}

.chart .box.wide {
  border-color: var(--line-strong);
  background: var(--bg-surface-elevated);
  box-shadow: var(--shadow-sm);
}

.chart .box.ghosted {
  border-style: dashed;
}

.chart .box em {
  display: block;
  font-family: var(--mono);
  font-style: normal;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}

.chart .box b {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 15.5px;
  color: var(--ink-bright);
}

.chart .box p {
  margin: 10px 0 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-soft);
}

.chart .link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 0 8px;
  text-align: center;
}

.chart .link i {
  width: 0;
  border-left: 1px dashed var(--line-strong);
  flex: 1;
}

.chart .link em {
  font-family: var(--mono);
  font-style: normal;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--ink-faint);
  background: var(--bg-app);
  padding: 3px 6px;
  border-radius: 4px;
  writing-mode: vertical-rl;
  white-space: nowrap;
}

/* Listings / Code blocks */

.listing {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-surface);
  max-width: 100%;
}

.listing figcaption {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  background: rgba(18, 20, 26, 0.7);
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 8px;
}

.listing figcaption::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--line-strong);
}

.listing pre {
  margin: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.listing code {
  display: block;
  background: transparent;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.65;
  padding: 16px 20px 20px;
  white-space: pre;
  tab-size: 2;
}

.listing .k { color: #f2974c; font-weight: 600; }
.listing .fn { color: #53f0ff; }
.listing .str { color: #86efac; }
.listing .cmt, .listing .c { color: #64748b; font-style: italic; }

#plugins .listing {
  max-width: 680px;
  margin-top: 32px;
}

/* Quickstart / Code terminal blocks */

.section-subtitle {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 1.35rem;
  margin: 36px 0 12px;
  color: var(--ink-bright);
}

pre.code {
  margin: 18px 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-surface);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}

pre.code code {
  display: block;
  padding: 16px 20px;
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.68;
  color: var(--ink);
  white-space: pre;
}

pre.code .cmt, pre.code .c { color: #64748b; font-style: italic; }
pre.code .k { color: #f2974c; font-weight: 600; }
pre.code .fn { color: #53f0ff; }
pre.code .str { color: #86efac; }

/* ---------------- footer ---------------- */

footer.site {
  background: var(--bg-surface);
  border-top: 1px solid var(--line);
  margin-top: 40px;
}

footer.site .titleblock {
  border-top: 0;
  background: transparent;
}

footer.site .titleblock .widecell {
  grid-column: 1 / -1;
  border-top: 1px solid var(--line);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}

/* ---------------- responsive optimization ---------------- */

@media (max-width: 960px) {
  .titleblock, footer.site .titleblock {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .titleblock > *:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .titleblock > div:nth-child(even) { border-right: 0; }
  .titleblock > div:nth-child(5) { grid-column: 1 / -1; border-right: 0; }
  footer.site .titleblock .widecell { border-top: 1px solid var(--line); }
  .chart {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .chart .link {
    flex-direction: row;
    justify-content: center;
    padding: 6px 0;
  }
  .chart .link i {
    display: none;
  }
  .chart .link em {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 4px 14px;
    writing-mode: horizontal-tb;
    color: var(--accent);
    font-size: 11px;
  }
  section > .wrap {
    padding-top: 60px;
    padding-bottom: 60px;
  }
}

@media (max-width: 680px) {
  .wrap {
    padding: 0 16px;
  }
  header.site .wrap {
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    min-height: auto;
  }
  nav.top {
    display: flex;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 6px;
    margin: 0 -4px;
    padding: 2px 2px 4px;
  }
  nav.top::-webkit-scrollbar {
    display: none;
  }
  nav.top a {
    flex: 0 0 auto;
    white-space: nowrap;
    font-size: 11.5px;
    padding: 6px 10px;
  }
  .sheet {
    padding: 26px 18px 28px;
    margin-top: 16px;
    border-radius: 12px;
  }
  h1 {
    font-size: clamp(1.85rem, 7.5vw, 2.5rem);
    line-height: 1.12;
  }
  .tag {
    font-size: 15px;
    line-height: 1.6;
    margin: 16px 0 24px;
  }
  .cta {
    flex-direction: column;
    gap: 10px;
    width: 100%;
  }
  .btn {
    width: 100%;
    justify-content: center;
    min-height: 44px;
    padding: 12px 18px;
    font-size: 13.5px;
  }
  .titleblock {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .titleblock > div {
    padding: 10px 12px;
  }
  .titleblock em {
    font-size: 9px;
    margin-bottom: 2px;
  }
  .titleblock b {
    font-size: 11.5px;
  }
  section > .wrap {
    padding-top: 48px;
    padding-bottom: 48px;
  }
  .section-title {
    font-size: clamp(1.65rem, 6.5vw, 2.2rem);
    line-height: 1.15;
  }
  .sect {
    font-size: 15px;
    margin-top: 12px;
  }
  .features-grid {
    grid-template-columns: 1fr;
    gap: 14px;
    margin-top: 26px;
  }
  .feature-card {
    padding: 18px 16px;
    border-radius: 10px;
  }
  .feature-card h3 {
    font-size: 15px;
  }
  .feature-card p {
    font-size: 14px;
  }
  .keysline {
    margin-top: 24px;
    padding: 12px 14px;
    gap: 8px 12px;
    font-size: 12px;
    border-radius: 8px;
  }
  .chart {
    margin-top: 24px;
    gap: 8px;
  }
  .chart .box {
    padding: 16px 16px;
  }
  .chart .box b {
    font-size: 14.5px;
    white-space: normal;
    word-break: break-word;
  }
  .chart .box p {
    font-size: 13.5px;
    margin-top: 8px;
  }
  .listing {
    background: var(--bg-panel);
    border-radius: 8px;
  }
  .listing figcaption {
    padding: 8px 12px;
    font-size: 10.5px;
  }
  .listing code {
    padding: 12px 12px;
    font-size: 12px;
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: anywhere;
  }
  .section-subtitle {
    margin: 28px 0 10px;
    font-size: 1.2rem;
  }
  pre.code {
    margin: 14px 0;
    border-radius: 8px;
  }
  pre.code code {
    font-size: 12px;
    padding: 12px 14px;
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: anywhere;
  }
  footer.site {
    margin-top: 28px;
  }
  footer.site .titleblock {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  footer.site .titleblock > div {
    padding: 10px 12px;
  }
}

@media (max-width: 360px) {
  .wrap {
    padding: 0 12px;
  }
  .sheet {
    padding: 20px 14px 22px;
  }
  .titleblock {
    grid-template-columns: 1fr;
  }
  .titleblock > div {
    border-right: 0 !important;
    border-top: 1px solid var(--line);
  }
  .titleblock > div:first-child {
    border-top: 0;
  }
  footer.site .titleblock {
    grid-template-columns: 1fr;
  }
  footer.site .titleblock > div {
    border-right: 0 !important;
  }
}
