/* dtech brand stylesheet — components & layout (theme.json owns tokens) */

:root {
  --dtech-steel:  #1C2A35;
  --dtech-copper: #B87333;
  --dtech-bone:   #F4F1EA;
  --dtech-line:   rgba(28, 42, 53, 0.15);
}

body {
  font-family: "IBM Plex Sans", -apple-system, Helvetica, Arial, sans-serif;
  color: var(--dtech-steel);
  background: var(--dtech-bone);
  line-height: 1.5;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  letter-spacing: -0.01em;
}

a { color: var(--dtech-copper); text-decoration: none; }
a:hover { text-decoration: underline; }

pre, code, kbd, samp {
  font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace;
}

.dtech-eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--dtech-copper);
}

.dtech-button-primary .wp-block-button__link {
  padding: 0.75rem 1.5rem;
  background: var(--dtech-copper);
  color: var(--dtech-steel);
  font-weight: 700;
  border: 2px solid var(--dtech-copper);
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.dtech-button-primary .wp-block-button__link:hover {
  background: var(--dtech-steel);
  color: var(--dtech-bone);
  text-decoration: none;
  border-color: var(--dtech-steel);
}

.dtech-button-secondary .wp-block-button__link {
  padding: 0.75rem 1.5rem;
  background: var(--dtech-steel);
  color: var(--dtech-bone);
  font-weight: 700;
  border: 2px solid var(--dtech-steel);
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.dtech-button-secondary .wp-block-button__link:hover {
  background: var(--dtech-copper);
  color: var(--dtech-steel);
  text-decoration: none;
  border-color: var(--dtech-copper);
}

/* 3D-print animation (used by print-animation pattern) */
.dtech-printer-block {
  padding: 4rem 1.5rem;
  background: var(--dtech-bone);
  border-top: 1px solid var(--dtech-line);
  border-bottom: 1px solid var(--dtech-line);
}
.dtech-printer-figure {
  margin: 1.5rem auto;
  max-width: 440px;
}
.dtech-printer {
  width: 100%;
  height: auto;
  display: block;
}

/* Sync principle: gear top edge runs from y=147 (bottom, scaleY=0) to y=82
   (top, scaleY=1). Print head's nozzle tip is +8px below the head's transform
   origin, so head_y = gear_top_y - 8 keeps the nozzle exactly on the layer
   being deposited. Both animations use linear timing so the linear scaleY
   ramp matches the linear translateY ramp 1:1. */

.dtech-grow-rect {
  transform-box: fill-box;
  transform-origin: center bottom;
  animation: dtech-grow 9s linear infinite;
}
.dtech-printed-object {
  animation: dtech-fade 9s linear infinite;
  opacity: 0;
}
.dtech-head-y {
  animation: dtech-head-y 9s linear infinite;
}
.dtech-head-x {
  animation: dtech-head-x 9s linear infinite;
}

@keyframes dtech-grow {
  0%, 5%    { transform: scaleY(0); }
  68%, 90%  { transform: scaleY(1); }
  95%, 100% { transform: scaleY(0); }
}

@keyframes dtech-fade {
  0%, 4%    { opacity: 0; }
  10%, 90%  { opacity: 1; }
  95%, 100% { opacity: 0; }
}

/* Y axis: rises 139→74 in lockstep with gear scaleY 0→1 (linear), then parks
   up at 45, then teleports back to 139 while invisible. */
@keyframes dtech-head-y {
  0%, 5%       { transform: translateY(139px); opacity: 1; }
  68%          { transform: translateY(74px);  opacity: 1; }
  85%, 92%     { transform: translateY(45px);  opacity: 1; }
  93%          { transform: translateY(45px);  opacity: 0; }
  94%          { transform: translateY(139px); opacity: 0; }
  100%         { transform: translateY(139px); opacity: 1; }
}

/* X axis: 6 serpentine sweeps between x=85 and x=155 during the 5%–68%
   print phase, then easing toward center for the parked-up pose. */
@keyframes dtech-head-x {
  0%, 5%    { transform: translateX(85px);  }
  15.5%     { transform: translateX(155px); }
  26%       { transform: translateX(85px);  }
  36.5%     { transform: translateX(155px); }
  47%       { transform: translateX(85px);  }
  57.5%     { transform: translateX(155px); }
  68%       { transform: translateX(85px);  }
  85%, 100% { transform: translateX(120px); }
}

@media (prefers-reduced-motion: reduce) {
  .dtech-grow-rect,
  .dtech-printed-object,
  .dtech-head-y,
  .dtech-head-x {
    animation: none;
  }
  .dtech-grow-rect       { transform: scaleY(1); }
  .dtech-printed-object  { opacity: 1; }
  .dtech-head-y          { transform: translateY(45px); }
  .dtech-head-x          { transform: translateX(120px); }
}

/* Split hero layout (used by split-hero pattern) */
.dtech-split-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 60vh;
  border-top: 1px solid var(--dtech-steel);
  border-bottom: 1px solid var(--dtech-steel);
}
.dtech-split-hero__side {
  padding: 3rem 2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1rem;
}
.dtech-split-hero__side--dark  { background: var(--dtech-steel); color: var(--dtech-bone); }
.dtech-split-hero__side--light { background: var(--dtech-bone);  color: var(--dtech-steel); border-left: 1px solid var(--dtech-steel); }
@media (max-width: 780px) {
  .dtech-split-hero { grid-template-columns: 1fr; }
  .dtech-split-hero__side--light { border-left: 0; border-top: 1px solid var(--dtech-steel); }
}
