:root {
  --paper: #f7f7f5;
  --ink: #1c1c1c;
  --quiet: #6a6a66;
  --line: #c8c8c2;
  --font: Vazirmatn, "Noto Naskh Arabic", Tahoma, sans-serif;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body { height: 100%; }

html { background: var(--paper); }

body {
  margin: 0;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: transparent;
  color: var(--ink);
  font: 400 15px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}

.tone {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: var(--paper);
}

.tone-next { opacity: 0; }

a { color: inherit; }

.header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 28px 0;
}

.header-line,
.header-tick {
  height: 1px;
  background: color-mix(in srgb, var(--ink) 22%, transparent);
}

.header-line { flex: 1; min-width: 24px; }
.header-tick { width: 22px; flex: none; }

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand {
  text-decoration: none;
  font-weight: 500;
  font-size: 17px;
  letter-spacing: 0;
}

[dir="ltr"] .brand {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.nav {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid color-mix(in srgb, var(--ink) 12%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, white 62%, transparent);
}

.nav a {
  text-decoration: none;
  font-size: 13px;
  color: var(--quiet);
  padding: 5px 13px;
  border-radius: 999px;
}

.nav a:hover {
  color: var(--ink);
  background: color-mix(in srgb, var(--ink) 6%, transparent);
}

.lang {
  border: 1px solid color-mix(in srgb, var(--ink) 12%, transparent);
  padding: 6px 13px;
  border-radius: 999px;
  background: color-mix(in srgb, white 62%, transparent);
  color: var(--quiet);
  font: inherit;
  font-size: 13px;
  letter-spacing: 0.08em;
  cursor: pointer;
}

.lang:hover {
  color: var(--ink);
  background: color-mix(in srgb, white 82%, transparent);
}

.hero {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
}

.hero-inner {
  display: grid;
  grid-template-areas: "intro" "stage" "summary";
  grid-template-rows: auto auto auto;
  align-items: center;
  width: min(1360px, calc(100% - 48px));
  margin: 0 auto;
  padding: 18px 0 28px;
}

.intro { grid-area: intro; text-align: center; }

.intro h1 {
  margin: 0;
  font-weight: 500;
  font-size: clamp(28px, 7vw, 40px);
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.summary {
  grid-area: summary;
  display: grid;
  justify-items: center;
  gap: 10px;
  text-align: center;
}

.stage {
  grid-area: stage;
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  touch-action: pan-y;
  user-select: none;
  outline: none;
}

.piece {
  width: min(100%, 860px);
  display: flex;
  align-items: center;
  justify-content: center;
  will-change: transform;
}

.float {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  transform-origin: 50% 70%;
}

.motion .float { animation: showcaseFloat 7s ease-in-out infinite alternate; }

@keyframes showcaseFloat {
  from { transform: translateY(0) perspective(900px) rotateY(-3deg); }
  to { transform: translateY(-5px) perspective(900px) rotateY(3deg); }
}

.float img {
  position: relative;
  z-index: 1;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: min(52svh, 460px);
  object-fit: contain;
  object-position: center;
  pointer-events: none;
}

.float::after {
  content: "";
  position: absolute;
  z-index: 0;
  left: 16%;
  right: 16%;
  bottom: 2%;
  height: 16px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(28, 28, 28, .14), transparent 72%);
  pointer-events: none;
}

.stage.is-empty .piece { visibility: hidden; }

.arrow {
  position: absolute;
  z-index: 2;
  top: calc(50% - 44px);
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--ink);
  opacity: .38;
  cursor: pointer;
  transition: opacity .25s ease;
}

.stage:hover .arrow,
.stage:focus-within .arrow { opacity: .45; }

.arrow:hover,
.arrow:focus-visible { opacity: 1; }

.arrow svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.arrow.prev { inset-inline-start: 18px; }
.arrow.next { inset-inline-end: 18px; }
[dir="rtl"] .arrow.prev svg { transform: scaleX(-1); }
[dir="ltr"] .arrow.next svg { transform: scaleX(-1); }

.dots {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: center;
  gap: 2px;
  margin-top: 4px;
}

.dot {
  position: relative;
  width: 28px;
  height: 28px;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

.dot::before {
  content: "";
  position: absolute;
  inset: 0;
  width: 5px;
  height: 5px;
  margin: auto;
  border-radius: 50%;
  background: var(--line);
}

.dot[aria-current="true"]::before { background: var(--ink); }

.caption {
  margin: 0;
  font-size: clamp(20px, 2.2vw, 28px);
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.35;
}

.contact {
  display: grid;
  justify-items: center;
  gap: 2px;
  margin: 0;
  color: var(--quiet);
  font-size: 13px;
  line-height: 1.55;
  text-align: center;
}

.contact a { text-decoration: none; }
.contact a:hover { color: var(--ink); }

:focus-visible {
  outline: 1px solid var(--ink);
  outline-offset: 4px;
}

.stage:focus-visible { outline: none; }

@media (max-width: 720px) {
  .header {
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 14px 16px 0;
  }
  .header-line { flex: none; width: min(168px, 42vw); }
  .header-tick { display: none; }
  .hero-inner {
    justify-items: center;
    width: calc(100% - 32px);
    padding-block: 4px 12px;
    row-gap: 12px;
    text-align: center;
  }
  .intro, .summary { justify-self: center; text-align: center; }
  .contact { justify-items: center; text-align: center; }
  .stage { justify-self: stretch; width: 100%; }
  .piece { width: 100%; }
  .float { width: 100%; }
  .float img {
    max-width: 100%;
    max-height: min(54svh, 120vw);
  }
  .arrow { top: calc(50% - 36px); }
  .arrow.prev { inset-inline-start: 0; }
  .arrow.next { inset-inline-end: 0; }
}

@media (min-width: 900px) {
  .hero-inner {
    grid-template-areas: "intro stage summary";
    grid-template-columns: minmax(200px, 250px) minmax(520px, 1fr) minmax(190px, 240px);
    grid-template-rows: auto;
    gap: 8px 32px;
    width: min(1540px, calc(100% - 40px));
    padding-block: 8px 28px;
  }
  .intro, .summary { text-align: start; min-width: 0; }
  .intro h1 { font-size: clamp(32px, 2.6vw, 46px); line-height: 1.2; }
  .summary { justify-items: start; align-content: center; gap: 16px; }
  .contact { justify-items: start; text-align: start; }
  .piece { width: 100%; }
  .float img { max-height: min(64svh, 540px); }
}

@media (hover: none) {
  .stage:hover .arrow { opacity: 0; }
  .stage:focus-within .arrow,
  .arrow:focus-visible { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .motion .float { animation: none; }
}
