:root {
  --bg: #050505;
  --bg-2: #0c0c0d;
  --fg: #f4f2ec;
  --muted: #9a958a;
  --line: rgba(255, 255, 255, 0.08);
  --gold: #c5a572;
  --gold-bright: #e0c48a;
  --gold-dim: rgba(197, 165, 114, 0.14);
  --font-display: "Bricolage Grotesque", Georgia, serif;
  --font-body: "Figtree", system-ui, sans-serif;
  --pad: clamp(1.25rem, 5vw, 4.5rem);
  --max: 68rem;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: auto;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* —— Atmospheric stage —— */
.stage {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  /* Isolate compositing so iOS scroll doesn't fight child transforms */
  transform: translate3d(0, 0, 0);
  -webkit-transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  background:
    radial-gradient(ellipse 90% 60% at 75% 10%, rgba(197, 165, 114, 0.14), transparent 55%),
    radial-gradient(ellipse 70% 50% at 10% 90%, rgba(255, 255, 255, 0.035), transparent 50%),
    linear-gradient(165deg, #080807 0%, #050505 48%, #100e0a 100%);
}

.stage-grid {
  position: absolute;
  inset: -20%;
  background-image:
    linear-gradient(rgba(197, 165, 114, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(197, 165, 114, 0.05) 1px, transparent 1px);
  background-size: 72px 72px;
  transform: perspective(600px) rotateX(58deg) scale(1.4) translateZ(0);
  transform-origin: center top;
  /* No background-position animation — it steps during scroll on mobile Safari */
  -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.55), transparent 78%);
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.55), transparent 78%);
}

.orb {
  position: absolute;
  border-radius: 50%;
  opacity: 0.5;
  transform: translate3d(0, 0, 0);
  -webkit-transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  will-change: transform;
}

.orb-a {
  width: 28rem;
  height: 28rem;
  top: -8%;
  right: -5%;
  background: radial-gradient(circle, rgba(197, 165, 114, 0.4), transparent 68%);
}

.orb-b {
  width: 22rem;
  height: 22rem;
  bottom: 8%;
  left: -8%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.08), transparent 70%);
}

.orb-c {
  width: 16rem;
  height: 16rem;
  top: 42%;
  left: 48%;
  background: radial-gradient(circle, rgba(197, 165, 114, 0.18), transparent 70%);
}

.ring {
  position: absolute;
  border: 1px solid rgba(197, 165, 114, 0.22);
  border-radius: 50%;
  transform: translate3d(0, 0, 0);
  -webkit-transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  will-change: transform, opacity;
  opacity: 0.5;
}

.r1 {
  width: min(70vw, 36rem);
  height: min(70vw, 36rem);
  right: -8%;
  top: 12%;
}

.r2 {
  width: min(50vw, 24rem);
  height: min(50vw, 24rem);
  right: 4%;
  top: 22%;
  border-color: rgba(255, 255, 255, 0.08);
}

/* Triangles: fixed backdrop, motion driven by JS rAF (smooth on iOS scroll) */
.stage .shard {
  position: absolute;
  display: block;
  background: var(--gold);
  clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
  -webkit-clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
  opacity: 0.16;
  transform: translate3d(0, 0, 0);
  -webkit-transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  will-change: transform;
  animation: none;
}

.stage .s1 {
  top: 14%;
  right: 12%;
  width: 88px;
  height: 76px;
  opacity: 0.2;
}

.stage .s2 {
  top: 38%;
  right: 26%;
  width: 48px;
  height: 42px;
  background: rgba(255, 255, 255, 0.65);
  opacity: 0.14;
}

.stage .s3 {
  top: 22%;
  left: 10%;
  width: 60px;
  height: 52px;
  background: rgba(197, 165, 114, 0.8);
  opacity: 0.16;
}

.stage .s4 {
  top: 48%;
  left: 20%;
  width: 36px;
  height: 32px;
  background: rgba(255, 255, 255, 0.45);
  opacity: 0.12;
}

.grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 40;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

main,
.nav,
.foot {
  position: relative;
  z-index: 1;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  color: var(--gold-bright);
}

strong {
  font-weight: 600;
  color: var(--fg);
}

code {
  font-size: 0.9em;
  padding: 0.1em 0.35em;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--gold-bright);
  background: var(--gold-dim);
}

/* —— Reveal —— */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  animation: rise 0.85s var(--ease) forwards;
}

.reveal.d1 { animation-delay: 0.1s; }
.reveal.d2 { animation-delay: 0.2s; }
.reveal.d3 { animation-delay: 0.3s; }

@keyframes rise {
  to { opacity: 1; transform: none; }
}

/* —— Nav —— */
.nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem var(--pad);
  background: linear-gradient(to bottom, rgba(5, 5, 5, 0.92), rgba(5, 5, 5, 0.55) 70%, transparent);
  backdrop-filter: blur(10px);
}

.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.08em;
  font-size: 0.95rem;
}

.nav-brand img {
  border-radius: 4px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(0.75rem, 2vw, 1.5rem);
  font-size: 0.92rem;
  color: var(--muted);
}

.nav-links a:hover {
  color: var(--fg);
}

.nav-cta {
  color: var(--bg) !important;
  background: var(--gold);
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  font-weight: 600;
}

.nav-cta:hover {
  background: var(--gold-bright);
  color: var(--bg) !important;
}

.tg-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.tg-ico {
  width: 1.05rem;
  height: 1.05rem;
  flex-shrink: 0;
}

@media (max-width: 760px) {
  .nav-links a:not(.nav-cta) {
    display: none;
  }
}

