/* ============================================================
   Galstyan Production Studio — Luxury Black & Gold
   ============================================================ */

:root {
  --black: #0a0a0b;
  --black-2: #111113;
  --black-3: #17171a;
  --gold: #c9a227;
  --gold-light: #e7c869;
  --gold-soft: #d4af37;
  --cream: #f5f1e8;
  --text: #d8d6d0;
  --muted: #8c8a86;
  --line: rgba(201, 162, 39, 0.18);
  --shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.7);

  --serif: "Playfair Display", Georgia, serif;
  --serif-2: "Cormorant Garamond", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, sans-serif;

  --maxw: 1240px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--black);
  color: var(--text);
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

.container { width: min(92%, var(--maxw)); margin-inline: auto; }

em { font-style: italic; color: var(--gold-light); }

/* ---------- Loader ---------- */
.loader {
  position: fixed; inset: 0; z-index: 1000;
  background: var(--black);
  display: grid; place-content: center; gap: 24px;
  transition: opacity 0.7s var(--ease), visibility 0.7s;
}
.loader.done { opacity: 0; visibility: hidden; }
.loader-mark {
  font-family: var(--serif); font-size: 2.4rem; letter-spacing: 0.4em;
  color: var(--gold); text-indent: 0.4em;
  animation: pulse 1.6s ease-in-out infinite;
}
.loader-bar { width: 180px; height: 2px; background: rgba(255,255,255,0.08); overflow: hidden; }
.loader-bar span { display: block; height: 100%; width: 40%; background: var(--gold); animation: load 1.2s var(--ease) infinite; }
@keyframes load { 0% { transform: translateX(-100%); } 100% { transform: translateX(350%); } }
@keyframes pulse { 50% { opacity: 0.45; } }

/* ---------- Scroll progress ---------- */
.scroll-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 100%;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  transform: scaleX(0); transform-origin: left center; will-change: transform;
  z-index: 999;
}

/* ---------- Navigation ---------- */
.nav {
  position: fixed; top: 0; left: 0; width: 100%; z-index: 200;
  padding: 22px 0;
  transition: padding 0.4s var(--ease), background 0.4s var(--ease), backdrop-filter 0.4s;
}
.nav.scrolled {
  padding: 12px 0;
  background: rgba(10, 10, 11, 0.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; }

.brand { display: flex; flex-direction: column; line-height: 1; }
.brand-mark { font-family: var(--serif); font-weight: 700; letter-spacing: 0.28em; color: var(--cream); font-size: 1.15rem; }
.brand-sub { font-size: 0.6rem; letter-spacing: 0.4em; color: var(--gold); text-transform: uppercase; margin-top: 4px; }

.nav-links { display: flex; align-items: center; gap: 36px; }
.nav-links a {
  font-size: 0.82rem; letter-spacing: 0.08em; color: var(--text);
  text-transform: uppercase; position: relative; transition: color 0.3s;
}
.nav-links a:not(.nav-cta)::after {
  content: ""; position: absolute; left: 0; bottom: -6px; width: 0; height: 1px;
  background: var(--gold); transition: width 0.35s var(--ease);
}
.nav-links a:not(.nav-cta):hover { color: var(--gold-light); }
.nav-links a:not(.nav-cta):hover::after { width: 100%; }
.nav-cta {
  border: 1px solid var(--gold); color: var(--gold-light);
  padding: 9px 20px; border-radius: 2px;
  transition: background 0.35s var(--ease), color 0.35s;
}
.nav-cta:hover { background: var(--gold); color: var(--black); }

.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: 0; padding: 6px; }
.nav-toggle span { width: 26px; height: 2px; background: var(--cream); transition: 0.35s var(--ease); }
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 15px 34px; font-size: 0.82rem; letter-spacing: 0.14em;
  text-transform: uppercase; border-radius: 2px; font-weight: 500;
  transition: transform 0.35s var(--ease), box-shadow 0.35s, background 0.35s, color 0.35s;
}
.btn-gold {
  background: linear-gradient(135deg, var(--gold), var(--gold-soft));
  color: var(--black); box-shadow: 0 14px 30px -12px rgba(201,162,39,0.6);
}
.btn-gold:hover { transform: translateY(-3px); box-shadow: 0 22px 40px -12px rgba(201,162,39,0.7); }
.btn-ghost { border: 1px solid rgba(245,241,232,0.3); color: var(--cream); }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold-light); transform: translateY(-3px); }
.btn.full { width: 100%; }

