/* ============================================================
   Moondust Studios — single-page static
   Deep-space dark theme, satin moondust accents.
   ============================================================ */

:root {
  /* Color */
  --bg:           #05060B;       /* deep space */
  --bg-2:         #0A0B14;       /* surface */
  --bg-3:         #11132099;     /* card surface w/ alpha for glass */
  --line:         #20223010;
  --border:       #2A2D44;
  --border-soft:  #1B1D2E;

  /* Text — never pure white on pure black, per request */
  --text:         #E6E4F2;        /* primary */
  --text-soft:    #B8B6CC;        /* secondary */
  --text-muted:   #807E95;        /* tertiary */
  --text-faint:   #585770;        /* meta */

  /* Accent: Moondust logo blue */
  --accent:        #2F91D2;
  --accent-soft:   #5EAEE4;
  --accent-glow:   #1F6FA8;

  /* Type */
  --font-sans:  'Satoshi', 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Space Grotesk', 'Satoshi', 'Inter', system-ui, sans-serif;

  /* Layout */
  --container: 1180px;
  --gutter: clamp(20px, 4vw, 40px);
  --radius: 18px;
  --radius-sm: 12px;

  /* Motion */
  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* Reset --------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

body {
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.6;
  color: var(--text-soft);
  background: var(--bg);
  /* Base radial wash for depth, behind starfield */
  background-image:
    radial-gradient(1200px 700px at 75% -10%, rgba(47, 145, 210, 0.18), transparent 60%),
    radial-gradient(900px 600px at 8% 110%, rgba(31, 111, 168, 0.16), transparent 60%);
  background-attachment: fixed;
  min-height: 100svh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Focus styles — visible on dark */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Skip link ----------------------------------------------------- */
.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  background: var(--accent);
  color: #0A0B14;
  padding: 10px 14px;
  border-radius: 8px;
  font-weight: 600;
  z-index: 100;
}
.skip-link:focus { top: 16px; }

/* ============================================================
   Decorative space background
   ============================================================ */
.space-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

/* Star layers — three densities, all generated via radial-gradient
   so we ship zero star images. */
.stars {
  position: absolute;
  inset: -10%;
  background-repeat: repeat;
  opacity: 0.9;
}
.stars--far {
  background-image:
    radial-gradient(1px 1px at 12% 14%, #DCD7F2 50%, transparent 51%),
    radial-gradient(1px 1px at 78% 9%,  #C9C1EA 50%, transparent 51%),
    radial-gradient(1px 1px at 41% 33%, #BAB1E0 50%, transparent 51%),
    radial-gradient(1px 1px at 88% 41%, #DCD7F2 50%, transparent 51%),
    radial-gradient(1px 1px at 23% 58%, #B5ACDC 50%, transparent 51%),
    radial-gradient(1px 1px at 64% 70%, #C9C1EA 50%, transparent 51%),
    radial-gradient(1px 1px at 17% 82%, #DCD7F2 50%, transparent 51%),
    radial-gradient(1px 1px at 92% 88%, #B5ACDC 50%, transparent 51%),
    radial-gradient(1px 1px at 47% 92%, #C9C1EA 50%, transparent 51%);
  background-size: 100% 100%;
  opacity: 0.55;
}
.stars--mid {
  background-image:
    radial-gradient(1.4px 1.4px at 30% 22%, #EFEAFF 50%, transparent 51%),
    radial-gradient(1.4px 1.4px at 70% 55%, #EFEAFF 50%, transparent 51%),
    radial-gradient(1.4px 1.4px at 14% 67%, #E0D8FA 50%, transparent 51%),
    radial-gradient(1.4px 1.4px at 85% 28%, #E0D8FA 50%, transparent 51%),
    radial-gradient(1.4px 1.4px at 53% 80%, #EFEAFF 50%, transparent 51%);
  background-size: 100% 100%;
  opacity: 0.75;
}
.stars--near {
  background-image:
    radial-gradient(2px 2px at 22% 38%, #FFFFFF 50%, transparent 51%),
    radial-gradient(2px 2px at 76% 18%, #FFFFFF 50%, transparent 51%),
    radial-gradient(2px 2px at 60% 86%, #FFFFFF 50%, transparent 51%),
    radial-gradient(1.6px 1.6px at 10% 92%, #F0EBFF 50%, transparent 51%);
  background-size: 100% 100%;
  opacity: 0.85;
  filter: drop-shadow(0 0 4px rgba(47, 145, 210, 0.6));
}

/* Subtle twinkle on the brightest star layer — disabled for reduced motion */
@media (prefers-reduced-motion: no-preference) {
  .stars--near {
    animation: twinkle 7s ease-in-out infinite;
  }
}
@keyframes twinkle {
  0%, 100% { opacity: 0.85; }
  50%      { opacity: 0.6; }
}

/* Orbital lines */
.orbit {
  position: absolute;
  border: 1px solid rgba(47, 145, 210, 0.10);
  border-radius: 50%;
  pointer-events: none;
}
.orbit--a {
  width: 1100px; height: 1100px;
  top: -460px; right: -380px;
  border-color: rgba(47, 145, 210, 0.14);
}
.orbit--b {
  width: 1600px; height: 1600px;
  top: -700px; right: -650px;
  border-color: rgba(47, 145, 210, 0.07);
}

/* The moon glow — anchors the upper right */
.moon-glow {
  position: absolute;
  width: 520px; height: 520px;
  top: -180px; right: -160px;
  background:
    radial-gradient(closest-side, rgba(47, 145, 210, 0.30), rgba(47, 145, 210, 0.06) 55%, transparent 75%);
  filter: blur(2px);
}

/* Drifting dust band across the middle */
.dust {
  position: absolute;
  left: -10%; right: -10%;
  top: 35%;
  height: 380px;
  background:
    radial-gradient(60% 100% at 50% 50%, rgba(47, 145, 210, 0.10), transparent 70%);
  transform: rotate(-6deg);
  filter: blur(20px);
}

/* ============================================================
   Layout primitives
   ============================================================ */
.site-header,
main > section,
.site-footer__inner {
  position: relative;
  z-index: 1;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ============================================================
   Header / brand
   ============================================================ */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-top: 28px;
  padding-bottom: 8px;
}

.brand,
.brand-logo {
  display: inline-flex;
  align-items: center;
  color: var(--text);
}
.brand { gap: 12px; }
.brand-logo img {
  width: clamp(250px, 31vw, 390px);
  height: auto;
  filter: drop-shadow(0 0 12px rgba(61, 144, 204, 0.18));
}
.brand__mark {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}
.brand__mark--sm { width: 32px; height: 32px; }

.brand__type {
  display: flex;
  flex-direction: column;
  line-height: 1;
}
.brand__name {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 22px;
  letter-spacing: -0.01em;
  color: var(--text);
}
.brand__sub {
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 4px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav a {
  color: var(--text-soft);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 700;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color .2s var(--ease), background .2s var(--ease), border-color .2s var(--ease), box-shadow .2s var(--ease), transform .2s var(--ease);
}
.nav a:hover { color: var(--text); background: rgba(47, 145, 210, 0.08); }
.nav__cta {
  border: 1px solid rgba(94, 174, 228, 0.42);
  color: #061521 !important;
  background: linear-gradient(180deg, #91CCF2 0%, var(--accent) 100%);
  box-shadow: 0 10px 28px -14px rgba(47, 145, 210, 0.85);
}
.nav__cta:hover {
  background: linear-gradient(180deg, #B5DFFF 0%, var(--accent-soft) 100%) !important;
  border-color: var(--accent-soft);
  transform: translateY(-1px);
}

@media (max-width: 560px) {
  .site-header {
    flex-direction: column;
    justify-content: center;
    gap: 14px;
    padding-top: 22px;
    padding-bottom: 14px;
    text-align: center;
  }

  .brand-logo {
    justify-content: center;
  }

  .nav {
    justify-content: center;
    width: 100%;
  }

  .nav a:not(.nav__cta) { display: none; }
  .brand__sub { display: none; }
  .brand-logo img { width: 244px; }
}

/* ============================================================
   Hero
   ============================================================ */
.logo-stage {
  min-height: auto;
  display: grid;
  place-items: center;
  padding-top: clamp(18px, 3vw, 32px);
  padding-bottom: clamp(14px, 2.5vw, 26px);
}

.moondust-logo {
  width: min(29vw, 230px);
  min-width: 160px;
  height: auto;
  filter:
    drop-shadow(0 0 20px rgba(61, 144, 204, 0.22))
    drop-shadow(0 32px 80px rgba(0, 0, 0, 0.45));
}

@media (max-width: 560px) {
  .logo-stage {
    min-height: auto;
    padding-top: 16px;
    padding-bottom: 12px;
  }

  .moondust-logo {
    width: min(48vw, 190px);
    min-width: 150px;
  }
}

.hero {
  padding-top: clamp(64px, 10vw, 120px);
  padding-bottom: clamp(72px, 12vw, 140px);
  max-width: 900px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 8px 14px;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  background: rgba(20, 22, 36, 0.4);
  backdrop-filter: blur(8px);
  margin: 0 0 28px;
}
.eyebrow__dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px rgba(47, 145, 210, 0.8);
}

.hero__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(40px, 7vw, 78px);
  line-height: 1.04;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0 0 28px;
}
.hero__title em {
  font-style: italic;
  font-weight: 400;
  background: linear-gradient(180deg, #DDF2FF 0%, #5EAEE4 75%, #2F91D2 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__lede {
  font-size: clamp(17px, 1.7vw, 19px);
  line-height: 1.65;
  color: var(--text-soft);
  max-width: 60ch;
  margin: 0 0 36px;
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.005em;
  cursor: pointer;
  transition: transform .2s var(--ease), background .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease), box-shadow .2s var(--ease);
  border: 1px solid transparent;
  text-align: center;
  white-space: nowrap;
}
.btn--primary {
  background: linear-gradient(180deg, #91CCF2 0%, #2F91D2 100%);
  color: #04111B;
  box-shadow: 0 8px 30px -10px rgba(47, 145, 210, 0.6);
}
.btn--primary:hover {
  background: linear-gradient(180deg, #B5DFFF 0%, #5EAEE4 100%);
  transform: translateY(-1px);
}
.btn--ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn--ghost:hover {
  background: rgba(47, 145, 210, 0.08);
  border-color: var(--accent-soft);
}
.btn--lg {
  min-height: 56px;
  padding: 14px 28px;
  font-size: 16px;
}

/* ============================================================
   Section heads
   ============================================================ */
.section-head {
  max-width: 720px;
  margin-bottom: clamp(24px, 4vw, 36px);
}
.section-kicker {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 16px;
}
.section-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(30px, 4.5vw, 48px);
  line-height: 1.1;
  letter-spacing: -0.015em;
  color: var(--text);
  margin: 0 0 14px;
}
.section-lede {
  font-size: 17px;
  color: var(--text-soft);
  max-width: 58ch;
  margin: 0;
}

/* ============================================================
   Projects gallery
   ============================================================ */
.projects {
  padding-block: clamp(16px, 3vw, 34px) clamp(28px, 5vw, 56px);
  border-top: 1px solid var(--border-soft);
}

.gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}
@media (max-width: 860px) {
  .gallery { grid-template-columns: 1fr; }
}

.card {
  position: relative;
  background: linear-gradient(180deg, rgba(22, 24, 40, 0.85) 0%, rgba(12, 14, 24, 0.85) 100%);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color .25s var(--ease), transform .25s var(--ease), box-shadow .25s var(--ease);
}
.card::before {
  /* Faint gradient ring lifted from accent */
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  padding: 1px;
  background: linear-gradient(140deg, rgba(47, 145, 210, 0.34), transparent 40%);
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
  opacity: 0.7;
}
.card:hover {
  border-color: var(--accent-soft);
  transform: translateY(-2px);
  box-shadow: 0 30px 60px -30px rgba(47, 145, 210, 0.35);
}

.card__link {
  display: block;
  color: inherit;
}
.card__link:focus-visible {
  outline: none;
}
.card:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent);
}

.card__media {
  position: relative;
  aspect-ratio: 16 / 7.4;
  overflow: hidden;
  background: #0A0B14;
  border-bottom: 1px solid var(--border-soft);
}
.card__media::after {
  /* Subtle vignette to blend the bright screenshots into the dark theme */
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(5, 6, 11, 0) 60%, rgba(5, 6, 11, 0.35) 100%),
    linear-gradient(180deg, rgba(5, 6, 11, 0.15) 0%, rgba(5, 6, 11, 0) 30%);
  pointer-events: none;
}
.card__media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: top center; /* show ONLY the top of the page */
  transition: transform .6s var(--ease);
}
.card:hover .card__media img { transform: scale(1.02); }

.card__body {
  padding: 24px 26px 28px;
}
.card__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.card__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 26px;
  letter-spacing: -0.01em;
  color: var(--text);
  margin: 0;
}
.card__tag {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  padding: 4px 10px;
  border: 1px solid rgba(47, 145, 210, 0.35);
  border-radius: 999px;
  background: rgba(47, 145, 210, 0.07);
}
.card__desc {
  margin: 0 0 18px;
  color: var(--text-soft);
  font-size: 15.5px;
  line-height: 1.55;
}
.card__cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
}
.card:hover .card__cta { color: #B5DFFF; }

/* ============================================================
   Studio / principles
   ============================================================ */
.studio {
  padding-block: clamp(72px, 11vw, 140px);
  border-top: 1px solid var(--border-soft);
}
.studio__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: clamp(40px, 6vw, 80px);
  align-items: start;
}
@media (max-width: 860px) {
  .studio__grid { grid-template-columns: 1fr; }
}
.studio__lede {
  font-size: 17px;
  color: var(--text-soft);
  max-width: 50ch;
  margin: 0;
}

.principles {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
@media (max-width: 540px) {
  .principles { grid-template-columns: 1fr; }
}
.principle {
  padding: 22px 22px 24px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, rgba(20, 22, 36, 0.55) 0%, rgba(8, 9, 16, 0.55) 100%);
  position: relative;
}
.principle__no {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 14px;
  color: var(--accent);
  display: block;
  margin-bottom: 14px;
  letter-spacing: 0.05em;
}
.principle__title {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 16px;
  color: var(--text);
  margin: 0 0 8px;
  letter-spacing: -0.005em;
}
.principle__body {
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--text-soft);
  margin: 0;
}

/* ============================================================
   Contact
   ============================================================ */
.contact {
  padding-block: clamp(72px, 11vw, 140px);
  border-top: 1px solid var(--border-soft);
  text-align: center;
}
.contact__inner {
  max-width: 640px;
  margin-inline: auto;
}
.contact__lede {
  font-size: 17px;
  color: var(--text-soft);
  margin: 0 0 32px;
}
.contact .section-kicker { margin-bottom: 18px; }

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border-soft);
  margin-top: 40px;
  padding-block: 48px 32px;
  color: var(--text-muted);
}
.site-footer__inner {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 40px;
  align-items: start;
}
@media (max-width: 700px) {
  .site-footer__inner { grid-template-columns: 1fr; }
}
.site-footer__brand {
  display: flex;
  gap: 14px;
  align-items: center;
}
.site-footer__name {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 18px;
  color: var(--text);
  margin: 0 0 4px;
}
.site-footer__tag {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0;
  max-width: 36ch;
}
.site-footer__nav {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
}
.site-footer__col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.site-footer__heading {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 0 0 4px;
}
.site-footer__col a {
  color: var(--text-soft);
  font-size: 15px;
  padding: 6px 0;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
}
.site-footer__col a:hover { color: var(--accent); }
.site-footer__legal {
  max-width: var(--container);
  margin: 40px auto 0;
  padding-inline: var(--gutter);
  padding-top: 24px;
  border-top: 1px solid var(--border-soft);
  font-size: 13px;
  color: var(--text-faint);
  position: relative;
  z-index: 1;
}

.moon-fact {
  max-width: var(--container);
  margin: 0 auto;
  padding: 26px var(--gutter) 34px;
  color: var(--text-muted);
  position: relative;
  z-index: 1;
  text-align: center;
}
.moon-fact p {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
}
.moon-fact span {
  color: var(--text-soft);
}

/* ============================================================
   High-contrast / reduced-motion respect
   ============================================================ */
@media (prefers-contrast: more) {
  :root {
    --text-soft: #D8D6E8;
    --text-muted: #A4A2BA;
    --border-soft: #34374E;
  }
}
