/* ===================================================================
   Cosmosis — The refined universe
   Static recreation of the Cosmosis.dc.html design prototype.
   =================================================================== */

:root {
  --bg:        #141312;
  --bg-2:      #1b1a18;
  --ink:       #FBF9F6;
  --ink-soft:  #E6E2DD;
  --ink-mute:  #CFCCC8;
  --ink-dim:   #B7B4B0;
  --gray:      #9b9894;
  --gray-2:    #757370;
  --gray-3:    #5c5a57;
  --gold:      #B59473;
  --gold-lt:   #c5a684;
  --line:      rgba(117,115,112,0.2);
  --maxw:      1360px;
  font-synthesis: none;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', system-ui, sans-serif;
  overflow-x: hidden;
}

::selection { background: var(--gold); color: var(--bg); }

input::placeholder, textarea::placeholder { color: var(--gray-2); }

*:focus-visible { outline: 1px solid var(--gold); outline-offset: 3px; }

.cm-root { position: relative; }

.cm-container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding-left: 40px;
  padding-right: 40px;
}

/* ---------- keyframes ---------- */
@keyframes cm-marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes cm-ken { 0% { transform: scale(1.06) translate(0,0); } 100% { transform: scale(1.16) translate(-1.5%,-1%); } }
@keyframes cm-scroll { 0% { transform: translateY(0); opacity: 0; } 30% { opacity: 1; } 100% { transform: translateY(14px); opacity: 0; } }

/* ===================== NAV ===================== */
.cm-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 60;
  height: 76px;
  display: flex;
  align-items: center;
}
.cm-nav-bg {
  position: absolute;
  inset: 0;
  background: rgba(20,19,18,0);
  border-bottom: 1px solid rgba(117,115,112,0);
  transition: background .4s ease, border-color .4s ease, backdrop-filter .4s ease;
}
.cm-nav-bg.is-scrolled {
  background: rgba(20,19,18,0.78);
  border-bottom: 1px solid rgba(117,115,112,0.22);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.cm-nav-inner {
  position: relative;
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.cm-brand { display: flex; align-items: center; gap: 14px; text-decoration: none; }
.cm-brand img { height: 23px; width: auto; display: block; }

.cm-navlinks { display: none; align-items: center; gap: 40px; }
.cm-navlinks a {
  color: var(--ink-mute);
  text-decoration: none;
  font-size: 13.5px;
  letter-spacing: .04em;
  transition: color .25s;
}
.cm-navlinks a:hover { color: var(--ink); }

/* ---------- primary button ---------- */
.cm-btn {
  display: inline-flex;
  align-items: center;
  background: var(--gold);
  color: var(--bg);
  text-decoration: none;
  font-weight: 600;
  letter-spacing: .02em;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background .25s;
}
.cm-btn:hover { background: var(--gold-lt); }
.cm-btn--sm { gap: 9px; font-size: 13px; padding: 11px 18px; }
.cm-btn--lg { gap: 11px; font-size: 14.5px; padding: 15px 26px; font-family: 'Inter', sans-serif; }

/* shared star glint */
.cm-star { transition: transform .5s cubic-bezier(.2,.8,.2,1); transform-origin: center; }
[data-glint]:hover .cm-star,
.cm-star[data-glint]:hover { transform: rotate(45deg) scale(1.5); }

/* ===================== HERO ===================== */
.cm-hero {
  position: relative;
  min-height: 100vh;
  height: 100svh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}
.cm-hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: radial-gradient(130% 100% at 50% 18%, #1c1a17 0%, #141312 46%, #0d0c0b 100%);
}
.cm-hero-bg canvas {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  display: block;
}
.cm-hero-bg video {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity 1s ease;
  animation: cm-ken 26s ease-in-out infinite alternate;
}
.cm-hero-veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(20,19,18,0.62) 0%, rgba(20,19,18,0.30) 32%, rgba(20,19,18,0.72) 78%, rgba(20,19,18,0.96) 100%);
}
.cm-hero-vignette {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: radial-gradient(120% 80% at 50% 40%, transparent 40%, rgba(20,19,18,0.55) 100%);
}

