/* Subteam hub + detail pages (extends ../style.css) */
.subteam-hub {
  padding: 48px 7% 96px;
  max-width: 1100px;
  margin: 0 auto;
}

.subteam-hub-intro {
  text-align: center;
  margin-bottom: 48px;
}

.subteam-hub-intro p {
  max-width: 52ch;
  margin: 0 auto;
  line-height: 1.75;
  color: #555;
}

.subteam-hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

a.subteam-page-card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: #fff;
  border: 1px solid rgba(232, 164, 184, 0.35);
  border-radius: 28px;
  padding: 36px 28px;
  text-align: center;
  transition: var(--transition);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
}

a.subteam-page-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 48px rgba(31, 92, 58, 0.12);
  border-color: rgba(31, 92, 58, 0.18);
}

a.subteam-page-card:focus-visible {
  outline: 2px solid var(--header-green);
  outline-offset: 4px;
}

.subteam-page-card .card-icon {
  font-size: 2.5rem;
  margin-bottom: 16px;
}

.subteam-page-card h2 {
  font-size: 1.5rem;
  margin-bottom: 10px;
  color: var(--header-green);
}

.subteam-page-card p {
  font-size: 0.95rem;
  line-height: 1.65;
  color: #5a5a5a;
  margin: 0;
}

.subteam-page-card .card-hint {
  display: inline-block;
  margin-top: 18px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--pink-rose);
}

/* Detail page layout */
.subteam-detail {
  padding: 40px 7% 80px;
  max-width: 900px;
  margin: 0 auto;
}

.subteam-detail h1 {
  font-family: var(--font-heading);
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  color: var(--header-green);
  margin-bottom: 12px;
}

.subteam-lede {
  font-size: 1.05rem;
  line-height: 1.75;
  color: #444;
  margin-bottom: 36px;
  max-width: 65ch;
}

.logo-link {
  text-decoration: none;
  color: inherit;
}

/* Wiring: schematic figures */
.schematic-grid {
  display: grid;
  gap: 28px;
}

.schematic-figure {
  background: #fff;
  border-radius: 20px;
  border: 1px solid rgba(232, 164, 184, 0.3);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

.schematic-figure figcaption {
  padding: 14px 18px;
  font-size: 0.92rem;
  color: #555;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  background: rgba(252, 238, 242, 0.35);
}

.schematic-placeholder {
  aspect-ratio: 16 / 10;
  background: linear-gradient(145deg, #fafafa, #f0f4f1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #8a9a8e;
  font-style: italic;
  font-size: 0.95rem;
  padding: 24px;
  text-align: center;
}

.schematic-placeholder img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* Software: scrollable code */
.code-panel {
  background: #1a1f1c;
  border-radius: 16px;
  border: 1px solid rgba(31, 92, 58, 0.35);
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

.code-panel-header {
  padding: 10px 16px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #a8c4b0;
  background: rgba(0, 0, 0, 0.35);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.code-scroll {
  max-height: min(420px, 55vh);
  overflow: auto;
  margin: 0;
  padding: 20px 22px 24px;
  font-family: ui-monospace, "SF Mono", Menlo, Monaco, Consolas, monospace;
  font-size: 0.82rem;
  line-height: 1.55;
  color: #e8f0eb;
  tab-size: 4;
}

.code-scroll::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.code-scroll::-webkit-scrollbar-thumb {
  background: rgba(124, 185, 122, 0.35);
  border-radius: 8px;
}

.code-scroll::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}

.code-scroll .kw {
  color: #e8a4b8;
}

.code-scroll .fn {
  color: #9ad498;
}

.code-scroll .str {
  color: #c5e6c8;
}

.code-scroll .com {
  color: #6b7f72;
  font-style: italic;
}

/* Mechanical: Three.js viewport */
/* .cad-viewport-wrap {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(232, 164, 184, 0.35);
  background: linear-gradient(180deg, #eef5f0 0%, #dfece2 100%);
  box-shadow: var(--shadow-soft);
}

.cad-viewport {
  display: block;
  width: 100%;
  height: min(420px, 55vh);
  touch-action: none;
}

.cad-viewport-caption {
  padding: 12px 16px;
  font-size: 0.85rem;
  color: #4a5c50;
  background: rgba(255, 255, 255, 0.75);
  border-top: 1px solid rgba(31, 92, 58, 0.1);
} */

.pipeline-desc {
  margin-top: 20px;
  font-size: 0.92rem;
  line-height: 1.8;
  color: #444;
}

.pipeline-desc p {
  margin: 0 0 12px;
}

.pipeline-desc p:last-child {
  margin-bottom: 0;
}

.tech-stack-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  font-size: 0.88rem;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(232, 164, 184, 0.35);
}

.tech-stack-table th {
  background: rgba(31, 92, 58, 0.08);
  color: var(--header-green);
  font-weight: 700;
  padding: 10px 14px;
  text-align: left;
  border-bottom: 2px solid rgba(31, 92, 58, 0.18);
}

.tech-stack-table td {
  padding: 9px 14px;
  border-bottom: 1px solid rgba(232, 164, 184, 0.25);
  color: #444;
  vertical-align: top;
}

.tech-stack-table tr:last-child td {
  border-bottom: none;
}

.tech-stack-table tr:hover td {
  background: rgba(252, 238, 242, 0.45);
}

.tech-stack-table td:first-child {
  font-family: ui-monospace, "SF Mono", Menlo, Monaco, Consolas, monospace;
  font-size: 0.82rem;
  color: var(--header-green);
  white-space: nowrap;
}

.pipeline-desc {
  margin-top: 20px;
  font-size: 0.92rem;
  line-height: 1.8;
  color: #444;
}

.pipeline-desc p {
  margin: 0 0 12px;
}

.pipeline-desc p:last-child {
  margin-bottom: 0;
}

.tech-stack-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  font-size: 0.88rem;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(232, 164, 184, 0.35);
}

.tech-stack-table th {
  background: rgba(31, 92, 58, 0.08);
  color: var(--header-green);
  font-weight: 700;
  padding: 10px 14px;
  text-align: left;
  border-bottom: 2px solid rgba(31, 92, 58, 0.18);
}

.tech-stack-table td {
  padding: 9px 14px;
  border-bottom: 1px solid rgba(232, 164, 184, 0.25);
  color: #444;
  vertical-align: top;
}

.tech-stack-table tr:last-child td {
  border-bottom: none;
}

.tech-stack-table tr:hover td {
  background: rgba(252, 238, 242, 0.45);
}

.tech-stack-table td:first-child {
  font-family: ui-monospace, "SF Mono", Menlo, Monaco, Consolas, monospace;
  font-size: 0.82rem;
  color: var(--header-green);
  white-space: nowrap;
}

.back-link {
  display: inline-block;
  margin-bottom: 28px;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--header-green);
  text-decoration: none;
}

