/* ============================================================
   Orbiqube Digital — Static site stylesheet
   Design language: digital editorial / interactive systems
   ============================================================ */

:root {
  --ivory: #f7f4ee;
  --paper: #fbf9f5;
  --ink: #16151a;
  --graphite: #3a3843;
  --violet: #5b2ee0;
  --violet-deep: #3f1eb0;
  --orange: #ff5a2d;
  --lime: #b6e23a;
  --line: rgba(22, 21, 26, 0.14);
  --line-strong: rgba(22, 21, 26, 0.28);
  --max-w: 1280px;
  --gutter: clamp(1.25rem, 4vw, 3.5rem);
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--font-sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; display: block; }

a { color: inherit; }

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

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--ink);
  color: var(--ivory);
  padding: 0.6rem 1rem;
  z-index: 200;
}
.skip-link:focus {
  left: 0.5rem;
  top: 0.5rem;
}

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

/* ---------- Wordmark / Logo ---------- */
.wordmark {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
}
.wm-orbi { color: var(--ink); }
.wm-qube { color: var(--violet); }
.wm-dot {
  width: 7px;
  height: 7px;
  background: var(--orange);
  display: inline-block;
  border-radius: 1px;
  transform: rotate(45deg);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(247, 244, 238, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  transition: padding 0.2s ease;
}
.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 1.1rem var(--gutter);
  display: flex;
  align-items: center;
  gap: 2rem;
  transition: padding 0.2s ease;
}
.site-header.is-compact .header-inner { padding-top: 0.6rem; padding-bottom: 0.6rem; }

.main-nav ul {
  display: flex;
  gap: 1.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.main-nav a {
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--graphite);
  position: relative;
  padding-bottom: 4px;
}
.main-nav a:hover { color: var(--violet); }

.header-cta { margin-left: auto; }

.menu-toggle {
  display: none;
  margin-left: auto;
  background: none;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  padding: 0.5rem;
  cursor: pointer;
}
.menu-toggle-box {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 20px;
}
.menu-line {
  height: 2px;
  background: var(--ink);
  display: block;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.menu-toggle[aria-expanded="true"] .menu-line:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-line:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] .menu-line:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.mobile-nav {
  border-top: 1px solid var(--line);
  padding: 1.25rem var(--gutter) 1.75rem;
  background: var(--paper);
}
.mobile-nav ul {
  list-style: none;
  margin: 0 0 1.25rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}
.mobile-nav a {
  text-decoration: none;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--ink);
  display: block;
  padding: 0.4rem 0;
}
.mobile-cta { display: inline-flex; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.8rem 1.5rem;
  border-radius: 3px;
  border: 1px solid transparent;
  cursor: pointer;
  min-height: 44px;
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.btn-primary {
  background: var(--violet);
  color: #fff;
}
.btn-primary:hover { background: var(--violet-deep); }
.btn-ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--ink);
}
.btn-ghost:hover { border-color: var(--ink); }
.btn-large { font-size: 1.1rem; padding: 1rem 2.2rem; }

/* ---------- Layout helpers ---------- */
.section {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: clamp(3.5rem, 8vw, 7rem) var(--gutter);
}
.section-label {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--violet);
  margin: 0 0 1rem;
}
.section-head h2 {
  font-size: clamp(1.8rem, 4vw, 2.75rem);
  line-height: 1.15;
  margin: 0 0 1.25rem;
  max-width: 42ch;
  font-weight: 700;
}
.section-intro {
  max-width: 56ch;
  font-size: 1.05rem;
  color: var(--graphite);
}

/* ---------- Hero ---------- */
.hero {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: clamp(2.5rem, 8vw, 5.5rem) var(--gutter) clamp(2rem, 6vw, 3rem);
}
.hero-grid {
  display: grid;
  grid-template-columns: 55% 45%;
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: center;
}
.hero-title {
  font-size: clamp(2.4rem, 6vw, 4.4rem);
  line-height: 1.05;
  margin: 0 0 1.25rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.hero-sub {
  font-size: clamp(1rem, 1.4vw, 1.15rem);
  color: var(--graphite);
  max-width: 52ch;
  margin: 0 0 1.25rem;
}
.hero-tagline {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--orange);
  margin: 0 0 2rem;
}
.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}
.hero-visual { position: relative; }
.orbit-svg { width: 100%; height: auto; }

.hero-coord {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--graphite);
  opacity: 0.55;
  margin-top: 1.5rem;
  border-top: 1px solid var(--line);
  padding-top: 0.75rem;
}

/* Orbit / cube animation */
.orbit-path {
  fill: none;
  stroke: var(--line-strong);
  stroke-width: 1;
}
.orbit-group { transform-origin: 240px 240px; }
.orbit-1 { animation: spin-slow 40s linear infinite; }
.orbit-2 { animation: spin-slow-rev 55s linear infinite; }
.orbit-3 { animation: spin-slow 70s linear infinite; }