/* ---------- Hero ---------- */
.hero { position: relative; min-height: 100vh; min-height: 100svh; display: flex; align-items: center; overflow: hidden; }
.hero-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(110% 80% at 85% 8%, rgba(201,162,39,0.16), transparent 55%),
    linear-gradient(155deg, #0b0b0c 0%, #15140f 55%, #0a0a0b 100%);
}
.hero-bg::after {
  content: ""; position: absolute; inset: 0; opacity: 0.5;
  background-image: radial-gradient(rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 22px 22px;
}
.hero-grid {
  position: relative; z-index: 2; padding-top: 90px;
  display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 56px; align-items: center; width: min(92%, var(--maxw));
}
.hero-content { max-width: 640px; }
.hero-figure {
  position: relative; border-radius: 10px; overflow: hidden; aspect-ratio: 4 / 5;
  box-shadow: var(--shadow); border: 1px solid var(--line);
}
.hero-figure::before {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(231,200,105,0.25);
  background: linear-gradient(180deg, transparent 60%, rgba(10,10,11,0.5));
}
.hero-figure img { width: 100%; height: 100%; object-fit: cover; }
.hero-figure figcaption {
  position: absolute; left: 0; bottom: 0; z-index: 2; padding: 16px 20px;
  font-family: var(--serif-2); font-style: italic; color: var(--cream); font-size: 1.02rem;
}
.eyebrow {
  font-size: 0.78rem; letter-spacing: 0.42em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 22px;
}
.eyebrow.gold { color: var(--gold-light); }
.hero-title {
  font-family: var(--serif); font-weight: 700; color: var(--cream);
  font-size: clamp(2.8rem, 8vw, 6.4rem); line-height: 1.02; letter-spacing: -0.01em;
  margin-bottom: 28px;
}
.reveal-line { display: block; overflow: hidden; }
.reveal-line > span {
  display: block; transform: translateY(110%);
  animation: rise 1s var(--ease) forwards;
}
.reveal-line:nth-child(2) > span { animation-delay: 0.15s; }
@keyframes rise { to { transform: translateY(0); } }
.hero-lead { max-width: 560px; font-size: 1.08rem; color: var(--text); margin-bottom: 38px; font-weight: 300; }
.hero-lead strong { color: var(--cream); font-weight: 600; }
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; }

.scroll-cue {
  position: absolute; bottom: 32px; left: 50%; transform: translateX(-50%);
  z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 10px;
  font-size: 0.65rem; letter-spacing: 0.3em; text-transform: uppercase; color: var(--muted);
}
.scroll-cue span {
  width: 1px; height: 46px; background: linear-gradient(var(--gold), transparent);
  position: relative; overflow: hidden;
}
.scroll-cue span::after {
  content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 40%;
  background: var(--gold-light); animation: scrolldot 1.8s var(--ease) infinite;
}
@keyframes scrolldot { 0% { transform: translateY(-100%); } 100% { transform: translateY(250%); } }

/* ---------- Marquee ---------- */
.marquee { background: var(--gold); color: var(--black); padding: 16px 0; overflow: hidden; }
.marquee-track {
  display: flex; gap: 28px; white-space: nowrap; width: max-content;
  animation: marquee 28s linear infinite;
  font-family: var(--serif); font-style: italic; font-size: 1.2rem; font-weight: 600;
}
.marquee-track span { opacity: 0.92; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Section base ---------- */
.section { padding: clamp(70px, 11vh, 140px) 0; }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 60px; }
.section-title {
  font-family: var(--serif); color: var(--cream); font-weight: 600;
  font-size: clamp(2rem, 5vw, 3.4rem); line-height: 1.1; margin-bottom: 16px;
}
.section-sub { color: var(--muted); font-weight: 300; }

/* ---------- Photography & Storytelling ---------- */
.story { background: var(--black-2); }
.story-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; }
.story-image { position: relative; border-radius: 6px; overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--line); }
.story-image img { width: 100%; height: 100%; max-height: 620px; object-fit: cover; filter: grayscale(0.15) brightness(0.92); transition: transform 0.9s var(--ease), filter 0.7s; }
.story-image:hover img { transform: scale(1.05); filter: grayscale(0) brightness(1); }
.story-image figcaption {
  position: absolute; left: 0; bottom: 0; padding: 22px 26px; width: 100%;
  background: linear-gradient(0deg, rgba(10,10,11,0.85), transparent);
  font-family: var(--serif-2); font-style: italic; color: var(--cream); font-size: 1.1rem;
}
.story-copy p { color: var(--text); font-weight: 300; margin-bottom: 18px; max-width: 520px; }
.story-points { list-style: none; display: grid; gap: 12px; margin: 24px 0 4px; }
.story-points li { display: flex; align-items: baseline; gap: 16px; color: var(--text); border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.story-points span { font-family: var(--serif); color: var(--gold-light); font-weight: 700; min-width: 30px; }
.story-quote {
  font-family: var(--serif); font-size: clamp(1.3rem, 2.6vw, 1.7rem); color: var(--gold-light);
  line-height: 1.4; border-left: 2px solid var(--gold); padding-left: 22px; margin-top: 28px;
}

/* ---------- Services (image cards) ---------- */
.services { background: linear-gradient(180deg, var(--black-2), var(--black)); }
.services-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.service-card {
  position: relative; background: var(--black-3); border: 1px solid rgba(255,255,255,0.05);
  border-radius: 6px; overflow: hidden;
  transition: transform 0.45s var(--ease), border-color 0.45s, box-shadow 0.45s;
}
.service-card:hover { transform: translateY(-10px); border-color: var(--gold); box-shadow: var(--shadow); }
.service-media { overflow: hidden; aspect-ratio: 4 / 3; }
.service-media img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(0.2) brightness(0.85); transition: transform 0.8s var(--ease), filter 0.6s; }
.service-card:hover .service-media img { transform: scale(1.08); filter: grayscale(0) brightness(1); }
.service-body { padding: 28px 28px 34px; }
.service-tag {
  display: inline-block; font-size: 0.64rem; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--gold-light); margin-bottom: 12px;
}
.service-card h3 { font-family: var(--serif); color: var(--cream); font-size: 1.5rem; margin-bottom: 12px; }
.service-card p { color: var(--muted); font-size: 0.95rem; }

