/* ============================================
   ARKSPAN — PAGE MODULES
   Restyled to the Tesla system: full-bleed panels,
   hairline grids, flat tiles, zero radius.
   ============================================ */

/* ============================================
   HERO — media panel + slideshow
   ============================================ */
.tv-hero {
  min-height: var(--viewport-section);
}
/* The hero slides are bare photos — no scrim of their own — so white type
   sat directly on the image and washed out on the brighter slides. Sits at
   z-index:-1, between .tv-hero__slides (-2) and the content above it. */
.tv-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.58) 0%,
    rgba(0, 0, 0, 0.46) 38%,
    rgba(0, 0, 0, 0.4) 62%,
    rgba(0, 0, 0, 0.62) 100%
  );
}
.tv-hero__slides {
  position: absolute;
  inset: 0;
  z-index: -2;
}
.tv-hero__slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1.2s ease-in-out;
  will-change: opacity;
}
.tv-hero__slide.is-active {
  opacity: 1;
}
.tv-hero__dots {
  position: absolute;
  left: 50%;
  bottom: var(--space-12);
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 3;
}
.tv-hero__dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: none;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.38);
  cursor: pointer;
  transition: all var(--transition-base);
}
.tv-hero__dot.is-active {
  background: #fff;
  width: 26px;
}
.tv-hero--dots .tv-scroll {
  bottom: var(--space-12);
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .tv-hero__slide {
    transition: none;
  }
}

/* ============================================
   STAT / SPEC ROW
   ============================================ */
.tv-specs--dark .tv-specs {
  border-color: rgba(255, 255, 255, 0.18);
}
.tv-specs--dark .tv-specs__cell {
  border-color: rgba(255, 255, 255, 0.18);
}
.tv-specs--dark .tv-specs__value {
  color: #fff;
}
.tv-specs--dark .tv-specs__label {
  color: rgba(255, 255, 255, 0.66);
}

/* ============================================
   PRODUCT CATALOGUE
   ============================================ */
.product-catalogue__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: var(--space-10);
  margin-bottom: var(--space-12);
}
.product-catalogue__header h2 {
  font-size: var(--display-md);
  font-weight: 300;
  letter-spacing: var(--tracking-display);
}
.product-catalogue__header p {
  max-width: 46ch;
  font-size: var(--text-base);
  color: var(--text-secondary);
}

.product-filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-10);
}
.product-filter {
  min-height: 36px;
  padding: 0 var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: var(--tracking-nav);
  text-transform: uppercase;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.product-filter:hover {
  border-color: var(--text-primary);
  color: var(--text-primary);
}
.product-filter.is-active {
  background: #000;
  border-color: #000;
  color: #fff;
}
[data-theme='dark'] .product-filter.is-active {
  background: #fff;
  border-color: #fff;
  color: #000;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr));
  gap: 1px;
  background: var(--border-light);
  border: 1px solid var(--border-light);
}
.product-loading {
  grid-column: 1 / -1;
  min-height: 220px;
  display: grid;
  place-content: center;
  text-align: center;
  color: var(--text-muted);
  background: var(--bg-primary);
}

.product-card {
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: var(--text-primary);
  transition: background var(--transition-base);
}
.product-card:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}
.product-card__visual {
  height: 200px;
  background-size: cover;
  background-position: center;
}
.product-card__signal {
  height: 200px;
  display: flex;
  align-items: flex-end;
  gap: 6px;
  padding: var(--space-6);
  background: linear-gradient(160deg, var(--bg-tertiary), var(--bg-primary));
}
.product-card__signal span {
  flex: 1;
  background: linear-gradient(to top, var(--accent), transparent);
  opacity: 0.85;
}
.product-card__signal span:nth-child(1) {
  height: 40%;
}
.product-card__signal span:nth-child(2) {
  height: 78%;
}
.product-card__signal span:nth-child(3) {
  height: 58%;
}
.product-card__body {
  padding: clamp(1.5rem, 2.5vw, 2.25rem);
  display: flex;
  flex-direction: column;
  flex: 1;
}
.product-card__category {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: var(--tracking-nav);
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--space-2);
}
.product-card__title {
  font-size: var(--text-2xl);
  font-weight: 400;
  letter-spacing: var(--tracking-tight);
  margin-bottom: var(--space-2);
}
.product-card__desc {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-5);
}
.product-card__meta {
  margin-top: auto;
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}
.product-card__link {
  display: block;
  margin-top: var(--space-4);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-primary);
}
.product-card:hover .product-card__link {
  color: var(--accent);
}

/* ============================================
   PRODUCT DETAIL PAGE
   ============================================ */
