/* =========================================================
   Deftio LLC — Design System
   Graphite / Paper / Copper — engineering-lab editorial system
   ========================================================= */

:root {
  --graphite: #14181D;
  --graphite2: #1C222A;
  --paper: #F5F3EE;
  --paper2: #EAE7DF;
  --ink: #181B1F;
  --slate: #5C6470;
  --copper: #BE5A2E;
  --copperlight: #D97D4C;
  --wire: #4C7A6A;
  --line: rgba(24,27,31,0.12);
  --line-dark: rgba(245,243,238,0.14);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

body { line-height: 1.6; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
@media (min-width: 768px) { .container { padding: 0 48px; } }

.skip-link {
  position: absolute; left: -999px; top: 0; background: var(--copper); color: #fff;
  padding: 10px 16px; z-index: 200; font-family: 'IBM Plex Mono', monospace; font-size: 13px;
}
.skip-link:focus { left: 8px; top: 8px; }

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

/* ---------- Typography helpers ---------- */
.section-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12.5px;
  letter-spacing: 0.06em;
  color: var(--copper);
  margin: 0 0 14px;
}
.section-label.light { color: var(--copperlight); }
.section-title {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin: 0 0 18px;
  max-width: 14ch;
}
.section-title.light { color: var(--paper); }
.section-copy {
  color: var(--slate);
  max-width: 46ch;
  font-size: 16.5px;
}
.section-copy.light { color: #A9AFB8; }
.section-head { margin-bottom: 56px; }
.inline-link { color: var(--copperlight); text-decoration: underline; text-decoration-color: rgba(217,125,76,0.4); }
.inline-link:hover { text-decoration-color: currentColor; }

.section-block { padding: 96px 0; position: relative; }
.section-dark { background: var(--graphite); color: var(--paper); }

/* ---------- Buttons ---------- */
.btn-primary, .btn-secondary {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 14px;
  padding: 14px 24px;
  border-radius: 2px;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease, border-color .2s ease;
  white-space: nowrap;
}
.btn-primary { background: var(--copper); color: #fff; }
.btn-primary:hover { background: var(--copperlight); transform: translateY(-1px); }
.btn-secondary { border: 1px solid var(--line); color: var(--ink); }
.btn-secondary:hover { border-color: var(--copper); color: var(--copper); }
.btn-large { font-size: 16px; padding: 18px 32px; margin-top: 8px; }

/* =========================================================
   NAVIGATION
   ========================================================= */
.site-nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(245,243,238,0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  transition: padding 0.25s ease, box-shadow .25s ease;
}
.site-nav.is-scrolled { box-shadow: 0 1px 0 var(--line); }
.nav-inner {
  max-width: 1200px; margin: 0 auto; padding: 22px 24px;
  display: flex; align-items: center; gap: 32px;
  transition: padding 0.25s ease;
}
.site-nav.is-scrolled .nav-inner { padding: 14px 24px; }
@media (min-width: 768px) { .nav-inner { padding: 22px 48px; } .site-nav.is-scrolled .nav-inner { padding: 14px 48px; } }

.nav-logo {
  font-family: 'Space Grotesk', sans-serif; font-weight: 600; font-size: 19px;
  display: flex; align-items: center; gap: 10px; color: var(--ink);
  margin-right: auto;
}
.nav-logo-mark {
  width: 10px; height: 10px; background: var(--copper); border-radius: 1px; flex: none;
}
.nav-links { display: none; gap: 28px; font-size: 14.5px; }
.nav-links a { color: var(--ink); opacity: 0.8; }
.nav-links a:hover { opacity: 1; color: var(--copper); }
@media (min-width: 900px) { .nav-links { display: flex; } }

.nav-cta { display: none; font-family: 'IBM Plex Mono', monospace; font-size: 13.5px; color: var(--ink); border-bottom: 1px solid var(--copper); padding-bottom: 2px; }
.nav-cta:hover { color: var(--copper); }
@media (min-width: 900px) { .nav-cta { display: inline-flex; } }

.menu-toggle {
  width: 32px; height: 24px; position: relative; flex: none;
}
.menu-toggle span {
  position: absolute; left: 0; width: 100%; height: 2px; background: var(--ink);
  transition: transform .2s ease, opacity .2s ease;
}
.menu-toggle span:nth-child(1) { top: 0; }
.menu-toggle span:nth-child(2) { top: 11px; }
.menu-toggle span:nth-child(3) { top: 22px; }
.menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(11px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-11px) rotate(-45deg); }
@media (min-width: 900px) { .menu-toggle { display: none; } }

.mobile-menu {
  display: none; flex-direction: column; gap: 4px;
  padding: 8px 24px 24px; border-top: 1px solid var(--line);
}
.mobile-menu.is-open { display: flex; }
.mobile-menu a { padding: 12px 0; font-size: 16px; color: var(--ink); border-bottom: 1px solid var(--line); }
.mobile-cta { color: var(--copper) !important; font-family: 'IBM Plex Mono', monospace; border-bottom: none !important; }

/* =========================================================
   HERO
   ========================================================= */
.hero {
  position: relative; overflow: hidden;
  padding: 76px 0 64px;
  background: var(--paper);
}
.hero-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0.6), transparent 85%);
  opacity: 0.6;
}
#hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0.55; }

