/* Triton Staging — "Engineering, Not Installation" section
   Self-contained styles for the new index showcase. Reuses page tokens
   (--tt-*) so palettes in theme-switcher.css recolor it automatically. */

.eng-discipline {
  background:
    radial-gradient(ellipse 60% 60% at 15% 10%, rgba(16,66,122,.05) 0%, transparent 55%),
    radial-gradient(ellipse 60% 60% at 90% 95%, rgba(201,166,99,.06) 0%, transparent 55%),
    var(--tt-paper-2);
  position: relative;
}

/* Faint engineering-paper grid behind the section */
.eng-discipline::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--tt-gray-line, rgba(15,26,42,.08)) 1px, transparent 1px),
    linear-gradient(90deg, var(--tt-gray-line, rgba(15,26,42,.08)) 1px, transparent 1px);
  background-size: 40px 40px;
  opacity: .45;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 0%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 0%, transparent 80%);
}

.eng-discipline .container { position: relative; z-index: 1; }

.eng-discipline .section-header { text-align: center; margin-left: auto; margin-right: auto; }

/* 2x2 grid */
.eng-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.75rem;
  margin-top: 3rem;
}

.eng-card {
  background: var(--tt-paper);
  border: 1px solid var(--tt-gray-line);
  border-radius: 4px;
  padding: 1.75rem 1.75rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  position: relative;
  transition: border-color .25s ease, box-shadow .25s ease, transform .25s ease;
}
.eng-card:hover {
  border-color: var(--tt-blue-soft-3, rgba(16,66,122,.22));
  box-shadow: 0 2px 6px rgba(15,26,42,.06), 0 16px 36px rgba(15,26,42,.08);
  transform: translateY(-2px);
}

/* Brass corner brackets — matches the hero-image-frame treatment */
.eng-card::before,
.eng-card::after {
  content: '';
  position: absolute;
  width: 1.4rem;
  height: 1.4rem;
  border: 1.5px solid var(--tt-brass);
  pointer-events: none;
  opacity: 0;
  transition: opacity .25s ease;
}
.eng-card::before { top: -.25rem; left: -.25rem; border-right: none; border-bottom: none; }
.eng-card::after  { bottom: -.25rem; right: -.25rem; border-left: none; border-top: none; }
.eng-card:hover::before,
.eng-card:hover::after { opacity: 1; }

/* SVG container — frames the drawing like a paper card */
.eng-card .eng-svg-frame {
  position: relative;
  background:
    linear-gradient(180deg, var(--tt-paper-2), var(--tt-paper-3));
  border: 1px solid var(--tt-gray-line);
  border-radius: 2px;
  aspect-ratio: 5 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.eng-card .eng-svg {
  width: 100%;
  height: 100%;
  display: block;
  /* Strokes inherit color from this element via currentColor */
  color: var(--tt-ink-2);
}

/* Mono label class used inside the SVGs */
.eng-svg-mono {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-feature-settings: 'tnum';
}
.eng-svg text { font-family: 'JetBrains Mono', ui-monospace, monospace; }

/* Card body */
.eng-card h3 {
  font-family: 'Newsreader', Georgia, serif;
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--tt-ink);
  line-height: 1.2;
  letter-spacing: -.01em;
  margin: 0;
}
.eng-card h3 em,
html body .eng-card h3 em {
  font-family: 'Lora', Georgia, serif !important;
  font-style: italic !important;
  color: var(--tt-blue) !important;
  font-weight: 500 !important;
  font-synthesis-style: none !important;
}
.eng-card p {
  font-size: 0.938rem;
  color: var(--tt-ink-3);
  line-height: 1.6;
  margin: 0;
  flex: 1;
}

.eng-card-foot {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.688rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--tt-blue);
  padding-top: .85rem;
  border-top: 1px solid var(--tt-gray-line);
  display: flex;
  align-items: center;
  gap: .5rem;
}
.eng-card-foot::before {
  content: '';
  display: inline-block;
  width: .65rem;
  height: 1px;
  background: currentColor;
  opacity: .7;
}

/* Dark-theme niceties: the brass corner brackets become slightly brighter,
   and the paper-frame gradient flips automatically because --tt-paper-2/3
   are redefined by the theme. The SVG strokes follow --tt-ink-2 which
   is white on dark themes — so they remain legible without any override. */

/* Shared-module placeholder: lets the injected <svg> lay out as if it were
   the direct child of .eng-svg-frame (matches the original inline structure). */
.eng-svg-placeholder { display: contents; }

/* ------------------------------------------------------------------ */
/* SINGLE-CARD VARIANT — used on service pages.                        */
/* Two columns on desktop: SVG figure left, copy right. Mobile stacks. */
/* ------------------------------------------------------------------ */
.eng-discipline--single .eng-split {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: clamp(2rem, 4vw, 3.5rem);
  align-items: center;
  max-width: 1100px;
  margin: 3rem auto 0;
}

.eng-discipline--single .eng-split > .eng-svg-frame {
  /* Reuse the same paper-gradient frame, larger here since it's the focal element */
  background: linear-gradient(180deg, var(--tt-paper-2), var(--tt-paper-3));
  border: 1px solid var(--tt-gray-line);
  border-radius: 2px;
  aspect-ratio: 5 / 3;
  position: relative;
  overflow: hidden;
}
.eng-discipline--single .eng-split > .eng-svg-frame .eng-svg {
  width: 100%;
  height: 100%;
  display: block;
  color: var(--tt-ink-2);
}

.eng-discipline--single .eng-card-body {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.eng-discipline--single .eng-card-body h3 {
  font-family: 'Newsreader', Georgia, serif;
  font-size: clamp(1.375rem, 2vw, 1.75rem);
  font-weight: 500;
  color: var(--tt-ink);
  line-height: 1.2;
  letter-spacing: -.012em;
  margin: 0;
}
.eng-discipline--single .eng-card-body h3 em,
html body .eng-discipline--single .eng-card-body h3 em {
  font-family: 'Lora', Georgia, serif !important;
  font-style: italic !important;
  color: var(--tt-blue) !important;
  font-weight: 500 !important;
  font-synthesis-style: none !important;
}
.eng-discipline--single .eng-card-body p {
  font-size: 1rem;
  color: var(--tt-ink-3);
  line-height: 1.65;
  margin: 0;
}
.eng-discipline--single .eng-card-body .eng-card-foot {
  /* Inherits global .eng-card-foot styles from above */
  margin-top: .25rem;
}

/* Responsive */
@media (max-width: 1024px) {
  .eng-grid { gap: 1.25rem; margin-top: 2.5rem; }
  .eng-card { padding: 1.4rem; }
  .eng-discipline--single .eng-split {
    grid-template-columns: 1fr;
    max-width: 720px;
  }
}
@media (max-width: 720px) {
  .eng-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .eng-card, .eng-card::before, .eng-card::after { transition: none; }
}