.product-page__hero {
  position: relative;
  min-height: 92vh;
  display: flex;
  align-items: flex-end;
  padding: calc(var(--header-height) + var(--space-16)) 0 var(--space-20);
  background: var(--bg-dark);
  color: #fff;
  overflow: hidden;
}
.product-page__hero-grid {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 3rem);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
}
.product-back {
  display: inline-block;
  margin-bottom: var(--space-8);
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.7);
}
.product-back:hover {
  color: #fff;
}
.product-page__eyebrow {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}
.product-page__eyebrow > span:first-child {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: var(--tracking-nav);
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.68);
}
.product-page__hero h1 {
  font-size: var(--display-lg);
  font-weight: 300;
  color: #fff;
  margin-bottom: var(--space-4);
}
.product-page__tagline {
  font-size: var(--text-xl);
  color: rgba(255, 255, 255, 0.82);
  margin-bottom: var(--space-5);
}
.product-page__intro {
  font-size: var(--text-base);
  color: rgba(255, 255, 255, 0.72);
  max-width: 54ch;
  margin-bottom: var(--space-8);
}
.product-page__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}
.product-page__visual {
  min-height: 380px;
  background-size: cover;
  background-position: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
}
.product-page__visual--abstract {
  display: grid;
  align-content: end;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2px;
  padding: var(--space-8);
  background: #0a0a0a;
}
.product-page__visual--abstract div {
  height: 110px;
  background: linear-gradient(to top, var(--accent), transparent);
}
.product-page__visual--abstract div:nth-child(2) {
  height: 240px;
}
.product-page__visual--abstract div:nth-child(3) {
  height: 160px;
}

.product-proof__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr));
}
.product-proof__grid > div {
  padding: var(--space-8) var(--space-4);
  border-right: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  flex-direction: column-reverse;
  gap: var(--space-2);
  text-align: center;
}
.product-proof__grid > div:last-child {
  border-right: none;
}
.product-proof__grid strong {
  font-size: var(--display-sm);
  font-weight: 300;
  letter-spacing: var(--tracking-display);
  color: var(--text-primary);
}
.product-proof__grid span {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.product-page__content {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
  gap: clamp(2rem, 5vw, 5rem);
}
.product-page__content h2 {
  margin-bottom: var(--space-4);
}
.product-page__content p {
  font-size: var(--text-lg);
}
.product-facts {
  border-top: 1px solid var(--border-light);
  padding-top: var(--space-6);
  display: grid;
  align-content: start;
  gap: var(--space-5);
}
.product-facts div {
  display: grid;
  gap: 2px;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: var(--space-4);
}
.product-facts span {
  font-size: 10px;
  letter-spacing: var(--tracking-nav);
  text-transform: uppercase;
  color: var(--text-muted);
}
.product-facts strong {
  font-size: var(--text-sm);
  font-weight: 500;
}
.product-feature-list {
  list-style: none;
  display: grid;
  gap: 0;
  margin-top: var(--space-8);
  border-top: 1px solid var(--border-light);
}
.product-feature-list li {
  display: flex;
  gap: var(--space-3);
  color: var(--text-secondary);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border-light);
}
.product-feature-list li::before {
  content: '—';
  color: var(--accent);
  flex-shrink: 0;
}

.product-module-grid,
.product-workflow {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr));
  gap: 1px;
  background: var(--border-light);
  border: 1px solid var(--border-light);
}
.product-module-grid > div,
.product-workflow > div {
  background: var(--bg-primary);
  padding: var(--space-6);
}
.product-module-grid strong,
.product-workflow strong {
  display: block;
  font-weight: 500;
  margin-bottom: var(--space-2);
}
.product-module-grid span,
.product-workflow span {
  color: var(--text-secondary);
  font-size: var(--text-sm);
}
.product-workflow > div {
  border-top: 2px solid var(--accent);
}
.product-workflow > div::before {
  content: 'STEP';
  display: block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: var(--tracking-nav);
  color: var(--accent);
  margin-bottom: var(--space-3);
}
.product-page__cta {
  background: #000;
  color: #fff;
}
.product-page__cta h2 {
  color: #fff;
}
.product-page__cta p {
  color: rgba(255, 255, 255, 0.72);
}
.product-page__cta .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-8);
  flex-wrap: wrap;
}

/* ============================================
   RESEARCH
   ============================================ */
.research-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(360px, 100%), 1fr));
  gap: 1px;
  background: var(--border-light);
  border: 1px solid var(--border-light);
}
.research-card {
  background: var(--bg-primary);
  padding: clamp(1.5rem, 3vw, 2.5rem);
  display: flex;
  flex-direction: column;
  transition: background var(--transition-base);
}
.research-card:hover {
  background: var(--bg-tertiary);
}
.research-card__meta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  font-size: var(--text-xs);
  color: var(--text-muted);
}
.research-card__title {
  font-size: var(--text-2xl);
  font-weight: 400;
  letter-spacing: var(--tracking-tight);
  margin-bottom: var(--space-3);
}
.research-card__desc {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-5);
}
.research-card .btn {
  align-self: flex-start;
  margin-top: auto;
}

