/* --- Variables --- */
:root {
  --bg: #0c0d0f;
  --bg-soft: #14161a;
  --text: #e8e6e3;
  --text-muted: #9a9691;
  --accent: #c9a227;
  --accent-hover: #ddb83a;
  --border: rgba(255, 255, 255, 0.08);
  --radius: 8px;
  --font-sans: 'Montserrat', system-ui, sans-serif;
  --font-display: 'Anton SC', sans-serif;
  --font-alt: 'Montserrat', system-ui, sans-serif;
  --space: clamp(1rem, 4vw, 2.5rem);
  --max-w: 1100px;
}

/* --- Reset & base --- */
*, *::before, *::after { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  background: var(--bg);
  min-height: 100%;
  font-family: var(--font-sans);
  overflow-x: hidden;
}
body {
  margin: 0;
  min-height: 100vh;
  font-family: inherit;
  font-size: 18px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; margin: 0; padding: 0; }

/* --- Golden shine spots (above hero bg, below content) --- */
.shine-spots {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 2;
  overflow: hidden;
}

.shine-spot {
  position: absolute;
  width: 380px;
  height: 95px;
  border-radius: 50%;
  background: radial-gradient(
    ellipse 70% 30% at 50% 50%,
    rgba(201, 162, 39, 0.4) 0%,
    rgba(201, 162, 39, 0.16) 55%,
    transparent 100%
  );
  filter: blur(32px);
  animation: shine-float 18s ease-in-out infinite;
}

.shine-spot-1 { top: 7%; left: 4%; animation-delay: 0s; animation-duration: 22s; }
.shine-spot-2 { top: 34%; right: 8%; animation-delay: -5s; animation-duration: 20s; animation-direction: reverse; }
.shine-spot-3 { top: 58%; left: 18%; animation-delay: -3s; animation-duration: 24s; }
.shine-spot-4 { top: 82%; right: 14%; animation-delay: -8s; animation-duration: 19s; animation-direction: reverse; }

@keyframes shine-float {
  0%, 100% { transform: translate(0, 0) rotate(-8deg); }
  25% { transform: translate(20px, -12px) rotate(5deg); }
  50% { transform: translate(-15px, 10px) rotate(-15deg); }
  75% { transform: translate(10px, 15px) rotate(3deg); }
}

/* --- Page wrap (for scrolling dots layer) --- */
.page-wrap {
  position: relative;
}

/* --- Floating dots (inside main, над hero і shine) --- */
.floating-dots {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  min-height: 100vh;
  pointer-events: none;
  z-index: 10;
  overflow: hidden;
  isolation: isolate;
}

.floating-dot {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.45);
  will-change: transform, opacity;
}

main {
  position: relative;
  z-index: 1;
}

.hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 100vh;
  z-index: 0;
  background: var(--bg);
  overflow: hidden;
}

.hero-bg::before {
  content: '';
  position: absolute;
  inset: -2%;
  background: var(--bg) url('images/background.png') center / cover no-repeat;
  filter: brightness(1.2);
  animation: hero-bg-zoom 20s ease-in-out infinite alternate;
}

@keyframes hero-bg-zoom {
  from { transform: scale(1); }
  to { transform: scale(1.18); }
}

.hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(12, 13, 15, 0.28) 0%,
    rgba(12, 13, 15, 0.4) 38%,
    rgba(12, 13, 15, 0.62) 62%,
    rgba(12, 13, 15, 0.88) 82%,
    rgb(12, 13, 15) 88%,
    rgb(12, 13, 15) 100%
  );
  pointer-events: none;
}

/* --- Who We Are (as section on home) --- */
.section.who-we-are {
  position: relative;
  width: 100%;
  max-width: none;
  min-height: 100vh;
  margin-top: -240px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 var(--space);
  box-sizing: border-box;
  overflow: hidden;
  mask-image: linear-gradient(to bottom, transparent 0%, black 14%, black 100%);
  mask-size: 100% 100%;
  mask-position: top;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 14%, black 100%);
  -webkit-mask-size: 100% 100%;
  -webkit-mask-position: top;
}