.hero-inner { position: relative; max-width: 1200px; margin: 0 auto; padding: 0 24px; }
@media (min-width: 768px) { .hero-inner { padding: 0 48px; } }

.eyebrow {
  font-family: 'IBM Plex Mono', monospace; font-size: 13px; color: var(--slate);
  display: flex; align-items: center; gap: 8px; margin: 0 0 28px;
}
.eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--wire); box-shadow: 0 0 0 3px rgba(76,122,106,0.18); }

.hero-headline {
  font-family: 'Space Grotesk', sans-serif; font-weight: 700;
  font-size: clamp(38px, 7vw, 84px);
  line-height: 1.03; letter-spacing: -0.015em;
  margin: 0 0 28px; max-width: 16ch;
}
.hero-sub { max-width: 56ch; font-size: clamp(16px, 1.6vw, 19px); color: var(--slate); margin: 0 0 40px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 72px; }

.hero-path { border-top: 1px solid var(--line); padding-top: 28px; }
.hero-path-track {
  display: flex; align-items: center; gap: 0;
  overflow-x: auto; padding-bottom: 4px;
}
.hp-node {
  font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: var(--slate);
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; flex: none;
  position: relative;
}
.hp-node::after {
  content: attr(data-label);
  position: absolute; top: 42px; left: 50%; transform: translateX(-50%);
  font-size: 11px; white-space: nowrap; color: var(--ink); font-family: 'Space Grotesk', sans-serif;
}
.hp-node:first-child, .hp-node:last-child { border-color: var(--copper); color: var(--copper); }
.hp-line { flex: 1 1 auto; min-width: 24px; height: 1px; background: var(--line); }

/* =========================================================
   CAPABILITY MAP
   ========================================================= */
.cap-map {
  position: relative; width: 100%; max-width: 640px; margin: 0 auto 56px;
  aspect-ratio: 1 / 0.85;
}
.cap-lines { position: absolute; inset: 0; width: 100%; height: 100%; }
.cap-lines line { stroke: var(--line); stroke-width: 0.4; transition: stroke .2s ease, stroke-width .2s ease; }
.cap-lines line.is-lit { stroke: var(--copper); stroke-width: 0.7; }

.cap-node {
  position: absolute;
  left: calc(var(--x) * 1%); top: calc(var(--y) * 1%);
  transform: translate(-50%, -50%);
  width: 108px; height: 108px; border-radius: 50%;
  background: var(--paper); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; text-align: center;
  padding: 8px; cursor: pointer;
  transition: border-color .2s ease, background .2s ease, transform .2s ease;
}
.cap-node-label { font-family: 'Space Grotesk', sans-serif; font-weight: 600; font-size: 14.5px; }
.cap-node:hover, .cap-node.is-active {
  border-color: var(--copper); background: #fff; transform: translate(-50%, -50%) scale(1.05);
}
.cap-node.is-active .cap-node-label { color: var(--copper); }

.cap-detail-item { display: none; border-top: 1px solid var(--line); padding-top: 24px; max-width: 60ch; }
.cap-detail-item.is-active { display: block; }
.cap-detail-eyebrow { font-family: 'IBM Plex Mono', monospace; font-size: 12.5px; color: var(--copper); display: block; margin-bottom: 10px; }
.cap-detail-item p { color: var(--ink); font-size: 16px; }

@media (max-width: 640px) {
  .cap-map { aspect-ratio: 1/1.15; }
  .cap-node { width: 84px; height: 84px; }
  .cap-node-label { font-size: 12px; }
}

/* =========================================================
   TECH STACK FIELD
   ========================================================= */