.cm-hero-eyebrow { position: absolute; z-index: 3; top: 104px; left: 0; right: 0; }
.cm-eyebrow-row { display: flex; align-items: center; gap: 13px; }
.cm-rule { width: 26px; height: 1px; background: var(--gray-2); }
.cm-rule--gold { width: 34px; background: var(--gold); }
.cm-eyebrow-text {
  font-size: 11.5px;
  letter-spacing: .34em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.cm-eyebrow-text--dim { letter-spacing: .32em; color: var(--gray-2); }
.cm-eyebrow-row--dim { gap: 13px; }

.cm-hero-content {
  position: relative;
  z-index: 3;
  padding-bottom: 72px;
}
.cm-hero-title {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 0.98;
  font-size: clamp(34px, 6vw, 96px);
  margin: 0;
  color: var(--ink);
  max-width: none;
}
.cm-line-mask { display: block; overflow: hidden; }
.cm-line-mask > span { display: block; }
/* Keep each source line on a single line from tablet up. */
@media (min-width: 620px) {
  .cm-line-mask > span { white-space: nowrap; }
}
.cm-hero-title em { color: var(--gold); font-style: italic; font-weight: 600; }

.cm-hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 30px;
  margin-top: 42px;
}
.cm-hero-blurb {
  margin: 0;
  max-width: 340px;
  color: var(--ink-mute);
  font-size: 14.5px;
  line-height: 1.65;
}
/* One line from tablet up; wrap naturally on small screens. */
@media (min-width: 620px) {
  .cm-hero-blurb { max-width: none; white-space: nowrap; }
}

.cm-scrollcue {
  position: absolute;
  z-index: 3;
  bottom: 30px;
  right: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
}
@media (max-width: 619px) {
  .cm-scrollcue { right: 24px; }
}
.cm-scrollcue-label {
  font-size: 10px;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--gray);
}
.cm-scrollcue-track {
  position: relative;
  width: 1px; height: 40px;
  background: rgba(251,249,246,0.18);
  overflow: hidden;
}
.cm-scrollcue-dot {
  position: absolute;
  inset: 0;
  background: var(--gold);
  animation: cm-scroll 2s ease-in-out infinite;
}

/* ===================== MARQUEE ===================== */
.cm-marquee-wrap {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 26px 0;
  overflow: hidden;
  white-space: nowrap;
}
.cm-marquee {
  display: inline-flex;
  align-items: center;
  animation: cm-marquee 28s linear infinite;
  will-change: transform;
}
.cm-marquee-group {
  display: inline-flex;
  align-items: center;
  gap: 34px;
  padding-right: 34px;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: clamp(26px, 3.4vw, 48px);
  letter-spacing: -0.01em;
  color: var(--ink);
}
.cm-marquee-group svg { flex: none; }
.cm-marquee-group .cm-dim { color: var(--gray-2); }

/* ===================== MANIFESTO + COLLAGE ===================== */
.cm-work { padding: 120px 40px 90px; scroll-margin-top: 80px; }
.cm-work .cm-eyebrow-row { margin-bottom: 48px; }
.cm-manifesto {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.16;
  font-size: clamp(28px, 4.4vw, 60px);
  margin: 0;
  max-width: 18ch;
  color: var(--ink-soft);
}
.cm-strong { color: var(--ink); font-weight: 600; }
.cm-gold-strong { color: var(--gold); font-weight: 600; }

.cm-collage {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 16px;
  margin-top: 72px;
}
.cm-collage figure {
  margin: 0;
  position: relative;
  aspect-ratio: 3 / 4;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
}
.cm-collage figure img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cm-collage-mid { margin-top: 48px; }

/* ===================== STATS ===================== */
.cm-stats-section { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.cm-stats {
  padding: 54px 40px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}
.cm-stat-num {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: clamp(44px, 6vw, 76px);
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--ink);
}
.cm-gold { color: var(--gold); }
.cm-stat-label { font-size: 12.5px; letter-spacing: .06em; color: var(--gray-2); margin-top: 12px; }

/* ===================== SERVICES ===================== */
.cm-services { position: relative; padding: 108px 40px 100px; scroll-margin-top: 80px; }
.cm-services-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 34px;
}
.cm-services-eyebrow { margin-bottom: 18px; gap: 12px; }
.cm-services-title {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  letter-spacing: -0.025em;
  font-size: clamp(30px, 4vw, 54px);
  line-height: 1.0;
  margin: 0;
}
.cm-services-blurb { max-width: 300px; color: var(--ink-dim); font-size: 14.5px; line-height: 1.7; margin: 0; }

/* accordion */
.cm-svc-list { border-top: 1px solid var(--line); }
.cm-svc-item { border-bottom: 1px solid var(--line); }
.cm-svc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: 100%;
  padding: 30px 4px;
  border: none;
  background: transparent;
  color: inherit;
  text-align: left;
  font: inherit;
  cursor: pointer;
  transition: padding .45s cubic-bezier(.2,.8,.2,1);
}
.cm-svc-item.is-open .cm-svc-row { padding-left: 24px; }
.cm-svc-rowleft { display: flex; align-items: center; gap: clamp(18px, 3vw, 52px); }
.cm-svc-idx {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 13px;
  letter-spacing: .16em;
  color: var(--gray-2);
  width: 30px;
  flex: none;
}
.cm-svc-name {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: clamp(24px, 3.4vw, 44px);
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--ink);
  transition: color .35s;
}
.cm-svc-row:hover .cm-svc-name,
.cm-svc-item.is-open .cm-svc-name { color: var(--gold); }
.cm-svc-rowright { display: flex; align-items: center; gap: 26px; }
.cm-svc-tags { display: none; font-size: 13px; color: var(--gray); letter-spacing: .02em; }

