/* ============================================================
   FOUNDRY & FIELD NOTES
   editorial product brand × scientific notebook
   ============================================================ */

[data-direction="foundry"] {
  --temp-cold: #2A4138;
  --temp-cool: #4A6A5C;
  --temp-mid: #FBF8F2;
  --temp-warm: #D17A4D;
  --temp-hot: #6B2E15;
}

[data-direction="foundry"] .dir-header {
  border-top-color: var(--ref-ink-900);
  border-top-width: 2px;
}

[data-direction="foundry"] .dir__shell {
  background:
    linear-gradient(to bottom, transparent 0, transparent calc(100% - 1px), var(--ref-ink-100) calc(100% - 1px));
}

/* Paper rule lines on hero */
[data-direction="foundry"] .foundry-hero {
  position: relative;
  padding: var(--sp-7) 0 var(--sp-8);
  border-bottom: 1px solid var(--rule);
  overflow: hidden;
}
[data-direction="foundry"] .foundry-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0 31px,
    rgba(31,29,23,.05) 31px 32px
  );
  pointer-events: none;
}
[data-direction="foundry"] .foundry-hero__inner {
  position: relative;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: var(--sp-7);
  align-items: end;
}
[data-direction="foundry"] .foundry-hero__plate {
  border: 1px solid var(--ref-ink-700);
  background: var(--bg-raised);
  padding: 24px;
  position: relative;
}
[data-direction="foundry"] .foundry-hero__plate::after {
  content: "fig. 1";
  position: absolute;
  bottom: -10px; right: 12px;
  background: var(--bg);
  padding: 0 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* Foundry icon stroke logic — hairline ink with a single warm stroke */
[data-direction="foundry"] .icon-cell__svg { stroke: var(--ref-ink-900); }

/* Letterpress-y small caps */
[data-direction="foundry"] .smallcaps {
  font-family: var(--font-display);
  font-variant: small-caps;
  letter-spacing: .14em;
  font-weight: 500;
}

/* Marginalia */
[data-direction="foundry"] .marginalia {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--ref-primary-700);
  font-size: 14px;
  line-height: 1.5;
  border-left: 1px solid var(--ref-primary-700);
  padding-left: 14px;
}

/* Section title underline */
[data-direction="foundry"] .s__title::after {
  content: "";
  display: block;
  width: 56px;
  height: 1px;
  background: var(--ref-ink-900);
  margin-top: 14px;
}

[data-direction="foundry"] .swatch__chip { border-radius: 0; border: 1px solid var(--ref-ink-100); }
[data-direction="foundry"] .logo-cell { border-radius: 0; }
[data-direction="foundry"] .product-card { border-radius: 0; }

/* ---------- Foundry-specific motion ---------- */
@keyframes f-ink-bloom {
  0%   { transform: scale(.4); opacity: 0; filter: blur(2px); }
  60%  { opacity: 1; filter: blur(.4px); }
  100% { transform: scale(1); opacity: 1; filter: blur(0); }
}
@keyframes f-rule-draw {
  0%   { stroke-dashoffset: 220; }
  100% { stroke-dashoffset: 0; }
}
@keyframes f-page-turn {
  0%, 100% { transform: rotateY(0); }
  50%       { transform: rotateY(-18deg); }
}
@keyframes f-cursor-blink {
  0%, 50%  { opacity: 1; }
  51%, 100% { opacity: 0; }
}
@keyframes f-dust {
  0%, 100% { transform: translate(0,0); }
  50%      { transform: translate(0,-2px); }
}

[data-direction="foundry"] .motion-stage--bloom .ink {
  width: 36px; height: 36px;
  background: radial-gradient(circle at 35% 35%, #4A2818, #1F1D17 70%);
  border-radius: 50%;
  animation: f-ink-bloom 1800ms var(--ease-emph) infinite;
}
[data-direction="foundry"] .motion-stage--rule svg path {
  stroke-dasharray: 220;
  animation: f-rule-draw 2400ms var(--ease-standard) infinite;
}
[data-direction="foundry"] .motion-stage--page {
  perspective: 800px;
}
[data-direction="foundry"] .motion-stage--page .leaf {
  width: 80px; height: 100px;
  background: var(--bg-raised);
  border: 1px solid var(--ref-ink-300);
  transform-origin: left center;
  animation: f-page-turn 3200ms var(--ease-emph) infinite;
}
[data-direction="foundry"] .motion-stage--cursor::after {
  content: "";
  display: block;
  width: 2px; height: 28px;
  background: var(--ref-primary-700);
  animation: f-cursor-blink 1100ms steps(1) infinite;
}

/* Product card flourishes */
[data-direction="foundry"] .product-card.timeline {
  background: repeating-linear-gradient(
    to bottom,
    var(--bg-raised) 0 31px,
    var(--ref-paper-100) 31px 32px
  );
}
[data-direction="foundry"] .product-card .product-row {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 14px;
  padding: 8px 0;
  border-bottom: 1px solid var(--rule);
  align-items: baseline;
  font-size: 13px;
}
[data-direction="foundry"] .product-card .product-row:last-child { border-bottom: none; }
[data-direction="foundry"] .product-card .product-row__date {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: .06em;
  text-transform: uppercase;
}
[data-direction="foundry"] .product-card .product-row__body {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 16px;
  color: var(--text);
}
[data-direction="foundry"] .product-card .product-row__tag {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ref-primary-700);
  border: 1px solid var(--ref-primary-700);
  padding: 2px 6px;
  border-radius: 1px;
}