/* ============================================
   CAREERS
   ============================================ */
.job-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
  gap: 1px;
  background: var(--border-light);
  border: 1px solid var(--border-light);
}
.job-card {
  background: var(--bg-primary);
  padding: clamp(1.5rem, 3vw, 2.25rem);
  display: flex;
  flex-direction: column;
  transition: background var(--transition-base);
}
.job-card:hover {
  background: var(--bg-tertiary);
}
.job-card__title {
  font-size: var(--text-xl);
  font-weight: 500;
  margin-bottom: var(--space-2);
}
.job-card__dept {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: var(--tracking-nav);
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--space-3);
}
.job-card__meta {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-bottom: var(--space-4);
}
.job-card__desc {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-5);
}
.job-card__cta {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

/* ============================================
   CONTACT
   ============================================ */
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: start;
}
.contact-info {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--border-light);
}
.contact-info-card {
  padding: var(--space-5) 0;
  border-bottom: 1px solid var(--border-light);
}
.contact-info-card h5 {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: var(--tracking-nav);
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--space-2);
}
.contact-info-card p {
  font-size: var(--text-base);
  color: var(--text-primary);
}
.contact-info-card a {
  color: var(--accent);
}

/* ============================================
   LEGAL / POLICY
   ============================================ */
.policy-content {
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  max-width: 72ch;
}
.policy-content h2 {
  font-size: var(--text-2xl);
  font-weight: 400;
  letter-spacing: var(--tracking-tight);
  margin: var(--space-10) 0 var(--space-4);
}
.policy-content h2:first-child {
  margin-top: 0;
}
.policy-content p {
  margin-bottom: var(--space-4);
}
.policy-content ul {
  margin-bottom: var(--space-4);
  padding-left: var(--space-6);
}
.policy-content li {
  margin-bottom: var(--space-2);
  color: var(--text-secondary);
}
.policy-meta {
  font-size: var(--text-sm);
  color: var(--text-muted);
  padding-bottom: var(--space-5);
  border-bottom: 1px solid var(--border-light);
  margin-bottom: var(--space-8);
}

/* ============================================
   LOGIN
   ============================================ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  background: var(--bg-primary);
}
.login-card {
  width: 100%;
  max-width: 400px;
}
.login-card__header {
  text-align: center;
  margin-bottom: var(--space-8);
}
.login-card__logo {
  font-size: var(--text-3xl);
  font-weight: 300;
  letter-spacing: var(--tracking-display);
  color: var(--text-primary);
}
.login-card__subtitle {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-top: var(--space-2);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
  .product-grid,
  .research-grid,
  .job-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
  }
  .product-page__hero-grid {
    grid-template-columns: 1fr;
  }
  .product-page__visual {
    min-height: 260px;
  }
  .product-page__content {
    grid-template-columns: 1fr;
  }
  .contact-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .product-grid,
  .research-grid,
  .job-grid {
    grid-template-columns: 1fr;
  }
  .product-catalogue__header,
  .product-page__cta .container {
    display: block;
  }
  .product-catalogue__header p {
    margin-top: var(--space-4);
  }
  .product-page__cta .btn {
    margin-top: var(--space-5);
  }
  .product-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ============================================
   FOCAL POINT
   background-size:cover only keeps the subject if we say where it is.
   A portrait viewport crops the SIDES of a landscape image; a landscape
   viewport crops the TOP and BOTTOM. Those are different axes, so each
   full-bleed surface takes two controls:

     --bg-pos    focal point on a landscape viewport  ("x y")
     --bg-pos-m  focal point on a portrait viewport   ("x y")

   Default is centre, so nothing changes until a value is set inline.
   Lives in pages.css because this file loads last and has to override
   the plain `background-position: center` declared for each surface.
   ============================================ */
.tv-section__media,
.tv-hero__slide,
.product-page__visual {
  background-position: var(--bg-pos, center);
}
@media (max-aspect-ratio: 1/1) {
  .tv-section__media,
  .tv-hero__slide,
  .product-page__visual {
    background-position: var(--bg-pos-m, var(--bg-pos, center));
  }
}

/* Card strips are fixed-height and always landscape, so they only ever lose
   top and bottom — one Y control covers both phone and desktop. */
.product-card__visual,
.mega__visual,
.sheet-product__visual {
  background-position: center var(--bg-pos-y, center);
}