/* ============================================================
   JoniDI — Celestial Dark
   ============================================================ */

@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../assets/fonts/fraunces-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Fraunces';
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url('../assets/fonts/fraunces-italic-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../assets/fonts/outfit-latin.woff2') format('woff2');
}

:root {
  --ink: #06060c;
  --ink-2: #0a0a14;
  --star: #f4efe6;
  --muted: #9a95a8;
  --gold: #e4bf7c;
  --gold-bright: #f5d9a0;
  --gold-dim: rgba(228, 191, 124, 0.35);
  --aurora: #6ee7d8;
  --violet: #8b7cf6;
  --serif: 'Fraunces', Georgia, serif;
  --sans: 'Outfit', system-ui, sans-serif;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --pad: clamp(1.5rem, 6vw, 7rem);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  scrollbar-color: rgba(228, 191, 124, 0.35) #0a0a14;
  scrollbar-width: thin;
}
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: #0a0a14; }
::-webkit-scrollbar-thumb {
  background: rgba(228, 191, 124, 0.3);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(228, 191, 124, 0.5); }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  background: var(--ink);
  color: var(--star);
  font-family: var(--sans);
  font-weight: 300;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

em { font-style: italic; }

/* ---------- Cosmos canvas ---------- */
#cosmos {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: block;
}
.vignette {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 120% 90% at 50% 40%, transparent 55%, rgba(6, 6, 12, 0.85) 100%),
    linear-gradient(to bottom, rgba(6, 6, 12, 0.35), transparent 30%);
}

main, .footer { position: relative; z-index: 2; }

/* ---------- Preloader ---------- */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.6rem;
}
.preloader__logo {
  width: 64px;
  height: 64px;
}
.preloader__mark {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 340;
  letter-spacing: 0.02em;
}
.preloader__word--accent { color: var(--gold); font-weight: 460; }
.preloader__line {
  width: min(220px, 40vw);
  height: 1px;
  background: rgba(244, 239, 230, 0.12);
  overflow: hidden;
}
.preloader__line-fill {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
}

