/* Design tokens — values taken 1:1 from skale.solutions */
:root {
  --color-canvas: #fff;
  --color-ink: #000;
  --color-accent: #ff280f;
  --color-heading: #262626;
  --color-muted: #757575;
  --color-telegram: #229ed9;
  --color-telegram-hover: #1c8bc0;
  --color-btn-light: #f2f2f2;
  --color-btn-dark: #050505;
  --color-guide: #00000009;
  --color-rule: #00000014;

  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-mono: "Roboto Mono", ui-monospace, "SF Mono", monospace;

  /* Half-width of the desktop frame (distance from center to each guide line) */
  --frame-half: min(16.6vw + 157px, 660px);
}

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

html,
body {
  height: 100%;
}

body {
  background-color: var(--color-canvas);
  color: var(--color-ink);
  font-family: var(--font-sans);
  /* The original uses Inter Display everywhere; opsz 32 is Inter's display cut */
  font-variation-settings: "opsz" 32;
  font-size: 16px;
  line-height: 24px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

/* ---------- Page shell ---------- */

.home {
  position: relative;
  min-height: 100vh;
  width: 100%;
  overflow: hidden;
  padding-bottom: 20px;
}

/* ---------- Load-in animation ---------- */

@keyframes appear-up {
  0% {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.appear {
  animation: appear-up 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

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

/* ---------- Vertical frame guides (desktop) ---------- */

.frame-guide {
  z-index: 5;
  pointer-events: none;
  background: var(--color-guide);
  width: 1px;
  position: absolute;
  top: 0;
  bottom: 0;
}

.frame-guide::before,
.frame-guide::after {
  content: "";
  background: var(--color-accent);
  width: 1px;
  height: 14px;
  position: absolute;
  left: 0;
}

.frame-guide::before {
  top: 0;
}

.frame-guide::after {
  bottom: 0;
}

.frame-guide--left {
  left: calc(50% - var(--frame-half));
}

.frame-guide--right {
  left: calc(50% + var(--frame-half));
}

/* ---------- ASCII side art ---------- */

.hand-clip {
  display: contents;
}

.hand {
  z-index: 1;
  position: absolute;
  mix-blend-mode: multiply;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
}

.hand-left {
  width: min(808px, 31.56vw);
  height: min(890px, 34.77vw);
  top: calc(12.7vh + 12px);
  left: max(-198px, -10.8vw);
}

.hand-right {
  width: min(799px, 31.2vw);
  height: min(741px, 28.95vw);
  top: calc(14.7vh + 12px);
  right: max(-148px, -8vw);
}

/* ---------- Header ---------- */

.header {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 20;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 44px 32px 0;
}

/* Wordmark: stands in for the red logo image (26px tall in the original) */
.wordmark {
  position: absolute;
  left: 50%;
  top: 48px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 7px;
  height: 26px;
  color: var(--color-accent);
  font-size: 27px;
  line-height: 1;
  font-weight: 500;
  letter-spacing: -0.04em;
  white-space: nowrap;
  user-select: none;
}

.wordmark__mark {
  width: 25px;
  height: 25px;
  flex: none;
}

/* ---------- Hero ---------- */

/* Mobile: fills the screen minus a strip, so the F.A.Q heading peeks below */
.hero-frame {
  position: relative;
  z-index: 10;
  margin: 12px 12px 0;
  min-height: calc(100svh - 132px);
  padding: 96px 0 72px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.frame-tick,
.hero-frame::before,
.hero-frame::after {
  display: none;
}

.title {
  font-size: 32px;
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.04em;
  color: var(--color-heading);
  text-wrap: balance;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Rotating event word: always on its own line, so swapping words never reflows the title */
.rotator {
  position: relative;
  display: block;
  height: 1.3em;
  padding: 0.1em 0;
  margin: -0.1em 0;
  /* Clips the sliding words top and bottom only; 0.1em padding keeps descenders */
  clip-path: inset(0 -50vw);
}

.rotator__word {
  position: absolute;
  inset: 0.1em 0 auto;
  text-align: center;
  white-space: nowrap;
}

@keyframes rotator-in {
  from {
    transform: translateY(130%);
  }
  to {
    transform: translateY(0);
  }
}

@keyframes rotator-out {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(-130%);
  }
}

.rotator__word.is-in {
  animation: rotator-in 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.rotator__word.is-out {
  animation: rotator-out 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.accent {
  color: var(--color-accent);
}

.lede {
  margin-top: 16px;
  font-size: 16px;
  line-height: 22px;
  font-weight: 500;
  color: var(--color-muted);
}

.lede__strong {
  color: var(--color-heading);
}

.lede__br {
  display: none;
}

/* ---------- Buttons ---------- */

.actions {
  margin-top: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn {
  position: relative;
  display: inline-flex;
  height: 44px;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  overflow: clip;
  border-radius: 4px;
  padding: 12px 22px 13px;
  cursor: pointer;
  transition: background-color 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn__stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}

.btn__label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  line-height: 19.2px;
  font-weight: 500;
  white-space: pre;
}

.btn__icon {
  width: 16px;
  height: 16px;
  flex: none;
}

.btn--telegram {
  background-color: var(--color-telegram);
}

.btn--telegram .btn__label {
  color: #fff;
}

.btn--light {
  background-color: var(--color-btn-light);
}

.btn--light .btn__label:first-child {
  color: #000;
}

.btn--light .btn__label:last-child {
  color: #fff;
}

@media (hover: hover) {
  /* 19.2px label + 22px gap: slides the duplicate label into view */
  .btn:hover .btn__stack {
    transform: translateY(-41.2px);
  }

  .btn--telegram:hover {
    background-color: var(--color-telegram-hover);
  }

  .btn--light:hover {
    background-color: var(--color-btn-dark);
  }
}

.btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* ---------- F.A.Q ---------- */

.faq {
  position: relative;
  z-index: 10;
  max-width: 640px;
  margin: 0 auto;
  padding: 72px 12px 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.faq__title {
  font-size: 26px;
  line-height: 1.15;
  font-weight: 500;
  letter-spacing: -0.04em;
  color: var(--color-heading);
  text-align: center;
  text-wrap: balance;
}

.faq__list {
  margin-top: 32px;
  width: 100%;
  border-top: 1px solid var(--color-rule);
}

.faq__item {
  border-bottom: 1px solid var(--color-rule);
}

.faq__q {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 18px 2px;
  list-style: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.faq__q::-webkit-details-marker {
  display: none;
}

.faq__q:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.faq__num {
  flex: none;
  font-family: var(--font-mono);
  font-variation-settings: normal;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.04em;
  color: var(--color-muted);
  font-variant-numeric: tabular-nums;
}

.faq__text {
  flex: 1;
  font-size: 18px;
  line-height: 24px;
  font-weight: 500;
  letter-spacing: -0.03em;
  color: var(--color-heading);
}

/* Plus that turns into a cross */
.faq__icon {
  position: relative;
  flex: none;
  align-self: center;
  width: 12px;
  height: 12px;
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.faq__icon::before,
.faq__icon::after {
  content: "";
  position: absolute;
  left: 0;
  top: 5.25px;
  width: 12px;
  height: 1.5px;
  background: var(--color-heading);
}

.faq__icon::after {
  transform: rotate(90deg);
}

.faq__item[open] .faq__icon {
  transform: rotate(45deg);
}

.faq__item[open] .faq__icon::before,
.faq__item[open] .faq__icon::after {
  background: var(--color-accent);
}

.faq__a {
  padding: 0 28px 20px 31px;
  font-size: 16px;
  line-height: 22px;
  font-weight: 500;
  color: var(--color-muted);
}

.faq__item[open] .faq__a {
  animation: appear-up 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@media (hover: hover) {
  .faq__q:hover .faq__text {
    color: var(--color-ink);
  }
}

@media (prefers-reduced-motion: reduce) {
  .faq__icon {
    transition: none;
  }

  .faq__item[open] .faq__a {
    animation: none;
  }
}

/* ---------- Breakpoints (same as the original) ---------- */

@media (max-width: 640px) {
  .frame-guide {
    display: none;
  }
}

/* Mobile (< 820px): framed hero with horizontal rules, no ring art */
@media (max-width: 819.98px) {
  .home .frame-guide {
    display: none;
  }

  .hero-frame::before,
  .hero-frame::after {
    content: "";
    display: block;
    pointer-events: none;
    position: absolute;
    left: -12px;
    right: -12px;
    height: 1px;
    background: var(--color-guide);
  }

  .hero-frame::before {
    top: -1px;
  }

  .hero-frame::after {
    bottom: -1px;
  }

  .frame-tick {
    display: block;
    pointer-events: none;
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
  }

  .frame-tick--left {
    left: 0;
  }

  .frame-tick--right {
    right: 0;
  }

  .frame-tick::before,
  .frame-tick::after {
    content: "";
    position: absolute;
    left: 0;
    width: 2px;
    height: 13px;
    background: var(--color-accent);
  }

  .frame-tick::before {
    top: 0;
  }

  .frame-tick::after {
    bottom: 0;
  }

  .home .hand-clip {
    display: none;
  }

  /* Two buttons don't fit side by side on a phone: stack at equal width */
  .actions {
    flex-direction: column;
    align-items: stretch;
  }
}

/* Wide (>= 820px) */
@media (min-width: 820px) {
  .home {
    padding-bottom: 0;
  }

  .header {
    padding: 46px 52px 0;
  }

  .wordmark {
    top: 42px;
  }

  /* Leaves the F.A.Q heading peeking above the fold as a scroll cue */
  .hero-frame {
    margin: 0;
    min-height: calc(100vh - 150px);
    justify-content: center;
    padding: 2vh 24px 0;
  }

  .title {
    font-size: 42px;
  }

  .lede__br {
    display: inline;
  }

  .actions {
    margin-top: 22px;
  }

  .faq {
    padding: 40px 24px 160px;
  }

  .faq__title {
    font-size: 32px;
  }
}

/* Mid-width band: art hidden, guides pinned */
@media (min-width: 820px) and (max-width: 1199.98px) {
  .home .hand-clip {
    display: none;
  }

  .home .frame-guide--left {
    left: calc(50% - 482px);
  }

  .home .frame-guide--right {
    left: auto;
    right: calc(50% - 482px);
  }
}

/* ---------- Works page (ishlar.html) ---------- */

.back {
  position: absolute;
  left: 16px;
  top: 52px;
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  margin-top: -13px;
  font-family: var(--font-mono);
  font-variation-settings: normal;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.04em;
  color: var(--color-muted);
  transition: color 0.3s;
}

.back svg {
  width: 14px;
  height: 14px;
}

.works {
  position: relative;
  z-index: 10;
  margin: 0 auto;
  padding: 128px 12px 0;
}

.works__head {
  text-align: center;
}

/* One heading per event type (Toʻy, Tugʻilgan kun…), only when there are several */
.works__group {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 56px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.works__group::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--color-rule);
}

.works__group + .works__grid {
  margin-top: 20px;
}

.works__grid {
  list-style: none;
  margin-top: 40px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px 12px;
}

.work {
  display: flex;
  flex-direction: column;
  -webkit-tap-highlight-color: transparent;
}

.work__shot {
  position: relative;
  display: block;
  aspect-ratio: 390 / 700;
  border-radius: 14px;
  overflow: hidden;
  background: var(--color-btn-light);
  box-shadow: 0 0 0 1px var(--color-rule);
  transition:
    transform 0.5s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.work__shot img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.work__meta {
  margin-top: 14px;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.work__num {
  flex: none;
  font-family: var(--font-mono);
  font-variation-settings: normal;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: -0.04em;
  color: var(--color-muted);
  font-variant-numeric: tabular-nums;
}

.work__name {
  flex: 1;
  min-width: 0;
  font-size: 18px;
  line-height: 22px;
  font-weight: 500;
  letter-spacing: -0.03em;
  color: var(--color-heading);
}

.work__arrow {
  flex: none;
  align-self: center;
  width: 16px;
  height: 16px;
  color: var(--color-muted);
  transition:
    transform 0.45s cubic-bezier(0.16, 1, 0.3, 1),
    color 0.3s;
}

.work__desc {
  margin-top: 4px;
  font-size: 14px;
  line-height: 19px;
  font-weight: 500;
  color: var(--color-muted);
}

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

.work:focus-visible .work__shot {
  box-shadow: 0 0 0 2px var(--color-accent);
}

.works-cta {
  position: relative;
  z-index: 10;
  padding: 88px 12px 72px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.works-cta .actions {
  margin-top: 24px;
}

@media (hover: hover) {
  .back:hover {
    color: var(--color-ink);
  }

  .work:hover .work__shot {
    transform: translateY(-4px);
    box-shadow:
      0 0 0 1px var(--color-rule),
      0 24px 40px -24px rgb(0 0 0 / 0.35);
  }

  .work:hover .work__shot img {
    transform: scale(1.03);
  }

  .work:hover .work__arrow {
    color: var(--color-accent);
    transform: translate(2px, -2px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .work__shot,
  .work__shot img,
  .work__arrow {
    transition: none;
  }
}

@media (min-width: 820px) {
  .back {
    left: 52px;
    top: 46px;
  }

  .works {
    max-width: 916px;
    padding: 136px 24px 0;
  }

  .works__group {
    margin-top: 72px;
  }

  .works__grid {
    margin-top: 56px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 48px 20px;
  }

  .work__shot {
    border-radius: 18px;
  }

  .work__desc {
    font-size: 15px;
    line-height: 21px;
  }

  .works-cta {
    padding: 120px 24px 140px;
  }
}

/* Keeps the grid inside the desktop frame guides */
@media (min-width: 1200px) {
  .works {
    max-width: calc(2 * var(--frame-half));
  }
}
