/* z7 link shortener landing redesign */

@font-face {
  font-family: "IRANYekanX";
  src: url("../font/iranyekan/IRANYekanX-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "IRANYekanX";
  src: url("../font/iranyekan/IRANYekanX-Bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "IRANYekanX";
  src: url("../font/iranyekan/IRANYekanX-ExtraBold.woff2") format("woff2");
  font-weight: 800;
  font-display: swap;
}

@font-face {
  font-family: "IRANYekanX";
  src: url("../font/iranyekan/IRANYekanX-Black.woff2") format("woff2");
  font-weight: 900;
  font-display: swap;
}

:root {
  --ls-bg: #2a35f5;
  --ls-tape: #f3f4ff;
  --ls-ink: #0a0f3d;
  --ls-ink-2: #4a5086;
  --ls-hot: #ff4d6d;
  --ls-on-bg: #f3f4ff;
  --ls-chip: #0a0f3d;
  --ls-chip-t: #ffb3c0;
  --ls-font: "IRANYekanX", system-ui, sans-serif;
  --ls-mono: ui-monospace, "Cascadia Code", "Segoe UI Mono", Menlo, monospace;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ls-bg: #10155f;
    --ls-hot: #ff6b86;
  }
}

:root[data-theme="dark"] {
  --ls-bg: #10155f;
  --ls-hot: #ff6b86;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  height: 100%;
  scroll-padding-top: env(safe-area-inset-top, 0px);
}

body.ls-rd {
  margin: 0;
  min-height: 100%;
  background: var(--ls-bg);
  color: var(--ls-on-bg);
  font-family: var(--ls-font);
  line-height: 1.8;
  overflow-x: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

.ls-rd-mono {
  font-family: var(--ls-mono);
  direction: ltr;
  unicode-bidi: isolate;
}

/* background junk URLs */
.ls-rd-junk {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
  direction: ltr;
}

.ls-rd-junk div {
  position: absolute;
  left: -4rem;
  white-space: nowrap;
  font-size: clamp(2rem, 6vw, 4.5rem);
  font-weight: 700;
  color: var(--ls-on-bg);
  opacity: 0.07;
  transform: rotate(-6deg);
  transform-origin: left;
}

.ls-rd-junk .ls-rd-junk-1 {
  top: 8%;
}

.ls-rd-junk .ls-rd-junk-2 {
  top: 30%;
  left: -22rem;
}

.ls-rd-junk .ls-rd-junk-3 {
  top: 62%;
}

.ls-rd-junk .ls-rd-junk-4 {
  top: 88%;
  left: -14rem;
}

.ls-rd-wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 52rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.ls-rd-header {
  padding-top: 1.5rem;
  position: relative;
  z-index: 1;
}

.ls-rd-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--ls-font);
  font-size: 1.7rem;
  font-weight: 900;
  line-height: 1;
  color: var(--ls-on-bg);
  text-decoration: none;
}

.ls-rd-logo b {
  background: var(--ls-on-bg);
  color: var(--ls-bg);
  border-radius: 0.7rem;
  width: 2.5rem;
  height: 2.5rem;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 1.15rem;
  direction: ltr;
}

.ls-rd-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2.5rem 0 3.5rem;
  position: relative;
  z-index: 1;
}

.ls-rd-main h1 {
  font-family: var(--ls-font);
  font-weight: 900;
  font-size: clamp(2.8rem, 10vw, 6rem);
  line-height: 1.3;
  margin: 0 0 0.6rem;
}

.ls-rd-lead {
  margin: 0 0 2.8rem;
  font-size: 1.1rem;
  max-width: 32rem;
  opacity: 0.88;
}

/* the tape */
.ls-rd-ribbon {
  position: relative;
  background: var(--ls-tape);
  color: var(--ls-ink);
  padding: 1.35rem 0.75rem;
  transform: rotate(-1.4deg);
  display: flex;
  gap: 0.6rem;
  box-shadow: 0 14px 0 -6px rgba(10, 15, 61, 0.28);
}