.orbit-dot { fill: var(--orange); }
.dot-1 { offset-path: path("M 40,240 A 200,70 0 1 1 440,240 A 200,70 0 1 1 40,240"); animation: orbit-move 12s linear infinite; }
.dot-2 { fill: var(--violet); offset-path: path("M 80,40 A 160,200 0 1 1 400,40 A 160,200 0 1 1 80,40"); animation: orbit-move 16s linear infinite reverse; }
.dot-3 { fill: var(--lime); offset-path: path("M 20,240 A 220,140 0 1 1 460,240 A 220,140 0 1 1 20,240"); animation: orbit-move 22s linear infinite; }

@keyframes orbit-move { to { offset-distance: 100%; } }
@keyframes spin-slow { to { transform: rotate(360deg); } }
@keyframes spin-slow-rev { to { transform: rotate(-360deg); } }

.cube-group { animation: cube-sway 10s ease-in-out infinite; transform-origin: 260px 210px; }
@keyframes cube-sway {
  0%, 100% { transform: rotate(0deg) translateY(0); }
  50% { transform: rotate(2.5deg) translateY(-6px); }
}
.cube-face { fill: var(--paper); stroke: var(--ink); stroke-width: 1.5; }
.cube-front { fill: rgba(91,46,224,0.06); }
.cube-top { fill: rgba(255,90,45,0.1); }
.cube-side { fill: rgba(22,21,26,0.05); }
.cube-edge { stroke: var(--ink); stroke-width: 1.5; }

.node-label circle { fill: var(--orange); }
.node-label text {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  fill: var(--graphite);
}
.node-connector { stroke: var(--line-strong); stroke-dasharray: 3 4; }

@media (prefers-reduced-motion: reduce) {
  .orbit-1, .orbit-2, .orbit-3, .dot-1, .dot-2, .dot-3, .cube-group {
    animation: none !important;
  }
}

/* ---------- Solutions ---------- */
.solutions-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1.25rem;
  margin-top: 2.5rem;
}
.solution {
  border: 1px solid var(--line);
  padding: 1.75rem;
  background: var(--paper);
  position: relative;
}
.solution-index {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--violet);
  margin: 0 0 0.75rem;
}
.solution h3 { margin: 0 0 0.6rem; font-size: 1.3rem; }
.solution p:last-child { margin: 0; color: var(--graphite); font-size: 0.98rem; }
.solution-visual { margin-bottom: 1rem; max-width: 180px; }

.solution-a { grid-column: 1 / 5; }
.solution-b { grid-column: 5 / 7; }
.solution-c { grid-column: 1 / 3; }
.solution-d { grid-column: 3 / 7; }

.frame { fill: var(--paper); stroke: var(--line-strong); stroke-width: 1.5; }
.frame-1 { fill: rgba(91,46,224,0.06); stroke: var(--violet); }
.frame-dot { fill: var(--orange); }

.config-panel { fill: none; stroke: var(--line-strong); }
.config-line { stroke: var(--line-strong); stroke-width: 2; }
.config-knob { fill: var(--violet); }
.config-shape { fill: rgba(255,90,45,0.12); stroke: var(--orange); stroke-width: 1.5; }

.spatial-grid line { stroke: var(--line); }
.spatial-cell { fill: var(--paper); stroke: var(--line-strong); }
.spatial-cell.active { fill: rgba(91,46,224,0.15); stroke: var(--violet); }

.data-link { stroke: var(--line-strong); stroke-width: 1.5; }
.data-node { fill: var(--paper); stroke: var(--ink); stroke-width: 1.5; }
.data-node-main { fill: var(--orange); stroke: var(--orange); }

/* ---------- Interaction demo ---------- */
.demo-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  color: var(--graphite);
  border: 1px solid var(--line-strong);
  padding: 0.35rem 0.75rem;
  margin-bottom: 2rem;
}
.demo-panel {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 2rem;
  border: 1px solid var(--line);
  background: var(--paper);
  padding: clamp(1.5rem, 3vw, 2.5rem);
}
.demo-controls fieldset {
  border: none;
  padding: 0;
  margin: 0 0 1.75rem;
}
.demo-controls legend {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--graphite);
  margin-bottom: 0.75rem;
  padding: 0;
}
.demo-btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.demo-opt {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.6rem 1rem;
  min-height: 44px;
  border: 1px solid var(--line-strong);
  background: var(--ivory);
  color: var(--ink);
  cursor: pointer;
  border-radius: 3px;
}
.demo-opt[aria-pressed="true"] {
  background: var(--violet);
  border-color: var(--violet);
  color: #fff;
}
.demo-visual {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  justify-content: center;
}
.demo-svg { width: 100%; height: auto; background: var(--ivory); border: 1px solid var(--line); }
.demo-layer { fill: rgba(91,46,224,0.12); stroke: var(--violet); stroke-width: 1.5; transition: fill 0.3s ease, opacity 0.3s ease; }
.demo-node { fill: var(--orange); transition: fill 0.3s ease, r 0.3s ease; }
.demo-readout-label {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  letter-spacing: 0.05em;
  color: var(--violet);
  margin: 0;
}
.demo-readout-desc { margin: 0.5rem 0; color: var(--graphite); }
.demo-readout-priority {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  color: var(--orange);
  margin: 0;
}