.stack-field {
  display: flex; flex-wrap: wrap; gap: 12px 14px; list-style: none; padding: 0; margin: 0;
}
.stack-field li {
  font-family: 'IBM Plex Mono', monospace; font-size: 14px;
  border: 1px solid var(--line-dark); color: #C9CDD3;
  padding: 10px 16px; border-radius: 2px;
  transition: border-color .2s ease, color .2s ease, transform .2s ease;
}
.stack-field li:hover { border-color: var(--copperlight); color: var(--copperlight); transform: translateY(-2px); }

/* =========================================================
   PROJECTS
   ========================================================= */
.project {
  display: grid; gap: 40px; padding: 56px 0; border-top: 1px solid var(--line);
}
.project:first-of-type { border-top: none; }
@media (min-width: 900px) {
  .project { grid-template-columns: 1.1fr 1fr; align-items: center; gap: 64px; }
  .project-02 .project-media { order: 2; }
}
.project-index { font-family: 'IBM Plex Mono', monospace; color: var(--copper); font-size: 13px; }
.project-copy h3 { font-family: 'Space Grotesk', sans-serif; font-size: clamp(24px, 3vw, 32px); margin: 8px 0 6px; font-weight: 600; }
.project-meta { font-family: 'IBM Plex Mono', monospace; font-size: 12.5px; color: var(--slate); margin-bottom: 20px; }
.project-copy p { margin: 0 0 14px; color: var(--ink); font-size: 15.5px; }
.project-copy p strong { font-family: 'Space Grotesk', sans-serif; font-weight: 600; }
.full-width { max-width: 72ch; }

.project-media { min-height: 220px; display: flex; align-items: center; justify-content: center; }
.tech-figure { position: relative; width: 100%; max-width: 340px; aspect-ratio: 1/1; }

/* Touchstone figure */
.touchstone-figure .tf-ring { position: absolute; border: 1px solid var(--copper); border-radius: 50%; opacity: 0.35; left: 50%; top: 62%; transform: translate(-50%,-50%); }
.tf-ring--1 { width: 60%; height: 60%; }
.tf-ring--2 { width: 78%; height: 78%; opacity: 0.22; }
.tf-ring--3 { width: 96%; height: 96%; opacity: 0.12; }
.tf-puck { position: absolute; left: 50%; top: 62%; transform: translate(-50%,-50%); width: 34%; height: 10%; background: var(--graphite); border-radius: 6px; }
.tf-device { position: absolute; left: 50%; top: 32%; transform: translate(-50%,-50%) rotate(0deg); width: 46%; height: 60%; background: var(--paper2); border: 1px solid var(--ink); border-radius: 8px; box-shadow: 0 10px 24px rgba(20,24,29,0.12); }

/* Hiku figure */
.hiku-figure .hf-device { position: absolute; left: 14%; top: 40%; width: 26%; height: 26%; border-radius: 50%; background: var(--graphite); }
.hiku-figure .hf-btn { position: absolute; inset: 28%; border-radius: 50%; background: var(--copper); }
.hf-wave { position: absolute; left: 30%; top: 50%; border: 1px solid var(--wire); border-radius: 50%; transform: translate(0,-50%); opacity: 0.5; }
.hf-wave--1 { width: 30%; height: 30%; }
.hf-wave--2 { width: 46%; height: 46%; opacity: 0.3; }
.hiku-figure .hf-phone { position: absolute; right: 14%; top: 28%; width: 20%; height: 44%; border: 1px solid var(--ink); border-radius: 8px; background: var(--paper2); }

/* Timeline */
.timeline { list-style: none; padding: 0; margin: 40px 0 0; display: grid; gap: 22px; grid-template-columns: 1fr; border-top: 1px dashed var(--line); padding-top: 32px; }
@media (min-width: 800px) { .timeline { grid-template-columns: repeat(4, 1fr); } }
.timeline li { display: flex; flex-direction: column; gap: 6px; position: relative; padding-left: 20px; border-left: 2px solid var(--copper); }
.tl-year { font-family: 'IBM Plex Mono', monospace; color: var(--copper); font-size: 13px; }
.tl-label { font-family: 'Space Grotesk', sans-serif; font-weight: 600; font-size: 16px; }
.tl-detail { color: var(--slate); font-size: 14px; }

/* Graph figure */
.graph-svg { width: 100%; height: 100%; }
.graph-figure { background: var(--paper2); border-radius: 8px; padding: 10px; }
.graph-nodes circle { fill: var(--copper); }
.graph-edges line { stroke: var(--slate); opacity: 0.5; }

/* =========================================================
   ABOUT
   ========================================================= */