.ls-rd-ribbon::before,
.ls-rd-ribbon::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 8px;
  background: radial-gradient(circle at 50% 0, var(--ls-bg) 4px, transparent 4.6px) 0 0 / 16px 8px
    repeat-x;
}

.ls-rd-ribbon::before {
  top: 0;
}

.ls-rd-ribbon::after {
  bottom: 0;
  background: radial-gradient(circle at 50% 100%, var(--ls-bg) 4px, transparent 4.6px) 0 0 / 16px 8px
    repeat-x;
}

.ls-rd-ribbon input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--ls-ink);
  font: 500 1.1rem var(--ls-mono);
  padding: 0.9rem 0.6rem;
  direction: ltr;
  text-align: left;
  outline: none;
}

.ls-rd-ribbon input::placeholder {
  font-family: var(--ls-font);
  direction: rtl;
  text-align: right;
  color: var(--ls-ink-2);
  opacity: 0.8;
}

.ls-rd-go {
  border: 0;
  background: var(--ls-ink);
  color: var(--ls-tape);
  font: 800 1.05rem var(--ls-font);
  padding: 0 1.6rem;
  border-radius: 0.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  transition: background 0.15s, transform 0.12s;
  white-space: nowrap;
}

.ls-rd-go:hover:not(:disabled) {
  background: var(--ls-hot);
  color: var(--ls-ink);
}

.ls-rd-go:active:not(:disabled) {
  transform: scale(0.96);
}

.ls-rd-go:disabled {
  opacity: 0.7;
  cursor: wait;
}

.ls-rd-go svg {
  width: 1.4rem;
  height: 1.4rem;
  flex-shrink: 0;
}

.ls-rd :focus-visible {
  outline: 3px solid var(--ls-hot);
  outline-offset: 3px;
}

.ls-rd-ribbon:focus-within {
  box-shadow: 0 14px 0 -6px rgba(10, 15, 61, 0.28), 0 0 0 3px var(--ls-hot);
}

.ls-rd-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.ls-rd-err:empty {
  display: none;
}

.ls-rd-err {
  display: inline-block;
  margin: 1.4rem 0 0;
  background: var(--ls-chip);
  color: var(--ls-chip-t);
  padding: 0.4rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.95rem;
}

/* the cut */
.ls-rd-cutzone {
  position: relative;
  margin-top: 2.2rem;
  display: none;
}

.ls-rd-cutzone.on {
  display: block;
}

.ls-rd-tapewrap {
  position: relative;
  height: 4.2rem;
  transition: height 0.4s ease, margin 0.4s ease;
}

.ls-rd-tapewrap.gone {
  height: 0;
  margin: 0;
  overflow: hidden;
}

.ls-rd-half {
  position: absolute;
  inset: 0;
  background: var(--ls-tape);
  color: var(--ls-ink);
  display: flex;
  align-items: center;
  padding: 0 1.2rem;
  font-size: 1rem;
  white-space: nowrap;
  overflow: hidden;
  direction: ltr;
  transition: transform 0.85s cubic-bezier(0.5, 0, 1, 0.6), opacity 0.85s ease-in;
}

