:root {
  --bg: #0d0d0d;
  --text: #f5f5f5;
  --muted: #cfcfcf;
  --card: #141414;
  --line: #262626;
  --accent: #ff4d00;
}

* {
  box-sizing: border-box
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
}

img {
  max-width: 100%;
  display: block
}

/* Header + Back button */
.page-header {
  padding: 28px 16px 10px
}

.header-row {
  width: 92%;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap
}

.page-header h1 {
  margin: 0;
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  color: var(--accent)
}

.sub {
  margin: 6px 0 0;
  color: var(--muted)
}

.typed-line {
  display: inline-block
}

.typed-base,
.typed-dynamic {
  color: var(--accent)
}

.btn-back {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 0;
  border: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
  background: #0f0f0f;
  transition: background .18s, color .18s, transform .12s
}

.btn-back:hover {
  background: var(--accent);
  color: #111
}

/* Layout */
.container {
  width: 92%;
  max-width: 1200px;
  margin: 0 auto 72px
}

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 28px
}

@media (max-width: 960px) {
  .grid {
    grid-template-columns: 1fr
  }
}

/* Card base */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 0;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .35)
}

.card+.card {
  margin-top: 18px
}

.h2 {
  font-size: 1.1rem;
  margin: 0;
  color: var(--accent)
}

.section-pad {
  padding: 12px 14px
}

/* 3D Viewer */
.viewer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  background: linear-gradient(180deg, rgba(255, 215, 0, .10), rgba(255, 215, 0, .04));
  border-bottom: 1px solid rgba(255, 215, 0, .18)
}

.model-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap
}

.model-tab {
  -webkit-appearance: none;
  appearance: none;
  background: #0f0f0f;
  border: 1px solid #2a2a2a;
  color: #eee;
  padding: 8px 12px;
  border-radius: 0;
  font-size: .9rem;
  cursor: pointer;
  transition: transform .16s, box-shadow .16s, background .18s, color .18s
}

.model-tab.active,
.model-tab:focus-visible {
  background: var(--accent);
  color: #111;
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 215, 0, .25) inset
}

.model-host {
  position: relative;
  width: 100%;
  height: 460px;
  background:
    radial-gradient(80% 60% at 50% 20%, #161616, #0b0b0b 70%)
}

#mv {
  width: 100%;
  height: 100%;
  --poster-color: transparent
}

.viewer-help {
  font-size: .95rem;
  color: #bdbdbd;
  text-align: center;
  padding: 10px 14px;
  border-top: 1px dashed #2a2a2a
}

.diag {
  margin: 10px 12px;
  background: #0f0f0f;
  border: 1px dashed #2a2a2a;
  border-radius: 0;
  padding: 10px 12px
}

.diag summary {
  cursor: pointer;
  color: var(--accent)
}

/* Photo Gallery (below viewer, left column) */
.wg-title {
  color: var(--accent);
  margin: 10px 14px 8px;
  font-size: 1.05rem
}

.wg-carousel {
  position: relative;
  padding: 10px
}

/* --- Carousel fixes --- */
.wg-viewport {
  position: relative;
  overflow: hidden;
  border-radius: 0;
  aspect-ratio: 16 / 9;
}

.wg-track {
  display: flex;
  transition: transform 320ms cubic-bezier(.22, .61, .36, 1);
  will-change: transform;
  height: 100%;
  /* make slides inherit viewport height */
}

.wg-item {
  flex: 0 0 100%;
  user-select: none;
  margin: 0;
  /* <— kills the default figure margins */
  height: 100%;
  display: grid;
  grid-template-rows: 1fr auto;
  /* image takes space, caption sits at bottom */
}

.wg-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* use 'contain' if you prefer letterboxing */
  background: #0b0b0b;
}

.wg-item figcaption {
  font-size: .95rem;
  color: var(--muted);
  text-align: center;
  padding: 8px 10px 2px;
}

.wg-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 0;
  background: #0f0f0f;
  border: 1px solid #2a2a2a;
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  z-index: 2
}

.wg-nav:hover {
  background: var(--accent);
  color: #111
}

.wg-nav.prev {
  left: 12px
}

.wg-nav.next {
  right: 12px
}

.wg-dots {
  display: flex;
  gap: 8px;
  justify-content: center;
  padding: 10px 6px 8px
}

.wg-dots button {
  width: 8px;
  height: 8px;
  border-radius: 0;
  background: #333;
  border: 0;
  cursor: pointer
}

.wg-dots button.active {
  background: var(--accent);
  box-shadow: 0 0 0 2px rgba(255, 215, 0, .25)
}

@media (prefers-reduced-motion: reduce) {
  .wg-track {
    transition: none
  }
}

/* Slides */
.slides-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  background: linear-gradient(180deg, rgba(255, 215, 0, .10), rgba(255, 215, 0, .04));
  border-bottom: 1px solid rgba(255, 215, 0, .18)
}

.slides-embed {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  background: #0b0b0b
}

.slides-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0 0 16px 16px
}

/* Writeup */
.project-writeup h3,
.technical-specs h3,
.key-features h3 {
  margin: 0 0 16px;
  color: var(--accent);
  font-size: 1.1rem;
  letter-spacing: 0.05em;
}

.project-writeup p,
.technical-specs li,
.key-features li {
  color: var(--text);
  line-height: 1.7;
}

.technical-specs ul,
.key-features ul {
  list-style: none;
  padding: 0;
}

.technical-specs li,
.key-features li {
  margin-bottom: 12px;
  padding-left: 20px;
  position: relative;
}

.technical-specs li::before,
.key-features li::before {
  content: '>';
  position: absolute;
  left: 0;
  color: var(--accent);
}

/* Footer */
.footer {
  padding: 24px;
  text-align: center;
  color: var(--muted);
  border-top: 1px solid #1a1a1a
}

/* Custom cursor (only hides system cursor if JS confirms init) */
/* Cursor styles inherited from shared-styles.css */