/* ============================================================
   ARXIDUC SYSTEMS — design system
   Off-white · deep charcoal · muted blue · steel · warm bronze
   ============================================================ */

:root {
  --bg:        #F7F6F2;
  --bg-tint:   #EFEDE7;
  --ink:       #17191D;
  --ink-soft:  #4A4F57;
  --ink-faint: #8A8F98;
  --charcoal:  #101216;
  --charcoal-2:#16191F;
  --blue:      #5E7A96;
  --blue-soft: #8DA2B8;
  --steel:     #9AA3AE;
  --bronze:    #A9835A;
  --bronze-soft:#C4A57F;
  --line:      rgba(23, 25, 29, 0.10);
  --line-dark: rgba(247, 246, 242, 0.10);

  --font: "Inter", -apple-system, "Segoe UI", sans-serif;

  --w-max: 1160px;
  --w-narrow: 720px;
  --pad: clamp(20px, 5vw, 64px);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }

::selection { background: var(--bronze); color: #fff; }

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--ink); color: var(--bg);
  padding: 10px 18px; z-index: 100;
}
.skip-link:focus { left: 12px; top: 12px; }

/* ---------- layout ---------- */

.wrap {
  max-width: var(--w-max);
  margin: 0 auto;
  padding-left: var(--pad);
  padding-right: var(--pad);
}
.wrap.narrow { max-width: var(--w-narrow); }
.wrap.center { text-align: center; }

.grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(32px, 6vw, 96px);
  align-items: start;
}

.section { padding: clamp(96px, 14vh, 180px) 0; }
.section-tint { background: var(--bg-tint); }

.section-dark {
  background: var(--charcoal);
  color: #E9E8E3;
}
.section-dark h2 { color: #F4F3EE; }
.section-dark .kicker { color: var(--bronze-soft); }

/* ---------- typography ---------- */

h1, h2, h3 {
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.08;
  text-wrap: balance;
}

h1 { font-size: clamp(2.6rem, 6.5vw, 4.6rem); }
h2 { font-size: clamp(1.9rem, 4vw, 3rem); margin-bottom: 0.5em; }
h3 { font-size: 1.15rem; letter-spacing: -0.01em; line-height: 1.3; }

h1 em {
  font-style: normal;
  color: var(--blue);
}

.kicker {
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bronze);
  margin-bottom: 1.4em;
}

.lead {
  font-size: clamp(1.15rem, 2vw, 1.4rem);
  line-height: 1.45;
  letter-spacing: -0.01em;
  color: var(--ink);
  font-weight: 500;
}
.section-dark .lead { color: #E9E8E3; }

.section-body > * + * { margin-top: 1.4em; }
.section-body { color: var(--ink-soft); }
.section-body .lead { color: var(--ink); }

.section-intro {
  color: inherit;
  opacity: 0.7;
  max-width: 46ch;
  margin-bottom: 3rem;
}

.statement {
  font-size: clamp(1.4rem, 2.6vw, 1.9rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--ink);
  padding-top: 0.6em;
}

.quiet-list {
  list-style: none;
  border-top: 1px solid var(--line);
}
.quiet-list li {
  padding: 1em 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-weight: 500;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-block;
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-decoration: none;
  padding: 14px 30px;
  border-radius: 3px;
  transition: background 0.35s var(--ease), color 0.35s var(--ease),
              transform 0.35s var(--ease);
}
.btn-primary {
  background: var(--ink);
  color: var(--bg);
}
.section-dark .btn-primary,
.story .btn-primary {
  background: var(--bg);
  color: var(--ink);
}
.btn-primary:hover { background: var(--bronze); color: #fff; transform: translateY(-1px); }
.btn-lg { padding: 17px 40px; font-size: 1rem; }

/* ---------- navigation ---------- */

.site-nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px var(--pad);
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease),
              background 0.4s var(--ease);
}
.site-nav.visible {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
.site-nav.on-light {
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.site-nav.on-dark {
  background: color-mix(in srgb, var(--charcoal) 72%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-dark);
}

.nav-logo img { height: 34px; width: auto; }
.site-nav .logo-dark  { display: none; }
.site-nav .logo-light { display: block; }
.site-nav.on-dark .logo-dark  { display: block; }
.site-nav.on-dark .logo-light { display: none; }

.nav-links { display: flex; gap: 32px; }
.nav-links a {
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--ink-soft);
  transition: color 0.25s var(--ease);
}
.site-nav.on-dark .nav-links a { color: rgba(233, 232, 227, 0.75); }
.nav-links a:hover { color: var(--bronze); }

.nav-right {
  display: flex;
  align-items: center;
  gap: 22px;
}

.lang-switch {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
}
.lang-switch button {
  background: none;
  border: none;
  cursor: pointer;
  font: inherit;
  font-weight: 500;
  padding: 4px 3px;
  color: var(--ink-soft);
  opacity: 0.55;
  transition: opacity 0.25s var(--ease), color 0.25s var(--ease);
}
.site-nav.on-dark .lang-switch button { color: rgba(233, 232, 227, 0.85); }
.lang-switch button:hover { opacity: 0.9; }
.lang-switch button.active { opacity: 1; color: var(--bronze); }
.site-nav.on-dark .lang-switch button.active { color: var(--bronze-soft); }
.lang-switch span { opacity: 0.3; color: inherit; }
.site-nav.on-dark .lang-switch span { color: rgba(233, 232, 227, 0.6); }

.btn-nav {
  padding: 9px 20px;
  font-size: 0.85rem;
  background: var(--ink);
  color: var(--bg);
}
.site-nav.on-dark .btn-nav { background: var(--bg); color: var(--ink); }
.btn-nav:hover { background: var(--bronze); color: #fff; }

/* ---------- opening scroll story ---------- */

.story {
  position: relative;
  height: 640vh;
  background: var(--charcoal);
}

.story-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
}

#storyCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.story-caption {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 var(--pad);
  opacity: 0;
  pointer-events: none;
}

