/* ==========================================================================
   Jupiter3Consultant
   Palette sampled from the Jupiter mark: deep space ground, the planet's pale
   and tan bands, and the Great Red Spot as the single accent.
   ========================================================================== */

/* --- Fonts: self-hosted, latin subset only ------------------------------- */
@font-face {
  font-family: 'Newsreader';
  src: url('../fonts/newsreader-500.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Public Sans';
  src: url('../fonts/public-sans-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Public Sans';
  src: url('../fonts/public-sans-600.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

/* --- Tokens -------------------------------------------------------------- */
:root {
  --space:       #14110f;
  --space-lift:  #221c18;
  --space-edge:  #332a23;
  --field-edge:  #6f6052;
  --placeholder: #968a7d;
  --band:        #ede4d6;
  --band-lift:   #f6f1e8;
  --tan:         #c89b6c;
  --spot:        #a63d2f;
  --spot-lit:    #c04a39;
  --ink:         #2a231d;
  --ink-soft:    #6b5e52;
  --cream:       #f3ece1;
  --cream-soft:  #b3a696;

  --serif: 'Newsreader', Georgia, 'Times New Roman', serif;
  --sans:  'Public Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  --measure: 62ch;
  --gutter: clamp(1.25rem, 5vw, 4.5rem);
  --band-y: clamp(4rem, 9vw, 7.5rem);
  --shell: 1180px;
}

/* --- Reset --------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--band);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4, p, ul, figure { margin: 0; }
ul { list-style: none; padding: 0; }
a { color: inherit; }
button, input, textarea { font: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid var(--tan);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--spot);
  color: #fff;
  padding: 0.75rem 1.25rem;
  text-decoration: none;
}
.skip:focus { left: 0; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* --- Shell + bands ------------------------------------------------------- */
.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.band { padding-block: var(--band-y); }
.band--dark { background: var(--space); color: var(--cream); }
.band--light { background: var(--band); color: var(--ink); }

/* The planet's banding, borrowed as a structural rule between sections. */
.hero + .band,
.band + .band { border-top: 1px solid var(--tan); }

/* --- Header -------------------------------------------------------------- */
.masthead {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--space);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}
.masthead[data-scrolled='true'] { border-bottom-color: var(--space-edge); }
.masthead__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 72px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--cream);
  text-decoration: none;
  font-weight: 600;
  font-size: 1.0625rem;
  letter-spacing: -0.01em;
}
.wordmark img { width: 34px; height: 34px; }

.nav { display: flex; align-items: center; gap: 2rem; }
.nav a {
  text-decoration: none;
  color: var(--cream-soft);
  font-size: 0.9375rem;
  padding-block: 0.35rem;
  border-bottom: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.nav a:hover,
.nav a[aria-current='true'] { color: var(--cream); border-bottom-color: var(--tan); }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--space-edge);
  color: var(--cream);
  padding: 0.5rem 0.85rem;
  border-radius: 3px;
  cursor: pointer;
  font-size: 0.875rem;
}

/* --- Hero ---------------------------------------------------------------- */
.hero {
  position: relative;
  background: var(--space);
  color: var(--cream);
  overflow: hidden;
  padding-block: clamp(3.5rem, 8vw, 6rem) clamp(3.5rem, 7vw, 5.5rem);
}
.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.85fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}
.hero__eyebrow {
  font-size: 0.875rem;
  color: var(--tan);
  margin-bottom: 1.35rem;
}
.hero h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.5rem, 6.4vw, 4.25rem);
  line-height: 1.04;
  letter-spacing: -0.021em;
  text-wrap: balance;
}
.hero__lede {
  margin-top: 1.6rem;
  max-width: 46ch;
  color: var(--cream-soft);
  font-size: clamp(1.0625rem, 1.4vw, 1.1875rem);
}
.hero__actions {
  margin-top: 2.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 2rem;
}
.hero__planet { justify-self: end; position: relative; width: 100%; max-width: 460px; }
.hero__planet::before {
  content: '';
  position: absolute;
  inset: -22%;
  background: radial-gradient(circle at 42% 38%, rgba(200, 155, 108, 0.17), transparent 62%);
  pointer-events: none;
}
/* The mark is a photo of a sphere, so rotate() would spin the whole disc like a
   wheel. Instead the artwork is unwrapped into a tileable surface strip which
   scrolls behind a circular mask, with fixed lighting painted over the top. */