.section.who-we-are .who-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: var(--bg) url('images/bg2.jpg') center bottom / cover no-repeat;
  filter: brightness(1.15);
  transform-origin: center center;
  animation: who-bg-zoom 45s ease-in-out forwards;
}

.section.who-we-are .who-bg::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 140px;
  background: linear-gradient(to bottom, var(--bg) 0%, transparent 100%);
  filter: blur(24px);
  transform: scaleY(1.4);
  transform-origin: top;
  pointer-events: none;
  z-index: 1;
  opacity: 0.92;
}

.section.who-we-are .who-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    var(--bg) 0%,
    var(--bg) 18%,
    rgba(12, 13, 15, 0.97) 28%,
    rgba(12, 13, 15, 0.7) 45%,
    rgba(12, 13, 15, 0.4) 60%,
    rgba(12, 13, 15, 0.55) 80%,
    rgba(12, 13, 15, 0.82) 100%
  );
  pointer-events: none;
}

.section.who-we-are .who-content {
  position: relative;
  z-index: 1;
  max-width: 680px;
  text-align: center;
  margin-top: 240px;
  transform-origin: center center;
}

.section.who-we-are.is-in-view .who-content {
  animation: hero-subtle-scale 20s ease-out 2s forwards;
}

.section.who-we-are .who-line {
  font-size: clamp(1.05rem, 2.2vw, 1.2rem);
  line-height: 1.7;
  color: var(--text);
  margin: 0 0 1rem;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
  transition-delay: calc(var(--who-delay, 0) * 0.2s);
}

.section.who-we-are.is-in-view .who-line {
  opacity: 1;
  transform: translateY(0);
}

.section.who-we-are .who-line:last-of-type {
  margin-bottom: 0;
}

.section.who-we-are .who-content-logo {
  margin-top: 2.5rem;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease-out 0.9s, transform 0.6s ease-out 0.9s;
}

.section.who-we-are.is-in-view .who-content-logo {
  opacity: 1;
  transform: translateY(0);
}

.section.who-we-are .who-content-logo img {
  height: 28px;
  width: auto;
  display: block;
  margin: 0 auto;
  opacity: 0.22;
  filter: brightness(0) invert(1);
}

/* --- Who We Are page --- */
.page-who-we-are .page-wrap {
  min-height: 100vh;
  position: relative;
  background: var(--bg);
}

.page-who-we-are .who-bg {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 0;
  background: var(--bg) url('images/bg2.jpg') center / cover no-repeat;
  filter: brightness(1.15);
  transform-origin: center center;
  animation: who-bg-zoom 45s ease-in-out forwards;
}

@keyframes who-bg-zoom {
  from { transform: scale(1); }
  to { transform: scale(1.12); }
}

.page-who-we-are .who-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(12, 13, 15, 0.4) 0%, rgba(12, 13, 15, 0.75) 100%);
  pointer-events: none;
}

.page-who-we-are .who-main {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 80px - 120px);
  padding: calc(80px + var(--space)) var(--space) clamp(4rem, 12vw, 6rem);
  box-sizing: border-box;
}

.page-who-we-are .who-content {
  position: relative;
  z-index: 11;
  max-width: 640px;
  text-align: center;
  margin-top: 6rem;
}

.page-who-we-are .who-line {
  font-size: clamp(1.05rem, 2.2vw, 1.2rem);
  line-height: 1.7;
  color: var(--text);
  margin: 0 0 1rem;
  opacity: 0;
  animation: who-fade-in 0.8s ease-out forwards;
  animation-delay: calc(var(--who-delay, 0) * 0.35s);
}

.page-who-we-are .who-line:last-of-type {
  margin-bottom: 0;
}

.page-who-we-are .who-content-logo {
  margin-top: 2.5rem;
  opacity: 0;
  animation: who-fade-in 0.8s ease-out forwards;
  animation-delay: 1.4s;
}

.page-who-we-are .who-content-logo img {
  height: 28px;
  width: auto;
  display: block;
  margin: 0 auto;
  opacity: 0.22;
  filter: brightness(0) invert(1);
}

@keyframes who-fade-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.page-who-we-are .nav-active {
  color: var(--text);
}