/* plus / close toggle */
.cm-svc-toggle {
  position: relative;
  width: 20px; height: 20px;
  flex: none;
}
.cm-svc-toggle::before,
.cm-svc-toggle::after {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  width: 16px; height: 1.5px;
  background: var(--gold);
  transform: translate(-50%, -50%);
  transition: transform .4s cubic-bezier(.2,.8,.2,1), opacity .3s ease;
}
.cm-svc-toggle::after { transform: translate(-50%, -50%) rotate(90deg); }
.cm-svc-item.is-open .cm-svc-toggle::after { transform: translate(-50%, -50%) rotate(0deg); opacity: 0; }

/* collapsible panel (grid-rows technique, no JS height measuring) */
.cm-svc-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .45s cubic-bezier(.2,.8,.2,1);
}
.cm-svc-item.is-open .cm-svc-panel { grid-template-rows: 1fr; }
.cm-svc-panel-inner { overflow: hidden; }
.cm-svc-panel-inner p {
  margin: 0;
  padding: 0 0 34px calc(30px + clamp(18px, 3vw, 52px));
  max-width: 62ch;
  color: var(--ink-dim);
  font-size: clamp(15px, 1.4vw, 17px);
  line-height: 1.7;
  opacity: 0;
  transition: opacity .4s ease .1s;
}
.cm-svc-item.is-open .cm-svc-panel-inner p { opacity: 1; }
.cm-svc-item.is-open .cm-svc-row { padding-left: 24px; }

/* ===================== PHILOSOPHY ===================== */
.cm-studio { padding: 30px 40px 110px; scroll-margin-top: 80px; }
.cm-philo-panel {
  background: var(--ink);
  color: var(--bg);
  border-radius: 4px;
  padding: clamp(40px, 5vw, 78px);
  position: relative;
  overflow: hidden;
}
.cm-philo-corner-v { position: absolute; right: 48px; top: 48px; width: 1px; height: 64px; background: rgba(20,19,18,0.12); }
.cm-philo-corner-h { position: absolute; right: 48px; top: 48px; height: 1px; width: 64px; background: rgba(20,19,18,0.12); }
.cm-philo {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 48px;
  align-items: start;
}
.cm-philo-eyebrow { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.cm-philo-title {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  letter-spacing: -0.025em;
  font-size: clamp(28px, 3.4vw, 46px);
  line-height: 1.04;
  margin: 0;
  color: var(--bg);
}
.cm-philo-lead {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 500;
  font-size: clamp(20px, 2.2vw, 28px);
  line-height: 1.42;
  letter-spacing: -0.01em;
  margin: 0 0 26px;
  color: var(--bg);
}
.cm-philo-body { color: var(--gray-3); font-size: 16px; line-height: 1.75; margin: 0; max-width: 560px; }

/* ===================== TEAM ===================== */
.cm-team { padding: 30px 40px 110px; scroll-margin-top: 80px; }
.cm-team-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 56px;
}
.cm-team-eyebrow { margin-bottom: 18px; gap: 12px; }
.cm-team-title {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  letter-spacing: -0.025em;
  font-size: clamp(30px, 4vw, 54px);
  line-height: 1.0;
  margin: 0;
}
.cm-team-blurb { max-width: 320px; color: var(--ink-dim); font-size: 14.5px; line-height: 1.7; margin: 0; }

.cm-team-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px;
}
.cm-team-card { margin: 0; text-align: center; }
.cm-team-photo {
  display: block;
  position: relative;
  width: 100%;
  max-width: 132px;
  margin: 0 auto;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  overflow: hidden;
  background: radial-gradient(120% 120% at 50% 20%, #24221f 0%, #17150f 70%);
  border: 1px solid rgba(181,148,115,0.65);
}
.cm-team-photo img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .6s cubic-bezier(.2,.8,.2,1);
}
.cm-team-card:hover .cm-team-photo img { transform: scale(1.05); }
.cm-team-initials {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: clamp(28px, 3vw, 40px);
  letter-spacing: .04em;
  color: var(--gold);
}
.cm-team-name {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: clamp(17px, 1.6vw, 20px);
  letter-spacing: -0.01em;
  margin: 18px 0 0;
  color: var(--ink);
}
.cm-team-role { margin: 5px 0 0; font-size: 13px; letter-spacing: .02em; color: var(--gray); }

