/* ══════════════════════════════════════════════════════════════
   Noys — Landing Page
   BEM methodology
   ══════════════════════════════════════════════════════════════ */

/* ──────────────────── Custom Properties ──────────────────── */
:root {
  --color-bg: #F4EEE7;
  --color-bg-alt: #EDE4D9;
  --color-bg-deep: #E5D9C8;
  --color-text: #000000;
  --color-text-secondary: #000000CC;
  --color-text-muted: #00000080;
  --color-accent: #C4A882;
  --color-accent-alt: #D4A574;
  --color-surface: #FFFFFF;
  --font-serif: 'Noto Serif', Georgia, serif;
  --font-ui: 'Rubik', system-ui, sans-serif;
}

/* ──────────────────── Reset ──────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  background-color: #F4EEE7;
}

body {
  font-family: var(--font-ui);
  color: var(--color-text);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: #F4EEE7;
}

.page-gradient {
  background: linear-gradient(170deg, var(--color-bg) 0%, var(--color-bg-alt) 50%, var(--color-bg-deep) 100%);
  min-height: 100vh;
}

img {
  display: block;
  max-width: 100%;
}

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


/* ══════════════════════════════════════════════════════════════
   BLOCK: Grain
   ══════════════════════════════════════════════════════════════ */
.grain {
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none;
  opacity: 0.028;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='a'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23a)' opacity='.5'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 180px;
}

/* ══════════════════════════════════════════════════════════════
   BLOCK: Blob
   ══════════════════════════════════════════════════════════════ */
.blob {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  will-change: transform;
}

.blob--1 {
  width: min(600px, 80vw);
  height: min(600px, 80vw);
  top: -12%;
  left: -15%;
  background: radial-gradient(circle, var(--color-accent) 0%, transparent 70%);
  opacity: 0.22;
  filter: blur(100px);
  animation: blob-drift-1 28s ease-in-out infinite;
}

.blob--2 {
  width: min(420px, 60vw);
  height: min(420px, 60vw);
  top: 18%;
  right: -8%;
  background: radial-gradient(circle, var(--color-accent-alt) 0%, transparent 70%);
  opacity: 0.16;
  filter: blur(90px);
  animation: blob-drift-2 32s ease-in-out infinite;
}

.blob--3 {
  width: min(500px, 70vw);
  height: min(500px, 70vw);
  bottom: -10%;
  left: 25%;
  background: radial-gradient(circle, #D4B896 0%, transparent 70%);
  opacity: 0.13;
  filter: blur(110px);
  animation: blob-drift-3 22s ease-in-out infinite;
}

/* ══════════════════════════════════════════════════════════════
   BLOCK: Hero
   ══════════════════════════════════════════════════════════════ */
.hero {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: visible;
}

.hero__wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  letter-spacing: 0.08em;
  margin-bottom: 0.5em;
  animation: fade-slide-up 1s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
}

.hero__wordmark-logo {
  height: 0.85em;
  width: auto;
}

.hero__text {
  text-align: center;
  padding: max(100px, 12dvh) 24px 0;
  max-width: 720px;
  position: relative;
  z-index: 2;
}

.hero__title {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(1.8rem, 4.8vw, 4.2rem);
  line-height: 1.2;
}

.hero__line {
  display: block;
  white-space: nowrap;
}

.hero__line:nth-child(1) {
  animation: fade-slide-up 1s cubic-bezier(0.16, 1, 0.3, 1) 0.4s both;
}

.hero__line:nth-child(2) {
  animation: fade-slide-up 1s cubic-bezier(0.16, 1, 0.3, 1) 0.6s both;
}

.hero__subtitle {
  font-family: var(--font-ui);
  font-size: clamp(0.88rem, 1.8vw, 1.1rem);
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  margin-top: 1.8em;
  animation: fade-slide-up 1s cubic-bezier(0.16, 1, 0.3, 1) 0.7s both;
}

.hero__cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 2em;
  padding: 16px 34px;
  border-radius: 14px;
  background: var(--color-text);
  color: var(--color-surface);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.01em;
  position: relative;
  overflow: hidden;
  transition:
    transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.3s ease;
  animation: fade-slide-up 1s cubic-bezier(0.16, 1, 0.3, 1) 0.95s both;
}

.hero__cta::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, 0.12) 50%, transparent 60%);
  transform: translateX(-100%);
  transition: transform 0.6s ease;
}

.hero__cta:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.14);
}

.hero__cta:hover::after {
  transform: translateX(100%);
}

.hero__cta-icon {
  width: 18px;
  height: 22px;
  fill: currentColor;
  flex-shrink: 0;
}

/* ══════════════════════════════════════════════════════════════
   BLOCK: Phone
   ══════════════════════════════════════════════════════════════ */
.hero__phone {
  position: relative;
  z-index: 1;
  margin-top: auto;
  padding-top: 2.5em;
  width: clamp(250px, 52vw, 340px);
  animation: phone-entrance 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.7s both;
}