/* --- Header --- */
.header {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translate(-50%, -200%);
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 0;
  width: max-content;
  max-width: min(90vw, 56rem);
  height: 3rem;
  padding: 0 1.5rem;
  box-sizing: border-box;
  background: transparent;
  color: #fff;
  perspective: 320px;
  transition: max-width 0.4s ease, gap 0.4s ease;
  animation: header-drop 0.65s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes header-drop {
  0%   { transform: translate(-50%, -200%); }
  60%  { transform: translate(-50%, 2%); }
  78%  { transform: translate(-50%, -4px); }
  100% { transform: translate(-50%, 0); }
}

.logo {
  display: flex;
  align-items: center;
  color: #fff;
  text-decoration: none;
  font-size: 1.9rem;
}

.logo-flip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transform-style: preserve-3d;
}

.logo-img,
.logo img {
  height: 1em;
  width: auto;
  display: block;
  filter: brightness(0) invert(1);
  backface-visibility: hidden;
}

.logo-text {
  font-family: 'Anton SC', sans-serif;
  font-size: 1em;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fff;
  max-width: 0;
  overflow: hidden;
  opacity: 0;
  white-space: nowrap;
  transition: opacity 0.25s ease;
}

.header.header-typewriter .logo-text {
  max-width: 20em;
  overflow: visible;
  opacity: 1;
}

.header .nav {
  opacity: 0;
  visibility: hidden;
  max-width: 0;
  max-height: 0;
  overflow: hidden;
  transition: opacity 0.35s ease, max-width 0.4s ease, max-height 0.4s ease;
}

.header.header-nav-visible {
  gap: 2rem;
}

.header.header-nav-visible .nav {
  opacity: 1;
  visibility: visible;
  max-width: 20rem;
  max-height: 5rem;
  overflow: visible;
}

.header.header-nav-visible .nav a {
  animation: nav-slide-in 1.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
  opacity: 0;
}

.header.header-nav-visible .nav a:nth-child(1) { animation-delay: 0.12s; }
.header.header-nav-visible .nav a:nth-child(2) { animation-delay: 0.45s; }
.header.header-nav-visible .nav a:nth-child(3) { animation-delay: 0.78s; }

@keyframes nav-slide-in {
  from {
    transform: translateX(-1.75rem);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Header intro: flip animation */
.header-flip-1 .logo-flip {
  animation: header-flip 0.55s ease-in-out forwards;
}

@keyframes header-flip {
  0%   { transform: rotateY(0deg); }
  100% { transform: rotateY(360deg); }
}

.nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav a {
  font-size: 0.9rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: color 0.2s;
}

.nav a:hover { color: rgba(255, 255, 255, 0.9); }

.btn-nav {
  padding: 0.45rem 1.1rem;
  background: rgba(255, 255, 255, 0.95);
  color: #1a1b1d !important;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
}

.btn-nav:hover {
  background: #fff;
  opacity: 1;
}

.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text);
}

.menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
}

/* --- Hero --- */
.hero {
  height: 100vh;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: calc(80px + var(--space)) var(--space);
  max-width: 100%;
  margin: 0 auto;
  margin-top: -24px;
  position: relative;
  z-index: 3;
}

/* Ширина контейнера = ширина тексту; картинка розтягується під неї */
.hero-inner {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: max-content;
  max-width: 100%;
  transform-origin: center center;
  animation: hero-subtle-scale 20s ease-out 2s forwards;
}

@keyframes hero-subtle-scale {
  from { transform: scale(1); }
  to { transform: scale(1.095); }
}

.hero-image {
  position: relative;
  width: 100%;
  min-width: 0;
  max-width: none;
  margin-bottom: 2.5rem;
  border-radius: var(--radius);
  /* Висота через aspect-ratio; fallback для старих мобільних (Safari < 15) */
  aspect-ratio: 1258 / 729;
  height: 0;
  padding-bottom: 57.95%; /* 729/1258 — fallback коли aspect-ratio не підтримується */
  background-image: url('./images/hero-image.png');
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0;
  transform: translateY(28px) scale(0.98);
  transform-origin: center center;
  animation: hero-image-flip 1s ease-out forwards;
}

@supports (aspect-ratio: 1) {
  .hero-image {
    height: auto;
    padding-bottom: 0;
  }
}