.planet {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  isolation: isolate;
}
.planet__surface {
  position: absolute;
  top: -2%;
  bottom: -2%;
  left: 0;
  width: 400%;
  background-image: url('../img/jupiter-surface.webp');
  background-repeat: repeat-x;
  background-size: 50% 100%;   /* one wrap spans 2x the disc, so 180deg is visible */
  transform-origin: 12.5% 50%; /* the disc's centre within this oversized strip */
  animation: planet-spin 100s linear infinite;
  will-change: transform;
}
/* 18deg is the axial tilt measured in the original artwork; rotating here rather
   than on .planet keeps the lighting below fixed in the scene. */
@keyframes planet-spin {
  from { transform: rotate(18deg) translate3d(0, 0, 0); }
  to   { transform: rotate(18deg) translate3d(-50%, 0, 0); }
}

/* Limb darkening, terminator and highlight — these stay put as the surface moves. */
.planet__shade {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 246, 232, 0.13), transparent 46%),
    linear-gradient(108deg, transparent 22%, rgba(6, 4, 2, 0.72) 92%),
    radial-gradient(circle at 46% 42%, transparent 34%, rgba(6, 4, 2, 0.34) 68%, rgba(4, 3, 2, 0.94) 100%);
  box-shadow: inset 0 0 34px 6px rgba(4, 3, 2, 0.72);
}

/* --- Buttons + links ----------------------------------------------------- */
.btn {
  display: inline-block;
  background: var(--spot);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  padding: 0.9rem 1.6rem;
  border: 1px solid var(--spot);
  border-radius: 3px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.btn:hover { background: var(--spot-lit); border-color: var(--spot-lit); }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }

.link-plain {
  color: var(--cream);
  text-decoration: none;
  border-bottom: 1px solid var(--space-edge);
  padding-bottom: 2px;
  transition: border-color 0.15s ease;
}
.link-plain:hover { border-bottom-color: var(--tan); }

/* --- Section headings ---------------------------------------------------- */
.sect-head { margin-bottom: clamp(2rem, 4vw, 3rem); }
.sect-head h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.875rem, 3.6vw, 2.75rem);
  line-height: 1.12;
  letter-spacing: -0.015em;
  max-width: 22ch;
  text-wrap: balance;
}

/* --- Approach list (the four marks, as a list not a card grid) ----------- */
.marks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0;
  border-top: 1px solid var(--space-edge);
}
.marks li {
  padding: 1.6rem 1.75rem 1.75rem 0;
  border-bottom: 1px solid var(--space-edge);
}
.marks h3 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.3125rem;
  margin-bottom: 0.4rem;
  color: var(--cream);
}
.marks p {
  font-size: 0.9375rem;
  color: var(--cream-soft);
  max-width: 34ch;
}

/* --- About --------------------------------------------------------------- */
.about__grid {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
}
.prose p + p { margin-top: 1.15rem; }
.prose { max-width: var(--measure); color: var(--ink); }
.prose strong { font-weight: 600; }

.pull {
  font-family: var(--serif);
  font-size: clamp(1.375rem, 2.6vw, 1.75rem);
  line-height: 1.3;
  color: var(--ink);
  border-left: 2px solid var(--spot);
  padding-left: 1.35rem;
  max-width: 24ch;
}

/* --- Contact ------------------------------------------------------------- */
.contact__grid {
  display: grid;
  grid-template-columns: minmax(0, 0.75fr) minmax(0, 1.25fr);
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: start;
}
.contact__aside p {
  color: var(--cream-soft);
  max-width: 32ch;
  margin-bottom: 2rem;
}
.reach { display: grid; gap: 1.1rem; }
.reach li { display: flex; align-items: flex-start; gap: 0.8rem; }
.reach svg { flex: none; width: 19px; height: 19px; margin-top: 0.22rem; stroke: var(--tan); }
.reach a { color: var(--cream); text-decoration: none; border-bottom: 1px solid var(--space-edge); }
.reach a:hover { border-bottom-color: var(--tan); }

