/*
 * Coming-soon page for a sewing course, built from 21st.dev components and
 * adapted for Persian RTL and phones:
 * - "Silk-Background-animation" (waleedkibhen): silk backdrop, see silk.js
 * - "Text Shimmer" (wensity): gold sweep on the title
 * - "Animated Signature" (dqnamo): self-drawing stitch line, see stitch.js
 * - "Hover Border Gradient" (Shatlyk1011): light orbiting the CTA border
 */

/* IRANYekanX (FaNum: Persian digits), proprietary, see fonts/FontLicense.txt. */
@font-face {
  font-family: "IRANYekanX";
  src: url("fonts/IRANYekanXFaNum-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "IRANYekanX";
  src: url("fonts/IRANYekanXFaNum-Medium.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: "IRANYekanX";
  src: url("fonts/IRANYekanXFaNum-DemiBold.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}

@property --orbit {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

:root {
  --background: #0b0a09;
  --foreground: #f6f1e8;
  --muted: #b9b0a3;
  --faint: #7d756b;
  --gold: #d6b06f;
  --gold-light: #fff1cf;
  --needle: #e4e0d8;
  color-scheme: dark;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* The gradient shows if WebGL is unavailable. */
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: radial-gradient(120% 80% at 50% 40%, #2a2622, var(--background));
  color: var(--foreground);
  font-family: "IRANYekanX", Tahoma, system-ui, sans-serif;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}

.silk,
.veil {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.silk {
  opacity: 0;
  transition: opacity 1.2s ease;
}

.silk.ready {
  opacity: 1;
}

.veil {
  background:
    radial-gradient(70% 55% at 50% 48%, rgba(11, 10, 9, 0.55), transparent 75%),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.3), transparent 40%, rgba(0, 0, 0, 0.55));
}

.corner {
  position: absolute;
  top: max(1.25rem, env(safe-area-inset-top));
  inset-inline-start: max(1.25rem, env(safe-area-inset-right));
  z-index: 2;
  margin: 0;
  font-size: 0.875rem;
  color: var(--muted);
  animation: fade-down 1s ease-out 0.9s both;
}

.hero {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  width: 100%;
  max-width: 44rem;
  margin-inline: auto;
  padding: 5rem max(1.25rem, env(safe-area-inset-left), env(safe-area-inset-right)) 4.5rem;
  text-align: center;
}

/* Persian script is joined: no letter-spacing or uppercase on its text. */
.eyebrow {
  margin: 0;
  padding: 0.3rem 1rem;
  border: 1px solid rgba(214, 176, 111, 0.35);
  border-radius: 999px;
  background: rgba(11, 10, 9, 0.35);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  font-size: 0.8125rem;
  color: var(--gold);
  animation: rise 0.8s ease-out 0.2s both;
}

.title {
  margin: 0;
  font-weight: 600;
  font-size: clamp(3.25rem, 17vw, 8rem);
  line-height: 1.25;
  white-space: nowrap;
  animation: blur-rise 1.2s cubic-bezier(0.2, 0.7, 0.2, 1) 0.35s both;
}

/* Text Shimmer: a light band sweeps right to left, the Persian reading direction. */
.shimmer {
  display: inline-block;
  padding: 0.1em 0.05em;
  background-image:
    linear-gradient(90deg, transparent calc(50% - 2.5rem), var(--gold-light), transparent calc(50% + 2.5rem)),
    linear-gradient(var(--gold), var(--gold));
  background-size: 250% 100%, auto;
  background-repeat: no-repeat;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--gold);
  text-shadow: 0 0 40px rgba(214, 176, 111, 0.12);
  animation: shimmer 5s linear 1.6s infinite both;
}

.stitch {
  display: block;
  width: min(18rem, 72vw);
  height: auto;
  margin-top: -0.75rem;
  overflow: visible;
}

.stitch-thread {
  fill: none;
  stroke: var(--gold);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-dasharray: 6 5;
}

.stitch-progress {
  fill: none;
  stroke: #fff;
  stroke-width: 10;
}

.needle {
  opacity: 0;
  fill: none;
  stroke: var(--needle);
  stroke-width: 1.3;
  stroke-linecap: round;
  transition: opacity 0.4s ease;
}

.tags {
  margin: 0;
  font-size: clamp(1.0625rem, 4.6vw, 1.375rem);
  color: var(--foreground);
  word-spacing: 0.15em;
  animation: rise 1s ease-out 1.1s both;
}

.tags span {
  margin-inline: 0.5em;
  color: var(--gold);
}

.description {
  max-width: 32rem;
  margin: 0;
  font-size: 1rem;
  color: var(--muted);
  text-wrap: pretty;
  animation: rise 1s ease-out 1.35s both;
}

/* Hover Border Gradient: a soft light circles the pill's border. */
.cta {
  position: relative;
  isolation: isolate;
  margin: 0.75rem 0 0;
  padding: 1px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(214, 176, 111, 0.22);
  animation: rise 1s ease-out 1.6s both;
}

.cta::before {
  content: "";
  position: absolute;
  inset: -100%;
  z-index: -1;
  background: conic-gradient(from var(--orbit), transparent 0 60%, var(--gold-light) 80%, transparent 95%);
  filter: blur(2px);
  animation: orbit 3.5s linear infinite;
}

.cta span {
  display: block;
  padding: 0.6rem 2.25rem;
  border-radius: inherit;
  background: rgba(11, 10, 9, 0.88);
  font-size: 1rem;
  font-weight: 500;
  color: var(--foreground);
}

footer {
  position: relative;
  z-index: 1;
  padding: 0 1rem max(1rem, env(safe-area-inset-bottom));
  text-align: center;
  font-size: 0.8125rem;
  color: var(--faint);
}

@media (min-width: 640px) {
  .description {
    font-size: 1.125rem;
  }
}

/* Keep everything on one screen on short phones. */
@media (max-height: 640px) {
  .hero {
    gap: 0.75rem;
    padding-block: 4rem 3rem;
  }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(1rem); }
  to { opacity: 1; transform: none; }
}

@keyframes blur-rise {
  from { opacity: 0; transform: translateY(2rem) scale(0.96); filter: blur(14px); }
  to { opacity: 1; transform: none; filter: blur(0); }
}

@keyframes fade-down {
  from { opacity: 0; transform: translateY(-1rem); }
  to { opacity: 1; transform: none; }
}

/* Sweep for 60% of the cycle, then rest. */
@keyframes shimmer {
  0% { background-position: -5% center, 0 0; }
  60%, 100% { background-position: 105% center, 0 0; }
}

@keyframes orbit {
  to { --orbit: 360deg; }
}

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

  .shimmer {
    background-image: none;
    -webkit-text-fill-color: var(--gold);
  }
}