/* ---------- Process timeline ---------- */
.timeline {
  list-style: none;
  margin: 2.5rem 0 0;
  padding: 0;
  border-top: 1px solid var(--line);
}
.timeline-item {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 1.5rem;
  padding: 1.75rem 0;
  border-bottom: 1px solid var(--line);
}
.timeline-num {
  font-family: var(--font-mono);
  font-size: 1.6rem;
  color: var(--violet);
  font-weight: 700;
}
.timeline-body h3 { margin: 0 0 0.5rem; font-size: 1.25rem; }
.timeline-body p { margin: 0; color: var(--graphite); max-width: 60ch; }

/* ---------- System diagram ---------- */
.system-diagram {
  position: relative;
  max-width: 640px;
  margin: 2.5rem auto 0;
}
.system-line { stroke: var(--line-strong); stroke-width: 1; }
.system-node { fill: var(--paper); stroke: var(--violet); stroke-width: 2; }
.system-svg { width: 100%; }
.system-labels {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-top: 2rem;
}
.system-label { text-align: center; }
.sl-name {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  color: var(--orange);
  margin: 0 0 0.35rem;
}
.sl-desc { margin: 0; color: var(--graphite); font-size: 0.95rem; }
.system-note {
  max-width: 50ch;
  margin: 2.5rem auto 0;
  text-align: center;
  font-size: 1.1rem;
  color: var(--graphite);
}

/* ---------- Capabilities matrix ---------- */
.matrix {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line);
  margin-top: 2rem;
}
.matrix span {
  padding: 1rem 1.1rem;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 0.92rem;
  font-family: var(--font-mono);
}
.matrix span:nth-child(4n) { border-right: none; }
.capabilities-note {
  margin-top: 1.25rem;
  font-size: 0.9rem;
  color: var(--graphite);
}

/* ---------- About ---------- */
.about-body {
  display: grid;
  gap: 1.25rem;
  max-width: 70ch;
  font-size: 1.05rem;
  color: var(--graphite);
  margin-top: 2rem;
}
.about-body h2 {
  color: var(--ink);
  font-size: 1.3rem;
  margin: 0.5rem 0 0;
}

/* ---------- Privacy page ---------- */
.section-head-title {
  font-size: clamp(1.8rem, 4vw, 2.75rem);
  margin: 0 0 1.25rem;
  font-weight: 700;
}
.back-link {
  margin-top: 2.5rem;
}
.back-link a {
  text-decoration: underline;
  font-weight: 600;
}

/* ---------- Contact ---------- */
.contact {
  text-align: center;
  border-top: 1px solid var(--line);
}
.contact-headline {
  font-size: clamp(1.9rem, 5vw, 3.2rem);
  max-width: 30ch;
  margin: 0 auto 1.25rem;
  font-weight: 800;
  line-height: 1.1;
}
.contact-sub {
  max-width: 55ch;
  margin: 0 auto 2rem;
  color: var(--graphite);
  font-size: 1.05rem;
}
.contact-email { margin-top: 1.5rem; }
.contact-email a { text-decoration: underline; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--paper);
  padding: 3rem var(--gutter) 2rem;
}
.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1.4fr 1fr;
  gap: 2rem;
  font-size: 0.92rem;
  color: var(--graphite);
}
.footer-wordmark { margin: 0 0 0.5rem; }
.footer-brand p { margin: 0; }
.footer-legal p { margin: 0 0 0.5rem; }
.footer-legal a { text-decoration: underline; }
.footer-links a { text-decoration: underline; }
.footer-copy {
  max-width: var(--max-w);
  margin: 2rem auto 0;
  font-size: 0.8rem;
  color: var(--graphite);
  opacity: 0.8;
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 1024px) {
  .solutions-grid { grid-template-columns: repeat(2, 1fr); }
  .solution-a, .solution-b, .solution-c, .solution-d { grid-column: auto; }
  .matrix { grid-template-columns: repeat(2, 1fr); }
  .matrix span:nth-child(4n) { border-right: 1px solid var(--line); }
  .matrix span:nth-child(2n) { border-right: none; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-links { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
  .main-nav, .header-cta { display: none; }
  .menu-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { order: -1; max-width: 380px; margin: 0 auto; }
  .demo-panel { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .solutions-grid { grid-template-columns: 1fr; }
  .matrix { grid-template-columns: 1fr; }
  .matrix span { border-right: none !important; }
  .timeline-item { grid-template-columns: 1fr; gap: 0.5rem; }
  .system-labels { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; gap: 1.75rem; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn { width: 100%; }
}

@media (max-width: 380px) {
  .demo-btn-group { flex-direction: column; }
  .demo-opt { width: 100%; }
}