/* ---------- About Artyom ---------- */
.about { background: var(--black); }
.about-grid { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 56px; align-items: start; }
.profile-card {
  position: sticky; top: 100px;
  background: var(--black-3); border: 1px solid var(--line); border-radius: 8px;
  padding: 22px; box-shadow: var(--shadow);
}
.profile-photo { border-radius: 6px; overflow: hidden; aspect-ratio: 4 / 5; margin-bottom: 20px; }
.profile-photo img { width: 100%; height: 100%; object-fit: cover; }
.profile-name { font-family: var(--serif); color: var(--cream); font-size: 1.5rem; text-align: center; }
.profile-role { text-align: center; color: var(--gold-light); font-size: 0.82rem; letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 22px; }
.profile-facts { display: grid; gap: 0; }
.profile-facts > div { display: grid; grid-template-columns: 1fr 1.3fr; gap: 12px; padding: 12px 4px; border-top: 1px solid rgba(255,255,255,0.06); }
.profile-facts dt { color: var(--muted); font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; }
.profile-facts dd { color: var(--cream); font-size: 0.9rem; }

.about-bio .bio-lead { font-family: var(--serif-2); font-size: 1.3rem; color: var(--cream); line-height: 1.6; margin-bottom: 28px; }
.about-bio h4 { font-family: var(--serif); color: var(--gold-light); font-size: 1.15rem; margin: 22px 0 10px; }
.about-bio p { color: var(--text); font-weight: 300; margin-bottom: 14px; }
.about-stats { clear: both; display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 38px; padding-top: 32px; border-top: 1px solid var(--line); text-align: center; }

/* Shared stat styling (used in About) */
.stat { display: block; text-align: center; }
.stat-num, .stat-plus {
  font-family: var(--serif); font-size: clamp(2rem, 4vw, 3rem);
  color: var(--gold-light); font-weight: 700; line-height: 1;
}
.stat p { color: var(--muted); font-size: 0.76rem; letter-spacing: 0.14em; text-transform: uppercase; margin-top: 12px; }

/* ---------- Testimonials ---------- */
.testimonials { background: linear-gradient(180deg, var(--black-2), var(--black)); }
.testi-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.testi-card {
  background: var(--black-3); border: 1px solid rgba(255,255,255,0.05);
  padding: 36px 30px; border-radius: 6px; position: relative;
  transition: transform 0.45s var(--ease), border-color 0.45s;
}
.testi-card:hover { transform: translateY(-8px); border-color: var(--gold); }
.testi-card::before {
  content: "\201C"; font-family: var(--serif); position: absolute; top: 4px; right: 24px;
  font-size: 5rem; color: rgba(201,162,39,0.18); line-height: 1;
}
.stars { color: var(--gold); letter-spacing: 0.2em; margin-bottom: 18px; }
.testi-card p { font-family: var(--serif-2); font-size: 1.22rem; color: var(--cream); line-height: 1.55; margin-bottom: 24px; }
.testi-card footer { display: flex; flex-direction: column; }
.testi-card strong { color: var(--gold-light); font-weight: 600; }
.testi-card span { color: var(--muted); font-size: 0.82rem; }

.logos {
  display: flex; justify-content: center; flex-wrap: wrap; gap: clamp(28px, 6vw, 70px);
  margin-top: 70px; padding-top: 40px; border-top: 1px solid var(--line);
}
.logos span { font-family: var(--serif); letter-spacing: 0.3em; color: var(--muted); font-size: 1.1rem; transition: color 0.4s; }
.logos span:hover { color: var(--gold-light); }

