@import url('base.css');

.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  margin-top: 68px;
  overflow: hidden;
}

.hero-bg,
.hero-overlay {
  position: absolute;
  inset: 0;
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.78) brightness(0.46);
}

.hero-overlay {
  background:
    linear-gradient(102deg, rgba(15, 23, 42, 0.9) 0%, rgba(29, 53, 87, 0.86) 46%, rgba(29, 53, 87, 0.38) 100%),
    linear-gradient(180deg, rgba(29, 53, 87, 0.08), transparent 45%);
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 760px;
  padding: 4rem 2rem 4rem 5vw;
}

.hero-tag,
.badge,
.mini-chip,
.gallery-tag,
.sub-card-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.78rem;
  border-radius: 999px;
  font-size: 0.74rem;
  border: 1px solid rgba(29, 53, 87, 0.22);
  background: rgba(29, 53, 87, 0.08);
  color: var(--tech-green);
}

.hero-title {
  font-family: var(--font-title);
  font-size: clamp(3.1rem, 6vw, 5.3rem);
  line-height: 0.98;
  color: var(--white);
  margin: 1.1rem 0 1.2rem;
}

.hero-desc {
  font-size: 1.08rem;
  color: rgba(241, 245, 249, 0.82);
  line-height: 1.85;
  margin-bottom: 1.6rem;
  max-width: 640px;
}

.hero-badges,
.panel-chips,
.gallery-tags,
.hero-actions,
.cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.hero-actions {
  margin-top: 2rem;
}

.summary-band {
  position: relative;
  margin-top: -48px;
  z-index: 3;
}

.summary-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 2rem;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.sum-item {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border);
  backdrop-filter: blur(12px);
  border-radius: var(--radius);
  padding: 1.4rem 1rem;
}

.sum-val {
  display: block;
  font-family: var(--font-title);
  font-size: 1.55rem;
  color: var(--white);
  margin-bottom: 0.2rem;
}

.sum-label {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-light);
}

.pres-layout,
.subsys-layout,
.fab-layout,
.gallery-project {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 2rem;
  align-items: start;
}

.pres-text p,
.subsys-text p {
  color: var(--text-mid);
  line-height: 1.8;
  margin-bottom: 1rem;
}

.info-table,
.workflow-band,
.fab-panel,
.sub-panel,
.cta-band,
.gallery-shell,
.viewer-fallback {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.12);
}

.info-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--border-light);
}

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

.info-key {
  color: var(--text-light);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.info-val {
  color: var(--white);
  font-size: 0.86rem;
  text-align: right;
}

.fig-block {
  overflow: hidden;
  border-radius: calc(var(--radius) + 2px);
  border: 1px solid var(--border);
  background: #ffffff;
}

.fig-block img {
  width: 100%;
  height: 420px;
  object-fit: cover;
}

figcaption {
  padding: 0.8rem 1rem;
  color: var(--text-light);
  font-size: 0.78rem;
  border-top: 1px solid var(--border-light);
}

.workflow-band,
.fab-panel,
.sub-panel,
.gallery-shell,
.viewer-fallback,
.cta-band {
  padding: 1.4rem;
}

.workflow-chain {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1rem;
  align-items: stretch;
}

.workflow-step {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 1rem;
}

.workflow-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  border: 1px solid rgba(29, 53, 87, 0.2);
  background: rgba(29, 53, 87, 0.08);
  color: var(--tech-green);
  font-family: var(--font-mono);
  margin-bottom: 1rem;
}

.workflow-step h4,
.sub-card h3,
.fab-block h3,
.asm-preview-card h4,
.gal-card h4,
.cta-band h2 {
  color: var(--white);
  font-family: var(--font-title);
  margin-bottom: 0.55rem;
}

.workflow-step p,
.sub-card p,
.fab-block p,
.asm-preview-card p,
.gal-card p,
.cta-band p {
  color: var(--text-mid);
  font-size: 0.88rem;
  line-height: 1.7;
}