.cap-line {
  font-size: clamp(1.5rem, 3.4vw, 2.6rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: #F4F3EE;
  max-width: 20ch;
  text-wrap: balance;
}
.cap-sub {
  margin-top: 0.9em;
  font-size: clamp(1rem, 1.6vw, 1.2rem);
  color: var(--steel);
}

.story-reveal .reveal-logo {
  width: clamp(280px, 42vw, 560px);
  height: auto;
}
.reveal-tagline {
  margin-top: 0.4em;
  font-size: clamp(1rem, 1.8vw, 1.3rem);
  color: var(--steel);
  letter-spacing: 0.01em;
}

.story-progress {
  position: absolute;
  left: 50%;
  bottom: 36px;
  transform: translateX(-50%);
  width: 120px;
  height: 2px;
  background: rgba(247, 246, 242, 0.14);
  border-radius: 2px;
  overflow: hidden;
}
#storyBar {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--bronze);
  transition: width 0.15s linear;
}

.story-hint {
  position: absolute;
  left: 50%;
  bottom: 52px;
  transform: translateX(-50%);
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--steel);
  animation: hintFade 3s var(--ease) infinite;
}
@keyframes hintFade {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 0.9; }
}

/* ---------- hero ---------- */

.hero {
  padding: clamp(120px, 20vh, 220px) 0;
  text-align: center;
}
.hero-sub {
  max-width: 52ch;
  margin: 2rem auto 2.8rem;
  font-size: clamp(1.05rem, 1.8vw, 1.25rem);
  color: var(--ink-soft);
}

/* ---------- tool fragmentation figure ---------- */

.tool-figure { margin-top: 8px; }
.tool-figure svg {
  width: 100%;
  height: auto;
  display: block;
}
.tool-figure figcaption {
  margin-top: 16px;
  font-size: 0.85rem;
  color: var(--ink-faint);
}

/* ---------- system visualization ---------- */

.system-viz {
  display: grid;
  grid-template-columns: minmax(0, 8fr) minmax(0, 4fr);
  gap: clamp(28px, 4vw, 56px);
  align-items: center;
}
#systemSvg { width: 100%; height: auto; }

#systemSvg .sys-node {
  cursor: pointer;
  outline: none;
}
#systemSvg .sys-node rect {
  fill: var(--charcoal-2);
  stroke: rgba(247, 246, 242, 0.18);
  stroke-width: 1;
  transition: stroke 0.3s var(--ease), fill 0.3s var(--ease);
}
#systemSvg .sys-node text {
  fill: #D8D7D2;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: fill 0.3s var(--ease);
}
#systemSvg .sys-node:hover rect,
#systemSvg .sys-node:focus-visible rect,
#systemSvg .sys-node.active rect {
  stroke: var(--bronze);
  fill: #1C2027;
}
#systemSvg .sys-node.active text { fill: #fff; }

#systemSvg .sys-link {
  stroke: rgba(247, 246, 242, 0.13);
  stroke-width: 1.2;
  fill: none;
  transition: stroke 0.3s var(--ease);
}
#systemSvg .sys-link.lit { stroke: var(--bronze); stroke-width: 1.6; }
#systemSvg .sys-link.flowing { stroke: rgba(169, 131, 90, 0.45); }
#systemSvg .sys-node.pulsed rect { stroke: var(--bronze); fill: #1C2027; }
#systemSvg .sys-node.pulsed text { fill: #fff; }

#systemSvg .sys-core circle {
  fill: none;
  stroke: var(--blue-soft);
  stroke-width: 1.2;
}
#systemSvg .sys-core text {
  fill: #F4F3EE;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
#systemSvg .flow-dot { fill: var(--bronze-soft); }

.system-panel {
  border-left: 1px solid var(--line-dark);
  padding-left: clamp(20px, 3vw, 40px);
  min-height: 180px;
}
.system-panel h3 {
  color: var(--bronze-soft);
  margin-bottom: 0.7em;
  font-size: 1.05rem;
}
.system-panel p {
  color: rgba(233, 232, 227, 0.75);
  font-size: 0.98rem;
}