.phone {
  position: relative;
  width: 100%;
  aspect-ratio: 1022 / 2082;
}

.phone__frame {
  position: relative;
  width: 100%;
  height: 100%;
  z-index: 1;
  user-select: none;
  -webkit-user-drag: none;
  filter:
    drop-shadow(0 40px 80px rgba(0, 0, 0, 0.22))
    drop-shadow(0 16px 32px rgba(0, 0, 0, 0.12))
    drop-shadow(0 4px 8px rgba(0, 0, 0, 0.06));
}

.phone__screen {
  position: absolute;
  z-index: 10;
  left: 5.09%;
  top: 2.21%;
  width: 89.82%;
  height: 95.58%;
  border-radius: 13.73% / 6.33%;
  object-fit: cover;
  object-position: top;
  user-select: none;
  -webkit-user-drag: none;
  opacity: 0;
  animation: screen-crossfade 20s ease-in-out infinite;
}

.phone__screen--1 { animation-delay: 0s; }
.phone__screen--2 { animation-delay: -15s; }
.phone__screen--3 { animation-delay: -10s; }
.phone__screen--4 { animation-delay: -5s; }

.phone__watermark {
  position: absolute;
  z-index: 0;
  width: 220%;
  height: auto;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.04;
  filter: blur(2px);
  pointer-events: none;
}

.phone__glow {
  position: absolute;
  z-index: 0;
  width: 160%;
  height: 70%;
  bottom: -15%;
  left: -30%;
  border-radius: 50%;
  background: radial-gradient(ellipse, var(--color-accent) 0%, var(--color-accent-alt) 40%, transparent 70%);
  opacity: 0.18;
  filter: blur(70px);
  animation: glow-breathe 6s ease-in-out 2s infinite;
  will-change: transform, opacity;
}

/* ══════════════════════════════════════════════════════════════
   BLOCK: Footer
   ══════════════════════════════════════════════════════════════ */
.footer {
  position: relative;
  z-index: 1;
  padding: 56px 24px 36px;
  text-align: center;
}

.footer__links {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
  font-size: 0.78rem;
  color: var(--color-text-muted);
  letter-spacing: 0.02em;
}

.footer__link {
  padding-bottom: 2px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  transition: color 0.25s, border-color 0.25s;
}

.footer__link:hover {
  color: var(--color-text);
  border-color: rgba(0, 0, 0, 0.35);
}

.footer__copy {
  margin-top: 18px;
  font-size: 0.72rem;
  color: var(--color-text-muted);
  opacity: 0.55;
  letter-spacing: 0.03em;
}

/* ══════════════════════════════════════════════════════════════
   Keyframes
   ══════════════════════════════════════════════════════════════ */
@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fade-slide-up {
  from {
    opacity: 0;
    transform: translateY(36px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes phone-entrance {
  from {
    opacity: 0;
    transform: translateY(80px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes glow-breathe {
  0%, 100% {
    opacity: 0.14;
    transform: scale(1) translateY(0);
    filter: blur(70px);
  }
  50% {
    opacity: 0.28;
    transform: scale(1.12) translateY(-8px);
    filter: blur(85px);
  }
}

@keyframes screen-crossfade {
  0%, 20% { opacity: 1; }
  25%, 95% { opacity: 0; }
  100% { opacity: 1; }
}

@keyframes blob-drift-1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(40px, -25px) scale(1.06); }
  66% { transform: translate(-25px, 18px) scale(0.96); }
}

@keyframes blob-drift-2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-45px, 28px) scale(1.08); }
}

@keyframes blob-drift-3 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(28px, 22px) scale(1.04); }
  66% { transform: translate(-35px, -12px) scale(0.97); }
}

/* ══════════════════════════════════════════════════════════════
   Responsive
   ══════════════════════════════════════════════════════════════ */

/* Tablet+ */
@media (min-width: 768px) {
  .hero__phone {
    width: clamp(280px, 30vw, 380px);
    padding-top: 3em;
  }
}

/* Desktop */
@media (min-width: 1024px) {
  .hero {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 6vw;
    padding: 0 6vw;
  }

  .hero__text {
    text-align: left;
    padding: 0;
    flex: 0 0 auto;
    max-width: 560px;
  }

  .hero__wordmark {
    margin-bottom: 0.6em;
  }

  .hero__phone {
    margin-top: 0;
    padding-top: 0;
    width: clamp(260px, 22vw, 380px);
    flex-shrink: 0;
  }
}

/* Large desktop */
@media (min-width: 1400px) {
  .hero {
    gap: 8vw;
    padding: 0 8vw;
  }

  .hero__phone {
    width: clamp(320px, 20vw, 400px);
  }
}

/* Short viewports (landscape phones) */
@media (max-height: 680px) and (max-width: 1023px) {
  .hero__text {
    padding-top: 90px;
  }

  .hero__title {
    font-size: clamp(2.2rem, 7vw, 3.5rem);
  }

  .hero__phone {
    width: clamp(180px, 35vw, 240px);
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