/* ---------- Navigation ---------- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.4rem var(--pad);
  transition: background 0.5s, backdrop-filter 0.5s, padding 0.5s;
}
.nav--scrolled {
  background: rgba(6, 6, 12, 0.7);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding-block: 0.9rem;
  border-bottom: 1px solid rgba(244, 239, 230, 0.06);
}
.nav__logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--star);
  text-decoration: none;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.25rem;
  font-weight: 340;
  letter-spacing: 0.02em;
}
.nav__logo em { color: var(--gold); font-weight: 460; }
.nav__logo-mark { width: 1.7rem; height: 1.7rem; }
.nav__links {
  display: flex;
  align-items: center;
  gap: clamp(1.2rem, 3vw, 2.4rem);
}
.nav__links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition: color 0.3s;
}
.nav__links a:hover { color: var(--gold-bright); }
.nav__cta {
  border: 1px solid var(--gold-dim);
  border-radius: 999px;
  padding: 0.5rem 1.3rem;
  color: var(--gold) !important;
  transition: background 0.3s, color 0.3s, border-color 0.3s;
}
.nav__cta:hover {
  background: var(--gold);
  color: var(--ink) !important;
  border-color: var(--gold);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 1rem 2.2rem;
  border-radius: 999px;
  transition: transform 0.35s var(--ease-out), box-shadow 0.35s, background 0.35s, color 0.35s, border-color 0.35s;
}
.btn--gold {
  background: linear-gradient(120deg, var(--gold), var(--gold-bright));
  color: var(--ink);
  box-shadow: 0 0 0 rgba(228, 191, 124, 0);
}
.btn--gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 40px rgba(228, 191, 124, 0.35);
}
.btn--ghost {
  border: 1px solid rgba(244, 239, 230, 0.2);
  color: var(--star);
}
.btn--ghost:hover {
  border-color: var(--gold);
  color: var(--gold-bright);
  transform: translateY(-2px);
}
.btn--lg { padding: 1.2rem 3rem; font-size: 0.95rem; }

/* ---------- Hero ---------- */
.hero {
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  text-align: center;
  padding: 6rem var(--pad) 4rem;
}
.hero__eyebrow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  margin-bottom: 2.2rem;
}
.hero__eyebrow-mark {
  width: clamp(3rem, 6vw, 4rem);
  height: auto;
  filter: drop-shadow(0 0 14px rgba(228, 191, 124, 0.35));
}
.rule {
  display: inline-block;
  width: clamp(2rem, 6vw, 4rem);
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-dim));
}
.rule:last-child { background: linear-gradient(90deg, var(--gold-dim), transparent); }
.hero__inner { position: relative; }
.hero__inner::before {
  /* soft scrim: quiets the galaxy directly behind the hero text */
  content: '';
  position: absolute;
  inset: -16% -14%;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(ellipse 62% 58% at 50% 44%, rgba(6, 6, 12, 0.66), transparent 72%);
}
.hero__title {
  font-family: var(--serif);
  font-weight: 345;
  color: #fffdf6;
  font-size: clamp(3.4rem, 11.5vw, 9.5rem);
  line-height: 1.02;
  letter-spacing: -0.01em;
  margin-bottom: 2.4rem;
}
.hero__title em {
  font-style: italic;
  font-weight: 380;
  background: linear-gradient(105deg, #ffeec4 15%, var(--gold-bright) 45%, var(--gold) 78%, #c79c5c 95%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero__title-line { display: block; overflow: hidden; }
.hero__title-word { display: inline-block; }
.hero__sub {
  font-size: clamp(1rem, 1.6vw, 1.25rem);
  color: #b5b0c2;
  font-weight: 300;
  line-height: 1.75;
  margin-bottom: 3rem;
  text-shadow: 0 1px 14px rgba(6, 6, 12, 0.95), 0 0 30px rgba(6, 6, 12, 0.8);
}
.hero__actions {
  display: flex;
  gap: 1.1rem;
  justify-content: center;
  flex-wrap: wrap;
}
.hero__scroll {
  position: absolute;
  bottom: 2.2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
}
.hero__scroll-text {
  font-size: 0.68rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--muted);
}
.hero__scroll-line {
  width: 1px;
  height: 3.2rem;
  background: linear-gradient(to bottom, var(--gold), transparent);
  animation: scrollPulse 2.2s var(--ease-out) infinite;
  transform-origin: top;
}
@keyframes scrollPulse {
  0% { transform: scaleY(0); opacity: 0; }
  35% { transform: scaleY(1); opacity: 1; }
  100% { transform: scaleY(1) translateY(1.5rem); opacity: 0; }
}

/* ---------- Sections ---------- */
.section {
  position: relative;
  padding: clamp(6rem, 14vh, 10rem) var(--pad);
  max-width: 1280px;
  margin: 0 auto;
}
.section__head {
  display: flex;
  align-items: baseline;
  gap: 1.2rem;
  margin-bottom: clamp(2.4rem, 5vw, 4rem);
}
.section__num {
  font-family: var(--serif);
  font-style: italic;
  color: var(--gold);
  font-size: 1rem;
}
.section__label {
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--muted);
}
.section__label::after {
  content: '';
  display: inline-block;
  vertical-align: middle;
  width: clamp(3rem, 8vw, 6rem);
  height: 1px;
  margin-left: 1.2rem;
  background: linear-gradient(90deg, var(--gold-dim), transparent);
}
.section__title {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(2rem, 4.6vw, 3.6rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
  max-width: 20ch;
  margin-bottom: clamp(3rem, 6vw, 5rem);
}

/* ---------- Vision ---------- */
.vision__statement {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(1.7rem, 3.8vw, 3.1rem);
  line-height: 1.35;
  letter-spacing: -0.005em;
  max-width: 26ch;
  margin-bottom: clamp(3rem, 7vw, 5.5rem);
}
.vision__statement .line-mask { display: block; overflow: hidden; }
.vision__cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: clamp(2rem, 5vw, 4.5rem);
  max-width: 900px;
}
.vision__cols p {
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.85;
  border-top: 1px solid rgba(244, 239, 230, 0.1);
  padding-top: 1.6rem;
}

