/* Class M Labs — quiet planetary study, responsive */
:root {
  color-scheme: dark;
  --bg: #07090d;
  --bg-deep: #030407;
  --ink: #f1f0eb;
  --ink-soft: #aaaeb3;
  --ink-dim: #686d73;
  --line: rgba(230, 232, 235, 0.12);
  --line-soft: rgba(230, 232, 235, 0.065);
  --atmosphere: #9db8c8;
  --planet-light: #7e8c8f;
  --planet-mid: #313a3e;
  --planet-dark: #101418;
  --content: 1440px;
  --pad: clamp(1.25rem, 4vw, 4.75rem);
  --sans: "Avenir Next", Avenir, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "SFMono-Regular", "Cascadia Mono", "Roboto Mono", Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg-deep);
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 72% 45%, rgba(90, 112, 122, 0.08), transparent 38rem),
    linear-gradient(135deg, var(--bg-deep), var(--bg) 48%, #090c10);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -3;
  content: "";
  pointer-events: none;
  background-image: radial-gradient(rgba(255,255,255,.035) .7px, transparent .7px);
  background-size: 5px 5px;
  opacity: .16;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: .28em;
}

.skip-link {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 100;
  padding: .7rem 1rem;
  color: var(--bg);
  background: var(--ink);
  transform: translateY(-160%);
  transition: transform .15s ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.starfield {
  position: fixed;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.home-page {
  min-height: 100svh;
  overflow: hidden;
}

.home-shell {
  display: grid;
  grid-template-rows: auto 1fr auto;
  width: min(100%, var(--content));
  min-height: 100svh;
  margin-inline: auto;
  padding-inline: var(--pad);
}

.site-header,
.site-footer {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-header {
  min-height: 94px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  color: var(--ink);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .19em;
  text-decoration: none;
  text-transform: uppercase;
}

.brand-mark {
  width: 27px;
  height: 27px;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 1;
}

.brand-mark circle {
  fill: currentColor;
  stroke: none;
}

.home-main {
  display: grid;
  min-height: 0;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(610px, 1.04fr) minmax(500px, .96fr);
  align-items: center;
  min-height: 0;
}

.hero-copy {
  position: relative;
  z-index: 5;
  padding-bottom: clamp(1rem, 5vh, 4rem);
  opacity: 0;
  transform: translateY(18px);
  animation: copy-arrive 1.15s cubic-bezier(.2,.75,.25,1) .1s forwards;
  /* Keep type legible where the quiet planet still sits behind/near copy */
  text-shadow:
    0 1px 18px rgba(3,5,8,.55),
    0 0 42px rgba(3,5,8,.28);
}

.hero h1 {
  max-width: none;
  margin: 0;
  font-size: clamp(4rem, 5.15vw, 6.2rem);
  font-weight: 420;
  line-height: .96;
  letter-spacing: -.058em;
}

.hero h1 span {
  display: block;
  white-space: nowrap;
}

/* Allow wrapping on narrow viewports */
@media (max-width: 640px) {
  .hero h1 span { white-space: normal; }
}

.hero h1 .muted {
  color: var(--ink-soft);
  font-weight: 275;
}

.hero-copy p {
  max-width: 31rem;
  margin: clamp(1.7rem, 3.5vh, 2.6rem) 0 0;
  color: var(--ink-soft);
  font-size: clamp(1rem, 1.2vw, 1.16rem);
  font-weight: 350;
  line-height: 1.68;
  text-wrap: pretty;
}

.planet-study {
  position: relative;
  width: min(58vw, calc(100svh - 170px), 920px);
  min-width: 540px;
  aspect-ratio: 1;
  justify-self: center;
  margin-right: clamp(-17rem, -13vw, -7rem);
  opacity: 0;
  animation: study-arrive 1.1s ease .15s forwards;
}

.planet-halo {
  position: absolute;
  top: 104%;
  left: 96%;
  width: 168%;
  aspect-ratio: 1;
  background: radial-gradient(circle, rgba(148,160,166,.045), rgba(78,90,96,.02) 48%, transparent 72%);
  border-radius: 50%;
  filter: blur(34px);
  opacity: .36;
  transform: translate(-50%, -50%);
  animation: light-breathe 18s ease-in-out infinite;
}

.planet-disc {
  position: absolute;
  top: 104%;
  left: 96%;
  width: 164%;
  aspect-ratio: 1;
  overflow: hidden;
  background-color: #07090d;
  background-image: url("class-m-planet.jpg");
  background-repeat: no-repeat;
  background-position: 50% 50%;
  background-size: 140% 140%;
  border: 1px solid rgba(221,228,230,.09);
  border-radius: 50%;
  /* Quiet the plate so copy keeps hierarchy */
  filter: saturate(.82) brightness(.9) contrast(.97);
  opacity: .88;
  box-shadow:
    inset 18px 10px 35px rgba(237,242,241,.015),
    inset -75px -48px 130px rgba(0,0,0,.58),
    0 0 48px rgba(70,96,100,.04);
  transform: translate(-50%, -50%);
  animation: planet-surface-shift 70s ease-in-out infinite alternate;
}

.planet-light,
.planet-shadow {
  position: absolute;
  inset: 0;
  border-radius: 50%;
}

.planet-light {
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 18%, rgba(196,208,204,.08), transparent 31%),
    linear-gradient(118deg, rgba(148,168,164,.035), transparent 42%);
  mix-blend-mode: soft-light;
  opacity: .28;
}

.planet-light::after {
  position: absolute;
  inset: 0;
  content: "";
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.78' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.42'/%3E%3C/svg%3E");
  background-size: 240px 240px;
  mix-blend-mode: soft-light;
  opacity: .04;
}

.planet-shadow {
  background: radial-gradient(circle at 22% 24%, transparent 0 27%, rgba(1,4,5,.12) 50%, rgba(0,0,0,.42) 100%);
}

.planet-disc::after {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(229,235,235,.07);
  border-radius: 50%;
  box-shadow: inset 22px 12px 38px rgba(226,235,233,.02);
  content: "";
  /* Soft veil: knocks remaining coastal sparkle back without muddying the disc */
  background:
    radial-gradient(circle at 50% 46%, transparent 34%, rgba(5,8,10,.14) 72%, rgba(3,5,7,.28) 100%),
    linear-gradient(125deg, rgba(120,148,150,.035), transparent 38%);
  pointer-events: none;
}

.site-footer {
  min-height: 76px;
  color: var(--ink-dim);
  font-family: var(--mono);
  font-size: .61rem;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.site-footer nav {
  position: relative;
  z-index: 8;
  display: flex;
  gap: 1.6rem;
  color: rgba(241,240,235,.72);
  text-shadow: 0 1px 12px rgba(0,0,0,.95), 0 0 2px rgba(0,0,0,.85);
}

.site-footer a {
  text-decoration: none;
  transition: color .18s ease;
}

.site-footer a:hover,
.site-footer a:focus-visible,
.back-link:hover,
.back-link:focus-visible {
  color: var(--ink);
}

/* Legal pages */
.legal-page {
  min-height: 100svh;
  background:
    radial-gradient(circle at 80% 10%, rgba(94,126,136,.07), transparent 30rem),
    linear-gradient(135deg, var(--bg-deep), var(--bg));
}

.legal-page .site-header,
.legal-page .site-footer,
.legal-shell {
  width: min(100%, 1120px);
  margin-inline: auto;
  padding-inline: var(--pad);
}

.legal-page .site-header {
  min-height: 94px;
  border-bottom: 1px solid var(--line-soft);
}

.back-link {
  color: var(--ink-dim);
  font-family: var(--mono);
  font-size: .62rem;
  letter-spacing: .12em;
  text-decoration: none;
  text-transform: uppercase;
  transition: color .18s ease;
}

.legal-shell {
  padding-top: clamp(5rem, 11vw, 9rem);
  padding-bottom: clamp(6rem, 12vw, 10rem);
}

.eyebrow {
  margin: 0 0 1.7rem;
  color: var(--ink-dim);
  font-family: var(--mono);
  font-size: .62rem;
  letter-spacing: .15em;
  text-transform: uppercase;
}

.eyebrow span {
  margin-right: .8rem;
  color: var(--ink-soft);
}

.legal-shell > h1 {
  max-width: none;
  margin: 0;
  font-size: clamp(3.5rem, 8vw, 7rem);
  font-weight: 360;
  line-height: .95;
  letter-spacing: -.055em;
}

.legal-grid,
.legal-content {
  margin-top: clamp(4rem, 9vw, 7.5rem);
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}

.legal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(3rem, 9vw, 8rem);
}

.legal-content {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3rem clamp(3rem, 9vw, 8rem);
}

.legal-shell section {
  max-width: 36rem;
}

.legal-shell h2 {
  margin: 0 0 1.1rem;
  color: var(--ink);
  font-family: var(--mono);
  font-size: .68rem;
  font-weight: 500;
  letter-spacing: .11em;
  line-height: 1.4;
  text-transform: uppercase;
}

.legal-shell p,
.legal-shell address {
  margin: 0;
  color: var(--ink-soft);
  font-size: .98rem;
  font-style: normal;
  line-height: 1.75;
}

.legal-shell a {
  color: var(--ink);
}

.legal-page .site-footer {
  border-top: 1px solid var(--line-soft);
}

@keyframes copy-arrive {
  to { opacity: 1; transform: translateY(0); }
}

@keyframes study-arrive {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes light-breathe {
  0%, 100% { opacity: .3; }
  50% { opacity: .4; }
}

@keyframes planet-surface-shift {
  from { background-position: 49.5% 50.2%; }
  to { background-position: 50.8% 49.6%; }
}

@media (max-width: 980px) {
  .home-page {
    overflow-y: auto;
    overflow-x: hidden;
  }

  .hero {
    grid-template-columns: 1fr 1fr;
    gap: clamp(1rem, 3vw, 3rem);
  }

  .hero h1 {
    font-size: clamp(3.7rem, 6.7vw, 5.35rem);
  }

  .planet-study {
    width: min(32vw, 520px);
    min-width: 300px;
    margin-right: -2rem;
  }
}

@media (max-width: 720px) {
  .home-page {
    overflow-y: auto;
    overflow-x: hidden;
  }

  .home-shell {
    display: grid;
    grid-template-rows: auto 1fr auto;
    width: 100%;
    min-height: 100svh;
  }

  .site-header {
    min-height: 78px;
  }

  /* Stack hero copy above planet */
  .hero {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-width: 0;
    padding-top: clamp(1.5rem, 5vh, 3.5rem);
  }

  .hero-copy {
    padding-bottom: 0;
    text-shadow:
      0 1px 18px rgba(3,5,8,.95),
      0 0 42px rgba(3,5,8,.48);
  }

  .hero h1 {
    max-width: none;
    font-size: clamp(2.8rem, 10vw, 3.6rem);
  }

  .hero-copy p {
    width: 100%;
    max-width: none;
    margin-top: 1.4rem;
    font-size: 1rem;
  }

  /* Planet becomes a decorative roundel below the copy */
  .planet-study {
    position: relative;
    width: min(82vw, 460px);
    min-width: 0;
    margin: .5rem auto 0;
    align-self: center;
    opacity: 1;
    animation: study-arrive 1.1s ease .15s forwards;
  }

  .planet-halo {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 120%;
    aspect-ratio: 1;
    background: radial-gradient(circle, rgba(148,160,166,.045), rgba(78,90,96,.02) 48%, transparent 72%);
    border-radius: 50%;
    filter: blur(34px);
    opacity: .3;
    transform: translate(-50%, -50%);
    animation: light-breathe 18s ease-in-out infinite;
  }

  .planet-disc {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    background-color: #07090d;
    background-image: url("class-m-planet.jpg");
    background-repeat: no-repeat;
    background-position: 50% 50%;
    background-size: 140% 140%;
    border: 1px solid rgba(221,228,230,.09);
    border-radius: 50%;
    filter: saturate(.82) brightness(.9) contrast(.97);
    opacity: .72;
    box-shadow:
      inset 18px 10px 35px rgba(237,242,241,.015),
      inset -75px -48px 130px rgba(0,0,0,.58),
      0 0 48px rgba(70,96,100,.04);
    transform: translate(-50%, -50%);
    animation: planet-surface-shift 70s ease-in-out infinite alternate;
  }

  /* Disc overlay elements keep working through the disc's children */
  .planet-light {
    overflow: hidden;
    background:
      radial-gradient(circle at 18% 18%, rgba(196,208,204,.08), transparent 31%),
      linear-gradient(118deg, rgba(148,168,164,.035), transparent 42%);
    mix-blend-mode: soft-light;
    opacity: .28;
  }

  .planet-light::after {
    position: absolute;
    inset: 0;
    content: "";
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.78' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.42'/%3E%3C/svg%3E");
    background-size: 240px 240px;
    mix-blend-mode: soft-light;
    opacity: .04;
    border-radius: 50%;
  }

  .planet-shadow {
    background: radial-gradient(circle at 22% 24%, transparent 0 27%, rgba(1,4,5,.12) 50%, rgba(0,0,0,.42) 100%);
  }

  .site-footer {
    min-height: 68px;
  }

  /* Legal pages: single column */
  .legal-grid,
  .legal-content {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
}

@media (max-width: 430px) {
  .brand {
    font-size: .63rem;
  }

  .hero {
    padding-top: clamp(.5rem, 3vh, 1.5rem);
  }

  .hero h1 {
    font-size: clamp(2.3rem, 11vw, 2.9rem);
  }

  .hero-copy p {
    font-size: .95rem;
    margin-top: 1rem;
  }

  .planet-study {
    width: min(85vw, 360px);
    margin-top: 0;
  }

  .site-footer {
    align-items: flex-end;
    padding-bottom: 1rem;
  }

  .site-footer nav {
    gap: .8rem;
    font-size: .56rem;
  }
}

@media (max-width: 380px) {
  .home-shell {
    padding-inline: 1rem;
  }

  .hero h1 {
    font-size: clamp(1.9rem, 10vw, 2.3rem);
    letter-spacing: -.04em;
  }

  .planet-study {
    width: 88vw;
  }

  .site-footer {
    flex-direction: column;
    gap: .4rem;
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
