/* ============================================================
   FUZION3D — hoja de estilos
   Paleta: grafito + acento "extrusión" naranja + trazo azul plano
   ============================================================ */

:root {
  --bg:        #14171a;
  --surface:   #1b1f23;
  --surface-2: #21262b;
  --line:      #2a2f35;
  --line-soft: #23282d;
  --text:      #e9e6df;
  --text-dim:  #9199a1;
  --text-faint:#5d656d;
  --accent:    #e8672c;
  --accent-dim:#7a3d22;
  --blueprint: #3b5a6b;

  --font-body: "IBM Plex Sans", "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", "Courier New", monospace;

  --gap: 24px;
  --radius: 2px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  background-image:
    linear-gradient(var(--line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 48px 48px;
  background-attachment: fixed;
}

a { color: inherit; }

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

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 28px;
}

.eyebrow-num {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-faint);
  letter-spacing: 0.02em;
}

/* ---------- Nav ---------- */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(20, 23, 26, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.site-nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 17px;
  letter-spacing: 0.01em;
  display: flex;
  align-items: baseline;
  gap: 8px;
  text-decoration: none;
}

.brand .dot {
  color: var(--accent);
}

.nav-links {
  display: flex;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  display: block;
  padding: 8px 14px;
  text-decoration: none;
  color: var(--text-dim);
  font-size: 14.5px;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
  border-color: var(--accent);
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  color: var(--text);
  width: 40px;
  height: 40px;
  cursor: pointer;
}

/* ---------- Hero ---------- */

.hero {
  padding: 96px 0 72px;
  border-bottom: 1px solid var(--line);
}

.hero-status {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}

.hero-status .pulse {
  width: 7px;
  height: 7px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(232, 103, 44, 0.6);
  animation: pulse 2.2s infinite;
}

@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(232, 103, 44, 0.5); }
  70%  { box-shadow: 0 0 0 9px rgba(232, 103, 44, 0); }
  100% { box-shadow: 0 0 0 0 rgba(232, 103, 44, 0); }
}

.hero h1 {
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1.08;
  margin: 0 0 20px;
  max-width: 15ch;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.hero .extrude-rule {
  height: 3px;
  width: 120px;
  background: var(--accent);
  margin: 0 0 28px;
  animation: extrude 1.1s cubic-bezier(.2,.7,.2,1) both;
  transform-origin: left;
}

@keyframes extrude {
  from { width: 0; }
  to   { width: 120px; }
}

.hero p.lead {
  max-width: 62ch;
  color: var(--text-dim);
  font-size: 18px;
  margin: 0 0 36px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  font-family: var(--font-body);
  font-size: 14.5px;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.btn:hover { border-color: var(--text-dim); }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #16110d;
  font-weight: 600;
}

.btn-primary:hover {
  background: #f0793f;
  border-color: #f0793f;
}

/* ---------- Section shell ---------- */

section {
  padding: 72px 0;
  border-bottom: 1px solid var(--line);
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 36px;
  flex-wrap: wrap;
}

.section-head h2 {
  font-size: 26px;
  margin: 0;
  font-weight: 600;
}

.section-head .sub {
  color: var(--text-dim);
  font-size: 14.5px;
  max-width: 46ch;
}

/* ---------- Perfil ---------- */

.perfil-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 56px;
  align-items: start;
}

.perfil-grid p {
  color: var(--text-dim);
  margin: 0 0 16px;
  max-width: 58ch;
}

.perfil-grid p strong { color: var(--text); font-weight: 600; }

.spec-panel {
  border: 1px solid var(--line);
  background: var(--surface);
}

.spec-panel .spec-row {
  display: flex;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

.spec-panel .spec-row:last-child { border-bottom: none; }

.spec-panel .spec-row .k { color: var(--text-faint); }
.spec-panel .spec-row .v { font-family: var(--font-mono); color: var(--text); text-align: right; }

/* ---------- Filamentos: spec sheet ---------- */

.spec-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
}

