@font-face {
  font-family: Vazirmatn;
  src: url("assets/vazirmatn-arabic.woff2") format("woff2");
  font-weight: 400 900;
  font-display: swap;
  unicode-range: U+0600-06FF,U+0750-077F,U+0870-089F,U+08A0-08FF,U+200C-200E,U+2010-2011,U+204F,U+FB50-FDFF,U+FE70-FEFC;
}

@font-face {
  font-family: Vazirmatn;
  src: url("assets/vazirmatn-latin.woff2") format("woff2");
  font-weight: 400 900;
  font-display: swap;
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

:root {
  color-scheme: dark;
  --background: #100b1c;
  --text: #fcf8ff;
  --muted: #c2b4d3;
  --lavender: #d5b3ff;
  --shell: min(1160px, calc(100% - 88px));
  font-family: Vazirmatn, Tahoma, sans-serif;
  color: var(--text);
  background: var(--background);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 280px;
  background:
    radial-gradient(ellipse 63rem 39rem at 15% 16rem, #211134 0%, transparent 75%),
    var(--background);
}
main { overflow-x: clip; }

h1, h2, h3, p { margin: 0; }
a { color: inherit; text-decoration: none; }
::selection { background: #ba90f8; color: #170d24; }
:focus-visible { outline: 2px solid #e5c5ff; outline-offset: 5px; }

.shell { width: var(--shell); margin-inline: auto; }
.icon-library { position: absolute; width: 0; height: 0; overflow: hidden; pointer-events: none; }
.icon {
  width: 1.22em;
  height: 1.22em;
  flex: none;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.skip-link {
  position: fixed;
  z-index: 4;
  inset: 12px 12px auto auto;
  padding: 10px 18px;
  border-radius: 8px;
  background: var(--lavender);
  color: #211031;
  transform: translateY(-150%);
}
.skip-link:focus { transform: none; }

.hero {
  display: grid;
  grid-template-columns: .93fr 1.07fr;
  align-items: center;
  min-height: 514px;
  gap: clamp(10px, 3.7vw, 55px);
  padding-block: 44px 32px;
}
.hero-content {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: start;
  min-width: 0;
}
.wordmark {
  --wordmark-rise: 15px;
  /* Follow the gap between K and o in the transparent wordmark. */
  --k-seam: 27.8% 0, 19% 40%, 20% 61%, 24.15% 82%, 28.2% 94%, 28.2% 100%;
  position: relative;
  isolation: isolate;
  width: min(100%, 30rem);
  color: #ece1f4;
  font: 600 clamp(2.55rem, 7vw, 6rem) / 1 Georgia, serif;
}
.wordmark::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -52% -9% -60%;
  background: radial-gradient(ellipse closest-side, #a174c827, #7546a519 50%, transparent 93%);
  pointer-events: none;
}
.wordmark-image,
.wordmark-k {
  display: block;
  width: 100%;
  height: auto;
  color: inherit;
  font: inherit;
  filter: brightness(1.27) drop-shadow(0 9px 17px #0a06169e);
  user-select: none;
}
.wordmark-image { animation: wordmark-arrive 970ms cubic-bezier(.19, .73, .25, 1) both; }
.wordmark-k {
  position: absolute;
  z-index: 2;
  inset: 0;
  clip-path: polygon(0 0, var(--k-seam), 0 100%);
  pointer-events: none;
}
.wordmark-k[hidden] { display: none; }
.with-k-intro .wordmark-image { animation: none; }
.k-intro-playing .wordmark-image { clip-path: polygon(var(--k-seam), 100% 100%, 100% 0); }
.k-intro-playing .wordmark::after { animation: none; }
@keyframes wordmark-arrive {
  from { opacity: .64; transform: translateY(calc(-1 * var(--wordmark-rise))); }
  to { opacity: 1; transform: none; }
}

@supports ((mask-image: url("")) or (-webkit-mask-image: url(""))) {
  .wordmark::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(112deg, transparent 38%, #fff3ffd2 49%, transparent 60%) 168% 50% / 245% 100% no-repeat;
    -webkit-mask: url("assets/kovira-wordmark.webp") center / 100% 100% no-repeat;
    mask: url("assets/kovira-wordmark.webp") center / 100% 100% no-repeat;
    opacity: 0;
    pointer-events: none;
    animation: wordmark-light 1050ms 455ms cubic-bezier(.27, .56, .34, 1) both;
  }
}
@keyframes wordmark-light {
  0% { opacity: 0; background-position: 168% 50%; }
  28% { opacity: .57; }
  72% { opacity: .32; }
  100% { opacity: 0; background-position: -82% 50%; }
}

.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: .65em;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 11px 16px;
  min-height: 45px;
  width: fit-content;
  max-width: 100%;
  font-weight: 770;
  line-height: 1.45;
  transition: background .2s, border-color .2s, box-shadow .2s, filter .2s, transform .2s;
}
.button .icon:last-child { transition: transform .2s; }
.button:hover .icon:last-child { transform: translateX(-3px); }
.hero-art {
  position: relative;
  isolation: isolate;
  aspect-ratio: 1.41;
  min-width: 0;
  width: 100%;
  margin-inline: auto;
}

.hero-art::before,
.hero-art::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.hero-art::before {
  inset: -8% -13% -5%;
  background: radial-gradient(ellipse closest-side, #7157ad43 4%, #57398523 48%, #38205911 72%, transparent);
}

.hero-art::after {
  inset: auto 0 7.5%;
  height: 16%;
  background:
    radial-gradient(ellipse 25% 34% at 81% 53%, #090610ba, transparent 94%),
    radial-gradient(ellipse 52% 44% at 44% 44%, #090610b0, #150c2375 45%, transparent 95%);
}

.mascot {
  position: absolute;
  z-index: 1;
  bottom: 14%;
  left: 0;
  width: 100%;
}

.mascot-image {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
}

.mascot-canvas {
  position: absolute;
  inset: -5%;
  width: 110%;
  height: 110%;
  pointer-events: none;
}

.mascot-rendered .mascot-image { opacity: 0; }

.bandana-name {
  position: absolute;
  top: 71.6%;
  left: 76.7%;
  transform: translate(-50%, -50%) rotate(-4deg);
  font-size: clamp(.86rem, 1.55vw, 1.32rem);
  font-weight: 900;
  line-height: 1;
  color: #f2e5f3;
  text-shadow: 0 1px 1px #2b172f;
  pointer-events: none;
  user-select: none;
}

.mascot-reaction,
.mascot-impact {
  position: absolute;
  z-index: 2;
  pointer-events: none;
}
.mascot-reaction {
  left: 86%;
  top: 23%;
  padding: 6px 12px 4px;
  border: 1px solid #b687f4;
  border-radius: 12px;
  background: #2a173f;
  color: #fff0ff;
  box-shadow: 0 3px 20px #9d6af45c;
  font-size: clamp(1.1rem, 2vw, 1.45rem);
  font-weight: 900;
  line-height: 1.18;
  white-space: nowrap;
  animation: mascot-ouch 1020ms ease-out both;
}
.mascot-reaction::after {
  content: "";
  position: absolute;
  left: 12px;
  bottom: -5px;
  width: 8px;
  height: 8px;
  border-right: 1px solid #b687f4;
  border-bottom: 1px solid #b687f4;
  background: inherit;
  transform: rotate(45deg);
}
.mascot-impact {
  left: var(--impact-x);
  top: var(--impact-y);
  width: clamp(23px, 5vw, 54px);
  aspect-ratio: 1;
  border: 1px solid #edd9ff;
  border-radius: 50%;
  box-shadow: 0 0 11px #c989ff, inset 0 0 8px #b781ffd0;
  animation: mascot-impact 440ms ease-out both;
}
@keyframes mascot-ouch {
  from { opacity: 0; transform: translate(-14%, -72%) scale(.84); }
  14%, 71% { opacity: 1; transform: translate(-14%, -100%) scale(1); }
  to { opacity: 0; transform: translate(-14%, -110%) scale(1); }
}
@keyframes mascot-impact {
  from { opacity: .91; transform: translate(-50%, -50%) scale(.34); }
  to { opacity: 0; transform: translate(-50%, -50%) scale(1.2); }
}

.services {
  margin-bottom: clamp(38px, 5.4vw, 70px);
  scroll-margin-top: 24px;
}
.section-heading {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-bottom: 17px;
}
.section-heading h2 { font-size: clamp(1.66rem, 3.1vw, 2.25rem); letter-spacing: -.05em; font-weight: 880; }
.section-heading > span { flex: 1; height: 1px; background: linear-gradient(270deg, #60437a, #39254975); }
.service-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.service-card {
  display: flex;
  position: relative;
  isolation: isolate;
  min-width: 0;
  min-height: 262px;
  padding: clamp(18px, 2.6vw, 30px);
  overflow: hidden;
  border: 1px solid var(--card-border);
  border-radius: 22px;
  background:
    radial-gradient(ellipse at 12% 61%, var(--card-glow), transparent 62%),
    linear-gradient(128deg, var(--card-base), #191124);
  transition: border-color .25s;
}
.service-card:hover, .service-card:focus-within { border-color: var(--card-hover); }
.vpn {
  --card-base: #25153a;
  --card-border: #51376e;
  --card-hover: #8960b8;
  --card-glow: #6839a86b;
  --card-accent: #d3b1ff;
  --card-icon: #b386f42b;
  --card-ring: #a56be43b;
  --button-bg: #b88af726;
  --button-border: #b78aee57;
  --button-hover: #b88af746;
}
.stars {
  --card-base: #2d1d34;
  --card-border: #59404e;
  --card-hover: #956849;
  --card-glow: #8d512951;
  --card-accent: #fbd68d;
  --card-icon: #e1a3422b;
  --card-ring: #cc90413a;
  --button-bg: #dda65524;
  --button-border: #d69d5960;
  --button-hover: #dda65546;
}
.card-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: 64%;
}
.service-icon {
  display: grid;
  place-items: center;
  width: 39px;
  height: 39px;
  border: 1px solid var(--button-border);
  border-radius: 12px;
  color: var(--card-accent);
  background: var(--card-icon);
  font-size: 1.03rem;
}
.card-content h3 {
  margin-block: 11px 4px;
  font-size: clamp(1.32rem, 2.25vw, 1.76rem);
  letter-spacing: -.045em;
  font-weight: 870;
  line-height: 1.4;
}
.card-content p {
  max-width: 16rem;
  padding-bottom: 16px;
  color: #d7c9e1;
  font-size: .91rem;
  line-height: 1.8;
}
.service-link {
  margin-top: auto;
  padding-inline: 10px;
  gap: 8px;
  font-size: .81rem;
  color: var(--card-accent);
  background: var(--button-bg);
  border-color: var(--button-border);
}
.service-link:hover { background: var(--button-hover); border-color: var(--card-hover); }
.service-link .arrow { width: 1em; height: 1em; }
.card-art {
  position: absolute;
  left: 0;
  width: 44%;
  top: 50%;
  aspect-ratio: 1;
  transform: translate(-4%, -50%);
  pointer-events: none;
}
.card-art::before, .card-art::after {
  content: "";
  position: absolute;
  inset: 14%;
  border-radius: 50%;
  border: 1px solid var(--card-ring);
}
.card-art::after { inset: 4%; border-style: dashed; opacity: .65; }
.card-art img {
  position: relative;
  z-index: 1;
  height: 100%;
  width: 100%;
  object-fit: contain;
  filter: drop-shadow(0 12px 18px #0b0610a3);
  transition: transform .35s;
}
.service-card:hover .card-art img { transform: translateY(-4px) rotate(-3deg); }

.site-footer { border-top: 1px solid #30223e; background: #100b1a; }
.copyright {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px 12px;
  padding-block: 21px;
  color: var(--muted);
  font-size: .82rem;
  text-align: center;
}

@media (max-width: 960px) {
  :root { --shell: calc(100% - 60px); }
  .hero { min-height: 445px; }
  .service-card { min-height: 236px; }
  .card-content { width: 67%; }
  .card-art { width: 41%; }
}

@media (max-width: 680px) {
  :root { --shell: calc(100% - 36px); }
  .hero { grid-template-columns: 1fr; min-height: 0; gap: 20px; padding-block: 48px 16px; }
  .hero-content { justify-items: center; }
  .wordmark { width: min(95%, 25.5rem); }
  .hero-art { width: min(100%, 456px); aspect-ratio: 1.56; }
  .hero-art::after { bottom: 3.5%; }
  .mascot { bottom: 10%; }
  .section-heading { margin-bottom: 12px; gap: 10px; }
  .service-grid { grid-template-columns: 1fr; gap: 13px; }
  .service-card { min-height: 209px; }
  .card-art { width: min(41%, 220px); transform: translate(-4%, -48%); }
}

@media (max-width: 350px) {
  :root { --shell: calc(100% - 28px); }
  .service-card { padding: 14px; }
  .card-content { width: 75%; }
  .card-art { width: 33%; transform: translate(-4%, -65%); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; }
  .wordmark { --wordmark-rise: 4px; }
  .wordmark-image { animation-duration: 580ms; }
  .wordmark::after { animation: none; }
  .mascot-impact { display: none; }
  .mascot-reaction { animation-name: mascot-ouch-fade; transform: translate(-14%, -100%); }
}

@keyframes mascot-ouch-fade {
  0%, 100% { opacity: 0; }
  12%, 74% { opacity: 1; }
}
