/* Endymion — editorial black/white, based on togetherlights design system */

:root {
  --color-bg: #fff;
  --color-text: #111;
  --color-text-muted: #555;
  --color-border: #d4d4d4;
  --color-surface: #f5f5f5;
  --color-accent: #0b3c5d;
  --color-hover: #328cc1;
  --font-sans: "PT Sans Narrow", "Helvetica Neue", helvetica, arial, sans-serif;
  --wrapper: min(52rem, calc(100vw - 2.5rem));
  --radius: 0.25rem;
  --color-page-outer: #1d2731;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 1.125rem;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: clamp(0.35rem, 2.4vw, 1.25rem);
  background: var(--color-page-outer);
  color: var(--color-text);
  font-family: var(--font-sans);
  line-height: 1.35;
}

main,
section,
header,
footer,
article,
details,
summary {
  display: block;
}

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

p {
  margin: 0 0 1.25rem;
}

p:last-child {
  margin-bottom: 0;
}

a {
  color: var(--color-text);
  text-decoration: underline;
  text-decoration-thickness: 0.07em;
  text-underline-offset: 0.15em;
}

a:hover {
  background: var(--color-hover);
  color: var(--color-text);
  opacity: 1;
}

a:focus-visible {
  outline: 2px solid var(--color-hover);
  outline-offset: 0.15rem;
}

button:focus-visible {
  outline: 2px solid var(--color-hover);
  outline-offset: 0.15rem;
}

button {
  font: inherit;
}

/* ─── Layout ─────────────────────────────────────────── */

.mainbox {
  width: var(--wrapper);
  max-width: 100%;
  margin-inline: auto;
  background: var(--color-accent);
  border-style: solid;
  border-color: var(--color-accent);
  border-top-width: 0;
  border-left-width: 1vw;
  border-right-width: 1vw;
  border-bottom-width: 4.5vh;
  border-top-left-radius: 3.7vw;
  border-top-right-radius: 3.7vw;
  border-bottom-left-radius: 3.7vw;
  border-bottom-right-radius: 3.7vw;
  box-sizing: border-box;
  overflow: hidden;
}

/* ─── Site header ─────────────────────────────────────── */

.site-header {
  background: var(--color-accent);
  padding: 1.5rem clamp(1rem, 4vw, 2.5rem);
  display: flex;
  align-items: center;
}

.site-header h1 {
  color: #fff;
  margin: 0;
  font-size: 1.35rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#container {
  background: var(--color-bg);
  padding-bottom: 4rem;
}

/* ─── Skip link ──────────────────────────────────────── */

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  padding: 0.6rem 1rem;
  background: var(--color-text);
  color: var(--color-bg);
  border-radius: var(--radius);
}

.skip-link:focus {
  top: 1rem;
}

/* ─── Hero carousel ──────────────────────────────────── */

.hero-section {
  width: 100%;
  overflow: hidden;
  background: #000;
  border-bottom: 1px solid var(--color-border);
  position: relative;
}

.carousel-track {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 70vh;
  overflow: hidden;
  background: #000;
  cursor: pointer;
}

.carousel-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.8s ease-in-out;
  display: block;
}

.carousel-slide.active {
  opacity: 1;
}

.carousel-indicators {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
}

.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #fff;
  opacity: 0.5;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.carousel-dot:hover {
  opacity: 0.8;
}

.carousel-dot.active {
  opacity: 1;
  background-color: #d9b310;
  transform: scale(1.2);
}

/* ─── Overview / body copy ───────────────────────────── */

.overview {
  padding: 2.5rem clamp(1rem, 4vw, 2.5rem) 1rem;
}

.tagline {
  margin: 0 0 2rem;
  color: var(--color-text-muted);
  font-size: 1.25rem;
  line-height: 1.3;
}

.section-label {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: capitalize;
  color: var(--color-text-muted);
  margin: 0 0 0.5rem;
}

.body-copy {
  margin: 0 0 1.1rem;
  max-width: 60ch;
}

/* ─── Divider ─────────────────────────────────────────── */

.rule {
  border: 0;
  border-top: 1px solid var(--color-border);
  margin: 0;
}

/* ─── Accordions ─────────────────────────────────────── */

.accordions {
  border-bottom: 1px solid var(--color-border);
  padding-inline: clamp(1rem, 4vw, 2.5rem);
}

.accordion {
  border-top: 1px solid var(--color-border);
}

.accordion summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 0;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.accordion summary:hover {
  background: var(--color-hover);
  margin-inline: -0.5rem;
  padding-inline: 0.5rem;
}

.accordion summary::-webkit-details-marker {
  display: none;
}

.accordion summary::after {
  content: "▴";
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--color-text-muted);
  flex-shrink: 0;
}

.accordion[open] summary::after {
  content: "▾";
}

.accordion-body {
  padding-bottom: 1.1rem;
  max-width: 60ch;
}

/* ─── Spec table ──────────────────────────────────────── */

.spec-table {
  width: 100%;
  border-collapse: collapse;
}

.spec-table th,
.spec-table td {
  text-align: left;
  padding: 0.55rem 0;
  vertical-align: top;
  border-bottom: 1px solid var(--color-border);
}

.spec-table th {
  width: 8.5rem;
  font-weight: 700;
  padding-right: 1.2rem;
  color: var(--color-text);
  white-space: nowrap;
}

.spec-table tr:last-child th,
.spec-table tr:last-child td {
  border-bottom: 0;
}

/* ─── Footer ──────────────────────────────────────────── */

.site-footer {
  margin-top: 3rem;
  padding-inline: clamp(1rem, 4vw, 2.5rem);
  color: var(--color-text-muted);
}

.site-footer p {
  margin: 0 0 0.6rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  margin-bottom: 0.5rem;
}

.footer-links a {
  color: var(--color-text-muted);
  text-decoration: none;
}

.footer-links a:hover {
  background: var(--color-hover);
  color: var(--color-text);
  opacity: 1;
}

.footer-credit-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--color-text-muted);
  cursor: pointer;
  font: inherit;
  text-decoration: none;
}

.footer-credit-btn:hover {
  background: var(--color-hover);
  color: var(--color-text);
}

.site-footer .footer-credit-text {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-top: 1rem;
  margin-bottom: 0;
}

.site-footer .footer-credit-text[hidden] {
  display: none;
}

/* ─── Responsive ──────────────────────────────────────── */

@media (width <= 56.25rem) {
  body {
    padding: 0.125rem 0.35rem;
  }

  .mainbox {
    border-left-width: 0.5vw;
    border-right-width: 0.5vw;
    border-bottom-width: 2.25vh;
    border-top-left-radius: 1.85vw;
    border-top-right-radius: 1.85vw;
    border-bottom-left-radius: 1.85vw;
    border-bottom-right-radius: 1.85vw;
  }

  .site-header {
    padding: 1.25rem 1rem;
  }
}

@media (width <= 36rem) {
  html {
    font-size: 1rem;
  }

  .carousel-track {
    max-height: 55vh;
  }

  .footer-links {
    flex-direction: column;
    gap: 1rem;
  }

  .spec-table th {
    width: 6.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