/* ---------- Contact ---------- */
.contact { background: var(--black); }
.contact-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 70px; align-items: start; }
.contact-copy p { color: var(--text); font-weight: 300; max-width: 420px; margin-bottom: 32px; }
.contact-info { list-style: none; display: grid; gap: 20px; margin-bottom: 32px; }
.contact-info li { display: flex; flex-direction: column; gap: 4px; }
.contact-info span { font-size: 0.7rem; letter-spacing: 0.24em; text-transform: uppercase; color: var(--gold); }
.contact-info a { color: var(--cream); font-size: 1.1rem; transition: color 0.3s; }
.contact-info a:hover { color: var(--gold-light); }
.socials { display: flex; gap: 24px; }
.socials a { font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); position: relative; }
.socials a:hover { color: var(--gold-light); }

.contact-form { display: grid; gap: 26px; }
.field { position: relative; }
.field input, .field select, .field textarea {
  width: 100%; background: transparent; border: 0; border-bottom: 1px solid rgba(245,241,232,0.2);
  color: var(--cream); font-family: var(--sans); font-size: 1rem; padding: 14px 2px; resize: vertical;
  transition: border-color 0.35s;
}
.field select option { background: var(--black-2); color: var(--cream); }
.field input:focus, .field select:focus, .field textarea:focus { outline: 0; border-color: var(--gold); }
.field label {
  position: absolute; left: 2px; top: 14px; color: var(--muted); pointer-events: none;
  transition: 0.3s var(--ease); font-size: 1rem;
}
.field input:focus + label, .field input:not(:placeholder-shown) + label,
.field textarea:focus + label, .field textarea:not(:placeholder-shown) + label,
.field select:focus + label, .field select:valid + label {
  top: -12px; font-size: 0.72rem; letter-spacing: 0.12em; color: var(--gold-light); text-transform: uppercase;
}
.form-note { font-size: 0.85rem; color: var(--gold-light); min-height: 18px; }
.form-note.error { color: #e07a7a; }

/* ---------- Footer ---------- */
.footer { background: var(--black-2); border-top: 1px solid var(--line); padding: 40px 0; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.footer-copy { color: var(--muted); font-size: 0.85rem; }
.to-top { color: var(--gold-light); font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase; transition: color 0.3s; }
.to-top:hover { color: var(--cream); }

/* ---------- Reveal animations ---------- */
.reveal { opacity: 0; transform: translateY(36px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ============================================================
   In-app WebView compatibility (Instagram / Facebook / Telegram)
   Scoped to html.is-inapp ONLY — real Safari never matches these,
   so Safari/Chrome behavior is completely unchanged.
   ============================================================ */

/* 1. Kill native smooth-scroll: it fights the collapsing in-app toolbar.
      A controlled JS rAF scroll handles anchor links instead (see script.js). */
html.is-inapp { scroll-behavior: auto; }

/* 2. Lock viewport-height sections to a JS-measured pixel height so the
      toolbar showing/hiding can't reflow the page mid-scroll. */
html.is-inapp .hero { min-height: var(--app-height, 100svh); }

/* 3. Drop backdrop-filter blur on the nav — extremely expensive to repaint
      every frame in WKWebView and a primary jank source. Use a solid bg. */
html.is-inapp .nav.scrolled {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  background: rgba(10, 10, 11, 0.94);
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .services-grid { grid-template-columns: 1fr; max-width: 560px; margin-inline: auto; }
  .testi-grid { grid-template-columns: 1fr; max-width: 620px; margin-inline: auto; }
  .contact-grid { grid-template-columns: 1fr; gap: 48px; }

  .hero-grid { grid-template-columns: 1fr; gap: 32px; padding-top: 116px; }
  .hero-figure { max-width: 340px; margin-inline: auto; width: 100%; }

  .story-grid { grid-template-columns: 1fr; gap: 36px; }
  .story-image img { max-height: 460px; }

  .about-grid { grid-template-columns: 1fr; gap: 36px; }
  .profile-card { position: static; max-width: 420px; }
}

@media (max-width: 768px) {
  .nav-toggle { display: flex; }
  .nav-links {
    position: fixed; inset: 0 0 0 auto; width: min(78%, 340px); height: 100vh;
    flex-direction: column; justify-content: center; align-items: flex-start; gap: 28px;
    background: var(--black-2); padding: 0 40px; border-left: 1px solid var(--line);
    transform: translateX(100%); transition: transform 0.5s var(--ease); z-index: 150;
  }
  .nav-links.open { transform: translateX(0); }
  .nav-links a { font-size: 1.05rem; }
  .nav-cta { padding: 12px 26px; }

  .hero-actions { width: 100%; }
  .hero-actions .btn { flex: 1; }
}

@media (max-width: 560px) {
  .about-stats { grid-template-columns: 1fr; gap: 28px; }
  .section-head { margin-bottom: 40px; }
  .footer-inner { justify-content: center; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
  .reveal-line > span { transform: none; }
}