.ls-rd-half span {
  display: block;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ls-rd-half.a {
  clip-path: polygon(0 0, 52% 0, 48% 25%, 52% 50%, 48% 75%, 52% 100%, 0 100%);
}

.ls-rd-half.b {
  clip-path: polygon(52% 0, 100% 0, 100% 100%, 52% 100%, 48% 75%, 52% 50%, 48% 25%);
}

.ls-rd-cutzone.fall .ls-rd-half.a {
  transform: translate(-2rem, 9rem) rotate(-9deg);
  opacity: 0;
}

.ls-rd-cutzone.fall .ls-rd-half.b {
  transform: translate(2rem, 9rem) rotate(8deg);
  opacity: 0;
}

.ls-rd-dash {
  position: absolute;
  left: 50%;
  top: -0.7rem;
  bottom: -0.7rem;
  border-left: 3px dashed var(--ls-hot);
  opacity: 0;
  transition: opacity 0.2s;
}

.ls-rd-cutzone.snip .ls-rd-dash {
  opacity: 1;
}

.ls-rd-scissors {
  position: absolute;
  top: 50%;
  left: 104%;
  width: 3.4rem;
  height: 3.4rem;
  margin: -1.7rem 0 0 -1.7rem;
  color: var(--ls-hot);
  transition: left 0.85s cubic-bezier(0.6, 0, 0.3, 1), opacity 0.3s;
  z-index: 2;
  filter: drop-shadow(0 3px 0 rgba(10, 15, 61, 0.35));
}

.ls-rd-cutzone.snip .ls-rd-scissors {
  left: 50%;
}

.ls-rd-cutzone.fall .ls-rd-scissors {
  opacity: 0;
}

.ls-rd-scissors .bl {
  transform-origin: 32px 32px;
}

.ls-rd-cutzone.snip .bl.u {
  animation: ls-rd-su 0.22s 3 0.85s alternate;
}

.ls-rd-cutzone.snip .bl.d {
  animation: ls-rd-sd 0.22s 3 0.85s alternate;
}

@keyframes ls-rd-su {
  to {
    transform: rotate(-14deg);
  }
}

@keyframes ls-rd-sd {
  to {
    transform: rotate(14deg);
  }
}

/* the result */
.ls-rd-final {
  display: none;
  background: var(--ls-tape);
  color: var(--ls-ink);
  padding: 1.6rem 1.4rem 1.4rem;
  border-radius: 0.4rem;
  transform-origin: center;
}

.ls-rd-cutzone.show .ls-rd-final {
  display: block;
  animation: ls-rd-pop 0.5s cubic-bezier(0.3, 1.6, 0.5, 1);
}

@keyframes ls-rd-pop {
  from {
    transform: scale(0.7) rotate(2deg);
    opacity: 0;
  }
}

.ls-rd-short {
  display: block;
  font-size: clamp(1.7rem, 6.5vw, 3rem);
  font-weight: 700;
  line-height: 1.3;
  word-break: break-all;
  margin: 0 0 1rem;
  text-align: left;
}

.ls-rd-short i {
  font-style: normal;
  color: var(--ls-ink-2);
}

.ls-rd-short em {
  font-style: normal;
  color: var(--ls-hot);
  background: var(--ls-ink);
  padding: 0 0.35em;
  border-radius: 0.2em;
}

.ls-rd-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.ls-rd-saved {
  font-weight: 800;
  font-size: 1.05rem;
}

.ls-rd-copy {
  border: 0;
  background: var(--ls-ink);
  color: var(--ls-tape);
  font: 800 1rem var(--ls-font);
  padding: 0.6rem 1.5rem;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background 0.15s;
}

.ls-rd-copy:hover,
.ls-rd-copy.done {
  background: var(--ls-hot);
  color: var(--ls-ink);
}

.ls-rd-note {
  margin: 2.6rem 0 0;
  font-size: 0.92rem;
  opacity: 0.8;
}

.ls-rd-footer {
  position: relative;
  z-index: 1;
  padding: 1.1rem 0 1.4rem;
  font-size: 0.85rem;
  opacity: 0.8;
}

.ls-rd-footer .ls-rd-wrap {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.ls-rd-disabled {
  margin: 0;
  background: var(--ls-chip);
  color: var(--ls-chip-t);
  padding: 0.8rem 1.2rem;
  border-radius: 0.5rem;
  font-size: 1rem;
}

@media (max-width: 560px) {
  .ls-rd-ribbon {
    flex-direction: column;
  }

  .ls-rd-go {
    padding: 0.95rem 1rem;
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ls-rd *,
  .ls-rd *::before,
  .ls-rd *::after {
    transition: none !important;
    animation: none !important;
  }
}
