/* ============ Base ============ */
:root {
  --bg: #0a0a0c;
  --bg-soft: #111114;
  --cream: #ece5d8;
  --cream-dim: rgba(236, 229, 216, 0.55);
  --cream-faint: rgba(236, 229, 216, 0.14);
  --warm: #c8a27a;
  --line: rgba(236, 229, 216, 0.10);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--cream);
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-weight: 300;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: var(--warm); color: #100d09; }

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

em { font-style: normal; color: var(--warm); }

/* ============ Three.js canvas ============ */
#scene {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
}

/* subtle film grain overlay */
.grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

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

/* ============ Layout helpers ============ */
section { padding: 0 clamp(20px, 6vw, 96px); }

.eyebrow {
  font-size: 12px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--cream-dim);
  font-weight: 400;
}

/* ============ Nav ============ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px clamp(20px, 6vw, 96px);
  mix-blend-mode: difference;
}
.nav__brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: "Syne", sans-serif;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.12em;
}
.nav__dot {
  width: 9px; height: 9px;
  background: var(--cream);
  box-shadow: 0 0 14px var(--cream);
  animation: pulse 2.4s var(--ease) infinite;
}
@keyframes pulse { 50% { opacity: 0.3; transform: scale(0.7); } }
.nav__links { display: flex; gap: 28px; font-size: 13px; letter-spacing: 0.06em; }
.nav__links a { color: var(--cream-dim); transition: color .3s var(--ease); }
.nav__links a:hover { color: var(--cream); }

/* ============ Hero ============ */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  padding-top: 96px;
}
/* readability veil behind the hero copy — radial so it fades on every
   side (no hard edge / seam when you scroll past the hero) */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(115% 85% at 16% 48%,
    rgba(10, 10, 12, 0.92) 0%,
    rgba(10, 10, 12, 0.62) 38%,
    rgba(10, 10, 12, 0.22) 60%,
    transparent 78%);
}
.hero__inner { max-width: 900px; position: relative; }

.hero__logo {
  width: clamp(132px, 13vw, 188px);
  height: auto;
  margin-top: 28px;
  margin-bottom: 26px;
  opacity: 0.95;
  filter: drop-shadow(0 0 24px rgba(236, 229, 216, 0.18));
}

.hero__title {
  font-family: "Syne", sans-serif;
  font-weight: 700;
  font-size: clamp(36px, 6vw, 88px);
  line-height: 1.0;
  letter-spacing: -0.015em;
  margin: 20px 0 26px;
  text-shadow: 0 2px 30px rgba(0, 0, 0, 0.55);
}
.hero__title span { display: block; }

.hero__sub {
  max-width: 520px;
  font-size: clamp(15px, 1.4vw, 18px);
  color: var(--cream-dim);
}

.hero__cta { display: flex; gap: 14px; margin-top: 38px; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  padding: 14px 26px;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 100px;
  border: 1px solid var(--cream-faint);
  transition: all .4s var(--ease);
}
.btn--primary { background: var(--cream); color: #100d09; border-color: var(--cream); }
.btn--primary:hover { background: var(--warm); border-color: var(--warm); transform: translateY(-2px); }
.btn--ghost:hover { border-color: var(--cream); background: rgba(236,229,216,0.04); transform: translateY(-2px); }

.scrollhint {
  position: absolute;
  bottom: 34px; left: clamp(20px, 6vw, 96px);
  display: flex; align-items: center; gap: 14px;
  font-size: 11px; letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--cream-dim);
}
.scrollhint i {
  width: 46px; height: 1px; background: var(--cream-faint); position: relative; overflow: hidden;
}
.scrollhint i::after {
  content: ""; position: absolute; inset: 0; width: 50%;
  background: var(--cream);
  animation: slide 2.2s var(--ease) infinite;
}
@keyframes slide { 0% { transform: translateX(-100%);} 100% { transform: translateX(200%);} }

/* ============ About ============ */
.about { padding-top: 14vh; padding-bottom: 14vh; }
.about__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(30px, 6vw, 90px);
  align-items: start;
}
.about__head h2 {
  font-family: "Syne", sans-serif;
  font-weight: 700;
  font-size: clamp(26px, 3.2vw, 46px);
  line-height: 1.06;
  letter-spacing: -0.01em;
  margin-top: 18px;
  text-shadow: 0 2px 28px rgba(0, 0, 0, 0.5);
}
.about__body p { color: rgba(236, 229, 216, 0.82); margin-bottom: 20px; font-size: clamp(15px,1.15vw,17px); }
.about__body p:last-child { margin-bottom: 0; }
.about__body p:first-child { color: var(--cream); }

.stats {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: clamp(50px, 8vw, 110px);
  border-top: 1px solid var(--line);
  padding-top: 40px;
}
.stats strong {
  display: block;
  font-family: "Syne", sans-serif;
  font-weight: 700;
  font-size: clamp(28px, 3.4vw, 46px);
}
.stats span { color: var(--cream-dim); font-size: 13px; letter-spacing: 0.04em; }

