:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #050505;
  color: #f1f5f0;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% 50%, rgba(70, 76, 66, 0.32), transparent 42rem),
    #050505;
}

.site-nav {
  position: fixed;
  top: 18px;
  right: 20px;
  z-index: 3;
  display: flex;
  gap: 6px;
  padding: 5px;
  border: 1px solid #343a33;
  border-radius: 8px;
  background: rgba(5, 5, 5, 0.76);
  backdrop-filter: blur(10px);
}

.site-nav a {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  padding: 0 10px;
  border-radius: 6px;
  color: #edf3e9;
  font-size: 0.84rem;
  font-weight: 700;
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: #050505;
  background: #e5b86f;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  padding-bottom: max(24px, env(safe-area-inset-bottom));
}

.page-shell {
  min-height: 100vh;
  padding: 96px 24px 42px;
}

.clock-panel {
  width: min(1120px, 100%);
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(340px, 1.2fr);
  grid-template-areas:
    "copy sky"
    "controls sky";
  align-items: center;
  gap: 22px 34px;
}

.copy {
  grid-area: copy;
}

.eyebrow {
  margin: 0 0 10px;
  color: #e5b86f;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  max-width: 12ch;
  color: #ffffff;
  font-size: clamp(2.4rem, 4.4rem, 4.4rem);
  line-height: 0.94;
  letter-spacing: 0;
}

.lead {
  margin: 20px 0 0;
  max-width: 42rem;
  color: #eef2ea;
  font-size: 1.16rem;
  line-height: 1.55;
}

.how-to {
  margin: 20px 0 0;
  max-width: 36rem;
  color: #eef2ea;
  font-size: 1.03rem;
  line-height: 1.6;
}

.controls {
  grid-area: controls;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.mode-toggle {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 34px;
  color: #cfd7cb;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
}

.mode-toggle input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
}

.toggle-track {
  position: relative;
  width: 52px;
  height: 28px;
  border: 1px solid #6f766c;
  border-radius: 8px;
  background: #10120f;
}

.toggle-track::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 18px;
  height: 18px;
  border-radius: 6px;
  background: #e5b86f;
  box-shadow: 0 0 14px rgba(229, 184, 111, 0.58);
  transition: transform 160ms ease;
}

.mode-toggle input:checked + .toggle-track::after {
  transform: translateX(24px);
}

.mode-toggle:has(input:focus-visible) .toggle-track {
  outline: 2px solid #9fc4ce;
  outline-offset: 2px;
}

.sky-stage {
  grid-area: sky;
  width: min(680px, 100%);
  justify-self: center;
  aspect-ratio: 1;
}

#sky-clock {
  width: 100%;
  height: 100%;
  display: block;
}

.clock-ring,
.pole-guide {
  fill: none;
  stroke: #4b5048;
  stroke-width: 1.3;
}

.hour-tick {
  stroke: #70776c;
  stroke-width: 1.1;
}

.hour-tick.major {
  stroke: #d9e2d2;
  stroke-width: 2.1;
}

.hour-label {
  fill: #f2f4ed;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0;
}

.constellation-line {
  stroke: #9fc4ce;
  stroke-width: 2.2;
  stroke-linecap: round;
  opacity: 0.66;
}

.star {
  fill: #f7fff6;
  filter: url("#star-glow");
}

.reference-star {
  fill: #e5b86f;
}

.reference-halo {
  fill: none;
  stroke: #e5b86f;
  stroke-width: 2;
  opacity: 0.9;
}

.pole {
  fill: #ff6b6b;
}

.marketing-page {
  width: min(1120px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(240px, 420px);
  align-items: center;
  gap: 36px;
}

.marketing-copy h1,
.text-page h1 {
  max-width: 13ch;
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.primary-link,
.secondary-link {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border-radius: 8px;
  font-weight: 800;
  text-decoration: none;
}

.primary-link {
  color: #050505;
  background: #e5b86f;
}

.secondary-link {
  border: 1px solid #596158;
  color: #edf3e9;
  background: rgba(255, 255, 255, 0.04);
}

.primary-link:hover,
.primary-link:focus-visible,
.secondary-link:hover,
.secondary-link:focus-visible {
  outline: 2px solid #9fc4ce;
  outline-offset: 2px;
}

.icon-showcase {
  display: grid;
  place-items: center;
}

.icon-showcase img {
  display: block;
  width: min(100%, 310px);
  height: auto;
  border-radius: 28%;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.46);
}

.feature-band,
.support-list {
  width: min(1120px, 100%);
  margin: 42px auto 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.support-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.feature-band article,
.support-list article {
  border: 1px solid #343a33;
  border-radius: 8px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.045);
}

.feature-band h2,
.support-list h2 {
  margin: 0 0 8px;
  color: #ffffff;
  font-size: 1rem;
  line-height: 1.2;
}

.feature-band p,
.support-list p {
  margin: 0;
  color: #dce5d9;
  line-height: 1.55;
}

.text-page {
  width: min(860px, 100%);
  margin: 0 auto;
}

@media (max-width: 820px) {
  .app-shell {
    align-items: start;
    padding: 74px 14px max(88px, env(safe-area-inset-bottom));
  }

  .clock-panel {
    min-height: calc(100vh - 106px);
    grid-template-columns: 1fr;
    grid-template-areas:
      "copy"
      "sky"
      "controls";
    align-content: start;
  }

  h1 {
    max-width: 12ch;
    font-size: clamp(2.2rem, 3.4rem, 3.4rem);
  }

  .sky-stage {
    width: min(100%, 560px);
  }

  .controls {
    position: fixed;
    right: 14px;
    bottom: max(18px, env(safe-area-inset-bottom));
    z-index: 2;
    padding: 10px 12px;
    border: 1px solid #383d35;
    border-radius: 8px;
    background: rgba(5, 5, 5, 0.88);
    backdrop-filter: blur(10px);
  }

  .site-nav {
    top: 14px;
    right: 14px;
    left: 14px;
    bottom: auto;
    justify-content: center;
  }

  .page-shell {
    padding: 84px 14px max(34px, env(safe-area-inset-bottom));
  }

  .marketing-page,
  .feature-band,
  .support-list {
    grid-template-columns: 1fr;
  }

  .marketing-page {
    gap: 28px;
  }

  .icon-showcase {
    order: -1;
  }

  .icon-showcase img {
    width: min(100%, 220px);
  }
}