.back-link:hover {
  text-decoration: underline;
}

/* Story content within subteam detail pages */
.story-label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--pink-rose);
  background: rgba(199, 95, 122, 0.08);
  border: 1px solid rgba(199, 95, 122, 0.2);
  border-radius: 999px;
  padding: 5px 14px;
  margin-bottom: 12px;
}

.story-label.mech-label {
  color: var(--header-green);
  background: rgba(31, 92, 58, 0.07);
  border-color: rgba(31, 92, 58, 0.18);
}

.story-subtitle-lede {
  color: var(--pink-rose);
  font-style: italic;
  font-size: 1rem;
  margin-top: 0;
  margin-bottom: 28px;
}

.subteam-detail h1 + .story-subtitle-lede {
  margin-top: -8px;
}

.story-body {
  border-top: 1px solid rgba(232, 164, 184, 0.3);
  padding-top: 28px;
  margin-bottom: 48px;
}

.story-body p {
  font-size: clamp(0.95rem, 1.8vw, 1.03rem);
  line-height: 1.85;
  color: #444;
  margin: 0 0 18px;
  text-wrap: pretty;
}

.story-body q {
  font-style: italic;
  color: var(--header-green);
  quotes: "\201C" "\201D";
}

.story-body q::before {
  content: open-quote;
}
.story-body q::after {
  content: close-quote;
}

.story-section-heading {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-dark);
  margin: 36px 0 14px;
  letter-spacing: -0.01em;
}

.story-section-heading:first-child {
  margin-top: 0;
}

.schematic-section-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
  color: #888;
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.schematic-section-divider::before,
.schematic-section-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(232, 164, 184, 0.4);
}

#viewer {
  width: 100%;
  height: 500px;
  background: #111;
  position: relative;
  border-radius: 12px;
  overflow: hidden;
}
#loader {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  opacity: 0.7;
}
.cad-viewport-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #1a1e24;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #e2ddd8;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.12);
}

#cad-canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.cad-loader {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  background: #1a1e24;
  z-index: 10;
  transition:
    opacity 0.5s ease,
    visibility 0.5s ease;
}

.cad-loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.cad-spinner {
  width: 36px;
  height: 36px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-top-color: #4af0c4;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.cad-loader-text {
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
  font-family: "DM Sans", sans-serif;
}

.cad-viewport-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.55rem 1rem;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(6px);
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: "DM Sans", sans-serif;
}

.cad-corner {
  position: absolute;
  width: 16px;
  height: 16px;
  pointer-events: none;
  z-index: 5;
}

.cad-corner--tl {
  top: 10px;
  left: 10px;
  border-top: 2px solid #4af0c4;
  border-left: 2px solid #4af0c4;
}

.cad-corner--br {
  bottom: 40px;
  right: 10px;
  border-bottom: 2px solid #4af0c4;
  border-right: 2px solid #4af0c4;
}