/* ---------- Work cards ---------- */
.work__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr));
  gap: 1.2rem;
}
.card {
  position: relative;
  padding: 2.4rem 2rem 2.8rem;
  border: 1px solid rgba(244, 239, 230, 0.08);
  border-radius: 18px;
  background: linear-gradient(160deg, rgba(20, 20, 34, 0.55), rgba(10, 10, 20, 0.35));
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  overflow: hidden;
  transition: transform 0.5s var(--ease-out), border-color 0.5s, background 0.5s;
}
.card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), rgba(228, 191, 124, 0.1), transparent 65%);
  opacity: 0;
  transition: opacity 0.5s;
  pointer-events: none;
}
.card:hover { transform: translateY(-6px); border-color: rgba(228, 191, 124, 0.35); }
.card:hover::before { opacity: 1; }
.card__icon {
  width: 2.6rem;
  height: 2.6rem;
  color: var(--gold);
  margin-bottom: 1.6rem;
}
.card__icon svg { width: 100%; height: 100%; }
.card h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.35rem;
  margin-bottom: 0.8rem;
  letter-spacing: 0.01em;
}
.card p { color: var(--muted); font-size: 0.95rem; line-height: 1.75; }
.card__index {
  position: absolute;
  top: 1.6rem;
  right: 1.8rem;
  font-family: var(--serif);
  font-style: italic;
  color: rgba(228, 191, 124, 0.4);
  font-size: 0.95rem;
}

/* ---------- Approach ---------- */
.approach__list { list-style: none; }
.approach__row {
  display: grid;
  grid-template-columns: minmax(4rem, 10rem) 1fr;
  gap: clamp(1rem, 4vw, 3rem);
  align-items: start;
  padding: clamp(2rem, 4vw, 3rem) 0;
  border-top: 1px solid rgba(244, 239, 230, 0.1);
  transition: border-color 0.4s;
}
.approach__row:last-child { border-bottom: 1px solid rgba(244, 239, 230, 0.1); }
.approach__row:hover { border-top-color: rgba(228, 191, 124, 0.45); }
.approach__num {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px rgba(228, 191, 124, 0.55);
}
.approach__body h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.4rem, 2.4vw, 1.9rem);
  margin-bottom: 0.6rem;
}
.approach__body p { color: var(--muted); max-width: 56ch; line-height: 1.8; }

/* ---------- Contact ---------- */
.contact {
  text-align: center;
  padding-block: clamp(7rem, 18vh, 12rem);
}
.contact__eyebrow {
  font-size: 0.8rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1.8rem;
}
.contact__title {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(2.8rem, 8vw, 6.5rem);
  line-height: 1.05;
  margin-bottom: 1.8rem;
}
.pre-split .line-mask { display: block; overflow: hidden; }
.pre-split .line { display: block; }
.contact__title em {
  background: linear-gradient(105deg, var(--gold-bright) 20%, var(--gold) 50%, #b98d4e 85%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.contact__sub { color: var(--muted); margin-bottom: 3rem; font-size: 1.05rem; }

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid rgba(244, 239, 230, 0.07);
  background: rgba(6, 6, 12, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.footer__inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2.2rem var(--pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.footer__brand {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.05rem;
  font-weight: 340;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}
.footer__brand em { color: var(--gold); font-weight: 460; }
.footer__mark { width: 1.35rem; height: 1.35rem; }
.footer__tag {
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-dim);
}
.footer__legal { font-size: 0.8rem; color: var(--muted); }

/* ---------- Animation initial states (JS removes) ---------- */
.js .reveal-hero,
.js .fade-up { opacity: 0; }
.js .hero__title-word { transform: translateY(110%); }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .hero__scroll-line { animation: none; }
  .js .reveal-hero,
  .js .fade-up { opacity: 1; }
  .js .hero__title-word { transform: none; }
}

/* ---------- Small screens ---------- */
@media (max-width: 640px) {
  .nav__links a:not(.nav__cta) { display: none; }
  .footer__inner { flex-direction: column; text-align: center; }
  .hero__sub br { display: none; }
  .hero__sub { max-width: 34ch; margin-inline: auto; }
}