.workflow-arrow {
  display: grid;
  place-items: center;
  color: var(--text-light);
  font-size: 1.1rem;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.gallery-item {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  min-height: 180px;
  background: var(--surface);
  cursor: pointer;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease, filter 0.5s ease;
}

.gallery-item:hover img {
  transform: scale(1.04);
  filter: brightness(1.08);
}

.gallery-item.featured {
  grid-column: span 2;
  min-height: 320px;
}

.sub-grid,
.fab-grid,
.asm-preview-grid,
.gal-grid {
  display: grid;
  gap: 1rem;
}

.sub-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fab-grid,
.gal-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.asm-preview-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.sub-card,
.fab-block,
.asm-preview-card,
.gal-card {
  padding: 1.35rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #ffffff;
  transition: transform var(--tr), border-color var(--tr), box-shadow var(--tr);
}

.sub-card:hover,
.fab-block:hover,
.asm-preview-card:hover,
.gal-card:hover,
.gallery-shell:hover {
  transform: translateY(-3px);
  border-color: rgba(29, 53, 87, 0.28);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.16);
}

.sub-card ul {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 1rem;
}

.sub-card li {
  color: var(--text-mid);
  font-size: 0.82rem;
  padding-left: 1rem;
  position: relative;
}

.sub-card li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.58em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--tech-green);
}

.viewer-fallback {
  overflow: hidden;
}

.viewer-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-light);
}

.viewer-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.viewer-frame {
  padding: 1rem 0 0;
}

.viewer-frame:first-child {
  padding-right: 1rem;
  border-right: 1px solid var(--border-light);
}

.viewer-frame:last-child {
  padding-left: 1rem;
}

.viewer-frame img {
  border-radius: var(--radius);
  width: 100%;
  height: 280px;
  object-fit: cover;
  border: 1px solid var(--border);
}

.viewer-frame span,
.fab-note {
  display: block;
  margin-top: 0.75rem;
  color: var(--text-light);
  font-size: 0.78rem;
  line-height: 1.7;
}

.fab-block img,
.gal-card img {
  width: 100%;
  height: 210px;
  object-fit: cover;
  border-radius: calc(var(--radius) - 2px);
  margin-bottom: 0.9rem;
  border: 1px solid var(--border);
}

.project-gallery-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  grid-auto-rows: 220px;
  gap: 1rem;
}

.project-gallery-grid .gallery-item:first-child {
  grid-row: span 2;
}

.cta-band {
  margin: 0 2rem 5rem;
  text-align: center;
}

.cta-band p {
  max-width: 720px;
  margin: 0 auto 1.4rem;
}

/* Workflow band inside the software section: span the full width and use 3×2 grid for readability */
#software .pres-layout > .workflow-band { grid-column: 1 / -1; margin-top: 1.5rem; }
#software .workflow-chain { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
.workflow-step h4 { word-break: normal; overflow-wrap: break-word; hyphens: none; }

@media (max-width: 1100px) {
  .workflow-chain { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .summary-inner,
  .fab-grid,
  .gal-grid,
  .asm-preview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .project-gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .project-gallery-grid .gallery-item:first-child { grid-row: span 1; }
}

@media (max-width: 860px) {
  .pres-layout,
  .subsys-layout,
  .fab-layout,
  .gallery-project,
  .viewer-body { grid-template-columns: 1fr; }

  .sub-grid { grid-template-columns: 1fr; }
  .gallery-item.featured { grid-column: span 1; }
  .hero-content { padding: 3rem 1.15rem 3rem; }
  .summary-band { margin-top: 0; }

  .viewer-frame:first-child {
    padding-right: 0;
    border-right: none;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 1rem;
  }

  .viewer-frame:last-child {
    padding-left: 0;
  }
}

@media (max-width: 720px) {
  #software .workflow-chain { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .summary-inner,
  .workflow-chain,
  .fab-grid,
  .gal-grid,
  .asm-preview-grid,
  .project-gallery-grid,
  .gallery-grid { grid-template-columns: 1fr; }

  #software .workflow-chain { grid-template-columns: 1fr; }
  .workflow-arrow { display: none; }
  .cta-band { margin: 0 1.15rem 3.75rem; }
  .hero-title { font-size: 2.6rem; }
  .hero-actions .btn-primary,
  .hero-actions .btn-outline { width: 100%; justify-content: center; }
}