/* ===================== CONTACT / FOOTER ===================== */
.cm-contact-section { border-top: 1px solid var(--line); scroll-margin-top: 80px; }
.cm-contact-inner { padding: 96px 40px 40px; }
.cm-contact-title {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-size: clamp(40px, 6.6vw, 96px);
  line-height: 0.98;
  margin: 0 0 64px;
  max-width: 16ch;
}
.cm-contact {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: start;
}
.cm-contact-lead { color: var(--ink-dim); font-size: 16px; line-height: 1.75; max-width: 400px; margin: 0 0 40px; }
.cm-contact-direct { display: flex; flex-direction: column; gap: 6px; margin-bottom: 34px; }
.cm-contact-direct-label { font-size: 12px; color: var(--gray-2); letter-spacing: .06em; text-transform: uppercase; }
.cm-contact-email {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 20px;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid rgba(117,115,112,0.4);
  padding-bottom: 3px;
  width: fit-content;
  transition: color .25s;
}
.cm-contact-email:hover { color: var(--gold); }

.cm-form-col { position: relative; }
.cm-formrule { position: absolute; left: -32px; top: 0; bottom: 0; width: 1px; background: var(--line); }
.cm-form { display: flex; flex-direction: column; gap: 0; }
.cm-field { display: block; padding: 18px 0; border-bottom: 1px solid rgba(117,115,112,0.28); }
.cm-field-label { display: block; font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--gray-2); margin-bottom: 10px; }
.cm-field input, .cm-field textarea {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--ink);
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  padding: 0;
  outline: none;
}
.cm-field textarea { resize: none; line-height: 1.6; }
.cm-form-submit { margin-top: 28px; justify-content: center; width: fit-content; }

.cm-form-success { display: flex; flex-direction: column; align-items: flex-start; gap: 18px; padding: 30px 0; }
.cm-form-success[hidden] { display: none; }
.cm-form-success h3 { font-family: 'Space Grotesk', sans-serif; font-weight: 600; font-size: 26px; margin: 0; color: var(--ink); }
.cm-form-success p { color: var(--ink-dim); font-size: 15.5px; line-height: 1.7; margin: 0; max-width: 380px; }

.cm-footer {
  margin-top: 96px;
  padding-top: 30px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.cm-footer-brand { display: flex; align-items: center; gap: 11px; }
.cm-footer-logo { height: 17px; width: auto; display: block; }
.cm-footer-links { display: flex; gap: 26px; }
.cm-footer-links a { color: var(--gray-2); text-decoration: none; font-size: 13px; transition: color .25s; }
.cm-footer-links a:hover { color: var(--ink); }
.cm-footer-copy { color: var(--gray-3); font-size: 12.5px; }

/* ===================== REVEAL (pre-animation base state) ===================== */
.cm-reveal-ready [data-reveal] { opacity: 0; transform: translateY(28px); }
.cm-reveal-ready [data-reveal].is-revealed { opacity: 1; transform: none; }

/* hero intro base states (only when JS will animate) */
.cm-hero-ready [data-hero-line] { transform: translateY(110%); }
.cm-hero-ready [data-hero-fade] { opacity: 0; }

/* ===================== RESPONSIVE ===================== */
@media (min-width: 900px) {
  .cm-navlinks { display: flex; }
}
@media (max-width: 899px) {
  .cm-philo { grid-template-columns: 1fr; }
  .cm-contact { grid-template-columns: 1fr; }
  .cm-collage { grid-template-columns: 1fr 1fr; }
  .cm-collage-mid { margin-top: 0; }
  .cm-formrule { display: none; }
  .cm-svc-tags { display: none !important; }
  .cm-team-grid { grid-template-columns: repeat(2, 1fr); gap: 24px 20px; }
}
@media (max-width: 619px) {
  .cm-stats { grid-template-columns: 1fr; }
  .cm-container { padding-left: 24px; padding-right: 24px; }
  .cm-work, .cm-services, .cm-studio, .cm-team, .cm-contact-inner, .cm-stats { padding-left: 24px; padding-right: 24px; }
}

/* desktop: reveal service tags */
@media (min-width: 900px) {
  .cm-svc-tags { display: inline; }
}

/* ===================== REDUCED MOTION ===================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .cm-marquee, .cm-hero-bg video, .cm-scrollcue-dot { animation: none; }
  .cm-hero-ready [data-hero-line] { transform: none; }
  .cm-hero-ready [data-hero-fade] { opacity: 1; }
  .cm-reveal-ready [data-reveal] { opacity: 1; transform: none; }
}