/* ---------- capability layers ---------- */

.layer-list {
  margin-top: 3.5rem;
  border-top: 1px solid var(--line);
}
.layer {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  gap: clamp(16px, 4vw, 64px);
  padding: clamp(26px, 3.5vw, 40px) 0;
  border-bottom: 1px solid var(--line);
  transition: background 0.3s var(--ease);
}
.layer h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); }
.layer p { color: var(--ink-soft); max-width: 56ch; }
.layer:hover h3 { color: var(--bronze); transition: color 0.3s var(--ease); }

/* ---------- industries ---------- */

.industry-grid {
  margin-top: 3.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.industry {
  background: var(--bg-tint);
  padding: clamp(28px, 3vw, 44px);
  transition: background 0.35s var(--ease);
}
.industry:hover { background: var(--bg); }
.industry h3 { margin-bottom: 0.7em; }
.industry p { color: var(--ink-soft); font-size: 0.97rem; }

/* ---------- method ---------- */

.method-list {
  list-style: none;
  border-top: 1px solid var(--line);
}
.method-list li {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 24px;
  padding: clamp(24px, 3vw, 36px) 0;
  border-bottom: 1px solid var(--line);
}
.step-num {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--bronze);
  letter-spacing: 0.08em;
  padding-top: 5px;
}
.method-list h3 { margin-bottom: 0.4em; }
.method-list p { color: var(--ink-soft); }

/* ---------- founder ---------- */

.founder { padding-top: 0; }
.founder-text {
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  line-height: 1.5;
  letter-spacing: -0.01em;
  color: var(--ink);
  max-width: 44ch;
}

/* ---------- contact ---------- */

.contact p {
  max-width: 44ch;
  margin: 1.6rem auto 2.6rem;
  color: rgba(233, 232, 227, 0.75);
}

.contact-form {
  max-width: 560px;
  margin: 0 auto;
  text-align: left;
  display: grid;
  gap: 24px;
}

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

.form-field label {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--steel);
  margin-bottom: 9px;
}

.form-field input,
.form-field textarea {
  width: 100%;
  background: rgba(247, 246, 242, 0.04);
  border: 1px solid rgba(247, 246, 242, 0.18);
  border-radius: 3px;
  color: #F4F3EE;
  font-family: var(--font);
  font-size: 0.98rem;
  line-height: 1.5;
  padding: 13px 15px;
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease);
}
.form-field textarea { resize: vertical; min-height: 130px; }

.form-field input:hover,
.form-field textarea:hover {
  border-color: rgba(247, 246, 242, 0.32);
}
.form-field input:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--bronze);
  background: rgba(247, 246, 242, 0.06);
}

.contact-form button {
  border: none;
  cursor: pointer;
  justify-self: center;
  margin-top: 6px;
}

.form-alt {
  text-align: center;
  font-size: 0.88rem;
  color: var(--steel);
  margin: 0 !important;
}
.form-alt a {
  color: var(--bronze-soft);
  text-decoration: none;
  transition: color 0.25s var(--ease);
}
.form-alt a:hover { color: var(--bronze); }

.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
}

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

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

.site-footer {
  background: var(--charcoal);
  border-top: 1px solid var(--line-dark);
  color: var(--steel);
  font-size: 0.88rem;
}
.footer-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
  padding-top: 40px;
  padding-bottom: 40px;
}
.footer-logo { height: 30px; width: auto; }
.site-footer nav { display: flex; gap: 20px; margin-left: auto; }
.site-footer a {
  color: var(--steel);
  text-decoration: none;
  transition: color 0.25s var(--ease);
}
.site-footer a:hover { color: var(--bronze-soft); }
.copyright { color: rgba(154, 163, 174, 0.6); }

/* ---------- reveal on scroll ---------- */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}
.reveal.in {
  opacity: 1;
  transform: none;
}

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

@media (max-width: 900px) {
  .grid-2 { grid-template-columns: 1fr; }
  .system-viz { grid-template-columns: 1fr; }
  .system-panel {
    border-left: none;
    border-top: 1px solid var(--line-dark);
    padding-left: 0;
    padding-top: 24px;
    min-height: 0;
  }
  .nav-links { display: none; }
}

@media (max-width: 600px) {
  body { font-size: 16px; }
  .layer { grid-template-columns: 1fr; gap: 10px; }
  .method-list li { grid-template-columns: 48px 1fr; gap: 16px; }
  .story { height: 520vh; }
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .story-hint { animation: none; }
  .story { height: auto; }
  .story-sticky { position: relative; height: auto; overflow: visible; padding: 15vh 0; }
  #storyCanvas, .story-progress { display: none; }
  .story-caption {
    position: static;
    opacity: 1;
    pointer-events: auto;
    padding: 7vh var(--pad);
  }
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