/* --- Form ---------------------------------------------------------------- */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.15rem;
}
.field { display: flex; flex-direction: column; gap: 0.45rem; }
.field--wide { grid-column: 1 / -1; }
.field label { font-size: 0.875rem; font-weight: 600; color: var(--cream); }
.field label .opt { font-weight: 400; color: var(--cream-soft); }
.field input,
.field textarea {
  background: var(--space-lift);
  border: 1px solid var(--field-edge);
  border-radius: 3px;
  padding: 0.8rem 0.95rem;
  color: var(--cream);
  width: 100%;
  transition: border-color 0.15s ease;
}
.field input::placeholder,
.field textarea::placeholder { color: var(--placeholder); }
.field input:hover,
.field textarea:hover { border-color: #8a7869; }
.field input:focus,
.field textarea:focus { border-color: var(--tan); outline: none; }
.field textarea { resize: vertical; min-height: 150px; }

.form-foot {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
  margin-top: 0.35rem;
}
.form-note { font-size: 0.875rem; color: var(--cream-soft); max-width: 34ch; }

/* Honeypot — must stay visually gone but reachable by bots. */
.hp {
  position: absolute !important;
  left: -9999px;
  opacity: 0;
  height: 0;
  width: 0;
  pointer-events: none;
}

.form-status {
  grid-column: 1 / -1;
  font-size: 0.9375rem;
  padding: 0.85rem 1.05rem;
  border-radius: 3px;
  border: 1px solid transparent;
}
.form-status:empty { display: none; }
.form-status[data-state='ok'] {
  background: rgba(200, 155, 108, 0.1);
  border-color: var(--tan);
  color: var(--cream);
}
.form-status[data-state='error'] {
  background: rgba(166, 61, 47, 0.14);
  border-color: var(--spot);
  color: #f0c9c2;
}
.form-status[data-state='busy'] { color: var(--cream-soft); }

/* --- Footer -------------------------------------------------------------- */
.site-foot {
  background: var(--space);
  color: var(--cream-soft);
  border-top: 1px solid var(--space-edge);
  padding-block: 2.5rem;
  font-size: 0.875rem;
}
.site-foot__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 2rem;
  justify-content: space-between;
  align-items: center;
}
.site-foot a { color: var(--cream-soft); }

/* --- Responsive ---------------------------------------------------------- */
@media (max-width: 860px) {
  .hero__grid,
  .about__grid,
  .contact__grid { grid-template-columns: minmax(0, 1fr); }

  .hero__grid { gap: 2.5rem; }
  .hero__planet { justify-self: start; order: -1; max-width: min(58vw, 260px); }
  .pull { margin-bottom: 0.5rem; }

  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: var(--space);
    border-top: 1px solid var(--space-edge);
    border-bottom: 1px solid var(--space-edge);
    padding: 0.5rem var(--gutter) 1rem;
  }
  .nav[data-open='true'] { display: flex; }
  .nav a { width: 100%; padding-block: 0.8rem; border-bottom: 1px solid var(--space-edge); }
  .nav a:last-child { border-bottom: none; }
  .nav-toggle { display: inline-block; }
  .masthead__inner { position: relative; }
  .marks li { padding-right: 0; }
}

@media (max-width: 560px) {
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .hero__actions { gap: 1rem; }
  .hero__actions .btn { width: 100%; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .planet__surface {
    animation: none !important;
    transform: rotate(18deg) !important;
  }
}

@media print {
  .masthead, .nav-toggle, form { display: none; }
  .planet__surface { animation: none; transform: rotate(18deg); }
  body { background: #fff; color: #000; }
  .band--dark, .hero { background: #fff; color: #000; }
}

/* Footer link: meet the 24px minimum target size (WCAG 2.5.8). */
.site-foot a {
  display: inline-block;
  padding-block: 0.3rem;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