table.spec-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  min-width: 720px;
}

table.spec-table thead th {
  text-align: left;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 12.5px;
  color: var(--text-faint);
  padding: 12px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

table.spec-table tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--text-dim);
  vertical-align: top;
}

table.spec-table tbody tr:last-child td { border-bottom: none; }

table.spec-table tbody td.material {
  color: var(--text);
  font-weight: 600;
  white-space: nowrap;
}

table.spec-table tbody tr:hover { background: var(--surface); }

/* ---------- STL section ---------- */

.stl-toolbar {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.stl-toolbar input[type="search"] {
  flex: 1;
  min-width: 220px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 10px 14px;
  font-family: var(--font-mono);
  font-size: 14px;
}

.stl-toolbar input[type="search"]:focus {
  outline: none;
  border-color: var(--accent);
}

.stl-toolbar .count {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-faint);
  align-self: center;
}

.file-list {
  border: 1px solid var(--line);
}

.file-row {
  border-bottom: 1px solid var(--line-soft);
}

.file-row:last-child { border-bottom: none; }

.file-row-head {
  display: grid;
  grid-template-columns: 1fr 110px 160px 160px;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  cursor: pointer;
}

.file-row-head:hover { background: var(--surface); }

.file-name {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-meta {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-faint);
}

.file-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.file-actions .btn {
  padding: 7px 12px;
  font-size: 13px;
}

.viewer-drawer {
  display: none;
  border-top: 1px solid var(--line-soft);
  background: var(--bg);
  padding: 20px;
}

.viewer-drawer.open { display: grid; grid-template-columns: 1fr 220px; gap: 20px; }

.viewer-canvas-wrap {
  height: 360px;
  border: 1px solid var(--line);
  background: #0e1012;
  position: relative;
}

.viewer-canvas-wrap canvas { width: 100%; height: 100%; display: block; }

.viewer-canvas-wrap .viewer-hint {
  position: absolute;
  bottom: 8px;
  left: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
}

.viewer-info .spec-row { font-size: 13px; }

.empty-state, .loading-state {
  padding: 40px 18px;
  text-align: center;
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 13.5px;
}

/* ---------- Galería ---------- */

.gallery-grid {
  columns: 3 260px;
  column-gap: 16px;
}

.gallery-grid figure {
  margin: 0 0 16px;
  break-inside: avoid;
  border: 1px solid var(--line);
  overflow: hidden;
}

.gallery-grid img { width: 100%; display: block; }

.gallery-grid figcaption {
  padding: 10px 12px;
  font-size: 12.5px;
  font-family: var(--font-mono);
  color: var(--text-faint);
  border-top: 1px solid var(--line);
}

/* ---------- Contacto ---------- */

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}

.contact-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.contact-list li {
  border-bottom: 1px solid var(--line-soft);
}

.contact-list a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 4px;
  text-decoration: none;
  color: var(--text);
  font-size: 15px;
}

.contact-list a:hover { color: var(--accent); }

.contact-list .label { color: var(--text-faint); font-family: var(--font-mono); font-size: 13px; }

/* ---------- Footer ---------- */

footer {
  padding: 28px 0;
  text-align: center;
  color: var(--text-faint);
  font-size: 13px;
  font-family: var(--font-mono);
}

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  .perfil-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .viewer-drawer.open {
    grid-template-columns: 1fr;
  }

  .file-row-head {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "name actions"
      "meta actions";
  }

  .file-row-head .file-name { grid-area: name; }
  .file-row-head .file-meta:first-of-type { grid-area: meta; }
  .file-row-head .file-meta:last-of-type { display: none; }
  .file-row-head .file-actions { grid-area: actions; }
}

@media (max-width: 720px) {
  .nav-links {
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    display: none;
  }

  .nav-links.open { display: flex; }

  .nav-toggle { display: block; }

  .gallery-grid { columns: 2 200px; }
}

@media (max-width: 480px) {
  .gallery-grid { columns: 1; }
}

/* Focus visibility */
a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