.about-grid { display: grid; gap: 40px; }
@media (min-width: 900px) { .about-grid { grid-template-columns: 0.9fr 1.4fr; } }
.about-copy p { max-width: 62ch; color: var(--ink); margin: 0 0 18px; font-size: 16.5px; }
.about-copy strong { font-family: 'Space Grotesk', sans-serif; }

/* =========================================================
   INSIGHTS
   ========================================================= */
.insights-layout { display: grid; gap: 40px; }
@media (min-width: 900px) { .insights-layout { grid-template-columns: 1.2fr 1fr; } }

.insight-featured {
  display: block; padding: 32px; border: 1px solid var(--line); border-radius: 4px;
  position: relative; transition: border-color .2s ease, transform .2s ease;
  color: var(--ink);
}
.insight-featured:hover { border-color: var(--copper); transform: translateY(-2px); }
.insight-category { font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: var(--copper); }
.insight-featured h3 { font-family: 'Space Grotesk', sans-serif; font-size: clamp(22px,3vw,28px); margin: 14px 0 12px; font-weight: 600; }
.insight-featured p { color: var(--slate); margin: 0 0 20px; max-width: 50ch; }
.insight-meta { font-family: 'IBM Plex Mono', monospace; font-size: 12.5px; color: var(--slate); }
.insight-arrow { position: absolute; bottom: 28px; right: 28px; font-size: 20px; color: var(--copper); transition: transform .2s ease; }
.insight-featured:hover .insight-arrow { transform: translate(4px,-4px); }

.insight-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; }
.insight-list li { border-top: 1px solid var(--line); }
.insight-list li:last-child { border-bottom: 1px solid var(--line); }
.insight-list a { display: block; padding: 20px 4px; color: var(--ink); }
.insight-list h4 { font-family: 'Space Grotesk', sans-serif; font-size: 17px; font-weight: 600; margin: 8px 0 6px; }
.insight-list p { color: var(--slate); font-size: 14.5px; margin: 0 0 8px; max-width: 48ch; }
.insight-list a:hover h4 { color: var(--copper); }

/* =========================================================
   OPEN SOURCE
   ========================================================= */
.repo-list { list-style: none; padding: 0; margin: 0; }
.repo-row { border-top: 1px solid var(--line-dark); }
.repo-row:last-child { border-bottom: 1px solid var(--line-dark); }
.repo-row a {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 20px;
  padding: 20px 4px; color: var(--paper);
}
.repo-name { font-family: 'IBM Plex Mono', monospace; font-size: 15.5px; color: var(--paper); flex: 0 0 auto; min-width: 230px; }
.repo-row a:hover .repo-name { color: var(--copperlight); }
.repo-desc { color: #A9AFB8; font-size: 14px; flex: 1 1 320px; }
.repo-meta { display: flex; gap: 14px; font-family: 'IBM Plex Mono', monospace; font-size: 12.5px; color: #8B919B; margin-left: auto; }
.repo-lang { border: 1px solid var(--line-dark); padding: 2px 8px; border-radius: 2px; }

/* =========================================================
   CONTACT
   ========================================================= */
.section-contact { background: var(--graphite2); color: var(--paper); text-align: center; }
.contact-inner { display: flex; flex-direction: column; align-items: center; }
.contact-headline { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: clamp(32px,6vw,60px); line-height: 1.08; margin: 0 0 8px; }
.contact-sub { color: #A9AFB8; font-size: 18px; margin: 0 0 40px; }
.section-contact .section-label { text-align: center; }

/* =========================================================
   FOOTER
   ========================================================= */
.site-footer { background: var(--graphite); color: var(--paper); padding: 56px 0 24px; }
.footer-inner { display: grid; gap: 32px; padding-bottom: 40px; border-bottom: 1px solid var(--line-dark); }
@media (min-width: 900px) { .footer-inner { grid-template-columns: 1.2fr 1fr 1fr; align-items: start; } }
.footer-brand { display: flex; gap: 12px; align-items: flex-start; }
.footer-name { font-family: 'Space Grotesk', sans-serif; font-weight: 600; font-size: 18px; }
.footer-tag { color: #A9AFB8; font-size: 14px; margin-top: 4px; }
.footer-nav { display: flex; flex-direction: column; gap: 10px; }
.footer-nav a, .footer-social a { color: #C9CDD3; font-size: 14.5px; }
.footer-nav a:hover, .footer-social a:hover { color: var(--copperlight); }
.footer-social { display: flex; flex-direction: column; gap: 10px; }
.footer-bottom { padding-top: 20px; font-family: 'IBM Plex Mono', monospace; font-size: 12.5px; color: #7B818B; }