/* —— Hero —— */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: flex-end;
  padding: calc(5.5rem + env(safe-area-inset-top)) var(--pad) clamp(3rem, 8vh, 5rem);
  overflow: hidden;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 42rem;
}

.brand {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.4rem, 7vw, 4.5rem);
  letter-spacing: 0.04em;
  line-height: 0.95;
  color: var(--fg);
  text-shadow: 0 0 40px rgba(197, 165, 114, 0.15);
}

.hero h1 {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.45rem, 3.4vw, 2.2rem);
  line-height: 1.18;
  letter-spacing: -0.02em;
  max-width: 20ch;
}

.lede {
  margin: 0 0 1.75rem;
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 38ch;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.8rem 1.25rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  transition: transform 0.25s var(--ease), background 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.25s;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: var(--gold);
  color: #12100c;
  box-shadow: 0 0 0 0 rgba(197, 165, 114, 0);
}

.btn-primary:hover {
  background: var(--gold-bright);
  color: #12100c;
  box-shadow: 0 12px 40px -12px rgba(197, 165, 114, 0.55);
}

.btn-ghost {
  border-color: var(--line);
  color: var(--fg);
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(6px);
}

.btn-ghost:hover {
  border-color: rgba(197, 165, 114, 0.45);
  color: var(--gold-bright);
}

.btn-ghost .tg-ico {
  color: #2aabee;
}

.nav-cta .tg-ico {
  color: #12100c;
}

.btn-primary .tg-ico {
  color: #12100c;
}

/* —— Sections —— */
.section {
  padding: clamp(4rem, 10vh, 6.5rem) var(--pad);
  max-width: var(--max);
  margin: 0 auto;
  border-top: 1px solid var(--line);
  background: linear-gradient(to bottom, rgba(5, 5, 5, 0.35), rgba(5, 5, 5, 0.72));
  backdrop-filter: blur(2px);
}

.eyebrow {
  margin: 0 0 0.75rem;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
}

.section h2 {
  margin: 0 0 1.25rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.6rem, 3.4vw, 2.45rem);
  letter-spacing: -0.02em;
  line-height: 1.15;
  max-width: 20ch;
}

.prose {
  margin: 0 0 1.5rem;
  color: var(--muted);
  max-width: 42rem;
}

.prose.narrow {
  max-width: 36rem;
}

.prose a {
  color: var(--gold-bright);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.steps {
  list-style: none;
  margin: 2.5rem 0 0;
  padding: 0;
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 800px) {
  .steps {
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
  }
}

.steps li {
  display: grid;
  gap: 0.85rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  transition: border-color 0.35s var(--ease), transform 0.35s var(--ease);
}

.steps li:hover {
  border-color: rgba(197, 165, 114, 0.35);
  transform: translateY(-3px);
}

.step-n {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--gold);
  font-size: 0.95rem;
  letter-spacing: 0.08em;
}

.steps h3 {
  margin: 0 0 0.4rem;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
}

.steps p {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
}

.join-grid {
  display: grid;
  gap: 1.25rem;
  margin: 2rem 0 2rem;
}

@media (min-width: 800px) {
  .join-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.join-block {
  padding: 1.35rem 0 0;
  border-top: 1px solid var(--line);
  transition: border-color 0.35s var(--ease);
}

.join-block:hover {
  border-color: rgba(197, 165, 114, 0.4);
}

.join-block h3 {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
}

.join-block p {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
}

.join-block a {
  color: var(--gold-bright);
}

.plain-list {
  margin: 0 0 2rem;
  padding-left: 1.15rem;
  color: var(--muted);
  max-width: 42rem;
}

.plain-list li {
  margin-bottom: 0.65rem;
}

.plain-list li::marker {
  color: var(--gold);
}

.estimate-form {
  display: grid;
  gap: 1rem;
  max-width: 24rem;
  margin: 2rem 0 1.5rem;
}

.estimate-form label {
  display: grid;
  gap: 0.4rem;
}

.estimate-form label span {
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.estimate-form select,
.estimate-form input {
  appearance: none;
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(12, 12, 13, 0.85);
  color: var(--fg);
  font: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.estimate-form select:focus,
.estimate-form input:focus {
  outline: none;
  border-color: rgba(197, 165, 114, 0.55);
  box-shadow: 0 0 0 3px rgba(197, 165, 114, 0.15);
}

.hint {
  margin: -0.35rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.hint.warn {
  color: #e0a090;
}

.estimate-card {
  margin-top: 0.5rem;
  padding: 1.5rem 0 0;
  border-top: 1px solid var(--line);
  max-width: 28rem;
}

.estimate-label {
  margin: 0 0 0.35rem;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.estimate-value {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 6vw, 3.5rem);
  font-weight: 800;
  color: var(--gold-bright);
  letter-spacing: -0.03em;
  line-height: 1;
  text-shadow: 0 0 32px rgba(197, 165, 114, 0.25);
}

.estimate-note {
  margin: 0.75rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.contact {
  padding-bottom: clamp(5rem, 12vh, 8rem);
}

.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem var(--pad) 2rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
  background: rgba(5, 5, 5, 0.7);
}

.foot-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--fg);
  font-size: 0.85rem;
}

.foot-brand img {
  border-radius: 3px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}

.legal {
  position: relative;
  z-index: 1;
  margin: 0;
  padding: 0 var(--pad) 2.5rem;
  max-width: var(--max);
  margin-inline: auto;
  font-size: 0.78rem;
  line-height: 1.55;
  color: #6e6a62;
}