/* ============ Work ============ */
.work { padding-top: 10vh; padding-bottom: 16vh; }
.work__head { margin-bottom: 48px; }
.work__head h2 {
  font-family: "Syne", sans-serif;
  font-weight: 700;
  font-size: clamp(26px, 3.4vw, 50px);
  margin-top: 14px;
  letter-spacing: -0.01em;
  text-shadow: 0 2px 28px rgba(0, 0, 0, 0.5);
}
.work__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(16px, 2vw, 28px);
}
.tile {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: rgba(12, 12, 16, 0.34);
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  transition: transform .5s var(--ease), border-color .5s var(--ease);
}
.tile:hover { transform: translateY(-6px); border-color: var(--cream-faint); }
.tile__media {
  height: clamp(180px, 24vw, 320px);
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(120% 120% at 30% 20%, rgba(200,162,122,0.22), transparent 60%),
    repeating-linear-gradient(135deg, rgba(236,229,216,0.05) 0 2px, transparent 2px 16px);
}
.tile__media::after {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(circle at center, transparent 0 40%, rgba(10,10,12,0.5));
  opacity: 0; transition: opacity .5s var(--ease);
}
.tile:hover .tile__media::after { opacity: 1; }
/* play glyph */
.tile__media::before {
  content: "";
  position: absolute; top: 50%; left: 50%;
  width: 0; height: 0;
  transform: translate(-40%, -50%) scale(0.9);
  border-style: solid;
  border-width: 16px 0 16px 26px;
  border-color: transparent transparent transparent var(--cream);
  opacity: 0.85;
  transition: transform .5s var(--ease), opacity .5s var(--ease);
  z-index: 2;
  filter: drop-shadow(0 0 18px rgba(236,229,216,0.45));
}
.tile:hover .tile__media::before { transform: translate(-40%, -50%) scale(1.18); opacity: 1; }
.tile__meta { padding: 22px 24px 26px; }
.tile__num { font-size: 12px; letter-spacing: 0.2em; color: var(--warm); }
.tile__meta h3 {
  font-family: "Syne", sans-serif;
  font-weight: 700;
  font-size: clamp(20px, 2vw, 28px);
  margin: 8px 0 8px;
}
.tile__meta p { color: var(--cream-dim); font-size: 14px; }

/* ============ Footer ============ */
.footer {
  border-top: 1px solid var(--line);
  padding: clamp(60px, 9vw, 120px) clamp(20px, 6vw, 96px) 40px;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,0.5));
}
.footer__cta h2 {
  font-family: "Syne", sans-serif;
  font-weight: 700;
  font-size: clamp(30px, 4.6vw, 64px);
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin-top: 16px;
  max-width: 12ch;
}
.footer__contacts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: clamp(44px, 7vw, 84px) 0 60px;
}
.contact {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 14px;
  transition: all .4s var(--ease);
}
.contact:hover { border-color: var(--cream-faint); background: rgba(236,229,216,0.03); transform: translateY(-4px); }
.contact__label { font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--cream-dim); }
.contact__mail { font-family: "Syne", sans-serif; font-weight: 600; font-size: clamp(15px, 1.5vw, 20px); }
.contact:hover .contact__mail { color: var(--warm); }

.footer__bottom {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 30px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--cream-dim);
}
.footer__bottom span:first-child { font-family: "Syne", sans-serif; font-weight: 700; color: var(--cream); letter-spacing: 0.12em; }

/* ============ Reveal animation ============ */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }

/* ============ Glass readability panels ============ */
/* Frosted-glass cards behind the floating copy: the backdrop-filter blurs the
   busy 3D background directly behind the text so it reads cleanly, while keeping
   the translucent "glass" aesthetic. */
.about__head,
.about__body {
  background: rgba(10, 10, 14, 0.42);
  -webkit-backdrop-filter: blur(16px) saturate(125%);
  backdrop-filter: blur(16px) saturate(125%);
  border: 1px solid rgba(236, 229, 216, 0.10);
  border-radius: 20px;
  padding: clamp(24px, 2.6vw, 40px);
}

/* heading blocks hug their content so they read as a tag, not a full-width bar */
.work__head,
.footer__cta {
  display: inline-block;
  background: rgba(10, 10, 14, 0.42);
  -webkit-backdrop-filter: blur(16px) saturate(125%);
  backdrop-filter: blur(16px) saturate(125%);
  border: 1px solid rgba(236, 229, 216, 0.10);
  border-radius: 20px;
  padding: clamp(20px, 2.4vw, 32px) clamp(24px, 2.8vw, 40px);
}

/* graceful fallback if the browser has no backdrop-filter: lean on a darker
   solid panel instead so text is still readable */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .about__head,
  .about__body,
  .work__head,
  .footer__cta,
  .tile { background: rgba(10, 10, 14, 0.82); }
}

/* ============ Responsive ============ */
@media (max-width: 820px) {
  .nav__links { display: none; }
  .about__grid { grid-template-columns: 1fr; }
  .work__grid { grid-template-columns: 1fr; }
  .footer__contacts { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr; gap: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  * { animation: none !important; }
}