@keyframes hero-image-flip {
  to {
    opacity: 0.9;
    transform: translateY(0) scale(1);
  }
}

.hero .hero-image,
.hero .hero-title {
  position: relative;
}

.hero-title {
  font-family: var(--font-sans);
  font-size: clamp(1.2rem, 3vw, 1.6rem);
  font-weight: 600;
  line-height: 1.4;
  margin: 0;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(14px);
  min-height: 1.4em;
}

.hero-title.hero-title-visible {
  animation: hero-title-in 0.6s ease-out forwards;
}

@keyframes hero-title-in {
  to {
    opacity: 0.65;
    transform: translateY(0);
  }
}

.hero-sub {
  font-family: var(--font-alt);
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--text-muted);
  max-width: 520px;
  margin: 0 0 2rem;
}

.btn-primary {
  display: inline-block;
  padding: 0.9rem 2rem;
  background: var(--accent);
  color: var(--bg);
  font-weight: 600;
  font-size: 1rem;
  border-radius: var(--radius);
  transition: background 0.2s, transform 0.15s;
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

/* --- Sections --- */
.section {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: clamp(3rem, 10vw, 6rem) var(--space);
}

.section.contact {
  padding-top: 240px;
  padding-bottom: 5rem;
}

main section {
  margin: 0;
}

.section h2 {
  font-family: var(--font-sans);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 600;
  margin: 0 0 1rem;
}

/* --- About --- */
.about h2 { margin-bottom: 0.5rem; }

.about-lead {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 640px;
  margin: 0 0 2.5rem;
}

.pillars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}

.pillar {
  padding: 1.5rem;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s;
}

.pillar:hover { border-color: rgba(201, 162, 39, 0.3); }

.pillar h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
  color: var(--accent);
}

.pillar p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* --- Contact --- */
.section.contact .contact-pill {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.section.contact.is-in-view .contact-pill {
  opacity: 1;
  transform: translateY(0);
}

.contact {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-align: center;
}

.contact-pill {
  display: inline-block;
  padding: 0.45rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  background: rgba(46, 55, 61, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 9999px;
  transition: color 0.2s;
}

.contact-pill:hover {
  color: rgba(255, 255, 255, 0.9);
}

/* --- Footer --- */
.footer {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: var(--space) clamp(1.5rem, 5vw, 3rem);
  border-top: 1px solid var(--border);
  max-width: var(--max-w);
  margin: 0 auto;
  background: var(--bg);
}

.footer-logo img {
  height: 24px;
  width: auto;
  display: block;
  opacity: 0.9;
  filter: brightness(0) invert(1);
}

.footer-copy {
  margin-left: auto;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* --- Mobile --- */
@media (max-width: 768px) {
  /* На мобільному без гамбургера — меню в хедері, з’являється після інтро */
  .header {
    gap: 1rem;
  }

  .nav {
    position: static;
    width: auto;
    flex-direction: row;
    align-items: center;
    padding: 0;
    background: none;
    border: none;
    transform: none;
    gap: 1.25rem;
  }

  .nav a { font-size: 0.9rem; }
  .btn-nav { text-align: center; }

  .menu-toggle { display: none; }

  /* Вертикальні маржини в 4 рази менші на мобільному */
  .section.who-we-are { margin-top: -60px; }
  .section.who-we-are .who-content { margin-top: 60px; }
  .section.who-we-are .who-line { margin: 0 0 1.5rem; }
  .section.who-we-are .who-content-logo { margin-top: 3rem; }
  .hero { margin-top: -18px; }
  .hero-title { white-space: normal; }
  .hero-sub { margin: 0 0 0.5rem; }
  .section { padding: clamp(0.75rem, 2.5vw, 1.5rem) var(--space); }
  .section.contact { padding-top: 60px; }
  .section h2 { margin: 0 0 0.25rem; }
  .about h2 { margin-bottom: 0.125rem; }
  .about-lead { margin: 0 0 0.625rem; }
  .pillar h3 { margin: 0 0 0.125rem; }
  .pillar p { margin: 0; }
}

@media (max-width: 500px) {
  .hero-image {
    width: 320px;
    margin: 0 auto 28px;
  }
}
